zx-bulk-release 3.1.8 → 3.1.9
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 +5 -0
- package/README.md +2 -2
- package/package.json +7 -13
- package/src/main/js/config.js +36 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [3.1.9](https://github.com/semrel-extra/zx-bulk-release/compare/v3.1.8...v3.1.9) (2026-04-13)
|
|
2
|
+
|
|
3
|
+
### Fixes & improvements
|
|
4
|
+
* perf: replace cosmiconfig with own config reader ([f980590](https://github.com/semrel-extra/zx-bulk-release/commit/f980590edbf9aa9311110207e24849c6373c0feb))
|
|
5
|
+
|
|
1
6
|
## [3.1.8](https://github.com/semrel-extra/zx-bulk-release/compare/v3.1.7...v3.1.8) (2026-04-13)
|
|
2
7
|
|
|
3
8
|
### Fixes & improvements
|
package/README.md
CHANGED
|
@@ -212,8 +212,8 @@ await run({
|
|
|
212
212
|
```
|
|
213
213
|
|
|
214
214
|
## Config
|
|
215
|
-
###
|
|
216
|
-
|
|
215
|
+
### Config files
|
|
216
|
+
[cosmiconfig](https://github.com/davidtheclark/cosmiconfig)-compatible lookup: `.releaserc`, `.release.json`, `.release.yaml`, `.releaserc.js`, `release.config.js`, or `release` key in `package.json`. Searched from the package root up to the repo root.
|
|
217
217
|
```json
|
|
218
218
|
{
|
|
219
219
|
"buildCmd": "yarn && yarn build",
|
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.
|
|
4
|
+
"version": "3.1.9",
|
|
5
5
|
"description": "zx-based alternative for multi-semantic-release",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -19,25 +19,24 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"test": "npm run test:unit",
|
|
22
|
-
"test:unit": "
|
|
22
|
+
"test:unit": "vitest run --dir src/test/js --exclude '**/integration*' --exclude '**/fixtures/**' --exclude '**/utils/**'",
|
|
23
23
|
"test:it": "node ./src/test/js/integration.test.js",
|
|
24
|
-
"test:cov": "
|
|
24
|
+
"test:cov": "vitest run --coverage --dir src/test/js --exclude '**/fixtures/**' --exclude '**/utils/**'",
|
|
25
25
|
"docs": "mkdir -p docs && cp ./README.md ./docs/README.md",
|
|
26
26
|
"publish:beta": "npm publish --tag beta --no-git-tag-version",
|
|
27
27
|
"build": "esbuild src/main/js/index.js --platform=node --outdir=target --bundle --format=esm --external:typescript"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@semrel-extra/topo": "^1.14.1",
|
|
31
|
-
"cosmiconfig": "^9.0.1",
|
|
32
31
|
"queuefy": "^1.2.1",
|
|
33
32
|
"tar-stream": "^3.1.8",
|
|
34
33
|
"zx-extra": "4.0.20"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"
|
|
36
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
38
37
|
"esbuild": "^0.28.0",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
38
|
+
"verdaccio": "6.5.0",
|
|
39
|
+
"vitest": "^4.1.4"
|
|
41
40
|
},
|
|
42
41
|
"publishConfig": {
|
|
43
42
|
"access": "public"
|
|
@@ -47,10 +46,5 @@
|
|
|
47
46
|
"url": "git+https://github.com/semrel-extra/zx-bulk-release.git"
|
|
48
47
|
},
|
|
49
48
|
"author": "Anton Golub <antongolub@antongolub.com>",
|
|
50
|
-
"license": "MIT"
|
|
51
|
-
"c8": {
|
|
52
|
-
"exclude": [
|
|
53
|
-
"src/test/**"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
49
|
+
"license": "MIT"
|
|
56
50
|
}
|
package/src/main/js/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fs, path, YAML } from 'zx'
|
|
2
2
|
import { asArray, camelize, memoizeBy } from './util.js'
|
|
3
3
|
import { GH_URL, resolveGhApiUrl } from './post/api/gh.js'
|
|
4
4
|
import { DEFAULT_GIT_COMMITTER_NAME, DEFAULT_GIT_COMMITTER_EMAIL } from './post/api/git.js'
|
|
@@ -29,12 +29,41 @@ export const defaultConfig = {
|
|
|
29
29
|
export const getPkgConfig = async (cwd, env) =>
|
|
30
30
|
normalizePkgConfig((await Promise.all(asArray(cwd).map(readPkgConfig))).find(Boolean) || defaultConfig, env)
|
|
31
31
|
|
|
32
|
-
export const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
export const cosmiconfig = (name, {searchPlaces}) => {
|
|
33
|
+
const load = async (filePath) => {
|
|
34
|
+
if (filePath.endsWith('.js') || filePath.endsWith('.cjs'))
|
|
35
|
+
return (await import(filePath)).default
|
|
36
|
+
const raw = await fs.readFile(filePath, 'utf8')
|
|
37
|
+
if (filePath.endsWith('.yaml') || filePath.endsWith('.yml'))
|
|
38
|
+
return YAML.parse(raw)
|
|
39
|
+
try { return JSON.parse(raw) } catch { return YAML.parse(raw) }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const search = async (cwd) => {
|
|
43
|
+
let dir = path.resolve(cwd)
|
|
44
|
+
while (true) {
|
|
45
|
+
for (const file of searchPlaces) {
|
|
46
|
+
const filePath = path.resolve(dir, file)
|
|
47
|
+
if (!await fs.pathExists(filePath)) continue
|
|
48
|
+
if (file === 'package.json') {
|
|
49
|
+
const pkg = await fs.readJson(filePath)
|
|
50
|
+
if (pkg[name]) return pkg[name]
|
|
51
|
+
continue
|
|
52
|
+
}
|
|
53
|
+
return load(filePath)
|
|
54
|
+
}
|
|
55
|
+
const parent = path.dirname(dir)
|
|
56
|
+
if (parent === dir) return
|
|
57
|
+
dir = parent
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {search}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const readPkgConfig = memoizeBy(async (cwd) =>
|
|
65
|
+
cosmiconfig(CONFIG_NAME, {searchPlaces: CONFIG_FILES}).search(cwd)
|
|
66
|
+
)
|
|
38
67
|
|
|
39
68
|
export const normalizePkgConfig = (config, env) => {
|
|
40
69
|
const envConfig = parseEnv(env)
|