@virmator/publish 14.28.0 → 14.28.1

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.
Files changed (2) hide show
  1. package/dist/publish.js +22 -12
  2. package/package.json +2 -2
package/dist/publish.js CHANGED
@@ -11,6 +11,14 @@ import { simpleGit } from 'simple-git';
11
11
  import { isValidSpdxExpression } from 'spdx-vir';
12
12
  import { buildUrl } from 'url-vir';
13
13
  const inVirmatorEnvKey = 'IN_VIRMATOR';
14
+ /**
15
+ * When true, publish through npm's staged publishing (`npm stage publish`), which requires later
16
+ * approval before packages go live. When false, publish directly (`npm publish`).
17
+ *
18
+ * Ideally, this would always use staged publishing. However, npm's current approval process for
19
+ * staged publishes is terrible. If they fix that, then we can flip this back to `true`.
20
+ */
21
+ const useStagedPublishing = false;
14
22
  /** A virmator plugin for publishing a package to npm. */
15
23
  export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
16
24
  name: 'Publish',
@@ -127,7 +135,7 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
127
135
  const publishCommand = [
128
136
  `${inVirmatorEnvKey}=true`,
129
137
  'npm',
130
- 'stage',
138
+ useStagedPublishing && 'stage',
131
139
  'publish',
132
140
  ...publishArgs,
133
141
  ]
@@ -197,17 +205,19 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
197
205
  }));
198
206
  if (!isDryRun) {
199
207
  await updateGit(monoRepoRootPath);
200
- const npmUsername = (await runHiddenShellCommand('npm whoami')).stdout.trim();
201
- log.info([
202
- 'Staged packages must be approved before they go live. Approve them here:',
203
- buildUrl('https://www.npmjs.com', {
204
- paths: [
205
- 'settings',
206
- npmUsername,
207
- 'staged-packages',
208
- ],
209
- }).href,
210
- ].join(' '));
208
+ if (useStagedPublishing) {
209
+ const npmUsername = (await runHiddenShellCommand('npm whoami')).stdout.trim();
210
+ log.info([
211
+ 'Staged packages must be approved before they go live. Approve them here:',
212
+ buildUrl('https://www.npmjs.com', {
213
+ paths: [
214
+ 'settings',
215
+ npmUsername,
216
+ 'staged-packages',
217
+ ],
218
+ }).href,
219
+ ].join(' '));
220
+ }
211
221
  }
212
222
  return;
213
223
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virmator/publish",
3
- "version": "14.28.0",
3
+ "version": "14.28.1",
4
4
  "description": "Default publish plugin for virmator.",
5
5
  "keywords": [
6
6
  "virmator",
@@ -37,7 +37,7 @@
37
37
  "@augment-vir/assert": "^32.1.0",
38
38
  "@augment-vir/common": "^32.1.0",
39
39
  "@augment-vir/node": "^32.1.0",
40
- "@virmator/core": "^14.28.0",
40
+ "@virmator/core": "^14.28.1",
41
41
  "mri": "^1.2.0",
42
42
  "semver": "^7.8.5",
43
43
  "simple-git": "^3.36.0",