Skip to content

Commit f1b67c4

Browse files
authored
Renames yarnrc -> yarnrc.yml (yarnpkg#244)
* Removes @types/decamelize (and one other) Commit generated via `yarn stage` * Implements .yarnrc.yml * Fixes the yarn binary used for CI * Adds more information when the binary is wrong * Removes instances of yarnrc * Updates the checked-in builds * Updates the tests * Updates the warn script to support Windows
1 parent 3e102b5 commit f1b67c4

39 files changed

+3860
-10022
lines changed

.pnp.js

-110
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarnrc

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1 @@
1-
## General settings
2-
3-
init-scope: berry
4-
5-
npm-publish-access: public
6-
7-
yarn-path: scripts/run-yarn.js
8-
9-
## List of plugins enabled in the current repository
10-
11-
plugins:
12-
- scripts/plugin-exec.js
13-
- scripts/plugin-stage.js
14-
- scripts/plugin-typescript.js
15-
- scripts/plugin-version.js
16-
- scripts/plugin-workspace-tools.js
1+
yarn-path: scripts/warn-about-yarn1.js

.yarnrc.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## General settings
2+
3+
initScope:
4+
berry
5+
6+
npmPublishAccess:
7+
public
8+
9+
yarnPath:
10+
scripts/run-yarn.js
11+
12+
## List of plugins enabled in the current repository
13+
14+
plugins:
15+
- scripts/plugin-exec.js
16+
- scripts/plugin-stage.js
17+
- scripts/plugin-typescript.js
18+
- scripts/plugin-version.js
19+
- scripts/plugin-workspace-tools.js

README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ Yarn is a modern package manager split into various packages. Its novel architec
2828

2929
## Install
3030

31-
Because this repository is about the modern but experimental version of Yarn (aka Yarn v2), the install process is slightly different for the time being.
32-
33-
- Open one of your project
34-
- First run `yarn policies set-version nightly` - to be sure that the next command will work
35-
- Then run `yarn policies set-version berry` - this will fetch the v2 bundle
36-
- And voilà! Just run any command, such as `yarn config -v` - they will use the v2
37-
- To revert, just remove the local change to your `.yarnrc` file
31+
Consult the [dedicated page](https://yarnpkg.github.io/berry/getting-started/install) for more details.
3832

3933
## Documentation
4034

@@ -93,7 +87,7 @@ $> yarn build:cli
9387

9488
**How it works**
9589

96-
After building the CLI your global `yarn` will immediatly start to reflect your local changes. This is because Yarn will pick up the `yarn-path` settings in this repository's `.yarnrc`, which is configured to use the newly built CLI if available.
90+
After building the CLI your global `yarn` will immediatly start to reflect your local changes. This is because Yarn will pick up the `yarnPath` settings in this repository's `.yarnrc.yml`, which is configured to use the newly built CLI if available.
9791

9892
**Works out of the box!**
9993

azure-pipelines.yml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ jobs:
1414
versionSpec: 10.x
1515
displayName: 'Install Node.js'
1616

17+
- bash: |
18+
npm install -g [email protected]
19+
displayName: "Install Yarn 1.17.2+"
20+
1721
- bash: |
1822
YARN_ENABLE_NETWORK=0 node ./scripts/run-yarn.js --frozen-lockfile
1923
displayName: "Check that the Yarn files don't change on new installs"

packages/acceptance-tests/pkg-tests-specs/sources/auth.test.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe(`Auth tests`, () => {
4343
dependencies: {[`no-deps`]: `1.0.0`},
4444
},
4545
async ({path, run, source}) => {
46-
await writeFile(`${path}/.yarnrc`, `npmAlwaysAuth: true\n`);
46+
await writeFile(`${path}/.yarnrc.yml`, `npmAlwaysAuth: true\n`);
4747

4848
await expect(run(`install`)).rejects.toThrowError(/No authentication configured for request/);
4949
},
@@ -57,7 +57,7 @@ describe(`Auth tests`, () => {
5757
dependencies: {[`private-package`]: `1.0.0`},
5858
},
5959
async ({path, run, source}) => {
60-
await writeFile(`${path}/.yarnrc`, `npmAuthToken: "${AUTH_TOKEN}"\n`);
60+
await writeFile(`${path}/.yarnrc.yml`, `npmAuthToken: "${AUTH_TOKEN}"\n`);
6161

6262
// Rejected by 401 error from registry so no validation on the error message
6363
await expect(run(`install`)).rejects.toThrow();
@@ -72,7 +72,7 @@ describe(`Auth tests`, () => {
7272
dependencies: {[`@private/package`]: `1.0.0`},
7373
},
7474
async ({path, run, source}) => {
75-
await writeFile(`${path}/.yarnrc`, `npmAuthToken: "${AUTH_TOKEN}"\n`);
75+
await writeFile(`${path}/.yarnrc.yml`, `npmAuthToken: "${AUTH_TOKEN}"\n`);
7676

7777
await run(`install`);
7878

@@ -91,7 +91,7 @@ describe(`Auth tests`, () => {
9191
dependencies: {[`private-package`]: `1.0.0`},
9292
},
9393
async ({path, run, source}) => {
94-
await writeFile(`${path}/.yarnrc`, `npmAuthToken: "${AUTH_TOKEN}"\nnpmAlwaysAuth: true\n`);
94+
await writeFile(`${path}/.yarnrc.yml`, `npmAuthToken: "${AUTH_TOKEN}"\nnpmAlwaysAuth: true\n`);
9595

9696
await run(`install`);
9797

@@ -110,7 +110,7 @@ describe(`Auth tests`, () => {
110110
dependencies: {[`private-package`]: `1.0.0`},
111111
},
112112
async ({path, run, source}) => {
113-
await writeFile(`${path}/.yarnrc`, `npmAuthIdent: "${AUTH_IDENT}"\n`);
113+
await writeFile(`${path}/.yarnrc.yml`, `npmAuthIdent: "${AUTH_IDENT}"\n`);
114114

115115
// Rejected by 401 error from registry so no validation on the error message
116116
await expect(run(`install`)).rejects.toThrow();
@@ -125,7 +125,7 @@ describe(`Auth tests`, () => {
125125
dependencies: {[`@private/package`]: `1.0.0`},
126126
},
127127
async ({path, run, source}) => {
128-
await writeFile(`${path}/.yarnrc`, `npmAuthIdent: "${AUTH_IDENT}"\n`);
128+
await writeFile(`${path}/.yarnrc.yml`, `npmAuthIdent: "${AUTH_IDENT}"\n`);
129129

130130
await run(`install`);
131131

@@ -144,7 +144,7 @@ describe(`Auth tests`, () => {
144144
dependencies: {[`private-package`]: `1.0.0`},
145145
},
146146
async ({path, run, source}) => {
147-
await writeFile(`${path}/.yarnrc`, `npmAuthIdent: "${AUTH_IDENT}"\nnpmAlwaysAuth: true\n`);
147+
await writeFile(`${path}/.yarnrc.yml`, `npmAuthIdent: "${AUTH_IDENT}"\nnpmAlwaysAuth: true\n`);
148148

149149
await run(`install`);
150150

@@ -163,7 +163,7 @@ describe(`Auth tests`, () => {
163163
dependencies: {[`private-package`]: `1.0.0`},
164164
},
165165
async ({path, run, source}) => {
166-
await writeFile(`${path}/.yarnrc`, `npmAuthToken: "${INVALID_AUTH_TOKEN}"\nnpmAlwaysAuth: true\n`);
166+
await writeFile(`${path}/.yarnrc.yml`, `npmAuthToken: "${INVALID_AUTH_TOKEN}"\nnpmAlwaysAuth: true\n`);
167167

168168
await expect(run(`install`)).rejects.toThrow();
169169
},
@@ -177,7 +177,7 @@ describe(`Auth tests`, () => {
177177
dependencies: {[`private-package`]: `1.0.0`},
178178
},
179179
async ({path, run, source}) => {
180-
await writeFile(`${path}/.yarnrc`, `npmAuthIdent: "${INVALID_AUTH_IDENT}"\nnpmAlwaysAuth: true\n`);
180+
await writeFile(`${path}/.yarnrc.yml`, `npmAuthIdent: "${INVALID_AUTH_IDENT}"\nnpmAlwaysAuth: true\n`);
181181

182182
await expect(run(`install`)).rejects.toThrow();
183183
},

packages/acceptance-tests/pkg-tests-specs/sources/commands/config.test.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ const environments = {
1414
// Nothing to do
1515
},
1616
[`folder with rcfile`]: async ({path}) => {
17-
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: berry-test\n`);
17+
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: berry-test\n`);
1818
},
1919
[`folder with rcfile without trailing newline`]: async ({path}) => {
20-
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: berry-test`);
20+
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: berry-test`);
2121
},
2222
[`folder with rcfile and rc in parent`]: async ({path}) => {
23-
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: berry-test\n`);
24-
await writeFile(`${path}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: value-to-override\nlast-update-check: 1555784893958\n`);
23+
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: berry-test\n`);
24+
await writeFile(`${path}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: value-to-override\nlastUpdateCheck: 1555784893958\n`);
2525
},
2626
[`folder with rcfile and rc in ancestor parent`]: async ({path}) => {
27-
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: berry-test\n`);
28-
await writeFile(`${path}/${RC_FILENAME}`, `init-scope: value-to-override\nlast-update-check: 1555784893958\n`);
27+
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: berry-test\n`);
28+
await writeFile(`${path}/${RC_FILENAME}`, `initScope: value-to-override\nlastUpdateCheck: 1555784893958\n`);
2929
},
3030
[`folder with rcfile and rc in home folder`]: async ({path, homePath}) => {
31-
await writeFile(`${homePath}/${RC_FILENAME}`, `init-scope: value-to-override\ndefault-language-name: python\n`);
32-
await writeFile(`${path}/${RC_FILENAME}`, `init-scope: berry-test\nlast-update-check: 1555784893958\n`);
31+
await writeFile(`${homePath}/${RC_FILENAME}`, `initScope: value-to-override\ndefaultLanguageName: python\n`);
32+
await writeFile(`${path}/${RC_FILENAME}`, `initScope: berry-test\nlastUpdateCheck: 1555784893958\n`);
3333
},
3434
};
3535

packages/acceptance-tests/pkg-tests-specs/sources/commands/npm/__snapshots__/login.test.js.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Object {
1818
`;
1919

2020
exports[`Commands npm login it should login a user with OTP to a specific scope 1`] = `
21-
"init-scope: berry-test
21+
"initScope: berry-test
2222
23-
npm-registries:
23+
npmRegistries:
2424
\\"http://yarn.test.registry\\":
2525
npmAuthToken: 686159dc-64b3-413e-a244-2de2b8d1c36f
2626
@@ -58,9 +58,9 @@ Object {
5858
`;
5959

6060
exports[`Commands npm login it should login a user with no OTP setup to a specific scope 1`] = `
61-
"init-scope: berry-test
61+
"initScope: berry-test
6262
63-
npm-registries:
63+
npmRegistries:
6464
\\"http://yarn.test.registry\\":
6565
npmAuthToken: 316158de-64b3-413e-a244-2de2b8d1c80f
6666

packages/acceptance-tests/pkg-tests-specs/sources/commands/npm/login.test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ describe(`Commands`, () => {
114114
const homePath = await createTemporaryFolder();
115115

116116
await writeFile(`${homePath}/${SPEC_RC_FILENAME}`, [
117-
`init-scope: berry-test\n`,
117+
`initScope:\n`,
118+
` berry-test\n`,
118119
`npmScopes:\n`,
119120
` testScope:\n`,
120121
` npmRegistryServer: "${url}"\n`,
@@ -153,7 +154,8 @@ describe(`Commands`, () => {
153154
const homePath = await createTemporaryFolder();
154155

155156
const initialRcFileContent = [
156-
`init-scope: berry-test\n`,
157+
`initScope:\n`,
158+
` berry-test\n`,
157159
`npmScopes:\n`,
158160
` testScope:\n`,
159161
` npmRegistryServer: "${url}"\n`,

0 commit comments

Comments
 (0)