Skip to content

Commit 8379b2c

Browse files
authored
Merge pull request #19398 from Nexus-Mods/feat/18921-cleanup-1
TSConfigs for project separation
2 parents 3f1809d + 863f543 commit 8379b2c

File tree

13 files changed

+90
-18
lines changed

13 files changed

+90
-18
lines changed

electron.vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default defineConfig({
3333
preload: {
3434
build: {
3535
lib: {
36-
entry: "./src/preload.ts"
36+
entry: "./src/preload/index.ts"
3737
}
3838
}
3939
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"postinstall": "node postinstall.js",
6060
"install:debug": "cross-env VORTEX_BUILD_CONFIG=Debug yarn install",
6161
"test": "jest --no-cache",
62-
"build": "yarn run check_packages && yarn run build_rest && tsc -p .",
62+
"build": "yarn tsc -p src/shared/tsconfig.json && yarn run check_packages && yarn run build_rest && yarn tsc -p .",
6363
"buildwatch": "yarn run build_rest && tsc -p . --watch",
6464
"buildext": "node ./tools/buildScripts/buildSingleExtension.js",
6565
"gen": "yarn ts-to-zod --all",

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (process.send) {
2222
* entry point for the main process
2323
*/
2424
import os from "os";
25-
import { VORTEX_VERSION } from "./constants";
25+
import { VORTEX_VERSION } from "./shared/constants";
2626
process.env["UV_THREADPOOL_SIZE"] = (os.cpus().length * 2).toString();
2727
process.env["VORTEX_VERSION"] = VORTEX_VERSION;
2828
import "./util/application.electron";
@@ -82,7 +82,7 @@ if (!process.argv.includes('--relaunched')
8282
}
8383
*/
8484

85-
import { DEBUG_PORT, HTTP_HEADER_SIZE } from "./constants";
85+
import { DEBUG_PORT, HTTP_HEADER_SIZE } from "./shared/constants";
8686

8787
import * as sourceMapSupport from "source-map-support";
8888
sourceMapSupport.install();

src/main/tsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"target": "esnext",
5+
"module": "commonjs",
6+
"moduleResolution": "node",
7+
8+
"rootDir": "../",
9+
"outDir": "../../out"
10+
},
11+
"include": ["../main.ts", "**/*", "../shared/**/*"]
12+
}
File renamed without changes.

src/renderer/tsconfig.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"target": "esnext",
5+
"module": "commonjs",
6+
"moduleResolution": "node",
7+
8+
"jsx": "react",
9+
10+
"rootDir": "../",
11+
"outDir": "../../out"
12+
},
13+
"files": [
14+
"../../typings.custom/index.d.ts",
15+
"../index.ts",
16+
"../renderer.tsx",
17+
"../splash.ts",
18+
"../extensions/index.ts"
19+
]
20+
}

src/shared/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# Shared
22

33
This directory contains code shared by the [main](../main/) and [renderer](../renderer/) process.
4+
5+
## Rules
6+
7+
- Only platform-agnostic npm packages allowed
8+
- No Node built-ins, Electron, or environment-specific libs
9+
- No imports from main / renderer / preload

src/shared/tsconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
// NOTE(erri120): this config only exists for your editor
3+
"compilerOptions": {
4+
"lib": ["ESNext"],
5+
"types": [],
6+
7+
"strict": true,
8+
"useUnknownInCatchVariables": true,
9+
"noUncheckedIndexedAccess": true,
10+
"noImplicitOverride": true,
11+
"noUnusedParameters": true,
12+
"noUnusedLocals": true,
13+
14+
"noEmit": true
15+
},
16+
"include": ["**/*"]
17+
}

src/toJSONSchema.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)