@anolilab/semantic-release-pnpm 2.0.3 → 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 CHANGED
@@ -1,3 +1,34 @@
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
+
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)
13
+
14
+ ### Bug Fixes
15
+
16
+ * **deps:** update dependencies across multiple packages ([150593f](https://github.com/anolilab/semantic-release/commit/150593fec51e1646e8bc5d8aa9db76a8370d42c1))
17
+ * **deps:** update dependencies and configurations across multiple packages ([414ca97](https://github.com/anolilab/semantic-release/commit/414ca976b2432a2d9fb300c746ee1eebfa4361a1))
18
+ * update dependencies and configuration across multiple packages ([9c9b4cb](https://github.com/anolilab/semantic-release/commit/9c9b4cb5b1f9e172f2e1ce509491b950ae448c09))
19
+ * update dependencies and improve configuration ([de0cf70](https://github.com/anolilab/semantic-release/commit/de0cf702c2c5217203409b475f96061702806475))
20
+ * update Nx version and adjust package configurations ([d39ef78](https://github.com/anolilab/semantic-release/commit/d39ef78b608486214ca3a73c5903c00798e7c456))
21
+ * update package dependencies and configurations ([8241a76](https://github.com/anolilab/semantic-release/commit/8241a762582a25742d385d8cf113851ac8b9b801))
22
+
23
+ ### Code Refactoring
24
+
25
+ * simplify packem configuration and improve comments ([592de5b](https://github.com/anolilab/semantic-release/commit/592de5b367a448974fc41fd7336e01ba4865a4cf))
26
+
27
+
28
+ ### Dependencies
29
+
30
+ * **@anolilab/rc:** upgraded to 2.0.4
31
+
1
32
  ## @anolilab/semantic-release-pnpm [2.0.3](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@2.0.2...@anolilab/semantic-release-pnpm@2.0.3) (2025-07-31)
2
33
 
3
34
  ### Bug Fixes
@@ -10,13 +10,17 @@ import { stringify } from 'ini';
10
10
  import getAuthToken from 'registry-auth-token';
11
11
  import { URL } from 'node:url';
12
12
 
13
- var __defProp$h = Object.defineProperty;
14
- var __name$h = (target, value) => __defProp$h(target, "name", { value, configurable: true });
15
- const getChannel = /* @__PURE__ */ __name$h((channel) => channel ? validRange(channel) ? `release-${channel}` : channel : "latest", "default");
13
+ const getChannel = (channel) => {
14
+ if (!channel) {
15
+ return "latest";
16
+ }
17
+ if (validRange(channel)) {
18
+ return `release-${channel}`;
19
+ }
20
+ return channel;
21
+ };
16
22
 
17
- var __defProp$g = Object.defineProperty;
18
- var __name$g = (target, value) => __defProp$g(target, "name", { value, configurable: true });
19
- const getNpmrcPath = /* @__PURE__ */ __name$g((cwd, environment) => {
23
+ const getNpmrcPath = (cwd, environment) => {
20
24
  const npmrcPath = resolve(cwd, ".npmrc");
21
25
  if (environment.NPM_CONFIG_USERCONFIG && isAccessibleSync(environment.NPM_CONFIG_USERCONFIG)) {
22
26
  return environment.NPM_CONFIG_USERCONFIG;
@@ -26,13 +30,11 @@ const getNpmrcPath = /* @__PURE__ */ __name$g((cwd, environment) => {
26
30
  }
27
31
  ensureFileSync(npmrcPath);
28
32
  return npmrcPath;
29
- }, "getNpmrcPath");
33
+ };
30
34
 
31
35
  const DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org/";
32
36
 
33
- var __defProp$f = Object.defineProperty;
34
- var __name$f = (target, value) => __defProp$f(target, "name", { value, configurable: true });
35
- const getRegistryUrl = /* @__PURE__ */ __name$f((scope, npmrc) => {
37
+ const getRegistryUrl = (scope, npmrc) => {
36
38
  let url = DEFAULT_NPM_REGISTRY;
37
39
  if (npmrc) {
38
40
  const registryUrl = npmrc[`${scope}:registry`] ?? npmrc.registry;
@@ -41,34 +43,36 @@ const getRegistryUrl = /* @__PURE__ */ __name$f((scope, npmrc) => {
41
43
  }
42
44
  }
43
45
  return url.endsWith("/") ? url : `${url}/`;
44
- }, "getRegistryUrl");
45
- const getRegistry = /* @__PURE__ */ __name$f(({ name, publishConfig: { registry } = {} }, { cwd, env }) => registry ?? env.NPM_CONFIG_REGISTRY ?? getRegistryUrl(
46
+ };
47
+ const getRegistry = ({ name, publishConfig: { registry } = {} }, { cwd, env }) => registry ?? env.NPM_CONFIG_REGISTRY ?? getRegistryUrl(
46
48
  name.split("/")[0],
47
49
  rc("npm", {
48
50
  config: env.NPM_CONFIG_USERCONFIG ?? resolve(cwd, ".npmrc"),
49
51
  cwd,
50
52
  defaults: { registry: "https://registry.npmjs.org/" }
51
53
  }).config
52
- ), "default");
54
+ );
53
55
 
54
- var __defProp$e = Object.defineProperty;
55
- var __name$e = (target, value) => __defProp$e(target, "name", { value, configurable: true });
56
- 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) => {
57
57
  return {
58
58
  channel: distributionTag,
59
59
  name: `pnpm package (@${distributionTag} dist-tag)`,
60
60
  url: normalizeUrl(registry) === normalizeUrl(DEFAULT_NPM_REGISTRY) ? `https://www.npmjs.com/package/${name}/v/${version}` : void 0
61
61
  };
62
- }, "getReleaseInfo");
62
+ };
63
63
 
64
- var __defProp$d = Object.defineProperty;
65
- var __name$d = (target, value) => __defProp$d(target, "name", { value, configurable: true });
66
- const reasonToNotPublish = /* @__PURE__ */ __name$d((pluginConfig, package_) => pluginConfig.npmPublish === false ? "npmPublish plugin option is false" : package_.private === true && package_.workspaces === void 0 ? "package is private and has no workspaces" : null, "reasonToNotPublish");
67
- const shouldPublish = /* @__PURE__ */ __name$d((pluginConfig, package_) => reasonToNotPublish(pluginConfig, package_) === null, "shouldPublish");
64
+ const reasonToNotPublish = (pluginConfig, package_) => {
65
+ if (pluginConfig.npmPublish === false) {
66
+ return "npmPublish plugin option is false";
67
+ }
68
+ if (package_.private === true && package_.workspaces === void 0) {
69
+ return "package is private and has no workspaces";
70
+ }
71
+ return null;
72
+ };
73
+ const shouldPublish = (pluginConfig, package_) => reasonToNotPublish(pluginConfig, package_) === null;
68
74
 
69
- var __defProp$c = Object.defineProperty;
70
- var __name$c = (target, value) => __defProp$c(target, "name", { value, configurable: true });
71
- const addChannelNpm = /* @__PURE__ */ __name$c(async (pluginConfig, packageJson, context) => {
75
+ const addChannel$1 = async (pluginConfig, packageJson, context) => {
72
76
  const {
73
77
  cwd,
74
78
  env,
@@ -95,11 +99,9 @@ const addChannelNpm = /* @__PURE__ */ __name$c(async (pluginConfig, packageJson,
95
99
  }
96
100
  logger.log(`Skip adding to npm channel as ${reasonToNotPublish(pluginConfig, packageJson)}`);
97
101
  return false;
98
- }, "default");
102
+ };
99
103
 
100
- var __defProp$b = Object.defineProperty;
101
- var __name$b = (target, value) => __defProp$b(target, "name", { value, configurable: true });
102
- const prepareNpm = /* @__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 }) => {
103
105
  const basePath = pkgRoot ? resolve(cwd, pkgRoot) : cwd;
104
106
  logger.log("Write version %s to package.json in %s", version, basePath);
105
107
  const versionResult = execa("pnpm", ["version", version, "--no-git-tag-version", "--allow-same-version"], {
@@ -122,11 +124,9 @@ const prepareNpm = /* @__PURE__ */ __name$b(async ({ pkgRoot, tarballDir }, { cw
122
124
  await move(tarballSource, tarballDestination);
123
125
  }
124
126
  }
125
- }, "default");
127
+ };
126
128
 
127
- var __defProp$a = Object.defineProperty;
128
- var __name$a = (target, value) => __defProp$a(target, "name", { value, configurable: true });
129
- const publishNpm = /* @__PURE__ */ __name$a(async (pluginConfig, packageJson, context) => {
129
+ const publish$1 = async (pluginConfig, packageJson, context) => {
130
130
  const {
131
131
  cwd,
132
132
  env,
@@ -171,31 +171,29 @@ const publishNpm = /* @__PURE__ */ __name$a(async (pluginConfig, packageJson, co
171
171
  }
172
172
  logger.log(`Skip publishing to npm registry as ${reasonToNotPublish(pluginConfig, packageJson)}`);
173
173
  return false;
174
- }, "default");
174
+ };
175
175
 
176
176
  const homepage = "https://github.com/anolilab/semantic-release/tree/main/packages/semantic-release-pnpm";
177
177
  const packageJson = {
178
178
  homepage: homepage};
179
179
 
180
- var __defProp$9 = Object.defineProperty;
181
- var __name$9 = (target, value) => __defProp$9(target, "name", { value, configurable: true });
182
- const linkify = /* @__PURE__ */ __name$9((file) => packageJson.homepage + "/blob/main/" + file, "linkify");
180
+ const linkify = (file) => `${packageJson.homepage}/blob/main/${file}`;
183
181
  const errors = {
184
- EINVALIDBRANCHES: /* @__PURE__ */ __name$9((branches) => {
182
+ EINVALIDBRANCHES: (branches) => {
185
183
  return {
186
184
  details: `The [branches option](${linkify("README.md#branches")}) option, if defined, must be an array of \`String\`.
187
185
  Your configuration for the \`branches\` option is \`${branches.join(",")}\`.`,
188
186
  message: "Invalid `branches` option."
189
187
  };
190
- }, "EINVALIDBRANCHES"),
191
- EINVALIDNPMPUBLISH: /* @__PURE__ */ __name$9(({ npmPublish }) => {
188
+ },
189
+ EINVALIDNPMPUBLISH: ({ npmPublish }) => {
192
190
  return {
193
191
  details: `The [npmPublish option](${linkify("README.md#npmpublish")}) option, if defined, must be a \`Boolean\`.
194
192
  Your configuration for the \`npmPublish\` option is \`${String(npmPublish)}\`.`,
195
193
  message: "Invalid `npmPublish` option."
196
194
  };
197
- }, "EINVALIDNPMPUBLISH"),
198
- EINVALIDNPMTOKEN: /* @__PURE__ */ __name$9(({ registry }) => {
195
+ },
196
+ EINVALIDNPMTOKEN: ({ registry }) => {
199
197
  return {
200
198
  details: `The [npm token](${linkify(
201
199
  "README.md#npm-registry-authentication"
@@ -204,15 +202,15 @@ If you are using Two Factor Authentication for your account, set its level to ["
204
202
  Please make sure to set the \`NPM_TOKEN\` environment variable in your CI with the exact value of the npm token.`,
205
203
  message: "Invalid npm token."
206
204
  };
207
- }, "EINVALIDNPMTOKEN"),
208
- EINVALIDPKGROOT: /* @__PURE__ */ __name$9(({ pkgRoot }) => {
205
+ },
206
+ EINVALIDPKGROOT: ({ pkgRoot }) => {
209
207
  return {
210
208
  details: `The [pkgRoot option](${linkify("README.md#pkgroot")}) option, if defined, must be a \`String\`.
211
209
  Your configuration for the \`pkgRoot\` option is \`${String(pkgRoot)}\`.`,
212
210
  message: "Invalid `pkgRoot` option."
213
211
  };
214
- }, "EINVALIDPKGROOT"),
215
- EINVALIDPNPM: /* @__PURE__ */ __name$9(({ version }) => {
212
+ },
213
+ EINVALIDPNPM: ({ version }) => {
216
214
  return {
217
215
  details: `The version of Pnpm that you are using is not compatible. Please refer to [the README](${linkify(
218
216
  "README.md#install"
@@ -221,22 +219,22 @@ Your configuration for the \`pkgRoot\` option is \`${String(pkgRoot)}\`.`,
221
219
  Your version of Pnpm is "${String(version)}".`,
222
220
  message: "Incompatible Pnpm version detected."
223
221
  };
224
- }, "EINVALIDPNPM"),
225
- EINVALIDPUBLISHBRANCH: /* @__PURE__ */ __name$9(({ publishBranch }) => {
222
+ },
223
+ EINVALIDPUBLISHBRANCH: ({ publishBranch }) => {
226
224
  return {
227
225
  details: `The [publishBranch option](${linkify("README.md#publishBranch")}) option, if defined, must be a \`String\`.
228
226
  Your configuration for the \`publishBranch\` option is \`${String(publishBranch)}\`.`,
229
227
  message: "Invalid `publishBranch` option."
230
228
  };
231
- }, "EINVALIDPUBLISHBRANCH"),
232
- EINVALIDTARBALLDIR: /* @__PURE__ */ __name$9(({ tarballDir }) => {
229
+ },
230
+ EINVALIDTARBALLDIR: ({ tarballDir }) => {
233
231
  return {
234
232
  details: `The [tarballDir option](${linkify("README.md#tarballdir")}) option, if defined, must be a \`String\`.
235
233
  Your configuration for the \`tarballDir\` option is \`${String(tarballDir)}\`.`,
236
234
  message: "Invalid `tarballDir` option."
237
235
  };
238
- }, "EINVALIDTARBALLDIR"),
239
- ENONPMTOKEN: /* @__PURE__ */ __name$9(({ registry }) => {
236
+ },
237
+ ENONPMTOKEN: ({ registry }) => {
240
238
  return {
241
239
  details: `An [npm token](${linkify(
242
240
  "README.md#npm-registry-authentication"
@@ -244,45 +242,41 @@ Your configuration for the \`tarballDir\` option is \`${String(tarballDir)}\`.`,
244
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)}\`.`,
245
243
  message: "No npm token specified."
246
244
  };
247
- }, "ENONPMTOKEN"),
248
- ENOPKG: /* @__PURE__ */ __name$9(() => {
245
+ },
246
+ ENOPKG: () => {
249
247
  return {
250
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.
251
249
  Please follow the [npm guideline](https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid \`package.json\` file.`,
252
250
  message: "Missing `package.json` file."
253
251
  };
254
- }, "ENOPKG"),
255
- ENOPKGNAME: /* @__PURE__ */ __name$9(() => {
252
+ },
253
+ ENOPKGNAME: () => {
256
254
  return {
257
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.
258
256
  Please make sure to add a valid \`name\` for your package in your \`package.json\`.`,
259
257
  message: "Missing `name` property in `package.json`."
260
258
  };
261
- }, "ENOPKGNAME"),
262
- ENOPNPM: /* @__PURE__ */ __name$9(() => {
259
+ },
260
+ ENOPNPM: () => {
263
261
  return {
264
262
  details: `The Pnpm CLI could not be found in your PATH. Make sure Pnpm is installed and try again.`,
265
263
  message: "Pnpm not found."
266
264
  };
267
- }, "ENOPNPM"),
268
- ENOPNPMRC: /* @__PURE__ */ __name$9(() => {
265
+ },
266
+ ENOPNPMRC: () => {
269
267
  return {
270
268
  details: `Didnt find a \`.npmrc\` file or it was not possible to create , in the root of your project.`,
271
269
  message: "Missing `.npmrc` file."
272
270
  };
273
- }, "ENOPNPMRC")
271
+ }
274
272
  };
275
273
 
276
- var __defProp$8 = Object.defineProperty;
277
- var __name$8 = (target, value) => __defProp$8(target, "name", { value, configurable: true });
278
- const getError = /* @__PURE__ */ __name$8((code, context = {}) => {
274
+ const getError = (code, context = {}) => {
279
275
  const { details, message } = errors[code](context);
280
276
  return new SemanticReleaseError(message, code, details);
281
- }, "default");
277
+ };
282
278
 
283
- var __defProp$7 = Object.defineProperty;
284
- var __name$7 = (target, value) => __defProp$7(target, "name", { value, configurable: true });
285
- const getPackage = /* @__PURE__ */ __name$7(async ({ pkgRoot }, { cwd }) => {
279
+ const getPackage = async ({ pkgRoot }, { cwd }) => {
286
280
  try {
287
281
  const { packageJson } = await findPackageJson(pkgRoot ? resolve(cwd, pkgRoot) : cwd);
288
282
  if (!packageJson.name) {
@@ -297,20 +291,16 @@ const getPackage = /* @__PURE__ */ __name$7(async ({ pkgRoot }, { cwd }) => {
297
291
  }
298
292
  throw error;
299
293
  }
300
- }, "default");
294
+ };
301
295
 
302
- var __defProp$6 = Object.defineProperty;
303
- var __name$6 = (target, value) => __defProp$6(target, "name", { value, configurable: true });
304
- const nerfDart = /* @__PURE__ */ __name$6((url) => {
296
+ const nerfDart = (url) => {
305
297
  const parsed = new URL(url);
306
298
  const from = `${parsed.protocol}//${parsed.host}${parsed.pathname}`;
307
299
  const real = new URL(".", from);
308
300
  return `//${real.host}${real.pathname}`;
309
- }, "nerfDart");
301
+ };
310
302
 
311
- var __defProp$5 = Object.defineProperty;
312
- var __name$5 = (target, value) => __defProp$5(target, "name", { value, configurable: true });
313
- 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 }) => {
314
304
  logger.log("Verify authentication for registry %s", registry);
315
305
  const { config, files } = rc("npm", {
316
306
  config: NPM_CONFIG_USERCONFIG ?? resolve(cwd, ".npmrc"),
@@ -337,11 +327,9 @@ email = \${NPM_EMAIL}`);
337
327
  const semanticError = getError("ENONPMTOKEN", { registry });
338
328
  throw new AggregateError([semanticError], semanticError.message);
339
329
  }
340
- }, "default");
330
+ };
341
331
 
342
- var __defProp$4 = Object.defineProperty;
343
- var __name$4 = (target, value) => __defProp$4(target, "name", { value, configurable: true });
344
- const verifyAuth = /* @__PURE__ */ __name$4(async (npmrc, package_, context) => {
332
+ const verifyAuth = async (npmrc, package_, context) => {
345
333
  const {
346
334
  cwd,
347
335
  env: { DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org/", ...environment },
@@ -369,27 +357,25 @@ const verifyAuth = /* @__PURE__ */ __name$4(async (npmrc, package_, context) =>
369
357
  } else {
370
358
  logger.log(`Skipping authentication verification for non-default registry "${registry}"`);
371
359
  }
372
- }, "default");
360
+ };
373
361
 
374
- var __defProp$3 = Object.defineProperty;
375
- var __name$3 = (target, value) => __defProp$3(target, "name", { value, configurable: true });
376
- const isString = /* @__PURE__ */ __name$3((value) => typeof value === "string", "isString");
377
- const isNil = /* @__PURE__ */ __name$3((value) => value === null || value === void 0, "isNil");
378
- 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) => {
379
365
  if (!isString(value)) {
380
366
  return false;
381
367
  }
382
368
  return value.trim() !== "";
383
- }, "isNonEmptyString");
369
+ };
384
370
  const VALIDATORS = {
385
371
  branches: Array.isArray,
386
372
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
387
- npmPublish: /* @__PURE__ */ __name$3((value) => typeof value === "boolean", "npmPublish"),
373
+ npmPublish: (value) => typeof value === "boolean",
388
374
  pkgRoot: isNonEmptyString,
389
375
  publishBranch: isNonEmptyString,
390
376
  tarballDir: isNonEmptyString
391
377
  };
392
- const verifyConfig = /* @__PURE__ */ __name$3((config) => (
378
+ const verifyConfig = (config) => (
393
379
  // eslint-disable-next-line unicorn/no-array-reduce
394
380
  Object.entries(config).reduce((errors, [option, value]) => {
395
381
  if (isNil(value)) {
@@ -403,24 +389,19 @@ const verifyConfig = /* @__PURE__ */ __name$3((config) => (
403
389
  }
404
390
  return [...errors, getError(`EINVALID${option.toUpperCase()}`, { [option]: value })];
405
391
  }, [])
406
- ), "default");
392
+ );
407
393
 
408
- var __defProp$2 = Object.defineProperty;
409
- var __name$2 = (target, value) => __defProp$2(target, "name", { value, configurable: true });
410
394
  const MIN_PNPM_VERSION = "8.0.0";
411
- async function verifyPnpm({ logger }) {
395
+ const verifyPnpm = async ({ logger }) => {
412
396
  logger.log(`Verify pnpm version is >= ${MIN_PNPM_VERSION}`);
413
397
  const version = getPackageManagerVersion("pnpm");
414
398
  if (gte(MIN_PNPM_VERSION, version)) {
415
399
  const semanticError = getError("EINVALIDPNPM", { version: String(version) });
416
400
  throw new AggregateError([semanticError], semanticError.message);
417
401
  }
418
- }
419
- __name$2(verifyPnpm, "verifyPnpm");
402
+ };
420
403
 
421
- var __defProp$1 = Object.defineProperty;
422
- var __name$1 = (target, value) => __defProp$1(target, "name", { value, configurable: true });
423
- const verify = /* @__PURE__ */ __name$1(async (pluginConfig, context) => {
404
+ const verify = async (pluginConfig, context) => {
424
405
  let errors = verifyConfig(pluginConfig);
425
406
  let errorsMessage = "";
426
407
  try {
@@ -444,14 +425,12 @@ const verify = /* @__PURE__ */ __name$1(async (pluginConfig, context) => {
444
425
  if (errors.length > 0) {
445
426
  throw new AggregateError(errors, errorsMessage);
446
427
  }
447
- }, "verify");
428
+ };
448
429
 
449
- var __defProp = Object.defineProperty;
450
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
451
430
  const PLUGIN_NAME = "semantic-release-pnpm";
452
431
  let verified;
453
432
  let prepared;
454
- const verifyConditions = /* @__PURE__ */ __name(async (pluginConfig, context) => {
433
+ const verifyConditions = async (pluginConfig, context) => {
455
434
  if (context.options.publish) {
456
435
  const publish2 = Array.isArray(context.options.publish) ? context.options.publish : [context.options.publish];
457
436
  const publishPlugin = publish2.find((config) => config.path && config.path === PLUGIN_NAME) || {};
@@ -463,30 +442,30 @@ const verifyConditions = /* @__PURE__ */ __name(async (pluginConfig, context) =>
463
442
  }
464
443
  await verify(pluginConfig, context);
465
444
  verified = true;
466
- }, "verifyConditions");
467
- const prepare = /* @__PURE__ */ __name(async (pluginConfig, context) => {
445
+ };
446
+ const prepare = async (pluginConfig, context) => {
468
447
  if (!verified) {
469
448
  await verify(pluginConfig, context);
470
449
  }
471
- await prepareNpm(pluginConfig, context);
450
+ await prepare$1(pluginConfig, context);
472
451
  prepared = true;
473
- }, "prepare");
474
- const publish = /* @__PURE__ */ __name(async (pluginConfig, context) => {
452
+ };
453
+ const publish = async (pluginConfig, context) => {
475
454
  const packageJson = await getPackage(pluginConfig, context);
476
455
  if (!verified) {
477
456
  await verify(pluginConfig, context);
478
457
  }
479
458
  if (!prepared) {
480
- await prepareNpm(pluginConfig, context);
459
+ await prepare$1(pluginConfig, context);
481
460
  }
482
- return await publishNpm(pluginConfig, packageJson, context);
483
- }, "publish");
484
- const addChannel = /* @__PURE__ */ __name(async (pluginConfig, context) => {
461
+ return await publish$1(pluginConfig, packageJson, context);
462
+ };
463
+ const addChannel = async (pluginConfig, context) => {
485
464
  if (!verified) {
486
465
  await verify(pluginConfig, context);
487
466
  }
488
467
  const packageJson = await getPackage(pluginConfig, context);
489
- return await addChannelNpm(pluginConfig, packageJson, context);
490
- }, "addChannel");
468
+ return await addChannel$1(pluginConfig, packageJson, context);
469
+ };
491
470
 
492
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",
3
+ "version": "2.0.5",
4
4
  "description": "Semantic-release plugin to publish a npm package with pnpm.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -38,24 +38,24 @@
38
38
  },
39
39
  "sideEffects": false,
40
40
  "type": "module",
41
- "main": "./dist/index.mjs",
42
- "types": "./dist/index.d.mts",
41
+ "main": "./dist/index.js",
42
+ "types": "./dist/index.d.ts",
43
43
  "files": [
44
44
  "CHANGELOG.md",
45
45
  "README.md",
46
46
  "dist"
47
47
  ],
48
48
  "dependencies": {
49
- "@anolilab/rc": "2.0.3",
49
+ "@anolilab/rc": "2.0.5",
50
50
  "@semantic-release/error": "^4.0.0",
51
- "@visulima/fs": "^3.1.5",
52
- "@visulima/package": "^3.5.8",
53
- "@visulima/path": "^1.4.0",
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": "^5.0.0",
56
- "normalize-url": "^8.0.2",
55
+ "ini": "^6.0.0",
56
+ "normalize-url": "^8.1.0",
57
57
  "registry-auth-token": "^5.1.0",
58
- "semver": "^7.7.2"
58
+ "semver": "^7.7.3"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=20.8.1"
package/dist/index.d.mts DELETED
@@ -1,123 +0,0 @@
1
- import stream from 'node:stream';
2
-
3
- interface BranchObject {
4
- channel?: string | false | undefined;
5
- name: string;
6
- prerelease?: boolean | string | undefined;
7
- range?: string | undefined;
8
- }
9
- type BranchSpec$1 = BranchObject | string;
10
- type PluginSpec<T = any> = string | [string, T];
11
- interface Options {
12
- [name: string]: any;
13
- branches?: BranchSpec$1 | ReadonlyArray<BranchSpec$1> | undefined;
14
- ci?: boolean | undefined;
15
- dryRun?: boolean | undefined;
16
- extends?: ReadonlyArray<string> | string | undefined;
17
- plugins?: ReadonlyArray<PluginSpec> | undefined;
18
- repositoryUrl?: string | undefined;
19
- tagFormat?: string | undefined;
20
- }
21
- interface Commit {
22
- author: {
23
- email: string;
24
- name: string;
25
- short: string;
26
- };
27
- body: string;
28
- commit: {
29
- long: string;
30
- short: string;
31
- };
32
- committer: {
33
- email: string;
34
- name: string;
35
- short: string;
36
- };
37
- committerDate: string;
38
- hash: string;
39
- message: string;
40
- subject: string;
41
- tree: {
42
- long: string;
43
- short: string;
44
- };
45
- }
46
-
47
- interface CommonContext {
48
- branch: BranchSpec;
49
- branches: BranchSpec[];
50
- cwd: string;
51
- env: "object";
52
- logger: {
53
- error: (...message: string[]) => void;
54
- log: (...message: string[]) => void;
55
- success: (...message: string[]) => void;
56
- };
57
- options: Options;
58
- stderr: stream.Writable;
59
- stdout: stream.Writable;
60
- }
61
- type VerifyConditionsContext = CommonContext;
62
- type CommonContext2 = CommonContext & {
63
- releases: Release[];
64
- };
65
- type AddChannelContext = CommonContext2 & {
66
- commits: Commit[];
67
- currentRelease: Release;
68
- lastRelease: Release;
69
- nextRelease: Release;
70
- };
71
- type CommonContext3 = CommonContext2 & {
72
- commits: Commit[];
73
- lastRelease: Release;
74
- };
75
- type CommonContext4 = CommonContext3 & {
76
- commits: Commit[];
77
- nextRelease: Release;
78
- };
79
- type PrepareContext = CommonContext4;
80
- type PublishContext = CommonContext4;
81
- interface BranchSpec {
82
- name: string;
83
- tags?: Tag[];
84
- }
85
- interface Tag {
86
- channel?: string;
87
- gitHead?: string;
88
- gitTag?: string;
89
- version?: string;
90
- }
91
- interface Release {
92
- channel?: string | null;
93
- gitHead?: string;
94
- gitTag?: string;
95
- name?: string;
96
- type?: "build" | "major" | "minor" | "patch" | "premajor" | "preminor" | "prepatch" | "prerelease" | undefined;
97
- version: string;
98
- }
99
-
100
- interface PluginConfig {
101
- branches?: (string | {
102
- name: string;
103
- prerelease: boolean;
104
- })[];
105
- disableScripts?: boolean;
106
- npmPublish?: boolean;
107
- pkgRoot?: string;
108
- publishBranch?: string;
109
- tarballDir?: string;
110
- }
111
-
112
- interface ReleaseInfo {
113
- channel: string;
114
- name: string;
115
- url?: string;
116
- }
117
-
118
- declare const verifyConditions: (pluginConfig: PluginConfig, context: VerifyConditionsContext) => Promise<void>;
119
- declare const prepare: (pluginConfig: PluginConfig, context: PrepareContext) => Promise<void>;
120
- declare const publish: (pluginConfig: PluginConfig, context: PublishContext) => Promise<ReleaseInfo | false>;
121
- declare const addChannel: (pluginConfig: PluginConfig, context: AddChannelContext) => Promise<ReleaseInfo | false>;
122
-
123
- export { addChannel, prepare, publish, verifyConditions };