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

fix(core): create multi-glob function #29880

Merged
merged 8 commits into from
Feb 7, 2025
Merged

Conversation

Cammisuli
Copy link
Member

@Cammisuli Cammisuli commented Feb 4, 2025

Current Behavior

Whenever there are multiple plugins using in a workspace, all the configuration paths are collected and used as 1 giant glob to test against the workspace context files.

Expected Behavior

Each plugin configuration glob is now handled separately and are not joined together into one giant one. This allows each glob pattern to have separate files for each plugin.

Related Issue(s)

Fixes #29473

Copy link

vercel bot commented Feb 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2025 7:28pm

Copy link

nx-cloud bot commented Feb 4, 2025

View your CI Pipeline Execution ↗ for commit 95ff39b.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 38m 1s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 20s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 4s View ↗
nx-cloud record -- nx format:check --base= --he... ✅ Succeeded 10s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 10s View ↗
nx documentation ✅ Succeeded 57s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-07 20:10:33 UTC

@Cammisuli Cammisuli marked this pull request as ready for review February 4, 2025 22:20
@Cammisuli Cammisuli requested review from a team as code owners February 4, 2025 22:20
@Cammisuli Cammisuli force-pushed the cammisuli/multi-globs branch from 0c6c222 to 0a0be97 Compare February 5, 2025 12:35
@AgentEnder
Copy link
Member

Have we checked if there is a noticeable perf difference when running ~10 plugins?

@Cammisuli Cammisuli force-pushed the cammisuli/multi-globs branch from eac7070 to f9eb5a1 Compare February 6, 2025 21:25
Comment on lines 159 to 161
} else {
// if there is no glob in the plugin, add an empty glob so that we can still map the globs by index to the plugin
globPatterns.push('');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before going into here, we should filter out the plugins that do not have createNodes already. Since they are not going to be used for creating the project grap

Cammisuli and others added 7 commits February 7, 2025 13:22
This ensures consistent indexing between glob patterns and plugins. It prevents potential errors when mapping plugins to their respective globs.
- Add missing semicolon in `retrieve-workspace-files.ts`.
- Correct indentation in `retrieve-workspace-files.spec.ts` for readability.
@FrozenPandaz FrozenPandaz force-pushed the cammisuli/multi-globs branch from f9eb5a1 to 6cc2644 Compare February 7, 2025 18:25
@@ -1678,6 +1678,16 @@ describe('project-configuration-utils', () => {
],
};

const noProjectsPlugin: NxPluginV2 = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't used

@FrozenPandaz FrozenPandaz merged commit 64f165d into master Feb 7, 2025
12 checks passed
@FrozenPandaz FrozenPandaz deleted the cammisuli/multi-globs branch February 7, 2025 20:18
@antoinepairet
Copy link

Thank you @FrozenPandaz @Cammisuli and @AgentEnder 🙌🏻 🙇🏻

jaysoo pushed a commit that referenced this pull request Feb 12, 2025
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Whenever there are multiple plugins using in a workspace, all the
configuration paths are collected and used as 1 giant glob to test
against the workspace context files.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Each plugin configuration glob is now handled separately and are not
joined together into one giant one. This allows each glob pattern to
have separate files for each plugin.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #29473

---------

Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect Handling of Negation in Glob Pattern in Nx Plugin - createNodesV2
4 participants