From d66a020b3cbae9c8f16d6e2b6080e8a1ddc8c0c5 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Aug 2023 11:48:18 +0300 Subject: [PATCH 1/6] Fix build script with no pro locally --- scripts/build.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/build.js b/scripts/build.js index 2ca41b5f7d..50620d94f4 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -22,7 +22,10 @@ function runBuild(entry, outfile) { fs.readFileSync(tsconfig, "utf-8") ) - if (!fs.existsSync("../pro/src")) { + if ( + !fs.existsSync("../pro/src") && + tsconfigPathPluginContent.compilerOptions?.paths + ) { // If we don't have pro, we cannot bundle backend-core. // Otherwise, the main context will not be shared between libraries delete tsconfigPathPluginContent.compilerOptions.paths[ From 5b29e879a448ae4b993c9218d6e9d9ef84a6214d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 10 Aug 2023 16:03:37 +0300 Subject: [PATCH 2/6] Fix dev when no pro loaded --- packages/server/package.json | 15 +++++++++++++++ packages/worker/package.json | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/packages/server/package.json b/packages/server/package.json index 7d0d8f5feb..29b8666746 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -179,5 +179,20 @@ }, "optionalDependencies": { "oracledb": "5.3.0" + }, + "nx": { + "targets": { + "dev:builder": { + "dependsOn": [ + { + "comment": "Required for pro usage when submodule not loaded", + "projects": [ + "@budibase/backend-core" + ], + "target": "build" + } + ] + } + } } } diff --git a/packages/worker/package.json b/packages/worker/package.json index a71e9519d9..3b66df264e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -102,5 +102,20 @@ "tsconfig-paths": "4.0.0", "typescript": "4.7.3", "update-dotenv": "1.1.1" + }, + "nx": { + "targets": { + "dev:builder": { + "dependsOn": [ + { + "comment": "Required for pro usage when submodule not loaded", + "projects": [ + "@budibase/backend-core" + ], + "target": "build" + } + ] + } + } } } From ea84b7ffe3d2f8f7359af8697ed570e61658f766 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 21 Aug 2023 09:54:08 +0300 Subject: [PATCH 3/6] Fix shared-core on dev:builder --- packages/shared-core/tsconfig.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/shared-core/tsconfig.json b/packages/shared-core/tsconfig.json index 33e37179d7..1e7516a1ab 100644 --- a/packages/shared-core/tsconfig.json +++ b/packages/shared-core/tsconfig.json @@ -1,4 +1,10 @@ { "extends": "./tsconfig.build.json", + "compilerOptions": { + "baseUrl": "..", + "rootDir": "src", + "composite": true, + "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo" + }, "exclude": ["node_modules", "dist"] } From 05be9536476412ea63af8cb40d9a27270e7f72ec Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 21 Aug 2023 10:06:37 +0300 Subject: [PATCH 4/6] Shared and types are commonjs (for pro users) --- packages/shared-core/tsconfig.build.json | 2 +- packages/types/tsconfig.build.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/shared-core/tsconfig.build.json b/packages/shared-core/tsconfig.build.json index 31dc1afc10..5b356a1f08 100644 --- a/packages/shared-core/tsconfig.build.json +++ b/packages/shared-core/tsconfig.build.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es6", - "moduleResolution": "node", + "module": "commonjs", "lib": ["es2020"], "strict": true, "noImplicitAny": true, diff --git a/packages/types/tsconfig.build.json b/packages/types/tsconfig.build.json index f2c4c7667b..8df63fac57 100644 --- a/packages/types/tsconfig.build.json +++ b/packages/types/tsconfig.build.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es6", - "moduleResolution": "node", + "module": "commonjs", "lib": ["es2020"], "strict": true, "noImplicitAny": true, From 8ca838dad27c65bec7593b59169cf4e998ea2026 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 21 Aug 2023 10:07:36 +0300 Subject: [PATCH 5/6] Fix types on shared-pro build --- packages/shared-core/package.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/shared-core/package.json b/packages/shared-core/package.json index 382f3fa731..2fc6be6974 100644 --- a/packages/shared-core/package.json +++ b/packages/shared-core/package.json @@ -32,6 +32,16 @@ "target": "build" } ] + }, + "dev:builder": { + "dependsOn": [ + { + "projects": [ + "@budibase/types" + ], + "target": "build" + } + ] } } } From c835f910c5a9a2e1145041bf5476e2bff6715632 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 21 Aug 2023 10:20:22 +0300 Subject: [PATCH 6/6] Fix cli build --- packages/cli/tsconfig.build.json | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/cli/tsconfig.build.json b/packages/cli/tsconfig.build.json index 34a89f54c3..9fbccadd31 100644 --- a/packages/cli/tsconfig.build.json +++ b/packages/cli/tsconfig.build.json @@ -8,22 +8,16 @@ "esModuleInterop": true, "resolveJsonModule": true, "incremental": true, - "types": [ "node", "jest" ], + "types": ["node", "jest"], "outDir": "dist", "skipLibCheck": true, "paths": { "@budibase/types": ["../types/src"], "@budibase/backend-core": ["../backend-core/src"], - "@budibase/backend-core/*": ["../backend-core/*"] + "@budibase/backend-core/*": ["../backend-core/*"], + "@budibase/shared-core": ["../shared-core/src"] } }, - "include": [ - "src/**/*" - ], - "exclude": [ - "node_modules", - "dist", - "**/*.spec.ts", - "**/*.spec.js" - ] + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.spec.ts", "**/*.spec.js"] }