feat: restructure package.json for improved module support and add CI workflow#87
feat: restructure package.json for improved module support and add CI workflow#87Kolezhniuk wants to merge 7 commits into
Conversation
Kolezhniuk
commented
Apr 2, 2026
- Updated "exports" field in package.json to support both Node and browser environments.
- Added new scripts for linting, cleaning, and building for both Node and browser.
- Removed Rollup configuration file as Vite is now used for building.
- Introduced a GitHub Actions CI workflow for automated testing.
- Added browser and Node test files using Vitest.
- Created a new ESLint configuration file for consistent code style.
- Implemented a new browser build output for the binfileutils library.
… workflow - Updated "exports" field in package.json to support both Node and browser environments. - Added new scripts for linting, cleaning, and building for both Node and browser. - Removed Rollup configuration file as Vite is now used for building. - Introduced a GitHub Actions CI workflow for automated testing. - Added browser and Node test files using Vitest. - Created a new ESLint configuration file for consistent code style. - Implemented a new browser build output for the binfileutils library.
…ate package.json formatting
There was a problem hiding this comment.
Pull request overview
This PR modernizes @iden3/binfileutils packaging and automation by switching to a Vite-based build, adding conditional exports for Node vs browser consumption, and introducing Vitest + GitHub Actions CI to validate both Node and browser-compatible behavior.
Changes:
- Reworked
package.jsonexports/scripts to publish Node (CJS) and browser (ESM) entrypoints and added lint/clean/test/build scripts. - Added Vite config for dual Node/browser builds and a multi-project Vitest setup (Node + Playwright browser tests).
- Added CI workflow, ESLint flat config, and new Node/browser round-trip tests; removed legacy Rollup + ESLint config.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
vite.config.js |
Adds Vite library build config (Node + browser) and Vitest multi-project configuration. |
test/node.js |
Adds a Node filesystem-based round-trip test. |
test/browser.js |
Adds a browser-compatible in-memory round-trip test (Vitest browser + Playwright). |
rollup.cjs.config.js |
Removes legacy Rollup config in favor of Vite. |
package.json |
Updates conditional exports, scripts, and devDependencies; switches deps to GitHub refs. |
package-lock.json |
Updates lockfile to npm lockfileVersion 3 and new dependency graph. |
eslint.config.js |
Introduces ESLint flat config and build output ignore. |
build/main.cjs |
Updates Node build output artifact. |
build/browser/browser.esm.js |
Adds browser build output artifact. |
.github/workflows/ci.yml |
Adds CI workflow to install deps, install Playwright, and run tests. |
.eslintrc.cjs |
Removes legacy ESLint config in favor of flat config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…p, and update Vite config - Removed console.time and console.timeEnd calls from readSection in binfileutils.js for cleaner code. - Wrapped file write and read operations in a try-finally block in the node.js test to ensure temporary files are deleted after tests. - Updated Vite configuration to exclude browser.js from node environment tests.
…update wasmcurves git reference
|
For comparison: I re-applied this migration on top of our optimization stack rather than replaying it, so the MSM/CIOS/memory work is preserved and a couple of bugs are fixed. See #89 (based on our optimization branch, so its diff is the migration alone). Migration-vs-migration diff: feat/esm-migration...feature/esm-tooling Deviations are called out in #89's description. |