Conversation
There was a problem hiding this comment.
Pull request overview
Modernizes the project’s tooling and release pipeline by migrating to a TypeScript-based build, adopting pnpm + Biome + Vitest, and replacing Travis with GitHub Actions + Changesets.
Changes:
- Replace the old Babel/ESM+CJS setup with a TypeScript
dist/build and ESM package exports. - Migrate tests from Ava to Vitest and add coverage configuration.
- Introduce Biome, Changesets, pnpm lockfile, Husky hooks, and GitHub Actions CI/release workflows.
Reviewed changes
Copilot reviewed 18 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Switch to pnpm tooling, ESM exports, TS build scripts, Biome/Vitest/Changesets/Husky integration. |
pnpm-lock.yaml |
Adds the pnpm lockfile for the new dependency graph. |
src/index.ts |
TypeScript implementation of the merge-patch logic and exports. |
test/index.test.ts |
Vitest-based test suite replacing Ava tests. |
vitest.config.ts |
Vitest coverage configuration (v8 provider). |
tsconfig.json / tsconfig.build.json |
TypeScript compiler configuration for dev + build. |
biome.json |
Biome lint/format configuration. |
.github/workflows/ci.yml |
CI workflow running checks on Node matrix. |
.github/workflows/release.yml |
Changesets-driven release workflow on master. |
.husky/pre-commit / .husky/commit-msg |
Git hooks for staged checks and commitlint. |
README.md |
Updates docs for ESM usage, pnpm, and new distribution path. |
.travis.yml, .babelrc, .eslintrc.yaml, .eslintignore, test/index.js, esm/index.js |
Removes legacy CI, Babel/ESLint, and old test/build artifacts. |
.gitignore |
Updates ignored build artifacts to dist/. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "type": "module", | ||
| "main": "./dist/index.mjs", | ||
| "module": "./dist/index.mjs", | ||
| "types": "./dist/index.d.ts", | ||
| "exports": { | ||
| ".": { | ||
| "types": "./dist/index.d.ts", | ||
| "import": "./dist/index.mjs" | ||
| } | ||
| }, |
There was a problem hiding this comment.
Switching to "type": "module" and an exports map with only an import condition makes the package ESM-only; require('tiny-merge-patch') will break for existing CommonJS consumers. If CommonJS support is still desired, add a CJS build and a require export condition; otherwise this should be treated as a breaking change (e.g., major version bump + release notes).
| "precommit": "npm run git-hook", | ||
| "commitmsg": "commitlint -e $GIT_PARAMS" | ||
| "clean": "rimraf dist coverage", | ||
| "build": "pnpm run clean && tsc -p tsconfig.build.json && mv dist/index.js dist/index.mjs", |
There was a problem hiding this comment.
The build script uses mv, which is not cross-platform and will fail on Windows shells. Consider either (a) publishing dist/index.js directly and pointing main/exports at it, or (b) replacing mv with a Node-based rename step (or a cross-platform helper) so pnpm run build works everywhere.
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [20, 22] |
There was a problem hiding this comment.
The toolchain in the lockfile (e.g., Vite) declares an engine requirement of node: ^20.19.0 || >=22.12.0. Using node-version: 20 can resolve to an earlier 20.x (depending on what's current), which may fail engine checks. Pin the matrix to 20.19.0 (or 20.19) or drop Node 20 from CI.
| node-version: [20, 22] | |
| node-version: [20.19.0, 22] |
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 |
There was a problem hiding this comment.
The lockfile engine constraints for the toolchain (e.g., Vite) require node: ^20.19.0 || >=22.12.0. To avoid future breakage when node-version: 22 resolves to an older 22.x, consider pinning to 22.12.0 (or 22.12) explicitly.
| node-version: 22 | |
| node-version: 22.12.0 |
No description provided.