@anolilab/semantic-release-pnpm 8.1.3 → 8.1.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,23 @@
1
+ ## @anolilab/semantic-release-pnpm [8.1.5](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.4...@anolilab/semantic-release-pnpm@8.1.5) (2026-04-27)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **semantic-release-pnpm:** align integration test with whoami error and add cache reset helper ([fdfc677](https://github.com/anolilab/semantic-release/commit/fdfc67705d1ba0b28dee9acd9b61fc1ec6916e62))
6
+ * **semantic-release-pnpm:** remove duplicate verifyAuthContextAgainstCustomRegistry function ([dc64c44](https://github.com/anolilab/semantic-release/commit/dc64c4443e61883136d78fb407ba1329bc06fc09))
7
+ * **semantic-release-pnpm:** use `npm pkg set` on pnpm v10+ ([c96d683](https://github.com/anolilab/semantic-release/commit/c96d6834099a2cfafa000a976be73fa9074f531c))
8
+ * **semantic-release-pnpm:** use pnpm whoami for custom registry auth verification ([afee204](https://github.com/anolilab/semantic-release/commit/afee2047abcd6201d63414f80349a7e5331925f8))
9
+
10
+ ### Tests
11
+
12
+ * **semantic-release-pnpm:** strengthen already-published regression test ([6e84c11](https://github.com/anolilab/semantic-release/commit/6e84c11505925e47bc72aff1e1d2fa897125e276))
13
+ * **semantic-release-pnpm:** use distinct registry URL in whoami-failure test to avoid cache collision ([5900697](https://github.com/anolilab/semantic-release/commit/59006976fb6aec218b85e7d54fcff3332f3dee19))
14
+
15
+ ## @anolilab/semantic-release-pnpm [8.1.4](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.3...@anolilab/semantic-release-pnpm@8.1.4) (2026-04-26)
16
+
17
+ ### Miscellaneous Chores
18
+
19
+ * clean up old lint command ([07d70e6](https://github.com/anolilab/semantic-release/commit/07d70e65b2fe220c3aee13eab796a70577a2d5c6))
20
+
1
21
  ## @anolilab/semantic-release-pnpm [8.1.3](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.2...@anolilab/semantic-release-pnpm@8.1.3) (2026-04-26)
2
22
 
3
23
  ## @anolilab/semantic-release-pnpm [8.1.2](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.1...@anolilab/semantic-release-pnpm@8.1.2) (2026-04-17)
package/dist/index.js CHANGED
@@ -161,8 +161,9 @@ const prepare$1 = async ({ pkgRoot, tarballDir }, { cwd, env, logger, nextReleas
161
161
  const pnpmVersion = getPackageManagerVersion("pnpm");
162
162
  const pnpmMajor = major(pnpmVersion);
163
163
  debug$7("Detected pnpm major version: %d", pnpmMajor);
164
+ const versionBin = pnpmMajor >= 10 ? "npm" : "pnpm";
164
165
  const versionArguments = pnpmMajor >= 10 ? ["pkg", "set", `version=${version}`] : ["version", version, "--no-git-tag-version", "--allow-same-version"];
165
- const versionResult = execa("pnpm", versionArguments, {
166
+ const versionResult = execa(versionBin, versionArguments, {
166
167
  cwd: basePath,
167
168
  env,
168
169
  preferLocal: true
@@ -592,56 +593,7 @@ const verifyAuthContextAgainstRegistry = async (npmrc, registry, context) => {
592
593
  throw error;
593
594
  }
594
595
  };
595
- const AUTH_STATUS_401 = /\b401\b/;
596
- const AUTH_STATUS_403 = /\b403\b/;
597
- const isAuthErrorMessage = (message) => message.includes("requires you to be logged in") || message.includes("authentication") || message.includes("Unauthorized") || AUTH_STATUS_401.test(message) || AUTH_STATUS_403.test(message);
598
- const handlePublishError = (error, registry) => {
599
- if (error instanceof AggregateError) {
600
- throw error;
601
- }
602
- const errorStderrRaw = error.stderr;
603
- const errorStderr = Array.isArray(errorStderrRaw) ? errorStderrRaw.join("\n") : errorStderrRaw ?? "";
604
- const errorMessage = error instanceof Error ? error.message : String(error);
605
- const combinedMessage = `${errorStderr} ${errorMessage}`;
606
- if (isConnectionError(error)) {
607
- const semanticError = getError("EINVALIDNPMAUTH", { registry });
608
- throw new AggregateError([semanticError], semanticError.message);
609
- }
610
- if (isAuthErrorMessage(combinedMessage)) {
611
- const semanticError = getError("EINVALIDNPMAUTH", { registry });
612
- throw new AggregateError([semanticError], semanticError.message);
613
- }
614
- throw error;
615
- };
616
- const verifyAuthContextAgainstCustomRegistry = async (npmrc, registry, context, pkgRoot = ".") => {
617
- const { cwd, env, logger, stderr, stdout } = context;
618
- try {
619
- logger.log(`Running "pnpm publish --dry-run" to verify authentication on registry "${registry}"`);
620
- const publishArgs = ["publish", pkgRoot, "--dry-run", "--tag=semantic-release-auth-check", "--registry", registry, "--no-git-checks"];
621
- const publishOptions = {
622
- cwd,
623
- env: {
624
- ...env,
625
- NPM_CONFIG_USERCONFIG: npmrc
626
- },
627
- preferLocal: true,
628
- timeout: 5e3
629
- // 5 second timeout to prevent hanging when registry is unavailable
630
- };
631
- const publishResult = await execa("pnpm", publishArgs, publishOptions);
632
- const stdoutString = Array.isArray(publishResult.stdout) ? publishResult.stdout.join("\n") : publishResult.stdout || "";
633
- const stderrString = Array.isArray(publishResult.stderr) ? publishResult.stderr.join("\n") : publishResult.stderr || "";
634
- if (stdoutString) {
635
- stdout.write(stdoutString);
636
- }
637
- if (stderrString) {
638
- stderr.write(stderrString);
639
- }
640
- } catch (error) {
641
- handlePublishError(error, registry);
642
- }
643
- };
644
- const verifyAuth = async (npmrc, package_, context, pkgRoot) => {
596
+ const verifyAuth = async (npmrc, package_, context) => {
645
597
  const registry = getRegistry(package_, context);
646
598
  if (package_.name) {
647
599
  debug$2(`Checking OIDC trusted publishing for package "${package_.name}" on registry "${registry}"`);
@@ -668,9 +620,7 @@ const verifyAuth = async (npmrc, package_, context, pkgRoot) => {
668
620
  debug$2("Package name not found, skipping OIDC check and using NPM_TOKEN authentication");
669
621
  }
670
622
  await setNpmrcAuth(npmrc, registry, context);
671
- const normalizedRegistry = normalizeUrl(registry);
672
- const normalizedOfficialRegistry = normalizeUrl(OFFICIAL_REGISTRY);
673
- await (normalizedRegistry === normalizedOfficialRegistry ? verifyAuthContextAgainstRegistry(npmrc, registry, context) : verifyAuthContextAgainstCustomRegistry(npmrc, registry, context, pkgRoot));
623
+ await verifyAuthContextAgainstRegistry(npmrc, registry, context);
674
624
  };
675
625
 
676
626
  const isString = (value) => typeof value === "string";
@@ -735,7 +685,7 @@ const verify = async (pluginConfig, context) => {
735
685
  if (shouldPublish(pluginConfig, packageJson)) {
736
686
  context.logger.log(`Verifying authentication for package "${packageJson.name ?? "unknown"}"`);
737
687
  const npmrc = getNpmrcPath(context.cwd, context.env);
738
- await verifyAuth(npmrc, packageJson, context, pluginConfig.pkgRoot);
688
+ await verifyAuth(npmrc, packageJson, context);
739
689
  } else {
740
690
  context.logger.log(`Skipping authentication verification for package "${packageJson.name ?? "unknown"}" (publishing disabled)`);
741
691
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/semantic-release-pnpm",
3
- "version": "8.1.3",
3
+ "version": "8.1.5",
4
4
  "description": "Semantic-release plugin to publish a npm package with pnpm.",
5
5
  "keywords": [
6
6
  "anolilab",