diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index e49b3b37ab..70120b92fc 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -14,6 +14,13 @@ Budibase is a monorepo managed by [lerna](https://github.com/lerna/lerna). Lerna
- **packages/server** - The budibase server. This [Koa](https://koajs.com/) app is responsible for serving the JS for the builder and budibase apps, as well as providing the API for interaction with the database and file system.
+## Contributor License Agreement (CLA)
+
+In order to accept your pull request, we need you to submit a CLA. You only need to do this once. If you are submitting a pull request for the first time, just submit a Pull Request and our CLA Bot will give you instructions on how to sign the CLA before merging your Pull Request.
+
+All contributors must sign an [Individual Contributor License Agreement](https://github.com/budibase/budibase/blob/next/.github/cla/individual-cla.md).
+
+If contributing on behalf of your company, your company must sign a [Corporate Contributor License Agreement](https://github.com/budibase/budibase/blob/next/.github/cla/corporate-cla.md). If so, please contact us via community@budibase.com.
## Glossary of Terms
diff --git a/.github/cla/corporate-cla.md b/.github/cla/corporate-cla.md
new file mode 100644
index 0000000000..405ba0ee68
--- /dev/null
+++ b/.github/cla/corporate-cla.md
@@ -0,0 +1,23 @@
+# Software Grant and Corporate Contributor License Agreement ("Agreement"), v1.0
+
+You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Budibase, Inc. ("Budibase"). Except for the license granted herein to Budibase and recipients of software distributed by Budibase, You reserve all right, title, and interest in and to Your Contributions.
+
+1. Definitions.
+
+"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Budibase. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"Contribution" shall mean the code, documentation or other original works of authorship expressly identified in Schedule B, as well as any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Budibase for inclusion in, or documentation of, any of the products owned or managed by Budibase (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Budibase or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Budibase for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
+
+2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to Budibase and to recipients of software distributed by Budibase a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
+
+3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to Budibase and to recipients of software distributed by Budibase a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
+
+4. You represent that You are legally entitled to grant the above license. You represent further that each employee of the Corporation designated on Schedule A below (or in a subsequent written modification to that Schedule) is authorized to submit Contributions on behalf of the Corporation.
+
+5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others).
+
+6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
+
+7. Should You wish to submit work that is not Your original creation, You may submit it to Budibase separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
+
+8. It is your responsibility to notify Budibase when any change is required to the list of designated employees authorized to submit Contributions on behalf of the Corporation, or to the Corporation's Point of Contact with Budibase.
\ No newline at end of file
diff --git a/.github/cla/individual-cla.md b/.github/cla/individual-cla.md
new file mode 100644
index 0000000000..db4f9a2e8e
--- /dev/null
+++ b/.github/cla/individual-cla.md
@@ -0,0 +1,23 @@
+
+
+# Individual Contributor License Agreement ("Agreement"), v1.0
+
+Thank you for your interest in contributing to open-source software projects (“Projects”) made available by Budibase Inc, or its affiliates (“Budibase”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Budibase in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact community@budibase.com.
+
+You accept and agree to the following terms and conditions for Your past, present, and future Contributions submitted to Budibase, Inc. ("Budibase"). Except for the license granted herein to Budibase and recipients of software distributed by Budibase, You reserve all right, title, and interest in and to Your Contributions.
+
+1. Definitions. "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Budibase. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Budibase for inclusion in, or documentation of, any of the products owned or managed by Budibase (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Budibase or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Budibase for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
+
+2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to Budibase and to recipients of software distributed by Budibase a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
+
+3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to Budibase and to recipients of software distributed by Budibase a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes a direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
+
+4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to Budibase, or that your employer has executed a separate Corporate CLA with Budibase.
+
+5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.
+
+6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
+
+7. Should You wish to submit work that is not Your original creation, You may submit it to Budibase separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
+
+8. You agree to notify Budibase of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml
new file mode 100644
index 0000000000..c7a701535b
--- /dev/null
+++ b/.github/workflows/cla.yml
@@ -0,0 +1,36 @@
+name: "CLA Assistant"
+on:
+ issue_comment:
+ types: [created]
+ pull_request_target:
+ types: [opened,closed,synchronize]
+
+jobs:
+ CLAssistant:
+ runs-on: ubuntu-latest
+ steps:
+ - name: "CLA Assistant"
+ if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
+ # Beta Release
+ uses: cla-assistant/github-action@v2.1.2-beta
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # the below token should have repo scope and must be manually added by you in the repository's secret
+ PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
+ with:
+ path-to-signatures: '.github/cla/signatures.json'
+ path-to-document: 'https://github.com/budibase/budibase/blob/next/.github/cla/individual-cla.md' # e.g. a CLA or a DCO document
+ # branch should not be protected
+ branch: 'next'
+ allowlist: user1,bot*
+
+ #below are the optional inputs - If the optional inputs are not given, then default values will be taken
+ #remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
+ #remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
+ #create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
+ #signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
+ custom-notsigned-prcomment: '
Thank you for your submission - we really appreciate it ❤️. Like many open-source projects, we ask that $you sign a [Contributor License Agreement](https://github.com/budibase/budibase/blob/next/.github/cla/individual-cla.md) before we can accept your contribution.
You can sign the CLA by just posting a Pull Request Comment, the same as the text below.
If you are contributing on behalf of a company, your company should contact us to sign a [Corporate Contributor License Agreement](https://github.com/budibase/budibase/blob/next/.github/cla/corporate-cla.md), via community@budibase.com.'
+ #custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
+ #custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
+ #lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
+ #use-dco-flag: true - If you are using DCO instead of CLA
\ No newline at end of file
diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js
index 696d83932a..58c4d8f4b6 100644
--- a/packages/builder/src/builderStore/dataBinding.js
+++ b/packages/builder/src/builderStore/dataBinding.js
@@ -2,10 +2,7 @@ import { cloneDeep } from "lodash/fp"
import { get } from "svelte/store"
import { findComponent, findComponentPath } from "./storeUtils"
import { store } from "builderStore"
-import {
- tables as tablesStore,
- queries as queriesStores,
-} from "stores/backend"
+import { tables as tablesStore, queries as queriesStores } from "stores/backend"
import { makePropSafe } from "@budibase/string-templates"
import { TableNames } from "../constants"
diff --git a/packages/server/src/electron.js b/packages/server/src/electron.js
deleted file mode 100644
index 9b4f0092b6..0000000000
--- a/packages/server/src/electron.js
+++ /dev/null
@@ -1,222 +0,0 @@
-// const { app, BrowserWindow, shell, dialog } = require("electron")
-// const { join } = require("./utilities/centralPath")
-// const isDev = require("electron-is-dev")
-// const { autoUpdater } = require("electron-updater")
-// const unhandled = require("electron-unhandled")
-// const { existsSync } = require("fs-extra")
-// const initialiseBudibase = require("./utilities/initialiseBudibase")
-// const { budibaseAppsDir } = require("./utilities/budibaseDir")
-// const { openNewGitHubIssue, debugInfo } = require("electron-util")
-// const eventEmitter = require("./events")
-
-// const budibaseDir = budibaseAppsDir()
-// const envFile = join(budibaseDir, ".env")
-
-// async function startApp() {
-// if (!existsSync(envFile)) {
-// await initialiseBudibase({ dir: budibaseDir })
-// }
-// // evict environment from cache, so it reloads when next asked
-// delete require.cache[require.resolve("./environment")]
-// // store the port incase its going to get overridden
-// const port = process.env.PORT
-// require("dotenv").config({ path: envFile })
-// // overwrite the port - don't want to use dotenv for the port
-// require("./environment")._set("PORT", port)
-
-// unhandled({
-// showDialog: true,
-// reportButton: error => {
-// openNewGitHubIssue({
-// title: error.message,
-// user: "Budibase",
-// labels: ["error-report"],
-// repo: "budibase",
-// body: `### Error that occurred when using the budibase builder:\n\`\`\`\n${
-// error.stack
-// }\n\`\`\`\n### Operating System Information:\n---\n\n${debugInfo()}`,
-// })
-// },
-// })
-
-// let win
-
-// function handleRedirect(e, url) {
-// e.preventDefault()
-// shell.openExternal(url)
-// }
-
-// async function createWindow() {
-// app.server = require("./app")
-// eventEmitter.on("internal:port", port => {
-// const APP_URL = `http://localhost:${port}/_builder`
-// const APP_TITLE = "Budibase Builder"
-// win = new BrowserWindow({
-// width: 1920,
-// height: 1080,
-// icon: join(__dirname, "..", "build", "icons", "512x512.png"),
-// })
-// win.setTitle(APP_TITLE)
-// win.loadURL(APP_URL)
-// if (isDev) {
-// win.webContents.openDevTools()
-// } else {
-// autoUpdater.checkForUpdatesAndNotify()
-// }
-
-// // open _blank in default browser
-// win.webContents.on("new-window", handleRedirect)
-// win.webContents.on("will-navigate", handleRedirect)
-// })
-// }
-
-// app.whenReady().then(createWindow)
-
-// // Quit when all windows are closed.
-// app.on("window-all-closed", () => {
-// // On macOS it is common for applications and their menu bar
-// // to stay active until the user quits explicitly with Cmd + Q
-// if (process.platform !== "darwin") {
-// app.server.close()
-// app.quit()
-// }
-// })
-
- app.on("activate", () => {
- // On macOS it's common to re-create a window in the app when the
- // dock icon is clicked and there are no other windows open.
- if (win === null) createWindow()
- })
-
- const template = [
- // { role: 'appMenu' }
- ...(isMac
- ? [
- {
- label: app.name,
- submenu: [
- { role: "about" },
- { type: "separator" },
- { role: "services" },
- { type: "separator" },
- { role: "hide" },
- { role: "hideothers" },
- { role: "unhide" },
- { type: "separator" },
- { role: "quit" },
- ],
- },
- ]
- : []),
- // { role: 'fileMenu' }
- {
- label: "File",
- submenu: [isMac ? { role: "close" } : { role: "quit" }],
- },
- // { role: 'editMenu' }
- {
- label: "Edit",
- submenu: [
- { role: "undo" },
- { role: "redo" },
- { type: "separator" },
- { role: "cut" },
- { role: "copy" },
- { role: "paste" },
- ...(isMac
- ? [
- { role: "pasteAndMatchStyle" },
- { role: "delete" },
- { role: "selectAll" },
- { type: "separator" },
- {
- label: "Speech",
- submenu: [{ role: "startSpeaking" }, { role: "stopSpeaking" }],
- },
- ]
- : [{ role: "delete" }, { type: "separator" }, { role: "selectAll" }]),
- ],
- },
- // { role: 'viewMenu' }
- {
- label: "View",
- submenu: [
- { role: "reload" },
- { role: "forceReload" },
- { role: "toggleDevTools" },
- { type: "separator" },
- { role: "resetZoom" },
- { role: "zoomIn" },
- { role: "zoomOut" },
- { type: "separator" },
- { role: "togglefullscreen" },
- ],
- },
- // { role: 'windowMenu' }
- {
- label: "Window",
- submenu: [
- { role: "minimize" },
- { role: "zoom" },
- ...(isMac
- ? [
- { type: "separator" },
- { role: "front" },
- { type: "separator" },
- { role: "window" },
- ]
- : [{ role: "close" }]),
- ],
- },
- {
- role: "help",
- submenu: [
- {
- label: "Learn More",
- click: () => shell.openExternal("https://www.budibase.com/"),
- },
- {
- label: "Documentation",
- click: () => shell.openExternal("https://docs.budibase.com/"),
- },
- {
- label: "Search issues",
- click: () =>
- shell.openExternal("https://github.com/Budibase/budibase/issues"),
- },
- {
- label: "Community discussions",
- click: () =>
- shell.openExternal(
- "https://github.com/Budibase/budibase/discussions"
- ),
- },
- ],
- },
- ]
-
- const menu = Menu.buildFromTemplate(template)
- Menu.setApplicationMenu(menu)
-}
-
-// autoUpdater.on("update-downloaded", (event, releaseNotes, releaseName) => {
-// const dialogOpts = {
-// type: "info",
-// buttons: ["Restart", "Later"],
-// title: "Budibase Update Available",
-// message: process.platform === "win32" ? releaseNotes : releaseName,
-// detail:
-// "A new version of the budibase builder has been downloaded. Restart the application to apply the updates.",
-// }
-
-// dialog.showMessageBox(dialogOpts).then(returnValue => {
-// if (returnValue.response === 0) autoUpdater.quitAndInstall()
-// })
-// })
-
-// autoUpdater.on("error", message => {
-// console.error("There was a problem updating the application")
-// console.error(message)
-// })
-
-// startApp()