@anolilab/semantic-release-pnpm 8.1.0 → 8.1.1
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 +6 -0
- package/README.md +3 -3
- package/dist/index.js +17 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## @anolilab/semantic-release-pnpm [8.1.1](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.0...@anolilab/semantic-release-pnpm@8.1.1) (2026-04-15)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **semantic-release-pnpm:** support pnpm v10 in prepare step ([f1dee76](https://github.com/anolilab/semantic-release/commit/f1dee765dc2278cecde34e85bc6d7096eeeba3d5))
|
|
6
|
+
|
|
1
7
|
## @anolilab/semantic-release-pnpm [8.1.0](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.0.0...@anolilab/semantic-release-pnpm@8.1.0) (2026-04-08)
|
|
2
8
|
|
|
3
9
|
### Features
|
package/README.md
CHANGED
|
@@ -180,9 +180,9 @@ Provenance applies specifically to publishing, so configure it under `publishCon
|
|
|
180
180
|
|
|
181
181
|
### Environment variables
|
|
182
182
|
|
|
183
|
-
| Variable | Description
|
|
184
|
-
| -------------- |
|
|
185
|
-
| `NPM_TOKEN` | Npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens)
|
|
183
|
+
| Variable | Description |
|
|
184
|
+
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
185
|
+
| `NPM_TOKEN` | Npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) |
|
|
186
186
|
| `NPM_ID_TOKEN` | OIDC identity token for [trusted publishing](https://docs.npmjs.com/trusted-publishers). Must be configured in your CI job (see [GitLab](#trusted-publishing-for-gitlab-pipelines), [CircleCI](#trusted-publishing-for-circleci)). Takes priority over CI-specific token retrieval when set. |
|
|
187
187
|
|
|
188
188
|
### Options
|
package/dist/index.js
CHANGED
|
@@ -19,12 +19,12 @@ const __cjs_getBuiltinModule = (module) => {
|
|
|
19
19
|
|
|
20
20
|
import dbg from 'debug';
|
|
21
21
|
import { execa } from 'execa';
|
|
22
|
-
import { validRange, gte } from 'semver';
|
|
23
|
-
import { isAccessibleSync, ensureFileSync, move, writeFile } from '@visulima/fs';
|
|
22
|
+
import { validRange, major, gte } from 'semver';
|
|
23
|
+
import { isAccessibleSync, ensureFileSync, isAccessible, readJson, writeJson, move, writeFile } from '@visulima/fs';
|
|
24
24
|
import { resolve } from '@visulima/path';
|
|
25
25
|
import { rc } from '@anolilab/rc';
|
|
26
26
|
import normalizeUrl from 'normalize-url';
|
|
27
|
-
import {
|
|
27
|
+
import { getPackageManagerVersion, findPackageJson } from '@visulima/package';
|
|
28
28
|
import SemanticReleaseError from '@semantic-release/error';
|
|
29
29
|
import { stringify } from 'ini';
|
|
30
30
|
import getAuthToken from 'registry-auth-token';
|
|
@@ -158,7 +158,11 @@ const debug$7 = dbg("semantic-release-pnpm:prepare");
|
|
|
158
158
|
const prepare$1 = async ({ pkgRoot, tarballDir }, { cwd, env, logger, nextRelease: { version }, stderr, stdout }) => {
|
|
159
159
|
const basePath = pkgRoot ? resolve(cwd, pkgRoot) : cwd;
|
|
160
160
|
logger.log("Write version %s to package.json in %s", version, basePath);
|
|
161
|
-
const
|
|
161
|
+
const pnpmVersion = getPackageManagerVersion("pnpm");
|
|
162
|
+
const pnpmMajor = major(pnpmVersion);
|
|
163
|
+
debug$7("Detected pnpm major version: %d", pnpmMajor);
|
|
164
|
+
const versionArguments = pnpmMajor >= 10 ? ["pkg", "set", `version=${version}`] : ["version", version, "--no-git-tag-version", "--allow-same-version"];
|
|
165
|
+
const versionResult = execa("pnpm", versionArguments, {
|
|
162
166
|
cwd: basePath,
|
|
163
167
|
env,
|
|
164
168
|
preferLocal: true
|
|
@@ -166,6 +170,15 @@ const prepare$1 = async ({ pkgRoot, tarballDir }, { cwd, env, logger, nextReleas
|
|
|
166
170
|
versionResult.stdout.pipe(stdout, { end: false });
|
|
167
171
|
versionResult.stderr.pipe(stderr, { end: false });
|
|
168
172
|
await versionResult;
|
|
173
|
+
if (pnpmMajor >= 10) {
|
|
174
|
+
const shrinkwrapPath = resolve(basePath, "npm-shrinkwrap.json");
|
|
175
|
+
if (await isAccessible(shrinkwrapPath)) {
|
|
176
|
+
debug$7(`Updating npm-shrinkwrap.json at ${shrinkwrapPath}`);
|
|
177
|
+
const shrinkwrap = await readJson(shrinkwrapPath);
|
|
178
|
+
shrinkwrap.version = version;
|
|
179
|
+
await writeJson(shrinkwrapPath, shrinkwrap, { indent: 2 });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
169
182
|
if (tarballDir) {
|
|
170
183
|
logger.log("Creating npm package version %s", version);
|
|
171
184
|
const packResult = execa("pnpm", ["pack", basePath], { cwd, env, preferLocal: true });
|