Skip to content

fix: correct packaging exports so .cjs/.d.cts resolve#2

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

fix: correct packaging exports so .cjs/.d.cts resolve#2
asachs01 merged 2 commits into
mainfrom
fix/packaging-exports

Conversation

@asachs01
Copy link
Copy Markdown
Member

Summary

Fixes broken package resolution and adds CI/repo hygiene.

Critical packaging fix

  • Adds "type": "module" to package.json. Without it, tsup did not emit .cjs/.d.cts artifacts matching the exports map, so require() consumers of @wyre-technology/node-unitrends got unresolved-export failures. The dual ESM/CJS build now produces dist/index.js, index.cjs, index.d.ts, and index.d.cts as the exports map declares.

Other changes

  • Build target raised to node22; @types/node bumped to ^22; engines.node set to >=22.
  • Adds PR CI workflow (.github/workflows/ci.yml) running lint, typecheck, build, and tests on Node 22.
  • Adds CODE_OF_CONDUCT.md (Contributor Covenant).
  • Syncs CHANGELOG.md.
  • npm audit fix applied to package-lock.json.

Verification

  • npm run build — emits all four dist/ artifacts
  • npm test — 42 tests pass
  • npm run lint — clean

Note: this PR adds the CI workflow, so checks run for the first time here.

asachs01 added 2 commits May 20, 2026 14:19
package.json main/exports pointed to ./dist/index.cjs and
./dist/index.d.cts, but without "type": "module" tsup emitted
index.js (CJS) and index.mjs (ESM), so require() of the published
package failed. Adding "type": "module" makes tsup emit index.js
(ESM), index.cjs (CJS), index.d.ts and index.d.cts, matching the
existing exports map. Mirrors the correct node-superops config.
- Add .github/workflows/ci.yml (lint/typecheck/build/test on PR + push, Node 22)
- Add CODE_OF_CONDUCT.md (Contributor Covenant)
- tsup target -> node22; @types/node -> ^22
- CHANGELOG: add [0.1.0] section for initial release, keep [Unreleased] for recent fixes
@asachs01 asachs01 merged commit c8adae9 into main May 20, 2026
1 check passed
github-actions Bot pushed a commit that referenced this pull request May 20, 2026
## [1.0.1](v1.0.0...v1.0.1) (2026-05-20)

### Bug Fixes

* correct packaging exports so .cjs/.d.cts resolve ([#2](#2)) ([c8adae9](c8adae9))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant