Skip to content

feat: restructure package.json for improved module support and add CI workflow#87

Open
Kolezhniuk wants to merge 7 commits into
feature/sharedArrayBuffersfrom
feat/esm-migration
Open

feat: restructure package.json for improved module support and add CI workflow#87
Kolezhniuk wants to merge 7 commits into
feature/sharedArrayBuffersfrom
feat/esm-migration

Conversation

@Kolezhniuk

Copy link
Copy Markdown
Contributor
  • 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.json exports/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.

Comment thread vite.config.js
Comment thread build/main.cjs Outdated
Comment thread build/browser/browser.esm.js
Comment thread test/node.js
Comment thread package.json Outdated
Comment thread package.json
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Kolezhniuk Kolezhniuk marked this pull request as ready for review June 4, 2026 08:56
d5k9 added 2 commits June 4, 2026 16:12
…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.
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.

4 participants