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

[feature] support npm workspaces #718

Closed
AndreasAugustin opened this issue Aug 19, 2022 · 1 comment
Closed

[feature] support npm workspaces #718

AndreasAugustin opened this issue Aug 19, 2022 · 1 comment

Comments

@AndreasAugustin
Copy link

AndreasAugustin commented Aug 19, 2022

It would be super nice if npm workspaces would be supported with gts.

Currently there are some issues (similar to #490 ) when I want to use gts within my npm workspace projects

When I init gts in one of the repos npm -ws exec npx -- gts init it is creating all needed files and the entries in the package.json in my repository. But the referenced files (e.q. in tsconfig.json or .eslintrc.json ) are not present in the workspace node_modules/ directory because those are installed in root dir (similar to --hoist option with lerna or with yarn workspaces).
It is easy to adjust the files afterwards but you get some error messages because of the post scripts. Also it is against the no configuration stated in the gts docs.

In most cases it is not possible to just use gts in root directory because in some cases different settings for tsconfig and eslint are needed within the workspace directories (e.q. UI and backend implementation in same repo).

Maybe a nice solution would be the following:

  • running npx gts init in root directory checks the package.json for workspace directory and asks in the cli for which workspaces the init should take place. For those the referenced directories (e.q. tsconfig.json, eslintrc.json,...) are adjusted to point to the root directory node_modules/ installations.

Just a base idea to start a discussion.

Remark
Just have seen the PR #654 . That PR should be related to this issue

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