You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BREAKING CHANGE: `@semantic-release/npm` is now a native ES Module. It
has named exports for each plugin hook (`verifyConditions`, `prepare`,
`publish`, `addChannel`)
// If the npm publish plugin is used and has `npmPublish`, `tarballDir` or `pkgRoot` configured, validate them now in order to prevent any release if the configuration is wrong
18
18
if(context.options.publish){
19
19
constpublishPlugin=
@@ -46,7 +46,7 @@ async function verifyConditions(pluginConfig, context) {
details: `The [npmPublish option](${linkify('README.md#npmpublish')}) option, if defined, must be a \`Boolean\`.
10
14
11
15
Your configuration for the \`npmPublish\` option is \`${npmPublish}\`.`,
12
-
}),
13
-
EINVALIDTARBALLDIR: ({tarballDir})=>({
16
+
};
17
+
}
18
+
19
+
exportfunctionEINVALIDTARBALLDIR({ tarballDir }){
20
+
return{
14
21
message: 'Invalid `tarballDir` option.',
15
22
details: `The [tarballDir option](${linkify('README.md#tarballdir')}) option, if defined, must be a \`String\`.
16
23
17
24
Your configuration for the \`tarballDir\` option is \`${tarballDir}\`.`,
18
-
}),
19
-
EINVALIDPKGROOT: ({pkgRoot})=>({
25
+
};
26
+
}
27
+
28
+
exportfunctionEINVALIDPKGROOT({ pkgRoot }){
29
+
return{
20
30
message: 'Invalid `pkgRoot` option.',
21
31
details: `The [pkgRoot option](${linkify('README.md#pkgroot')}) option, if defined, must be a \`String\`.
22
32
23
33
Your configuration for the \`pkgRoot\` option is \`${pkgRoot}\`.`,
24
-
}),
25
-
ENONPMTOKEN: ({registry})=>({
34
+
};
35
+
}
36
+
37
+
exportfunctionENONPMTOKEN({ registry }){
38
+
return{
26
39
message: 'No npm token specified.',
27
40
details: `An [npm token](${linkify(
28
41
'README.md#npm-registry-authentication'
29
42
)}) must be created and set in the \`NPM_TOKEN\` environment variable on your CI environment.
30
43
31
44
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}\`.`,
32
-
}),
33
-
EINVALIDNPMTOKEN: ({registry})=>({
45
+
};
46
+
}
47
+
48
+
exportfunctionEINVALIDNPMTOKEN({ registry }){
49
+
return{
34
50
message: 'Invalid npm token.',
35
51
details: `The [npm token](${linkify(
36
52
'README.md#npm-registry-authentication'
@@ -40,17 +56,23 @@ If you are using Two Factor Authentication for your account, set its level to ["
40
56
Authorization and writes" level.
41
57
42
58
Please make sure to set the \`NPM_TOKEN\` environment variable in your CI with the exact value of the npm token.`,
43
-
}),
44
-
ENOPKGNAME: ()=>({
59
+
};
60
+
}
61
+
62
+
exportfunctionENOPKGNAME(){
63
+
return{
45
64
message: 'Missing `name` property in `package.json`.',
46
65
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.
47
66
48
67
Please make sure to add a valid \`name\` for your package in your \`package.json\`.`,
49
-
}),
50
-
ENOPKG: ()=>({
68
+
};
69
+
}
70
+
71
+
exportfunctionENOPKG(){
72
+
return{
51
73
message: 'Missing `package.json` file.',
52
74
details: `A [package.json file](https://docs.npmjs.com/files/package.json) at the root of your project is required to release on npm.
53
75
54
76
Please follow the [npm guideline](https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid \`package.json\` file.`,
0 commit comments