@abp/aspnetcore.mvc.ui
Advanced tools
Comparing version 3.3.1 to 4.0.0-rc.1
@@ -7,3 +7,5 @@ "use strict"; | ||
merge = require("merge-stream"), | ||
rimraf = require("rimraf"), | ||
fse = require('fs-extra'), | ||
glob = require('glob'), | ||
micromatch = require('micromatch'), | ||
path = require("path"), | ||
@@ -45,10 +47,39 @@ extendObject = require('extend-object'); | ||
} | ||
function cleanFiles() { | ||
if (resourceMapping.clean) { | ||
for (var i = 0; i < resourceMapping.clean.length; i++) { | ||
rimraf.sync(replaceAliases(resourceMapping.clean[i]) + '/**/*', { force: true }); | ||
} | ||
} | ||
function cleanDirsAndFiles(patterns) { | ||
const { dirs, files } = findDirsAndFiles(patterns); | ||
files.forEach(file => fse.unlinkSync(file)); | ||
dirs.forEach(dir => { | ||
try { | ||
fse.rmdirSync(dir); | ||
} catch (_) {} | ||
}); | ||
} | ||
function findDirsAndFiles(patterns) { | ||
const dirs = []; | ||
const files = []; | ||
const list = glob.sync('**/*', { dot: true }); | ||
const matches = micromatch(list, normalizeGlob(patterns), { | ||
dot: true, | ||
}); | ||
matches.forEach(match => { | ||
if (!fse.pathExistsSync(match)) return; | ||
(fse.statSync(match).isDirectory() ? dirs : files).push(match); | ||
}); | ||
return { dirs, files }; | ||
} | ||
function normalizeGlob(patterns) { | ||
return patterns.map(pattern => { | ||
const prefix = /\*$/.test(pattern) ? '' : '/**'; | ||
return replaceAliases(pattern).replace(/(!?)\.\//, '$1') + prefix; | ||
}); | ||
} | ||
@@ -69,10 +100,4 @@ function normalizeResourceMapping(resourcemapping) { | ||
if (!resourcemapping.clean) { | ||
resourcemapping.clean = []; | ||
} | ||
resourcemapping.clean = resourcemapping.clean || defaultSettings.clean; | ||
for (var i = 0; i < defaultSettings.clean.length; ++i) { | ||
resourcemapping.clean.push(defaultSettings.clean[i]); | ||
} | ||
return resourcemapping; | ||
@@ -118,3 +143,3 @@ } | ||
cleanFiles(); | ||
cleanDirsAndFiles(resourceMapping.clean); | ||
@@ -121,0 +146,0 @@ var tasks = []; |
{ | ||
"version": "3.3.1", | ||
"version": "4.0.0-rc.1", | ||
"name": "@abp/aspnetcore.mvc.ui", | ||
@@ -10,8 +10,10 @@ "publishConfig": { | ||
"extend-object": "^1.0.0", | ||
"fs-extra": "^9.0.1", | ||
"glob": "^7.1.6", | ||
"gulp": "^4.0.2", | ||
"merge-stream": "^2.0.0", | ||
"path": "^0.12.7", | ||
"rimraf": "^3.0.2" | ||
"micromatch": "^4.0.2", | ||
"path": "^0.12.7" | ||
}, | ||
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431" | ||
} |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
5185
122
8
2
3
+ Addedfs-extra@^9.0.1
+ Addedglob@^7.1.6
+ Addedmicromatch@^4.0.2
+ Addedat-least-node@1.0.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addeduniversalify@2.0.1(transitive)
- Removedrimraf@^3.0.2
- Removedrimraf@3.0.2(transitive)