zx-bulk-release 3.3.1 → 4.0.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 CHANGED
@@ -1,3 +1,25 @@
1
+ ## [4.0.1](https://github.com/semrel-extra/zx-bulk-release/compare/v4.0.0...v4.0.1) (2026-10-12)
2
+
3
+ ### Fixes & improvements
4
+ * fix(pack): replace manifests atomically, siblings never read a torn package.json ([01f9784](https://github.com/semrel-extra/zx-bulk-release/commit/01f9784fc702b167e941840d99d1ee5e243a3986))
5
+
6
+ ## [4.0.0](https://github.com/semrel-extra/zx-bulk-release/compare/v3.3.0...v4.0.0) (2026-10-12)
7
+
8
+ ### Features
9
+ * feat: v4 ([ab56758](https://github.com/semrel-extra/zx-bulk-release/commit/ab567580f75924c9196419e0994f2e699fbc25ef))
10
+
11
+ ### BREAKING CHANGES
12
+ * significant internal refactoring ([ab56758](https://github.com/semrel-extra/zx-bulk-release/commit/ab567580f75924c9196419e0994f2e699fbc25ef))
13
+
14
+ ### Fixes & improvements
15
+ * fix: settle before exiting in every mode; preflight analyzes from fetched tags ([049647c](https://github.com/semrel-extra/zx-bulk-release/commit/049647ce3acc5e43f7ff6cbb0ef364cc375b4cff))
16
+ * fix(verify): bind the directive and every parcel to the trusted context ([167f70a](https://github.com/semrel-extra/zx-bulk-release/commit/167f70ad34d407b65a0e43cb1d8aa7260b1e285b))
17
+ * fix(courier): one executor — claim before act, settle before deciding ([ca12cf1](https://github.com/semrel-extra/zx-bulk-release/commit/ca12cf180f7f601f7bd1090c4989e8acf39df597))
18
+ * fix(courier): claim tags at the release commit, decide by the remote state ([95d9746](https://github.com/semrel-extra/zx-bulk-release/commit/95d974638b9045fbfce947fc41290abc9f5d5a6c))
19
+ * fix(git): one writer per repo, identity via env, retries from the remote tip ([164b356](https://github.com/semrel-extra/zx-bulk-release/commit/164b356bafac7db2c43c70f3fe2b873a52dc1979))
20
+ * fix: print every failure once, redacted, and keep queued calls in their caller context ([3c2d0cf](https://github.com/semrel-extra/zx-bulk-release/commit/3c2d0cfaa0c4125d1393d1c190f716eabcbb4433))
21
+ * fix(verify): check package identity of parcels ([18a83a2](https://github.com/semrel-extra/zx-bulk-release/commit/18a83a24dd2248b423f475923bc48c40be563b97))
22
+
1
23
  ## [3.3.1](https://github.com/semrel-extra/zx-bulk-release/compare/v3.3.0...v3.3.1) (2026-10-12)
2
24
 
3
25
  ### Fixes & improvements
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "3.3.1",
4
+ "version": "4.0.1",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -29,15 +29,15 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@semrel-extra/topo": "^1.14.1",
32
- "tar-stream": "^3.2.1",
32
+ "tar-stream": "^3.2.2",
33
33
  "zx-extra": "4.0.20"
34
34
  },
35
35
  "devDependencies": {
36
- "@vitest/coverage-v8": "^5.0.3",
36
+ "@vitest/coverage-v8": "^5.0.4",
37
37
  "esbuild": "^0.28.2",
38
38
  "verdaccio": "6.10.5",
39
- "vite": "^8.3.2",
40
- "vitest": "^5.0.3"
39
+ "vite": "^8.3.4",
40
+ "vitest": "^5.0.4"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -1,4 +1,5 @@
1
1
  import zlib from 'node:zlib'
2
+ import {randomUUID} from 'node:crypto'
2
3
  import _fs from 'node:fs/promises'
3
4
  import _path from 'node:path'
4
5
  import tar from 'tar-stream'
@@ -69,13 +70,29 @@ export const fetchManifest = async (pkg, {nothrow} = {}) => {
69
70
  export const npmPersist = async (pkg) => {
70
71
  const {name, version, manifest, manifestAbsPath} = pkg
71
72
  log.info(`updating ${manifestAbsPath} inners: ${name} ${version}`)
72
- await fs.writeJson(manifestAbsPath, manifest, {spaces: 2})
73
+ await replaceFile(manifestAbsPath, JSON.stringify(manifest, null, 2) + '\n')
73
74
  }
74
75
 
75
76
  export const npmRestore = async (pkg) => {
76
77
  const {manifestRaw, manifestAbsPath} = pkg
77
78
  log.info(`rolling back ${manifestAbsPath} inners to manifestRaw`)
78
- await fs.writeFile(manifestAbsPath, manifestRaw, {encoding: 'utf8'})
79
+ await replaceFile(manifestAbsPath, manifestRaw)
80
+ }
81
+
82
+ // Packages go in parallel, and npm (yarn, pnpm) in any of them reads every manifest of the workspace:
83
+ // a reader sees the old file or the new one, never a torn one. A symlinked manifest stays a symlink.
84
+ const replaceFile = async (file, data) => {
85
+ const target = await fs.realpath(file)
86
+ const {mode} = await fs.stat(target)
87
+ const tmp = `${target}.${randomUUID()}.tmp`
88
+ try {
89
+ await fs.writeFile(tmp, data, 'utf8')
90
+ await fs.chmod(tmp, mode & 0o7777)
91
+ await fs.rename(tmp, target)
92
+ } catch (e) {
93
+ await fs.rm(tmp, {force: true})
94
+ throw e
95
+ }
79
96
  }
80
97
 
81
98
  export const npmPublish = async (pkg) => {