@talend/scripts-config-cdn
Advanced tools
Comparing version 10.6.0 to 10.7.0
19
cdn.js
@@ -12,2 +12,3 @@ /* eslint-disable global-require */ | ||
const lockfile = require('@yarnpkg/lockfile'); | ||
const yaml = require('js-yaml'); | ||
const modules = require('./modules.json'); | ||
@@ -121,7 +122,17 @@ const umds = require('./umds.json'); | ||
if (fs.existsSync(lockPath)) { | ||
const json = lockfile.parse(fs.readFileSync(lockPath, 'utf-8')); | ||
infos = Object.keys(json.object) | ||
let yarnv1; | ||
let yarnv3; | ||
try { | ||
yarnv1 = lockfile.parse(fs.readFileSync(lockPath, 'utf-8')); | ||
} catch (e) { | ||
yarnv3 = yaml.load(fs.readFileSync(lockPath, 'utf-8')); | ||
// eslint-disable-next-line no-underscore-dangle | ||
delete yarnv3.__metadata; | ||
} | ||
const json = yarnv1 ? yarnv1.object : yarnv3; | ||
infos = Object.keys(json) | ||
.map(moduleAndversion => { | ||
const moduleName = getModuleName(moduleAndversion); | ||
return moduleToCdn(moduleName, json.object[moduleAndversion].version, { | ||
return moduleToCdn(moduleName, json[moduleAndversion].version, { | ||
env: 'development', | ||
@@ -132,3 +143,3 @@ }); | ||
} else { | ||
console.error(`No lockfile found in ${cwd}. Search in parent directory`); | ||
console.log(`No lockfile found in ${cwd}. Search in parent directory`); | ||
return getModulesFromLockFile(path.join(cwd, '..')); | ||
@@ -135,0 +146,0 @@ } |
# CHANGELOG | ||
## 10.7.0 | ||
### Minor Changes | ||
- 646a521a3: Make scripts-config-cdn compliant with yarn v3.X | ||
## 10.6.0 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@talend/scripts-config-cdn", | ||
"version": "10.6.0", | ||
"version": "10.7.0", | ||
"description": "Provide a simple API to inject CDN config into existing webpack configuration", | ||
"main": "cdn.js", | ||
"scripts": { | ||
"lint": "talend-scripts lint ./", | ||
"test": "echo \"Nothing to test\"" | ||
@@ -13,4 +14,5 @@ }, | ||
"@talend/dynamic-cdn-webpack-plugin": "^13.0.0", | ||
"@talend/module-to-cdn": "^9.8.3", | ||
"@talend/module-to-cdn": "^9.8.4", | ||
"@yarnpkg/lockfile": "^1.1.0", | ||
"js-yaml": "^3.14.1", | ||
"read-pkg-up": "^7.0.1" | ||
@@ -17,0 +19,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
35529
8
1089
5
+ Addedjs-yaml@^3.14.1
+ Addedargparse@1.0.10(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedsprintf-js@1.0.3(transitive)
Updated@talend/module-to-cdn@^9.8.4