remove superfluous files

This commit is contained in:
Martin McKeaveney 2020-11-06 13:46:19 +00:00
parent aab4f60d76
commit 596940371e
8 changed files with 3 additions and 183 deletions

View File

@ -1,10 +1,4 @@
import { import { getBuiltin } from "components/userInterface/pagesParsing/createProps"
makePropsSafe,
getBuiltin,
} from "components/userInterface/pagesParsing/createProps"
import api from "./api"
import { store } from "builderStore"
import { generate_screen_css } from "./generate_css"
import { uuid } from "./uuid" import { uuid } from "./uuid"
import getNewComponentName from "./getNewComponentName" import getNewComponentName from "./getNewComponentName"

View File

@ -1,5 +1,5 @@
const CouchDB = require("../../db") const CouchDB = require("../../db")
const { compileStaticAssetsForPage } = require("../../utilities/builder") const compileStaticAssetsForPage = require("../../utilities/builder/compileStaticAssetsForPage")
const env = require("../../environment") const env = require("../../environment")
const { existsSync } = require("fs-extra") const { existsSync } = require("fs-extra")
const { budibaseAppsDir } = require("../../utilities/budibaseDir") const { budibaseAppsDir } = require("../../utilities/budibaseDir")

View File

@ -1,6 +1,6 @@
const CouchDB = require("../../db/client") const CouchDB = require("../../db/client")
const { generatePageID } = require("../../db/utils") const { generatePageID } = require("../../db/utils")
const { compileStaticAssetsForPage } = require("../../utilities/builder") const compileStaticAssetsForPage = require("../../utilities/builder/compileStaticAssetsForPage")
exports.save = async function(ctx) { exports.save = async function(ctx) {
const db = new CouchDB(ctx.user.appId) const db = new CouchDB(ctx.user.appId)

View File

@ -17,12 +17,8 @@ module.exports = async (appId, pageName, pkg) => {
await buildFrontendAppDefinition(appId, pageName, pkg, appPath) await buildFrontendAppDefinition(appId, pageName, pkg, appPath)
await copyClientLib(appPath, pageName) await copyClientLib(appPath, pageName)
// await savePageJson(appPath, pageName, pkg)
} }
// const rootPath = (config, appId) => (config.useAppRootPath ? `/${appId}` : "")
const copyClientLib = async (appPath, pageName) => { const copyClientLib = async (appPath, pageName) => {
const sourcepath = require.resolve("@budibase/client") const sourcepath = require.resolve("@budibase/client")
const destPath = join(publicPath(appPath, pageName), "budibase-client.js") const destPath = join(publicPath(appPath, pageName), "budibase-client.js")
@ -96,23 +92,3 @@ const buildFrontendAppDefinition = async (appId, pageName, pkg) => {
` `
) )
} }
// const savePageJson = async (appPath, pageName, pkg) => {
// const pageFile = join(appPath, "pages", pageName, "page.json")
// if (pkg.page._css) {
// delete pkg.page._css
// }
// if (pkg.page.name) {
// delete pkg.page.name
// }
// if (pkg.page._screens) {
// delete pkg.page._screens
// }
// await writeJSON(pageFile, pkg.page, {
// spaces: 2,
// })
// }

View File

@ -1,20 +0,0 @@
// const { readJSON, readdir } = require("fs-extra")
// const { join } = require("../centralPath")
// module.exports = async appPath => {
// const pages = {}
// const pageFolders = await readdir(join(appPath, "pages"))
// for (let pageFolder of pageFolders) {
// try {
// pages[pageFolder] = await readJSON(
// join(appPath, "pages", pageFolder, "page.json")
// )
// pages[pageFolder].name = pageFolder
// } catch (_) {
// // ignore error
// }
// }
// return pages
// }

View File

@ -1,80 +0,0 @@
// const { appPackageFolder } = require("../createAppPackage")
// const {
// readJSON,
// writeJSON,
// readdir,
// ensureDir,
// rename,
// unlink,
// rmdir,
// } = require("fs-extra")
// const { join } = require("../centralPath")
// const { dirname } = require("path")
const compileStaticAssetsForPage = require("./compileStaticAssetsForPage")
// const getPages = require("./getPages")
// const listScreens = require("./listScreens")
// const { budibaseAppsDir } = require("../budibaseDir")
// const { budibaseAppsDir } = require("../budibaseDir")
module.exports.compileStaticAssetsForPage = compileStaticAssetsForPage
// module.exports.listScreens = listScreens
// const getAppDefinition = async appPath =>
// await readJSON(`${appPath}/appDefinition.json`)
// module.exports.getPackageForBuilder = async application => {
// const appPath = resolve(budibaseAppsDir(), application._id)
// const pages = await getPages(appPath)
// return {
// pages,
// application,
// }
// }
// const screenPath = (appPath, pageName, name) =>
// join(appPath, "pages", pageName, "screens", name + ".json")
// module.exports.saveScreen = async (appId, pagename, screen) => {
// const appPath = join(budibaseAppsDir(), appId)
// const compPath = screenPath(appPath, pagename, screen.props._id)
// await ensureDir(dirname(compPath))
// if (screen._css) {
// delete screen._css
// }
// await writeJSON(compPath, screen, {
// encoding: "utf8",
// flag: "w",
// spaces: 2,
// })
// return screen
// }
// module.exports.deleteScreen = async (config, appId, pagename, name) => {
// const appPath = join(budibaseAppsDir(), appId)
// const componentFile = screenPath(appPath, pagename, name)
// await unlink(componentFile)
// const dir = dirname(componentFile)
// if ((await readdir(dir)).length === 0) {
// await rmdir(dir)
// }
// }
// module.exports.savePage = async (appId, pagename, page) => {
// const appPath = join(budibaseAppsDir(), appId)
// const pageDir = join(appPath, "pages", pagename)
// await ensureDir(pageDir)
// await writeJSON(join(pageDir, "page.json"), page, {
// encoding: "utf8",
// flag: "w",
// space: 2,
// })
// const appDefinition = await getAppDefinition(appPath)
// await compileStaticAssetsForPage(appId, appDefinition, pagename, page)
// }

View File

@ -1,48 +0,0 @@
const { readJSON, readdir, stat } = require("fs-extra")
const { join } = require("../centralPath")
const { keyBy } = require("lodash/fp")
const { budibaseAppsDir } = require("../budibaseDir")
// module.exports = async (appId, pagename) => {
// const appPath = join(budibaseAppsDir(), appId)
// return keyBy("name")(await fetchscreens(appPath, pagename))
// }
// const fetchscreens = async (appPath, pagename, relativePath = "") => {
// const currentDir = join(appPath, "pages", pagename, "screens", relativePath)
// const contents = await readdir(currentDir)
// const screens = []
// for (let item of contents) {
// const itemRelativePath = join(relativePath, item)
// const itemFullPath = join(currentDir, item)
// const stats = await stat(itemFullPath)
// if (stats.isFile()) {
// if (!item.endsWith(".json")) continue
// const component = await readJSON(itemFullPath)
// component.name = itemRelativePath
// .substring(0, itemRelativePath.length - 5)
// .replace(/\\/g, "/")
// component.props = component.props || {}
// screens.push(component)
// } else {
// const childComponents = await fetchscreens(
// appPath,
// join(relativePath, item)
// )
// for (let c of childComponents) {
// screens.push(c)
// }
// }
// }
// return screens
// }

View File

@ -1,5 +1,3 @@
const { resolve } = require("./centralPath")
const { cwd } = require("process")
const stream = require("stream") const stream = require("stream")
const fetch = require("node-fetch") const fetch = require("node-fetch")
const tar = require("tar-fs") const tar = require("tar-fs")