Creates stubs for so called "in-direct" dependencies, this is useful if a package provides it's own typings out of the box and you don't want to suppress any errors from in-direct dependencies or even Required module not found
errors.
- Resolves packages of your mono-repo that have a dependency to
flow-typed
as well as a dependency to one of the whitelisted packages in your configuration. - Resolves the in-direct dependencies of the iterated dependency and creates stubs for them.
$ flow-mono create-stubs
Installs all stubs in the root of your mono-repo.
By default this command will not do anything since automatically stubbing all 2nd level dependencies is to error prone. Instead you need to whitelist the dependencies for which we should create stubs of it's in-direct dependencies. To do so just create a .flowmonorc
or a flow-mono
section in your repositories root package.json
, paste in the example and adjust as you like!
{
"create-stubs": {
"dependencies": ["immutable-js"]
}
}
This will resolve all mono-repo packages that have immutable-js
as a dependency, resolve immutable-js
own dependencies and create stubs for them.
This command also respects the flowTypedCommandExecRetries
configuration option, which might be useful if you encounter problems due to network errors while flow-typed is running, .e.g.
{
"flowTypedCommandExecRetries": 3
}