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.

How to apply flow type checking in lerna managed project?

See original GitHub issue

Since Lerna hoists common npm packages into root node_modules folder, running flow in each package cannot find these common npm packages in its own node_modules folder. It would fail with error message as below.

  5: import {createStore, applyMiddleware, combineReducers, compose} from 'redux';
                                                                          ^^^^^^^ redux. Required module not found

In above case, redux is hoisted to node_modules in root node_modules.

Is there any practice to workaround for flow type-checking?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:24
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
steelbraincommented, Jun 21, 2018

@sibelius Relying on third party solutions is not ideal. While I agree this particular issue is out of scope for Lerna itself, I still think it should be taken care of in flow instead of some third party wrapper or fork

8reactions
mochengcommented, Jul 3, 2017

@evocateur I checked @wtgtybhertgeghgtwtg 's repo and found the difference. In that repo, flow is run at root instead of each package. And, there is a flow-typed sub folder holding dependency package libdef.

Surely, we can leverage same strategy to make flow work in lerna. But, it is preferred to enable each sub-package could run flow independently without much setup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@mikojs/lerna-flow-typed-install - npm package | Snyk
Run `flow-typed install` in the lerna-managed project. Visit Snyk Advisor to see a full health score report for @mikojs/lerna-flow-typed-install, including ...
Read more >
How to deploy only changed packages in a Lerna Monorepo
Lerna offers a solution with a little “hack”: simply put package_2 in the devDependencies of package_1: Lerna will automatically detect packages ...
Read more >
Lerna You a Monorepo: The Nuts and Bolts of Building a CI ...
Make sure unit testing, screenshot testing, interaction testing, ... We decided to use a single Percy project, and run partial builds on ...
Read more >
1.1 Motivation · flow-mono-cli - Immowelt Group
As of now maintaining a mono-repository with flow is hard, there are a few issues within flow ... How to apply flow type...
Read more >
Introducing Flow-Typed - JavaScript. Flow
The process of managing libdefs for a Flow project should be ... or make use of new Flow features that better describe the...
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