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

simplify types generation using a single tsconfig #2118

Merged
merged 5 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/little-items-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

Type declarations are now generated using `"module": "NodeNext"`.
5 changes: 5 additions & 0 deletions .changeset/violet-lemons-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

The `"exports"` fallback for `/react-table` types is now handled using [`typesVersions`](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#version-selection-with-typesversions).
17 changes: 11 additions & 6 deletions packages/itwinui-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,26 @@
},
"require": {
"types": "./cjs/react-table/react-table.d.ts"
},
"types": "./react-table.d.ts"
}
},
"./styles.css": "./styles.css",
"./cjs": "./cjs/index.js",
"./esm": "./esm/index.js",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"react-table": [
"./esm/react-table/react-table.d.ts"
]
}
},
"files": [
"cjs",
"esm",
"styles.css",
"CHANGELOG.md",
"LICENSE.md",
"react-table.d.ts"
"LICENSE.md"
],
"description": "A react component library for iTwinUI",
"homepage": "https://github.com/iTwin/iTwinUI",
Expand All @@ -64,7 +69,7 @@
"scripts": {
"build": "pnpm clean:build && pnpm build:js && pnpm build:styles && pnpm build:types && pnpm build:post",
"build:js": "node ./scripts/build.mjs",
"build:types": "tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && tsc -p tsconfig.react-table.json",
"build:types": "tsc -p tsconfig.build.json --outDir esm && tsc -p tsconfig.build.json --outDir cjs",
"build:styles": "vite build src/styles.js",
"build:post": "node ./scripts/postBuild.mjs",
"clean:build": "rimraf esm && rimraf cjs && rimraf react-table.d.ts",
Expand All @@ -80,7 +85,7 @@
"dev": "pnpm clean:build && concurrently \"pnpm dev:esm\" \"pnpm dev:cjs\" \"pnpm build:styles --watch\" \"pnpm dev:types\"",
"dev:esm": "swc src -d esm --watch --strip-leading-paths",
"dev:cjs": "swc src -d cjs --watch --strip-leading-paths -C module.type=commonjs",
"dev:types": "concurrently \"tsc -p tsconfig.cjs.json --emitDeclarationOnly --watch --preserveWatchOutput\" \"tsc -p tsconfig.esm.json --emitDeclarationOnly --watch --preserveWatchOutput\" \"tsc -p tsconfig.react-table.json --watch --preserveWatchOutput\"",
"dev:types": "concurrently \"tsc -p tsconfig.build.json --outDir esm --watch --preserveWatchOutput\" \"tsc -p tsconfig.build.json --outDir cjs --watch --preserveWatchOutput\"",
"dev:styles": "pnpm build:styles --watch"
},
"dependencies": {
Expand Down
10 changes: 0 additions & 10 deletions packages/itwinui-react/tsconfig.cjs.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/itwinui-react/tsconfig.esm.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/itwinui-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "es2020",
"module": "esnext",
"module": "NodeNext",
"lib": ["esnext", "dom"],
"declaration": true,
"esModuleInterop": true,
Expand Down
10 changes: 0 additions & 10 deletions packages/itwinui-react/tsconfig.react-table.json

This file was deleted.

Loading