fix: commonjs exports and additional validation checks#15
Merged
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Pull request overview
This PR improves the package’s ESM/CJS publishing setup so consumers can reliably import (ESM) and require (CommonJS) the library, and adds CI checks to validate the published artifact.
Changes:
- Emit the CommonJS build as
dist/index.cjsand add anexportsmap inpackage.jsonwithimport/require/typesentries. - Add lightweight runtime export checks for both ESM (
import.mjs) and CJS (require.cjs) and run them after builds. - Strengthen CI by adding
typecheckand annpm pack --dry-runstep.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/exports/require.cjs | Adds a CommonJS require() smoke test to validate runtime export shape. |
| tests/exports/import.mjs | Adds an ESM import smoke test to validate default + named exports. |
| rollup.config.js | Renames CJS output to .cjs and marks @telemetrydeck/sdk as external. |
| package.json | Adds exports map, updates entrypoints, and wires export tests into the build lifecycle. |
| .github/workflows/test_and_release.yml | Adds typechecking and a packaging dry-run step in release workflow. |
| .github/workflows/pull_request.yml | Adds typechecking and a packaging dry-run step in PR workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version 1.2.2 🎉 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.
Pull request overview
Related to #10
This PR improves the package’s ESM/CJS publishing setup so consumers can reliably import (ESM) and require (CommonJS) the library, and adds CI checks to validate the published artifact.
Changes: