Skip to content

Commit 695d054

Browse files
committed
update ts config structure
1 parent f5f9101 commit 695d054

22 files changed

+93
-93
lines changed

.eslintrc.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ overrides:
4949
- '*.tsx'
5050
parserOptions:
5151
project:
52-
- './tsconfig.spec.json'
53-
- './tsconfig.node.json'
52+
- './tsconfig.json'
5453
- './packages/*/tsconfig.json'
5554
plugins:
5655
- '@typescript-eslint'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
"start:watcher": "lerna run watch:css",
1111
"start:storybook": "storybook dev -p 6006",
1212
"setup": "lerna run build:i18n && lerna run build:css && lerna run build:css-bundle && rimraf node_modules/@types/mocha",
13-
"build": "yarn setup && tsc --build && lerna run build:client && lerna run build:wrapper && lerna run build:ssr",
13+
"build": "yarn setup && tsc --build tsconfig.build.json && lerna run build:client && lerna run build:wrapper && lerna run build:ssr",
1414
"build:storybook": "lerna run build:i18n && yarn create-cypress-commands-docs && storybook build -o .out",
1515
"build:storybook-sitemap": "node ./scripts/create-storybook-sitemap.js --directory .out",
1616
"test:prepare": "rimraf temp && lerna run build",
1717
"test:cypress": "cypress run --component --browser chrome",
1818
"test:cypress:open": "CYPRESS_COVERAGE=false cypress open --component --browser chrome",
1919
"test": "yarn test:prepare && yarn test:cypress",
20-
"clean": "tsc --build --clean && rimraf temp .out && lerna run clean",
20+
"clean": "tsc --build --clean && tsc --build tsconfig.build.json --clean && rimraf temp .out && lerna run clean",
2121
"clean:remove-modules": "yarn clean && rimraf node_modules",
2222
"prettier:all": "prettier --write --config ./prettier.config.cjs \"packages/**/*.{js,jsx,ts,tsx,mdx,json,md}\"",
2323
"lint": "eslint packages --ext .ts,.tsx",

packages/base/tsconfig.build.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx"]
4+
}

packages/base/tsconfig.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"module": "NodeNext",
5-
"moduleResolution": "NodeNext",
6-
"baseUrl": ".",
7-
"outDir": "./dist",
8-
"declarationDir": "./dist",
94
"strict": true,
10-
"noImplicitAny": false,
11-
"rootDir": "./src"
5+
"noImplicitAny": false
126
},
13-
"include": ["src/**/*"],
14-
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx"]
7+
"include": ["src"]
158
}

packages/charts/tsconfig.build.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"references": [
4+
{
5+
"path": "../base/tsconfig.build.json"
6+
},
7+
{
8+
"path": "../main/tsconfig.build.json"
9+
}
10+
],
11+
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx", "**/*.stories.tsx"]
12+
}

packages/charts/tsconfig.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
{
22
"extends": "../../tsconfig.base.json",
3-
"compilerOptions": {
4-
"module": "NodeNext",
5-
"moduleResolution": "NodeNext",
6-
"baseUrl": ".",
7-
"outDir": "./dist",
8-
"declarationDir": "./dist",
9-
"rootDir": "./src"
10-
},
113
"references": [
124
{
135
"path": "../base"
@@ -16,6 +8,5 @@
168
"path": "../main"
179
}
1810
],
19-
"include": ["src/**/*"],
20-
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx", "**/*.stories.tsx"]
11+
"include": ["src"]
2112
}

packages/cli/tsconfig.build.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./tsconfig.json"
3+
}

packages/cli/tsconfig.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
"compilerOptions": {
44
"target": "es2022",
55
"lib": ["ES2023", "dom"],
6-
"module": "NodeNext",
7-
"moduleResolution": "NodeNext",
86
"noEmitOnError": true,
9-
"baseUrl": ".",
10-
"outDir": "./dist",
11-
"declarationDir": "./dist",
12-
"rootDir": "./src",
137
"strict": true,
148
"types": ["node"],
159
"skipLibCheck": true

packages/compat/tsconfig.build.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"references": [
4+
{
5+
"path": "../base/tsconfig.build.json"
6+
},
7+
{
8+
"path": "../main/tsconfig.build.json"
9+
}
10+
],
11+
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx", "**/*.stories.tsx"]
12+
}

packages/compat/tsconfig.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"module": "NodeNext",
5-
"moduleResolution": "NodeNext",
6-
"baseUrl": ".",
7-
"outDir": "./dist",
8-
"declarationDir": "./dist",
9-
"rootDir": "./src",
104
"strict": true,
115
"noImplicitAny": false,
126
"strictNullChecks": false,
@@ -20,6 +14,5 @@
2014
"path": "../main"
2115
}
2216
],
23-
"include": ["src/**/*"],
24-
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx", "**/*.stories.tsx"]
17+
"include": ["src/**/*"]
2518
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./tsconfig.json"
3+
}

packages/cypress-commands/tsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"module": "NodeNext",
55
"moduleResolution": "NodeNext",
66
"noEmitOnError": true,
7-
"baseUrl": ".",
8-
"outDir": "./dist",
9-
"declarationDir": "./dist",
10-
"rootDir": "./src",
117
"types": ["cypress"],
128
"strict": true,
139
"skipLibCheck": true
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"extends": "./tsconfig.json",
3-
"compilerOptions": {
4-
"rootDir": "."
5-
},
63
"include": ["src", "CommandsAndQueries.tsx"]
74
}

packages/main/.babelrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@
4848
]
4949
}
5050
},
51-
"ignore": ["**/*.cy.ts", "**/*.cy.tsx", "**/CodeGen.tsx", "**/*.stories.tsx"]
51+
"ignore": ["dist", "**/*.cy.ts", "**/*.cy.tsx", "**/CodeGen.tsx", "**/*.stories.tsx"]
5252
}

packages/main/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
"scripts": {
4545
"clean": "rimraf dist tmp wrappers ssr",
4646
"build:i18n": "node scripts/generateI18n.mjs",
47-
"build:client": "babel src --out-dir dist --extensions .ts,.tsx --env-name client && tsc --declarationDir dist",
48-
"build:ssr": "babel src --out-dir ssr --extensions .ts,.tsx --env-name ssr && tsc --declarationDir ssr",
49-
"build:wrapper": "babel src --out-dir wrappers --extensions .ts,.tsx --env-name wrapper && tsc --declarationDir wrappers",
47+
"build:client": "babel src --out-dir dist --extensions .ts,.tsx --env-name client && tsc --project tsconfig.build.json --declarationDir dist",
48+
"build:ssr": "babel src --out-dir ssr --extensions .ts,.tsx --env-name ssr && tsc --project tsconfig.build.json --declarationDir ssr",
49+
"build:wrapper": "babel src --out-dir wrappers --extensions .ts,.tsx --env-name wrapper && tsc --project tsconfig.build.json --declarationDir wrappers",
5050
"build:css": "postcss --base src --dir dist/css src/**/*.css",
5151
"build:css-bundle": "node ../../config/merge-css-modules.js",
5252
"watch:css": "yarn build:css --watch"

packages/main/tsconfig.build.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"references": [
4+
{
5+
"path": "../base/tsconfig.build.json"
6+
}
7+
],
8+
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx", "**/*.stories.tsx"]
9+
}

packages/main/tsconfig.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"module": "NodeNext",
5-
"moduleResolution": "NodeNext",
6-
"baseUrl": ".",
7-
"outDir": "./dist",
8-
"declarationDir": "./dist",
9-
"rootDir": "./src",
104
"strict": true,
115
"noImplicitAny": false,
126
"strictNullChecks": false,
@@ -18,6 +12,5 @@
1812
"path": "../base"
1913
}
2014
],
21-
"include": ["src/**/*"],
22-
"exclude": ["node_modules", "**/*.cy.ts", "**/*.cy.tsx", "**/*.stories.tsx"]
15+
"include": ["src"]
2316
}

tsconfig.base.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"compilerOptions": {
3-
"module": "esnext",
3+
"module": "NodeNext",
4+
"moduleResolution": "NodeNext",
45
"target": "ES2021",
56
"lib": ["ES2022", "dom"],
67
"jsx": "react-jsx",
7-
"baseUrl": ".",
8-
"rootDir": ".",
8+
"baseUrl": "${configDir}/src",
9+
"rootDir": "${configDir}/src",
910
"composite": true,
1011
"paths": {
12+
"@/*": ["./*"],
1113
"@sb/*": ["./.storybook/*"],
1214
"@ui5/webcomponents-cypress-commands": ["./packages/cypress-commands/src/index.ts"],
1315
"@ui5/webcomponents-react": ["./packages/main/src/index.ts"],
1416
"@ui5/webcomponents-react-base": ["./packages/base/src/index.ts"],
1517
"@ui5/webcomponents-react-charts": ["./packages/charts/src/index.ts"],
1618
"@ui5/webcomponents-react/*": ["./packages/main/src/*"]
1719
},
18-
"moduleResolution": "node",
1920
"forceConsistentCasingInFileNames": true,
2021
"strict": false,
2122
"allowSyntheticDefaultImports": true,
@@ -24,6 +25,8 @@
2425
"esModuleInterop": true,
2526
"resolveJsonModule": true,
2627
"declaration": true,
27-
"skipLibCheck": true
28+
"skipLibCheck": true,
29+
"outDir": "${configDir}/dist",
30+
"declarationDir": "${configDir}/dist"
2831
}
2932
}

tsconfig.build.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"references": [
4+
{
5+
"path": "./packages/base/tsconfig.build.json"
6+
},
7+
{
8+
"path": "./packages/main/tsconfig.build.json"
9+
},
10+
{
11+
"path": "./packages/charts/tsconfig.build.json"
12+
},
13+
{
14+
"path": "./packages/cypress-commands/tsconfig.build.json"
15+
},
16+
{
17+
"path": "./packages/cli/tsconfig.build.json"
18+
},
19+
{
20+
"path": "./packages/compat/tsconfig.build.json"
21+
}
22+
],
23+
"files": []
24+
}

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
},
1919
{
2020
"path": "./packages/compat"
21+
},
22+
{
23+
"path": "./tsconfig.spec.json"
2124
}
2225
],
23-
"files": []
26+
"files": ["vite.config.ts", ".storybook", "docs", "packages/cypress-commands/CommandsAndQueries.tsx"]
2427
}

tsconfig.node.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

tsconfig.spec.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,7 @@
44
"lib": ["es2022", "dom"],
55
"types": ["cypress", "node", "@testing-library/cypress", "cypress-real-events"],
66
"moduleResolution": "Node",
7-
"jsx": "react-jsx",
8-
"paths": {
9-
"@/*": ["./*"]
10-
}
7+
"jsx": "react-jsx"
118
},
12-
"include": [
13-
"cypress/**/*.ts",
14-
"cypress/**/*.tsx",
15-
"**/*.cy.ts",
16-
"**/*.cy.tsx",
17-
"cypress.config.ts",
18-
"docs/knowledge-base/*.tsx",
19-
"docs/knowledgeBaseExamples/*.tsx",
20-
"vite.config.ts"
21-
]
9+
"include": ["cypress", "**/*.cy.ts", "**/*.cy.tsx", "cypress.config.ts"]
2210
}

0 commit comments

Comments
 (0)