Migrate to Lerna & publish libdefs to NPM
See original GitHub issueWhat we gain with this?
- Lerna setup allows us to publish library definitions to NPM.
- Using NPM allows to utilize npm dependencies for libdef dependencies.
- You can live without flow-typed CLI if you want to
What it requires?
- Lerna repo format (half-done)
- Lerna setup
- NPM namespace (done by @GAntoine : https://www.npmjs.com/org/flowtyped)
- Test runner needs to be migrated to monorepo
- CI setup to publish libdefs to NPM
- Publish libdefs to NPM
Open questions:
-
How the libdefs should be named? DefinitelyTyped uses
"@types/uuid": "^3.4.2",
way of naming. The problem with that is that Flow moves fast and we need to support multiple Flow versions for different libdefs. How to achieve that?- Perhaps the naming could be something like:
"@flowtyped/uuid-flow_v0.32.x-": "^3.4.2"
? - Support only latest Flow version
- Is this feasible? Most likely not since so many people lack multiple versions behind.
- Perhaps the naming could be something like:
-
Should CLI & test runner be split into own repo?
Some earlier plans: https://docs.google.com/document/d/1bR1k70q5xZfajlbbCJR_ZYC-UAU-aH1qUY54RxafNGY/edit
Some experimenting: https://github.com/flow-typed/flow-typed/compare/master...villesau:run-tests-against-experimental-folder
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:53 (46 by maintainers)
Top Results From Across the Web
@lerna/publish - npm
@lerna/publish. Publish packages in the current project. Install lerna for access to the lerna CLI. Usage.
Read more >How can an npm module provide its own Flow libdef out of the ...
You can type your package and publish them here: https://github.com/flowtype/flow-typed. Using the flow-typed tool, you can generate a full ...
Read more >FAQ | Lerna
Create a directory for your package in the packages folder, and run npm init ... If the lerna.json has not yet been updated,...
Read more >Moving from multiple repositories to a lerna-js mono-repo
At mitter.io, we have a couple of public-facing npm packages that we need to publish, and we recently moved to a mono-repo structure...
Read more >JavaScript Monorepos with Lerna - Semaphore CI
Do you have multiple JavaScript or Node projects in one repo? ... lerna publish from-git Found 2 packages to publish: - @tomfern/api ...
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
What about using tags to mark which flow version ranges a libdef version is compatible with? That way people that need to remain on an older version of flow can get the latest version of the libdef that’s still compatible with their flow version.
I’m not sure you need Lerna for this. It would add unnecessary boilerplate to each typedef folder, and probably not something Lerna is designed for anyway (dozens of packages, yes; 100s/1000s, no).
How about keeping the folder structure like it is now, with a script that programmatically adapts each folder to the relevant package(s) and publishes to npm. Afaik this is how TypeScript does it.