Skip to content

Commit

Permalink
fix: account for new npm-package-arg behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Oct 18, 2022
1 parent 6fe7663 commit a722962
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/check/check-required.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const run = ({ pkg, path, config: { requiredPackages = {} } }) => {

return {
title: `The following required ${location} were not found:`,
body: specs.map((s) => s.rawSpec ? `${s.name}@${s.rawSpec}` : s.name),
body: specs.map((s) => s.rawSpec === '*' ? s.name : `${s.name}@${s.rawSpec}`),
// solution is to remove any existing all at once but add back in by --save-<location>
solution: [
rmCommand(specs),
Expand Down
4 changes: 0 additions & 4 deletions lib/util/has-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ const getSpecVersion = (spec, where) => {
switch (arg.type) {
case 'range':
return new semver.Range(arg.fetchSpec)
case 'tag': {
// special case an empty spec to mean any version
return arg.rawSpec === '' && new semver.Range('*')
}
case 'version':
return new semver.SemVer(arg.fetchSpec)
case 'directory': {
Expand Down
10 changes: 5 additions & 5 deletions tap-snapshots/test/check/snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The following required devDependencies were not found:
@npmcli/eslint-config
tap
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@latest tap@latest --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@* tap@* --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
-------------------------------------------------------------------
`
Expand Down Expand Up @@ -250,7 +250,7 @@ The following required devDependencies were not found:
@npmcli/eslint-config
tap
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@latest tap@latest --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@* tap@* --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
-------------------------------------------------------------------
`
Expand Down Expand Up @@ -357,7 +357,7 @@ The following required devDependencies were not found:
@npmcli/eslint-config
tap
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@latest tap@latest --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@* tap@* --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
-------------------------------------------------------------------
Expand Down Expand Up @@ -427,7 +427,7 @@ The following required devDependencies were not found:
@npmcli/eslint-config
tap
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@latest tap@latest --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@* tap@* --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
-------------------------------------------------------------------
Expand Down Expand Up @@ -497,7 +497,7 @@ The following required devDependencies were not found:
@npmcli/eslint-config
tap
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@latest tap@latest --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
To correct it: npm rm @npmcli/template-oss @npmcli/eslint-config tap && npm i @npmcli/eslint-config@* tap@* --save-dev && npm i @npmcli/template-oss@{{VERSION}} --save-dev --save-exact
-------------------------------------------------------------------
`

0 comments on commit a722962

Please sign in to comment.