Skip to content

Commit

Permalink
fix(deps): npm-package-arg now normalize x, x@, x@* (#400)
Browse files Browse the repository at this point in the history
* fix(deps): npm-package-arg now normalize x, x@, x@*
- npa will no longer return "latest" when passing `*` but instead it will return empty string "" as per their new v10 PR: npm/statusboard#460
  • Loading branch information
ghiscoding committed Oct 21, 2022
1 parent 4eaea64 commit 41b6eaa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Expand Up @@ -58,7 +58,7 @@
"make-dir": "^3.1.0",
"minimatch": "^5.1.0",
"node-fetch": "^2.6.7",
"npm-package-arg": "^9.1.2",
"npm-package-arg": "^10.0.0",
"npmlog": "^7.0.1",
"p-map": "^4.0.0",
"p-queue": "^6.6.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/package.ts
Expand Up @@ -271,7 +271,7 @@ export class Package {
/^(workspace:)+(.*)$/.test(workspaceSpec)
) {
if (workspaceSpec) {
if (resolved.fetchSpec === 'latest') {
if (resolved.fetchSpec === 'latest' || resolved.fetchSpec === '') {
npmlog.error(
`publish`,
[
Expand Down
2 changes: 1 addition & 1 deletion packages/publish/package.json
Expand Up @@ -41,7 +41,7 @@
"has-unicode": "^2.0.1",
"libnpmaccess": "^6.0.4",
"libnpmpublish": "^7.0.0",
"npm-package-arg": "^9.1.2",
"npm-package-arg": "^10.0.0",
"npm-packlist": "^7.0.1",
"npm-registry-fetch": "^14.0.2",
"npmlog": "^7.0.1",
Expand Down
Expand Up @@ -279,12 +279,12 @@ describe("workspace protocol 'workspace:' specifiers", () => {
'publish',
[
`Your package named "package-6" has external dependencies not handled by Lerna-Lite and without workspace version suffix, `,
`we recommend using defined versions with workspace protocol. Your dependency is currently being published with "tiny-registry": "latest".`,
`we recommend using defined versions with workspace protocol. Your dependency is currently being published with "tiny-registry": "".`,
].join('')
);
expect((writePkg as any).updatedManifest('package-6').dependencies).toMatchObject({
'package-1': '>=1.0.0', // workspace:>=1.0.0 will not be bumped without a flag
'tiny-registry': 'latest', // workspace:*
'tiny-registry': '', // workspace:*
'tiny-tarball': '^2.3.4', // workspace:^2.3.4
});
});
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 41b6eaa

Please sign in to comment.