@anolilab/semantic-release-pnpm 8.1.20 → 8.1.22

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,25 @@
1
+ ## @anolilab/semantic-release-pnpm [8.1.22](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.21...@anolilab/semantic-release-pnpm@8.1.22) (2026-09-08)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * point every Discord link at the anolilab server ([8cee2ca](https://github.com/anolilab/semantic-release/commit/8cee2ca80ba2b7bac1af7a1ead62441492afa001))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@anolilab/rc:** upgraded to 4.0.8
11
+
12
+ ## @anolilab/semantic-release-pnpm [8.1.21](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.20...@anolilab/semantic-release-pnpm@8.1.21) (2026-08-20)
13
+
14
+ ### Bug Fixes
15
+
16
+ * **semantic-release-pnpm:** bump the version without invoking npm ([e0cb740](https://github.com/anolilab/semantic-release/commit/e0cb740385a380c3b7c165070c4bc4da5d5d1dbb)), closes [#375](https://github.com/anolilab/semantic-release/issues/375)
17
+
18
+ ### Code Refactoring
19
+
20
+ * **semantic-release-pnpm:** write the bumped manifest in a single pass ([106794a](https://github.com/anolilab/semantic-release/commit/106794a45d9974ccfb6327f647352e964a3e16ea))
21
+ * serialize manifests through one shared helper ([18c6e0a](https://github.com/anolilab/semantic-release/commit/18c6e0a8e5658c34d12d444c9b1ed4563cb5b393))
22
+
1
23
  ## @anolilab/semantic-release-pnpm [8.1.20](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-pnpm@8.1.19...@anolilab/semantic-release-pnpm@8.1.20) (2026-08-20)
2
24
 
3
25
 
package/README.md CHANGED
@@ -315,7 +315,7 @@ The anolilab semantic-release-pnpm is open-sourced software licensed under the [
315
315
  [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
316
316
  [prs-welcome]: https://github.com/anolilab/multi-semantic-release/blob/main/.github/CONTRIBUTING.md
317
317
  [chat-badge]: https://img.shields.io/discord/902465130518949899.svg?style=for-the-badge
318
- [chat]: https://discord.gg/TtFJY8xkFK
318
+ [chat]: https://discord.gg/eajEZvk2PG
319
319
  [typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
320
320
  [typescript-url]: https://www.typescriptlang.org/
321
321
  [license-url]: LICENSE.md
package/dist/index.js CHANGED
@@ -23,11 +23,13 @@ const __cjs_getBuiltinModule = (module) => {
23
23
  import dbg from 'debug';
24
24
  import { execa, ExecaError } from 'execa';
25
25
  import { validRange, major, gte } from 'semver';
26
- import { isAccessibleSync, ensureFileSync, isAccessible, readJson, writeJson, move, writeFile } from '@visulima/fs';
26
+ import { isAccessibleSync, ensureFileSync, readFile, readJson, writeFile, isAccessible, writeJson, move } from '@visulima/fs';
27
27
  import { resolve } from '@visulima/path';
28
28
  import { rc } from '@anolilab/rc';
29
29
  import normalizeUrl from 'normalize-url';
30
30
  import { getPackageManagerVersion, findPackageJson } from '@visulima/package';
31
+ import { LF, detect, format } from '@visulima/fs/eol';
32
+ import detectIndent from 'detect-indent';
31
33
  import SemanticReleaseError from '@semantic-release/error';
32
34
  import { stringify } from 'ini';
33
35
  import getAuthToken from 'registry-auth-token';
@@ -159,6 +161,16 @@ const addChannel$1 = async (pluginConfig, packageJson, context) => {
159
161
  return false;
160
162
  };
161
163
 
164
+ const DEFAULT_INDENT = 2;
165
+ const serializeManifest = (data, original) => {
166
+ if (!original) {
167
+ return `${JSON.stringify(data, void 0, DEFAULT_INDENT)}${LF}`;
168
+ }
169
+ const eol = detect(original) ?? LF;
170
+ const serialized = JSON.stringify(data, void 0, detectIndent(original).indent);
171
+ return format(serialized, eol) + (original.endsWith("\n") ? eol : "");
172
+ };
173
+
162
174
  const debug$7 = dbg("semantic-release-pnpm:prepare");
163
175
  const prepare$1 = async ({ pkgRoot, tarballDir }, { cwd, env, logger, nextRelease: { version }, stderr, stdout }) => {
164
176
  const basePath = pkgRoot ? resolve(cwd, pkgRoot) : cwd;
@@ -166,17 +178,12 @@ const prepare$1 = async ({ pkgRoot, tarballDir }, { cwd, env, logger, nextReleas
166
178
  const pnpmVersion = getPackageManagerVersion("pnpm");
167
179
  const pnpmMajor = major(pnpmVersion);
168
180
  debug$7("Detected pnpm major version: %d", pnpmMajor);
169
- const versionBin = pnpmMajor >= 10 ? "npm" : "pnpm";
170
- const versionArguments = pnpmMajor >= 10 ? ["pkg", "set", `version=${version}`] : ["version", version, "--no-git-tag-version", "--allow-same-version"];
171
- const versionResult = execa(versionBin, versionArguments, {
172
- cwd: basePath,
173
- env,
174
- preferLocal: true
175
- });
176
- versionResult.stdout.pipe(stdout, { end: false });
177
- versionResult.stderr.pipe(stderr, { end: false });
178
- await versionResult;
179
181
  if (pnpmMajor >= 10) {
182
+ const packagePath = resolve(basePath, "package.json");
183
+ const packageContent = await readFile(packagePath);
184
+ const packageJson = await readJson(packagePath);
185
+ packageJson.version = version;
186
+ await writeFile(packagePath, serializeManifest(packageJson, packageContent));
180
187
  const shrinkwrapPath = resolve(basePath, "npm-shrinkwrap.json");
181
188
  if (await isAccessible(shrinkwrapPath)) {
182
189
  debug$7(`Updating npm-shrinkwrap.json at ${shrinkwrapPath}`);
@@ -184,6 +191,15 @@ const prepare$1 = async ({ pkgRoot, tarballDir }, { cwd, env, logger, nextReleas
184
191
  shrinkwrap.version = version;
185
192
  await writeJson(shrinkwrapPath, shrinkwrap, { indent: 2 });
186
193
  }
194
+ } else {
195
+ const versionResult = execa("pnpm", ["version", version, "--no-git-tag-version", "--allow-same-version"], {
196
+ cwd: basePath,
197
+ env,
198
+ preferLocal: true
199
+ });
200
+ versionResult.stdout.pipe(stdout, { end: false });
201
+ versionResult.stderr.pipe(stderr, { end: false });
202
+ await versionResult;
187
203
  }
188
204
  if (tarballDir) {
189
205
  logger.log("Creating npm package version %s", version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/semantic-release-pnpm",
3
- "version": "8.1.20",
3
+ "version": "8.1.22",
4
4
  "description": "Semantic-release plugin to publish a npm package with pnpm.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -61,12 +61,13 @@
61
61
  ],
62
62
  "dependencies": {
63
63
  "@actions/core": "3.0.1",
64
- "@anolilab/rc": "4.0.7",
64
+ "@anolilab/rc": "4.0.8",
65
65
  "@semantic-release/error": "^4.0.0",
66
66
  "@visulima/fs": "^5.1.0",
67
67
  "@visulima/package": "5.0.11",
68
68
  "@visulima/path": "^3.0.0",
69
69
  "debug": "^4.4.3",
70
+ "detect-indent": "^7.0.2",
70
71
  "env-ci": "^11.2.0",
71
72
  "execa": "^10.0.1",
72
73
  "ini": "^7.0.0",