gts icon indicating copy to clipboard operation
gts copied to clipboard

[feature] support npm workspaces

Open AndreasAugustin opened this issue 3 years ago • 0 comments

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

AndreasAugustin avatar Aug 19 '22 11:08 AndreasAugustin