@jsdevtools/npm-publish 2.0.0 → 2.1.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.
Files changed (73) hide show
  1. package/README.md +39 -26
  2. package/lib/action/main.js +1 -0
  3. package/lib/action/main.js.map +1 -1
  4. package/lib/cli/index.d.ts +1 -1
  5. package/lib/cli/index.js +4 -1
  6. package/lib/cli/index.js.map +1 -1
  7. package/lib/cli/parse-cli-arguments.js +1 -0
  8. package/lib/cli/parse-cli-arguments.js.map +1 -1
  9. package/lib/compare-and-publish/compare-and-publish.d.ts +21 -0
  10. package/lib/compare-and-publish/compare-and-publish.js +49 -0
  11. package/lib/compare-and-publish/compare-and-publish.js.map +1 -0
  12. package/lib/compare-and-publish/compare-versions.d.ts +16 -0
  13. package/lib/compare-and-publish/compare-versions.js +41 -0
  14. package/lib/compare-and-publish/compare-versions.js.map +1 -0
  15. package/lib/compare-and-publish/get-arguments.d.ts +21 -0
  16. package/lib/compare-and-publish/get-arguments.js +50 -0
  17. package/lib/compare-and-publish/get-arguments.js.map +1 -0
  18. package/lib/compare-and-publish/index.d.ts +1 -0
  19. package/lib/compare-and-publish/index.js +18 -0
  20. package/lib/compare-and-publish/index.js.map +1 -0
  21. package/lib/errors.d.ts +3 -0
  22. package/lib/errors.js +8 -1
  23. package/lib/errors.js.map +1 -1
  24. package/lib/format-publish-result.d.ts +3 -3
  25. package/lib/format-publish-result.js +5 -5
  26. package/lib/format-publish-result.js.map +1 -1
  27. package/lib/normalize-options.d.ts +4 -2
  28. package/lib/normalize-options.js +14 -12
  29. package/lib/normalize-options.js.map +1 -1
  30. package/lib/npm/call-npm-cli.d.ts +26 -4
  31. package/lib/npm/call-npm-cli.js +49 -27
  32. package/lib/npm/call-npm-cli.js.map +1 -1
  33. package/lib/npm/index.d.ts +2 -29
  34. package/lib/npm/index.js +16 -38
  35. package/lib/npm/index.js.map +1 -1
  36. package/lib/npm/use-npm-environment.d.ts +4 -2
  37. package/lib/npm/use-npm-environment.js +7 -5
  38. package/lib/npm/use-npm-environment.js.map +1 -1
  39. package/lib/npm-publish.js +7 -12
  40. package/lib/npm-publish.js.map +1 -1
  41. package/lib/options.d.ts +14 -3
  42. package/lib/read-manifest.d.ts +4 -7
  43. package/lib/read-manifest.js +4 -1
  44. package/lib/read-manifest.js.map +1 -1
  45. package/lib/results.d.ts +5 -1
  46. package/lib/results.js +3 -0
  47. package/lib/results.js.map +1 -1
  48. package/package.json +7 -3
  49. package/src/action/main.ts +1 -0
  50. package/src/cli/index.ts +4 -1
  51. package/src/cli/parse-cli-arguments.ts +1 -0
  52. package/src/compare-and-publish/compare-and-publish.ts +75 -0
  53. package/src/compare-and-publish/compare-versions.ts +48 -0
  54. package/src/compare-and-publish/get-arguments.ts +61 -0
  55. package/src/compare-and-publish/index.ts +1 -0
  56. package/src/errors.ts +7 -0
  57. package/src/format-publish-result.ts +6 -6
  58. package/src/normalize-options.ts +16 -12
  59. package/src/npm/call-npm-cli.ts +90 -48
  60. package/src/npm/index.ts +2 -64
  61. package/src/npm/use-npm-environment.ts +10 -4
  62. package/src/npm-publish.ts +11 -18
  63. package/src/options.ts +15 -3
  64. package/src/read-manifest.ts +8 -9
  65. package/src/results.ts +6 -1
  66. package/lib/compare-versions.d.ts +0 -20
  67. package/lib/compare-versions.js +0 -36
  68. package/lib/compare-versions.js.map +0 -1
  69. package/lib/npm/get-publish-arguments.d.ts +0 -9
  70. package/lib/npm/get-publish-arguments.js +0 -29
  71. package/lib/npm/get-publish-arguments.js.map +0 -1
  72. package/src/compare-versions.ts +0 -52
  73. package/src/npm/get-publish-arguments.ts +0 -34
package/README.md CHANGED
@@ -41,9 +41,9 @@ The v1 to v2 upgrade brought a few notable **breaking changes**. To migrate, mak
41
41
 
42
42
  - The `type` output is now an empty string instead of `none` when no release occurs
43
43
  ```diff
44
- - - if: ${{ steps.publish.outputs.type != 'none' }}
45
- + - if: ${{ steps.publish.outputs.type }}
46
- run: echo "Version changed!"
44
+ - run: echo "Version changed!"
45
+ - if: ${{ steps.publish.outputs.type != 'none' }}
46
+ + if: ${{ steps.publish.outputs.type }}
47
47
  ```
48
48
  - The `check-version` and `greater-version-only` options have been removed and replaced with `strategy`.
