-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
513 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const path = require("node:path"); | ||
|
||
module.exports = { | ||
plugins: ["kuzzle", "jest"], | ||
extends: [ | ||
"plugin:kuzzle/default", | ||
"plugin:kuzzle/node", | ||
"plugin:kuzzle/typescript", | ||
"plugin:jest/recommended", | ||
"plugin:jest/style", | ||
], | ||
parserOptions: { | ||
project: path.join(__dirname, "tsconfig.test.json"), | ||
}, | ||
overrides: [ | ||
{ | ||
files: [ | ||
".eslintrc.cjs", | ||
"**/roles/*.ts", | ||
"**/collections/*.ts", | ||
"**tests/**/*.ts", | ||
], | ||
rules: { | ||
"sort-keys": ["off"], | ||
}, | ||
}, | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"printWidth": 100, | ||
"tabWidth": 2, | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* eslint-disable sort-keys */ | ||
import SemanticReleaseError from '@semantic-release/error'; | ||
|
||
export const ERROR_DEFINITIONS = { | ||
EINVALIDNPMPUBLISH({ npmPublish }) { | ||
return { | ||
message: 'Invalid `npmPublish` option.', | ||
details: `If the npmPublish option defined, must be a \`Boolean\`. | ||
Your configuration for the \`npmPublish\` option is \`${npmPublish}\`.`, | ||
}; | ||
}, | ||
ENONPMTOKEN({ registry }) { | ||
return { | ||
message: 'No npm token specified.', | ||
details: `An npm token must be created and set in the \`NPM_TOKEN\` environment variable on your CI environment. | ||
Please make sure to create an [npm token](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) and to set it in the \`NPM_TOKEN\` environment variable on your CI environment. The token must allow to publish to the registry \`${registry}\`.`, | ||
}; | ||
}, | ||
EINVALIDNPMTOKEN({ registry }) { | ||
return { | ||
message: 'Invalid npm token.', | ||
details: `The npm token configured in the \`NPM_TOKEN\` environment variable must be a valid [token](https://docs.npmjs.com/getting-started/working_with_tokens) allowing to publish to the registry \`${registry}\`. | ||
If you are using Two Factor Authentication for your account, set its level to ["Authorization only"](https://docs.npmjs.com/getting-started/using-two-factor-authentication#levels-of-authentication) in your account settings. **semantic-release** cannot publish with the default " | ||
Authorization and writes" level. | ||
Please make sure to set the \`NPM_TOKEN\` environment variable in your CI with the exact value of the npm token.`, | ||
}; | ||
}, | ||
ENOPKGNAME() { | ||
return { | ||
message: 'Missing `name` property in `package.json`.', | ||
details: `The \`package.json\`'s [name](https://docs.npmjs.com/files/package.json#name) property is required in order to publish a package to the npm registry. | ||
Please make sure to add a valid \`name\` for your package in your \`package.json\`.`, | ||
}; | ||
}, | ||
ENOPKG() { | ||
return { | ||
message: 'Missing `package.json` file.', | ||
details: `A [package.json file](https://docs.npmjs.com/files/package.json) at the root of your project is required to release on npm. | ||
Please follow the [npm guideline](https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid \`package.json\` file.`, | ||
}; | ||
}, | ||
}; | ||
|
||
export function getError(code, ctx = {}) { | ||
const { message, details } = ERROR_DEFINITIONS[code](ctx); | ||
|
||
return new SemanticReleaseError(message, code, details); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './error.mjs'; | ||
export * from './package.mjs'; | ||
export * from './registry.mjs'; |
Oops, something went wrong.