question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate to Lerna & publish libdefs to NPM

See original GitHub issue

What 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?

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.
  • 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:open
  • Created 5 years ago
  • Reactions:13
  • Comments:53 (46 by maintainers)

github_iconTop GitHub Comments

4reactions
zeorincommented, Jan 16, 2019

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.

3reactions
jamesisaaccommented, Jan 16, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found