Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to PR 6007 #6207

Merged
merged 3 commits into from
Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions __tests__/commands/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ test.concurrent('add', async (): Promise<void> => {
});
});

test.concurrent('add (with scoped registry)', (): Promise<void> => {
const flags = {enableDefaultRc: true};
return runGlobal(['add', '@test-scope/scoped-module'], flags, 'add-with-scoped-registry', async config => {
expect(await fs.exists(path.join(config.globalFolder, 'node_modules', '@test-scope', 'scoped-module'))).toEqual(
true,
);
});
});

test.concurrent('remove', async (): Promise<void> => {
const tmpGlobalFolder = await createTempGlobalFolder();
const tmpPrefixFolder = await createTempPrefixFolder();
Expand Down
1 change: 1 addition & 0 deletions __tests__/fixtures/global/add-with-scoped-registry/.yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@test-scope:registry" "http://test-scope-registry.com"
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
HTTP/1.1 200 OK
X-Powered-By: verdaccio/3.5.1
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
ETag: "44b57ba5bc86dbe39ef3e60f5112a6ec"
Content-Length: 754
Vary: Accept-Encoding
X-Status-Cat: http://flic.kr/p/aVuVsF
Date: Fri, 03 Aug 2018 06:37:42 GMT
Connection: keep-alive

{
"name": "@test-scope/scoped-module",
"versions": {
"0.0.1": {
"name": "@test-scope/scoped-module",
"version": "0.0.1",
"description": "Scoped Module for Yarn tests",
"main": "index.js",
"license": "MIT",
"_id": "@test-scope/[email protected]",
"dist": {
"shasum": "0d2cf8db4b0fca4f50a0597e9a377cb1e6c48a93",
"tarball": "http://test-scope-registry.com/@test-scope%2fscoped-module/-/scoped-module-0.0.1.tgz"
}
}
},
"time": {
"modified": "2018-08-03T06:33:38.743Z",
"created": "2018-08-03T06:33:38.743Z",
"0.0.1": "2018-08-03T06:33:38.743Z"
},
"dist-tags": {
"latest": "0.0.1"
},
"_rev": "6-7cc396d8f7359a4d",
"readme": "",
"_attachments": {}
}
Binary file not shown.
2 changes: 2 additions & 0 deletions src/cli/commands/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ async function updateCwd(config: Config): Promise<void> {
globalFolder: config.globalFolder,
cacheFolder: config._cacheRootFolder,
linkFolder: config.linkFolder,
enableDefaultRc: config.enableDefaultRc,
extraneousYarnrcFiles: config.extraneousYarnrcFiles,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ export default class Config {

this.commandName = opts.commandName || '';

this.enableDefaultRc = !!opts.enableDefaultRc;
this.enableDefaultRc = opts.enableDefaultRc !== false;
this.extraneousYarnrcFiles = opts.extraneousYarnrcFiles || [];

this.preferOffline = !!opts.preferOffline;
Expand Down