Fixing an issue with server still expecting tmp directory to be created externally and updating component library to not cache with require in dev.

This commit is contained in:
mike12345567 2021-04-01 16:28:51 +01:00
parent 2f03b758a9
commit 4f589a8b49
1 changed files with 6 additions and 9 deletions

View File

@ -22,13 +22,7 @@ const fetch = require("node-fetch")
const DEFAULT_AUTOMATION_BUCKET =
"https://prod-budi-automations.s3-eu-west-1.amazonaws.com"
const DEFAULT_AUTOMATION_DIRECTORY = ".budibase-automations"
const NODE_MODULES_PATH = join(
__dirname,
"..",
"..",
"..",
"node_modules"
)
const NODE_MODULES_PATH = join(__dirname, "..", "..", "..", "node_modules")
/**
* The single stack system (Cloud and Builder) should not make use of the file system where possible,
@ -178,12 +172,15 @@ exports.getComponentLibraryManifest = async (appId, library) => {
const path = require.resolve(library).split(lib)[0]
return require(join(path, lib, filename))
} else if (env.isDev()) {
return require(join(
const path = join(
NODE_MODULES_PATH,
"@budibase",
"standard-components",
filename
))
)
// always load from new so that updates are refreshed
delete require.cache[require.resolve(path)]
return require(path)
}
const path = join(appId, "node_modules", library, "package", filename)
let resp = await retrieve(ObjectStoreBuckets.APPS, path)