49
49
  - Use `strategy: all` (default) to publish all versions that do not yet exist in the registry.
@@ -73,7 +73,9 @@ See the [change log][] for more details and other changes in the v2 release.
73
73
  To use the GitHub Action, you'll need to add it as a step in your [workflow file][]. By default, the only thing you need to do is set the `token` parameter to your [npm authentication token][].
74
74
 
75
75
  ```yaml
76
- on: push
76
+ on:
77
+ push:
78
+ branches: main
77
79
 
78
80
  jobs:
79
81
  publish:
@@ -82,7 +84,7 @@ jobs:
82
84
  - uses: actions/checkout@v3
83
85
  - uses: actions/setup-node@v3
84
86
  with:
85
- node-version: 18
87
+ node-version: "18"
86
88
  - run: npm ci
87
89
  - run: npm test
88
90
  - uses: JS-DevTools/npm-publish@v2
@@ -97,15 +99,18 @@ jobs:
97
99
 
98
100
  You can set any or all of the following input parameters using `with`:
99
101
 
100
- | Name | Type | Default | Description |
101
- | ---------- | ---------------------- | ----------------------------- | ----------------------------------------------------------------------------- |
102
- | `token` | string | **required** | Authentication token to use with the configured registry. |
103
- | `registry` | string | `https://registry.npmjs.org/` | Registry URL to use. |
104
- | `package` | string | Current working directory | Path to a package directory, a `package.json`, or a packed `.tgz` to publish |
105
- | `tag` | string | `latest` | [Distribution tag][npm-tag] to publish to. |
106
- | `access` | `public`, `restricted` | [npm defaults][npm-access] | Whether the package should be publicly visible or restricted. |
107
- | `strategy` | `all`, `upgrade` | `all` | Use `all` to publish all unique versions, `upgrade` for only semver upgrades. |
108
- | `dry-run` | boolean | `false` | Run `npm publish` with the `--dry-run` flag to prevent publication. |
102
+ | Name | Type | Default | Description |
103
+ | ------------ | ---------------------- | -------------------------------- | ----------------------------------------------------------------------------- |
104
+ | `token` | string | **required** | Authentication token to use with the configured registry. |
105
+ | `registry` | string | `https://registry.npmjs.org/` \* | Registry URL to use. |
106
+ | `package` | string | Current working directory | Path to a package directory, a `package.json`, or a packed `.tgz` to publish |
107
+ | `tag` | string | `latest` \* | [Distribution tag][npm-tag] to publish to. |
108
+ | `access` | `public`, `restricted` | [npm defaults][npm-access] \* | Whether the package should be publicly visible or restricted. |
109
+ | `provenance` | boolean | `false` \* | Run `npm publish` with the `--provenance` flag to add provenance statements. |
110
+ | `strategy` | `all`, `upgrade` | `all` | Use `all` to publish all unique versions, `upgrade` for only semver upgrades. |
111
+ | `dry-run` | boolean | `false` | Run `npm publish` with the `--dry-run` flag to prevent publication. |
112
+
113
+ \* Default values for these options may be specified using `publishConfig` in `package.json`.
109
114
 
110
115
  [npm-tag]: https://docs.npmjs.com/cli/v9/commands/npm-publish#tag
111
116
  [npm-access]: https://docs.npmjs.com/cli/v9/commands/npm-publish#access
@@ -135,6 +140,7 @@ steps:
135
140
  | `old-version` | string | Previously published version on `tag` or empty if no previous version on tag. |
136
141
  | `tag` | string | [Distribution tag][npm-tag] the package was published to. |
137
142
  | `access` | string | [Access level][npm-access] the package was published with, or `default` if scoped-package defaults were used. |
143
+ | `registry` | string | Registry the package was published to. |
138
144
  | `dry-run` | boolean | Whether `npm publish` was run in "dry run" mode. |
139
145
 
140
146
  [semver release type]: https://github.com/npm/node-semver#release_types
@@ -166,17 +172,20 @@ As shown in the example above, you should pass an options object to the `npmPubl
166
172
  import type { Options } from "@jsdevtools/npm-publish";
167
173
  ```
168
174
 
