From 2b0f8091e774f4046dfaaf525698e3ad72e50331 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 15 Jan 2025 10:48:03 +0100 Subject: [PATCH 1/6] Add string logging --- scripts/build.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build.js b/scripts/build.js index a745f49cfb..c18f637fab 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -47,6 +47,9 @@ let { argv } = require("yargs") async function runBuild(entry, outfile) { const isDev = process.env.NODE_ENV !== "production" + + console.log(`Building in mode ${process.env.NODE_ENV}`) + const tsconfig = argv["p"] || `tsconfig.build.json` const { data: tsconfigPathPluginContent } = loadTsConfig( From aa488ae8942197bbed46e723b5fc296e872f882b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 15 Jan 2025 11:03:05 +0100 Subject: [PATCH 2/6] Fix is dev --- scripts/build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index c18f637fab..a77329765f 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -46,9 +46,9 @@ const svelteCompilePlugin = { let { argv } = require("yargs") async function runBuild(entry, outfile) { - const isDev = process.env.NODE_ENV !== "production" + const isDev = !process.env.CI - console.log(`Building in mode ${process.env.NODE_ENV}`) + console.log(`Building in mode dev mode: ${isDev}`) const tsconfig = argv["p"] || `tsconfig.build.json` From f2fba9da0888aa88aa380e72ff1704b1e9603e45 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 15 Jan 2025 11:03:20 +0100 Subject: [PATCH 3/6] Sourcemap from tsconfig.json --- scripts/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.js b/scripts/build.js index a77329765f..e8e52d267c 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -61,7 +61,7 @@ async function runBuild(entry, outfile) { entryPoints: [entry], bundle: true, minify: !isDev, - sourcemap: isDev, + sourcemap: tsconfigPathPluginContent.compilerOptions.sourceMap, tsconfig, plugins: [ svelteCompilePlugin, From 3751886304020c20fc3862d04fa0316e94c1acdd Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 15 Jan 2025 11:03:27 +0100 Subject: [PATCH 4/6] Default on --- tsconfig.build.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.build.json b/tsconfig.build.json index a05fa2c976..0e22ddf964 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -11,6 +11,7 @@ "declaration": true, "isolatedModules": true, "baseUrl": ".", + "sourceMap": true, "paths": { "@budibase/types": ["./packages/types/src"], "@budibase/backend-core": ["./packages/backend-core/src"], From 322d3cbacb8a35c5ee624ed971e0dc411458cec5 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 15 Jan 2025 11:03:48 +0100 Subject: [PATCH 5/6] Generate meta only if in dev --- scripts/build.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index e8e52d267c..0106421fe7 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -128,10 +128,12 @@ async function runBuild(entry, outfile) { await Promise.all([hbsFiles, mainBuild, oldClientVersions]) - fs.writeFileSync( - `dist/${path.basename(outfile)}.meta.json`, - JSON.stringify((await mainBuild).metafile) - ) + if (isDev) { + fs.writeFileSync( + `dist/${path.basename(outfile)}.meta.json`, + JSON.stringify((await mainBuild).metafile) + ) + } console.log( "\x1b[32m%s\x1b[0m", From 1be1787bdc56655f92e79395abdecd481e6ae474 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 15 Jan 2025 11:04:15 +0100 Subject: [PATCH 6/6] Don't publish sourcemap for pro --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index a4f63b2267..43a5785ccb 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit a4f63b22675e16dcdcaa4d9e83b298eee6466a07 +Subproject commit 43a5785ccb4f83ce929b29f05ea0a62199fcdf23