fixed dev setup

This commit is contained in:
Martin McKeaveney 2020-05-11 16:01:02 +01:00
parent 6fac98074d
commit cc30913e34
9 changed files with 13 additions and 30 deletions

View File

@ -16,7 +16,6 @@
<link rel='stylesheet' href='/_builder/fonts.css'>
<link rel='stylesheet' href="/_builder/uikit.min.css">
<link rel='stylesheet' href="/_builder/nano.min.css">
<script src='/_builder/pickr.min.js'></script>
</head>
<body id="app">

View File

@ -1 +0,0 @@
whats the craic big lawd ?

View File

@ -4,6 +4,7 @@ const createInstance = require("@budibase/server/src/api/controllers/instance")
.create
const createApplication = require("@budibase/server/src/api/controllers/application")
.create
const buildPage = require("@budibase/server/src/utilities/builder/buildPage")
const { copy, readJSON, writeJSON, remove, exists } = require("fs-extra")
const { resolve, join } = require("path")
const chalk = require("chalk")
@ -70,14 +71,4 @@ const createEmptyAppPackage = async opts => {
packageJson.name = opts.name
await writeJSON(packageJsonPath, packageJson)
const removePlaceholder = async (...args) => {
await remove(join(newAppFolder, ...args, "placeholder"))
}
await removePlaceholder("pages", "main", "screens")
await removePlaceholder("pages", "unauthenticated", "screens")
await removePlaceholder("public", "shared")
await removePlaceholder("public", "main")
await removePlaceholder("public", "unauthenticated")
}
}

File diff suppressed because one or more lines are too long

View File

@ -2,8 +2,6 @@ const CouchDB = require("../../db")
const { homedir } = require("os")
const { resolve, join } = require("path")
const isDev = process.env.NODE_ENV !== "production"
exports.fetchAppComponentDefinitions = async function(ctx) {
const db = new CouchDB(`client-${ctx.params.clientId}`)
const app = await db.get(ctx.params.appId)
@ -17,7 +15,7 @@ exports.fetchAppComponentDefinitions = async function(ctx) {
"node_modules"
)
if (isDev) {
if (ctx.isDev) {
appDirectory = "/tmp/.budibase"
}

View File

@ -12,16 +12,16 @@ const { convertCssToFiles } = require("./convertCssToFiles")
const publicPath = require("./publicPath")
const deleteCodeMeta = require("./deleteCodeMeta")
module.exports = async (config, appname, pageName, pkg) => {
const appPath = appPackageFolder(config, appname)
module.exports = async (config, appId, pageName, pkg) => {
const appPath = appPackageFolder(config, appId)
pkg.screens = pkg.screens || []
await convertCssToFiles(publicPath(appPath, pageName), pkg)
await buildIndexHtml(config, appname, pageName, appPath, pkg)
await buildIndexHtml(config, appId, pageName, appPath, pkg)
await buildFrontendAppDefinition(config, appname, pageName, pkg, appPath)
await buildFrontendAppDefinition(config, appId, pageName, pkg, appPath)
await copyClientLib(appPath, pageName)
@ -44,12 +44,12 @@ const copyClientLib = async (appPath, pageName) => {
)
}
const buildIndexHtml = async (config, appname, pageName, appPath, pkg) => {
const buildIndexHtml = async (config, appId, pageName, appPath, pkg) => {
const appPublicPath = publicPath(appPath, pageName)
const appRootPath = appname
const appRootPath = appId
const stylesheetUrl = s =>
s.startsWith("http") ? s : `/${rootPath(config, appname)}/${s}`
s.startsWith("http") ? s : `/${rootPath(config, appId)}/${s}`
const templateObj = {
title: pkg.page.title || "Budibase App",
@ -72,10 +72,10 @@ const buildIndexHtml = async (config, appname, pageName, appPath, pkg) => {
await writeFile(indexHtmlPath, indexHtml, { flag: "w+" })
}
const buildFrontendAppDefinition = async (config, appname, pageName, pkg) => {
const appPath = appPackageFolder(config, appname)
const buildFrontendAppDefinition = async (config, appId, pageName, pkg) => {
const appPath = appPackageFolder(config, appId)
const appPublicPath = publicPath(appPath, pageName)
const appRootPath = rootPath(config, appname)
const appRootPath = rootPath(config, appId)
const filename = join(appPublicPath, "clientFrontendDefinition.js")