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 6 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,7 +14,7 @@ describe(`Commands`, () => {
test(
`it should print the npm registry username when config has a valid npmAuthToken`,
makeTemporaryEnv({}, async ({ path, run, source }) => {
await writeFile(`${path}/.yarnrc`, `npmAuthToken: "${AUTH_TOKEN}"\n`);
await writeFile(`${path}/.yarnrc.yml`, `npmAuthToken: "${AUTH_TOKEN}"\n`);

let code;
let stdout;
Expand All @@ -33,7 +33,7 @@ describe(`Commands`, () => {
test(
`it should print the npm registry username when config has a valid npmAuthIdent`,
makeTemporaryEnv({}, async ({ path, run, source }) => {
await writeFile(`${path}/.yarnrc`, `npmAuthIdent: "${AUTH_IDENT}"\n`);
await writeFile(`${path}/.yarnrc.yml`, `npmAuthIdent: "${AUTH_IDENT}"\n`);

let code;
let stdout;
Expand All @@ -54,7 +54,7 @@ describe(`Commands`, () => {
makeTemporaryEnv({}, async ({ path, run, source }) => {
const url = startPackageServer();

await writeFile(`${path}/.yarnrc`, [
await writeFile(`${path}/.yarnrc.yml`, [
`npmScopes:\n`,
` testScope:\n`,
` npmRegistryServer: "${url}"\n`,
Expand Down Expand Up @@ -87,15 +87,15 @@ describe(`Commands`, () => {
test(
`it should throw an error when config has an invalid npmAuthToken`,
makeTemporaryEnv({}, async ({ path, run, source }) => {
await writeFile(`${path}/.yarnrc`, `npmAuthToken: "${INVALID_AUTH_TOKEN}"\n`);
await writeFile(`${path}/.yarnrc.yml`, `npmAuthToken: "${INVALID_AUTH_TOKEN}"\n`);
await expect(run(`npm`, `whoami`)).rejects.toThrowError(/Authentication failed/);
})
);

test(
`it should throw an error when config has an invalid npmAuthIdent`,
makeTemporaryEnv({}, async ({ path, run, source }) => {
await writeFile(`${path}/.yarnrc`, `npmAuthIdent: "${INVALID_AUTH_IDENT}"\n`);
await writeFile(`${path}/.yarnrc.yml`, `npmAuthIdent: "${INVALID_AUTH_IDENT}"\n`);
await expect(run(`npm`, `whoami`)).rejects.toThrowError(/Authentication failed/);
})
);
Expand All @@ -105,7 +105,7 @@ describe(`Commands`, () => {
makeTemporaryEnv({}, async ({ path, run, source }) => {
const url = startPackageServer();

await writeFile(`${path}/.yarnrc`, [
await writeFile(`${path}/.yarnrc.yml`, [
`npmScopes:\n`,
` testScope:\n`,
` npmRegistryServer: "${url}"\n`,
Expand Down