Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite in TypeScript; update build process #6

Merged
merged 6 commits into from
Nov 14, 2024
Merged

Conversation

nwalters512
Copy link
Contributor

This PR rewrites lib/ to use native TypeScript instead of JSDoc comments. It also switches to building dist/{cjs,esm} with tsc directly so that the types can be correctly generated (see #2). The UMD builds are still done with Rollup since tsc can't natively produce a UMD bundle.

Closes #2.

"jest": "^29.7.0",
"rollup": "^4.26.0",
"typescript": "^5.6.3"
"typescript": "^5.7.1-rc"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 5.7 release candidate was necessary to gain support for rewriteRelativeImportExtensions, see https://devblogs.microsoft.com/typescript/announcing-typescript-5-7-rc/

"repository": {
"type": "git",
"url": "https://github.com/orchidjs/unicode-variants.git"
},
"type": "module",
"main": "dist/cjs/index.js",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change: main now points to dist/cjs instead of dist/umd. The UMD build should be reserved for browser use.

@@ -3,7 +3,7 @@
* Usage:
* > npm run bench
*/
import * as D from './lib/index.mjs';
import * as D from './dist/esm/index.js';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This now requires one to run npm run build first. I couldn't see a convenient way to have this file either be or directly import TypeScript.

@nwalters512 nwalters512 merged commit 9c0dc15 into main Nov 14, 2024
3 checks passed
@nwalters512 nwalters512 deleted the typescript-rewrite branch November 14, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken types when used with ESM + node16 moduleResolution
1 participant