build(rest-passthrough): Use typescript to build (#4432)

* build(rest-passthrough): Use typescript to build

It doesn't make a lot of sense for something like this to use SWC to build + this needed typescript with a tsconfig anyway for a typecheck

* Add tsconfig

* Remove .swcrc and copy tsconfig in docker

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
This commit is contained in:
Fleny
2025-09-17 21:38:34 +02:00
committed by GitHub
parent df1658d923
commit 3ee8b48658
5 changed files with 54 additions and 1174 deletions

View File

@@ -1,25 +0,0 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"target": "es2022",
"keepClassNames": true,
"loose": true
},
"module": {
"type": "es6",
"strict": false,
"strictMode": true,
"lazy": false,
"noInterop": false
},
"sourceMaps": "inline"
}

View File

@@ -15,7 +15,7 @@ WORKDIR /app
# copy the source files
COPY src/ src/
# copy the compiler config
COPY .swcrc ./
COPY tsconfig.json ./
# compile the files
RUN yarn build

View File

@@ -5,7 +5,7 @@
"version": "1.0.0",
"packageManager": "yarn@4.6.0",
"scripts": {
"build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist",
"build": "tsc",
"start:dev": "yarn exec node -r dotenv/config dist/server.js",
"start:prod": "yarn exec node ./dist/server.js",
"release": "cliff-jumper"
@@ -19,8 +19,8 @@
},
"devDependencies": {
"@favware/cliff-jumper": "^6.0.0",
"@swc/cli": "^0.7.8",
"@swc/core": "^1.13.5",
"dotenv": "^17.2.1"
"@types/node": "^24.3.1",
"dotenv": "^17.2.1",
"typescript": "^5.9.2"
}
}

View File

@@ -0,0 +1,19 @@
{
// Visit https://aka.ms/tsconfig to read more about this file
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"module": "node20",
"target": "es2020",
"lib": ["ES2020"],
"types": ["node"],
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"strict": true,
"verbatimModuleSyntax": true,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": true
}
}

File diff suppressed because it is too large Load Diff