You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Be able to run npx create-nx-workspace my-workspace --preset=file:/path/to/dist
Motivation
To make it easier for testing. Currently have to publish to an NPM registry, which means also publishing all dependencies of the preset. The feedback loop is too high. It's also risky to publish a dev version with tag=latest and someone end up creating a workspace with that instead of the stable version. We usually change the .name in package.json before publishing the preset for testing.
Suggested Implementation
Check for preset.startsWith("file:") and use it instead of trying to install from the NPM registry. This prefix file: is what you use for installing local version of things, so it should be safe to just add it to the package.json as the version, with any name.
Alternate Implementations
Allow specifying the version or tag on the --preset option would make things easier: npx create-nx-workspace my-workspace --preset=mypkg@dev.
But not solve the problem entirely, only if it allows --preset=mypkg@file:/path/to/dist.
Considerations
It's worth noting that the --preset is currently passed to nx g, so perhaps the feature would have to be implemented on the generate cli command from NX.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏
Description
Be able to run
npx create-nx-workspace my-workspace --preset=file:/path/to/dist
Motivation
To make it easier for testing. Currently have to publish to an NPM registry, which means also publishing all dependencies of the preset. The feedback loop is too high. It's also risky to publish a dev version with
tag=latest
and someone end up creating a workspace with that instead of the stable version. We usually change the.name
in package.json before publishing the preset for testing.Suggested Implementation
Check for
preset.startsWith("file:")
and use it instead of trying to install from the NPM registry. This prefixfile:
is what you use for installing local version of things, so it should be safe to just add it to the package.json as the version, with any name.Alternate Implementations
Allow specifying the version or tag on the
--preset
option would make things easier:npx create-nx-workspace my-workspace --preset=mypkg@dev
.But not solve the problem entirely, only if it allows
--preset=mypkg@file:/path/to/dist
.Considerations
It's worth noting that the
--preset
is currently passed tonx g
, so perhaps the feature would have to be implemented on thegenerate
cli command from NX.The text was updated successfully, but these errors were encountered: