@anolilab/semantic-release-pnpm 8.1.14 → 8.1.16

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,31 @@
1
+ ## @anolilab/semantic-release-pnpm [8.1.16](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.15...@anolilab/semantic-release-pnpm@8.1.16) (2026-06-20)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **build:** add @visulima/pail devDependency to satisfy cerebro peer ([a440c7d](https://github.com/anolilab/semantic-release/commit/a440c7dc61ca5ae69b4931e7ba751c43fdc8159b))
6
+ * **lint:** satisfy eslint-config v27 rules and make codecov upload non-blocking ([da69704](https://github.com/anolilab/semantic-release/commit/da69704ad8158cd82a4eab1259164fbbb6c82999))
7
+
8
+
9
+ ### Dependencies
10
+
11
+ * **@anolilab/rc:** upgraded to 4.0.4
12
+
13
+ ## @anolilab/semantic-release-pnpm [8.1.15](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.14...@anolilab/semantic-release-pnpm@8.1.15) (2026-05-26)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **semantic-release-pnpm:** handle non-AggregateError in verify and skip re-publish ([#309](https://github.com/anolilab/semantic-release/issues/309)) ([6acb075](https://github.com/anolilab/semantic-release/commit/6acb075cbd3e7abf1f8c0d5417ffb661fd331646))
18
+ * **semantic-release-pnpm:** soft-fail whoami for non-official registries ([#310](https://github.com/anolilab/semantic-release/issues/310)) ([b041d88](https://github.com/anolilab/semantic-release/commit/b041d88374957b254cc4f4561a44467a422918a9))
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * **deps:** bump deps and upgrade to pnpm 11 ([#312](https://github.com/anolilab/semantic-release/issues/312)) ([100be77](https://github.com/anolilab/semantic-release/commit/100be77953d6c51f595b01fd092a2a83c011ed0b))
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * **@anolilab/rc:** upgraded to 4.0.3
28
+
1
29
  ## @anolilab/semantic-release-pnpm [8.1.14](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.13...@anolilab/semantic-release-pnpm@8.1.14) (2026-05-23)
2
30
 
3
31
  ## @anolilab/semantic-release-pnpm [8.1.13](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.12...@anolilab/semantic-release-pnpm@8.1.13) (2026-05-23)
package/dist/index.d.ts CHANGED
@@ -1,123 +1,119 @@
1
1
  import stream from 'node:stream';
2
-
2
+ import '@visulima/package';
3
3
  interface BranchObject {
4
- channel?: string | false;
5
- name: string;
6
- prerelease?: boolean | string;
7
- range?: string;
4
+ channel?: string | false;
5
+ name: string;
6
+ prerelease?: boolean | string;
7
+ range?: string;
8
8
  }
9
9
  type BranchSpec$1 = BranchObject | string;
10
10
  type PluginSpec<T = any> = string | [string, T];
11
11
  interface Options {
12
- [name: string]: any;
13
- branches?: BranchSpec$1 | ReadonlyArray<BranchSpec$1>;
14
- ci?: boolean;
15
- dryRun?: boolean;
16
- extends?: ReadonlyArray<string> | string;
17
- plugins?: ReadonlyArray<PluginSpec>;
18
- repositoryUrl?: string;
19
- tagFormat?: string;
12
+ [name: string]: any;
13
+ branches?: BranchSpec$1 | ReadonlyArray<BranchSpec$1>;
14
+ ci?: boolean;
15
+ dryRun?: boolean;
16
+ extends?: ReadonlyArray<string> | string;
17
+ plugins?: ReadonlyArray<PluginSpec>;
18
+ repositoryUrl?: string;
19
+ tagFormat?: string;
20
20
  }
21
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
- };
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
45
  }
46
-
47
46
  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;
47
+ branch: BranchSpec;
48
+ branches: BranchSpec[];
49
+ cwd: string;
50
+ env: "object";
51
+ logger: {
52
+ error: (...message: string[]) => void;
53
+ log: (...message: string[]) => void;
54
+ success: (...message: string[]) => void;
55
+ warn: (...message: string[]) => void;
56
+ };
57
+ options: Options;
58
+ stderr: stream.Writable;
59
+ stdout: stream.Writable;
60
60
  }
61
61
  type VerifyConditionsContext = CommonContext;
62
62
  type CommonContext2 = CommonContext & {
63
- releases: Release[];
63
+ releases: Release[];
64
64
  };
65
65
  type AddChannelContext = CommonContext2 & {
66
- commits: Commit[];
67
- currentRelease: Release;
68
- lastRelease: Release;
69
- nextRelease: Release;
66
+ commits: Commit[];
67
+ currentRelease: Release;
68
+ lastRelease: Release;
69
+ nextRelease: Release;
70
70
  };
71
71
  type CommonContext3 = CommonContext2 & {
72
- commits: Commit[];
73
- lastRelease: Release;
72
+ commits: Commit[];
73
+ lastRelease: Release;
74
74
  };
75
75
  type CommonContext4 = CommonContext3 & {
76
- commits: Commit[];
77
- nextRelease: Release;
76
+ commits: Commit[];
77
+ nextRelease: Release;
78
78
  };
79
79
  type PrepareContext = CommonContext4;
80
80
  type PublishContext = CommonContext4;
81
81
  interface BranchSpec {
82
- name: string;
83
- tags?: Tag[];
82
+ name: string;
83
+ tags?: Tag[];
84
84
  }
85
85
  interface Tag {
86
- channel?: string;
87
- gitHead?: string;
88
- gitTag?: string;
89
- version?: string;
86
+ channel?: string;
87
+ gitHead?: string;
88
+ gitTag?: string;
89
+ version?: string;
90
90
  }
91
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";
97
- version: string;
92
+ channel?: string | null;
93
+ gitHead?: string;
94
+ gitTag?: string;
95
+ name?: string;
96
+ type?: "build" | "major" | "minor" | "patch" | "premajor" | "preminor" | "prepatch" | "prerelease";
97
+ version: string;
98
98
  }
99
-
100
99
  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?: false | string;
100
+ branches?: (string | {
101
+ name: string;
102
+ prerelease: boolean;
103
+ })[];
104
+ disableScripts?: boolean;
105
+ npmPublish?: boolean;
106
+ pkgRoot?: string;
107
+ publishBranch?: string;
108
+ tarballDir?: false | string;
110
109
  }
111
-
112
110
  interface ReleaseInfo {
113
- channel: string;
114
- name: string;
115
- url?: string;
111
+ channel: string;
112
+ name: string;
113
+ url?: string;
116
114
  }
117
-
118
115
  declare const verifyConditions: (pluginConfig: PluginConfig, context: VerifyConditionsContext) => Promise<void>;
119
116
  declare const prepare: (pluginConfig: PluginConfig, context: PrepareContext) => Promise<void>;
120
117
  declare const publish: (pluginConfig: PluginConfig, context: PublishContext) => Promise<ReleaseInfo | false>;
121
118
  declare const addChannel: (pluginConfig: PluginConfig, context: AddChannelContext) => Promise<ReleaseInfo | false>;
122
-
123
119
  export { addChannel, prepare, publish, verifyConditions };
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ const __cjs_getBuiltinModule = (module) => {
18
18
  };
19
19
 
20
20
  import dbg from 'debug';
21
- import { execa } from 'execa';
21
+ import { execa, ExecaError } from 'execa';
22
22
  import { validRange, major, gte } from 'semver';
23
23
  import { isAccessibleSync, ensureFileSync, isAccessible, readJson, writeJson, move, writeFile } from '@visulima/fs';
24
24
  import { resolve } from '@visulima/path';
@@ -199,6 +199,21 @@ const prepare$1 = async ({ pkgRoot, tarballDir }, { cwd, env, logger, nextReleas
199
199
  };
200
200
 
201
201
  const debug$6 = dbg("semantic-release-pnpm:publish");
202
+ const ALREADY_PUBLISHED_PHRASE = "cannot publish over the previously published versions";
203
+ const isAlreadyPublishedError = (error) => {
204
+ const haystacks = [error.stderr, error.shortMessage, error.message].filter((value) => typeof value === "string");
205
+ return haystacks.some((value) => value.includes(ALREADY_PUBLISHED_PHRASE));
206
+ };
207
+ const handlePublishError = (error, packageJson, context, distributionTag, registry) => {
208
+ const { logger, nextRelease: { version } } = context;
209
+ const errorMessage = error instanceof Error ? error.message : String(error);
210
+ if (error instanceof ExecaError && isAlreadyPublishedError(error)) {
211
+ logger.log(`Package ${packageJson.name ?? ""}@${version} is already published at dist-tag @${distributionTag} on ${registry}, skipping`);
212
+ return getReleaseInfo(packageJson, context, distributionTag, registry);
213
+ }
214
+ logger.log(`Failed to publish ${packageJson.name ?? ""}@${version} to dist-tag @${distributionTag} on ${registry}: ${errorMessage}`);
215
+ throw new AggregateError([error], errorMessage, { cause: error });
216
+ };
202
217
  const publish$1 = async (pluginConfig, packageJson, context) => {
203
218
  const {
204
219
  cwd,
@@ -237,9 +252,7 @@ const publish$1 = async (pluginConfig, packageJson, context) => {
237
252
  try {
238
253
  await result;
239
254
  } catch (error) {
240
- const errorMessage = error instanceof Error ? error.message : String(error);
241
- logger.log(`Failed to publish ${packageJson.name ?? ""}@${version} to dist-tag @${distributionTag} on ${registry}: ${errorMessage}`);
242
- throw new AggregateError([error], errorMessage, { cause: error });
255
+ return handlePublishError(error, packageJson, context, distributionTag, registry);
243
256
  }
244
257
  logger.log(`Published ${packageJson.name ?? ""}@${version} to dist-tag @${distributionTag} on ${registry}`);
245
258
  return getReleaseInfo(packageJson, context, distributionTag, registry);
@@ -576,11 +589,17 @@ const verifyAuthContextAgainstRegistry = async (npmrc, registry, context) => {
576
589
  }
577
590
  } catch (error) {
578
591
  if (isConnectionError(error)) {
579
- const semanticError2 = getError("EINVALIDNPMAUTH", { registry });
580
- throw new AggregateError([semanticError2], semanticError2.message, { cause: error });
592
+ const semanticError = getError("EINVALIDNPMAUTH", { registry });
593
+ throw new AggregateError([semanticError], semanticError.message, { cause: error });
581
594
  }
582
- const semanticError = getError("EINVALIDNPMTOKEN", { registry });
583
- throw new AggregateError([semanticError], semanticError.message, { cause: error });
595
+ if (normalizeUrl(registry) === normalizeUrl(OFFICIAL_REGISTRY)) {
596
+ const semanticError = getError("EINVALIDNPMTOKEN", { registry });
597
+ throw new AggregateError([semanticError], semanticError.message, { cause: error });
598
+ }
599
+ const errorMessage = error instanceof Error ? error.message : String(error);
600
+ context.logger.warn(
601
+ `Could not verify auth via "pnpm whoami" on custom registry "${registry}" (${errorMessage}). This registry may not support /-/whoami for the configured token type (e.g. GitLab Package Registry with deploy tokens). The publish step will surface any real credential errors.`
602
+ );
584
603
  }
585
604
  })();
586
605
  whoamiCache.set(cacheKey, verificationPromise);
@@ -678,7 +697,7 @@ const verify = async (pluginConfig, context) => {
678
697
  } catch (error) {
679
698
  const typedError = error;
680
699
  errorsMessage += typedError.message;
681
- errors = [...errors, ...typedError.errors];
700
+ errors = [...errors, ...Array.isArray(typedError.errors) ? typedError.errors : [typedError]];
682
701
  }
683
702
  try {
684
703
  const packageJson = await getPackage(pluginConfig, context);
@@ -692,7 +711,7 @@ const verify = async (pluginConfig, context) => {
692
711
  } catch (error) {
693
712
  const typedError = error;
694
713
  errorsMessage += typedError.message;
695
- errors = [...errors, ...typedError.errors];
714
+ errors = [...errors, ...Array.isArray(typedError.errors) ? typedError.errors : [typedError]];
696
715
  }
697
716
  if (errors.length > 0) {
698
717
  throw new AggregateError(errors, errorsMessage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/semantic-release-pnpm",
3
- "version": "8.1.14",
3
+ "version": "8.1.16",
4
4
  "description": "Semantic-release plugin to publish a npm package with pnpm.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -61,7 +61,7 @@
61
61
  ],
62
62
  "dependencies": {
63
63
  "@actions/core": "3.0.1",
64
- "@anolilab/rc": "4.0.2",
64
+ "@anolilab/rc": "4.0.4",
65
65
  "@semantic-release/error": "^4.0.0",
66
66
  "@visulima/fs": "^4.1.0",
67
67
  "@visulima/package": "^4.1.7",
@@ -72,7 +72,7 @@
72
72
  "ini": "^6.0.0",
73
73
  "normalize-url": "9.0.1",
74
74
  "registry-auth-token": "5.1.1",
75
- "semver": "7.8.0"
75
+ "semver": "7.8.4"
76
76
  },
77
77
  "engines": {
78
78
  "node": "^22.14.0 || >=24.10.0"