@architect/hydrate
Advanced tools
Comparing version 3.1.12 to 3.2.0-RC.0
{ | ||
"name": "@architect/hydrate", | ||
"version": "3.1.12", | ||
"version": "3.2.0-RC.0", | ||
"description": "Architect dependency hydrator and shared file manager", | ||
@@ -53,2 +53,3 @@ "main": "src/index.js", | ||
"nyc": "^15.1.0", | ||
"pnpm": "~7.29.1", | ||
"proxyquire": "~2.1.3", | ||
@@ -55,0 +56,0 @@ "tap-spec": "^5.0.0", |
@@ -33,2 +33,3 @@ let { dirname, join, sep } = require('path') | ||
let exists = file => existsSync(join(cwd, file)) | ||
let isJs = file.endsWith('package.json') | ||
@@ -38,2 +39,9 @@ let isPy = file.endsWith('requirements.txt') | ||
let isNpm, isPnpm, isYarn | ||
if (isJs) { | ||
isNpm = exists('package-lock.json') | ||
isPnpm = params.pnpm || exists('pnpm-lock.yaml') | ||
isYarn = params.yarn || exists('yarn.lock') | ||
} | ||
series([ | ||
@@ -56,3 +64,2 @@ function clear (callback) { | ||
// depending on npm version - and enshrine those in the package.json | ||
let exists = file => existsSync(join(cwd, file)) | ||
@@ -62,6 +69,12 @@ // Install JS deps | ||
let prodFlag = isRoot ? '' : '--production' | ||
if (exists('package-lock.json')) { | ||
if (isNpm) { | ||
exec(`npm ci ${prodFlag}`, options, callback) | ||
} | ||
else if (exists('yarn.lock')) { | ||
else if (isPnpm) { | ||
prodFlag = isRoot ? '' : '--prod' | ||
let local = join(cwd, 'node_modules', 'pnpm') | ||
let cmd = local ? `npx pnpm i ${prodFlag}` : `pnpm i ${prodFlag}` | ||
exec(cmd, options, callback) | ||
} | ||
else if (isYarn) { | ||
let local = join(cwd, 'node_modules', 'yarn') | ||
@@ -78,3 +91,3 @@ let cmd = local ? `npx yarn ${prodFlag}` : `yarn ${prodFlag}` | ||
else if (isJs && !installing) { | ||
if (exists('yarn.lock')) { | ||
if (isYarn) { | ||
let local = join(cwd, 'node_modules', 'yarn') | ||
@@ -84,2 +97,7 @@ let cmd = local ? 'npx yarn upgrade' : 'yarn upgrade' | ||
} | ||
else if (isPnpm) { | ||
let local = join(cwd, 'node_modules', 'pnpm') | ||
let cmd = local ? 'npx pnpm update' : 'pnpm update' | ||
exec(cmd, options, callback) | ||
} | ||
else { | ||
@@ -86,0 +104,0 @@ exec(`npm update`, options, callback) |
@@ -37,2 +37,4 @@ #!/usr/bin/env node | ||
verbose: args.verbose, | ||
pnpm: args.pnpm, | ||
yarn: args.yarn, | ||
} | ||
@@ -39,0 +41,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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
60147
1153
10
1