fix: remove typescript syntax from js modules#177
Conversation
🦋 Changeset detectedLatest commit: 6085fa8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
❌ Deploy Preview for red-hat-design-tokens failed. Why did it fail? →
|
There was a problem hiding this comment.
Pull request overview
This pull request fixes an issue where .cjs files contained TypeScript syntax, breaking compatibility with tools like @jspm/generator that don't support TypeScript in CommonJS modules. The fix converts the CommonJS format generators to produce pure JavaScript with JSDoc type annotations instead of TypeScript syntax.
Changes:
- Rewrote
mapCjsandmetaMapCjsformat generators to output pure JavaScript with JSDoc instead of relying on TypeScript-to-JavaScript string replacement - Added smoke tests to verify
.cjsfiles can be loaded by Node.js without type stripping - Updated wireit test configuration to include the new smoke tests
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/formats/map.ts | Replaced TypeScript-based generation with pure JavaScript output using JSDoc for both mapCjs and metaMapCjs formats |
| test/smoke.cjs | Added comprehensive smoke tests to validate .cjs files load correctly in Node.js without TypeScript support |
| package.json | Added test:smoke script and configured it as a test dependency |
| .changeset/polite-walls-invite.md | Added changeset documenting the fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8709cc9 to
6085fa8
Compare
Fixes #176