gajus / gajus/flow-runtime

Types not resolving to `.js.flow` files

Open
#27 5 comments 1 reaction 0 assignees View on GitHub
:dollar: Funded on Issuehunt enhancement
Dominant language
JavaScript
Stars
797
Forks
49
PR merge metrics
No merged PRs in 30d

Description

[Issuehunt badges](https://oss.issuehunt.io/r/gajus/flow-runtime/issues/27)

I'm using an npm package that transpiles its files then uses `flow-copy-source` to copy its flow annotated files to the package's `lib` folder. The result is there's an `index.js` file and an `index.js.flow` file. `index.js.flow` contains custom types exported by the application, while `index.js` has these stripped.

At compile time, the `flow-bin` binary resolves to `index.js.flow` instead of `index.js`, allowing the flow compiler to pick out the custom types. However, the flow-runtime babel plugin doesn't resolve `index.js.flow`first, causing flow-runtime to throw the error `Error: Could not reference the given type.`

If you could point me in the right direction in the code base I might be able to help submit a PR. If you have another suggestion on how I could fix this though I'd appreciate it!

---

IssueHunt Summary

### Backers (Total: $20.00)

- [issuehunt issuehunt](https://oss.issuehunt.io/u/issuehunt) ($20.00)

### Submitted pull Requests
- [#288 Discover .js.flow definition files](https://oss.issuehunt.io/r/gajus/flow-runtime/pull/288)
- [#297 fix(flow-config-parser): support module.name_mapper.extension remap](https://oss.issuehunt.io/r/gajus/flow-runtime/pull/297)
- [#307 Fix package .js.flow type discovery](https://oss.issuehunt.io/r/gajus/flow-runtime/pull/307)
---

#### [Become a backer now!](https://oss.issuehunt.io/r/gajus/flow-runtime/issues/27)
#### [Or submit a pull request to get the deposits!](https://oss.issuehunt.io/r/gajus/flow-runtime/issues/27)
### Tips

- Checkout the [Issuehunt explorer](https://oss.issuehunt.io/r/gajus/flow-runtime/) to discover more funded issues.
- Need some help from other developers? [Add your repositories](https://oss.issuehunt.io/r/new) on IssueHunt to raise funds.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.