@anolilab/semantic-release-pnpm 8.1.4 → 8.1.6
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 +16 -0
- package/dist/index.js +5 -55
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## @anolilab/semantic-release-pnpm [8.1.6](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.5...@anolilab/semantic-release-pnpm@8.1.6) (2026-04-28)
|
|
2
|
+
|
|
3
|
+
## @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)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **semantic-release-pnpm:** align integration test with whoami error and add cache reset helper ([fdfc677](https://github.com/anolilab/semantic-release/commit/fdfc67705d1ba0b28dee9acd9b61fc1ec6916e62))
|
|
8
|
+
* **semantic-release-pnpm:** remove duplicate verifyAuthContextAgainstCustomRegistry function ([dc64c44](https://github.com/anolilab/semantic-release/commit/dc64c4443e61883136d78fb407ba1329bc06fc09))
|
|
9
|
+
* **semantic-release-pnpm:** use `npm pkg set` on pnpm v10+ ([c96d683](https://github.com/anolilab/semantic-release/commit/c96d6834099a2cfafa000a976be73fa9074f531c))
|
|
10
|
+
* **semantic-release-pnpm:** use pnpm whoami for custom registry auth verification ([afee204](https://github.com/anolilab/semantic-release/commit/afee2047abcd6201d63414f80349a7e5331925f8))
|
|
11
|
+
|
|
12
|
+
### Tests
|
|
13
|
+
|
|
14
|
+
* **semantic-release-pnpm:** strengthen already-published regression test ([6e84c11](https://github.com/anolilab/semantic-release/commit/6e84c11505925e47bc72aff1e1d2fa897125e276))
|
|
15
|
+
* **semantic-release-pnpm:** use distinct registry URL in whoami-failure test to avoid cache collision ([5900697](https://github.com/anolilab/semantic-release/commit/59006976fb6aec218b85e7d54fcff3332f3dee19))
|
|
16
|
+
|
|
1
17
|
## @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)
|
|
2
18
|
|
|
3
19
|
### Miscellaneous Chores
|
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(
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
}
|