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

Enables all official plugins by default #4253

Merged
merged 25 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
8,713 changes: 6,908 additions & 1,805 deletions .pnp.cjs

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions .yarn/versions/bbd4868b.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
releases:
"@yarnpkg/cli": major
"@yarnpkg/libui": major
"@yarnpkg/plugin-constraints": major
"@yarnpkg/plugin-interactive-tools": major
"@yarnpkg/plugin-version": major

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ describe(`Commands`, () => {
for (const [environmentDescription, environment] of Object.entries(environments)) {
for (const [scriptDescription, script] of Object.entries(constraints)) {
test(`test (${environmentDescription} / ${scriptDescription})`,
makeTemporaryEnv({}, {
plugins: [
require.resolve(`@yarnpkg/monorepo/scripts/plugin-constraints.js`),
arcanis marked this conversation as resolved.
Show resolved Hide resolved
],
}, async ({path, run, source}) => {
makeTemporaryEnv({}, async ({path, run, source}) => {
await environment(path);
await writeFile(`${path}/constraints.pro`, script);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import {xfs} from '@yarnpkg/fslib';
import {environments} from './environments';

describe(`Commands`, () => {
const config = {
plugins: [
require.resolve(`@yarnpkg/monorepo/scripts/plugin-constraints.js`),
],
};

const manifest = {
workspaces: [
`packages/*`,
Expand All @@ -24,7 +18,7 @@ describe(`Commands`, () => {
};

describe(`constraints --fix`, () => {
test(`test apply fix to dependencies`, makeTemporaryEnv(manifest, config, async ({path, run, source}) => {
test(`test apply fix to dependencies`, makeTemporaryEnv(manifest, async ({path, run, source}) => {
await xfs.writeFilePromise(`${path}/constraints.pro`, `
gen_enforced_dependency('.', 'is-number', '2.0.0', dependencies).
`);
Expand All @@ -37,7 +31,7 @@ describe(`Commands`, () => {
expect(fixedManifest.license).toBe(`MIT`);
}));

test(`test apply fix to fields`, makeTemporaryEnv(manifest, config, async ({path, run, source}) => {
test(`test apply fix to fields`, makeTemporaryEnv(manifest, async ({path, run, source}) => {
await xfs.writeFilePromise(`${path}/constraints.pro`, `
gen_enforced_field('.', 'license', 'BSD-2-Clause').
`);
Expand All @@ -50,7 +44,7 @@ describe(`Commands`, () => {
expect(fixedManifest.license).toBe(`BSD-2-Clause`);
}));

test(`test apply fix to fields and manifests`, makeTemporaryEnv(manifest, config, async ({path, run, source}) => {
test(`test apply fix to fields and manifests`, makeTemporaryEnv(manifest, async ({path, run, source}) => {
await xfs.writeFilePromise(`${path}/constraints.pro`, `
gen_enforced_dependency('.', 'is-number', '2.0.0', dependencies).
gen_enforced_field('.', 'license', 'BSD-2-Clause').
Expand All @@ -64,7 +58,7 @@ describe(`Commands`, () => {
expect(fixedManifest.license).toBe(`BSD-2-Clause`);
}));

test(`test applying fix shouldn't duplicate workspaces`, makeTemporaryEnv(manifest, config, async ({path, run, source}) => {
test(`test applying fix shouldn't duplicate workspaces`, makeTemporaryEnv(manifest, async ({path, run, source}) => {
await xfs.writeFilePromise(`${path}/constraints.pro`, `
gen_enforced_dependency('.', 'is-number', '2.0.0', dependencies).
gen_enforced_field('.', 'license', 'BSD-2-Clause').
Expand All @@ -77,7 +71,7 @@ describe(`Commands`, () => {
expect(fixedManifest.workspaces.length).toBe(1);
}));

it(`should preserve the raw manifest data when applying a fix`, makeTemporaryEnv(manifest, config, async ({path, run, source}) => {
it(`should preserve the raw manifest data when applying a fix`, makeTemporaryEnv(manifest, async ({path, run, source}) => {
await xfs.writeFilePromise(`${path}/constraints.pro`, `
gen_enforced_dependency('.', 'is-number', null, dependencies).
`);
Expand All @@ -90,7 +84,7 @@ describe(`Commands`, () => {
expect(fixedManifest.unparsedKey).toBe(`foo`);
}));

test(`test apply fix to string fields`, makeTemporaryEnv(manifest, config, async ({path, run, source}) => {
test(`test apply fix to string fields`, makeTemporaryEnv(manifest, async ({path, run, source}) => {
environments[`various field types`](path);

await xfs.writeFilePromise(`${path}/constraints.pro`, `
Expand All @@ -104,7 +98,7 @@ describe(`Commands`, () => {
expect(fixedManifest._name).toStrictEqual(`foo`);
}));

test(`test apply fix to object fields`, makeTemporaryEnv(manifest, config, async ({path, run, source}) => {
test(`test apply fix to object fields`, makeTemporaryEnv(manifest, async ({path, run, source}) => {
environments[`various field types`](path);

await xfs.writeFilePromise(`${path}/constraints.pro`, `
Expand All @@ -122,7 +116,7 @@ describe(`Commands`, () => {
});
}));

test(`test apply fix to array fields`, makeTemporaryEnv(manifest, config, async ({path, run, source}) => {
test(`test apply fix to array fields`, makeTemporaryEnv(manifest, async ({path, run, source}) => {
environments[`various field types`](path);

await xfs.writeFilePromise(`${path}/constraints.pro`, `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ describe(`Commands`, () => {
describe(`constraints query`, () => {
test(
`test without trailing .`,
makeTemporaryEnv({}, {
plugins: [
require.resolve(`@yarnpkg/monorepo/scripts/plugin-constraints.js`),
],
}, async({path, run, source}) => {
makeTemporaryEnv({}, async({path, run, source}) => {
await environments[`one regular dependency`](path);

let code;
Expand All @@ -49,11 +45,7 @@ describe(`Commands`, () => {

test(
`test with a syntax error`,
makeTemporaryEnv({}, {
plugins: [
require.resolve(`@yarnpkg/monorepo/scripts/plugin-constraints.js`),
],
}, async({path, run, source}) => {
makeTemporaryEnv({}, async({path, run, source}) => {
await environments[`one regular dependency`](path);

let code;
Expand All @@ -72,11 +64,7 @@ describe(`Commands`, () => {

test(
`test with an unknown predicate`,
makeTemporaryEnv({}, {
plugins: [
require.resolve(`@yarnpkg/monorepo/scripts/plugin-constraints.js`),
],
}, async({path, run, source}) => {
makeTemporaryEnv({}, async({path, run, source}) => {
await environments[`one regular dependency`](path);

let code;
Expand All @@ -95,11 +83,7 @@ describe(`Commands`, () => {

test(
`test with an empty predicate`,
makeTemporaryEnv({}, {
plugins: [
require.resolve(`@yarnpkg/monorepo/scripts/plugin-constraints.js`),
],
}, async({path, run, source}) => {
makeTemporaryEnv({}, async({path, run, source}) => {
await environments[`one regular dependency`](path);

let code;
Expand All @@ -120,11 +104,7 @@ describe(`Commands`, () => {
for (const [queryDescription, query] of Object.entries(queries)) {
test(
`test (${environmentDescription} / ${queryDescription})`,
makeTemporaryEnv({}, {
plugins: [
require.resolve(`@yarnpkg/monorepo/scripts/plugin-constraints.js`),
],
}, async ({path, run, source}) => {
makeTemporaryEnv({}, async ({path, run, source}) => {
await environment(path);
await writeFile(`${path}/constraints.pro`, constraintsFile);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ describe(`Commands`, () => {
for (const [scriptDescription, script] of Object.entries(constraints)) {
test(
`test (${environmentDescription} / ${scriptDescription})`,
makeTemporaryEnv({}, {
plugins: [
require.resolve(`@yarnpkg/monorepo/scripts/plugin-constraints.js`),
],
}, async ({path, run, source}) => {
makeTemporaryEnv({}, async ({path, run, source}) => {
await environment(path);
await writeFile(`${path}/constraints.pro`, script);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe(`Commands`, () => {

await writeFile(`${path}/.yarnrc.yml`, [
`plugins:`,
` - ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-version.js`))}`,
` - ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-hello-world.js`))}`,
`npmScopes:`,
` private:`,
` npmRegistryServer: "${url}"`,
Expand All @@ -111,7 +111,7 @@ describe(`Commands`, () => {
makeTemporaryEnv({}, async ({path, run, source}) => {
const url = await startPackageServer();

const relativePluginPath = require.resolve(`@yarnpkg/monorepo/scripts/plugin-version.js`);
const relativePluginPath = require.resolve(`@yarnpkg/monorepo/scripts/plugin-hello-world.js`);

await writeFile(`${path}/.yarnrc.yml`, [
`plugins:`,
Expand All @@ -136,8 +136,8 @@ describe(`Commands`, () => {

await writeFile(`${path}/.yarnrc.yml`, [
`plugins:`,
` - path: ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-version.js`))}`,
` spec: "@yarnpkg/plugin-version"`,
` - path: ${JSON.stringify(require.resolve(`@yarnpkg/monorepo/scripts/plugin-hello-world.js`))}`,
` spec: "@yarnpkg/plugin-hello-world"`,
`npmScopes:`,
` private:`,
` npmRegistryServer: "${url}"`,
Expand Down
Loading