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(js): avoid nested paths in workspaces because they can lead to future issues #29553

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Jan 8, 2025

For the new TS setup, we currently use nested glob patterns: apps/**, libs/**, and packages/**.

Nested paths can result into too many projects being matched. For example, if libs/mylib/src/__fixtures__/package.json is there for testing, it will be matched as a project and likely result in an error.

Other tools like turborepo also caution against this: https://turbo.build/repo/docs/crafting-your-repository/structuring-a-repository#declaring-directories-for-packages

If users want to, they could change to nested ** paths, but we should not use it by default.

Note: For CNW, we only use apps/* by default since that is where the project lives. When users do nx g lib packages/foo then packages/* will be added automatically.

Current Behavior

Use nested ** paths.

Expected Behavior

Don't use nested ** paths.

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from Coly010 January 8, 2025 18:23
Copy link

vercel bot commented Jan 8, 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 Jan 8, 2025 8:43pm

Copy link

nx-cloud bot commented Jan 8, 2025

View your CI Pipeline Execution ↗ for commit 2653680.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 6m 30s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 25s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check --base=71653... ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx documentation --no-dte ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-08 20:53:31 UTC

@jaysoo jaysoo force-pushed the fix/workspaces-glob branch 2 times, most recently from f8ad3fb to 107179a Compare January 8, 2025 19:48
@jaysoo jaysoo force-pushed the fix/workspaces-glob branch from 107179a to 2653680 Compare January 8, 2025 20:41
@jaysoo jaysoo merged commit fb31800 into master Jan 8, 2025
6 checks passed
@jaysoo jaysoo deleted the fix/workspaces-glob branch January 8, 2025 23:08
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.

2 participants