Repository navigation
v1.0.0
Release v1.0.0
Highlights
deep-obj-diff v1.0.0 is a major release that restructures the project into a Turborepo-managed monorepo with two independently publishable packages: a core diffing library and a standalone CLI.
What's New
Monorepo Architecture
The project has been split into two packages under packages/:
| Package | npm Name | Description |
|---|---|---|
packages/core |
deep-obj-diff |
Zero-dependency deep object diffing library |
packages/cli |
deep-obj-diff-cli |
Standalone CLI for comparing JSON files/values |
Dual CJS / ESM Support
The core library now ships both CommonJS and ES Module builds, so it works seamlessly regardless of how you consume it:
// ESM
import { diff } from 'deep-obj-diff';
// CJS
const { diff } = require('deep-obj-diff');Distribution layout:
dist/
cjs/ → CommonJS build
esm/ → ES Module build
types/ → TypeScript declarations
Package exports use the conditional exports specification, so bundlers and Node.js automatically resolve the correct entry point.
Zero-Dependency CLI Bundle
The CLI (deep-obj-diff-cli) is bundled with esbuild into a single self-contained file — it has zero runtime dependencies. All dependencies including commander and deep-obj-diff itself are inlined at build time.
npx deep-obj-diff-cli file1.json file2.jsonTurborepo Integration
The monorepo is now orchestrated by Turborepo for:
- Parallel task execution — build, test, and lint run concurrently across packages
- Intelligent caching — unchanged packages skip redundant work
- Dependency-aware ordering — CLI build automatically waits for the core build
Root-level scripts:
npm run build # Build all packages
npm run test # Test all packages
npm run lint # Lint all packages
npm run clean # Clean all dist/ foldersUpdated CI/CD
GitHub Actions have been updated for the monorepo:
- CI — Validates that both CJS, ESM, types, and CLI dist artifacts are produced correctly
- Publish — Publishes
deep-obj-diffanddeep-obj-diff-clito npm separately
Breaking Changes
- Package structure — The source tree moved from root-level
src/andtests/intopackages/core/andpackages/cli/. If you were importing from internal file paths rather than the package entry point, those paths have changed. - CLI package name — The CLI is now a separate package (
deep-obj-diff-cli). If you previously used the CLI fromdeep-obj-diff, install the new package instead.
Migration Guide
Library Users
No changes needed. npm install deep-obj-diff still works exactly the same. Both import and require are now supported out of the box.
CLI Users
# Before
npm install -g deep-obj-diff
# After
npm install -g deep-obj-diff-cliThe CLI command name remains deep-obj-diff.
Contributors
The repo is now a monorepo. After cloning:
npm install # Installs all workspaces + Turborepo
npm run build # Builds everything
npm run test # Runs all testsIndividual packages can be targeted:
npm run build -w packages/core
npm run test -w packages/cliTechnical Details
| Core | CLI | |
|---|---|---|
| Build | tsc (dual CJS + ESM) |
esbuild (single bundled file) |
| Runtime deps | 0 | 0 |
| Tests | 180 | 19 |
| Node.js | ≥ 18 | ≥ 18 |
| TypeScript | 5.9 | 5.9 |
Full Changelog
- Restructured project into npm workspaces monorepo (
packages/core,packages/cli) - Added dual CJS/ESM build output with conditional
exportsinpackage.json - Added explicit
.jsextensions to all relative imports for ESM compatibility - Extracted CLI into standalone zero-dependency package bundled with esbuild
- Replaced runtime
package.jsonversion reading with build-time__CLI_VERSION__define - Added Turborepo for monorepo task orchestration and caching
- Created dedicated
build.jsscripts for both core and CLI packages - Updated GitHub Actions CI and publish workflows for monorepo structure
- Simplified composite action to single
turbo run lint teststep - Added
jest.config.jsmoduleNameMapperfor.jsextension resolution in tests