From daa87915e889300be75e07e89fdca1d6405bcc90 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 Jan 2024 13:45:23 +0100 Subject: [PATCH 01/19] Test examples --- .../string-templates/test/manifest.spec.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/string-templates/test/manifest.spec.js diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js new file mode 100644 index 0000000000..90e23dcedd --- /dev/null +++ b/packages/string-templates/test/manifest.spec.js @@ -0,0 +1,22 @@ +const fs = require("fs") +const { processString } = require("../src/index.cjs") + +const manifest = JSON.parse( + fs.readFileSync(require.resolve("../manifest.json"), "utf8") +) + +const examples = Object.keys(manifest).flatMap(collection => + Object.keys(manifest[collection]).map(fnc => [collection, fnc]) +) + +describe("manifest", () => { + describe("examples are valid", () => { + it.each(examples)("%s - %s", async (collection, func) => { + const example = manifest[collection][func].example + + const [hbs, js] = example.split("->").map(x => x.trim()) + + expect(await processString(hbs)).toEqual(js) + }) + }) +}) From f783602d9fbde9479f1cde36506d0f85c78c7ca8 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 Jan 2024 14:05:35 +0100 Subject: [PATCH 02/19] Fix date test examples --- packages/string-templates/manifest.json | 2 +- packages/string-templates/test/manifest.spec.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/string-templates/manifest.json b/packages/string-templates/manifest.json index ee03d75aa3..9dd8260350 100644 --- a/packages/string-templates/manifest.json +++ b/packages/string-templates/manifest.json @@ -1196,7 +1196,7 @@ "durationType" ], "numArgs": 2, - "example": "{{duration timeLeft \"seconds\"}} -> a few seconds", + "example": "{{duration 8 \"seconds\"}} -> a few seconds", "description": "

Produce a humanized duration left/until given an amount of time and the type of time measurement.

\n" } } diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 90e23dcedd..36c1b1bd0b 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -1,6 +1,9 @@ const fs = require("fs") const { processString } = require("../src/index.cjs") +const tk = require("timekeeper") +tk.freeze("2021-01-21T12:00:00") + const manifest = JSON.parse( fs.readFileSync(require.resolve("../manifest.json"), "utf8") ) From ac9f8bd4989697b96e4063abe3d2407ad81159fc Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 10:40:26 +0100 Subject: [PATCH 03/19] Fix random test --- packages/string-templates/test/manifest.spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 36c1b1bd0b..62fd5acf99 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -1,3 +1,12 @@ +jest.mock("@budibase/handlebars-helpers/lib/math", () => { + const actual = jest.requireActual("@budibase/handlebars-helpers/lib/math") + + return { + ...actual, + random: () => 10, + } +}) + const fs = require("fs") const { processString } = require("../src/index.cjs") From 537eae7b98cf900920a7cf89a25598c91e28b30f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 10:44:49 +0100 Subject: [PATCH 04/19] Fix sum --- packages/string-templates/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/string-templates/manifest.json b/packages/string-templates/manifest.json index 9dd8260350..951f5fecdc 100644 --- a/packages/string-templates/manifest.json +++ b/packages/string-templates/manifest.json @@ -126,7 +126,7 @@ "array" ], "numArgs": 1, - "example": "{{ sum [1, 2, 3] }} -> 6", + "example": "{{ sum 1 2 3 }} -> 6", "description": "

Returns the sum of all numbers in the given array.

\n" } }, From dc0bef20d86d92018cebb5e549571fc17e87d24a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 12:16:52 +0100 Subject: [PATCH 05/19] Fix sum --- packages/string-templates/manifest.json | 2 +- packages/string-templates/test/manifest.spec.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/string-templates/manifest.json b/packages/string-templates/manifest.json index 951f5fecdc..008c537abc 100644 --- a/packages/string-templates/manifest.json +++ b/packages/string-templates/manifest.json @@ -126,7 +126,7 @@ "array" ], "numArgs": 1, - "example": "{{ sum 1 2 3 }} -> 6", + "example": "{{ sum '[1, 2, 3]' }} -> 6", "description": "

Returns the sum of all numbers in the given array.

\n" } }, diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 62fd5acf99..2457467de3 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -26,9 +26,10 @@ describe("manifest", () => { it.each(examples)("%s - %s", async (collection, func) => { const example = manifest[collection][func].example - const [hbs, js] = example.split("->").map(x => x.trim()) + let [hbs, js] = example.split("->").map(x => x.trim()) + hbs = hbs.replace(/'\[1, 2, 3\]'/, "array") - expect(await processString(hbs)).toEqual(js) + expect(await processString(hbs, { array: [1, 2, 3] })).toEqual(js) }) }) }) From 6abaf589ff9669a6521fd50e17641172856d0756 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 12:16:59 +0100 Subject: [PATCH 06/19] Fix duration generation --- packages/string-templates/scripts/gen-collection-info.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/string-templates/scripts/gen-collection-info.js b/packages/string-templates/scripts/gen-collection-info.js index 815f3b607f..b487c4dde4 100644 --- a/packages/string-templates/scripts/gen-collection-info.js +++ b/packages/string-templates/scripts/gen-collection-info.js @@ -36,7 +36,7 @@ const ADDED_HELPERS = { duration: { args: ["time", "durationType"], numArgs: 2, - example: '{{duration timeLeft "seconds"}} -> a few seconds', + example: '{{duration 8 "seconds"}} -> a few seconds', description: "Produce a humanized duration left/until given an amount of time and the type of time measurement.", }, From 142b404a91600dc63832bf075f16f90f78be0010 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 12:18:47 +0100 Subject: [PATCH 07/19] Array instead of string --- packages/string-templates/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/string-templates/manifest.json b/packages/string-templates/manifest.json index 008c537abc..9dd8260350 100644 --- a/packages/string-templates/manifest.json +++ b/packages/string-templates/manifest.json @@ -126,7 +126,7 @@ "array" ], "numArgs": 1, - "example": "{{ sum '[1, 2, 3]' }} -> 6", + "example": "{{ sum [1, 2, 3] }} -> 6", "description": "

Returns the sum of all numbers in the given array.

