|
|
|
@ -165,7 +165,13 @@ exports.downloadTemplate = async (type, name) => { |
|
|
|
exports.getComponentLibraryManifest = async (appId, library) => { |
|
|
|
const filename = "manifest.json" |
|
|
|
/* istanbul ignore next */ |
|
|
|
if (env.isTest() || env.isDev()) { |
|
|
|
// when testing in cypress and so on we need to get the package
|
|
|
|
// as the environment may not be fully fleshed out for dev or prod
|
|
|
|
if (env.isTest()) { |
|
|
|
const lib = library.split("/")[1] |
|
|
|
const path = require.resolve(library).split(lib)[0] |
|
|
|
return require(join(path, lib, filename)) |
|
|
|
} else if (env.isDev()) { |
|
|
|
const path = join( |
|
|
|
NODE_MODULES_PATH, |
|
|
|
"@budibase", |
|
|
|
|