diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-12-23 16:04:18 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-12-23 16:15:14 +0100 |
commit | 9d74dfdb7ab3f4ce06bab00ce685541293bd37a6 (patch) | |
tree | ba740551142d483ef975cc7ced2425986a58302b /packages | |
parent | feat: Add react and mobx integration (diff) | |
download | sophie-9d74dfdb7ab3f4ce06bab00ce685541293bd37a6.tar.gz sophie-9d74dfdb7ab3f4ce06bab00ce685541293bd37a6.tar.zst sophie-9d74dfdb7ab3f4ce06bab00ce685541293bd37a6.zip |
build: Enable typescript composite mode and clean
Moves all typings to the dist-types directories from the dist
directories so that we can let vite clean the dist directories on build
without clobbering the typings generated by tsc.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/main/package.json | 3 | ||||
-rw-r--r-- | packages/main/tsconfig.json | 5 | ||||
-rw-r--r-- | packages/preload/package.json | 3 | ||||
-rw-r--r-- | packages/preload/tsconfig.json | 5 | ||||
-rw-r--r-- | packages/renderer/package.json | 3 | ||||
-rw-r--r-- | packages/renderer/tsconfig.json | 5 | ||||
-rw-r--r-- | packages/shared/package.json | 4 | ||||
-rw-r--r-- | packages/shared/tsconfig.json | 3 | ||||
-rw-r--r-- | packages/shared/vite.config.js | 2 |
9 files changed, 26 insertions, 7 deletions
diff --git a/packages/main/package.json b/packages/main/package.json index 1f5e749..509acdc 100644 --- a/packages/main/package.json +++ b/packages/main/package.json | |||
@@ -3,7 +3,9 @@ | |||
3 | "version": "0.1.0", | 3 | "version": "0.1.0", |
4 | "private": true, | 4 | "private": true, |
5 | "main": "dist/index.cjs", | 5 | "main": "dist/index.cjs", |
6 | "types": "dist-types/index.d.ts", | ||
6 | "scripts": { | 7 | "scripts": { |
8 | "clean": "rimraf dist dist-types tsconfig.tsbuildinfo", | ||
7 | "build": "vite build", | 9 | "build": "vite build", |
8 | "typecheck": "tsc" | 10 | "typecheck": "tsc" |
9 | }, | 11 | }, |
@@ -17,6 +19,7 @@ | |||
17 | "@types/electron-devtools-installer": "^2.2.0", | 19 | "@types/electron-devtools-installer": "^2.2.0", |
18 | "@types/node": "^17.0.4", | 20 | "@types/node": "^17.0.4", |
19 | "electron-devtools-installer": "^3.2.0", | 21 | "electron-devtools-installer": "^3.2.0", |
22 | "rimraf": "^3.0.2", | ||
20 | "typescript": "^4.5.4", | 23 | "typescript": "^4.5.4", |
21 | "vite": "^2.7.6" | 24 | "vite": "^2.7.6" |
22 | } | 25 | } |
diff --git a/packages/main/tsconfig.json b/packages/main/tsconfig.json index 970215c..5afee21 100644 --- a/packages/main/tsconfig.json +++ b/packages/main/tsconfig.json | |||
@@ -1,7 +1,10 @@ | |||
1 | { | 1 | { |
2 | "extends": "../../tsconfig.json", | 2 | "extends": "../../tsconfig.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "noEmit": true, | 4 | "composite": true, |
5 | "declarationDir": "dist-types", | ||
6 | "emitDeclarationOnly": true, | ||
7 | "rootDir": "src", | ||
5 | "types": [ | 8 | "types": [ |
6 | "node", | 9 | "node", |
7 | "vite/client" | 10 | "vite/client" |
diff --git a/packages/preload/package.json b/packages/preload/package.json index 2ad215c..e050b9a 100644 --- a/packages/preload/package.json +++ b/packages/preload/package.json | |||
@@ -4,7 +4,9 @@ | |||
4 | "private": true, | 4 | "private": true, |
5 | "sideEffects": false, | 5 | "sideEffects": false, |
6 | "main": "dist/index.cjs", | 6 | "main": "dist/index.cjs", |
7 | "types": "dist-types/index.d.ts", | ||
7 | "scripts": { | 8 | "scripts": { |
9 | "clean": "rimraf dist dist-types tsconfig.tsbuildinfo", | ||
8 | "build": "vite build", | 10 | "build": "vite build", |
9 | "typecheck": "tsc" | 11 | "typecheck": "tsc" |
10 | }, | 12 | }, |
@@ -15,6 +17,7 @@ | |||
15 | "mobx-state-tree": "^5.1.0" | 17 | "mobx-state-tree": "^5.1.0" |
16 | }, | 18 | }, |
17 | "devDependencies": { | 19 | "devDependencies": { |
20 | "rimraf": "^3.0.2", | ||
18 | "typescript": "^4.5.4", | 21 | "typescript": "^4.5.4", |
19 | "vite": "^2.7.6" | 22 | "vite": "^2.7.6" |
20 | } | 23 | } |
diff --git a/packages/preload/tsconfig.json b/packages/preload/tsconfig.json index 8bfa0ec..66726e3 100644 --- a/packages/preload/tsconfig.json +++ b/packages/preload/tsconfig.json | |||
@@ -1,7 +1,10 @@ | |||
1 | { | 1 | { |
2 | "extends": "../../tsconfig.json", | 2 | "extends": "../../tsconfig.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "noEmit": true | 4 | "composite": true, |
5 | "declarationDir": "dist-types", | ||
6 | "emitDeclarationOnly": true, | ||
7 | "rootDir": "src" | ||
5 | }, | 8 | }, |
6 | "references": [ | 9 | "references": [ |
7 | { | 10 | { |
diff --git a/packages/renderer/package.json b/packages/renderer/package.json index ceec3a5..5f9bd57 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json | |||
@@ -3,7 +3,9 @@ | |||
3 | "version": "0.1.0", | 3 | "version": "0.1.0", |
4 | "private": true, | 4 | "private": true, |
5 | "main": "dist/index.html", | 5 | "main": "dist/index.html", |
6 | "types": "dist-types/index.d.ts", | ||
6 | "scripts": { | 7 | "scripts": { |
8 | "clean": "rimraf dist dist-types node_modules tsconfig.tsbuildinfo", | ||
7 | "build": "vite build", | 9 | "build": "vite build", |
8 | "typecheck": "tsc" | 10 | "typecheck": "tsc" |
9 | }, | 11 | }, |
@@ -26,6 +28,7 @@ | |||
26 | "@vitejs/plugin-react": "^1.1.3", | 28 | "@vitejs/plugin-react": "^1.1.3", |
27 | "mst-middlewares": "^5.1.0", | 29 | "mst-middlewares": "^5.1.0", |
28 | "remotedev": "^0.2.9", | 30 | "remotedev": "^0.2.9", |
31 | "rimraf": "^3.0.2", | ||
29 | "typescript": "^4.5.4", | 32 | "typescript": "^4.5.4", |
30 | "vite": "^2.7.6" | 33 | "vite": "^2.7.6" |
31 | } | 34 | } |
diff --git a/packages/renderer/tsconfig.json b/packages/renderer/tsconfig.json index 8746462..998ed07 100644 --- a/packages/renderer/tsconfig.json +++ b/packages/renderer/tsconfig.json | |||
@@ -1,8 +1,11 @@ | |||
1 | { | 1 | { |
2 | "extends": "../../tsconfig.json", | 2 | "extends": "../../tsconfig.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "noEmit": true, | 4 | "composite": true, |
5 | "declarationDir": "dist-types", | ||
6 | "emitDeclarationOnly": true, | ||
5 | "jsx": "react", | 7 | "jsx": "react", |
8 | "rootDir": "src", | ||
6 | "lib": [ | 9 | "lib": [ |
7 | "dom", | 10 | "dom", |
8 | "dom.iterable", | 11 | "dom.iterable", |
diff --git a/packages/shared/package.json b/packages/shared/package.json index f49be47..83aec54 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json | |||
@@ -4,12 +4,14 @@ | |||
4 | "private": true, | 4 | "private": true, |
5 | "main": "dist/index.cjs", | 5 | "main": "dist/index.cjs", |
6 | "module": "dist/index.es.js", | 6 | "module": "dist/index.es.js", |
7 | "types": "dist/index.d.ts", | 7 | "types": "dist-types/index.d.ts", |
8 | "scripts": { | 8 | "scripts": { |
9 | "clean": "rimraf dist dist-types tsconfig.tsbuildinfo", | ||
9 | "build": "vite build", | 10 | "build": "vite build", |
10 | "typecheck": "tsc" | 11 | "typecheck": "tsc" |
11 | }, | 12 | }, |
12 | "devDependencies": { | 13 | "devDependencies": { |
14 | "rimraf": "^3.0.2", | ||
13 | "typescript": "^4.5.4", | 15 | "typescript": "^4.5.4", |
14 | "vite": "^2.7.6" | 16 | "vite": "^2.7.6" |
15 | }, | 17 | }, |
diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json index d441cc8..de75833 100644 --- a/packages/shared/tsconfig.json +++ b/packages/shared/tsconfig.json | |||
@@ -2,8 +2,7 @@ | |||
2 | "extends": "../../tsconfig.json", | 2 | "extends": "../../tsconfig.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "composite": true, | 4 | "composite": true, |
5 | "declaration": true, | 5 | "declarationDir": "dist-types", |
6 | "declarationDir": "dist", | ||
7 | "emitDeclarationOnly": true, | 6 | "emitDeclarationOnly": true, |
8 | "rootDir": "src" | 7 | "rootDir": "src" |
9 | }, | 8 | }, |
diff --git a/packages/shared/vite.config.js b/packages/shared/vite.config.js index 05ec118..a3efc87 100644 --- a/packages/shared/vite.config.js +++ b/packages/shared/vite.config.js | |||
@@ -36,7 +36,7 @@ const config = { | |||
36 | ...builtinModules, | 36 | ...builtinModules, |
37 | ], | 37 | ], |
38 | }, | 38 | }, |
39 | emptyOutDir: false, // Do not remove `.d.ts` files. | 39 | emptyOutDir: true, |
40 | brotliSize: false, | 40 | brotliSize: false, |
41 | }, | 41 | }, |
42 | }; | 42 | }; |