Skip to content

Commit

Permalink
Fix renaming scoped packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambroos committed Nov 14, 2017
1 parent 18eed7b commit a8405e4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions __tests__/commands/install/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,10 @@ test.concurrent('install renamed packages', (): Promise<void> => {

const json2 = await fs.readJson(path.join(dir, 'left-pad2', 'package.json'));
expect(json2.version).toEqual('1.1.0');

const json3 = await fs.readJson(path.join(dir, 'unscoped-turf-helpers', 'package.json'));
expect(json3.version).toEqual('3.0.16');
expect(json3.name).toEqual('@turf/helpers');
});
});

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"dependencies": {
"left-pad": "npm:left-pad@1.0.0",
"left-pad2": "npm:left-pad@1.1.0"
"left-pad2": "npm:left-pad@1.1.0",
"unscoped-turf-helpers": "npm:@turf/helpers@3.0.16"
}
}
3 changes: 3 additions & 0 deletions __tests__/fixtures/install/install-renamed-packages/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@turf/helpers@3.0.16":
version "3.0.16"
resolved helpers-3.0.16.tgz#450adf252738358847ce0359030412b0b421a877
"left-pad@npm:left-pad@1.0.0":
version "1.0.0"
resolved left-pad-1.0.0.tgz#c84e2417581bbb8eaf2b9e3d7a122e572ab1af37
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/exotics/registry-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class RegistryResolver extends ExoticResolver {
constructor(request: PackageRequest, fragment: string) {
super(request, fragment);

const match = fragment.match(/^(\S+):(.*?)(@(.*?)|)$/);
const match = fragment.match(/^(\S+):(@?.*?)(@(.*?)|)$/);
if (match) {
this.range = match[4] || 'latest';
this.name = match[2];
Expand Down

0 comments on commit a8405e4

Please sign in to comment.