169
- | Name | Type | Default | Description |
170
- | -------------------- | ---------------------- | ----------------------------- | ----------------------------------------------------------------------------- |
171
- | `token` | string | **required** | Authentication token to use with the configured registry. |
172
- | `registry` | string, `URL` | `https://registry.npmjs.org/` | Registry URL to use. |
173
- | `package` | string | Current working directory | Path to a package directory, a `package.json`, or a packed `.tgz` to publish |
174
- | `tag` | string | `latest` | [Distribution tag][npm-tag] to publish to. |
175
- | `access` | `public`, `restricted` | [npm defaults][npm-access] | Whether the package should be publicly visible or restricted. |
176
- | `strategy` | `all`, `upgrade` | `all` | Use `all` to publish all unique versions, `upgrade` for only semver upgrades. |
177
- | `dryRun` | boolean | `false` | Run `npm publish` with the `--dry-run` flag to prevent publication. |
178
- | `logger` | object | `undefined` | Logging interface with `debug`, `info`, and `error` log methods. |
179
- | `temporaryDirectory` | string | `os.tmpdir()` | Temporary directory to hold a generated `.npmrc` file |
175
+ | Name | Type | Default | Description |
176
+ | -------------------- | ---------------------- | -------------------------------- | ----------------------------------------------------------------------------- |
177
+ | `token` | string | **required** | Authentication token to use with the configured registry. |
178
+ | `registry` | string, `URL` | `https://registry.npmjs.org/` \* | Registry URL to use. |
179
+ | `package` | string | Current working directory | Path to a package directory, a `package.json`, or a packed `.tgz` to publish |
180
+ | `tag` | string | `latest` \* | [Distribution tag][npm-tag] to publish to. |
181
+ | `access` | `public`, `restricted` | [npm defaults][npm-access] \* | Whether the package should be publicly visible or restricted. |
182
+ | `provenance` | boolean | `false` \* | Run `npm publish` with the `--provenance` flag to add provenance statements. |
183
+ | `strategy` | `all`, `upgrade` | `all` | Use `all` to publish all unique versions, `upgrade` for only semver upgrades. |
184
+ | `dryRun` | boolean | `false` | Run `npm publish` with the `--dry-run` flag to prevent publication. |
185
+ | `logger` | object | `undefined` | Logging interface with `debug`, `info`, and `error` log methods. |
186
+ | `temporaryDirectory` | string | `os.tmpdir()` | Temporary directory to hold a generated `.npmrc` file |
187
+
188
+ \* Default values for these options may be specified using `publishConfig` in `package.json`.
180
189
 
181
190
  ### Output
182
191
 
@@ -195,6 +204,7 @@ import type { Results } from "@jsdevtools/npm-publish";
195
204
  | `oldVersion` | Optional string | Previously published version on `tag` or `undefined` if no previous version. |
196
205
  | `tag` | string | [Distribution tag][npm-tag] that the package was published to. |
197
206
  | `access` | Optional string | [Access level][npm-access] the package was published with, or `undefined` if scoped-package defaults were used. |
207
+ | `registry` | `URL` | Registry the package was published to. |
198
208
  | `dryRun` | boolean | Whether `npm publish` was run in "dry run" mode. |
199
209
 
200
210
  ## Command Line Interface
@@ -243,7 +253,10 @@ Options:
243
253
  Defaults to "latest".
244
254
 
245
255
  --access <access> Package access, may be "public" or "restricted".
246
- See documentation for details.
256
+ See npm documentation for details.
257
+
258
+ --provenance Publish with provenance statements.
259
+ See npm documentation for details.
247
260
 
248
261
  --strategy <strategy> Publish strategy, may be "all" or "upgrade".
249
262
  Defaults to "all", see documentation for details.
