Skip to content

Commit

Permalink
Renames yarnrc -> yarnrc.yml (yarnpkg#244)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
arcanis authored Jun 21, 2019
1 parent 3e102b5 commit f1b67c4
Show file tree
Hide file tree
Showing 39 changed files with 3,860 additions and 10,022 deletions.
110 changes: 0 additions & 110 deletions .pnp.js

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

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 1 addition & 16 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
## General settings

init-scope: berry

npm-publish-access: public

yarn-path: scripts/run-yarn.js

## List of plugins enabled in the current repository

plugins:
- scripts/plugin-exec.js
- scripts/plugin-stage.js
- scripts/plugin-typescript.js
- scripts/plugin-version.js
- scripts/plugin-workspace-tools.js
yarn-path: scripts/warn-about-yarn1.js
19 changes: 19 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## General settings

initScope:
berry

npmPublishAccess:
public

yarnPath:
scripts/run-yarn.js

## List of plugins enabled in the current repository

plugins:
- scripts/plugin-exec.js
- scripts/plugin-stage.js
- scripts/plugin-typescript.js
- scripts/plugin-version.js
- scripts/plugin-workspace-tools.js
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ Yarn is a modern package manager split into various packages. Its novel architec

## Install

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.

- Open one of your project
- First run `yarn policies set-version nightly` - to be sure that the next command will work
- Then run `yarn policies set-version berry` - this will fetch the v2 bundle
- And voilà! Just run any command, such as `yarn config -v` - they will use the v2
- To revert, just remove the local change to your `.yarnrc` file
Consult the [dedicated page](https://yarnpkg.github.io/berry/getting-started/install) for more details.

## Documentation

Expand Down Expand Up @@ -93,7 +87,7 @@ $> yarn build:cli

**How it works**

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.
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.

**Works out of the box!**

Expand Down
4 changes: 4 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
versionSpec: 10.x
displayName: 'Install Node.js'

- bash: |
npm install -g [email protected]
displayName: "Install Yarn 1.17.2+"
- bash: |
YARN_ENABLE_NETWORK=0 node ./scripts/run-yarn.js --frozen-lockfile
displayName: "Check that the Yarn files don't change on new installs"
Expand Down
18 changes: 9 additions & 9 deletions packages/acceptance-tests/pkg-tests-specs/sources/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe(`Auth tests`, () => {
dependencies: {[`no-deps`]: `1.0.0`},
},
async ({path, run, source}) => {
await writeFile(`${path}/.yarnrc`, `npmAlwaysAuth: true\n`);
await writeFile(`${path}/.yarnrc.yml`, `npmAlwaysAuth: true\n`);

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

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

await run(`install`);

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

await run(`install`);

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

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

await run(`install`);

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

await run(`install`);

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

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

await expect(run(`install`)).rejects.toThrow();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ const environments = {
// Nothing to do
},
[`folder with rcfile`]: async ({path}) => {
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: berry-test\n`);
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: berry-test\n`);
},
[`folder with rcfile without trailing newline`]: async ({path}) => {
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: berry-test`);
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: berry-test`);
},
[`folder with rcfile and rc in parent`]: async ({path}) => {
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: berry-test\n`);
await writeFile(`${path}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: value-to-override\nlast-update-check: 1555784893958\n`);
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: berry-test\n`);
await writeFile(`${path}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: value-to-override\nlastUpdateCheck: 1555784893958\n`);
},
[`folder with rcfile and rc in ancestor parent`]: async ({path}) => {
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `init-scope: berry-test\n`);
await writeFile(`${path}/${RC_FILENAME}`, `init-scope: value-to-override\nlast-update-check: 1555784893958\n`);
await writeFile(`${path}/${SUBFOLDER}/${SUBFOLDER}/${RC_FILENAME}`, `initScope: berry-test\n`);
await writeFile(`${path}/${RC_FILENAME}`, `initScope: value-to-override\nlastUpdateCheck: 1555784893958\n`);
},
[`folder with rcfile and rc in home folder`]: async ({path, homePath}) => {
await writeFile(`${homePath}/${RC_FILENAME}`, `init-scope: value-to-override\ndefault-language-name: python\n`);
await writeFile(`${path}/${RC_FILENAME}`, `init-scope: berry-test\nlast-update-check: 1555784893958\n`);
await writeFile(`${homePath}/${RC_FILENAME}`, `initScope: value-to-override\ndefaultLanguageName: python\n`);
await writeFile(`${path}/${RC_FILENAME}`, `initScope: berry-test\nlastUpdateCheck: 1555784893958\n`);
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Object {
`;

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

exports[`Commands npm login it should login a user with no OTP setup to a specific scope 1`] = `
"init-scope: berry-test
"initScope: berry-test
npm-registries:
npmRegistries:
\\"http://yarn.test.registry\\":
npmAuthToken: 316158de-64b3-413e-a244-2de2b8d1c80f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ describe(`Commands`, () => {
const homePath = await createTemporaryFolder();

await writeFile(`${homePath}/${SPEC_RC_FILENAME}`, [
`init-scope: berry-test\n`,
`initScope:\n`,
` berry-test\n`,
`npmScopes:\n`,
` testScope:\n`,
` npmRegistryServer: "${url}"\n`,
Expand Down Expand Up @@ -153,7 +154,8 @@ describe(`Commands`, () => {
const homePath = await createTemporaryFolder();

const initialRcFileContent = [
`init-scope: berry-test\n`,
`initScope:\n`,
` berry-test\n`,
`npmScopes:\n`,
` testScope:\n`,
` npmRegistryServer: "${url}"\n`,
Expand Down
Loading

0 comments on commit f1b67c4

Please sign in to comment.