chore: simplify package exports, enable tsdown exports, and upgrade to TypeScript 7

- Delegate `exports` map generation to tsdown (`exports: true`) and simplify `package.json` to a bare `"." : "./dist/index.mjs"` entry plus `"./package.json"`; drop redundant `main`/`module` fields
- Add `sideEffects: false` to `package.json` so bundlers can tree-shake the package
- Enable `clean: true` and `failOnWarn: true` in `tsdown.config.ts` for a cleaner build and stricter warning enforcement
- Suppress the TypeScript 7.0 experimental-API warning emitted by tsdown
- Bump `typescript` dev dependency to `^7.0.2`
This commit is contained in:
2026-09-20 17:47:36 -04:00
parent 3ded70f364
commit 026a93c69f
3 changed files with 381 additions and 20 deletions
+5 -9
View File
@@ -31,15 +31,11 @@
"dist"
],
"type": "module",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"sideEffects": false,
"types": "./dist/index.d.mts",
"exports": {
".": {
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs",
"default": "./dist/index.mjs"
}
".": "./dist/index.mjs",
"./package.json": "./package.json"
},
"publishConfig": {
"access": "public"
@@ -59,12 +55,12 @@
"tldts": "~7.4.13"
},
"devDependencies": {
"@types/node": "^26.6.1",
"@types/node": "^26.6.2",
"oxfmt": "^0.68.0",
"oxlint": "^1.83.0",
"oxlint-tsgolint": "^7.0.2002",
"tsdown": "^0.23.0",
"typescript": "^6.0.3",
"typescript": "^7.0.2",
"vite": "^8.3.0",
"vitest": "^5.0.1"
},