@@ -34,6 +34,7 @@ async function run() {
34
34
  package: core.getInput("package"),
35
35
  tag: core.getInput("tag"),
36
36
  access: core.getInput("access"),
37
+ provenance: core.getBooleanInput("provenance"),
37
38
  strategy: core.getInput("strategy"),
38
39
  dryRun: core.getBooleanInput("dry-run"),
39
40
  logger: core.logger,
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/action/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yBAAyB;AACzB,0CAAyC;AACzC,gDAAkC;AAElC,sBAAsB;AACtB,KAAK,UAAU,GAAG;IAChB,MAAM,OAAO,GAAG,MAAM,IAAA,qBAAU,EAAC;QAC/B,KAAK,EAAE,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;QAC3C,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;QACnC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QACjC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QACzB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;QACnC,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC;QACvC,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;KAC/C,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACr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EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const USAGE = "\nUsage:\n\n npm-publish <options> [package]\n\nArguments:\n\n package The path to the package to publish.\n May be a directory, package.json, or .tgz file.\n Defaults to the package in the current directory.\n\nOptions:\n\n --token <token> (Required) npm authentication token.\n\n --registry <url> Registry to read from and write to.\n Defaults to \"https://registry.npmjs.org/\".\n\n --tag <tag> The distribution tag to check against and publish to.\n Defaults to \"latest\".\n\n --access <access> Package access, may be \"public\" or \"restricted\".\n See documentation for details.\n\n --strategy <strategy> Publish strategy, may be \"all\" or \"upgrade\".\n Defaults to \"all\", see documentation for details.\n\n --dry-run Do not actually publish anything.\n --quiet Only print errors.\n --debug Print debug logs.\n\n -v, --version Print the version number.\n -h, --help Show usage text.\n\nExamples:\n\n $ npm-publish --token abc123 ./my-package\n";
1
+ export declare const USAGE = "\nUsage:\n\n npm-publish <options> [package]\n\nArguments:\n\n package The path to the package to publish.\n May be a directory, package.json, or .tgz file.\n Defaults to the package in the current directory.\n\nOptions:\n\n --token <token> (Required) npm authentication token.\n\n --registry <url> Registry to read from and write to.\n Defaults to \"https://registry.npmjs.org/\".\n\n --tag <tag> The distribution tag to check against and publish to.\n Defaults to \"latest\".\n\n --access <access> Package access, may be \"public\" or \"restricted\".\n See npm documentation for details.\n\n --provenance Publish with provenance statements.\n See npm documentation for details.\n\n --strategy <strategy> Publish strategy, may be \"all\" or \"upgrade\".\n Defaults to \"all\", see documentation for details.\n\n --dry-run Do not actually publish anything.\n --quiet Only print errors.\n --debug Print debug logs.\n\n -v, --version Print the version number.\n -h, --help Show usage text.\n\nExamples:\n\n $ npm-publish --token abc123 ./my-package\n";
2
2
  /**
3
3
  * The main entry point of the CLI
4
4
  *
package/lib/cli/index.js CHANGED
@@ -25,7 +25,10 @@ Options:
25
25
  Defaults to "latest".
26
26
 
27
27
  --access <access> Package access, may be "public" or "restricted".
28
- See documentation for details.
28
+ See npm documentation for details.
29
+
30
+ --provenance Publish with provenance statements.
31
+ See npm documentation for details.
29
32
 
30
33
  --strategy <strategy> Publish strategy, may be "all" or "upgrade".
31
34
  Defaults to "all", see documentation for details.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AAAA,0CAAsD;AACtD,qEAA6D;AAEhD,QAAA,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCpB,CAAC;AAEF;;;;;GAKG;AACI,KAAK,UAAU,IAAI,CAAC,IAAc,EAAE,OAAe;IACxD,MAAM,YAAY,GAAG,IAAA,0CAAiB,EAAC,IAAI,CAAC,CAAC;IAE7C,IAAI,YAAY,CAAC,IAAI,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,aAAK,CAAC,CAAC;QACpB,OAAO;KACR;IAED,IAAI,YAAY,CAAC,OAAO,EAAE;QACxB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO;KACR;IAED,MAAM,MAAM,GAAW;QACrB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,YAAY,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAC7D,KAAK,EAAE,YAAY,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;KAC/D,CAAC;IAEF,MAAM,IAAA,qBAAU,EAAC,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;AACxD,CAAC;AApBD,oBAoBC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AAAA,0CAAsD;AACtD,qEAA6D;AAEhD,QAAA,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCpB,CAAC;AAEF;;;;;GAKG;AACI,KAAK,UAAU,IAAI,CAAC,IAAc,EAAE,OAAe;IACxD,MAAM,YAAY,GAAG,IAAA,0CAAiB,EAAC,IAAI,CAAC,CAAC;IAE7C,IAAI,YAAY,CAAC,IAAI,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,aAAK,CAAC,CAAC;QACpB,OAAO;KACR;IAED,IAAI,YAAY,CAAC,OAAO,EAAE;QACxB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO;KACR;IAED,MAAM,MAAM,GAAW;QACrB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,YAAY,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAC7D,KAAK,EAAE,YAAY,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;KAC/D,CAAC;IAEF,MAAM,IAAA,qBAAU,EAAC,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;AACxD,CAAC;AApBD,oBAoBC"}
@@ -12,6 +12,7 @@ const ARGUMENTS_OPTIONS = [
12
12
  { name: "registry", type: String },
13
13
  { name: "tag", type: String },
14
14
  { name: "access", type: String },
15
+ { name: "provenance", type: Boolean },
15
16
  { name: "strategy", type: String },
16
17
  { name: "dry-run", type: Boolean },
17
18
  { name: "quiet", type: Boolean },
@@ -1 +1 @@
1
- {"version":3,"file":"parse-cli-arguments.js","sourceRoot":"","sources":["../../src/cli/parse-cli-arguments.ts"],"names":[],"mappings":";AAAA,2CAA2C;;;;;;AAE3C,0EAAgD;AAGhD,MAAM,iBAAiB,GAAG;IACxB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE;IACtD,EAAE,IAAI,EAAE,OAA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AO,CAAC,KAAK,CAAC;QACrB,OAAO,EAAE,OAAkB;KAC5B,CAAC;AACJ,CAAC;AAbD,8CAaC"}
@@ -0,0 +1,21 @@
1
+ import type { PackageManifest } from "../read-manifest.js";
2
+ import type { NormalizedOptions } from "../normalize-options.js";
3
+ import { type NpmCliEnvironment } from "../npm/index.js";
4
+ import { type VersionComparison } from "./compare-versions.js";
5
+ export interface PublishResult extends VersionComparison {
6
+ id: string | undefined;
7
+ files: PublishFile[];
8
+ }
9
+ export interface PublishFile {
10
+ path: string;
11
+ size: number;
12
+ }
13
+ /**
14
+ * Get the currently published versions of a package and publish if needed.
15
+ *
16
+ * @param manifest The package to potentially publish.
17
+ * @param options Configuration options.
18
+ * @param environment Environment variables for the npm cli.
19
+ * @returns Information about the publish, including if it occurred.
20
+ */
21
+ export declare function compareAndPublish(manifest: PackageManifest, options: NormalizedOptions, environment: NpmCliEnvironment): Promise<PublishResult>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.compareAndPublish = void 0;
4
+ const index_js_1 = require("../npm/index.js");
5
+ const compare_versions_js_1 = require("./compare-versions.js");
6
+ const get_arguments_js_1 = require("./get-arguments.js");
7
+ /**
8
+ * Get the currently published versions of a package and publish if needed.
9
+ *
10
+ * @param manifest The package to potentially publish.
11
+ * @param options Configuration options.
12
+ * @param environment Environment variables for the npm cli.
13
+ * @returns Information about the publish, including if it occurred.
14
+ */
15
+ async function compareAndPublish(manifest, options, environment) {
16
+ const { name, version, packageSpec } = manifest;
17
+ const cliOptions = { environment, logger: options.logger };
18
+ const viewArguments = (0, get_arguments_js_1.getViewArguments)(name, options);
19
+ const publishArguments = (0, get_arguments_js_1.getPublishArguments)(packageSpec, options);
20
+ let viewCall = await (0, index_js_1.callNpmCli)(index_js_1.VIEW, viewArguments, cliOptions);
21
+ // `npm view` will succeed with no output the package exists in the registry
22
+ // with no `latest` tag. This is only possible with third-party registries.
23
+ // https://github.com/npm/cli/issues/6408
24
+ if (!viewCall.successData && !viewCall.error) {
25
+ // Retry the call to `npm view` with the configured publish tag,
26
+ // to at least try to get something.
27
+ const viewWithTagArguments = (0, get_arguments_js_1.getViewArguments)(name, options, true);
28
+ viewCall = await (0, index_js_1.callNpmCli)(index_js_1.VIEW, viewWithTagArguments, cliOptions);
29
+ }
30
+ if (viewCall.error && viewCall.errorCode !== index_js_1.E404) {
31
+ throw viewCall.error;
32
+ }
33
+ const comparison = (0, compare_versions_js_1.compareVersions)(version, viewCall.successData, options);
34
+ const publishCall = comparison.type
35
+ ? await (0, index_js_1.callNpmCli)(index_js_1.PUBLISH, publishArguments, cliOptions)
36
+ : { successData: undefined, errorCode: undefined, error: undefined };
37
+ if (publishCall.error && publishCall.errorCode !== index_js_1.EPUBLISHCONFLICT) {
38
+ throw publishCall.error;
39
+ }
40
+ const { successData: publishData } = publishCall;
41
+ return {
42
+ id: publishData?.id,
43
+ files: publishData?.files ?? [],
44
+ type: publishData ? comparison.type : undefined,
45
+ oldVersion: comparison.oldVersion,
46
+ };
47
+ }
48
+ exports.compareAndPublish = compareAndPublish;
49
+ //# sourceMappingURL=compare-and-publish.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare-and-publish.js","sourceRoot":"","sources":["../../src/compare-and-publish/compare-and-publish.ts"],"names":[],"mappings":";;;AAEA,8CAOyB;AACzB,+DAAgF;AAChF,yDAA2E;AAY3E;;;;;;;GAOG;AACI,KAAK,UAAU,iBAAiB,CACrC,QAAyB,EACzB,OAA0B,EAC1B,WAA8B;IAE9B,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC;IAChD,MAAM,UAAU,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;IAE3D,MAAM,aAAa,GAAG,IAAA,mCAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,MAAM,gBAAgB,GAAG,IAAA,sCAAmB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AAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAC/C,UAAU,EAAE,UAAU,CAAC,UAAU;KAClC,CAAC;AACJ,CAAC;AA3CD,8CA2CC"}
@@ -0,0 +1,16 @@
1
+ import type { NormalizedOptions } from "../normalize-options.js";
2
+ import type { ReleaseType } from "../results.js";
3
+ import type { NpmViewData } from "../npm/index.js";
4
+ export interface VersionComparison {
5
+ type: ReleaseType | undefined;
6
+ oldVersion: string | undefined;
7
+ }
8
+ /**
9
+ * Compare previously published versions with the package's current version.
10
+ *
11
+ * @param currentVersion The current package version.
12
+ * @param publishedVersions The versions that have already been published.
13
+ * @param options Configuration options
14
+ * @returns The release type and previous version.
15
+ */
16
+ export declare function compareVersions(currentVersion: string, publishedVersions: NpmViewData | undefined, options: NormalizedOptions): VersionComparison;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.compareVersions = void 0;
7
+ const diff_js_1 = __importDefault(require("semver/functions/diff.js"));
8
+ const gt_js_1 = __importDefault(require("semver/functions/gt.js"));
9
+ const valid_js_1 = __importDefault(require("semver/functions/valid.js"));
10
+ const options_js_1 = require("../options.js");
11
+ const INITIAL = "initial";
12
+ const DIFFERENT = "different";
13
+ /**
14
+ * Compare previously published versions with the package's current version.
15
+ *
16
+ * @param currentVersion The current package version.
17
+ * @param publishedVersions The versions that have already been published.
18
+ * @param options Configuration options
19
+ * @returns The release type and previous version.
20
+ */
21
+ function compareVersions(currentVersion, publishedVersions, options) {
22
+ const { versions, "dist-tags": tags } = publishedVersions ?? {};
23
+ const { strategy, tag: publishTag } = options;
24
+ const oldVersion = (0, valid_js_1.default)(tags?.[publishTag.value]) ?? undefined;
25
+ const isUnique = !versions?.includes(currentVersion);
26
+ let type;
27
+ if (isUnique) {
28
+ if (!oldVersion) {
29
+ type = INITIAL;
30
+ }
31
+ else if ((0, gt_js_1.default)(currentVersion, oldVersion)) {
32
+ type = (0, diff_js_1.default)(currentVersion, oldVersion) ?? DIFFERENT;
33
+ }
34
+ else if (strategy.value === options_js_1.STRATEGY_ALL) {
35
+ type = DIFFERENT;
36
+ }
37
+ }
38
+ return { type, oldVersion };
39
+ }
40
+ exports.compareVersions = compareVersions;
41
+ //# sourceMappingURL=compare-versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare-versions.js","sourceRoot":"","sources":["../../src/compare-and-publish/compare-versions.ts"],"names":[],"mappings":";;;;;;AAAA,uEAAwD;AACxD,mEAAuD;AACvD,yEAAoD;AAEpD,8CAA6C;AAU7C,MAAM,OAAO,GAAG,SAAS,CAAC;AAC1B,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B;;;;;;;GAOG;AACH,SAAgB,eAAe,CAC7B,cAAsB,EACtB,iBAA0C,EAC1C,OAA0B;IAE1B,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,iBAAiB,IAAI,EAAE,CAAC;IAChE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC9C,MAAM,UAAU,GAAG,IAAA,kBAAW,EAAC,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC;IACtE,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IACrD,IAAI,IAA6B,CAAC;IAElC,IAAI,QAAQ,EAAE;QACZ,IAAI,CAAC,UAAU,EAAE;YACf,IAAI,GAAG,OAAO,CAAC;SAChB;aAAM,IAAI,IAAA,eAAiB,EAAC,cAAc,EAAE,UAAU,CAAC,EAAE;YACxD,IAAI,GAAG,IAAA,iBAAgB,EAAC,cAAc,EAAE,UAAU,CAAC,IAAI,SAAS,CAAC;SAClE;aAAM,IAAI,QAAQ,CAAC,KAAK,KAAK,yBAAY,EAAE;YAC1C,IAAI,GAAG,SAAS,CAAC;SAClB;KACF;IAED,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AAC9B,CAAC;AAtBD,0CAsBC"}
@@ -0,0 +1,21 @@
1
+ import type { NormalizedOptions } from "../normalize-options.js";
2
+ /**
3
+ * Given a package name and publish configuration, get the NPM CLI view
4
+ * arguments.
5
+ *
6
+ * @param packageName Package name.
7
+ * @param options Publish configuration.
8
+ * @param retryWithTag Include a non-latest tag in the package spec for a rety
9
+ * attempt.
10
+ * @returns Arguments to pass to the NPM CLI. If `retryWithTag` is true, but the
11
+ * publish config is using the `latest` tag, will return `undefined`.
12
+ */
13
+ export declare function getViewArguments(packageName: string, options: NormalizedOptions, retryWithTag?: boolean): string[];
14
+ /**
15
+ * Given a publish configuration, get the NPM CLI publish arguments.
16
+ *
17
+ * @param packageSpec Package specification path.
18
+ * @param options Publish configuration.
19
+ * @returns Arguments to pass to the NPM CLI.
20
+ */
21
+ export declare function getPublishArguments(packageSpec: string, options: NormalizedOptions): string[];
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPublishArguments = exports.getViewArguments = void 0;
4
+ /**
5
+ * Given a package name and publish configuration, get the NPM CLI view
6
+ * arguments.
7
+ *
8
+ * @param packageName Package name.
9
+ * @param options Publish configuration.
10
+ * @param retryWithTag Include a non-latest tag in the package spec for a rety
11
+ * attempt.
12
+ * @returns Arguments to pass to the NPM CLI. If `retryWithTag` is true, but the
13
+ * publish config is using the `latest` tag, will return `undefined`.
14
+ */
15
+ function getViewArguments(packageName, options, retryWithTag = false) {
16
+ const packageSpec = retryWithTag
17
+ ? `${packageName}@${options.tag.value}`
18
+ : packageName;
19
+ return [packageSpec, "dist-tags", "versions"];
20
+ }
21
+ exports.getViewArguments = getViewArguments;
22
+ /**
23
+ * Given a publish configuration, get the NPM CLI publish arguments.
24
+ *
25
+ * @param packageSpec Package specification path.
26
+ * @param options Publish configuration.
27
+ * @returns Arguments to pass to the NPM CLI.
28
+ */
29
+ function getPublishArguments(packageSpec, options) {
30
+ const { tag, access, dryRun, provenance } = options;
31
+ const publishArguments = [];
32
+ if (packageSpec.length > 0) {
33
+ publishArguments.push(packageSpec);
34
+ }
35
+ if (!tag.isDefault) {
36
+ publishArguments.push("--tag", tag.value);
37
+ }
38
+ if (!access.isDefault && access.value) {
39
+ publishArguments.push("--access", access.value);
40
+ }
41
+ if (!provenance.isDefault && provenance.value) {
42
+ publishArguments.push("--provenance");
43
+ }
44
+ if (!dryRun.isDefault && dryRun.value) {
45
+ publishArguments.push("--dry-run");
46
+ }
47
+ return publishArguments;
48
+ }
49
+ exports.getPublishArguments = getPublishArguments;
50
+ //# sourceMappingURL=get-arguments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-arguments.js","sourceRoot":"","sources":["../../src/compare-and-publish/get-arguments.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;GAUG;AACH,SAAgB,gBAAgB,CAC9B,WAAmB,EACnB,OAA0B,EAC1B,YAAY,GAAG,KAAK;IAEpB,MAAM,WAAW,GAAG,YAAY;QAC9B,CAAC,CAAC,GAAG,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE;QACvC,CAAC,CAAC,WAAW,CAAC;IAEhB,OAAO,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;AAChD,CAAC;AAVD,4CAUC;AAED;;;;;;GAMG;AACH,SAAgB,mBAAmB,CACjC,WAAmB,EACnB,OAA0B;IAE1B,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACpD,MAAM,gBAAgB,GAAG,EAAE,CAAC;IAE5B,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;QAC1B,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KACpC;IAED,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE;QAClB,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;KAC3C;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,KAAK,EAAE;QACrC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;KACjD;IAED,IAAI,CAAC,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,KAAK,EAAE;QAC7C,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KACvC;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,KAAK,EAAE;QACrC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KACpC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AA5BD,kDA4BC"}
@@ -0,0 +1 @@
1
+ export * from "./compare-and-publish.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./compare-and-publish.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compare-and-publish/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}
package/lib/errors.d.ts CHANGED
@@ -25,6 +25,9 @@ export declare class InvalidRegistryUrlError extends TypeError {
25
25
  export declare class InvalidTokenError extends TypeError {
26
26
  constructor();
27
27
  }
28
+ export declare class InvalidTagError extends TypeError {
29
+ constructor(value: unknown);
30
+ }
28
31
  export declare class InvalidAccessError extends TypeError {
29
32
  constructor(value: unknown);
30
33
  }
package/lib/errors.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.NpmCallError = exports.InvalidStrategyError = exports.InvalidAccessError = exports.InvalidTokenError = exports.InvalidRegistryUrlError = exports.InvalidPackagePublishConfigError = exports.InvalidPackageVersionError = exports.InvalidPackageNameError = exports.PackageJsonParseError = exports.PackageTarballReadError = exports.PackageJsonReadError = exports.InvalidPackageError = void 0;
6
+ exports.NpmCallError = exports.InvalidStrategyError = exports.InvalidAccessError = exports.InvalidTagError = exports.InvalidTokenError = exports.InvalidRegistryUrlError = exports.InvalidPackagePublishConfigError = exports.InvalidPackageVersionError = exports.InvalidPackageNameError = exports.PackageJsonParseError = exports.PackageTarballReadError = exports.PackageJsonReadError = exports.InvalidPackageError = void 0;
7
7
  const node_os_1 = __importDefault(require("node:os"));
8
8
  const options_js_1 = require("./options.js");
9
9
  class InvalidPackageError extends TypeError {
@@ -87,6 +87,13 @@ class InvalidTokenError extends TypeError {
87
87
  }
88
88
  }
89
89
  exports.InvalidTokenError = InvalidTokenError;
90
+ class InvalidTagError extends TypeError {
91
+ constructor(value) {
92
+ super(`Tag must be a non-empty string, got "${String(value)}".`);
93
+ this.name = "InvalidTagError";
94
+ }
95
+ }
96
+ exports.InvalidTagError = InvalidTagError;
90
97
  class InvalidAccessError extends TypeError {
91
98
  constructor(value) {
92
99
  super(`Access must be "${options_js_1.ACCESS_PUBLIC}" or "${options_js_1.ACCESS_RESTRICTED}", got "${String(value)}".`);
package/lib/errors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AAEzB,6CAKsB;AAEtB,MAAa,mBAAoB,SAAQ,SAAS;IAChD,YAAmB,KAAc;QAC/B,KAAK,CACH,iEAAiE,MAAM,CACrE,KAAK,CACN,GAAG,CACL,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AATD,kDASC;AAED,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAmB,YAAoB,EAAE,aAAsB;QAC7D,MAAM,OAAO,GAAG;YACd,kCAAkC,YAAY,EAAE;YAChD,aAAa,YAAY,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;SAC5D;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,iBAAE,CAAC,GAAG,CAAC,CAAC;QAEhB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAZD,oDAYC;AAED,MAAa,uBAAwB,SAAQ,KAAK;IAChD,YAAmB,WAAmB,EAAE,aAAsB;QAC5D,MAAM,OAAO,GAAG;YACd,oCAAoC,WAAW,EAAE;YACjD,aAAa,YAAY,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;SAC5D;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,iBAAE,CAAC,GAAG,CAAC,CAAC;QAEhB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAZD,0DAYC;AAED,MAAa,qBAAsB,SAAQ,WAAW;IACpD,YAAmB,WAAmB,EAAE,aAAsB;QAC5D,MAAM,OAAO,GAAG;YAC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,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AATD,oDASC;AAED,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAmB,OAAe,EAAE,QAAgB,EAAE,MAAc;QAClE,KAAK,CACH;YACE,gBAAgB,OAAO,oCAAoC,QAAQ,EAAE;YACrE,MAAM;SACP,CAAC,IAAI,CAAC,iBAAE,CAAC,GAAG,CAAC,CACf,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAVD,oCAUC"}
@@ -1,4 +1,4 @@
1
- import type { PublishResult } from "./npm/index.js";
1
+ import type { PublishResult } from "./compare-and-publish/index.js";
2
2
  import type { PackageManifest } from "./read-manifest.js";
3
3
  import type { NormalizedOptions } from "./normalize-options.js";
4
4
  /**
@@ -6,7 +6,7 @@ import type { NormalizedOptions } from "./normalize-options.js";
6
6
  *
7
7
  * @param manifest Package manifest
8
8
  * @param options Configuration options.
9
- * @param results Results from running npm publish.
9
+ * @param result Results from running npm publish.
10
10
  * @returns Formatted string.
11
11
  */
12
- export declare function formatPublishResult(manifest: PackageManifest, options: NormalizedOptions, results?: PublishResult): string;
12
+ export declare function formatPublishResult(manifest: PackageManifest, options: NormalizedOptions, result: PublishResult): string;
@@ -10,17 +10,17 @@ const node_os_1 = __importDefault(require("node:os"));
10
10
  *
11
11
  * @param manifest Package manifest
12
12
  * @param options Configuration options.
13
- * @param results Results from running npm publish.
13
+ * @param result Results from running npm publish.
14
14
  * @returns Formatted string.
15
15
  */
16
- function formatPublishResult(manifest, options, results) {
17
- if (results === undefined) {
16
+ function formatPublishResult(manifest, options, result) {
17
+ if (result.id === undefined) {
18
18
  return `🙅‍♀️ ${manifest.name}@${manifest.version} publish skipped.`;
19
19
  }
20
20
  return [
21
- `📦 ${results.id}${options.dryRun.value ? " (DRY RUN)" : ""}`,
21
+ `📦 ${result.id}${options.dryRun.value ? " (DRY RUN)" : ""}`,
22
22
  "=== Contents ===",
23
- ...results.files.map(({ path, size }) => `${formatSize(size)}\t${path}`),
23
+ ...result.files.map(({ path, size }) => `${formatSize(size)}\t${path}`),
24
24
  ].join(node_os_1.default.EOL);
25
25
  }
26
26
  exports.formatPublishResult = formatPublishResult;
@@ -1 +1 @@
1
- {"version":3,"file":"format-publish-result.js","sourceRoot":"","sources":["../src/format-publish-result.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AAMzB;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CACjC,QAAyB,EACzB,OAA0B,EAC1B,OAAuB;IAEvB,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO,SAAS,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,mBAAmB,CAAC;KACtE;IAED,OAAO;QACL,MAAM,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE;QAC7D,kBAAkB;QAClB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;KACzE,CAAC,IAAI,CAAC,iBAAE,CAAC,GAAG,CAAC,CAAC;AACjB,CAAC;AAdD,kDAcC;AAED,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE;IAC1C,IAAI,IAAI,GAAG,IAAI,EAAE;QACf,OAAO,GAAG,IAAI,IAAI,CAAC;KACpB;IACD,IAAI,IAAI,GAAG,OAAS,EAAE;QACpB,OAAO,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;KACzC;IAED,OAAO,GAAG,CAAC,IAAI,GAAG,OAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/C,CAAC,CAAC"}
1
+ {"version":3,"file":"format-publish-result.js","sourceRoot":"","sources":["../src/format-publish-result.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AAMzB;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CACjC,QAAyB,EACzB,OAA0B,EAC1B,MAAqB;IAErB,IAAI,MAAM,CAAC,EAAE,KAAK,SAAS,EAAE;QAC3B,OAAO,SAAS,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,mBAAmB,CAAC;KACtE;IAED,OAAO;QACL,MAAM,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE;QAC5D,kBAAkB;QAClB,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;KACxE,CAAC,IAAI,CAAC,iBAAE,CAAC,GAAG,CAAC,CAAC;AACjB,CAAC;AAdD,kDAcC;AAED,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE;IAC1C,IAAI,IAAI,GAAG,IAAI,EAAE;QACf,OAAO,GAAG,IAAI,IAAI,CAAC;KACpB;IACD,IAAI,IAAI,GAAG,OAAS,EAAE;QACpB,OAAO,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;KACzC;IAED,OAAO,GAAG,CAAC,IAAI,GAAG,OAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/C,CAAC,CAAC"}
@@ -1,11 +1,13 @@
1
1
  import type { PackageManifest } from "./read-manifest.js";
2
2
  import { type Access, type Strategy, type Options, type Logger } from "./options.js";
3
+ export declare const TAG_LATEST = "latest";
3
4
  /** Normalized and sanitized auth, publish, and runtime configurations. */
4
5
  export interface NormalizedOptions {
5
6
  registry: URL;
6
7
  token: string;
7
8
  tag: ConfigValue<string>;
8
9
  access: ConfigValue<Access | undefined>;
10
+ provenance: ConfigValue<boolean>;
9
11
  dryRun: ConfigValue<boolean>;
10
12
  strategy: ConfigValue<Strategy>;
11
13
  logger: Logger | undefined;
@@ -19,8 +21,8 @@ export interface ConfigValue<TValue> {
19
21
  /**
20
22
  * Normalizes and sanitizes options, and fills-in any default values.
21
23
  *
22
- * @param options User-input options.
23
24
  * @param manifest Package metadata from package.json.
25
+ * @param options User-input options.
24
26
  * @returns Validated auth and publish configuration.
25
27
  */
26
- export declare function normalizeOptions(options: Options, manifest: PackageManifest): NormalizedOptions;
28
+ export declare function normalizeOptions(manifest: PackageManifest, options: Options): NormalizedOptions;