@nrwl/tao
Advanced tools
Comparing version 8.7.0-beta.5 to 8.7.0-beta.6
{ | ||
"name": "@nrwl/tao", | ||
"version": "8.7.0-beta.5", | ||
"version": "8.7.0-beta.6", | ||
"description": "CLI for generating code and running commands", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -207,28 +207,34 @@ "use strict"; | ||
function createFetcher(logger) { | ||
let cache = {}; | ||
return function f(packageName, packageVersion) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const dir = tmp_1.dirSync().name; | ||
logger.info(`Fetching ${packageName}@${packageVersion}`); | ||
child_process_1.execSync(`npm install ${packageName}@${packageVersion} --prefix=${dir}`, { | ||
stdio: [] | ||
}); | ||
const json = JSON.parse(stripJsonComments(fs_1.readFileSync(path.join(dir, 'node_modules', packageName, 'package.json')).toString())); | ||
let migrationsFile = json['nx-migrations'] || json['ng-update']; | ||
// migrationsFile is an object | ||
if (migrationsFile && migrationsFile.migrations) { | ||
migrationsFile = migrationsFile.migrations; | ||
if (!cache[`${packageName}-${packageVersion}`]) { | ||
const dir = tmp_1.dirSync().name; | ||
logger.info(`Fetching ${packageName}@${packageVersion}`); | ||
child_process_1.execSync(`npm install ${packageName}@${packageVersion} --prefix=${dir}`, { | ||
stdio: [] | ||
}); | ||
const json = JSON.parse(stripJsonComments(fs_1.readFileSync(path.join(dir, 'node_modules', packageName, 'package.json')).toString())); | ||
let migrationsFile = json['nx-migrations'] || json['ng-update']; | ||
// migrationsFile is an object | ||
if (migrationsFile && migrationsFile.migrations) { | ||
migrationsFile = migrationsFile.migrations; | ||
} | ||
// packageVersion can be a tag, resolvedVersion works with semver | ||
const resolvedVersion = json.version; | ||
if (migrationsFile) { | ||
const json = JSON.parse(stripJsonComments(fs_1.readFileSync(path.join(dir, 'node_modules', packageName, migrationsFile)).toString())); | ||
cache[`${packageName}-${packageVersion}`] = { | ||
version: resolvedVersion, | ||
schematics: json.schematics, | ||
packageJsonUpdates: json.packageJsonUpdates | ||
}; | ||
} | ||
else { | ||
cache[`${packageName}-${packageVersion}`] = { | ||
version: resolvedVersion | ||
}; | ||
} | ||
} | ||
// packageVersion can be a tag, resolvedVersion works with semver | ||
const resolvedVersion = json.version; | ||
if (migrationsFile) { | ||
const json = JSON.parse(stripJsonComments(fs_1.readFileSync(path.join(dir, 'node_modules', packageName, migrationsFile)).toString())); | ||
return { | ||
version: resolvedVersion, | ||
schematics: json.schematics, | ||
packageJsonUpdates: json.packageJsonUpdates | ||
}; | ||
} | ||
else { | ||
return { version: resolvedVersion }; | ||
} | ||
return cache[`${packageName}-${packageVersion}`]; | ||
}); | ||
@@ -235,0 +241,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85267
1764