bulk-release 2.14.0 → 2.15.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,13 @@
1
+ ## [2.15.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.15.0...v2.15.1) (2024-02-09)
2
+
3
+ ### Fixes & improvements
4
+ * perf: apply npmRestore to updated pkgs only ([daa4080](https://github.com/semrel-extra/zx-bulk-release/commit/daa4080f402a4a68ce97e21089dde98995c23486))
5
+
6
+ ## [2.15.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.14.0...v2.15.0) (2024-02-08)
7
+
8
+ ### Features
9
+ * feat: separate test and build steps ([3024a60](https://github.com/semrel-extra/zx-bulk-release/commit/3024a601adc7e2e819149c01c29d813d4467947a))
10
+
1
11
  ## [2.14.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.13.3...v2.14.0) (2023-12-19)
2
12
 
3
13
  ### Features
package/README.md CHANGED
@@ -44,6 +44,7 @@ GH_TOKEN=ghtoken GH_USER=username NPM_TOKEN=npmtoken npx zx-bulk-release [opts]
44
44
  | `--include-private` | Include `private` packages | `false` |
45
45
  | `--concurrency` | `build/publish` threads limit | `os.cpus.length` |
46
46
  | `--no-build` | Skip `buildCmd` invoke | |
47
+ | `--no-test` | Disable `testCmd` run | |
47
48
  | `--no-npm-fetch` | Disable npm artifacts fetching | |
48
49
  | `--only-workspace-deps` | Recognize only `workspace:` deps as graph edges | |
49
50
  | `--dry-run` / `--no-publish` | Disable any publish logic | |
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "2.14.0",
4
+ "version": "2.15.1",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -28,12 +28,12 @@
28
28
  "@semrel-extra/topo": "^1.14.1",
29
29
  "cosmiconfig": "^9.0.0",
30
30
  "queuefy": "^1.2.1",
31
- "tar-stream": "^3.1.6",
31
+ "tar-stream": "^3.1.7",
32
32
  "zx-extra": "^2.6.4"
33
33
  },
34
34
  "devDependencies": {
35
- "c8": "^8.0.1",
36
- "esbuild": "^0.19.9",
35
+ "c8": "^9.1.0",
36
+ "esbuild": "^0.20.0",
37
37
  "uvu": "^0.5.6",
38
38
  "verdaccio": "^5.29.0"
39
39
  },
@@ -3,7 +3,7 @@ import {log} from '../log.js'
3
3
  import {$} from 'zx-extra'
4
4
 
5
5
  export const exec = async (pkg, name) => {
6
- const cmd = tpl(pkg.config[name], {...pkg, ...pkg.context})
6
+ const cmd = tpl(pkg.context.flags[name] ?? pkg.config[name], {...pkg, ...pkg.context})
7
7
  const now = Date.now()
8
8
 
9
9
  if (cmd) {
@@ -10,6 +10,7 @@ import {analyze} from '../steps/analyze.js'
10
10
  import {build} from '../steps/build.js'
11
11
  import {publish} from '../steps/publish.js'
12
12
  import {clean} from '../steps/clean.js'
13
+ import {test} from '../steps/test.js'
13
14
 
14
15
  export const run = async ({cwd = process.cwd(), env, flags = {}} = {}) => within(async () => {
15
16
  const {version: zbrVersion} = createRequire(import.meta.url)('../../../../package.json')
@@ -48,12 +49,17 @@ export const run = async ({cwd = process.cwd(), env, flags = {}} = {}) => within
48
49
 
49
50
  if (!pkg.releaseType) {
50
51
  report.setStatus('skipped', name)
52
+ pkg.skipped = true
51
53
  return
52
54
  }
53
55
  if (flags.build !== false) {
54
56
  report.setStatus('building', name)
55
57
  await build(pkg, _exec)
56
58
  }
59
+ if (flags.test !== false) {
60
+ report.setStatus('testing', name)
61
+ await test(pkg, _exec)
62
+ }
57
63
  if (!flags.dryRun && flags.publish !== false) {
58
64
  report.setStatus('publishing', name)
59
65
  await publish(pkg, _exec)
@@ -16,7 +16,7 @@ export const build = memoizeBy(async (pkg, run = exec, flags = {}, self = build)
16
16
 
17
17
  if (!pkg.fetched) {
18
18
  await run(pkg, 'buildCmd')
19
- await run(pkg, 'testCmd')
19
+ // await run(pkg, 'testCmd')
20
20
  }
21
21
 
22
22
  pkg.built = true
@@ -3,5 +3,5 @@ import {npmRestore} from '../api/npm.js'
3
3
 
4
4
  export const clean = async (cwd, packages) => {
5
5
  await unsetUserConfig(cwd)
6
- await Promise.all(Object.values(packages).map(npmRestore))
6
+ await Promise.all(Object.values(packages).filter(pkg => !pkg.skipped).map(npmRestore))
7
7
  }
@@ -0,0 +1,16 @@
1
+ import {$, within} from 'zx-extra'
2
+ import {memoizeBy} from '../util.js'
3
+ import {exec} from '../processor/exec.js'
4
+ // import {traverseDeps} from "../processor/deps.js";
5
+
6
+ export const test = memoizeBy(async (pkg, run = exec, flags = {}, self = test) => within(async () => {
7
+ $.scope = pkg.name
8
+
9
+ // await traverseDeps({pkg, packages: pkg.context.packages, cb: async({pkg}) => self(pkg, run, flags, self)})
10
+
11
+ if (!pkg.fetched) {
12
+ await run(pkg, 'testCmd')
13
+ }
14
+
15
+ pkg.tested = true
16
+ }))