@jsdevtools/npm-publish 2.2.2 → 3.0.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.
package/README.md CHANGED
@@ -6,23 +6,29 @@
6
6
  [![License](https://img.shields.io/npm/l/@jsdevtools/npm-publish.svg)](LICENSE)
7
7
  [![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/JS-DevTools/npm-publish)
8
8
 
9
- Publish your packages to npm automatically in GitHub Actions by updating the version number.
9
+ Publish packages to npm automatically in GitHub Actions by updating the version number.
10
+
11
+ - [Change log][releases]
12
+ - [v2 to v3 migration guide](#v2-to-v3)
13
+ - [v1 to v3 migration guide](#v1-to-v3)
14
+
15
+ [releases]: https://github.com/JS-DevTools/npm-publis/releases
10
16
 
11
17
  ## Features
12
18
 
13
- - 🧠 **Smart**<br>
19
+ - 🧠 **Smart**
14
20
  Only publishes if the version number in `package.json` differs from the latest on npm.
15
21
 
16
- - 🛠 **Configurable**<br>
22
+ - 🛠 **Configurable**
17
23
  Customize the version-checking behavior, the registry URL, and path of your package.
18
24
 
19
- - 🔐 **Secure**<br>
20
- Keeps your npm authentication token secret. Doesn't read from or write to `~/.npmrc`.
25
+ - 🔐 **Secure**
26
+ Keeps your npm authentication token secret. Doesn't read nor write to `~/.npmrc`.
21
27
 
22
- - ⚡ **Fast**<br>
28
+ - ⚡ **Fast**
23
29
  100% JavaScript (which is faster than Docker) and bundled to optimize loading time.
24
30
 
25
- - 📤 **Outputs**<br>
31
+ - 📤 **Outputs**
26
32
  Exposes the old and new version numbers, and the type of change (major, minor, patch, etc.) as variables that you can use in your workflow.
27
33
 
28
34
  ## Usage
@@ -35,78 +41,6 @@ This package can be used three different ways:
35
41
 
36
42
  - 🖥 A [**CLI**](#command-line-interface) that you run in your terminal
37
43
 
38
- ## v2 Migration Guide
39
-
40
- The v1 to v2 upgrade brought a few notable **breaking changes**. To migrate, make the following updates:
41
-
42
- - The `type` output is now an empty string instead of `'none'` when no release occurs
43
- ```diff
44
- - run: echo "Version changed!"
45
- - if: ${{ steps.publish.outputs.type != 'none' }}
46
- + if: ${{ steps.publish.outputs.type }}
47
- ```
48
- - The `--ignore-scripts` option is now passed to `npm publish` as a security precaution. If you define any publish lifecycle scripts - `prepublishOnly`, `prepack`, `prepare`, `postpack`, `publish`, `postpublish` - run them explicitly or set the `ignore-scripts` input to `false`.
49
- ```diff
50
- with:
51
- token: ${{ secrets.NPM_TOKEN }}
52
- + ignore-scripts: false
53
- ```
54
- - The workflow's `.npmrc` file is no longer modified. If you have any workarounds to adjust for this misbehavior - for example, if you're using `actions/setup-node` to configure `.npmrc` - you should remove them.
55
-
56
- ```diff
57
- - uses: actions/setup-node@v3
58
- with:
59
- node-version: '18'
60
- registry-url: https://registry.npmjs.org/
61
-
62
- - uses: JS-DevTools/npm-publish@v1
63
- with:
64
- token: ${{ secrets.NPM_TOKEN }}
65
-
66
- - name: Do some more stuff with npm
67
- run: npm whoami
68
- env:
69
- - INPUT_TOKEN: ${{ secrets.NPM_TOKEN }}
70
- + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
71
- ```
72
-
73
- - The `check-version` and `greater-version-only` options have been removed and replaced with `strategy`.
74
- - Use `strategy: all` (default) to publish all versions that do not yet exist in the registry.
75
- ```diff
76
- with:
77
- token: ${{ secrets.NPM_TOKEN }}
78
- - check-version: true
79
- - greater-version-only: false
80
- + strategy: all
81
- ```
82
- - Use `strategy: upgrade` to only publish versions that upgrade the selected tag.
83
- ```diff
84
- with:
85
- token: ${{ secrets.NPM_TOKEN }}
86
- - check-version: true
87
- - greater-version-only: true
88
- + strategy: upgrade
89
- ```
90
- - `check-version: false` has been removed. You may not need this action if you're not checking already published versions; [you can `npm` directly][publishing-nodejs-packages], instead.
91
- ```diff
92
- - - uses: JS-DevTools/npm-publish@v1
93
- - with:
94
- - token: ${{ secrets.NPM_TOKEN }}
95
- - check-version: false
96
- + - uses: actions/setup-node@v3
97
- + with:
98
- + node-version: '18'
99
- + registry-url: https://registry.npmjs.org/
100
- + - run: npm publish
101
- + env:
102
- + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
103
- ```
104
-
105
- See the [change log][] for more details and other changes in the v2 release.
106
-
107
- [publishing-nodejs-packages]: https://docs.github.com/actions/publishing-packages/publishing-nodejs-packages
108
- [change log]: https://github.com/JS-DevTools/npm-publish/releases
109
-
110
44
  ## GitHub Action
111
45
 
112
46
  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][].
@@ -120,13 +54,13 @@ jobs:
120
54
  publish:
121
55
  runs-on: ubuntu-latest
122
56
  steps:
123
- - uses: actions/checkout@v3
57
+ - uses: actions/checkout@v4
124
58
  - uses: actions/setup-node@v3
125
59
  with:
126
- node-version: "18"
60
+ node-version: "20"
127
61
  - run: npm ci
128
62
  - run: npm test
129
- - uses: JS-DevTools/npm-publish@v2
63
+ - uses: JS-DevTools/npm-publish@v3
130
64
  with:
131
65
  token: ${{ secrets.NPM_TOKEN }}
132
66
  ```
@@ -145,13 +79,13 @@ jobs:
145
79
  contents: read
146
80
  packages: write # allow GITHUB_TOKEN to publish packages
147
81
  steps:
148
- - uses: actions/checkout@v3
82
+ - uses: actions/checkout@v4
149
83
  - uses: actions/setup-node@v3
150
84
  with:
151
- node-version: "18"
85
+ node-version: "20"
152
86
  - run: npm ci
153
87
  - run: npm test
154
- - uses: JS-DevTools/npm-publish@v2
88
+ - uses: JS-DevTools/npm-publish@v3
155
89
  with:
156
90
  token: ${{ secrets.GITHUB_TOKEN }}
157
91
  registry: "https://npm.pkg.github.com"
@@ -161,7 +95,7 @@ jobs:
161
95
  [npm authentication token]: https://docs.npmjs.com/creating-and-viewing-authentication-tokens
162
96
  [GitHub Package Registry]: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry
163
97
 
164
- ### Usage
98
+ ### Action usage
165
99
 
166
100
  You can set any or all of the following input parameters using `with`:
167
101
 
@@ -184,19 +118,19 @@ You can set any or all of the following input parameters using `with`:
184
118
  [npm-access]: https://docs.npmjs.com/cli/v9/commands/npm-publish#access
185
119
  [provenance]: https://docs.npmjs.com/generating-provenance-statements
186
120
 
187
- ### Output
121
+ ### Action output
188
122
 
189
- npm-publish exposes some output variables, which you can use in later steps of your workflow. To access the output variables, you'll need to set an `id` for the npm-publish step.
123
+ npm-publish exposes several output variables, which you can use in later steps of your workflow if you provide an `id` for the npm-publish step.
190
124
 
191
- ```yaml
192
- steps:
193
- - id: publish
194
- uses: JS-DevTools/npm-publish@v2
195
- with:
196
- token: ${{ secrets.NPM_TOKEN }}
125
+ ```diff
126
+ steps:
127
+ - uses: JS-DevTools/npm-publish@v3
128
+ + id: publish
129
+ with:
130
+ token: ${{ secrets.NPM_TOKEN }}
197
131
 
198
- - if: ${{ steps.publish.outputs.type }}
199
- run: echo "Version changed!"
132
+ + - if: ${{ steps.publish.outputs.type }}
133
+ + run: echo "Version changed!"
200
134
  ```
201
135
 
202
136
  | Name | Type | Description |
@@ -232,7 +166,7 @@ await npmPublish({ token: "YOUR_NPM_AUTH_TOKEN_HERE" });
232
166
 
233
167
  [npm]: https://docs.npmjs.com/about-npm/
234
168
 
235
- ### Usage
169
+ ### API usage
236
170
 
237
171
  As shown in the example above, you should pass an options object to the `npmPublish` function. In TypeScript, the `Options` interface is available as an import.
238
172
 
@@ -257,7 +191,7 @@ import type { Options } from "@jsdevtools/npm-publish";
257
191
  1. May be specified using `publishConfig` in `package.json`.
258
192
  2. Provenance requires npm `>=9.5.0`.
259
193
 
260
- ### Output
194
+ ### API output
261
195
 
262
196
  The `npmPublish()` function returns a promise of a `Results` object. In TypeScript, the `Results` interface is available as an import.
263
197
 
@@ -301,7 +235,7 @@ npx npm-publish --token YOUR_NPM_AUTH_TOKEN_HERE --registry http://example.com .
301
235
 
302
236
  Run `npm-publish --help` to see the full list of options available.
303
237
 
304
- ```
238
+ ```text
305
239
  Usage:
306
240
 
307
241
  npm-publish <options> [package]
@@ -346,6 +280,116 @@ Examples:
346
280
  $ npm-publish --token abc123 ./my-package
347
281
  ```
348
282
 
283
+ ## Migration guides
284
+
285
+ Major releases of the action and libraries may contain breaking changes, documented here.
286
+ For more detailed change logs, see [releases][].
287
+
288
+ ### v2 to v3
289
+
290
+ The v3 release does not require any changes to how you use `npm-publish` from `v2`. The version of Node.js used by the action was updated to v20 due to GitHub Action's [deprecation of Node.js v16][node16-deprecation]. The minimum required version of Node.js for the library and CLI remains v16.
291
+
292
+ [node16-deprecation]: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
293
+
294
+ ### v1 to v3
295
+
296
+ The v2 release made several breaking changes to inputs, outputs, and behaviors that were present in `v1`. The examples below focus on the action, but the same changes are applicable to the library and CLI, too.
297
+
298
+ #### v2 option changes
299
+
300
+ The `check-version` and `greater-version-only` boolean options were replaced with the `strategy` option:
301
+
302
+ - `strategy: all` (default) will publish any version that does not yet exist in the registry
303
+ - `strategy: upgrade` will publish only if the version is a semver upgrade of the requested `dist-tag`
304
+
305
+ ```diff
306
+ with:
307
+ token: ${{ secrets.NPM_TOKEN }}
308
+ - check-version: true
309
+ - greater-version-only: false
310
+ + strategy: all
311
+
312
+ with:
313
+ token: ${{ secrets.NPM_TOKEN }}
314
+ - check-version: true
315
+ - greater-version-only: true
316
+ + strategy: upgrade
317
+ ```
318
+
319
+ `check-version: false` has been removed. If you only need to publish, without first checking whether the version exists in the registry, you can [use `npm` directly][publishing-nodejs-packages] instead:
320
+
321
+ ```diff
322
+ - uses: actions/setup-node@v3
323
+ with:
324
+ node-version: '18'
325
+ + registry-url: https://registry.npmjs.org/
326
+
327
+ - - uses: JS-DevTools/npm-publish@v1
328
+ - with:
329
+ - token: ${{ secrets.NPM_TOKEN }}
330
+ - check-version: false
331
+ + - run: npm publish
332
+ + env:
333
+ + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
334
+ ```
335
+
336
+ [publishing-nodejs-packages]: https://docs.github.com/actions/publishing-packages/publishing-nodejs-packages
337
+
338
+ #### v2 output changes
339
+
340
+ The `type` output is now an empty string instead of `'none'` when no release occurs
341
+
342
+ ```diff
343
+ - run: echo "Version changed!"
344
+ - if: ${{ steps.publish.outputs.type != 'none' }}
345
+ + if: ${{ steps.publish.outputs.type }}
346
+ ```
347
+
348
+ #### v2 behavior changes
349
+
350
+ The `--ignore-scripts` option is now passed to `npm publish` as a security precaution. If you define any publish lifecycle scripts - `prepublishOnly`, `prepack`, `prepare`, `postpack`, `publish`, `postpublish` - we recommend you run that logic as a separate explicit build step.
351
+
352
+ ```diff
353
+ + - run: npm run build
354
+
355
+ - - uses: JS-DevTools/npm-publish@v1
356
+ + - uses: JS-DevTools/npm-publish@v3
357
+ with:
358
+ token: ${{ secrets.NPM_TOKEN }}
359
+ ```
360
+
361
+ If you can't change your build, you can set the `ignore-scripts` input to `false` as a workaround. Be aware that failures during a lifecycle script can be difficult to debug, and any `stdout`/`stderr` output from your build script could interfere with how `npm-publish` interprets results from the `npm` CLI.
362
+
363
+ ```diff
364
+ - - uses: JS-DevTools/npm-publish@v1
365
+ + - uses: JS-DevTools/npm-publish@v3
366
+ with:
367
+ token: ${{ secrets.NPM_TOKEN }}
368
+ + ignore-scripts: false
369
+ ```
370
+
371
+ The global `.npmrc` file is no longer read nor modified. This means the `token` option is now required for the library and CLI. (It was already required for the action.) You may have workarounds in place referencing `INPUT_TOKEN`, which v1 [erroneously wrote][#15] to `.npmrc`. These workarounds should be removed.
372
+
373
+ ```diff
374
+ - uses: actions/setup-node@v3
375
+ with:
376
+ node-version: '18'
377
+ registry-url: https://registry.npmjs.org/
378
+
379
+ - - uses: JS-DevTools/npm-publish@v1
380
+ + - uses: JS-DevTools/npm-publish@v3
381
+ with:
382
+ token: ${{ secrets.NPM_TOKEN }}
383
+
384
+ - name: Do some more stuff with npm
385
+ run: npm whoami
386
+ env:
387
+ - INPUT_TOKEN: ${{ secrets.NPM_TOKEN }}
388
+ + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
389
+ ```
390
+
391
+ [#15]: https://github.com/JS-DevTools/npm-publish/issues/15
392
+
349
393
  ## License
350
394
 
351
395
  npm-publish is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.
@@ -359,5 +403,3 @@ Thanks to these awesome companies for their support of Open Source developers
359
403
  [![GitHub](https://jstools.dev/img/badges/github.svg)](https://github.com/open-source)
360
404
  [![NPM](https://jstools.dev/img/badges/npm.svg)](https://www.npmjs.com/)
361
405
  [![Coveralls](https://jstools.dev/img/badges/coveralls.svg)](https://coveralls.io)
362
- [![Travis CI](https://jstools.dev/img/badges/travis-ci.svg)](https://travis-ci.com)
363
- [![SauceLabs](https://jstools.dev/img/badges/sauce-labs.svg)](https://saucelabs.com)
package/lib/errors.js CHANGED
@@ -61,7 +61,7 @@ class InvalidPackageNameError extends TypeError {
61
61
  exports.InvalidPackageNameError = InvalidPackageNameError;
62
62
  class InvalidPackageVersionError extends TypeError {
63
63
  constructor(value) {
64
- super(`Package version must be a string, got "${String(value)}"`);
64
+ super(`Package version must be a valid semantic version, got "${String(value)}"`);
65
65
  this.name = "InvalidPackageVersionError";
66
66
  }
67
67
  }
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,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,cAAc,CAAC;IAC7B,CAAC;CACF;AAVD,oCAUC"}
@@ -119,7 +119,7 @@ async function readManifest(packagePath) {
119
119
  throw new errors.InvalidPackageNameError(name);
120
120
  }
121
121
  if (typeof version !== "string") {
122
- throw new errors.InvalidPackageVersionError(version);
122
+ throw new errors.InvalidPackageVersionError(manifestJson["version"]);
123
123
  }
124
124
  if (typeof publishConfig !== "object" ||
125
125
  Array.isArray(publishConfig) ||
@@ -1 +1 @@
1
- {"version":3,"file":"read-manifest.js","sourceRoot":"","sources":["../src/read-manifest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAkC;AAClC,0DAA6B;AAC7B,mCAA8C;AAC9C,6BAAsD;AAEtD,oDAAsC;AAmBtC,MAAM,QAAQ,GAAG,cAAc,CAAC;AAEhC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AACzC,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,MAAM,UAAU,GAAG,CAAC,IAAa,EAAkB,EAAE;IACnD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,mBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,iBAAiB,CAAC;AAC/E,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,IAAa,EAAkB,EAAE;IACpD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;AAC/D,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,IAAa,EAAkB,EAAE;IAClD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,eAAe,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAsB,EAAE;IAC/D,OAAO,IAAA,cAAW,EAAC,OAAiB,CAAC,IAAI,SAAS,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,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G,YAAY,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;KACrD;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,MAAM,CAAC,qBAAqB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;KAC5D;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACjD,MAAM,IAAI,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;KAChD;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,MAAM,IAAI,MAAM,CAAC,0BAA0B,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;KACtE;IAED,IACE,OAAO,aAAa,KAAK,QAAQ;QACjC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC;QAC5B,CAAC,aAAa,EACd;QACA,MAAM,IAAI,MAAM,CAAC,gCAAgC,CAAC,aAAa,CAAC,CAAC;KAClE;IAED,OAAO;QACL,WAAW;QACX,IAAI;QACJ,OAAO;QACP,aAAa;QACb,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;KAChC,CAAC;AACJ,CAAC;AA3DD,oCA2DC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jsdevtools/npm-publish",
3
3
  "description": "Fast, easy publishing to NPM",
4
- "version": "2.2.2",
4
+ "version": "3.0.1",
5
5
  "keywords": [
6
6
  "github-action",
7
7
  "npm",
@@ -54,31 +54,31 @@
54
54
  "devDependencies": {
55
55
  "@actions/core": "^1.10.1",
56
56
  "@types/command-line-args": "^5.2.1",
57
- "@types/node": "^20.6.0",
57
+ "@types/node": "^20.8.6",
58
58
  "@types/tar": "^6.1.6",
59
- "@typescript-eslint/eslint-plugin": "^6.7.0",
60
- "@typescript-eslint/parser": "^6.7.0",
61
- "@vitest/coverage-istanbul": "^0.34.4",
59
+ "@typescript-eslint/eslint-plugin": "^6.7.5",
60
+ "@typescript-eslint/parser": "^6.7.5",
61
+ "@vitest/coverage-istanbul": "^0.34.6",
62
62
  "concurrently": "^8.2.1",
63
- "esbuild": "^0.19.2",
64
- "eslint": "^8.49.0",
63
+ "esbuild": "^0.19.4",
64
+ "eslint": "^8.51.0",
65
65
  "eslint-config-prettier": "^9.0.0",
66
- "eslint-import-resolver-typescript": "^3.6.0",
66
+ "eslint-import-resolver-typescript": "^3.6.1",
67
67
  "eslint-plugin-import": "npm:eslint-plugin-i@^2.28.1",
68
- "eslint-plugin-jsdoc": "^46.6.0",
69
- "eslint-plugin-n": "^16.1.0",
68
+ "eslint-plugin-jsdoc": "^46.8.2",
69
+ "eslint-plugin-n": "^16.2.0",
70
70
  "eslint-plugin-promise": "^6.1.1",
71
71
  "eslint-plugin-sonarjs": "^0.21.0",
72
72
  "eslint-plugin-unicorn": "^48.0.1",
73
73
  "prettier": "^3.0.3",
74
- "prettier-plugin-jsdoc": "^1.0.2",
75
- "rimraf": "^5.0.1",
74
+ "prettier-plugin-jsdoc": "^1.1.1",
75
+ "rimraf": "^5.0.5",
76
76
  "typescript": "^5.2.2",
77
- "vitest": "^0.34.4",
78
- "vitest-when": "^0.1.2"
77
+ "vitest": "^0.34.6",
78
+ "vitest-when": "^0.2.0"
79
79
  },
80
80
  "dependencies": {
81
- "@types/semver": "^7.5.1",
81
+ "@types/semver": "^7.5.2",
82
82
  "command-line-args": "^5.2.1",
83
83
  "semver": "7.5.4",
84
84
  "tar": "6.2.0"
package/src/errors.ts CHANGED
@@ -69,7 +69,9 @@ export class InvalidPackageNameError extends TypeError {
69
69
 
70
70
  export class InvalidPackageVersionError extends TypeError {
71
71
  public constructor(value: unknown) {
72
- super(`Package version must be a string, got "${String(value)}"`);
72
+ super(
73
+ `Package version must be a valid semantic version, got "${String(value)}"`
74
+ );
73
75
  this.name = "InvalidPackageVersionError";
74
76
  }
75
77
  }
@@ -121,7 +121,7 @@ export async function readManifest(
121
121
  }
122
122
 
123
123
  if (typeof version !== "string") {
124
- throw new errors.InvalidPackageVersionError(version);
124
+ throw new errors.InvalidPackageVersionError(manifestJson["version"]);
125
125
  }
126
126
 
127
127
  if (