@artus/core
Advanced tools
Comparing version 2.0.0-alpha.11 to 2.0.0-alpha.12
@@ -28,3 +28,3 @@ "use strict"; | ||
refName: constant_1.DEFAULT_APP_REF, | ||
checkPackageVersion: false, // Don't check app version | ||
isPackage: false, | ||
}]; | ||
@@ -31,0 +31,0 @@ // Init scan-task scanner |
@@ -116,3 +116,3 @@ "use strict"; | ||
refName: ref.name, | ||
checkPackageVersion: ref.isPackage, | ||
isPackage: ref.isPackage, | ||
}; | ||
@@ -144,3 +144,3 @@ const waitingTaskList = (_a = this.waitingTaskMap.get(pluginName)) !== null && _a !== void 0 ? _a : []; | ||
var _a; | ||
const { curPath = '', refName, checkPackageVersion } = taskItem; | ||
const { curPath = '', refName, isPackage } = taskItem; | ||
let basePath = curPath; | ||
@@ -150,10 +150,12 @@ if (!path_1.default.isAbsolute(basePath)) { | ||
} | ||
const packageVersion = await (0, utils_1.getPackageVersion)((refName === constant_1.DEFAULT_APP_REF || !isPackage) | ||
? basePath | ||
: refName); | ||
if (this.refMap[refName]) { | ||
// Already scanned | ||
const refItem = this.refMap[refName]; | ||
if (checkPackageVersion && refItem.packageVersion) { | ||
const curPackageVersion = await (0, utils_1.getPackageVersion)(refName === constant_1.DEFAULT_APP_REF ? basePath : refName); | ||
if (curPackageVersion && curPackageVersion !== refItem.packageVersion) { | ||
if (refItem.packageVersion) { | ||
if (packageVersion && packageVersion !== refItem.packageVersion) { | ||
// Do NOT allow multi-version of plugin package | ||
throw new Error(`${refName} has multi version of ${curPackageVersion}, ${refItem.packageVersion}`); | ||
throw new Error(`${refName} has multi version of ${packageVersion}, ${refItem.packageVersion}`); | ||
} | ||
@@ -173,3 +175,3 @@ } | ||
const refItem = { | ||
packageVersion: await (0, utils_1.getPackageVersion)(basePath), | ||
packageVersion, | ||
items: [], | ||
@@ -176,0 +178,0 @@ }; |
@@ -39,3 +39,3 @@ import { Manifest } from '../loader'; | ||
refName: string; | ||
checkPackageVersion: boolean; | ||
isPackage: boolean; | ||
} |
@@ -61,2 +61,11 @@ "use strict"; | ||
const resolvePluginConfigItemRef = async (pluginConfigItem, baseDir, root) => { | ||
var _a; | ||
if (pluginConfigItem.refName) { | ||
// For Unit-test | ||
return { | ||
name: pluginConfigItem.refName, | ||
path: (_a = pluginConfigItem.path) !== null && _a !== void 0 ? _a : pluginConfigItem.refName, | ||
isPackage: !!pluginConfigItem.package, | ||
}; | ||
} | ||
if (pluginConfigItem.package) { | ||
@@ -63,0 +72,0 @@ const refPath = (0, common_1.getPackagePath)(pluginConfigItem.package, [baseDir]); |
{ | ||
"name": "@artus/core", | ||
"version": "2.0.0-alpha.11", | ||
"version": "2.0.0-alpha.12", | ||
"description": "Core package of Artus", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
120488
2896