zx-bulk-release 2.2.8 → 2.2.10

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.2.10](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.9...v2.2.10) (2023-03-24)
2
+
3
+ ### Fixes & improvements
4
+ * fix: debug point for publish step ([c4eedf9](https://github.com/semrel-extra/zx-bulk-release/commit/c4eedf9ddbe2120961ffc5f55b723cbbdc41cef8))
5
+
6
+ ## [2.2.9](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.8...v2.2.9) (2023-03-24)
7
+
8
+ ### Fixes & improvements
9
+ * refactor: wrap git pushers with queuefy ([2e9355f](https://github.com/semrel-extra/zx-bulk-release/commit/2e9355f69724a8ba097024456cbe5a80f37ea2a7))
10
+
1
11
  ## [2.2.8](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.7...v2.2.8) (2023-03-24)
2
12
 
3
13
  ### Fixes & improvements
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
- "version": "2.2.8",
3
+ "version": "2.2.10",
4
4
  "description": "zx-based alternative for multi-semantic-release",
5
5
  "type": "module",
6
6
  "exports": {
@@ -4,7 +4,7 @@ import {formatTag} from './meta.js';
4
4
  import {log} from './log.js'
5
5
  import {getCommits} from './git.js'
6
6
 
7
- export const analyze = async (pkg, packages) => {
7
+ export const analyze = async (pkg) => {
8
8
  const semanticChanges = await getSemanticChanges(pkg.absPath, pkg.latest.tag?.ref)
9
9
  const depsChanges = await updateDeps(pkg, pkg.context.packages)
10
10
  const changes = [...semanticChanges, ...depsChanges]
package/src/main/js/gh.js CHANGED
@@ -1,8 +1,9 @@
1
+ import {queuefy} from 'queuefy'
2
+ import {$, path} from 'zx-extra'
1
3
  import {log} from './log.js'
2
4
  import {getRepo, pushCommit} from './git.js'
3
5
  import {formatTag} from './meta.js'
4
6
  import {formatReleaseNotes} from './changelog.js'
5
- import {$, path} from 'zx-extra'
6
7
  import {msgJoin} from './util.js'
7
8
 
8
9
  export const ghRelease = async (pkg) => {
@@ -24,7 +25,7 @@ export const ghRelease = async (pkg) => {
24
25
  await $.o({cwd})`curl -H 'Authorization: token ${ghToken}' -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${repoName}/releases -d ${releaseData}`
25
26
  }
26
27
 
27
- export const ghPages = async (pkg) => {
28
+ export const ghPages = queuefy(async (pkg) => {
28
29
  const {config: {ghPages: opts, gitCommitterEmail, gitCommitterName, ghBasicAuth: basicAuth}} = pkg
29
30
  if (!opts) return
30
31
 
@@ -45,4 +46,4 @@ export const ghPages = async (pkg) => {
45
46
  gitCommitterName,
46
47
  basicAuth
47
48
  })
48
- }
49
+ })
@@ -1,7 +1,6 @@
1
1
  import {$, ctx, fs, path, tempy, copy} from 'zx-extra'
2
2
  import {log} from './log.js'
3
3
  import {memoizeBy} from './util.js'
4
- import {queuefy} from 'queuefy'
5
4
 
6
5
  export const fetchRepo = memoizeBy(async ({cwd: _cwd, branch, origin: _origin, basicAuth}) => ctx(async ($) => {
7
6
  const origin = _origin || (await getRepo(_cwd, {basicAuth})).repoAuthedUrl
@@ -18,7 +17,7 @@ export const fetchRepo = memoizeBy(async ({cwd: _cwd, branch, origin: _origin, b
18
17
  return cwd
19
18
  }), async ({cwd, branch}) => `${await getRoot(cwd)}:${branch}`)
20
19
 
21
- export const pushCommit = queuefy(async ({cwd, from, to, branch, origin, msg, ignoreFiles, files = [], basicAuth, gitCommitterEmail, gitCommitterName}) => ctx(async ($) => {
20
+ export const pushCommit = async ({cwd, from, to, branch, origin, msg, ignoreFiles, files = [], basicAuth, gitCommitterEmail, gitCommitterName}) => ctx(async ($) => {
22
21
  let retries = 3
23
22
 
24
23
  const _cwd = await fetchRepo({cwd, branch, origin, basicAuth})
@@ -54,7 +53,7 @@ export const pushCommit = queuefy(async ({cwd, from, to, branch, origin, msg, ig
54
53
  await $`git pull --rebase origin ${branch}`
55
54
  }
56
55
  }
57
- }))
56
+ })
58
57
 
59
58
  export const getRoot = async (cwd) => (await $.o({cwd})`git rev-parse --show-toplevel`).toString().trim()
60
59
 
@@ -1,7 +1,8 @@
1
1
  // Semantic tags processing
2
2
 
3
+ import {Buffer} from 'node:buffer'
4
+ import {queuefy} from 'queuefy'
3
5
  import {ctx, semver, $, fs, path} from 'zx-extra'
4
- import {Buffer} from 'buffer'
5
6
  import {log} from './log.js'
6
7
  import {fetchRepo, pushCommit, getTags as getGitTags} from './git.js'
7
8
  import {fetchManifest} from './npm.js'
@@ -20,7 +21,7 @@ export const pushTag = (pkg) => ctx(async ($) => {
20
21
  await $`git push origin ${tag}`
21
22
  })
22
23
 
23
- export const pushMeta = async (pkg) => {
24
+ export const pushMeta = queuefy(async (pkg) => {
24
25
  log({pkg})('push artifact to branch \'meta\'')
25
26
 
26
27
  const {name, version, absPath: cwd, config: {gitCommitterEmail, gitCommitterName, ghBasicAuth: basicAuth}} = pkg
@@ -42,7 +43,7 @@ export const pushMeta = async (pkg) => {
42
43
  const files = [{relpath: `${getArtifactPath(tag)}.json`, contents: meta}]
43
44
 
44
45
  await pushCommit({cwd, to, branch, msg, files, gitCommitterEmail, gitCommitterName, basicAuth})
45
- }
46
+ })
46
47
 
47
48
  export const getLatest = async (pkg) => {
48
49
  const {absPath: cwd, name, config: {ghBasicAuth: basicAuth}} = pkg
@@ -131,7 +131,15 @@ const build = memoizeBy(async (pkg, run = runCmd, flags = {}, self = build) => w
131
131
  const publish = memoizeBy(async (pkg, run = runCmd) => within(async () => {
132
132
  $.scope = pkg.name
133
133
 
134
- await fs.writeJson(pkg.manifestPath, pkg.manifest, {spaces: 2})
134
+ // Debug
135
+ // https://www.npmjs.com/package/@packasso/preset-ts-tsc-uvu/v/0.0.0?activeTab=code
136
+ // https://github.com/qiwi/packasso/actions/runs/4514909191/jobs/7951564982#step:7:817
137
+ // https://github.com/qiwi/packasso/blob/meta/2023-3-24-packasso-preset-ts-tsc-uvu-0-21-0-f0.json
138
+ if (pkg.version !== pkg.manifest.version) {
139
+ throw new Error('package.json version not synced')
140
+ }
141
+
142
+ fs.writeJsonSync(pkg.manifestPath, pkg.manifest, {spaces: 2})
135
143
  await pushTag(pkg)
136
144
 
137
145
  await Promise.all([