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

Renames yarnrc -> yarnrc.yml #244

Merged
merged 8 commits into from Jun 21, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
118 changes: 0 additions & 118 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
@@ -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
@@ -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
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
Expand Up @@ -14,6 +14,10 @@ jobs:
versionSpec: 10.x
displayName: 'Install Node.js'

- bash: |
npm install -g yarn@1.17.2
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
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
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
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