feat(misc): non conflicting init/add flow#22791
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2cfe216. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
FrozenPandaz
force-pushed
the
init-lite
branch
6 times, most recently
from
April 12, 2024 14:07
a41e685 to
bb8c8a1
Compare
FrozenPandaz
force-pushed
the
init-lite
branch
2 times, most recently
from
April 12, 2024 19:00
714cbaa to
1bcacf3
Compare
FrozenPandaz
force-pushed
the
init-lite
branch
2 times, most recently
from
April 12, 2024 20:30
3a3e95c to
f5d937b
Compare
FrozenPandaz
marked this pull request as ready for review
April 14, 2024 06:31
AgentEnder
approved these changes
Apr 15, 2024
AgentEnder
left a comment
Member
There was a problem hiding this comment.
Looks good, one minor nitpick that may be worth changing
Member
There was a problem hiding this comment.
Suggested change
| output.log({ title: '🔨 Configuring plugins' }); | |
| if (plugins.length) | |
| output.log({ title: '🔨 Configuring plugins' }); |
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
When initializing a plugin, the same target name is always chosen. Sometimes, this may conflict with existing targets. For example, if you already have a
buildnpm script, as a build target, then thebuildtarget coming in from theviteplugin overrides it. This may cause unexpected behavior resulting from adding the plugin. Already in the current version, we combat this by not includingnpmscripts as targets. However, for targets likebuild, thenpmscript is likely what people are already considering their defactobuildscript.Expected Behavior
Plugins are initialized with a set of possible options. The option which does not conflict with the current graph is chosen. If none of the provided options does not conflict, an error is thrown. The plugins prefer the shorter more general target name such as
buildhowever, will shift to target names such asvite:buildfor thevite plugin.Because plugins now ensure that they don't conflict with the existing graph, we can now add
npmscripts by default. As such, thenx initflow has also been updated to add thosenpmscripts. This results in annx initflow which is more incremental. You can now start atpackage-basedwith no plugins and add plugins afterwards with no worry of plugins altering the existing project graph. In addition, plugins are not selected by default in the init flow as they are easier to add later.https://nx-dev-git-fork-frozenpandaz-init-lite-nrwl.vercel.app/recipes/adopting-nx/adding-to-monorepo
Related Issue(s)
Fixes #