Skip to content

fix: commonjs exports and additional validation checks#15

Merged
salza80 merged 10 commits into
mainfrom
packageupdate
Jun 22, 2026
Merged

fix: commonjs exports and additional validation checks#15
salza80 merged 10 commits into
mainfrom
packageupdate

Conversation

@salza80

@salza80 salza80 commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

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:

  • Emit the CommonJS build as dist/index.cjs and add an exports map in package.json with import/require/types entries.
  • Add lightweight runtime export checks for both ESM (import.mjs) and CJS (require.cjs) and run them after builds.
  • Strengthen CI by adding typecheck and an npm pack --dry-run step.

@salza80 salza80 requested a review from Copilot June 22, 2026 12:02
@salza80 salza80 self-assigned this Jun 22, 2026
@salza80 salza80 added the bug Something isn't working label Jun 22, 2026
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/index.mjs 1.24 KB (+0.88% 🔺)
dist/index.js 0 B (-100% 🔽)
dist/index.cjs 1.36 KB (+100% 🔺)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cjs and add an exports map in package.json with import/require/types entries.
  • Add lightweight runtime export checks for both ESM (import.mjs) and CJS (require.cjs) and run them after builds.
  • Strengthen CI by adding typecheck and an npm pack --dry-run step.

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.

Comment thread .github/workflows/pull_request.yml Outdated
Comment thread .github/workflows/test_and_release.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@salza80 salza80 merged commit 2e6d01d into main Jun 22, 2026
2 checks passed
@salza80 salza80 deleted the packageupdate branch June 22, 2026 12:27
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.2 🎉

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

bug Something isn't working released on @latest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants