zx-bulk-release 2.13.0-beta.5 → 2.13.0

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,17 @@
1
+ ## [2.13.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.12.2...v2.13.0) (2023-12-05)
2
+
3
+ ### Fixes & improvements
4
+ * fix: avoid polynomial regex on flags parsing ([c080fb8](https://github.com/semrel-extra/zx-bulk-release/commit/c080fb8246d71ad5e366ae6931b06db3ff86233b))
5
+ * fix: sanitize paths on extract ([3f67b9f](https://github.com/semrel-extra/zx-bulk-release/commit/3f67b9f89b44589930c5dcce96237c0c5c3294f1))
6
+ * refactor: decompose processor.js ([a498a7f](https://github.com/semrel-extra/zx-bulk-release/commit/a498a7f5900396e42b6b2a6478028e128ab6ec1f))
7
+ * fix: throw error if declared gh asset is empty ([d2dc6f6](https://github.com/semrel-extra/zx-bulk-release/commit/d2dc6f6b457a3178671b0d6349d42234b8052c7e))
8
+ * fix: handle empty files collection on gh assets push ([c9dbb5b](https://github.com/semrel-extra/zx-bulk-release/commit/c9dbb5bf3c5b4ff4ce11603e541feae784574f10))
9
+ * perf: replace external `curl`, `wget` and `tar` with node `fetch` and `tar-stream` ([496c73b](https://github.com/semrel-extra/zx-bulk-release/commit/496c73b68172c42e5930d185f1008d487928e7fc))
10
+
11
+ ### Features
12
+ * feat: configurable meta push ([0042af3](https://github.com/semrel-extra/zx-bulk-release/commit/0042af34d31ff6d3783c3953ece167a9dc78fb45))
13
+ * feat: let release meta be published as gh assets ([3d333e1](https://github.com/semrel-extra/zx-bulk-release/commit/3d333e1fb6d61adb5bd05ac3a90e19a3a5402843))
14
+
1
15
  ## [2.12.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.12.1...v2.12.2) (2023-11-20)
2
16
 
3
17
  ### Fixes & improvements
package/README.md CHANGED
@@ -210,8 +210,11 @@ Anyway, it's still possible to override the default config by `tagFormat` option
210
210
 
211
211
 
212
212
  ### Meta
213
+ Each release gathers its own meta. It is _recommended_ to store the data somehow to ensure flow reliability.:
214
+ * Set `meta: {type: 'asset'}` to persist as gh asset.
215
+ * If set `meta: {type: null}` the required data will be fetched from the npm artifact.
216
+ * Otherwise, it will be pushed as a regular git commit to the `meta` branch (default behaviour).
213
217
 
214
- Each release pushes its result to the `meta` branch.
215
218
  `2022-6-26-semrel-extra-zxbr-test-c-1-3-1-f0.json`
216
219
  ```json
217
220
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "2.13.0-beta.5",
4
+ "version": "2.13.0",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -35,7 +35,7 @@
35
35
  "c8": "^8.0.1",
36
36
  "esbuild": "^0.19.8",
37
37
  "uvu": "^0.5.6",
38
- "verdaccio": "^5.27.0"
38
+ "verdaccio": "^5.27.1"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -53,7 +53,7 @@ export const subsWorkspace = (decl, actual) => {
53
53
 
54
54
  export const topo = async ({flags = {}, cwd} = {}) => {
55
55
  const ignore = typeof flags.ignore === 'string'
56
- ? flags.ignore.split(/\s*,\s*/)
56
+ ? flags.ignore.split(',').map(c => c.trim())
57
57
  : Array.isArray(flags.ignore)
58
58
  ? flags.ignore
59
59
  : []
@@ -34,11 +34,16 @@ export const prepareMeta = async (pkg) => {
34
34
  }
35
35
 
36
36
  export const pushMeta = queuefy(async (pkg) => {
37
+ const {type} = pkg.config.meta
38
+
39
+ if (type === null) {
40
+ return
41
+ }
42
+
37
43
  if (!pkg.meta) {
38
44
  await prepareMeta(pkg)
39
45
  }
40
46
 
41
- const {type} = pkg.config.meta
42
47
  if (type === 'asset' || type === 'assets') {
43
48
  pkg.config.ghAssets = [...pkg.config.ghAssets || [], {
44
49
  name: 'meta.json',
@@ -66,13 +66,15 @@ export const getCommonPath = files => {
66
66
  return p.slice(0, p.lastIndexOf('/') + 1)
67
67
  }
68
68
 
69
+ export const safePath = v => path.resolve('/', v).slice(1)
70
+
69
71
  // https://stackoverflow.com/questions/19978452/how-to-extract-single-file-from-tar-gz-archive-using-node-js
70
72
  export const unzip = (stream, {pick, omit, cwd = process.cwd(), strip = 0} = {}) => new Promise((resolve, reject) => {
71
73
  const extract = tar.extract()
72
74
  const results = []
73
75
 
74
76
  extract.on('entry', ({name, type}, stream, cb)=> {
75
- const _name = strip ? name.split('/').slice(strip).join('/') : name
77
+ const _name = safePath(strip ? name.split('/').slice(strip).join('/') : name)
76
78
  const fp = path.join(cwd, _name)
77
79
 
78
80
  let data = ''