From 1b920a2f168a809504d98c72102f440897739229 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 24 May 2021 19:49:34 +0100 Subject: [PATCH] remove public folder concept, upload client lib directly --- .../builder/auth/_components/GoogleButton.svelte | 14 +++++++------- packages/server/src/utilities/fileSystem/index.js | 6 ++++-- packages/server/src/utilities/fileSystem/newApp.js | 5 ++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte b/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte index 3eaf048872..c9c459b1f3 100644 --- a/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte +++ b/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte @@ -10,13 +10,13 @@ {#if show} - - -
- google icon -

Sign in with Google

-
-
+ window.open("/api/admin/auth/google", "_blank")} + > +
+ google icon +

Sign in with Google

+
{/if} diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index d84c6deb8a..0e267b3613 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -12,8 +12,9 @@ const { streamUpload, deleteFolder, downloadTarball, + uploadDirectory, } = require("./utilities") -const { downloadLibraries, newAppPublicPath } = require("./newApp") +const { downloadLibraries, uploadClientLibrary } = require("./newApp") const download = require("download") const env = require("../../environment") const { homedir } = require("os") @@ -134,7 +135,8 @@ exports.performBackup = async (appId, backupName) => { */ exports.createApp = async appId => { await downloadLibraries(appId) - await newAppPublicPath(appId) + await uploadClientLibrary(appId) + await uploadDirectory(ObjectStoreBuckets.APPS, NODE_MODULES_PATH, appId) } /** diff --git a/packages/server/src/utilities/fileSystem/newApp.js b/packages/server/src/utilities/fileSystem/newApp.js index 91cc771743..22113757c9 100644 --- a/packages/server/src/utilities/fileSystem/newApp.js +++ b/packages/server/src/utilities/fileSystem/newApp.js @@ -26,10 +26,9 @@ exports.downloadLibraries = async appId => { return paths } -exports.newAppPublicPath = async appId => { - const path = join(appId, "public") +exports.uploadClientLibrary = async appId => { const sourcepath = require.resolve("@budibase/client") - const destPath = join(path, "budibase-client.js") + const destPath = join(appId, "budibase-client.js") await streamUpload(BUCKET_NAME, destPath, fs.createReadStream(sourcepath)) }