zx-bulk-release 3.1.1 → 3.1.2

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,10 @@
1
+ ## [3.1.2](https://github.com/semrel-extra/zx-bulk-release/compare/v3.1.1...v3.1.2) (2026-04-13)
2
+
3
+ ### Fixes & improvements
4
+ * perf: append pkg scope to internal zx logs ([08471b9](https://github.com/semrel-extra/zx-bulk-release/commit/08471b9c87d9ef2bf24b30a99977c308cee1feaf))
5
+ * perf: update default zx ctx file name ([9857dcd](https://github.com/semrel-extra/zx-bulk-release/commit/9857dcdcf9d1e5221eb3fc62f4919a8af2b885fc))
6
+ * refactor: enhance cli ([8909ab2](https://github.com/semrel-extra/zx-bulk-release/commit/8909ab2496402102b33fa134275ac415b6d8297a))
7
+
1
8
  ## [3.1.1](https://github.com/semrel-extra/zx-bulk-release/compare/v3.1.0...v3.1.1) (2026-04-12)
2
9
 
3
10
  ### Fixes & improvements
package/README.md CHANGED
@@ -44,10 +44,10 @@ GH_TOKEN=ghtoken GH_USER=username NPM_TOKEN=npmtoken npx zx-bulk-release [opts]
44
44
  ```
45
45
  | Flag | Description | Default |
46
46
  |------------------------------|---------------------------------------------------------------------------------------------------|------------------|
47
- | `--receive` | Consume rebuild signal, analyze, preflight. Writes `.zbr-context.json`. Run before deps install. | |
47
+ | `--receive` | Consume rebuild signal, analyze, preflight. Writes `zbr-context.json`. Run before deps install. | |
48
48
  | `--pack [dir]` | Pack only: build, test, and write delivery tars to `dir`. No credentials needed. | `parcels` |
49
49
  | `--verify [dir]` | Verify untrusted parcels against context, copy valid ones to `parcels/`. Use `--context` for path. | `parcels` |
50
- | `--context <path>` | Path to trusted `.zbr-context.json` (used with `--verify`). | `.zbr-context.json` |
50
+ | `--context <path>` | Path to trusted `zbr-context.json` (used with `--verify`). | `zbr-context.json` |
51
51
  | `--deliver [dir]` | Deliver only: read tars from `dir` and run delivery channels. No source code needed. | `parcels` |
52
52
  | `--ignore` | Packages to ignore: `a, b` | |
53
53
  | `--include-private` | Include `private` packages | `false` |
@@ -152,7 +152,7 @@ jobs:
152
152
  - uses: actions/upload-artifact@v4
153
153
  with:
154
154
  name: context-${{ github.run_id }}
155
- path: .zbr-context.json
155
+ path: zbr-context.json
156
156
 
157
157
  # pack — deps installed, hostile code may run, zero credentials
158
158
  - if: steps.receive.outputs.status == 'proceed'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "3.1.1",
4
+ "version": "3.1.2",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -1,7 +1,51 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import {argv} from 'zx-extra'
4
- import {run} from './index.js'
4
+ import {run, version} from './index.js'
5
5
  import {normalizeFlags} from './config.js'
6
6
 
7
- run({flags: normalizeFlags(argv)})
7
+ const flags = normalizeFlags(argv)
8
+
9
+ if (flags.h || flags.help) {
10
+ console.log(`zx-bulk-release v${version}
11
+
12
+ Usage: npx zx-bulk-release [options]
13
+
14
+ Modes:
15
+ (no flags) All-in-one: analyze, build, test, pack, deliver
16
+ --receive Analyze & preflight, write zbr-context.json. Run BEFORE deps install
17
+ --pack [dir] Build, test, pack tars to dir [default: parcels]
18
+ --verify [input-dir] Validate parcels against context, copy valid to parcels/ [default: parcels]
19
+ --deliver [dir] Deliver parcels through channels [default: parcels]
20
+
21
+ Options:
22
+ --context <path> Trusted context path (with --verify) [default: zbr-context.json]
23
+ --dry-run, --no-publish Disable publish and any remote-mutating operations
24
+ --no-build Skip buildCmd
25
+ --no-test Skip testCmd
26
+ --snapshot Publish snapshot versions to npm only
27
+ --ignore <a,b> Packages to ignore
28
+ --include-private Include private packages
29
+ --concurrency <n> Build/publish thread limit [default: os.cpus().length]
30
+ --only-workspace-deps Recognize only workspace: deps as graph edges
31
+ --no-npm-fetch Disable npm artifact fetching
32
+ --report <path> Persist release state to file
33
+ --debug Enable verbose mode
34
+ -v, --version Print version
35
+ -h, --help Show this help`)
36
+ process.exit(0)
37
+ }
38
+
39
+ if (flags.v || flags.version) {
40
+ console.log(version)
41
+ process.exit(0)
42
+ }
43
+
44
+ try {
45
+ await run({flags})
46
+ process.exit(0)
47
+ } catch (e) {
48
+ if (e?.exitCode !== undefined) process.exit(e.exitCode)
49
+ console.error(e)
50
+ process.exit(1)
51
+ }
@@ -1 +1 @@
1
- export {run} from './post/release.js'
1
+ export {run, version} from './post/release.js'
@@ -1,6 +1,6 @@
1
1
  import {fs, path} from 'zx-extra'
2
2
 
3
- export const CONTEXT_FILE = '.zbr-context.json'
3
+ export const CONTEXT_FILE = 'zbr-context.json'
4
4
 
5
5
  export const writeContext = async (cwd, context) => {
6
6
  const filePath = path.resolve(cwd, CONTEXT_FILE)
@@ -1,7 +1,7 @@
1
1
  // Meta generator: builds pkg.meta payload and resolves latest-release meta from git tags / gh assets / meta branch.
2
2
 
3
3
  import {semver, $, fs, path} from 'zx-extra'
4
- import {fetchRepo, getTags as getGitTags, getRepo} from '../../api/git.js'
4
+ import {fetchRepo, getTags as getGitTags, getRepo, getSha} from '../../api/git.js'
5
5
  import {fetchManifest} from '../../api/npm.js'
6
6
  import {ghGetAsset} from '../../api/gh.js'
7
7
  import {parseTag} from './tag.js'
@@ -16,7 +16,7 @@ export const prepareMeta = async (pkg) => {
16
16
  if (type === null) return
17
17
 
18
18
  const {absPath: cwd} = pkg
19
- const hash = (await $.o({cwd})`git rev-parse HEAD`).toString().trim()
19
+ const hash = await getSha(cwd)
20
20
  pkg.meta = {
21
21
  META_VERSION: '1',
22
22
  hash,
@@ -42,9 +42,9 @@ export const contextify = async (pkg, ctx) => {
42
42
  pkg.ctx = {
43
43
  ...ctx,
44
44
  git: {
45
- sha: await getSha(pkg.absPath),
46
- root: await getRoot(pkg.absPath),
47
- timestamp: await getCommitTimestamp(pkg.absPath),
45
+ sha: await getSha(ctx.cwd),
46
+ root: await getRoot(ctx.cwd),
47
+ timestamp: await getCommitTimestamp(ctx.cwd),
48
48
  },
49
49
  }
50
50
  }
@@ -14,46 +14,21 @@ import {runPack} from './modes/pack.js'
14
14
 
15
15
  const ZBR_VERSION = createRequire(import.meta.url)('../../../../package.json').version
16
16
 
17
- const HELP = `
18
- zx-bulk-release v${ZBR_VERSION}
19
-
20
- Usage: npx zx-bulk-release [options]
21
-
22
- Modes:
23
- (no flags) All-in-one: analyze, build, test, pack, deliver
24
- --receive Analyze & preflight. Writes .zbr-context.json. Run BEFORE deps install.
25
- --pack [dir] Build, test, pack tars to dir. [default: parcels]
26
- --verify [dir] Validate parcels against context, copy to parcels/. [default: parcels]
27
- --deliver [dir] Deliver parcels through channels. [default: parcels]
28
-
29
- Options:
30
- --context <path> Path to .zbr-context.json (with --verify). [default: .zbr-context.json]
31
- --dry-run, --no-publish Disable any publish / remote-mutating logic.
32
- --no-build Skip buildCmd.
33
- --no-test Skip testCmd.
34
- --snapshot Publish snapshot versions to npm only.
35
- --ignore <a,b> Packages to ignore.
36
- --include-private Include private packages.
37
- --concurrency <n> Build/publish thread limit. [default: os.cpus().length]
38
- --only-workspace-deps Recognize only workspace: deps as graph edges.
39
- --no-npm-fetch Disable npm artifact fetching.
40
- --report <path> Persist release state to file.
41
- --debug Enable verbose mode.
42
- -v, --version Print version.
43
- -h, --help Show this help.
44
- `.trim()
17
+ export {ZBR_VERSION as version}
45
18
 
46
19
  export const run = async ({cwd = process.cwd(), env: _env, flags = {}} = {}) => within(async () => {
47
- if (flags.h || flags.help)
48
- return console.log(HELP)
49
-
50
- if (flags.v || flags.version)
51
- return console.log(ZBR_VERSION)
52
-
53
20
  const env = {...process.env, ..._env}
54
21
  log.secret(env.GH_TOKEN, env.GITHUB_TOKEN, env.NPM_TOKEN)
55
22
  log.info(`zx-bulk-release@${ZBR_VERSION}`)
56
23
 
24
+ const _log = $.log
25
+ $.log = (entry) => {
26
+ if (entry.kind === 'cmd' && $.scope) {
27
+ entry = {...entry, cmd: `[${$.scope}] ${entry.cmd}`}
28
+ }
29
+ _log(entry)
30
+ }
31
+
57
32
  if (flags.verify) return runVerify({cwd, flags})
58
33
  if (flags.deliver) return runDeliver({env, flags})
59
34