Skip to content

Commit 6e4ef1c

Browse files
joshblackmperrotti
andauthored
chore(tsconfig): update config target and module detection (#4054)
* chore(tsconfig): update config target and module detection * refactor(types): move to explicit type re-exports * chore(project): replace ts-node for tsx to work with new tsconfig * chore(deps): update color2k for type declarations * chore: update build script to use package.json script --------- Co-authored-by: Josh Black <[email protected]> Co-authored-by: Mike Perrotti <[email protected]>
1 parent b20cd51 commit 6e4ef1c

File tree

6 files changed

+145
-25
lines changed

6 files changed

+145
-25
lines changed

package-lock.json

Lines changed: 132 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"build:docs": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs",
4949
"build:docs:preview": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs preview",
5050
"build:storybook:visual-testing": "storybook build",
51-
"build:components.json": "ts-node script/components-json/build",
51+
"build:components.json": "tsx script/components-json/build.ts",
5252
"install:docs": "(cd docs && npm install --legacy-peer-deps)",
5353
"lint": "eslint '**/*.{js,ts,tsx,md,mdx}' --max-warnings=0",
5454
"lint:fix": "npm run lint -- --fix",
@@ -112,7 +112,7 @@
112112
"@types/styled-system__css": "^5.0.16",
113113
"@types/styled-system__theme-get": "^5.0.1",
114114
"clsx": "^1.2.1",
115-
"color2k": "^2.0.0",
115+
"color2k": "^2.0.3",
116116
"deepmerge": "^4.2.2",
117117
"focus-visible": "^5.2.0",
118118
"fzy.js": "^0.4.1",
@@ -256,8 +256,8 @@
256256
"storybook-addon-turbo-build": "2.0.1",
257257
"styled-components": "5.3.11",
258258
"terser": "5.17.6",
259-
"ts-node": "10.9.2",
260259
"ts-toolbelt": "9.6.0",
260+
"tsx": "4.6.2",
261261
"typescript": "5.2.2",
262262
"typescript-plugin-css-modules": "5.0.2",
263263
"unist-util-find": "3.0.0",

script/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ npx copyfiles -u 1 "./lib/**/*.d.ts" ./lib-esm
1818
npx copyfiles --flat ./lib/components.css ./css
1919

2020
# Build components.json file for documentation
21-
npx ts-node script/components-json/build
21+
npm run build:components.json

src/Select/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export {default, SelectProps} from './Select'
1+
export {default} from './Select'
2+
export type {SelectProps} from './Select'
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export {default, UnderlineNavProps, UnderlineNavLinkProps} from './UnderlineNav'
1+
export {default} from './UnderlineNav'
2+
export type {UnderlineNavProps, UnderlineNavLinkProps} from './UnderlineNav'

tsconfig.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
3-
"target": "esnext",
4-
"module": "commonjs",
3+
"target": "ESNext",
4+
"module": "ESNext",
55
"allowJs": true,
66
"checkJs": false,
77
"jsx": "preserve",
@@ -15,7 +15,9 @@
1515
"forceConsistentCasingInFileNames": true,
1616
"resolveJsonModule": true,
1717
"typeRoots": ["./node_modules/@types", "./@types"],
18-
"plugins": [{"name": "typescript-plugin-css-modules"}]
18+
"plugins": [{"name": "typescript-plugin-css-modules"}],
19+
"isolatedModules": true,
20+
"moduleDetection": "force"
1921
},
2022
"include": [
2123
"@types/**/*.ts",

0 commit comments

Comments
 (0)