bulk-release 2.3.2 → 2.3.3

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,8 @@
1
+ ## [2.3.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.3.2...v2.3.3) (2023-04-07)
2
+
3
+ ### Fixes & improvements
4
+ * fix: use tmp for `.npmrc` creation ([06ae101](https://github.com/semrel-extra/zx-bulk-release/commit/06ae10187e4f1bdef30c6490ce03077b2ac8b44d))
5
+
1
6
  ## [2.3.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.3.1...v2.3.2) (2023-04-02)
2
7
 
3
8
  ### Fixes & improvements
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "2.3.2",
4
+ "version": "2.3.3",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -22,7 +22,7 @@
22
22
  "docs": "mkdir -p docs && cp ./README.md ./docs/README.md"
23
23
  },
24
24
  "dependencies": {
25
- "@semrel-extra/topo": "^1.9.0",
25
+ "@semrel-extra/topo": "^1.9.1",
26
26
  "cosmiconfig": "^8.1.3",
27
27
  "queuefy": "^1.2.1",
28
28
  "zx-extra": "^2.5.4"
@@ -1,5 +1,5 @@
1
1
  import {log} from './log.js'
2
- import {$, ctx, fs, path, INI, fetch} from 'zx-extra'
2
+ import {$, fs, INI, fetch, tempy} from 'zx-extra'
3
3
 
4
4
  export const fetchPkg = async (pkg) => {
5
5
  const id = `${pkg.name}@${pkg.version}`
@@ -34,19 +34,20 @@ export const fetchManifest = async (pkg, {nothrow} = {}) => {
34
34
  }
35
35
  }
36
36
 
37
- export const npmPublish = (pkg) => ctx(async ($) => {
37
+ export const npmPublish = async (pkg) => {
38
38
  const {absPath: cwd, name, version, manifest, config} = pkg
39
39
  if (manifest.private || config?.npmPublish === false) return
40
+
40
41
  const {npmRegistry, npmToken, npmConfig} = config
41
- const npmrc = npmConfig ? npmConfig : path.resolve(cwd, '.npmrc')
42
+ const npmrc = npmConfig ? npmConfig : tempy.temporaryFile({name: '.npmrc'})
42
43
 
43
44
  log({pkg})(`publish npm package ${name} ${version} to ${npmRegistry}`)
44
- $.cwd = cwd
45
+
45
46
  if (!npmConfig) {
46
- await $.raw`echo ${npmRegistry.replace(/https?:/, '')}/:_authToken=${npmToken} >> ${npmrc}`
47
+ await fs.writeFile(npmrc, `${npmRegistry.replace(/^https?:\/\//, '//')}/:_authToken=${npmToken}`, {encoding: 'utf8'})
47
48
  }
48
- await $`npm publish --no-git-tag-version --registry=${npmRegistry} --userconfig ${npmrc} --no-workspaces`
49
- })
49
+ await $.o({cwd})`npm publish --no-git-tag-version --registry=${npmRegistry} --userconfig ${npmrc} --no-workspaces`
50
+ }
50
51
 
51
52
  // $`npm view ${name}@${version} dist.tarball`
52
53
  export const getTarballUrl = (registry, name, version) => `${registry}/${name}/-/${name.replace(/^.+(%2f|\/)/,'')}-${version}.tgz`