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

Allow starting an NX workspace using a local folder as preset #14056

Closed
1 task done
ianldgs opened this issue Dec 29, 2022 · 4 comments
Closed
1 task done

Allow starting an NX workspace using a local folder as preset #14056

ianldgs opened this issue Dec 29, 2022 · 4 comments

Comments

@ianldgs
Copy link
Contributor

ianldgs commented Dec 29, 2022

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 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.

@AgentEnder AgentEnder added the scope: misc Misc issues label Dec 29, 2022
@ianldgs
Copy link
Contributor Author

ianldgs commented Dec 30, 2022

@AgentEnder do you like the idea? Which implementation alternative do you think it's best?

@ianldgs
Copy link
Contributor Author

ianldgs commented Apr 21, 2023

Not entirely sure, have to test, but seems like #16303 solves this.

Copy link

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! 🙏

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

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

No branches or pull requests

2 participants