@virmator/publish 14.27.4 → 14.28.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/README.md CHANGED
@@ -6,7 +6,9 @@ A default plugin for [virmator](https://www.npmjs.com/package/virmator).
6
6
 
7
7
  - **publish**
8
8
 
9
- Publish a package or mono-repo to NPM with an optional test script and auto-incrementing package version.
9
+ Stage a package or mono-repo for publishing to NPM (via npm's staged publishing) with an optional test script and auto-incrementing package version.
10
+
11
+ Staged versions are not live on NPM until they are approved on the npm website or via 'npm stage approve' (both require 2FA). Requires npm >= 11.15.0.
10
12
 
11
13
  - Examples
12
14
  - With tests: `virmator publish npm test`
package/dist/publish.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare const virmatorPublishPlugin: Readonly<Readonly<{
6
6
  cliCommands: NoInfer<{
7
7
  readonly publish: {
8
8
  readonly doc: {
9
- readonly sections: readonly ["\n Publish a package or mono-repo to NPM with an optional test script and auto-incrementing package version.\n "];
9
+ readonly sections: readonly ["\n Stage a package or mono-repo for publishing to NPM (via npm's staged publishing) with an optional test script and auto-incrementing package version.\n ", "\n Staged versions are not live on NPM until they are approved on the npm website or via 'npm stage approve' (both require 2FA). Requires npm >= 11.15.0.\n "];
10
10
  readonly examples: readonly [{
11
11
  readonly title: "With tests";
12
12
  readonly content: "virmator publish npm test";
@@ -22,7 +22,7 @@ export declare const virmatorPublishPlugin: Readonly<Readonly<{
22
22
  executor: import("@virmator/core").VirmatorPluginExecutor<NoInfer<{
23
23
  readonly publish: {
24
24
  readonly doc: {
25
- readonly sections: readonly ["\n Publish a package or mono-repo to NPM with an optional test script and auto-incrementing package version.\n "];
25
+ readonly sections: readonly ["\n Stage a package or mono-repo for publishing to NPM (via npm's staged publishing) with an optional test script and auto-incrementing package version.\n ", "\n Staged versions are not live on NPM until they are approved on the npm website or via 'npm stage approve' (both require 2FA). Requires npm >= 11.15.0.\n "];
26
26
  readonly examples: readonly [{
27
27
  readonly title: "With tests";
28
28
  readonly content: "virmator publish npm test";
package/dist/publish.js CHANGED
@@ -9,6 +9,7 @@ import { join, relative, resolve } from 'node:path';
9
9
  import semver from 'semver';
10
10
  import { simpleGit } from 'simple-git';
11
11
  import { isValidSpdxExpression } from 'spdx-vir';
12
+ import { buildUrl } from 'url-vir';
12
13
  const inVirmatorEnvKey = 'IN_VIRMATOR';
13
14
  /** A virmator plugin for publishing a package to npm. */
14
15
  export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
@@ -18,7 +19,10 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
18
19
  doc: {
19
20
  sections: [
20
21
  `
21
- Publish a package or mono-repo to NPM with an optional test script and auto-incrementing package version.
22
+ Stage a package or mono-repo for publishing to NPM (via npm's staged publishing) with an optional test script and auto-incrementing package version.
23
+ `,
24
+ `
25
+ Staged versions are not live on NPM until they are approved on the npm website or via 'npm stage approve' (both require 2FA). Requires npm >= 11.15.0.
22
26
  `,
23
27
  ],
24
28
  examples: [
@@ -123,6 +127,7 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
123
127
  const publishCommand = [
124
128
  `${inVirmatorEnvKey}=true`,
125
129
  'npm',
130
+ 'stage',
126
131
  'publish',
127
132
  ...publishArgs,
128
133
  ]
@@ -192,6 +197,17 @@ export const virmatorPublishPlugin = defineVirmatorPlugin(import.meta.dirname, {
192
197
  }));
193
198
  if (!isDryRun) {
194
199
  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(' '));
195
211
  }
196
212
  return;
197
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virmator/publish",
3
- "version": "14.27.4",
3
+ "version": "14.28.0",
4
4
  "description": "Default publish plugin for virmator.",
5
5
  "keywords": [
6
6
  "virmator",
@@ -34,10 +34,10 @@
34
34
  "test:update": "npm test"
35
35
  },
36
36
  "dependencies": {
37
- "@augment-vir/assert": "^32.0.0",
38
- "@augment-vir/common": "^32.0.0",
39
- "@augment-vir/node": "^32.0.0",
40
- "@virmator/core": "^14.27.4",
37
+ "@augment-vir/assert": "^32.1.0",
38
+ "@augment-vir/common": "^32.1.0",
39
+ "@augment-vir/node": "^32.1.0",
40
+ "@virmator/core": "^14.28.0",
41
41
  "mri": "^1.2.0",
42
42
  "semver": "^7.8.5",
43
43
  "simple-git": "^3.36.0",
@@ -45,12 +45,12 @@
45
45
  "url-vir": "^2.1.9"
46
46
  },
47
47
  "devDependencies": {
48
- "@augment-vir/test": "^32.0.0",
49
- "@types/node": "^26.0.1",
48
+ "@augment-vir/test": "^32.1.0",
49
+ "@types/node": "^26.1.1",
50
50
  "@types/semver": "^7.7.1",
51
51
  "markdown-code-example-inserter": "^3.0.6",
52
- "type-fest": "^5.7.0",
53
- "typedoc": "^0.28.19"
52
+ "type-fest": "^5.8.0",
53
+ "typedoc": "^0.28.20"
54
54
  },
55
55
  "engines": {
56
56
  "node": ">=22"