TypeScript monorepo with Rush.js, with at least one package, leveraging Jest, Plop, Just, Just Scripts.
Closed this issue · 7 comments
In documentation, about stacks-monorepo, it says
Just uses the Rush library to manage monorepos.
When I follow the steps, it doesn't.
Intention
I am willing to make a PR to support this use-case (without breaking the use of Lerna or Beachball). This is to know if there are plans to support such use-case.
Reproduction repo
Use-Case: Have a TypeScript monorepo (ideally with Rush, because it is now my new favourite over Lerna), with at least one item, process to run tests, plop files, and run tests.
See: https://github.com/renoirb/experiments-201908-just-plop-typescript-monorepo-rushjs
Steps:
npm init just
cd monorepo-created
npm run gen
# ...
But I've had to change things a bit after that so I could get to to work. (not visible in Git history)
That's right, I hadn't updated the docs. We've switched to lerna. Kind of strapped for time at the moment fixing bugs in another repo. Feel free to submit a PR if you find these inconsistencies.
Is the switch to Lerna and Yarn workspace monorepo a choice based on some technical superiority. Or it went in that tangent and you guys plan to support it back?
The code looks like there can be more than only one possible monorepo stack.
If that's the case, I can make a PR to add a scaffold to plop a rush monorepo. I guess the difference would be to make a "npx just-task rush-monorepo" instead of creating a top level package.json file. Then docs would be easy to adjust to mention both possibilities.
I'm saying this because I have been using Lerna for more than a year and I've tried RushJs for a werk. Rush was more helpful for telling build errors and package dependencies. Whoch is very useful for a team. Not all members in a team are NPM packaging ninjas after all..
Back to my question. If there are plans to support back, but just need to be done again because it is in a backlog, tell me. I might help.
Rush is actually technically superior in that it provides a lot out of the box. Lerna is missing the following:
- automated semver via change files (Lerna uses commit messages which is meh)
- incremental builds
That said, the change file automated versioning has been filled by another piece of software called beachball
. Incremental builds is another matter - just-task has support for this and could be used to help speed things up.
The issue I found with Rush centers around the fact that it doesn't actually have as big of install base amongst the most popular monorepos out there. We actually have found both to be good solutions, but the purpose of the just-stack-monorepo
is to get new users up and running with very familiar tools. We could use a just-stack-rush-monorepo
as well to make sure those who want to use Rush has a good starting point as well.
Thanks for the feedback, I could work some more on a Just+Rush integration, it's here https://github.com/renoirb/experiments-201908-rush-typescript-just-bili-monorepo
I could eventually create a just-stack-rush-monorepo
, maybe utilities to bind just-scripts to be run from rush|rushx CLI.
At the moment:
- just-scripts work (TODO: I gotta find a way to make a HighOrder factory though, just-scripts's lib() factory isn't matching our stack)
- I can run just-scripts from rush|rushx, but with specific package.json scripts, it feels tedious, see rushx see comment here
- I can lint with ESLint
'plugin:@typescript-eslint/recommended'
for both TypeScript and JavaScript
Next steps:
- Instead of bundling only with TypeScript's
tsc
, in case we want to pass through Rollup and Babel to add@babel/runtime-core3
leverage egoist/bili
Let's see how we can cherry-pick my discoveries and add just-stack-?
, if you're interested in what I'm working on to be part of just__
Oh yeah, the stacks so far are for a typescript (the npm package) centric repo. I like the idea of offering both babel and rollup support for just-scripts as well. Though I kind of wonder if there's a point where we should build out an ecosystem vs all inside just-scripts.
Hi, I could get something working that allow me to manage all my ECMAScript 2019+ and TypeScript, sometimes Vue.js modules. I'm leveraging just, and egoist/bili (which allows managing code with Rollup). It's not perfect, i'd like to have simpler files with even less boilerplate, but what's there has the merit to declare things explicitly . But it works well. repo link
Issues seem to have gone stale.