@anolilab/semantic-release-pnpm 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/index.js +73 -109
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## @anolilab/semantic-release-pnpm [2.0.5](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@2.0.4...@anolilab/semantic-release-pnpm@2.0.5) (2025-11-01)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* update package dependencies and configurations ([d94ebd8](https://github.com/anolilab/semantic-release/commit/d94ebd8869c34106aa0c11beb0f7410bbc86367f))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Dependencies
|
|
9
|
+
|
|
10
|
+
* **@anolilab/rc:** upgraded to 2.0.5
|
|
11
|
+
|
|
1
12
|
## @anolilab/semantic-release-pnpm [2.0.4](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@2.0.3...@anolilab/semantic-release-pnpm@2.0.4) (2025-09-22)
|
|
2
13
|
|
|
3
14
|
### Bug Fixes
|
package/dist/index.js
CHANGED
|
@@ -10,9 +10,7 @@ import { stringify } from 'ini';
|
|
|
10
10
|
import getAuthToken from 'registry-auth-token';
|
|
11
11
|
import { URL } from 'node:url';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
var __name$h = (target, value) => __defProp$h(target, "name", { value, configurable: true });
|
|
15
|
-
const getChannel = /* @__PURE__ */ __name$h((channel) => {
|
|
13
|
+
const getChannel = (channel) => {
|
|
16
14
|
if (!channel) {
|
|
17
15
|
return "latest";
|
|
18
16
|
}
|
|
@@ -20,11 +18,9 @@ const getChannel = /* @__PURE__ */ __name$h((channel) => {
|
|
|
20
18
|
return `release-${channel}`;
|
|
21
19
|
}
|
|
22
20
|
return channel;
|
|
23
|
-
}
|
|
21
|
+
};
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
var __name$g = (target, value) => __defProp$g(target, "name", { value, configurable: true });
|
|
27
|
-
const getNpmrcPath = /* @__PURE__ */ __name$g((cwd, environment) => {
|
|
23
|
+
const getNpmrcPath = (cwd, environment) => {
|
|
28
24
|
const npmrcPath = resolve(cwd, ".npmrc");
|
|
29
25
|
if (environment.NPM_CONFIG_USERCONFIG && isAccessibleSync(environment.NPM_CONFIG_USERCONFIG)) {
|
|
30
26
|
return environment.NPM_CONFIG_USERCONFIG;
|
|
@@ -34,13 +30,11 @@ const getNpmrcPath = /* @__PURE__ */ __name$g((cwd, environment) => {
|
|
|
34
30
|
}
|
|
35
31
|
ensureFileSync(npmrcPath);
|
|
36
32
|
return npmrcPath;
|
|
37
|
-
}
|
|
33
|
+
};
|
|
38
34
|
|
|
39
35
|
const DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org/";
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
var __name$f = (target, value) => __defProp$f(target, "name", { value, configurable: true });
|
|
43
|
-
const getRegistryUrl = /* @__PURE__ */ __name$f((scope, npmrc) => {
|
|
37
|
+
const getRegistryUrl = (scope, npmrc) => {
|
|
44
38
|
let url = DEFAULT_NPM_REGISTRY;
|
|
45
39
|
if (npmrc) {
|
|
46
40
|
const registryUrl = npmrc[`${scope}:registry`] ?? npmrc.registry;
|
|
@@ -49,29 +43,25 @@ const getRegistryUrl = /* @__PURE__ */ __name$f((scope, npmrc) => {
|
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
45
|
return url.endsWith("/") ? url : `${url}/`;
|
|
52
|
-
}
|
|
53
|
-
const getRegistry =
|
|
46
|
+
};
|
|
47
|
+
const getRegistry = ({ name, publishConfig: { registry } = {} }, { cwd, env }) => registry ?? env.NPM_CONFIG_REGISTRY ?? getRegistryUrl(
|
|
54
48
|
name.split("/")[0],
|
|
55
49
|
rc("npm", {
|
|
56
50
|
config: env.NPM_CONFIG_USERCONFIG ?? resolve(cwd, ".npmrc"),
|
|
57
51
|
cwd,
|
|
58
52
|
defaults: { registry: "https://registry.npmjs.org/" }
|
|
59
53
|
}).config
|
|
60
|
-
)
|
|
54
|
+
);
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
var __name$e = (target, value) => __defProp$e(target, "name", { value, configurable: true });
|
|
64
|
-
const getReleaseInfo = /* @__PURE__ */ __name$e(({ name }, { env: { DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org/" }, nextRelease: { version } }, distributionTag, registry) => {
|
|
56
|
+
const getReleaseInfo = ({ name }, { env: { DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org/" }, nextRelease: { version } }, distributionTag, registry) => {
|
|
65
57
|
return {
|
|
66
58
|
channel: distributionTag,
|
|
67
59
|
name: `pnpm package (@${distributionTag} dist-tag)`,
|
|
68
60
|
url: normalizeUrl(registry) === normalizeUrl(DEFAULT_NPM_REGISTRY) ? `https://www.npmjs.com/package/${name}/v/${version}` : void 0
|
|
69
61
|
};
|
|
70
|
-
}
|
|
62
|
+
};
|
|
71
63
|
|
|
72
|
-
|
|
73
|
-
var __name$d = (target, value) => __defProp$d(target, "name", { value, configurable: true });
|
|
74
|
-
const reasonToNotPublish = /* @__PURE__ */ __name$d((pluginConfig, package_) => {
|
|
64
|
+
const reasonToNotPublish = (pluginConfig, package_) => {
|
|
75
65
|
if (pluginConfig.npmPublish === false) {
|
|
76
66
|
return "npmPublish plugin option is false";
|
|
77
67
|
}
|
|
@@ -79,12 +69,10 @@ const reasonToNotPublish = /* @__PURE__ */ __name$d((pluginConfig, package_) =>
|
|
|
79
69
|
return "package is private and has no workspaces";
|
|
80
70
|
}
|
|
81
71
|
return null;
|
|
82
|
-
}
|
|
83
|
-
const shouldPublish =
|
|
72
|
+
};
|
|
73
|
+
const shouldPublish = (pluginConfig, package_) => reasonToNotPublish(pluginConfig, package_) === null;
|
|
84
74
|
|
|
85
|
-
|
|
86
|
-
var __name$c = (target, value) => __defProp$c(target, "name", { value, configurable: true });
|
|
87
|
-
const addChannel$1 = /* @__PURE__ */ __name$c(async (pluginConfig, packageJson, context) => {
|
|
75
|
+
const addChannel$1 = async (pluginConfig, packageJson, context) => {
|
|
88
76
|
const {
|
|
89
77
|
cwd,
|
|
90
78
|
env,
|
|
@@ -111,11 +99,9 @@ const addChannel$1 = /* @__PURE__ */ __name$c(async (pluginConfig, packageJson,
|
|
|
111
99
|
}
|
|
112
100
|
logger.log(`Skip adding to npm channel as ${reasonToNotPublish(pluginConfig, packageJson)}`);
|
|
113
101
|
return false;
|
|
114
|
-
}
|
|
102
|
+
};
|
|
115
103
|
|
|
116
|
-
|
|
117
|
-
var __name$b = (target, value) => __defProp$b(target, "name", { value, configurable: true });
|
|
118
|
-
const prepare$1 = /* @__PURE__ */ __name$b(async ({ pkgRoot, tarballDir }, { cwd, env, logger, nextRelease: { version }, stderr, stdout }) => {
|
|
104
|
+
const prepare$1 = async ({ pkgRoot, tarballDir }, { cwd, env, logger, nextRelease: { version }, stderr, stdout }) => {
|
|
119
105
|
const basePath = pkgRoot ? resolve(cwd, pkgRoot) : cwd;
|
|
120
106
|
logger.log("Write version %s to package.json in %s", version, basePath);
|
|
121
107
|
const versionResult = execa("pnpm", ["version", version, "--no-git-tag-version", "--allow-same-version"], {
|
|
@@ -138,11 +124,9 @@ const prepare$1 = /* @__PURE__ */ __name$b(async ({ pkgRoot, tarballDir }, { cwd
|
|
|
138
124
|
await move(tarballSource, tarballDestination);
|
|
139
125
|
}
|
|
140
126
|
}
|
|
141
|
-
}
|
|
127
|
+
};
|
|
142
128
|
|
|
143
|
-
|
|
144
|
-
var __name$a = (target, value) => __defProp$a(target, "name", { value, configurable: true });
|
|
145
|
-
const publish$1 = /* @__PURE__ */ __name$a(async (pluginConfig, packageJson, context) => {
|
|
129
|
+
const publish$1 = async (pluginConfig, packageJson, context) => {
|
|
146
130
|
const {
|
|
147
131
|
cwd,
|
|
148
132
|
env,
|
|
@@ -187,31 +171,29 @@ const publish$1 = /* @__PURE__ */ __name$a(async (pluginConfig, packageJson, con
|
|
|
187
171
|
}
|
|
188
172
|
logger.log(`Skip publishing to npm registry as ${reasonToNotPublish(pluginConfig, packageJson)}`);
|
|
189
173
|
return false;
|
|
190
|
-
}
|
|
174
|
+
};
|
|
191
175
|
|
|
192
176
|
const homepage = "https://github.com/anolilab/semantic-release/tree/main/packages/semantic-release-pnpm";
|
|
193
177
|
const packageJson = {
|
|
194
178
|
homepage: homepage};
|
|
195
179
|
|
|
196
|
-
|
|
197
|
-
var __name$9 = (target, value) => __defProp$9(target, "name", { value, configurable: true });
|
|
198
|
-
const linkify = /* @__PURE__ */ __name$9((file) => `${packageJson.homepage}/blob/main/${file}`, "linkify");
|
|
180
|
+
const linkify = (file) => `${packageJson.homepage}/blob/main/${file}`;
|
|
199
181
|
const errors = {
|
|
200
|
-
EINVALIDBRANCHES:
|
|
182
|
+
EINVALIDBRANCHES: (branches) => {
|
|
201
183
|
return {
|
|
202
184
|
details: `The [branches option](${linkify("README.md#branches")}) option, if defined, must be an array of \`String\`.
|
|
203
185
|
Your configuration for the \`branches\` option is \`${branches.join(",")}\`.`,
|
|
204
186
|
message: "Invalid `branches` option."
|
|
205
187
|
};
|
|
206
|
-
},
|
|
207
|
-
EINVALIDNPMPUBLISH:
|
|
188
|
+
},
|
|
189
|
+
EINVALIDNPMPUBLISH: ({ npmPublish }) => {
|
|
208
190
|
return {
|
|
209
191
|
details: `The [npmPublish option](${linkify("README.md#npmpublish")}) option, if defined, must be a \`Boolean\`.
|
|
210
192
|
Your configuration for the \`npmPublish\` option is \`${String(npmPublish)}\`.`,
|
|
211
193
|
message: "Invalid `npmPublish` option."
|
|
212
194
|
};
|
|
213
|
-
},
|
|
214
|
-
EINVALIDNPMTOKEN:
|
|
195
|
+
},
|
|
196
|
+
EINVALIDNPMTOKEN: ({ registry }) => {
|
|
215
197
|
return {
|
|
216
198
|
details: `The [npm token](${linkify(
|
|
217
199
|
"README.md#npm-registry-authentication"
|
|
@@ -220,15 +202,15 @@ If you are using Two Factor Authentication for your account, set its level to ["
|
|
|
220
202
|
Please make sure to set the \`NPM_TOKEN\` environment variable in your CI with the exact value of the npm token.`,
|
|
221
203
|
message: "Invalid npm token."
|
|
222
204
|
};
|
|
223
|
-
},
|
|
224
|
-
EINVALIDPKGROOT:
|
|
205
|
+
},
|
|
206
|
+
EINVALIDPKGROOT: ({ pkgRoot }) => {
|
|
225
207
|
return {
|
|
226
208
|
details: `The [pkgRoot option](${linkify("README.md#pkgroot")}) option, if defined, must be a \`String\`.
|
|
227
209
|
Your configuration for the \`pkgRoot\` option is \`${String(pkgRoot)}\`.`,
|
|
228
210
|
message: "Invalid `pkgRoot` option."
|
|
229
211
|
};
|
|
230
|
-
},
|
|
231
|
-
EINVALIDPNPM:
|
|
212
|
+
},
|
|
213
|
+
EINVALIDPNPM: ({ version }) => {
|
|
232
214
|
return {
|
|
233
215
|
details: `The version of Pnpm that you are using is not compatible. Please refer to [the README](${linkify(
|
|
234
216
|
"README.md#install"
|
|
@@ -237,22 +219,22 @@ Your configuration for the \`pkgRoot\` option is \`${String(pkgRoot)}\`.`,
|
|
|
237
219
|
Your version of Pnpm is "${String(version)}".`,
|
|
238
220
|
message: "Incompatible Pnpm version detected."
|
|
239
221
|
};
|
|
240
|
-
},
|
|
241
|
-
EINVALIDPUBLISHBRANCH:
|
|
222
|
+
},
|
|
223
|
+
EINVALIDPUBLISHBRANCH: ({ publishBranch }) => {
|
|
242
224
|
return {
|
|
243
225
|
details: `The [publishBranch option](${linkify("README.md#publishBranch")}) option, if defined, must be a \`String\`.
|
|
244
226
|
Your configuration for the \`publishBranch\` option is \`${String(publishBranch)}\`.`,
|
|
245
227
|
message: "Invalid `publishBranch` option."
|
|
246
228
|
};
|
|
247
|
-
},
|
|
248
|
-
EINVALIDTARBALLDIR:
|
|
229
|
+
},
|
|
230
|
+
EINVALIDTARBALLDIR: ({ tarballDir }) => {
|
|
249
231
|
return {
|
|
250
232
|
details: `The [tarballDir option](${linkify("README.md#tarballdir")}) option, if defined, must be a \`String\`.
|
|
251
233
|
Your configuration for the \`tarballDir\` option is \`${String(tarballDir)}\`.`,
|
|
252
234
|
message: "Invalid `tarballDir` option."
|
|
253
235
|
};
|
|
254
|
-
},
|
|
255
|
-
ENONPMTOKEN:
|
|
236
|
+
},
|
|
237
|
+
ENONPMTOKEN: ({ registry }) => {
|
|
256
238
|
return {
|
|
257
239
|
details: `An [npm token](${linkify(
|
|
258
240
|
"README.md#npm-registry-authentication"
|
|
@@ -260,45 +242,41 @@ Your configuration for the \`tarballDir\` option is \`${String(tarballDir)}\`.`,
|
|
|
260
242
|
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 \`${String(registry)}\`.`,
|
|
261
243
|
message: "No npm token specified."
|
|
262
244
|
};
|
|
263
|
-
},
|
|
264
|
-
ENOPKG:
|
|
245
|
+
},
|
|
246
|
+
ENOPKG: () => {
|
|
265
247
|
return {
|
|
266
248
|
details: `A [package.json file](https://docs.npmjs.com/files/package.json) at the root of your project is required to release on npm.
|
|
267
249
|
Please follow the [npm guideline](https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid \`package.json\` file.`,
|
|
268
250
|
message: "Missing `package.json` file."
|
|
269
251
|
};
|
|
270
|
-
},
|
|
271
|
-
ENOPKGNAME:
|
|
252
|
+
},
|
|
253
|
+
ENOPKGNAME: () => {
|
|
272
254
|
return {
|
|
273
255
|
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.
|
|
274
256
|
Please make sure to add a valid \`name\` for your package in your \`package.json\`.`,
|
|
275
257
|
message: "Missing `name` property in `package.json`."
|
|
276
258
|
};
|
|
277
|
-
},
|
|
278
|
-
ENOPNPM:
|
|
259
|
+
},
|
|
260
|
+
ENOPNPM: () => {
|
|
279
261
|
return {
|
|
280
262
|
details: `The Pnpm CLI could not be found in your PATH. Make sure Pnpm is installed and try again.`,
|
|
281
263
|
message: "Pnpm not found."
|
|
282
264
|
};
|
|
283
|
-
},
|
|
284
|
-
ENOPNPMRC:
|
|
265
|
+
},
|
|
266
|
+
ENOPNPMRC: () => {
|
|
285
267
|
return {
|
|
286
268
|
details: `Didnt find a \`.npmrc\` file or it was not possible to create , in the root of your project.`,
|
|
287
269
|
message: "Missing `.npmrc` file."
|
|
288
270
|
};
|
|
289
|
-
}
|
|
271
|
+
}
|
|
290
272
|
};
|
|
291
273
|
|
|
292
|
-
|
|
293
|
-
var __name$8 = (target, value) => __defProp$8(target, "name", { value, configurable: true });
|
|
294
|
-
const getError = /* @__PURE__ */ __name$8((code, context = {}) => {
|
|
274
|
+
const getError = (code, context = {}) => {
|
|
295
275
|
const { details, message } = errors[code](context);
|
|
296
276
|
return new SemanticReleaseError(message, code, details);
|
|
297
|
-
}
|
|
277
|
+
};
|
|
298
278
|
|
|
299
|
-
|
|
300
|
-
var __name$7 = (target, value) => __defProp$7(target, "name", { value, configurable: true });
|
|
301
|
-
const getPackage = /* @__PURE__ */ __name$7(async ({ pkgRoot }, { cwd }) => {
|
|
279
|
+
const getPackage = async ({ pkgRoot }, { cwd }) => {
|
|
302
280
|
try {
|
|
303
281
|
const { packageJson } = await findPackageJson(pkgRoot ? resolve(cwd, pkgRoot) : cwd);
|
|
304
282
|
if (!packageJson.name) {
|
|
@@ -313,20 +291,16 @@ const getPackage = /* @__PURE__ */ __name$7(async ({ pkgRoot }, { cwd }) => {
|
|
|
313
291
|
}
|
|
314
292
|
throw error;
|
|
315
293
|
}
|
|
316
|
-
}
|
|
294
|
+
};
|
|
317
295
|
|
|
318
|
-
|
|
319
|
-
var __name$6 = (target, value) => __defProp$6(target, "name", { value, configurable: true });
|
|
320
|
-
const nerfDart = /* @__PURE__ */ __name$6((url) => {
|
|
296
|
+
const nerfDart = (url) => {
|
|
321
297
|
const parsed = new URL(url);
|
|
322
298
|
const from = `${parsed.protocol}//${parsed.host}${parsed.pathname}`;
|
|
323
299
|
const real = new URL(".", from);
|
|
324
300
|
return `//${real.host}${real.pathname}`;
|
|
325
|
-
}
|
|
301
|
+
};
|
|
326
302
|
|
|
327
|
-
|
|
328
|
-
var __name$5 = (target, value) => __defProp$5(target, "name", { value, configurable: true });
|
|
329
|
-
const setNpmrcAuth = /* @__PURE__ */ __name$5(async (npmrc, registry, { cwd, env: { NPM_CONFIG_USERCONFIG, NPM_EMAIL, NPM_PASSWORD, NPM_TOKEN, NPM_USERNAME }, logger }) => {
|
|
303
|
+
const setNpmrcAuth = async (npmrc, registry, { cwd, env: { NPM_CONFIG_USERCONFIG, NPM_EMAIL, NPM_PASSWORD, NPM_TOKEN, NPM_USERNAME }, logger }) => {
|
|
330
304
|
logger.log("Verify authentication for registry %s", registry);
|
|
331
305
|
const { config, files } = rc("npm", {
|
|
332
306
|
config: NPM_CONFIG_USERCONFIG ?? resolve(cwd, ".npmrc"),
|
|
@@ -353,11 +327,9 @@ email = \${NPM_EMAIL}`);
|
|
|
353
327
|
const semanticError = getError("ENONPMTOKEN", { registry });
|
|
354
328
|
throw new AggregateError([semanticError], semanticError.message);
|
|
355
329
|
}
|
|
356
|
-
}
|
|
330
|
+
};
|
|
357
331
|
|
|
358
|
-
|
|
359
|
-
var __name$4 = (target, value) => __defProp$4(target, "name", { value, configurable: true });
|
|
360
|
-
const verifyAuth = /* @__PURE__ */ __name$4(async (npmrc, package_, context) => {
|
|
332
|
+
const verifyAuth = async (npmrc, package_, context) => {
|
|
361
333
|
const {
|
|
362
334
|
cwd,
|
|
363
335
|
env: { DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org/", ...environment },
|
|
@@ -385,27 +357,25 @@ const verifyAuth = /* @__PURE__ */ __name$4(async (npmrc, package_, context) =>
|
|
|
385
357
|
} else {
|
|
386
358
|
logger.log(`Skipping authentication verification for non-default registry "${registry}"`);
|
|
387
359
|
}
|
|
388
|
-
}
|
|
360
|
+
};
|
|
389
361
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
const
|
|
393
|
-
const isNil = /* @__PURE__ */ __name$3((value) => value === null || value === void 0, "isNil");
|
|
394
|
-
const isNonEmptyString = /* @__PURE__ */ __name$3((value) => {
|
|
362
|
+
const isString = (value) => typeof value === "string";
|
|
363
|
+
const isNil = (value) => value === null || value === void 0;
|
|
364
|
+
const isNonEmptyString = (value) => {
|
|
395
365
|
if (!isString(value)) {
|
|
396
366
|
return false;
|
|
397
367
|
}
|
|
398
368
|
return value.trim() !== "";
|
|
399
|
-
}
|
|
369
|
+
};
|
|
400
370
|
const VALIDATORS = {
|
|
401
371
|
branches: Array.isArray,
|
|
402
372
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
403
|
-
npmPublish:
|
|
373
|
+
npmPublish: (value) => typeof value === "boolean",
|
|
404
374
|
pkgRoot: isNonEmptyString,
|
|
405
375
|
publishBranch: isNonEmptyString,
|
|
406
376
|
tarballDir: isNonEmptyString
|
|
407
377
|
};
|
|
408
|
-
const verifyConfig =
|
|
378
|
+
const verifyConfig = (config) => (
|
|
409
379
|
// eslint-disable-next-line unicorn/no-array-reduce
|
|
410
380
|
Object.entries(config).reduce((errors, [option, value]) => {
|
|
411
381
|
if (isNil(value)) {
|
|
@@ -419,23 +389,19 @@ const verifyConfig = /* @__PURE__ */ __name$3((config) => (
|
|
|
419
389
|
}
|
|
420
390
|
return [...errors, getError(`EINVALID${option.toUpperCase()}`, { [option]: value })];
|
|
421
391
|
}, [])
|
|
422
|
-
)
|
|
392
|
+
);
|
|
423
393
|
|
|
424
|
-
var __defProp$2 = Object.defineProperty;
|
|
425
|
-
var __name$2 = (target, value) => __defProp$2(target, "name", { value, configurable: true });
|
|
426
394
|
const MIN_PNPM_VERSION = "8.0.0";
|
|
427
|
-
const verifyPnpm =
|
|
395
|
+
const verifyPnpm = async ({ logger }) => {
|
|
428
396
|
logger.log(`Verify pnpm version is >= ${MIN_PNPM_VERSION}`);
|
|
429
397
|
const version = getPackageManagerVersion("pnpm");
|
|
430
398
|
if (gte(MIN_PNPM_VERSION, version)) {
|
|
431
399
|
const semanticError = getError("EINVALIDPNPM", { version: String(version) });
|
|
432
400
|
throw new AggregateError([semanticError], semanticError.message);
|
|
433
401
|
}
|
|
434
|
-
}
|
|
402
|
+
};
|
|
435
403
|
|
|
436
|
-
|
|
437
|
-
var __name$1 = (target, value) => __defProp$1(target, "name", { value, configurable: true });
|
|
438
|
-
const verify = /* @__PURE__ */ __name$1(async (pluginConfig, context) => {
|
|
404
|
+
const verify = async (pluginConfig, context) => {
|
|
439
405
|
let errors = verifyConfig(pluginConfig);
|
|
440
406
|
let errorsMessage = "";
|
|
441
407
|
try {
|
|
@@ -459,14 +425,12 @@ const verify = /* @__PURE__ */ __name$1(async (pluginConfig, context) => {
|
|
|
459
425
|
if (errors.length > 0) {
|
|
460
426
|
throw new AggregateError(errors, errorsMessage);
|
|
461
427
|
}
|
|
462
|
-
}
|
|
428
|
+
};
|
|
463
429
|
|
|
464
|
-
var __defProp = Object.defineProperty;
|
|
465
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
466
430
|
const PLUGIN_NAME = "semantic-release-pnpm";
|
|
467
431
|
let verified;
|
|
468
432
|
let prepared;
|
|
469
|
-
const verifyConditions =
|
|
433
|
+
const verifyConditions = async (pluginConfig, context) => {
|
|
470
434
|
if (context.options.publish) {
|
|
471
435
|
const publish2 = Array.isArray(context.options.publish) ? context.options.publish : [context.options.publish];
|
|
472
436
|
const publishPlugin = publish2.find((config) => config.path && config.path === PLUGIN_NAME) || {};
|
|
@@ -478,15 +442,15 @@ const verifyConditions = /* @__PURE__ */ __name(async (pluginConfig, context) =>
|
|
|
478
442
|
}
|
|
479
443
|
await verify(pluginConfig, context);
|
|
480
444
|
verified = true;
|
|
481
|
-
}
|
|
482
|
-
const prepare =
|
|
445
|
+
};
|
|
446
|
+
const prepare = async (pluginConfig, context) => {
|
|
483
447
|
if (!verified) {
|
|
484
448
|
await verify(pluginConfig, context);
|
|
485
449
|
}
|
|
486
450
|
await prepare$1(pluginConfig, context);
|
|
487
451
|
prepared = true;
|
|
488
|
-
}
|
|
489
|
-
const publish =
|
|
452
|
+
};
|
|
453
|
+
const publish = async (pluginConfig, context) => {
|
|
490
454
|
const packageJson = await getPackage(pluginConfig, context);
|
|
491
455
|
if (!verified) {
|
|
492
456
|
await verify(pluginConfig, context);
|
|
@@ -495,13 +459,13 @@ const publish = /* @__PURE__ */ __name(async (pluginConfig, context) => {
|
|
|
495
459
|
await prepare$1(pluginConfig, context);
|
|
496
460
|
}
|
|
497
461
|
return await publish$1(pluginConfig, packageJson, context);
|
|
498
|
-
}
|
|
499
|
-
const addChannel =
|
|
462
|
+
};
|
|
463
|
+
const addChannel = async (pluginConfig, context) => {
|
|
500
464
|
if (!verified) {
|
|
501
465
|
await verify(pluginConfig, context);
|
|
502
466
|
}
|
|
503
467
|
const packageJson = await getPackage(pluginConfig, context);
|
|
504
468
|
return await addChannel$1(pluginConfig, packageJson, context);
|
|
505
|
-
}
|
|
469
|
+
};
|
|
506
470
|
|
|
507
471
|
export { addChannel, prepare, publish, verifyConditions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/semantic-release-pnpm",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Semantic-release plugin to publish a npm package with pnpm.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -46,16 +46,16 @@
|
|
|
46
46
|
"dist"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@anolilab/rc": "2.0.
|
|
49
|
+
"@anolilab/rc": "2.0.5",
|
|
50
50
|
"@semantic-release/error": "^4.0.0",
|
|
51
|
-
"@visulima/fs": "^
|
|
52
|
-
"@visulima/package": "^
|
|
53
|
-
"@visulima/path": "^
|
|
51
|
+
"@visulima/fs": "^4.0.2",
|
|
52
|
+
"@visulima/package": "^4.1.2",
|
|
53
|
+
"@visulima/path": "^2.0.1",
|
|
54
54
|
"execa": "^9.6.0",
|
|
55
|
-
"ini": "^
|
|
55
|
+
"ini": "^6.0.0",
|
|
56
56
|
"normalize-url": "^8.1.0",
|
|
57
57
|
"registry-auth-token": "^5.1.0",
|
|
58
|
-
"semver": "^7.7.
|
|
58
|
+
"semver": "^7.7.3"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=20.8.1"
|