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

Changeset doesn't detect monorepo context in simple nx monorepo without workspaces #761

Closed
Tirke opened this issue Feb 23, 2022 · 1 comment

Comments

@Tirke
Copy link

Tirke commented Feb 23, 2022

Affected Packages

I think it's a limitation of https://www.npmjs.com/package/@manypkg/get-packages

Problem

In a monorepo using nx + pnpm without pnpm workspaces running changeset after changeset init to create the first changeset file, the tool only suggest the root package (which is btw private:true). When I add the pnpm-workspace.yaml file changeset is now currently suggesting my packages.

nx is a fully competent way to manage a monorepo, you don't need to add yarn or pnpm or whatever workspace solution on top of it. It's even sometimes a bit counterproductive because nx is a bit more inclined towards declaring all the dependencies in the root package.json.

Proposed solution

It would be good if changeset could detect that we are on a nx monorepo only based on the nx file (or any other method) without having to add a workspace solution on top of it.

@brianespinosa
Copy link
Contributor

@Andarist I know we are using the referenced package above instead of rolling our own. There is an open feature request to add NX support to @manypkg/get-packages.

Until that package gets updated (assuming it does get updated), I would be willing to go in and update our local get-workspaces package to check for NX configs and if so, grab them, otherwise use get-packages internally. This way we could support NX now.

Technically the current workaround is to declare NX packages in a "workspaces" key in the package.json even though no dependencies are getting installed there. This then symlinks these packages into the node_modules directory... which for some using NX is undesirable.

Happy to take a stab at adding this functionality if you're open to accepting a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants