fix: correct packaging exports so .cjs/.d.cts resolve#2
Merged
Conversation
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
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))
|
🎉 This PR is included in version 1.0.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes broken package resolution and adds CI/repo hygiene.
Critical packaging fix
"type": "module"topackage.json. Without it,tsupdid not emit.cjs/.d.ctsartifacts matching theexportsmap, sorequire()consumers of@wyre-technology/node-unitrendsgot unresolved-export failures. The dual ESM/CJS build now producesdist/index.js,index.cjs,index.d.ts, andindex.d.ctsas theexportsmap declares.Other changes
node22;@types/nodebumped to^22;engines.nodeset to>=22..github/workflows/ci.yml) running lint, typecheck, build, and tests on Node 22.CODE_OF_CONDUCT.md(Contributor Covenant).CHANGELOG.md.npm audit fixapplied topackage-lock.json.Verification
npm run build— emits all fourdist/artifactsnpm test— 42 tests passnpm run lint— cleanNote: this PR adds the CI workflow, so checks run for the first time here.