zx-bulk-release 2.3.1 → 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 +10 -0
- package/package.json +2 -2
- package/src/main/js/npm.js +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
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
|
+
|
|
6
|
+
## [2.3.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.3.1...v2.3.2) (2023-04-02)
|
|
7
|
+
|
|
8
|
+
### Fixes & improvements
|
|
9
|
+
* perf: update @semrel-extra/topo to v1.9.0 ([b6fcd15](https://github.com/semrel-extra/zx-bulk-release/commit/b6fcd15f449d1588522a68b9d51555d8966c925a))
|
|
10
|
+
|
|
1
11
|
## [2.3.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.3.0...v2.3.1) (2023-04-02)
|
|
2
12
|
|
|
3
13
|
### Fixes & improvements
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zx-bulk-release",
|
|
3
3
|
"alias": "bulk-release",
|
|
4
|
-
"version": "2.3.
|
|
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.
|
|
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"
|
package/src/main/js/npm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {log} from './log.js'
|
|
2
|
-
import {$,
|
|
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 =
|
|
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 :
|
|
42
|
+
const npmrc = npmConfig ? npmConfig : tempy.temporaryFile({name: '.npmrc'})
|
|
42
43
|
|
|
43
44
|
log({pkg})(`publish npm package ${name} ${version} to ${npmRegistry}`)
|
|
44
|
-
|
|
45
|
+
|
|
45
46
|
if (!npmConfig) {
|
|
46
|
-
await
|
|
47
|
+
await fs.writeFile(npmrc, `${npmRegistry.replace(/^https?:\/\//, '//')}/:_authToken=${npmToken}`, {encoding: 'utf8'})
|
|
47
48
|
}
|
|
48
|
-
await
|
|
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`
|