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"
28 lines
908 B
JavaScript
28 lines
908 B
JavaScript
const getPages = require("./getPages")
|
|
const { appPackageFolder } = require("../createAppPackage")
|
|
const { writeJSON, writeFile } = require("fs-extra")
|
|
const { join } = require("path")
|
|
const publicPath = require("./publicPath")
|
|
|
|
module.exports = async (config, appname, appDefinition, accessLevels) => {
|
|
const appPath = appPackageFolder(config, appname)
|
|
|
|
await writeJSON(`${appPath}/appDefinition.json`, appDefinition, {
|
|
spaces: 2,
|
|
})
|
|
|
|
await writeJSON(`${appPath}/access_levels.json`, accessLevels, {
|
|
spaces: 2,
|
|
})
|
|
|
|
const pages = await getPages(appPath)
|
|
for (let pageName in pages) {
|
|
const pagePublicPath = publicPath(appPath, pageName)
|
|
const filename = join(pagePublicPath, "clientBackendDefinition.js")
|
|
const appDefString = JSON.stringify(appDefinition)
|
|
await writeFile(
|
|
filename,
|
|
`window['##BUDIBASE_BACKEND_DEFINITION##'] = ${appDefString};`
|
|
)
|
|
}
|
|
}
|