From 594b7c2cce66d7a4e868a075e1bf773b5e7f7fa6 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 15 Jun 2020 17:06:54 +0100 Subject: [PATCH 1/2] budibase dockerfile --- packages/server/Dockerfile | 11 +++++++++++ packages/server/package.json | 1 + packages/server/src/index.js | 13 +++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 packages/server/Dockerfile create mode 100644 packages/server/src/index.js diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile new file mode 100644 index 0000000000..7ae24dfd62 --- /dev/null +++ b/packages/server/Dockerfile @@ -0,0 +1,11 @@ +FROM node:12-alpine + +WORKDIR /app + +# copy files and install dependencies +COPY . ./ +RUN yarn + +EXPOSE 4001 + +CMD ["yarn", "run:docker"] diff --git a/packages/server/package.json b/packages/server/package.json index 49a5626f6f..ad89654b0e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -27,6 +27,7 @@ "test:integration": "jest workflow --runInBand", "test:watch": "jest --watch", "initialise": "node ../cli/bin/budi init -b local -q", + "run:docker": "node src/index", "budi": "node ../cli/bin/budi", "dev:builder": "nodemon ../cli/bin/budi run", "electron": "electron src/electron.js", diff --git a/packages/server/src/index.js b/packages/server/src/index.js new file mode 100644 index 0000000000..89f61d2f22 --- /dev/null +++ b/packages/server/src/index.js @@ -0,0 +1,13 @@ +const { resolve } = require("path") + +async function runServer() { + const budibaseDir = "~/.budibase"; + + process.env.BUDIBASE_DIR = resolve(budibaseDir) + + const server = await require("./app")(); + server.on("close", () => console.log("Server Closed")) + console.log(`Budibase running on ${JSON.stringify(server.address())}`) +} + +runServer(); \ No newline at end of file From 34b27b83bba5f12993ac28984330d0f71a2fd10a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 15 Jun 2020 17:08:59 +0100 Subject: [PATCH 2/2] lint :sparkles: --- .../ComponentPropertiesPanel.svelte | 7 ++++--- .../userInterface/SettingsView.svelte | 21 +++++++++---------- packages/server/src/index.js | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte index bcebb4d2d4..e0a5de3fdb 100644 --- a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte +++ b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte @@ -39,8 +39,9 @@ let panelDefinition = {} - $: panelDefinition = componentPropDefinition.properties && - componentPropDefinition.properties[selectedCategory.value] + $: panelDefinition = + componentPropDefinition.properties && + componentPropDefinition.properties[selectedCategory.value] const onStyleChanged = store.setComponentStyle const onPropChanged = store.setComponentProp @@ -88,7 +89,7 @@ {panelDefinition} onChange={onPropChanged} onScreenPropChange={store.setPageOrScreenProp} - screenOrPageInstance={$store.currentView !== "component" && $store.currentPreviewItem} /> + screenOrPageInstance={$store.currentView !== 'component' && $store.currentPreviewItem} /> {:else if selectedCategory.value === 'events'} {/if} diff --git a/packages/builder/src/components/userInterface/SettingsView.svelte b/packages/builder/src/components/userInterface/SettingsView.svelte index 17e4fe5e71..fdcb286434 100644 --- a/packages/builder/src/components/userInterface/SettingsView.svelte +++ b/packages/builder/src/components/userInterface/SettingsView.svelte @@ -19,9 +19,9 @@ data.target ? onChange(key, data.target.value) : onChange(key, data) } - function handleScreenPropChange (name, value) { - onScreenPropChange(name,value) - if(!isPage && name === "name") { + function handleScreenPropChange(name, value) { + onScreenPropChange(name, value) + if (!isPage && name === "name") { // screen name is changed... change URL $goto(`./:page/${value}`) } @@ -40,20 +40,19 @@ $: isPage = screenOrPageInstance && screenOrPageInstance.favicon $: screenOrPageDefinition = isPage ? pageDefinition : screenDefinition - {#if screenOrPageInstance} {#each screenOrPageDefinition as def} + control={def.control} + label={def.label} + key={def.key} + value={screenOrPageInstance[def.key]} + onChange={handleScreenPropChange} + props={{ ...excludeProps(def, ['control', 'label']) }} /> {/each} -
+
{/if} {#if panelDefinition && panelDefinition.length > 0} diff --git a/packages/server/src/index.js b/packages/server/src/index.js index 89f61d2f22..9b4c323104 100644 --- a/packages/server/src/index.js +++ b/packages/server/src/index.js @@ -1,13 +1,13 @@ const { resolve } = require("path") async function runServer() { - const budibaseDir = "~/.budibase"; + const budibaseDir = "~/.budibase" process.env.BUDIBASE_DIR = resolve(budibaseDir) - const server = await require("./app")(); + const server = await require("./app")() server.on("close", () => console.log("Server Closed")) console.log(`Budibase running on ${JSON.stringify(server.address())}`) } -runServer(); \ No newline at end of file +runServer()