\n" } }, From 7705397da3b839fd7b3564abbbd59885baa31e80 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 12:18:53 +0100 Subject: [PATCH 08/19] Array instead of string --- packages/string-templates/test/manifest.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 2457467de3..1e1f58dae0 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -27,7 +27,7 @@ describe("manifest", () => { const example = manifest[collection][func].example let [hbs, js] = example.split("->").map(x => x.trim()) - hbs = hbs.replace(/'\[1, 2, 3\]'/, "array") + hbs = hbs.replace(/\[1, 2, 3\]/, "array") expect(await processString(hbs, { array: [1, 2, 3] })).toEqual(js) }) From c59750cc9ea38ee9708505b4c9bb3f313519f4ca Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 12:24:03 +0100 Subject: [PATCH 09/19] Fix some array tests --- packages/string-templates/test/manifest.spec.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 1e1f58dae0..38033a377e 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -27,9 +27,20 @@ describe("manifest", () => { const example = manifest[collection][func].example let [hbs, js] = example.split("->").map(x => x.trim()) - hbs = hbs.replace(/\[1, 2, 3\]/, "array") + hbs = hbs.replace(/\[1, 2, 3\]/, "array3") + hbs = hbs.replace(/\[1, 2, 3, 4\]/, "array4") - expect(await processString(hbs, { array: [1, 2, 3] })).toEqual(js) + if (js === undefined) { + // The function has no return value + return + } + + expect( + await processString(hbs, { + array3: [1, 2, 3], + array4: [1, 2, 3, 4], + }) + ).toEqual(js) }) }) }) From 6f87a6f0bc8c4e6bb3557e9bad728864db41c6a5 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 14:57:35 +0100 Subject: [PATCH 10/19] Fix some array examples --- .../string-templates/test/manifest.spec.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 38033a377e..d7e3cfa18f 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -21,26 +21,32 @@ const examples = Object.keys(manifest).flatMap(collection => Object.keys(manifest[collection]).map(fnc => [collection, fnc]) ) +function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") // $& means the whole matched string +} + describe("manifest", () => { describe("examples are valid", () => { it.each(examples)("%s - %s", async (collection, func) => { const example = manifest[collection][func].example let [hbs, js] = example.split("->").map(x => x.trim()) - hbs = hbs.replace(/\[1, 2, 3\]/, "array3") - hbs = hbs.replace(/\[1, 2, 3, 4\]/, "array4") + + const context = {} + + const arrays = hbs.match(/\[[^/\]]+\]/) + arrays.forEach((arrayString, i) => { + hbs = hbs.replace(new RegExp(escapeRegExp(arrayString)), `array${i}`) + context[`array${i}`] = JSON.parse(arrayString) + }) if (js === undefined) { // The function has no return value return } - expect( - await processString(hbs, { - array3: [1, 2, 3], - array4: [1, 2, 3, 4], - }) - ).toEqual(js) + const result = await processString(hbs, context) + expect(result).toEqual(js) }) }) }) From b66fac87cc89cbc163fb3561a82c36395c3c6f0c Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 15:30:15 +0100 Subject: [PATCH 11/19] Fix some array examples --- packages/string-templates/test/manifest.spec.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index d7e3cfa18f..b10bd3cd31 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -32,12 +32,14 @@ describe("manifest", () => { let [hbs, js] = example.split("->").map(x => x.trim()) - const context = {} + const context = { + double: i => i * 2, + } const arrays = hbs.match(/\[[^/\]]+\]/) arrays.forEach((arrayString, i) => { hbs = hbs.replace(new RegExp(escapeRegExp(arrayString)), `array${i}`) - context[`array${i}`] = JSON.parse(arrayString) + context[`array${i}`] = JSON.parse(arrayString.replace(/\'/g, '"')) }) if (js === undefined) { @@ -46,6 +48,14 @@ describe("manifest", () => { } const result = await processString(hbs, context) + try { + let parsedExpected + if ( + Array.isArray((parsedExpected = JSON.parse(js.replace(/\'/g, '"')))) + ) { + js = parsedExpected.join(",") + } + } catch {} expect(result).toEqual(js) }) }) From 603943d7cf9a34a195b2f0679e7dea7ce8caf732 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 22:06:40 +0100 Subject: [PATCH 12/19] Refactor tests --- .../string-templates/test/manifest.spec.js | 74 +++++++++++-------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index b10bd3cd31..c03306cd19 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -17,8 +17,15 @@ const manifest = JSON.parse( fs.readFileSync(require.resolve("../manifest.json"), "utf8") ) -const examples = Object.keys(manifest).flatMap(collection => - Object.keys(manifest[collection]).map(fnc => [collection, fnc]) +const functionsToExclude = { string: ["raw"] } + +const collections = Object.keys(manifest) +const examples = collections.reduce( + (acc, collection) => ({ + ...acc, + [collection]: manifest[collection], + }), + {} ) function escapeRegExp(string) { @@ -27,36 +34,45 @@ function escapeRegExp(string) { describe("manifest", () => { describe("examples are valid", () => { - it.each(examples)("%s - %s", async (collection, func) => { - const example = manifest[collection][func].example + describe.each(collections)("%s", collection => { + it.each( + Object.keys(examples[collection]).filter( + fnc => !functionsToExclude[collection]?.includes(fnc) + ) + )("%s", async func => { + const example = manifest[collection][func].example - let [hbs, js] = example.split("->").map(x => x.trim()) + let [hbs, js] = example.split("->").map(x => x.trim()) - const context = { - double: i => i * 2, - } - - const arrays = hbs.match(/\[[^/\]]+\]/) - arrays.forEach((arrayString, i) => { - hbs = hbs.replace(new RegExp(escapeRegExp(arrayString)), `array${i}`) - context[`array${i}`] = JSON.parse(arrayString.replace(/\'/g, '"')) - }) - - if (js === undefined) { - // The function has no return value - return - } - - const result = await processString(hbs, context) - try { - let parsedExpected - if ( - Array.isArray((parsedExpected = JSON.parse(js.replace(/\'/g, '"')))) - ) { - js = parsedExpected.join(",") + const context = { + double: i => i * 2, } - } catch {} - expect(result).toEqual(js) + + const arrays = hbs.match(/\[[^/\]]+\]/) + arrays?.forEach((arrayString, i) => { + hbs = hbs.replace(new RegExp(escapeRegExp(arrayString)), `array${i}`) + context[`array${i}`] = JSON.parse(arrayString.replace(/\'/g, '"')) + }) + + if (js === undefined) { + // The function has no return value + return + } + + let result = await processString(hbs, context) + // Trim 's + js = js.replace(/^\'|\'$/g, "") + try { + let parsedExpected + if ( + Array.isArray((parsedExpected = JSON.parse(js.replace(/\'/g, '"')))) + ) { + js = parsedExpected.join(",") + } + } catch {} + result = result.replace(/ /g, " ") + expect(result).toEqual(js) + }) }) }) }) From 4829cdc4ce64e3b1385168fac90e0dfeb6da5a07 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 22:08:55 +0100 Subject: [PATCH 13/19] Fix uuid tests --- packages/string-templates/test/manifest.spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index c03306cd19..8c53ea0302 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -6,6 +6,14 @@ jest.mock("@budibase/handlebars-helpers/lib/math", () => { random: () => 10, } }) +jest.mock("@budibase/handlebars-helpers/lib/uuid", () => { + const actual = jest.requireActual("@budibase/handlebars-helpers/lib/uuid") + + return { + ...actual, + uuid: () => "f34ebc66-93bd-4f7c-b79b-92b5569138bc", + } +}) const fs = require("fs") const { processString } = require("../src/index.cjs") From 99e5bc1a57d4106b21f1fa1267a0aef6c3d5c2cf Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 22:35:35 +0100 Subject: [PATCH 14/19] Refactor --- .../string-templates/test/manifest.spec.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 8c53ea0302..5153f1dbed 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -28,13 +28,17 @@ const manifest = JSON.parse( const functionsToExclude = { string: ["raw"] } const collections = Object.keys(manifest) -const examples = collections.reduce( - (acc, collection) => ({ - ...acc, - [collection]: manifest[collection], - }), - {} -) +const examples = collections.reduce((acc, collection) => { + const functions = Object.keys(manifest[collection]).filter( + fnc => + !functionsToExclude[collection]?.includes(fnc) && + manifest[collection][fnc].example + ) + if (functions.length) { + acc[collection] = functions + } + return acc +}, {}) function escapeRegExp(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") // $& means the whole matched string @@ -42,12 +46,8 @@ function escapeRegExp(string) { describe("manifest", () => { describe("examples are valid", () => { - describe.each(collections)("%s", collection => { - it.each( - Object.keys(examples[collection]).filter( - fnc => !functionsToExclude[collection]?.includes(fnc) - ) - )("%s", async func => { + describe.each(Object.keys(examples))("%s", collection => { + it.each(examples[collection])("%s", async func => { const example = manifest[collection][func].example let [hbs, js] = example.split("->").map(x => x.trim()) From ea0e36b7a42461f6294e2e370d3ca39653d9ccaa Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 23 Jan 2024 14:28:52 +0100 Subject: [PATCH 15/19] Don't explicitly exclude raw --- packages/string-templates/test/manifest.spec.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 5153f1dbed..091d2789af 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -25,14 +25,10 @@ const manifest = JSON.parse( fs.readFileSync(require.resolve("../manifest.json"), "utf8") ) -const functionsToExclude = { string: ["raw"] } - const collections = Object.keys(manifest) const examples = collections.reduce((acc, collection) => { const functions = Object.keys(manifest[collection]).filter( - fnc => - !functionsToExclude[collection]?.includes(fnc) && - manifest[collection][fnc].example + fnc => manifest[collection][fnc].example ) if (functions.length) { acc[collection] = functions From f193c276f6e63c51fc8fb2984a8cd86443988224 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 23 Jan 2024 14:28:58 +0100 Subject: [PATCH 16/19] Fix test --- packages/string-templates/test/manifest.spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 091d2789af..f1b4277b79 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -50,6 +50,7 @@ describe("manifest", () => { const context = { double: i => i * 2, + isString: x => typeof x === "string", } const arrays = hbs.match(/\[[^/\]]+\]/) From 108508db7ecd39acd0baa3204147ba15b2b4b4f6 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 23 Jan 2024 16:00:07 +0100 Subject: [PATCH 17/19] Fix tests --- packages/string-templates/test/manifest.spec.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index f1b4277b79..ccfb14b4e0 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -72,7 +72,11 @@ describe("manifest", () => { if ( Array.isArray((parsedExpected = JSON.parse(js.replace(/\'/g, '"')))) ) { - js = parsedExpected.join(",") + if (typeof parsedExpected[0] === "object") { + js = JSON.stringify(parsedExpected) + } else { + js = parsedExpected.join(",") + } } } catch {} result = result.replace(/ /g, " ") From 52fca8714d88123121d794700efa586282a42dac Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 23 Jan 2024 19:40:31 +0100 Subject: [PATCH 18/19] More verbose test code --- .../string-templates/test/manifest.spec.js | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index ccfb14b4e0..506f2eb6f7 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -40,6 +40,18 @@ function escapeRegExp(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") // $& means the whole matched string } +function tryParseJson(str) { + if (typeof str !== "string") { + return + } + + try { + return JSON.parse(str.replace(/\'/g, '"')) + } catch (e) { + return + } +} + describe("manifest", () => { describe("examples are valid", () => { describe.each(Object.keys(examples))("%s", collection => { @@ -67,18 +79,15 @@ describe("manifest", () => { let result = await processString(hbs, context) // Trim 's js = js.replace(/^\'|\'$/g, "") - try { - let parsedExpected - if ( - Array.isArray((parsedExpected = JSON.parse(js.replace(/\'/g, '"')))) - ) { + if ((parsedExpected = tryParseJson(js))) { + if (Array.isArray(parsedExpected)) { if (typeof parsedExpected[0] === "object") { js = JSON.stringify(parsedExpected) } else { js = parsedExpected.join(",") } } - } catch {} + } result = result.replace(/ /g, " ") expect(result).toEqual(js) }) From 50e8d53ebfbfb95cabcf42a09db3b22b9200d75f Mon Sep 17 00:00:00 2001 From: Christos Alexiou Date: Wed, 24 Jan 2024 12:24:48 +0200 Subject: [PATCH 19/19] Add TARGETBUILD to single image build script --- scripts/build-single-image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-single-image.sh b/scripts/build-single-image.sh index ba64d6121b..16b668e033 100755 --- a/scripts/build-single-image.sh +++ b/scripts/build-single-image.sh @@ -1,4 +1,4 @@ #!/bin/bash yarn build --scope @budibase/server --scope @budibase/worker version=$(./scripts/getCurrentVersion.sh) -docker build -f hosting/single/Dockerfile -t budibase:latest --build-arg BUDIBASE_VERSION=$version . +docker build -f hosting/single/Dockerfile -t budibase:latest --build-arg BUDIBASE_VERSION=$version --build-arg TARGETBUILD=single .