bulk-release 2.5.3 → 2.6.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,8 @@
1
+ ## [2.6.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.3...v2.6.0) (2023-04-21)
2
+
3
+ ### Features
4
+ * feat: enable npm `--provenance` via `NPM_PROVENANCE` env var ([c61ff88](https://github.com/semrel-extra/zx-bulk-release/commit/c61ff88a47c3fee6102ea19de47cdcecdda8833d))
5
+
1
6
  ## [2.5.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.2...v2.5.3) (2023-04-13)
2
7
 
3
8
  ### Fixes & improvements
package/README.md CHANGED
@@ -63,6 +63,21 @@ await run({
63
63
  })
64
64
  ```
65
65
 
66
+ ### ENV
67
+ ```ts
68
+ export const parseEnv = ({GH_USER, GH_USERNAME, GITHUB_USER, GITHUB_USERNAME, GH_TOKEN, GITHUB_TOKEN, NPM_TOKEN, NPM_REGISTRY, NPMRC, NPM_USERCONFIG, NPM_CONFIG_USERCONFIG, NPM_PROVENANCE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL} = process.env) =>
69
+ ({
70
+ ghUser: GH_USER || GH_USERNAME || GITHUB_USER || GITHUB_USERNAME,
71
+ ghToken: GH_TOKEN || GITHUB_TOKEN,
72
+ npmConfig: NPMRC || NPM_USERCONFIG || NPM_CONFIG_USERCONFIG,
73
+ npmToken: NPM_TOKEN,
74
+ npmProvenance: NPM_PROVENANCE,
75
+ npmRegistry: NPM_REGISTRY || 'https://registry.npmjs.org',
76
+ gitCommitterName: GIT_COMMITTER_NAME || 'Semrel Extra Bot',
77
+ gitCommitterEmail: GIT_COMMITTER_EMAIL || 'semrel-extra-bot@hotmail.com',
78
+ })
79
+ ```
80
+
66
81
  ### Config
67
82
  Any [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) compliant format: `.releaserc`, `.release.json`, `.release.yaml`, etc.
68
83
  ```json
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "2.5.3",
4
+ "version": "2.6.0",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -38,12 +38,13 @@ export const normalizePkgConfig = (config, env) => ({
38
38
  }
39
39
  })
40
40
 
41
- export const parseEnv = ({GH_USER, GH_USERNAME, GITHUB_USER, GITHUB_USERNAME, GH_TOKEN, GITHUB_TOKEN, NPM_TOKEN, NPM_REGISTRY, NPMRC, NPM_USERCONFIG, NPM_CONFIG_USERCONFIG, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL} = process.env) =>
41
+ export const parseEnv = ({GH_USER, GH_USERNAME, GITHUB_USER, GITHUB_USERNAME, GH_TOKEN, GITHUB_TOKEN, NPM_TOKEN, NPM_REGISTRY, NPMRC, NPM_USERCONFIG, NPM_CONFIG_USERCONFIG, NPM_PROVENANCE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL} = process.env) =>
42
42
  ({
43
43
  ghUser: GH_USER || GH_USERNAME || GITHUB_USER || GITHUB_USERNAME,
44
44
  ghToken: GH_TOKEN || GITHUB_TOKEN,
45
45
  npmConfig: NPMRC || NPM_USERCONFIG || NPM_CONFIG_USERCONFIG,
46
46
  npmToken: NPM_TOKEN,
47
+ npmProvenance: NPM_PROVENANCE,
47
48
  npmRegistry: NPM_REGISTRY || 'https://registry.npmjs.org',
48
49
  gitCommitterName: GIT_COMMITTER_NAME || 'Semrel Extra Bot',
49
50
  gitCommitterEmail: GIT_COMMITTER_EMAIL || 'semrel-extra-bot@hotmail.com',
@@ -37,7 +37,7 @@ export const fetchManifest = async (pkg, {nothrow} = {}) => {
37
37
  }
38
38
 
39
39
  export const npmPublish = async (pkg) => {
40
- const {absPath: cwd, name, version, manifest, config: {npmPublish, npmRegistry, npmToken, npmConfig} } = pkg
40
+ const {absPath: cwd, name, version, manifest, config: {npmPublish, npmRegistry, npmToken, npmConfig, npmProvenance}} = pkg
41
41
 
42
42
  if (manifest.private || npmPublish === false) return
43
43
 
@@ -46,7 +46,7 @@ export const npmPublish = async (pkg) => {
46
46
  const npmTag = pkg.preversion ? 'snapshot' : 'latest'
47
47
  const npmrc = await getNpmrc({npmConfig, npmToken, npmRegistry})
48
48
 
49
- await $.o({cwd})`npm publish --no-git-tag-version --registry=${npmRegistry} --userconfig ${npmrc} --tag ${npmTag} --no-workspaces`
49
+ await $.o({cwd})`npm publish ${npmProvenance ? '--provenance' : ''} --no-git-tag-version --registry=${npmRegistry} --userconfig ${npmrc} --tag ${npmTag} --no-workspaces`
50
50
  }
51
51
 
52
52
  export const getNpmrc = async ({npmConfig, npmToken, npmRegistry}) => {