feat(nx-python): add projectNameAndRootFormat
parameter to poetry project generator
#186
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.
This PR adds the
projectNameAndRootFormat
parameter to the@nxlv/python:poetry-project
project generator.Current Behavior
Currently, the project generator relies on the workspace layout (
appsDir
=apps
andlibsDir
=libs
) to generate the project name + project folder,However, On Nx v16.8.0 or higher, the generators are prompting the user to choose how Nx will calculate where the project should be located, by using the
--projectNameAndRootFormat
withas-provided
orderived
, which the default value for Nx isas-provided
.So, if the workspace is v16.8.0 or higher, and run the command
nx generate @nxlv/python:poetry-project myproject
to generate the project, the project is going to be created at the root of the repomyproject
.And if you provide
directory
option withsrc/myproject
, the name of the project will besrc-myproject
, which could cause some confusion.As happened here: #182
Expected Behavior
To make this plugin compatible with the previous versions and don't break the generator for those who still using Nx workspaces lower than v16.8.0, I've added the
projectNameAndRootFormat
parameter to the@nxlv/python:poetry-project
project generator as defaultderived
.For new Nx workspaces, the user should provide the
--projectNameAndRootFormat as-provided
and work in the Nx is recommending now or add the following configuration to thenx.json
:I've changed the
README.md
to instruct new users on how to deal with this change.Related Issue(s)
Reference #182