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

feat(core): use custom resolution to resolve from source local plugins with artifacts pointing to the outputs #29222

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

leosvelperez
Copy link
Member

@leosvelperez leosvelperez commented Dec 5, 2024

Current Behavior

Local Nx plugins in the new TS setup can't be resolved properly if they aren't built first. Graph plugins can't be built either because the graph is needed to run a task, but the plugin must be built to construct the graph.

Expected Behavior

Local Nx plugins should work in the new TS setup. A custom resolution is added to resolve the local plugin artifacts from the source.

It will try to use a development condition from the exports entry in package.json if it exists. If it doesn't, it will fall back to guess the source based on the artifact path and some commonly known/used source dirs: ., ./src, ./src/lib.

Related Issue(s)

Fixes #

@leosvelperez leosvelperez self-assigned this Dec 5, 2024
Copy link

vercel bot commented Dec 5, 2024

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 Dec 13, 2024 1:35pm

Copy link

nx-cloud bot commented Dec 5, 2024

Your CI Pipeline Execution ↗ for commit 017b51e ⏳ is in progress.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 8m, 27s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 24s View ↗
nx-cloud record -- nx format:check --base=f96fd... ✅ Succeeded 2s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 0s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 0s View ↗
nx documentation --no-dte ✅ Succeeded 0s View ↗

Last updated at 2024-12-13 15:20:19UTC

Sent with 💌 from NxCloud.

@leosvelperez leosvelperez force-pushed the core/local-plugin-custom-resolution branch 2 times, most recently from d1c4fe2 to dc5ce4a Compare December 10, 2024 10:18
@leosvelperez leosvelperez marked this pull request as draft December 10, 2024 17:17
@leosvelperez leosvelperez force-pushed the core/local-plugin-custom-resolution branch from dc5ce4a to d9bf224 Compare December 12, 2024 10:29
@leosvelperez leosvelperez marked this pull request as ready for review December 12, 2024 14:35
@leosvelperez leosvelperez requested a review from a team as a code owner December 12, 2024 14:35
@@ -138,6 +138,7 @@ export function createNodeFromPackageJson(
const hash = hashObject({
...json,
root: projectRoot,
bust: 1,
Copy link
Member Author

Choose a reason for hiding this comment

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

After this PR, with the same file content, a different result is obtained, so we need to bust the cache to ensure projects are processed.

Copy link
Member

Choose a reason for hiding this comment

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

There should be a comment to explain why this is here and when to update it.

@jaysoo jaysoo merged commit 48cd50a into master Dec 13, 2024
6 checks passed
@jaysoo jaysoo deleted the core/local-plugin-custom-resolution branch December 13, 2024 15:49
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants