https://github.com/zth/rescript-generated-js-diff
https://github.com/zth/rescript-generated-js-diff
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zth/rescript-generated-js-diff
- Owner: zth
- Created: 2025-08-11T19:50:14.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-08-12T18:06:00.000Z (7 months ago)
- Last Synced: 2025-08-27T18:39:07.668Z (6 months ago)
- Language: ReScript
- Size: 129 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## rescript-generated-js-diff
Small CLI to zip the generated JS files of a ReScript project. Useful for sharing or inspecting diffs of compiler output.
### How it works
- **Config discovery**: reads `rescript.json` or `bsconfig.json` to find `sources`.
- **File selection**: collects files with the configured `suffix` (default: `.bs.js`; respects `suffix` if set, e.g. `.res.mjs`).
- **Output**: creates a zip archive in the target project directory.
### Install
```sh
npm install
```
### Run
```sh
node src/RescriptGeneratedJsDiff.res.mjs [out-file]
```
Examples:
```sh
# Zip generated JS in the current project (writes ./diff.zip)
node src/RescriptGeneratedJsDiff.res.mjs .
# Custom output path
node src/RescriptGeneratedJsDiff.res.mjs . ./out/generated.zip
```
### Notes
- Exits with code 1 if no files with the target suffix are found.
- To rebuild `.res.mjs` from source, use: `npm run res:build` (and `npm run res:dev` to watch).