You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewUsageError(`The local project doesn't feature a 'packageManager' field - please explicit the package manager to pack, or update the manifest to reference it`);
console.warn(`! Corepack only supports objects as valid value for devEngines.packageManager. The current value (${JSON.stringify(packageManager)}) will be ignored.`);
84
+
returnpackageJSONContent.packageManager;
85
+
}
86
+
if(Array.isArray(packageManager)){
87
+
console.warn(`! Corepack does not currently support array values for devEngines.packageManager`);
88
+
returnpackageJSONContent.packageManager;
89
+
}
90
+
91
+
const{name, version, onFail}=packageManager;
92
+
if(typeofname!==`string`||name.includes(`@`)){
93
+
warnOrThrow(`The value of devEngines.packageManager.name ${JSON.stringify(name)} is not a supported string value`,onFail);
warnOrThrow(`The value of devEngines.packageManager.version ${JSON.stringify(version)} is not a valid semver range`,onFail);
98
+
returnpackageJSONContent.packageManager;
99
+
}
100
+
101
+
debugUtils.log(`devEngines.packageManager defines that ${name}@${version} is the local package manager`);
102
+
103
+
const{packageManager: pm}=packageJSONContent;
104
+
if(pm){
105
+
if(!pm.startsWith(`${name}@`))
106
+
warnOrThrow(`"packageManager" field is set to ${JSON.stringify(pm)} which does not match the "devEngines.packageManager" field set to ${JSON.stringify(name)}`,onFail);
warnOrThrow(`"packageManager" field is set to ${JSON.stringify(pm)} which does not match the value defined in "devEngines.packageManager" for ${JSON.stringify(name)} of ${JSON.stringify(version)}`,onFail);
0 commit comments