Guidance on current usage with Lerna and Yarn Workspaces?
See original GitHub issueI am currently setting up a fresh monorepo structure using Lerna and TSDX to build out a component library.
I have read and followed the various links related to #122 but wanted to check if there is anything to consider when using TSDX inside a lerna monorepo before some kind of official monorepo template (might) land.
My current thinking is to:
- Setup the monorepo via lerna as normal
- Setup the yarn workspaces integration with lerna
- Add
tsdx
as adevDependency
at the root level - Run
npx tsdx create mylib-package-a
for each package inside thepackages/*
folder - Add npm scripts at the root level that use
lerna run [flags]
to eitherstart
,watch
,test
orbuild
each individual package folder as one command.
Is that roughly the right approach for using TSDX inside a monorepo structure?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:8 (2 by maintainers)
Top Results From Across the Web
A Beginner's Guide to Lerna with Yarn Workspaces | by jsilvax
It allows us to easily release dependencies on NPM with a single command, automatically updates the package.
Read more >Monorepo Javascript Projects with Yarn Workspaces and Lerna
Yarn workspaces are used to optimize dependency management. When we use yarn workspaces, all project dependencies are installed in one go. Tools ...
Read more >Why Lerna and Yarn Workspaces is a Perfect Match for ...
For this approach, you do not require lerna. yarn workspaces come with built-in Mono-Repo capabilities. To use yarn workspaces you need yarn ...
Read more >Monorepos: Yarn Workspaces and Lerna for beginners!
Let's discover how to handle monorepos with multiple packages using Yarn Workspaces and LernaJS. We're going to discuss Yarn Workspaces ...
Read more >Getting Started | Lerna
When running lerna init , Lerna configures the workspace to use NPM/YARN/PNPM workspaces, the built-in solution for local referencing of packages. In this ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think there’s room for a separate init config for
tsdx
that configures alerna
-friendly version of atsdx
project.lerna
and monorepos are common enough that a feature like this will help a lot with adoption of this lib.I’ve been following roughly this approach, but needing to remember to modify a few of the instructions given that I’m using
tsdx
rather thantsc
directly. And doing this muchtsconfig
wrangling sort of defaults the purpose of usingtsdx
.Hey,
To me, the best is to build once, and then run watch in --parallel with the --noClean option.
Problem is that currently, the watcher is only looking for changes in ./src, so your symlinks will not be watched (+ they might be hoisted).
https://github.com/jaredpalmer/tsdx/blob/b21d7af1ae87f3f1f1324e7ad07671dde630fed0/src/index.ts#L328
Will see if I can send a PR for that, but was not very successful with patch-package 😕