yarn workspaces extension
monorepo management tool
Install
npm i -g wksp
then
wksp <cmd>
shorthand for: yarn workspace <cmd>
wksp will detect the package name automatically (if run inside the project folder)
if your current directory is the workspace root you can specify the name
wksp -n my-app <cmd>
shorthand for: yarn workspace <name> <cmd>
Variadic arguments are supported, (any arguments for the command)
wksp add react react-dom react-router
# cli cmd args...
Options that are specific to yarn, require an --
--options
wksp add tailwindcss postcss autoprefixer -- --dev
# cli cmd args... -- yarn options
this applies when running scripts
wksp start -- --port 3002 --watch
# cli cmd -- script options
-D
or --dev
save as dev dependency
-E
or --exact
save exact dependency
-P
or --peer
save as peer dependency
some terminals doesn't allow passing options --
you can use compatibility options directly:
wksp add -D typescript
cwd: .../monorepo/
projects/
/client/
/server/
/ui-lib/
wksp start -n client
--name
cwd: .../monorepo/projects/server
wksp start
wksp will detect the package name related with this folder and run the start script defined in package.json
Have a great idea how we can extend yarn workspaces features ? suggest here