Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with monorepo support regarding gentype and commonjs build #146

Open
TomiS opened this issue Feb 12, 2025 · 4 comments
Open

Issues with monorepo support regarding gentype and commonjs build #146

TomiS opened this issue Feb 12, 2025 · 4 comments

Comments

@TomiS
Copy link
Contributor

TomiS commented Feb 12, 2025

Maybe I'm doing something wrong here, but it appears neither commonjs files (with in-source: false) nor gentyped files are being generated. At least not in the monorepo enviroment.

Here's a fairly minimal monorepo to demonstrate the issue
https://github.com/TomiS/rewatch-test

@Bushuo
Copy link
Contributor

Bushuo commented Feb 12, 2025

Gentype will work with the next 11.x release of the rescript compiler.
This prerelease also has the changes included https://github.com/rescript-lang/rescript/releases/tag/v11.2.0-beta.1
I am using a local build and had no issues so far.

@TomiS
Copy link
Contributor Author

TomiS commented Feb 13, 2025

Thanks. Unfortunately it seems updating to latest ReScript version changes nothing in my test repository. Both issues remain. I updated the test repo to confirm this.

@Bushuo
Copy link
Contributor

Bushuo commented Feb 13, 2025

I tried with your repo, if you add the "gentypeconfig" to the root rescript.json it works.
Maybe supporting it on a per project basis makes sense.

@TomiS
Copy link
Contributor Author

TomiS commented Feb 14, 2025

Ah, of course I did not test that combination of configs this time. Thanks, now it indeed works. It required running clear once though. But this solves the gentype issue.

However building to multiple targets is another long-term issue that still exists. I wonder if it is even supposed to work, and what are the implications if it will not. E.g. is the support for commonjs target still considered as necessary? Personally I use it to run some part of the code to generate pdf files on node. But maybe node (or some other runtime) can nowadays properly work with esm target too, I haven't recently checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants