From bc31be6ef1aa0e94236ec08494d4372f35840226 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 5 Dec 2024 17:09:05 +0100 Subject: [PATCH] Use base tsconfig in server --- package.json | 1 + packages/server/tsconfig.build.json | 25 +------------------------ packages/server/tsconfig.json | 5 ----- scripts/build.js | 7 +++++-- yarn.lock | 12 ++++++++---- 5 files changed, 15 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 3ccba61a71..24c05fac17 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "husky": "^8.0.3", "kill-port": "^1.6.1", "lerna": "7.4.2", + "load-tsconfig": "^0.2.5", "madge": "^6.0.0", "nx-cloud": "16.0.5", "prettier": "2.8.8", diff --git a/packages/server/tsconfig.build.json b/packages/server/tsconfig.build.json index c4b9b8788e..77026b8258 100644 --- a/packages/server/tsconfig.build.json +++ b/packages/server/tsconfig.build.json @@ -1,28 +1,5 @@ { - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "lib": ["es2020"], - "strict": true, - "noImplicitAny": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "incremental": true, - "types": ["node", "jest"], - "outDir": "dist/src", - "skipLibCheck": true, - "baseUrl": ".", - "paths": { - "@budibase/types": ["../types/src"], - "@budibase/backend-core": ["../backend-core/src"], - "@budibase/backend-core/*": ["../backend-core/*"], - "@budibase/shared-core": ["../shared-core/src"], - "@budibase/pro": ["../pro/src"], - "@budibase/string-templates": ["../string-templates/src"], - "@budibase/string-templates/*": ["../string-templates/*"] - }, - "allowArbitraryExtensions": true - }, + "extends": "../../tsconfig.build.json", "include": ["src/**/*"], "exclude": [ "node_modules", diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json index 9d633c6455..c962785810 100644 --- a/packages/server/tsconfig.json +++ b/packages/server/tsconfig.json @@ -1,10 +1,5 @@ { "extends": "./tsconfig.build.json", - "compilerOptions": { - "lib": ["es2020", "dom"], - "composite": true, - "baseUrl": "." - }, "ts-node": { "require": ["tsconfig-paths/register"], "swc": true diff --git a/scripts/build.js b/scripts/build.js index 93a2a1e589..8ea6b49023 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -8,6 +8,7 @@ const path = require("path") const { build } = require("esbuild") const { compile } = require("svelte/compiler") +const { loadTsConfig } = require("load-tsconfig") const { default: TsconfigPathsPlugin, @@ -47,8 +48,10 @@ var { argv } = require("yargs") async function runBuild(entry, outfile) { const isDev = process.env.NODE_ENV !== "production" const tsconfig = argv["p"] || `tsconfig.build.json` - const tsconfigPathPluginContent = JSON.parse( - fs.readFileSync(tsconfig, "utf-8") + + const { data: tsconfigPathPluginContent } = loadTsConfig( + process.cwd(), + tsconfig ) const sharedConfig = { diff --git a/yarn.lock b/yarn.lock index acfa2984ca..8a228db081 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2201,8 +2201,8 @@ dependencies: "@budibase/nano" "10.1.5" "@budibase/pouchdb-replication-stream" "1.2.11" - "@budibase/shared-core" "0.0.0" - "@budibase/types" "0.0.0" + "@budibase/shared-core" "*" + "@budibase/types" "*" "@techpass/passport-openidconnect" "0.3.3" aws-cloudfront-sign "3.0.2" aws-sdk "2.1692.0" @@ -2304,7 +2304,7 @@ "@budibase/shared-core@3.2.16": version "0.0.0" dependencies: - "@budibase/types" "0.0.0" + "@budibase/types" "*" cron-validate "1.4.5" "@budibase/string-templates@3.2.16": @@ -2319,7 +2319,6 @@ version "0.0.0" dependencies: scim-patch "^0.8.1" - zod "^3.23.8" "@bull-board/api@5.10.2": version "5.10.2" @@ -14625,6 +14624,11 @@ load-json-file@^4.0.0: pify "^3.0.0" strip-bom "^3.0.0" +load-tsconfig@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/load-tsconfig/-/load-tsconfig-0.2.5.tgz#453b8cd8961bfb912dea77eb6c168fe8cca3d3a1" + integrity sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg== + local-pkg@^0.4.2: version "0.4.3" resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963"