1
0
Fork 0
mirror of synced 2024-06-30 12:00:31 +12:00

Merge pull request #231 from Budibase/fix-dev-setup

fixed dev setup
This commit is contained in:
Martin McKeaveney 2020-05-11 16:40:45 +01:00 committed by GitHub
commit 1c1f891543
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 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/fonts.css'>
<link rel='stylesheet' href="/_builder/uikit.min.css"> <link rel='stylesheet' href="/_builder/uikit.min.css">
<link rel='stylesheet' href="/_builder/nano.min.css"> <link rel='stylesheet' href="/_builder/nano.min.css">
<script src='/_builder/pickr.min.js'></script>
</head> </head>
<body id="app"> <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 .create
const createApplication = require("@budibase/server/src/api/controllers/application") const createApplication = require("@budibase/server/src/api/controllers/application")
.create .create
const buildPage = require("@budibase/server/src/utilities/builder/buildPage")
const { copy, readJSON, writeJSON, remove, exists } = require("fs-extra") const { copy, readJSON, writeJSON, remove, exists } = require("fs-extra")
const { resolve, join } = require("path") const { resolve, join } = require("path")
const chalk = require("chalk") const chalk = require("chalk")
@ -70,14 +71,4 @@ const createEmptyAppPackage = async opts => {
packageJson.name = opts.name packageJson.name = opts.name
await writeJSON(packageJsonPath, packageJson) 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

@ -5,8 +5,6 @@ const {
budibaseAppsDir, budibaseAppsDir,
} = require("../../utilities/budibaseDir") } = require("../../utilities/budibaseDir")
const isDev = process.env.NODE_ENV !== "production"
exports.fetchAppComponentDefinitions = async function(ctx) { exports.fetchAppComponentDefinitions = async function(ctx) {
const db = new CouchDB(`client-${ctx.params.clientId}`) const db = new CouchDB(`client-${ctx.params.clientId}`)
const app = await db.get(ctx.params.appId) const app = await db.get(ctx.params.appId)
@ -19,7 +17,7 @@ exports.fetchAppComponentDefinitions = async function(ctx) {
"node_modules" "node_modules"
) )
if (isDev) { if (ctx.isDev) {
appDirectory = budibaseTempDir() appDirectory = budibaseTempDir()
} }

View file

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