- 
          
- 
        Couldn't load subscription status. 
- Fork 1.2k
Add opt-in optimization for static workspace patterns in 'project.setupWorkspaces' #6941
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| releases: | ||
| "@yarnpkg/core": patch | ||
|  | ||
| declined: | ||
| - "@yarnpkg/plugin-catalog" | ||
| - "@yarnpkg/plugin-compat" | ||
| - "@yarnpkg/plugin-constraints" | ||
| - "@yarnpkg/plugin-dlx" | ||
| - "@yarnpkg/plugin-essentials" | ||
| - "@yarnpkg/plugin-exec" | ||
| - "@yarnpkg/plugin-file" | ||
| - "@yarnpkg/plugin-git" | ||
| - "@yarnpkg/plugin-github" | ||
| - "@yarnpkg/plugin-http" | ||
| - "@yarnpkg/plugin-init" | ||
| - "@yarnpkg/plugin-interactive-tools" | ||
| - "@yarnpkg/plugin-jsr" | ||
| - "@yarnpkg/plugin-link" | ||
| - "@yarnpkg/plugin-nm" | ||
| - "@yarnpkg/plugin-npm" | ||
| - "@yarnpkg/plugin-npm-cli" | ||
| - "@yarnpkg/plugin-pack" | ||
| - "@yarnpkg/plugin-patch" | ||
| - "@yarnpkg/plugin-pnp" | ||
| - "@yarnpkg/plugin-pnpm" | ||
| - "@yarnpkg/plugin-stage" | ||
| - "@yarnpkg/plugin-typescript" | ||
| - "@yarnpkg/plugin-version" | ||
| - "@yarnpkg/plugin-workspace-tools" | ||
| - "@yarnpkg/builder" | ||
| - "@yarnpkg/cli" | ||
| - "@yarnpkg/doctor" | ||
| - "@yarnpkg/extensions" | ||
| - "@yarnpkg/nm" | ||
| - "@yarnpkg/pnpify" | ||
| - "@yarnpkg/sdks" | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -35,6 +35,27 @@ describe(`Workspaces tests`, () => { | |
| }), | ||
| ); | ||
|  | ||
| test( | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The two tests that I've added here are duplicates of tests that already exist in this file, however these new tests have the  | ||
| `it should support basic glob patterns with enableWorkspacePatternAnalysis`, | ||
| makeTemporaryMonorepoEnv({ | ||
| workspaces: [ | ||
| `packages/*`, | ||
| ], | ||
| }, { | ||
| [`packages/foo`]: {}, | ||
| [`packages/bar`]: {}, | ||
| [`packages/baz`]: {}, | ||
| }, async ({path, run, source}) => { | ||
| await run(`config`, `set`, `enableWorkspacePatternAnalysis`, `true`); | ||
| await expect(getWorkspaces(run)).resolves.toStrictEqual([ | ||
| `.`, | ||
| `packages/bar`, | ||
| `packages/baz`, | ||
| `packages/foo`, | ||
| ]); | ||
| }), | ||
| ); | ||
|  | ||
| test( | ||
| `it should support negated glob patterns`, | ||
| makeTemporaryMonorepoEnv({ | ||
|  | @@ -55,6 +76,27 @@ describe(`Workspaces tests`, () => { | |
| }), | ||
| ); | ||
|  | ||
| test( | ||
| `it should support negated glob patterns with enableWorkspacePatternAnalysis`, | ||
| makeTemporaryMonorepoEnv({ | ||
| workspaces: [ | ||
| `packages/*`, | ||
| `!packages/foo`, | ||
| ], | ||
| }, { | ||
| [`packages/foo`]: {}, | ||
| [`packages/bar`]: {}, | ||
| [`packages/baz`]: {}, | ||
| }, async ({path, run, source}) => { | ||
| await run(`config`, `set`, `enableWorkspacePatternAnalysis`, `true`); | ||
| await expect(getWorkspaces(run)).resolves.toStrictEqual([ | ||
| `.`, | ||
| `packages/bar`, | ||
| `packages/baz`, | ||
| ]); | ||
| }), | ||
| ); | ||
|  | ||
| test( | ||
| `it should not implicitly make workspaces require-able`, | ||
| makeTemporaryEnv( | ||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was auto-generated when running
yarn test:lint --fixWithout this change, I get the following error in CI: