Lots of poking around to get apps to run, plux fixing tests (#92)

ixing broken tests on client
typo in buildPage.js
fixing some server tests
local datastore uses fs-extra remove, not rmdir
client - loadBudibase - no longer destructuring arg
updated publishdev script for client (reads apps)
prettier fix
some little bug fixes
bugfix - set screens to empty array when falsy
typo in template page.json
replaced "Shard Factor" for "Estimated Count"
This commit is contained in:
Michael Shanks 2020-02-12 12:45:24 +00:00 committed by GitHub
parent 0af15bd7d8
commit c3fa212b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 164 additions and 304 deletions

View File

@ -99,7 +99,7 @@
<Textbox label="Name:" bind:text={record.name} on:change={nameChanged} />
{#if !record.isSingle}
<Textbox label="Collection Name:" bind:text={record.collectionName} />
<Textbox label="Shard Factor:" bind:text={record.allidsShardFactor} />
<Textbox label="Estimated Record Count:" bind:text={record.estimatedRecordCount} />
{/if}
<div class="recordkey">{record.nodeKey()}</div>

View File

@ -9,7 +9,7 @@
"request": "launch",
"name": "init",
"program": "${workspaceFolder}\\bin\\budi",
"args": ["init"],
"args": ["init", "--config", "dev"],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/sandbox"
},

View File

@ -1,3 +1,3 @@
#!/usr/bin/env node
require('../src/cli')();
require("../src/cli")()

View File

@ -51,8 +51,7 @@ const prompts = async opts => {
mask: "*",
})
if (password !== passwordConfirm)
throw new Exception("Passwords do not match!")
if (password !== passwordConfirm) throw new Error("Passwords do not match!")
opts.password = password
}

View File

@ -9,7 +9,7 @@
"_id": 0,
"_styles": {
"layout": {},
"positions": {}
"position": {}
},
"_code": ""
},

View File

@ -9,7 +9,7 @@
"_id": 1,
"_styles": {
"layout": {},
"positions": {}
"position": {}
},
"_code": ""
},

View File

@ -1,6 +1,7 @@
const { readdir, stat, copyFile } = require("fs-extra")
const { constants } = require("fs")
const { join, basename } = require("path")
const serverConfig = require("../../server/config")()
const packagesFolder = ".."
@ -9,7 +10,11 @@ const jsMapFile = dir => join(dir, "budibase-client.js.map")
const sourceJs = jsFile("dist")
const sourceJsMap = jsMapFile("dist")
const appPackages = join(packagesFolder, "server", "appPackages")
const appPackages = join(
packagesFolder,
"server",
serverConfig.latestPackagesFolder
)
const publicMain = appName => join(appPackages, appName, "public", "main")
const publicUnauth = appName =>
@ -34,10 +39,11 @@ const nodeModules = appName =>
const copySourceJsMap = copySource(sourceJsMap)
for (let app of apps) {
if (app === ".data") continue
if (!(await stat(join(appPackages, app))).isDirectory()) continue
await copySourceJs(nodeModules(app))
await copySourceJsMap(nodeModules(app))
//await copySourceJs(nodeModules(app))
//await copySourceJsMap(nodeModules(app))
await copySourceJs(publicMain(app))
await copySourceJsMap(publicMain(app))

View File

@ -14,8 +14,7 @@ export const createApp = (
frontendDefinition,
backendDefinition,
user,
uiFunctions,
screens
uiFunctions
) => {
const coreApi = createCoreApi(backendDefinition, user)
backendDefinition.hierarchy = coreApi.templateApi.constructHierarchy(
@ -74,7 +73,7 @@ export const createApp = (
currentUrl = url
}
routeTo = screenRouter(screens, onScreenSelected)
routeTo = screenRouter(frontendDefinition.screens, onScreenSelected)
routeTo(currentUrl || window.location.pathname)
}

View File

@ -2,20 +2,17 @@ import { createApp } from "./createApp"
import { trimSlash } from "./common/trimSlash"
import { builtins, builtinLibName } from "./render/builtinComponents"
export const loadBudibase = async ({
componentLibraries,
page,
screens,
window,
localStorage,
uiFunctions,
}) => {
const backendDefinition = window["##BUDIBASE_BACKEND_DEFINITION##"]
const frontendDefinition = window["##BUDIBASE_FRONTEND_DEFINITION##"]
const uiFunctionsFromWindow = window["##BUDIBASE_FRONTEND_FUNCTIONS##"]
uiFunctions = uiFunctionsFromWindow || uiFunctions
export const loadBudibase = async (opts) => {
const userFromStorage = localStorage.getItem("budibase:user")
let componentLibraries = opts && opts.componentLibraries
const _window = (opts && opts.window) || window
const _localStorage = (opts && opts.localStorage) || localStorage
const backendDefinition = _window["##BUDIBASE_BACKEND_DEFINITION##"]
const frontendDefinition = _window["##BUDIBASE_FRONTEND_DEFINITION##"]
const uiFunctions = _window["##BUDIBASE_FRONTEND_FUNCTIONS##"]
const userFromStorage = _localStorage.getItem("budibase:user")
const user = userFromStorage
? JSON.parse(userFromStorage)
@ -43,32 +40,23 @@ export const loadBudibase = async ({
}
}
componentLibraries[builtinLibName] = builtins(window)
if (!page) {
page = frontendDefinition.page
}
if (!screens) {
screens = frontendDefinition.screens
}
componentLibraries[builtinLibName] = builtins(_window)
const { initialisePage, screenStore, pageStore, routeTo, rootNode } = createApp(
window.document,
_window.document,
componentLibraries,
frontendDefinition,
backendDefinition,
user,
uiFunctions || {},
screens
uiFunctions || {}
)
const route = window.location
? window.location.pathname.replace(rootPath, "")
const route = _window.location
? _window.location.pathname.replace(rootPath, "")
: "";
return {
rootNode: initialisePage(page, window.document.body, route),
rootNode: initialisePage(frontendDefinition.page, _window.document.body, route),
screenStore,
pageStore,
routeTo,

View File

@ -10,15 +10,33 @@ export const load = async (page, screens = [], url = "/") => {
autoAssignIds(s.props)
}
setAppDef(dom.window, page, screens)
addWindowGlobals(dom.window, page, screens, uiFunctions, {
hierarchy: {},
actions: [],
triggers: [],
})
const app = await loadBudibase({
componentLibraries: allLibs(dom.window),
window: dom.window,
localStorage: createLocalStorage(),
})
return { dom, app }
}
const addWindowGlobals = (
window,
page,
screens,
uiFunctions,
})
return { dom, app }
appDefinition
) => {
window["##BUDIBASE_BACKEND_DEFINITION##"] = appDefinition
window["##BUDIBASE_FRONTEND_DEFINITION##"] = {
page,
screens,
appRootPath: "",
}
window["##BUDIBASE_FRONTEND_FUNCTIONS##"] = uiFunctions
}
export const makePage = props => ({ props })

View File

@ -1,26 +1,28 @@
const { promisify } = require("util")
const fs = require("fs")
const {
access,
mkdir,
remove,
unlink,
readdir,
rename,
stat,
readFile,
writeFile,
} = require("fs-extra")
const { join } = require("path")
const { createReadStream, createWriteStream } = require("fs")
const readFile = promisify(fs.readFile)
const writeFile = (path, content, overwrite) =>
promisify(fs.writeFile)(path, content, {
const _writeFile = (path, content, overwrite) =>
writeFile(path, content, {
encoding: "utf8",
flag: overwrite ? "w" : "wx",
})
const access = promisify(fs.access)
const mkdir = promisify(fs.mkdir)
const rmdir = promisify(fs.rmdir)
const unlink = promisify(fs.unlink)
const readdir = promisify(fs.readdir)
const rename = promisify(fs.rename)
const stat = promisify(fs.stat)
const updateFile = root => async (path, file) =>
await writeFile(join(root, path), file, true)
await _writeFile(join(root, path), file, true)
const createFile = root => async (path, file) =>
await writeFile(join(root, path), file, false)
await _writeFile(join(root, path), file, false)
const loadFile = root => async path => await readFile(join(root, path), "utf8")
@ -39,14 +41,14 @@ const deleteFile = root => async path => await unlink(join(root, path))
module.exports.deleteFile = deleteFile
const deleteFolder = root => async path => await rmdir(join(root, path))
const deleteFolder = root => async path => await remove(join(root, path))
const readableFileStream = root => async path =>
fs.createReadStream(join(root, path))
createReadStream(join(root, path))
const writableFileStream = root => path =>
new Promise((resolve, reject) => {
const stream = fs.createWriteStream(join(root, path), "utf8")
const stream = createWriteStream(join(root, path), "utf8")
stream.on("open", () => resolve(stream))
stream.on("error", reject)
})
@ -72,7 +74,8 @@ const getDatastoreConfig = rootConfig => (applicationId, instanceId) =>
join(rootConfig.rootPath, datastoreFolder(applicationId, instanceId))
const getMasterDbRootConfig = rootConfig => () => rootConfig.rootPath
const getInstanceDbRootConfig = rootConfig => (applicationId, instanceId) =>
// eslint-disable-next-line no-unused-vars
const getInstanceDbRootConfig = rootConfig => (_applicationId, _instanceId) =>
rootConfig.rootPath
const getDbRootConfig = (rootConfig, applicationId, instanceId) =>
applicationId === "master"

View File

@ -29,6 +29,7 @@
"@babel/preset-env": "^7.1.0",
"@budibase/core": "^0.0.16",
"es6-promisify": "^6.0.1",
"fs-extra": "^8.1.0",
"lodash": "^4.17.13",
"p-limit": "^2.0.0",
"papaparse": "^4.6.1",

View File

@ -573,6 +573,23 @@
lodash "^4.17.10"
to-fast-properties "^2.0.0"
"@budibase/core@^0.0.16":
version "0.0.16"
resolved "https://registry.yarnpkg.com/@budibase/core/-/core-0.0.16.tgz#efff16876f906b2aa59803c3312ec7593664b623"
integrity sha512-DvzfurHHp9KkSjkvbGbKsVczR5ne38bMLRA2hHEJxAmC0Tshld06cEq7HMy2BmPb6kaC1URYHlFs/gPhW2cSFQ==
dependencies:
"@nx-js/compiler-util" "^2.0.0"
date-fns "^1.29.0"
lodash "^4.17.13"
lunr "^2.3.5"
safe-buffer "^5.1.2"
shortid "^2.2.8"
"@nx-js/compiler-util@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@nx-js/compiler-util/-/compiler-util-2.0.0.tgz#c74c12165fa2f017a292bb79af007e8fce0af297"
integrity sha512-AxSQbwj9zqt8DYPZ6LwZdytqnwfiOEdcFdq4l8sdjkZmU2clTht7RDLCI8xvkp7KqgcNaOGlTeCM55TULWruyQ==
"@types/body-parser@*":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.17.0.tgz#9f5c9d9bd04bb54be32d5eb9fc0d8c974e6cf58c"
@ -894,6 +911,11 @@ core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
date-fns@^1.29.0:
version "1.30.1"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c"
integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==
debug@=3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
@ -1059,6 +1081,15 @@ fragment-cache@^0.2.1:
dependencies:
map-cache "^0.2.2"
fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^4.0.0"
universalify "^0.1.0"
fs-minipass@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d"
@ -1123,6 +1154,11 @@ graceful-fs@^4.1.11:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.3"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==
has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
@ -1349,6 +1385,13 @@ json5@^0.5.0:
version "0.5.1"
resolved "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
optionalDependencies:
graceful-fs "^4.1.6"
kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
version "3.2.2"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
@ -1395,6 +1438,11 @@ loose-envify@^1.0.0:
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
lunr@^2.3.5:
version "2.3.8"
resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.8.tgz#a8b89c31f30b5a044b97d2d28e2da191b6ba2072"
integrity sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==
make-dir@^1.0.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
@ -1508,6 +1556,11 @@ nan@^2.9.2:
version "2.11.1"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766"
nanoid@^2.1.0:
version "2.1.11"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280"
integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==
nanomatch@^1.2.9:
version "1.2.13"
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
@ -1893,6 +1946,13 @@ set-value@^2.0.0:
is-plain-object "^2.0.3"
split-string "^3.0.1"
shortid@^2.2.8:
version "2.2.15"
resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.15.tgz#2b902eaa93a69b11120373cd42a1f1fe4437c122"
integrity sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==
dependencies:
nanoid "^2.1.0"
signal-exit@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
@ -2094,6 +2154,11 @@ union-value@^1.0.0:
is-extendable "^0.1.1"
set-value "^0.4.3"
universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
unset-value@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"

View File

@ -504,243 +504,24 @@
"condition": "context.record.type === \"user\" && context.record.createdByMaster === true"
}
],
"actions": {
"initialise_instance": {
"actions": [
{
"name": "initialise_instance",
"behaviourSource": "main",
"behaviourName": "initialiseInstance",
"initialOptions": {}
},
"create_user": {
{
"name": "create_user",
"behaviourSource": "main",
"behaviourName": "createNewUser",
"initialOptions": {}
},
"set_default_version": {
{
"name": "set_default_version",
"behaviourSource": "main",
"behaviourName": "setDefaultVersion",
"initialOptions": {}
}
},
"props": {
"main": {
"_component": "@budibase/standard-components/stackpanel",
"direction": "horizontal",
"children": [
{
"_component": "children#array_element#",
"control": {
"_component": "@budibase/standard-components/panel",
"text": "Create New",
"component": {
"_component": ""
},
"containerClass": "",
"background": "",
"border": "1px solid black",
"borderRadius": "2px",
"font": "",
"color": "",
"padding": "10px",
"margin": "20px",
"hoverColor": "",
"hoverBackground": "gainsboro",
"height": "100px",
"width": "100px",
"onClick": [
{
"##eventHandlerType": "Get New Record",
"parameters": {
"collectionKey": "/applications",
"childRecordType": "application",
"statePath": "currentApplication"
}
}
],
"display": "inline"
}
}
],
"width": "auto",
"height": "auto",
"containerClass": "",
"itemContainerClass": "",
"data": {
"##bbstate": "allApplications",
"##bbsource": "store"
},
"dataItemComponent": {
"_component": "@budibase/standard-components/panel",
"text": "",
"component": {
"_component": "@budibase/standard-components/stackpanel",
"direction": "horizontal",
"children": [
{
"_component": "children#array_element#",
"control": {
"_component": "@budibase/standard-components/text",
"value": "",
"containerClass": "",
"font": "",
"color": "",
"textAlign": "inline",
"verticalAlign": "inline",
"display": "inline"
}
}
],
"width": "auto",
"height": "auto",
"containerClass": "",
"itemContainerClass": "",
"data": {
"##bbstate": ""
},
"dataItemComponent": {
"_component": ""
},
"onLoad": []
},
"containerClass": "",
"background": "",
"border": "1px solid dimgray",
"borderRadius": "2px",
"font": "",
"color": "black",
"padding": "10px",
"margin": "20px",
"hoverColor": "",
"hoverBackground": "",
"height": "",
"width": "",
"onClick": [
{
"##eventHandlerType": "Load Record",
"parameters": {
"recordKey": {
"##bbstate": "key",
"##bbsource": "context"
},
"statePath": "currentApp"
}
}
],
"display": "inline"
},
"onLoad": [
{
"##eventHandlerType": "List Records",
"parameters": {
"indexKey": "/all_applications",
"statePath": "allApplications"
}
}
],
"component": {
"_component": "@budibase/standard-components/stackpanel",
"direction": "horizontal",
"children": [
{
"_component": "#children#array_element",
"control": {
"_component": "@budibase/standard-components/text",
"value": "",
"containerClass": "",
"font": "",
"color": "",
"textAlign": "inline",
"verticalAlign": "inline",
"display": "inline"
}
}
],
"width": "auto",
"height": "auto",
"containerClass": "",
"itemContainerClass": "",
"data": {
"##bbstate": "allApplications",
"##bbsource": "store"
},
"dataItemComponent": {
"_component": "apps/Application List Item",
"text": {
"##bbstate": "name",
"##bbstatefallback": "My App Name",
"##bbsource": "context"
},
"component": {
"_component": "@budibase/standard-components/stackpanel",
"direction": "horizontal",
"children": [
{
"_component": "#children#array_element",
"control": {
"_component": "@budibase/standard-components/text",
"value": "",
"containerClass": "",
"font": "",
"color": "",
"textAlign": "inline",
"verticalAlign": "inline",
"display": "inline"
}
}
],
"width": "auto",
"height": "auto",
"containerClass": "",
"itemContainerClass": "",
"data": {
"##bbstate": "allApplications",
"##bbsource": "store"
},
"dataItemComponent": {
"_component": ""
},
"onLoad": []
},
"containerClass": "",
"background": "",
"border": "1px solid dimgray",
"borderRadius": "2px",
"font": "",
"color": "black",
"padding": "10px",
"margin": "20px",
"hoverColor": "",
"hoverBackground": "",
"height": "",
"width": "",
"onClick": [
{
"##eventHandlerType": "Load Record",
"parameters": {
"recordKey": {
"##bbstate": "key",
"##bbsource": "context"
},
"statePath": "currentApplication"
}
}
],
"display": ""
},
"onLoad": []
}
},
"unauthenticated": {
"_component": "@budibase/standard-components/login",
"logo": "_shared/budibase-logo.png",
"loginRedirect": "",
"usernameLabel": "Username",
"passwordLabel": "Password",
"loginButtonLabel": "Login",
"buttonClass": "",
"inputClass": ""
}
}
]
}

View File

@ -1,7 +1,7 @@
const { tmpdir } = require("os")
const { join } = require("path")
const uuid = require("uuid/v1")
const { take, takeRight, last } = require("lodash/fp")
const { take } = require("lodash/fp")
const { splitKey, $, joinKey } = require("@budibase/core").common
const {
unzipTarGzPackageToRuntime,

View File

@ -73,14 +73,14 @@
"condition": ""
}
],
"actions": {
"output_to_file": {
"actions": [
{
"name": "output_to_file",
"behaviourSource": "main",
"behaviourName": "outputToFile",
"initialOptions": {}
}
},
],
"props": {
"main": {
"_component": "some_component"

View File

@ -22,12 +22,12 @@ const extraMasterPlugins = {
}
const customizeMaster = appDefinition => {
appDefinition.actions.outputToFile = {
appDefinition.actions.push({
name: "outputToFile",
behaviourSource: "test_plugins",
behaviourName: "outputToFile",
initialOptions: {},
}
})
appDefinition.triggers.push({
actionName: "outputToFile",

View File

@ -18,6 +18,8 @@ const publicPath = require("./publicPath")
module.exports = async (config, appname, pageName, pkg) => {
const appPath = appPackageFolder(config, appname)
pkg.screens = pkg.screens || []
await convertCssToFiles(publicPath(appPath, pageName), pkg)
await buildIndexHtml(config, appname, pageName, appPath, pkg)
@ -133,7 +135,7 @@ const buildFrontendAppDefinition = async (config, appname, pageName, pkg) => {
await writeFile(
filename,
`window['##BUDIBASE_FRONTEND_DEINITION##'] = ${clientUiDefinition};
`window['##BUDIBASE_FRONTEND_DEFINITION##'] = ${clientUiDefinition};
window['##BUDIBASE_FRONTEND_FUNCTIONS##'] = ${pkg.uiFunctions}`
)
}

View File

@ -7,7 +7,7 @@ module.exports.convertCssToFiles = async (publicPagePath, pkg) => {
await ensureDir(cssDir)
await emptyDir(cssDir)
for (let screen of pkg.screens) {
for (let screen of pkg.screens || []) {
if (!screen._css) continue
if (screen._css.trim().length === 0) {
delete screen._css

View File

@ -22,7 +22,7 @@ module.exports = async (config, appname, appDefinition, accessLevels) => {
const appDefString = JSON.stringify(appDefinition)
await writeFile(
filename,
`window['##BUDIBASE_FRONTEND_DEINITION##'] = ${appDefString};`
`window['##BUDIBASE_BACKEND_DEFINITION##'] = ${appDefString};`
)
}
}

View File

@ -40,24 +40,24 @@ const createTriggers = appPackage => {
const createActions = appPackage => {
const appDef = appPackage.appDefinition
appDef.actions.createUser = {
appDef.actions.push({
name: "createUser",
behaviourSource: "_injected",
behaviourName: "createUser",
initialOptions: {},
}
appDef.actions.enableUser = {
})
appDef.actions.push({
name: "enableUser",
behaviourSource: "_injected",
behaviourName: "enableUser",
initialOptions: {},
}
appDef.actions.disableUser = {
})
appDef.actions.push({
name: "disableUser",
behaviourSource: "_injected",
behaviourName: "disableUser",
initialOptions: {},
}
})
}
const constructPlugin = async (masterAppInternal, appName, instanceKey) => {

View File

@ -88,9 +88,7 @@ module.exports = async context => {
const createAppUser = async (appname, instance, user, password) => {
if (isMaster(appname)) {
throw new Exception(
"This method is for creating app users - not on master!"
)
throw new Error("This method is for creating app users - not on master!")
}
const versionId = determineVersionId(instance.version)