Skip to content

Conversation

@meabed
Copy link
Contributor

@meabed meabed commented Sep 6, 2025

Summary

  • Added full ESM (ECMAScript Modules) support alongside existing CommonJS
  • Configured dual build output for maximum compatibility
  • Added contribution guidelines

Changes

  • TypeScript Configuration: Created separate configs for ESM (tsconfig.esm.json) and CommonJS (tsconfig.cjs.json) builds
  • Package.json Updates:
    • Configured proper dual exports with conditional paths for import/require
    • Added module field pointing to ESM build
    • Updated build scripts to generate both formats
  • ESM Compatibility: Added post-build script to fix ESM imports with .js extensions
  • Build Output Structure:
    • dist/cjs/ - CommonJS build with type marker
    • dist/esm/ - ESM build with type marker
  • Documentation: Added CONTRIBUTING.md with development guidelines

Test Plan

  • Build runs successfully with yarn build
  • ESM imports work: import { Configuration } from '@devmehq/sdk-js'
  • CommonJS requires work: const { Configuration } = require('@devmehq/sdk-js')
  • Both module formats tested and verified
  • Review package installation in consuming projects
  • Verify unpkg.com CDN compatibility remains intact

- Add separate TypeScript configs for ESM and CommonJS builds
- Configure package.json with proper dual exports
- Add build script to fix ESM imports with .js extensions
- Support both import and require syntax
- Add CONTRIBUTING.md with contribution guidelines
@github-actions
Copy link

github-actions bot commented Sep 6, 2025

🎉 This PR is included in version 1.3.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@meabed meabed merged commit 15bdc8f into master Sep 6, 2025
@github-actions
Copy link

github-actions bot commented Sep 6, 2025

🎉 This PR is included in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 1.3.0-beta.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant