Skip to content

refactor: split dir for CLI and dev scripts #6782

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

Merged
merged 9 commits into from
Jun 20, 2024

Conversation

cometkim
Copy link
Member

I understand that we already have a managed artifact list for it. but isolating actual artifacts from scripts makes it much easier to maintain, and prevents accidents and dependencies between them.

I added a subpath imports as an easy resolution. That means it is only referenced in internally. Alternatively we can add it as exports entry to make it possible to referenced by outside of this package (e.g. require('rescript/bin_path') in https://github.com/rescript-lang/rescript-compiler/blob/f56f5c2/.github/workflows/get_artifact_dir_name.js#L4)

@cometkim
Copy link
Member Author

gentype again 😂

just opened #6783

@cometkim
Copy link
Member Author

cometkim commented May 26, 2024

98b5b5f would be better to support third-party tools that need to spawn ReScript binary themselves, but that also means we're adding an official API that we need to keep maintain its compatibility

@cometkim cometkim force-pushed the split-lib-scripts branch 3 times, most recently from 1f539cd to ee252bc Compare June 16, 2024 19:44
@cometkim cometkim requested a review from cknitt June 16, 2024 21:11
@cknitt
Copy link
Member

cknitt commented Jun 17, 2024

Thanks a lot!

Could you also remove scripts/.npmignore? It should not be needed anymore.

],
"exports": {
"./bin_path": "./cli/bin_path.js",
"./package.json": "./package.json"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used once in .github/workflows/prepare_package_upload.js.
I'd prefer to keep .github/workflows/prepare_package_upload.js as it was and just export bin_path here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no consumers exist, it's better to minimize the API exposure. I can convert this back to an import map.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cometkim cometkim force-pushed the split-lib-scripts branch from a072c46 to dd9bb74 Compare June 20, 2024 15:08
@cknitt cknitt merged commit fcdf7a9 into rescript-lang:master Jun 20, 2024
19 checks passed
@cometkim cometkim mentioned this pull request Jul 4, 2024
@cometkim cometkim deleted the split-lib-scripts branch September 11, 2024 00:44
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

Successfully merging this pull request may close these issues.

2 participants