Skip to content

fix: correct packaging exports so CJS/ESM consumers resolve#3

Merged
asachs01 merged 2 commits into
mainfrom
fix/packaging-exports
May 20, 2026
Merged

fix: correct packaging exports so CJS/ESM consumers resolve#3
asachs01 merged 2 commits into
mainfrom
fix/packaging-exports

Conversation

@asachs01
Copy link
Copy Markdown
Member

Summary

Critical packaging fix plus tooling cleanup.

Critical: packaging exports

  • Adds "type": "module" to package.json. Without it, tsup emits .cjs/.d.cts artifacts but the exports map could not correctly resolve them — CJS consumers (and require() of the package) were broken. With type: module the build emits index.js/index.cjs/index.d.ts/index.d.cts matching the exports map exactly.

Other changes

  • Adds .eslintrc.json (TypeScript ESLint config) so npm run lint works.
  • CHANGELOG cleanup: removes auto-generated semantic-release block, restores Keep a Changelog format, corrects @asachs01@wyre-technology scope, adds compare links.
  • Raises Node baseline to >=22engines, tsup target node22, @types/node ^22, CI matrix to Node 22 only.
  • npm audit fix applied to package-lock.json.

Verification

  • npm run build — green; dist/ contains index.js, index.cjs, index.d.ts, index.d.cts.
  • npm test — 79 tests passing.
  • npm run lint — 0 errors (4 pre-existing non-null-assertion warnings in test fixtures).

asachs01 and others added 2 commits May 20, 2026 14:19
… map

package.json main/exports point to ./dist/index.cjs and ./dist/index.d.cts,
but without "type": "module" tsup emitted index.js (CJS) and index.mjs (ESM),
breaking require() of the published package. Adding "type": "module" makes
tsup emit index.js (ESM), index.cjs (CJS), index.d.ts and index.d.cts, which
match the existing exports map.

Also add .eslintrc.json (replicated from sibling node-superops) so
`npm run lint` resolves a config instead of erroring.
- npm audit fix (non-breaking lockfile updates)
- Rewrite CHANGELOG.md in consistent Keep a Changelog format,
  correct package scope to @wyre-technology/node-ninjaone
- Raise Node baseline to >=22: engines, tsup target node22,
  @types/node ^22, CI matrix Node 22

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@asachs01 asachs01 force-pushed the fix/packaging-exports branch from f57b88d to 29fd913 Compare May 20, 2026 18:20
@asachs01 asachs01 merged commit 1f23f92 into main May 20, 2026
2 checks passed
@asachs01 asachs01 deleted the fix/packaging-exports branch May 20, 2026 18:21
github-actions Bot pushed a commit that referenced this pull request May 20, 2026
## [1.1.1](v1.1.0...v1.1.1) (2026-05-20)

### Bug Fixes

* correct packaging exports so CJS/ESM consumers resolve ([#3](#3)) ([1f23f92](1f23f92))
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.

1 participant