vite 3.1.0-beta.2 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/client.mjs +20 -9
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/chunks/{dep-4069c338.js → dep-19c40c50.js} +81 -84
- package/dist/node/chunks/{dep-6d69fd4f.js → dep-57f3662c.js} +1 -1
- package/dist/node/chunks/{dep-d66eb979.js → dep-a713b95d.js} +1152 -1089
- package/dist/node/cli.js +6 -6
- package/dist/node/constants.js +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node-cjs/publicUtils.cjs +1 -1
- package/package.json +8 -8
- package/src/client/overlay.ts +20 -9
|
@@ -12554,7 +12554,7 @@ function printServerUrls(urls, optionsHost, info) {
|
|
|
12554
12554
|
info(` ${picocolors.exports.green('➜')} ${picocolors.exports.bold('Network')}: ${colorUrl(url)}`);
|
|
12555
12555
|
}
|
|
12556
12556
|
if (urls.network.length === 0 && optionsHost === undefined) {
|
|
12557
|
-
const note = `use ${picocolors.exports.
|
|
12557
|
+
const note = `use ${picocolors.exports.reset(picocolors.exports.bold('--host'))} to expose`;
|
|
12558
12558
|
info(picocolors.exports.dim(` ${picocolors.exports.green('➜')} ${picocolors.exports.bold('Network')}: ${note}`));
|
|
12559
12559
|
}
|
|
12560
12560
|
}
|
|
@@ -13765,91 +13765,91 @@ var utils$g = {};
|
|
|
13765
13765
|
|
|
13766
13766
|
var array$1 = {};
|
|
13767
13767
|
|
|
13768
|
-
Object.defineProperty(array$1, "__esModule", { value: true });
|
|
13769
|
-
array$1.splitWhen = array$1.flatten = void 0;
|
|
13770
|
-
function flatten$1(items) {
|
|
13771
|
-
return items.reduce((collection, item) => [].concat(collection, item), []);
|
|
13772
|
-
}
|
|
13773
|
-
array$1.flatten = flatten$1;
|
|
13774
|
-
function splitWhen(items, predicate) {
|
|
13775
|
-
const result = [[]];
|
|
13776
|
-
let groupIndex = 0;
|
|
13777
|
-
for (const item of items) {
|
|
13778
|
-
if (predicate(item)) {
|
|
13779
|
-
groupIndex++;
|
|
13780
|
-
result[groupIndex] = [];
|
|
13781
|
-
}
|
|
13782
|
-
else {
|
|
13783
|
-
result[groupIndex].push(item);
|
|
13784
|
-
}
|
|
13785
|
-
}
|
|
13786
|
-
return result;
|
|
13787
|
-
}
|
|
13768
|
+
Object.defineProperty(array$1, "__esModule", { value: true });
|
|
13769
|
+
array$1.splitWhen = array$1.flatten = void 0;
|
|
13770
|
+
function flatten$1(items) {
|
|
13771
|
+
return items.reduce((collection, item) => [].concat(collection, item), []);
|
|
13772
|
+
}
|
|
13773
|
+
array$1.flatten = flatten$1;
|
|
13774
|
+
function splitWhen(items, predicate) {
|
|
13775
|
+
const result = [[]];
|
|
13776
|
+
let groupIndex = 0;
|
|
13777
|
+
for (const item of items) {
|
|
13778
|
+
if (predicate(item)) {
|
|
13779
|
+
groupIndex++;
|
|
13780
|
+
result[groupIndex] = [];
|
|
13781
|
+
}
|
|
13782
|
+
else {
|
|
13783
|
+
result[groupIndex].push(item);
|
|
13784
|
+
}
|
|
13785
|
+
}
|
|
13786
|
+
return result;
|
|
13787
|
+
}
|
|
13788
13788
|
array$1.splitWhen = splitWhen;
|
|
13789
13789
|
|
|
13790
13790
|
var errno$1 = {};
|
|
13791
13791
|
|
|
13792
|
-
Object.defineProperty(errno$1, "__esModule", { value: true });
|
|
13793
|
-
errno$1.isEnoentCodeError = void 0;
|
|
13794
|
-
function isEnoentCodeError(error) {
|
|
13795
|
-
return error.code === 'ENOENT';
|
|
13796
|
-
}
|
|
13792
|
+
Object.defineProperty(errno$1, "__esModule", { value: true });
|
|
13793
|
+
errno$1.isEnoentCodeError = void 0;
|
|
13794
|
+
function isEnoentCodeError(error) {
|
|
13795
|
+
return error.code === 'ENOENT';
|
|
13796
|
+
}
|
|
13797
13797
|
errno$1.isEnoentCodeError = isEnoentCodeError;
|
|
13798
13798
|
|
|
13799
13799
|
var fs$h = {};
|
|
13800
13800
|
|
|
13801
|
-
Object.defineProperty(fs$h, "__esModule", { value: true });
|
|
13802
|
-
fs$h.createDirentFromStats = void 0;
|
|
13803
|
-
class DirentFromStats$1 {
|
|
13804
|
-
constructor(name, stats) {
|
|
13805
|
-
this.name = name;
|
|
13806
|
-
this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
|
13807
|
-
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
|
13808
|
-
this.isDirectory = stats.isDirectory.bind(stats);
|
|
13809
|
-
this.isFIFO = stats.isFIFO.bind(stats);
|
|
13810
|
-
this.isFile = stats.isFile.bind(stats);
|
|
13811
|
-
this.isSocket = stats.isSocket.bind(stats);
|
|
13812
|
-
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
|
13813
|
-
}
|
|
13814
|
-
}
|
|
13815
|
-
function createDirentFromStats$1(name, stats) {
|
|
13816
|
-
return new DirentFromStats$1(name, stats);
|
|
13817
|
-
}
|
|
13801
|
+
Object.defineProperty(fs$h, "__esModule", { value: true });
|
|
13802
|
+
fs$h.createDirentFromStats = void 0;
|
|
13803
|
+
class DirentFromStats$1 {
|
|
13804
|
+
constructor(name, stats) {
|
|
13805
|
+
this.name = name;
|
|
13806
|
+
this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
|
13807
|
+
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
|
13808
|
+
this.isDirectory = stats.isDirectory.bind(stats);
|
|
13809
|
+
this.isFIFO = stats.isFIFO.bind(stats);
|
|
13810
|
+
this.isFile = stats.isFile.bind(stats);
|
|
13811
|
+
this.isSocket = stats.isSocket.bind(stats);
|
|
13812
|
+
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
|
13813
|
+
}
|
|
13814
|
+
}
|
|
13815
|
+
function createDirentFromStats$1(name, stats) {
|
|
13816
|
+
return new DirentFromStats$1(name, stats);
|
|
13817
|
+
}
|
|
13818
13818
|
fs$h.createDirentFromStats = createDirentFromStats$1;
|
|
13819
13819
|
|
|
13820
13820
|
var path$h = {};
|
|
13821
13821
|
|
|
13822
|
-
Object.defineProperty(path$h, "__esModule", { value: true });
|
|
13823
|
-
path$h.removeLeadingDotSegment = path$h.escape = path$h.makeAbsolute = path$h.unixify = void 0;
|
|
13824
|
-
const path$g = require$$0$4;
|
|
13825
|
-
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
|
|
13826
|
-
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
|
|
13827
|
-
/**
|
|
13828
|
-
* Designed to work only with simple paths: `dir\\file`.
|
|
13829
|
-
*/
|
|
13830
|
-
function unixify(filepath) {
|
|
13831
|
-
return filepath.replace(/\\/g, '/');
|
|
13832
|
-
}
|
|
13833
|
-
path$h.unixify = unixify;
|
|
13834
|
-
function makeAbsolute(cwd, filepath) {
|
|
13835
|
-
return path$g.resolve(cwd, filepath);
|
|
13836
|
-
}
|
|
13837
|
-
path$h.makeAbsolute = makeAbsolute;
|
|
13838
|
-
function escape$2(pattern) {
|
|
13839
|
-
return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
|
13840
|
-
}
|
|
13841
|
-
path$h.escape = escape$2;
|
|
13842
|
-
function removeLeadingDotSegment(entry) {
|
|
13843
|
-
// We do not use `startsWith` because this is 10x slower than current implementation for some cases.
|
|
13844
|
-
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
|
13845
|
-
if (entry.charAt(0) === '.') {
|
|
13846
|
-
const secondCharactery = entry.charAt(1);
|
|
13847
|
-
if (secondCharactery === '/' || secondCharactery === '\\') {
|
|
13848
|
-
return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
|
|
13849
|
-
}
|
|
13850
|
-
}
|
|
13851
|
-
return entry;
|
|
13852
|
-
}
|
|
13822
|
+
Object.defineProperty(path$h, "__esModule", { value: true });
|
|
13823
|
+
path$h.removeLeadingDotSegment = path$h.escape = path$h.makeAbsolute = path$h.unixify = void 0;
|
|
13824
|
+
const path$g = require$$0$4;
|
|
13825
|
+
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
|
|
13826
|
+
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
|
|
13827
|
+
/**
|
|
13828
|
+
* Designed to work only with simple paths: `dir\\file`.
|
|
13829
|
+
*/
|
|
13830
|
+
function unixify(filepath) {
|
|
13831
|
+
return filepath.replace(/\\/g, '/');
|
|
13832
|
+
}
|
|
13833
|
+
path$h.unixify = unixify;
|
|
13834
|
+
function makeAbsolute(cwd, filepath) {
|
|
13835
|
+
return path$g.resolve(cwd, filepath);
|
|
13836
|
+
}
|
|
13837
|
+
path$h.makeAbsolute = makeAbsolute;
|
|
13838
|
+
function escape$2(pattern) {
|
|
13839
|
+
return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
|
13840
|
+
}
|
|
13841
|
+
path$h.escape = escape$2;
|
|
13842
|
+
function removeLeadingDotSegment(entry) {
|
|
13843
|
+
// We do not use `startsWith` because this is 10x slower than current implementation for some cases.
|
|
13844
|
+
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
|
13845
|
+
if (entry.charAt(0) === '.') {
|
|
13846
|
+
const secondCharactery = entry.charAt(1);
|
|
13847
|
+
if (secondCharactery === '/' || secondCharactery === '\\') {
|
|
13848
|
+
return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
|
|
13849
|
+
}
|
|
13850
|
+
}
|
|
13851
|
+
return entry;
|
|
13852
|
+
}
|
|
13853
13853
|
path$h.removeLeadingDotSegment = removeLeadingDotSegment;
|
|
13854
13854
|
|
|
13855
13855
|
var pattern$1 = {};
|
|
@@ -15953,173 +15953,173 @@ micromatch$1.braceExpand = (pattern, options) => {
|
|
|
15953
15953
|
|
|
15954
15954
|
var micromatch_1 = micromatch$1;
|
|
15955
15955
|
|
|
15956
|
-
Object.defineProperty(pattern$1, "__esModule", { value: true });
|
|
15957
|
-
pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
|
|
15958
|
-
const path$f = require$$0$4;
|
|
15959
|
-
const globParent$1 = globParent$2;
|
|
15960
|
-
const micromatch = micromatch_1;
|
|
15961
|
-
const GLOBSTAR$1 = '**';
|
|
15962
|
-
const ESCAPE_SYMBOL = '\\';
|
|
15963
|
-
const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
|
|
15964
|
-
const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
|
|
15965
|
-
const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
|
|
15966
|
-
const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
|
|
15967
|
-
const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
|
|
15968
|
-
function isStaticPattern(pattern, options = {}) {
|
|
15969
|
-
return !isDynamicPattern(pattern, options);
|
|
15970
|
-
}
|
|
15971
|
-
pattern$1.isStaticPattern = isStaticPattern;
|
|
15972
|
-
function isDynamicPattern(pattern, options = {}) {
|
|
15973
|
-
/**
|
|
15974
|
-
* A special case with an empty string is necessary for matching patterns that start with a forward slash.
|
|
15975
|
-
* An empty string cannot be a dynamic pattern.
|
|
15976
|
-
* For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
|
|
15977
|
-
*/
|
|
15978
|
-
if (pattern === '') {
|
|
15979
|
-
return false;
|
|
15980
|
-
}
|
|
15981
|
-
/**
|
|
15982
|
-
* When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
|
|
15983
|
-
* filepath directly (without read directory).
|
|
15984
|
-
*/
|
|
15985
|
-
if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
|
|
15986
|
-
return true;
|
|
15987
|
-
}
|
|
15988
|
-
if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
|
|
15989
|
-
return true;
|
|
15990
|
-
}
|
|
15991
|
-
if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
|
|
15992
|
-
return true;
|
|
15993
|
-
}
|
|
15994
|
-
if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
|
|
15995
|
-
return true;
|
|
15996
|
-
}
|
|
15997
|
-
return false;
|
|
15998
|
-
}
|
|
15999
|
-
pattern$1.isDynamicPattern = isDynamicPattern;
|
|
16000
|
-
function hasBraceExpansion(pattern) {
|
|
16001
|
-
const openingBraceIndex = pattern.indexOf('{');
|
|
16002
|
-
if (openingBraceIndex === -1) {
|
|
16003
|
-
return false;
|
|
16004
|
-
}
|
|
16005
|
-
const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1);
|
|
16006
|
-
if (closingBraceIndex === -1) {
|
|
16007
|
-
return false;
|
|
16008
|
-
}
|
|
16009
|
-
const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
|
|
16010
|
-
return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
|
|
16011
|
-
}
|
|
16012
|
-
function convertToPositivePattern(pattern) {
|
|
16013
|
-
return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
|
|
16014
|
-
}
|
|
16015
|
-
pattern$1.convertToPositivePattern = convertToPositivePattern;
|
|
16016
|
-
function convertToNegativePattern(pattern) {
|
|
16017
|
-
return '!' + pattern;
|
|
16018
|
-
}
|
|
16019
|
-
pattern$1.convertToNegativePattern = convertToNegativePattern;
|
|
16020
|
-
function isNegativePattern(pattern) {
|
|
16021
|
-
return pattern.startsWith('!') && pattern[1] !== '(';
|
|
16022
|
-
}
|
|
16023
|
-
pattern$1.isNegativePattern = isNegativePattern;
|
|
16024
|
-
function isPositivePattern(pattern) {
|
|
16025
|
-
return !isNegativePattern(pattern);
|
|
16026
|
-
}
|
|
16027
|
-
pattern$1.isPositivePattern = isPositivePattern;
|
|
16028
|
-
function getNegativePatterns(patterns) {
|
|
16029
|
-
return patterns.filter(isNegativePattern);
|
|
16030
|
-
}
|
|
16031
|
-
pattern$1.getNegativePatterns = getNegativePatterns;
|
|
16032
|
-
function getPositivePatterns$1(patterns) {
|
|
16033
|
-
return patterns.filter(isPositivePattern);
|
|
16034
|
-
}
|
|
16035
|
-
pattern$1.getPositivePatterns = getPositivePatterns$1;
|
|
16036
|
-
/**
|
|
16037
|
-
* Returns patterns that can be applied inside the current directory.
|
|
16038
|
-
*
|
|
16039
|
-
* @example
|
|
16040
|
-
* // ['./*', '*', 'a/*']
|
|
16041
|
-
* getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
|
|
16042
|
-
*/
|
|
16043
|
-
function getPatternsInsideCurrentDirectory(patterns) {
|
|
16044
|
-
return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
|
|
16045
|
-
}
|
|
16046
|
-
pattern$1.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
|
|
16047
|
-
/**
|
|
16048
|
-
* Returns patterns to be expanded relative to (outside) the current directory.
|
|
16049
|
-
*
|
|
16050
|
-
* @example
|
|
16051
|
-
* // ['../*', './../*']
|
|
16052
|
-
* getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
|
|
16053
|
-
*/
|
|
16054
|
-
function getPatternsOutsideCurrentDirectory(patterns) {
|
|
16055
|
-
return patterns.filter(isPatternRelatedToParentDirectory);
|
|
16056
|
-
}
|
|
16057
|
-
pattern$1.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
|
|
16058
|
-
function isPatternRelatedToParentDirectory(pattern) {
|
|
16059
|
-
return pattern.startsWith('..') || pattern.startsWith('./..');
|
|
16060
|
-
}
|
|
16061
|
-
pattern$1.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
|
|
16062
|
-
function getBaseDirectory(pattern) {
|
|
16063
|
-
return globParent$1(pattern, { flipBackslashes: false });
|
|
16064
|
-
}
|
|
16065
|
-
pattern$1.getBaseDirectory = getBaseDirectory;
|
|
16066
|
-
function hasGlobStar(pattern) {
|
|
16067
|
-
return pattern.includes(GLOBSTAR$1);
|
|
16068
|
-
}
|
|
16069
|
-
pattern$1.hasGlobStar = hasGlobStar;
|
|
16070
|
-
function endsWithSlashGlobStar(pattern) {
|
|
16071
|
-
return pattern.endsWith('/' + GLOBSTAR$1);
|
|
16072
|
-
}
|
|
16073
|
-
pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
16074
|
-
function isAffectDepthOfReadingPattern(pattern) {
|
|
16075
|
-
const basename = path$f.basename(pattern);
|
|
16076
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
|
16077
|
-
}
|
|
16078
|
-
pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
16079
|
-
function expandPatternsWithBraceExpansion(patterns) {
|
|
16080
|
-
return patterns.reduce((collection, pattern) => {
|
|
16081
|
-
return collection.concat(expandBraceExpansion(pattern));
|
|
16082
|
-
}, []);
|
|
16083
|
-
}
|
|
16084
|
-
pattern$1.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
16085
|
-
function expandBraceExpansion(pattern) {
|
|
16086
|
-
return micromatch.braces(pattern, {
|
|
16087
|
-
expand: true,
|
|
16088
|
-
nodupes: true
|
|
16089
|
-
});
|
|
16090
|
-
}
|
|
16091
|
-
pattern$1.expandBraceExpansion = expandBraceExpansion;
|
|
16092
|
-
function getPatternParts(pattern, options) {
|
|
16093
|
-
let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
|
|
16094
|
-
/**
|
|
16095
|
-
* The scan method returns an empty array in some cases.
|
|
16096
|
-
* See micromatch/picomatch#58 for more details.
|
|
16097
|
-
*/
|
|
16098
|
-
if (parts.length === 0) {
|
|
16099
|
-
parts = [pattern];
|
|
16100
|
-
}
|
|
16101
|
-
/**
|
|
16102
|
-
* The scan method does not return an empty part for the pattern with a forward slash.
|
|
16103
|
-
* This is another part of micromatch/picomatch#58.
|
|
16104
|
-
*/
|
|
16105
|
-
if (parts[0].startsWith('/')) {
|
|
16106
|
-
parts[0] = parts[0].slice(1);
|
|
16107
|
-
parts.unshift('');
|
|
16108
|
-
}
|
|
16109
|
-
return parts;
|
|
16110
|
-
}
|
|
16111
|
-
pattern$1.getPatternParts = getPatternParts;
|
|
16112
|
-
function makeRe(pattern, options) {
|
|
16113
|
-
return micromatch.makeRe(pattern, options);
|
|
16114
|
-
}
|
|
16115
|
-
pattern$1.makeRe = makeRe;
|
|
16116
|
-
function convertPatternsToRe(patterns, options) {
|
|
16117
|
-
return patterns.map((pattern) => makeRe(pattern, options));
|
|
16118
|
-
}
|
|
16119
|
-
pattern$1.convertPatternsToRe = convertPatternsToRe;
|
|
16120
|
-
function matchAny(entry, patternsRe) {
|
|
16121
|
-
return patternsRe.some((patternRe) => patternRe.test(entry));
|
|
16122
|
-
}
|
|
15956
|
+
Object.defineProperty(pattern$1, "__esModule", { value: true });
|
|
15957
|
+
pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
|
|
15958
|
+
const path$f = require$$0$4;
|
|
15959
|
+
const globParent$1 = globParent$2;
|
|
15960
|
+
const micromatch = micromatch_1;
|
|
15961
|
+
const GLOBSTAR$1 = '**';
|
|
15962
|
+
const ESCAPE_SYMBOL = '\\';
|
|
15963
|
+
const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
|
|
15964
|
+
const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
|
|
15965
|
+
const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
|
|
15966
|
+
const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
|
|
15967
|
+
const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
|
|
15968
|
+
function isStaticPattern(pattern, options = {}) {
|
|
15969
|
+
return !isDynamicPattern(pattern, options);
|
|
15970
|
+
}
|
|
15971
|
+
pattern$1.isStaticPattern = isStaticPattern;
|
|
15972
|
+
function isDynamicPattern(pattern, options = {}) {
|
|
15973
|
+
/**
|
|
15974
|
+
* A special case with an empty string is necessary for matching patterns that start with a forward slash.
|
|
15975
|
+
* An empty string cannot be a dynamic pattern.
|
|
15976
|
+
* For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
|
|
15977
|
+
*/
|
|
15978
|
+
if (pattern === '') {
|
|
15979
|
+
return false;
|
|
15980
|
+
}
|
|
15981
|
+
/**
|
|
15982
|
+
* When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
|
|
15983
|
+
* filepath directly (without read directory).
|
|
15984
|
+
*/
|
|
15985
|
+
if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
|
|
15986
|
+
return true;
|
|
15987
|
+
}
|
|
15988
|
+
if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
|
|
15989
|
+
return true;
|
|
15990
|
+
}
|
|
15991
|
+
if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
|
|
15992
|
+
return true;
|
|
15993
|
+
}
|
|
15994
|
+
if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
|
|
15995
|
+
return true;
|
|
15996
|
+
}
|
|
15997
|
+
return false;
|
|
15998
|
+
}
|
|
15999
|
+
pattern$1.isDynamicPattern = isDynamicPattern;
|
|
16000
|
+
function hasBraceExpansion(pattern) {
|
|
16001
|
+
const openingBraceIndex = pattern.indexOf('{');
|
|
16002
|
+
if (openingBraceIndex === -1) {
|
|
16003
|
+
return false;
|
|
16004
|
+
}
|
|
16005
|
+
const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1);
|
|
16006
|
+
if (closingBraceIndex === -1) {
|
|
16007
|
+
return false;
|
|
16008
|
+
}
|
|
16009
|
+
const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
|
|
16010
|
+
return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
|
|
16011
|
+
}
|
|
16012
|
+
function convertToPositivePattern(pattern) {
|
|
16013
|
+
return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
|
|
16014
|
+
}
|
|
16015
|
+
pattern$1.convertToPositivePattern = convertToPositivePattern;
|
|
16016
|
+
function convertToNegativePattern(pattern) {
|
|
16017
|
+
return '!' + pattern;
|
|
16018
|
+
}
|
|
16019
|
+
pattern$1.convertToNegativePattern = convertToNegativePattern;
|
|
16020
|
+
function isNegativePattern(pattern) {
|
|
16021
|
+
return pattern.startsWith('!') && pattern[1] !== '(';
|
|
16022
|
+
}
|
|
16023
|
+
pattern$1.isNegativePattern = isNegativePattern;
|
|
16024
|
+
function isPositivePattern(pattern) {
|
|
16025
|
+
return !isNegativePattern(pattern);
|
|
16026
|
+
}
|
|
16027
|
+
pattern$1.isPositivePattern = isPositivePattern;
|
|
16028
|
+
function getNegativePatterns(patterns) {
|
|
16029
|
+
return patterns.filter(isNegativePattern);
|
|
16030
|
+
}
|
|
16031
|
+
pattern$1.getNegativePatterns = getNegativePatterns;
|
|
16032
|
+
function getPositivePatterns$1(patterns) {
|
|
16033
|
+
return patterns.filter(isPositivePattern);
|
|
16034
|
+
}
|
|
16035
|
+
pattern$1.getPositivePatterns = getPositivePatterns$1;
|
|
16036
|
+
/**
|
|
16037
|
+
* Returns patterns that can be applied inside the current directory.
|
|
16038
|
+
*
|
|
16039
|
+
* @example
|
|
16040
|
+
* // ['./*', '*', 'a/*']
|
|
16041
|
+
* getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
|
|
16042
|
+
*/
|
|
16043
|
+
function getPatternsInsideCurrentDirectory(patterns) {
|
|
16044
|
+
return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
|
|
16045
|
+
}
|
|
16046
|
+
pattern$1.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
|
|
16047
|
+
/**
|
|
16048
|
+
* Returns patterns to be expanded relative to (outside) the current directory.
|
|
16049
|
+
*
|
|
16050
|
+
* @example
|
|
16051
|
+
* // ['../*', './../*']
|
|
16052
|
+
* getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
|
|
16053
|
+
*/
|
|
16054
|
+
function getPatternsOutsideCurrentDirectory(patterns) {
|
|
16055
|
+
return patterns.filter(isPatternRelatedToParentDirectory);
|
|
16056
|
+
}
|
|
16057
|
+
pattern$1.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
|
|
16058
|
+
function isPatternRelatedToParentDirectory(pattern) {
|
|
16059
|
+
return pattern.startsWith('..') || pattern.startsWith('./..');
|
|
16060
|
+
}
|
|
16061
|
+
pattern$1.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
|
|
16062
|
+
function getBaseDirectory(pattern) {
|
|
16063
|
+
return globParent$1(pattern, { flipBackslashes: false });
|
|
16064
|
+
}
|
|
16065
|
+
pattern$1.getBaseDirectory = getBaseDirectory;
|
|
16066
|
+
function hasGlobStar(pattern) {
|
|
16067
|
+
return pattern.includes(GLOBSTAR$1);
|
|
16068
|
+
}
|
|
16069
|
+
pattern$1.hasGlobStar = hasGlobStar;
|
|
16070
|
+
function endsWithSlashGlobStar(pattern) {
|
|
16071
|
+
return pattern.endsWith('/' + GLOBSTAR$1);
|
|
16072
|
+
}
|
|
16073
|
+
pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
16074
|
+
function isAffectDepthOfReadingPattern(pattern) {
|
|
16075
|
+
const basename = path$f.basename(pattern);
|
|
16076
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
|
16077
|
+
}
|
|
16078
|
+
pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
16079
|
+
function expandPatternsWithBraceExpansion(patterns) {
|
|
16080
|
+
return patterns.reduce((collection, pattern) => {
|
|
16081
|
+
return collection.concat(expandBraceExpansion(pattern));
|
|
16082
|
+
}, []);
|
|
16083
|
+
}
|
|
16084
|
+
pattern$1.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
16085
|
+
function expandBraceExpansion(pattern) {
|
|
16086
|
+
return micromatch.braces(pattern, {
|
|
16087
|
+
expand: true,
|
|
16088
|
+
nodupes: true
|
|
16089
|
+
});
|
|
16090
|
+
}
|
|
16091
|
+
pattern$1.expandBraceExpansion = expandBraceExpansion;
|
|
16092
|
+
function getPatternParts(pattern, options) {
|
|
16093
|
+
let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
|
|
16094
|
+
/**
|
|
16095
|
+
* The scan method returns an empty array in some cases.
|
|
16096
|
+
* See micromatch/picomatch#58 for more details.
|
|
16097
|
+
*/
|
|
16098
|
+
if (parts.length === 0) {
|
|
16099
|
+
parts = [pattern];
|
|
16100
|
+
}
|
|
16101
|
+
/**
|
|
16102
|
+
* The scan method does not return an empty part for the pattern with a forward slash.
|
|
16103
|
+
* This is another part of micromatch/picomatch#58.
|
|
16104
|
+
*/
|
|
16105
|
+
if (parts[0].startsWith('/')) {
|
|
16106
|
+
parts[0] = parts[0].slice(1);
|
|
16107
|
+
parts.unshift('');
|
|
16108
|
+
}
|
|
16109
|
+
return parts;
|
|
16110
|
+
}
|
|
16111
|
+
pattern$1.getPatternParts = getPatternParts;
|
|
16112
|
+
function makeRe(pattern, options) {
|
|
16113
|
+
return micromatch.makeRe(pattern, options);
|
|
16114
|
+
}
|
|
16115
|
+
pattern$1.makeRe = makeRe;
|
|
16116
|
+
function convertPatternsToRe(patterns, options) {
|
|
16117
|
+
return patterns.map((pattern) => makeRe(pattern, options));
|
|
16118
|
+
}
|
|
16119
|
+
pattern$1.convertPatternsToRe = convertPatternsToRe;
|
|
16120
|
+
function matchAny(entry, patternsRe) {
|
|
16121
|
+
return patternsRe.some((patternRe) => patternRe.test(entry));
|
|
16122
|
+
}
|
|
16123
16123
|
pattern$1.matchAny = matchAny;
|
|
16124
16124
|
|
|
16125
16125
|
var stream$4 = {};
|
|
@@ -16268,166 +16268,176 @@ function pauseStreams (streams, options) {
|
|
|
16268
16268
|
return streams
|
|
16269
16269
|
}
|
|
16270
16270
|
|
|
16271
|
-
Object.defineProperty(stream$4, "__esModule", { value: true });
|
|
16272
|
-
stream$4.merge = void 0;
|
|
16273
|
-
const merge2 = merge2_1;
|
|
16274
|
-
function merge$1(streams) {
|
|
16275
|
-
const mergedStream = merge2(streams);
|
|
16276
|
-
streams.forEach((stream) => {
|
|
16277
|
-
stream.once('error', (error) => mergedStream.emit('error', error));
|
|
16278
|
-
});
|
|
16279
|
-
mergedStream.once('close', () => propagateCloseEventToSources(streams));
|
|
16280
|
-
mergedStream.once('end', () => propagateCloseEventToSources(streams));
|
|
16281
|
-
return mergedStream;
|
|
16282
|
-
}
|
|
16283
|
-
stream$4.merge = merge$1;
|
|
16284
|
-
function propagateCloseEventToSources(streams) {
|
|
16285
|
-
streams.forEach((stream) => stream.emit('close'));
|
|
16271
|
+
Object.defineProperty(stream$4, "__esModule", { value: true });
|
|
16272
|
+
stream$4.merge = void 0;
|
|
16273
|
+
const merge2 = merge2_1;
|
|
16274
|
+
function merge$1(streams) {
|
|
16275
|
+
const mergedStream = merge2(streams);
|
|
16276
|
+
streams.forEach((stream) => {
|
|
16277
|
+
stream.once('error', (error) => mergedStream.emit('error', error));
|
|
16278
|
+
});
|
|
16279
|
+
mergedStream.once('close', () => propagateCloseEventToSources(streams));
|
|
16280
|
+
mergedStream.once('end', () => propagateCloseEventToSources(streams));
|
|
16281
|
+
return mergedStream;
|
|
16282
|
+
}
|
|
16283
|
+
stream$4.merge = merge$1;
|
|
16284
|
+
function propagateCloseEventToSources(streams) {
|
|
16285
|
+
streams.forEach((stream) => stream.emit('close'));
|
|
16286
16286
|
}
|
|
16287
16287
|
|
|
16288
16288
|
var string$2 = {};
|
|
16289
16289
|
|
|
16290
|
-
Object.defineProperty(string$2, "__esModule", { value: true });
|
|
16291
|
-
string$2.isEmpty = string$2.isString = void 0;
|
|
16292
|
-
function isString(input) {
|
|
16293
|
-
return typeof input === 'string';
|
|
16294
|
-
}
|
|
16295
|
-
string$2.isString = isString;
|
|
16296
|
-
function isEmpty$1(input) {
|
|
16297
|
-
return input === '';
|
|
16298
|
-
}
|
|
16290
|
+
Object.defineProperty(string$2, "__esModule", { value: true });
|
|
16291
|
+
string$2.isEmpty = string$2.isString = void 0;
|
|
16292
|
+
function isString(input) {
|
|
16293
|
+
return typeof input === 'string';
|
|
16294
|
+
}
|
|
16295
|
+
string$2.isString = isString;
|
|
16296
|
+
function isEmpty$1(input) {
|
|
16297
|
+
return input === '';
|
|
16298
|
+
}
|
|
16299
16299
|
string$2.isEmpty = isEmpty$1;
|
|
16300
16300
|
|
|
16301
|
-
Object.defineProperty(utils$g, "__esModule", { value: true });
|
|
16302
|
-
utils$g.string = utils$g.stream = utils$g.pattern = utils$g.path = utils$g.fs = utils$g.errno = utils$g.array = void 0;
|
|
16303
|
-
const array = array$1;
|
|
16304
|
-
utils$g.array = array;
|
|
16305
|
-
const errno = errno$1;
|
|
16306
|
-
utils$g.errno = errno;
|
|
16307
|
-
const fs$g = fs$h;
|
|
16308
|
-
utils$g.fs = fs$g;
|
|
16309
|
-
const path$e = path$h;
|
|
16310
|
-
utils$g.path = path$e;
|
|
16311
|
-
const pattern = pattern$1;
|
|
16312
|
-
utils$g.pattern = pattern;
|
|
16313
|
-
const stream$3 = stream$4;
|
|
16314
|
-
utils$g.stream = stream$3;
|
|
16315
|
-
const string$1 = string$2;
|
|
16301
|
+
Object.defineProperty(utils$g, "__esModule", { value: true });
|
|
16302
|
+
utils$g.string = utils$g.stream = utils$g.pattern = utils$g.path = utils$g.fs = utils$g.errno = utils$g.array = void 0;
|
|
16303
|
+
const array = array$1;
|
|
16304
|
+
utils$g.array = array;
|
|
16305
|
+
const errno = errno$1;
|
|
16306
|
+
utils$g.errno = errno;
|
|
16307
|
+
const fs$g = fs$h;
|
|
16308
|
+
utils$g.fs = fs$g;
|
|
16309
|
+
const path$e = path$h;
|
|
16310
|
+
utils$g.path = path$e;
|
|
16311
|
+
const pattern = pattern$1;
|
|
16312
|
+
utils$g.pattern = pattern;
|
|
16313
|
+
const stream$3 = stream$4;
|
|
16314
|
+
utils$g.stream = stream$3;
|
|
16315
|
+
const string$1 = string$2;
|
|
16316
16316
|
utils$g.string = string$1;
|
|
16317
16317
|
|
|
16318
|
-
Object.defineProperty(tasks, "__esModule", { value: true });
|
|
16319
|
-
tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0;
|
|
16320
|
-
const utils$a = utils$g;
|
|
16321
|
-
function generate(patterns, settings) {
|
|
16322
|
-
const positivePatterns = getPositivePatterns(patterns);
|
|
16323
|
-
const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
|
|
16324
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isStaticPattern(pattern, settings));
|
|
16325
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isDynamicPattern(pattern, settings));
|
|
16326
|
-
const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
|
|
16327
|
-
const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
|
|
16328
|
-
return staticTasks.concat(dynamicTasks);
|
|
16329
|
-
}
|
|
16330
|
-
tasks.generate = generate;
|
|
16331
|
-
/**
|
|
16332
|
-
* Returns tasks grouped by basic pattern directories.
|
|
16333
|
-
*
|
|
16334
|
-
* Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
|
|
16335
|
-
* This is necessary because directory traversal starts at the base directory and goes deeper.
|
|
16336
|
-
*/
|
|
16337
|
-
function convertPatternsToTasks(positive, negative, dynamic) {
|
|
16338
|
-
const tasks = [];
|
|
16339
|
-
const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive);
|
|
16340
|
-
const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive);
|
|
16341
|
-
const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
|
|
16342
|
-
const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
|
|
16343
|
-
tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
|
|
16344
|
-
/*
|
|
16345
|
-
* For the sake of reducing future accesses to the file system, we merge all tasks within the current directory
|
|
16346
|
-
* into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest.
|
|
16347
|
-
*/
|
|
16348
|
-
if ('.' in insideCurrentDirectoryGroup) {
|
|
16349
|
-
tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic));
|
|
16350
|
-
}
|
|
16351
|
-
else {
|
|
16352
|
-
tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
|
|
16353
|
-
}
|
|
16354
|
-
return tasks;
|
|
16355
|
-
}
|
|
16356
|
-
tasks.convertPatternsToTasks = convertPatternsToTasks;
|
|
16357
|
-
function getPositivePatterns(patterns) {
|
|
16358
|
-
return utils$a.pattern.getPositivePatterns(patterns);
|
|
16359
|
-
}
|
|
16360
|
-
tasks.getPositivePatterns = getPositivePatterns;
|
|
16361
|
-
function getNegativePatternsAsPositive(patterns, ignore) {
|
|
16362
|
-
const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore);
|
|
16363
|
-
const positive = negative.map(utils$a.pattern.convertToPositivePattern);
|
|
16364
|
-
return positive;
|
|
16365
|
-
}
|
|
16366
|
-
tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
16367
|
-
function groupPatternsByBaseDirectory(patterns) {
|
|
16368
|
-
const group = {};
|
|
16369
|
-
return patterns.reduce((collection, pattern) => {
|
|
16370
|
-
const base = utils$a.pattern.getBaseDirectory(pattern);
|
|
16371
|
-
if (base in collection) {
|
|
16372
|
-
collection[base].push(pattern);
|
|
16373
|
-
}
|
|
16374
|
-
else {
|
|
16375
|
-
collection[base] = [pattern];
|
|
16376
|
-
}
|
|
16377
|
-
return collection;
|
|
16378
|
-
}, group);
|
|
16379
|
-
}
|
|
16380
|
-
tasks.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
16381
|
-
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
16382
|
-
return Object.keys(positive).map((base) => {
|
|
16383
|
-
return convertPatternGroupToTask(base, positive[base], negative, dynamic);
|
|
16384
|
-
});
|
|
16385
|
-
}
|
|
16386
|
-
tasks.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
|
|
16387
|
-
function convertPatternGroupToTask(base, positive, negative, dynamic) {
|
|
16388
|
-
return {
|
|
16389
|
-
dynamic,
|
|
16390
|
-
positive,
|
|
16391
|
-
negative,
|
|
16392
|
-
base,
|
|
16393
|
-
patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern))
|
|
16394
|
-
};
|
|
16395
|
-
}
|
|
16318
|
+
Object.defineProperty(tasks, "__esModule", { value: true });
|
|
16319
|
+
tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0;
|
|
16320
|
+
const utils$a = utils$g;
|
|
16321
|
+
function generate(patterns, settings) {
|
|
16322
|
+
const positivePatterns = getPositivePatterns(patterns);
|
|
16323
|
+
const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
|
|
16324
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isStaticPattern(pattern, settings));
|
|
16325
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isDynamicPattern(pattern, settings));
|
|
16326
|
+
const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
|
|
16327
|
+
const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
|
|
16328
|
+
return staticTasks.concat(dynamicTasks);
|
|
16329
|
+
}
|
|
16330
|
+
tasks.generate = generate;
|
|
16331
|
+
/**
|
|
16332
|
+
* Returns tasks grouped by basic pattern directories.
|
|
16333
|
+
*
|
|
16334
|
+
* Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
|
|
16335
|
+
* This is necessary because directory traversal starts at the base directory and goes deeper.
|
|
16336
|
+
*/
|
|
16337
|
+
function convertPatternsToTasks(positive, negative, dynamic) {
|
|
16338
|
+
const tasks = [];
|
|
16339
|
+
const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive);
|
|
16340
|
+
const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive);
|
|
16341
|
+
const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
|
|
16342
|
+
const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
|
|
16343
|
+
tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
|
|
16344
|
+
/*
|
|
16345
|
+
* For the sake of reducing future accesses to the file system, we merge all tasks within the current directory
|
|
16346
|
+
* into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest.
|
|
16347
|
+
*/
|
|
16348
|
+
if ('.' in insideCurrentDirectoryGroup) {
|
|
16349
|
+
tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic));
|
|
16350
|
+
}
|
|
16351
|
+
else {
|
|
16352
|
+
tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
|
|
16353
|
+
}
|
|
16354
|
+
return tasks;
|
|
16355
|
+
}
|
|
16356
|
+
tasks.convertPatternsToTasks = convertPatternsToTasks;
|
|
16357
|
+
function getPositivePatterns(patterns) {
|
|
16358
|
+
return utils$a.pattern.getPositivePatterns(patterns);
|
|
16359
|
+
}
|
|
16360
|
+
tasks.getPositivePatterns = getPositivePatterns;
|
|
16361
|
+
function getNegativePatternsAsPositive(patterns, ignore) {
|
|
16362
|
+
const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore);
|
|
16363
|
+
const positive = negative.map(utils$a.pattern.convertToPositivePattern);
|
|
16364
|
+
return positive;
|
|
16365
|
+
}
|
|
16366
|
+
tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
16367
|
+
function groupPatternsByBaseDirectory(patterns) {
|
|
16368
|
+
const group = {};
|
|
16369
|
+
return patterns.reduce((collection, pattern) => {
|
|
16370
|
+
const base = utils$a.pattern.getBaseDirectory(pattern);
|
|
16371
|
+
if (base in collection) {
|
|
16372
|
+
collection[base].push(pattern);
|
|
16373
|
+
}
|
|
16374
|
+
else {
|
|
16375
|
+
collection[base] = [pattern];
|
|
16376
|
+
}
|
|
16377
|
+
return collection;
|
|
16378
|
+
}, group);
|
|
16379
|
+
}
|
|
16380
|
+
tasks.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
16381
|
+
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
16382
|
+
return Object.keys(positive).map((base) => {
|
|
16383
|
+
return convertPatternGroupToTask(base, positive[base], negative, dynamic);
|
|
16384
|
+
});
|
|
16385
|
+
}
|
|
16386
|
+
tasks.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
|
|
16387
|
+
function convertPatternGroupToTask(base, positive, negative, dynamic) {
|
|
16388
|
+
return {
|
|
16389
|
+
dynamic,
|
|
16390
|
+
positive,
|
|
16391
|
+
negative,
|
|
16392
|
+
base,
|
|
16393
|
+
patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern))
|
|
16394
|
+
};
|
|
16395
|
+
}
|
|
16396
16396
|
tasks.convertPatternGroupToTask = convertPatternGroupToTask;
|
|
16397
16397
|
|
|
16398
16398
|
var patterns = {};
|
|
16399
16399
|
|
|
16400
|
-
Object.defineProperty(patterns, "__esModule", { value: true });
|
|
16401
|
-
patterns.removeDuplicateSlashes = patterns.transform = void 0;
|
|
16402
|
-
/**
|
|
16403
|
-
* Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
|
|
16404
|
-
* The latter is due to the presence of the device path at the beginning of the UNC path.
|
|
16405
|
-
* @todo rewrite to negative lookbehind with the next major release.
|
|
16406
|
-
*/
|
|
16407
|
-
const DOUBLE_SLASH_RE$1 = /(?!^)\/{2,}/g;
|
|
16408
|
-
function transform(patterns) {
|
|
16409
|
-
return patterns.map((pattern) => removeDuplicateSlashes(pattern));
|
|
16410
|
-
}
|
|
16411
|
-
patterns.transform = transform;
|
|
16412
|
-
/**
|
|
16413
|
-
* This package only works with forward slashes as a path separator.
|
|
16414
|
-
* Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
|
|
16415
|
-
*/
|
|
16416
|
-
function removeDuplicateSlashes(pattern) {
|
|
16417
|
-
return pattern.replace(DOUBLE_SLASH_RE$1, '/');
|
|
16418
|
-
}
|
|
16400
|
+
Object.defineProperty(patterns, "__esModule", { value: true });
|
|
16401
|
+
patterns.removeDuplicateSlashes = patterns.transform = void 0;
|
|
16402
|
+
/**
|
|
16403
|
+
* Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
|
|
16404
|
+
* The latter is due to the presence of the device path at the beginning of the UNC path.
|
|
16405
|
+
* @todo rewrite to negative lookbehind with the next major release.
|
|
16406
|
+
*/
|
|
16407
|
+
const DOUBLE_SLASH_RE$1 = /(?!^)\/{2,}/g;
|
|
16408
|
+
function transform(patterns) {
|
|
16409
|
+
return patterns.map((pattern) => removeDuplicateSlashes(pattern));
|
|
16410
|
+
}
|
|
16411
|
+
patterns.transform = transform;
|
|
16412
|
+
/**
|
|
16413
|
+
* This package only works with forward slashes as a path separator.
|
|
16414
|
+
* Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
|
|
16415
|
+
*/
|
|
16416
|
+
function removeDuplicateSlashes(pattern) {
|
|
16417
|
+
return pattern.replace(DOUBLE_SLASH_RE$1, '/');
|
|
16418
|
+
}
|
|
16419
16419
|
patterns.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
16420
16420
|
|
|
16421
|
-
var async$
|
|
16421
|
+
var async$7 = {};
|
|
16422
16422
|
|
|
16423
|
-
var
|
|
16423
|
+
var async$6 = {};
|
|
16424
16424
|
|
|
16425
16425
|
var out$3 = {};
|
|
16426
16426
|
|
|
16427
16427
|
var async$5 = {};
|
|
16428
16428
|
|
|
16429
|
-
|
|
16430
|
-
|
|
16429
|
+
var async$4 = {};
|
|
16430
|
+
|
|
16431
|
+
var out$2 = {};
|
|
16432
|
+
|
|
16433
|
+
var async$3 = {};
|
|
16434
|
+
|
|
16435
|
+
var out$1 = {};
|
|
16436
|
+
|
|
16437
|
+
var async$2 = {};
|
|
16438
|
+
|
|
16439
|
+
Object.defineProperty(async$2, "__esModule", { value: true });
|
|
16440
|
+
async$2.read = void 0;
|
|
16431
16441
|
function read$4(path, settings, callback) {
|
|
16432
16442
|
settings.fs.lstat(path, (lstatError, lstat) => {
|
|
16433
16443
|
if (lstatError !== null) {
|
|
@@ -16454,7 +16464,7 @@ function read$4(path, settings, callback) {
|
|
|
16454
16464
|
});
|
|
16455
16465
|
});
|
|
16456
16466
|
}
|
|
16457
|
-
async$
|
|
16467
|
+
async$2.read = read$4;
|
|
16458
16468
|
function callFailureCallback$2(callback, error) {
|
|
16459
16469
|
callback(error);
|
|
16460
16470
|
}
|
|
@@ -16526,25 +16536,25 @@ class Settings$2 {
|
|
|
16526
16536
|
}
|
|
16527
16537
|
settings$3.default = Settings$2;
|
|
16528
16538
|
|
|
16529
|
-
Object.defineProperty(out$
|
|
16530
|
-
out$
|
|
16531
|
-
const async$
|
|
16539
|
+
Object.defineProperty(out$1, "__esModule", { value: true });
|
|
16540
|
+
out$1.statSync = out$1.stat = out$1.Settings = void 0;
|
|
16541
|
+
const async$1 = async$2;
|
|
16532
16542
|
const sync$7 = sync$8;
|
|
16533
16543
|
const settings_1$3 = settings$3;
|
|
16534
|
-
out$
|
|
16544
|
+
out$1.Settings = settings_1$3.default;
|
|
16535
16545
|
function stat$4(path, optionsOrSettingsOrCallback, callback) {
|
|
16536
16546
|
if (typeof optionsOrSettingsOrCallback === 'function') {
|
|
16537
|
-
async$
|
|
16547
|
+
async$1.read(path, getSettings$2(), optionsOrSettingsOrCallback);
|
|
16538
16548
|
return;
|
|
16539
16549
|
}
|
|
16540
|
-
async$
|
|
16550
|
+
async$1.read(path, getSettings$2(optionsOrSettingsOrCallback), callback);
|
|
16541
16551
|
}
|
|
16542
|
-
out$
|
|
16552
|
+
out$1.stat = stat$4;
|
|
16543
16553
|
function statSync(path, optionsOrSettings) {
|
|
16544
16554
|
const settings = getSettings$2(optionsOrSettings);
|
|
16545
16555
|
return sync$7.read(path, settings);
|
|
16546
16556
|
}
|
|
16547
|
-
out$
|
|
16557
|
+
out$1.statSync = statSync;
|
|
16548
16558
|
function getSettings$2(settingsOrOptions = {}) {
|
|
16549
16559
|
if (settingsOrOptions instanceof settings_1$3.default) {
|
|
16550
16560
|
return settingsOrOptions;
|
|
@@ -16552,16 +16562,6 @@ function getSettings$2(settingsOrOptions = {}) {
|
|
|
16552
16562
|
return new settings_1$3.default(settingsOrOptions);
|
|
16553
16563
|
}
|
|
16554
16564
|
|
|
16555
|
-
var out$2 = {};
|
|
16556
|
-
|
|
16557
|
-
var async$3 = {};
|
|
16558
|
-
|
|
16559
|
-
var async$2 = {};
|
|
16560
|
-
|
|
16561
|
-
var out$1 = {};
|
|
16562
|
-
|
|
16563
|
-
var async$1 = {};
|
|
16564
|
-
|
|
16565
16565
|
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
16566
16566
|
|
|
16567
16567
|
let promise;
|
|
@@ -16688,9 +16688,9 @@ function joinPathSegments$1(a, b, separator) {
|
|
|
16688
16688
|
}
|
|
16689
16689
|
common$a.joinPathSegments = joinPathSegments$1;
|
|
16690
16690
|
|
|
16691
|
-
Object.defineProperty(async$
|
|
16692
|
-
async$
|
|
16693
|
-
const fsStat$5 = out$
|
|
16691
|
+
Object.defineProperty(async$3, "__esModule", { value: true });
|
|
16692
|
+
async$3.readdir = async$3.readdirWithFileTypes = async$3.read = void 0;
|
|
16693
|
+
const fsStat$5 = out$1;
|
|
16694
16694
|
const rpl = runParallel_1;
|
|
16695
16695
|
const constants_1$1 = constants$2;
|
|
16696
16696
|
const utils$8 = utils$9;
|
|
@@ -16702,7 +16702,7 @@ function read$2(directory, settings, callback) {
|
|
|
16702
16702
|
}
|
|
16703
16703
|
readdir$3(directory, settings, callback);
|
|
16704
16704
|
}
|
|
16705
|
-
async$
|
|
16705
|
+
async$3.read = read$2;
|
|
16706
16706
|
function readdirWithFileTypes$1(directory, settings, callback) {
|
|
16707
16707
|
settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
16708
16708
|
if (readdirError !== null) {
|
|
@@ -16728,7 +16728,7 @@ function readdirWithFileTypes$1(directory, settings, callback) {
|
|
|
16728
16728
|
});
|
|
16729
16729
|
});
|
|
16730
16730
|
}
|
|
16731
|
-
async$
|
|
16731
|
+
async$3.readdirWithFileTypes = readdirWithFileTypes$1;
|
|
16732
16732
|
function makeRplTaskEntry(entry, settings) {
|
|
16733
16733
|
return (done) => {
|
|
16734
16734
|
if (!entry.dirent.isSymbolicLink()) {
|
|
@@ -16784,7 +16784,7 @@ function readdir$3(directory, settings, callback) {
|
|
|
16784
16784
|
});
|
|
16785
16785
|
});
|
|
16786
16786
|
}
|
|
16787
|
-
async$
|
|
16787
|
+
async$3.readdir = readdir$3;
|
|
16788
16788
|
function callFailureCallback$1(callback, error) {
|
|
16789
16789
|
callback(error);
|
|
16790
16790
|
}
|
|
@@ -16796,7 +16796,7 @@ var sync$6 = {};
|
|
|
16796
16796
|
|
|
16797
16797
|
Object.defineProperty(sync$6, "__esModule", { value: true });
|
|
16798
16798
|
sync$6.readdir = sync$6.readdirWithFileTypes = sync$6.read = void 0;
|
|
16799
|
-
const fsStat$4 = out$
|
|
16799
|
+
const fsStat$4 = out$1;
|
|
16800
16800
|
const constants_1 = constants$2;
|
|
16801
16801
|
const utils$7 = utils$9;
|
|
16802
16802
|
const common$8 = common$a;
|
|
@@ -16875,7 +16875,7 @@ var fs$b = {};
|
|
|
16875
16875
|
|
|
16876
16876
|
Object.defineProperty(settings$2, "__esModule", { value: true });
|
|
16877
16877
|
const path$d = require$$0$4;
|
|
16878
|
-
const fsStat$3 = out$
|
|
16878
|
+
const fsStat$3 = out$1;
|
|
16879
16879
|
const fs$a = fs$b;
|
|
16880
16880
|
class Settings$1 {
|
|
16881
16881
|
constructor(_options = {}) {
|
|
@@ -16897,12 +16897,12 @@ class Settings$1 {
|
|
|
16897
16897
|
}
|
|
16898
16898
|
settings$2.default = Settings$1;
|
|
16899
16899
|
|
|
16900
|
-
Object.defineProperty(out$
|
|
16901
|
-
out$
|
|
16902
|
-
const async = async$
|
|
16900
|
+
Object.defineProperty(out$2, "__esModule", { value: true });
|
|
16901
|
+
out$2.Settings = out$2.scandirSync = out$2.scandir = void 0;
|
|
16902
|
+
const async = async$3;
|
|
16903
16903
|
const sync$5 = sync$6;
|
|
16904
16904
|
const settings_1$2 = settings$2;
|
|
16905
|
-
out$
|
|
16905
|
+
out$2.Settings = settings_1$2.default;
|
|
16906
16906
|
function scandir(path, optionsOrSettingsOrCallback, callback) {
|
|
16907
16907
|
if (typeof optionsOrSettingsOrCallback === 'function') {
|
|
16908
16908
|
async.read(path, getSettings$1(), optionsOrSettingsOrCallback);
|
|
@@ -16910,12 +16910,12 @@ function scandir(path, optionsOrSettingsOrCallback, callback) {
|
|
|
16910
16910
|
}
|
|
16911
16911
|
async.read(path, getSettings$1(optionsOrSettingsOrCallback), callback);
|
|
16912
16912
|
}
|
|
16913
|
-
out$
|
|
16913
|
+
out$2.scandir = scandir;
|
|
16914
16914
|
function scandirSync(path, optionsOrSettings) {
|
|
16915
16915
|
const settings = getSettings$1(optionsOrSettings);
|
|
16916
16916
|
return sync$5.read(path, settings);
|
|
16917
16917
|
}
|
|
16918
|
-
out$
|
|
16918
|
+
out$2.scandirSync = scandirSync;
|
|
16919
16919
|
function getSettings$1(settingsOrOptions = {}) {
|
|
16920
16920
|
if (settingsOrOptions instanceof settings_1$2.default) {
|
|
16921
16921
|
return settingsOrOptions;
|
|
@@ -17285,13 +17285,13 @@ class Reader$1 {
|
|
|
17285
17285
|
}
|
|
17286
17286
|
reader$1.default = Reader$1;
|
|
17287
17287
|
|
|
17288
|
-
Object.defineProperty(async$
|
|
17288
|
+
Object.defineProperty(async$4, "__esModule", { value: true });
|
|
17289
17289
|
const events_1 = require$$0$5;
|
|
17290
|
-
const fsScandir$2 = out$
|
|
17290
|
+
const fsScandir$2 = out$2;
|
|
17291
17291
|
const fastq = queue.exports;
|
|
17292
17292
|
const common$5 = common$7;
|
|
17293
|
-
const reader_1$
|
|
17294
|
-
class AsyncReader extends reader_1$
|
|
17293
|
+
const reader_1$4 = reader$1;
|
|
17294
|
+
class AsyncReader extends reader_1$4.default {
|
|
17295
17295
|
constructor(_root, _settings) {
|
|
17296
17296
|
super(_root, _settings);
|
|
17297
17297
|
this._settings = _settings;
|
|
@@ -17380,15 +17380,15 @@ class AsyncReader extends reader_1$3.default {
|
|
|
17380
17380
|
this._emitter.emit('entry', entry);
|
|
17381
17381
|
}
|
|
17382
17382
|
}
|
|
17383
|
-
async$
|
|
17383
|
+
async$4.default = AsyncReader;
|
|
17384
17384
|
|
|
17385
|
-
Object.defineProperty(async$
|
|
17386
|
-
const async_1$
|
|
17385
|
+
Object.defineProperty(async$5, "__esModule", { value: true });
|
|
17386
|
+
const async_1$4 = async$4;
|
|
17387
17387
|
class AsyncProvider {
|
|
17388
17388
|
constructor(_root, _settings) {
|
|
17389
17389
|
this._root = _root;
|
|
17390
17390
|
this._settings = _settings;
|
|
17391
|
-
this._reader = new async_1$
|
|
17391
|
+
this._reader = new async_1$4.default(this._root, this._settings);
|
|
17392
17392
|
this._storage = [];
|
|
17393
17393
|
}
|
|
17394
17394
|
read(callback) {
|
|
@@ -17404,7 +17404,7 @@ class AsyncProvider {
|
|
|
17404
17404
|
this._reader.read();
|
|
17405
17405
|
}
|
|
17406
17406
|
}
|
|
17407
|
-
async$
|
|
17407
|
+
async$5.default = AsyncProvider;
|
|
17408
17408
|
function callFailureCallback(callback, error) {
|
|
17409
17409
|
callback(error);
|
|
17410
17410
|
}
|
|
@@ -17412,16 +17412,16 @@ function callSuccessCallback(callback, entries) {
|
|
|
17412
17412
|
callback(null, entries);
|
|
17413
17413
|
}
|
|
17414
17414
|
|
|
17415
|
-
var stream$
|
|
17415
|
+
var stream$2 = {};
|
|
17416
17416
|
|
|
17417
|
-
Object.defineProperty(stream$
|
|
17417
|
+
Object.defineProperty(stream$2, "__esModule", { value: true });
|
|
17418
17418
|
const stream_1$5 = require$$0$7;
|
|
17419
|
-
const async_1$
|
|
17419
|
+
const async_1$3 = async$4;
|
|
17420
17420
|
class StreamProvider {
|
|
17421
17421
|
constructor(_root, _settings) {
|
|
17422
17422
|
this._root = _root;
|
|
17423
17423
|
this._settings = _settings;
|
|
17424
|
-
this._reader = new async_1$
|
|
17424
|
+
this._reader = new async_1$3.default(this._root, this._settings);
|
|
17425
17425
|
this._stream = new stream_1$5.Readable({
|
|
17426
17426
|
objectMode: true,
|
|
17427
17427
|
read: () => { },
|
|
@@ -17446,17 +17446,17 @@ class StreamProvider {
|
|
|
17446
17446
|
return this._stream;
|
|
17447
17447
|
}
|
|
17448
17448
|
}
|
|
17449
|
-
stream$
|
|
17449
|
+
stream$2.default = StreamProvider;
|
|
17450
17450
|
|
|
17451
17451
|
var sync$4 = {};
|
|
17452
17452
|
|
|
17453
17453
|
var sync$3 = {};
|
|
17454
17454
|
|
|
17455
17455
|
Object.defineProperty(sync$3, "__esModule", { value: true });
|
|
17456
|
-
const fsScandir$1 = out$
|
|
17456
|
+
const fsScandir$1 = out$2;
|
|
17457
17457
|
const common$4 = common$7;
|
|
17458
|
-
const reader_1$
|
|
17459
|
-
class SyncReader extends reader_1$
|
|
17458
|
+
const reader_1$3 = reader$1;
|
|
17459
|
+
class SyncReader extends reader_1$3.default {
|
|
17460
17460
|
constructor() {
|
|
17461
17461
|
super(...arguments);
|
|
17462
17462
|
this._scandir = fsScandir$1.scandirSync;
|
|
@@ -17529,7 +17529,7 @@ var settings$1 = {};
|
|
|
17529
17529
|
|
|
17530
17530
|
Object.defineProperty(settings$1, "__esModule", { value: true });
|
|
17531
17531
|
const path$c = require$$0$4;
|
|
17532
|
-
const fsScandir = out$
|
|
17532
|
+
const fsScandir = out$2;
|
|
17533
17533
|
class Settings {
|
|
17534
17534
|
constructor(_options = {}) {
|
|
17535
17535
|
this._options = _options;
|
|
@@ -17553,33 +17553,33 @@ class Settings {
|
|
|
17553
17553
|
}
|
|
17554
17554
|
settings$1.default = Settings;
|
|
17555
17555
|
|
|
17556
|
-
Object.defineProperty(out$
|
|
17557
|
-
out$
|
|
17558
|
-
const async_1$
|
|
17559
|
-
const stream_1$4 = stream$
|
|
17556
|
+
Object.defineProperty(out$3, "__esModule", { value: true });
|
|
17557
|
+
out$3.Settings = out$3.walkStream = out$3.walkSync = out$3.walk = void 0;
|
|
17558
|
+
const async_1$2 = async$5;
|
|
17559
|
+
const stream_1$4 = stream$2;
|
|
17560
17560
|
const sync_1$2 = sync$4;
|
|
17561
17561
|
const settings_1$1 = settings$1;
|
|
17562
|
-
out$
|
|
17562
|
+
out$3.Settings = settings_1$1.default;
|
|
17563
17563
|
function walk$2(directory, optionsOrSettingsOrCallback, callback) {
|
|
17564
17564
|
if (typeof optionsOrSettingsOrCallback === 'function') {
|
|
17565
|
-
new async_1$
|
|
17565
|
+
new async_1$2.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
|
|
17566
17566
|
return;
|
|
17567
17567
|
}
|
|
17568
|
-
new async_1$
|
|
17568
|
+
new async_1$2.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
|
|
17569
17569
|
}
|
|
17570
|
-
out$
|
|
17570
|
+
out$3.walk = walk$2;
|
|
17571
17571
|
function walkSync(directory, optionsOrSettings) {
|
|
17572
17572
|
const settings = getSettings(optionsOrSettings);
|
|
17573
17573
|
const provider = new sync_1$2.default(directory, settings);
|
|
17574
17574
|
return provider.read();
|
|
17575
17575
|
}
|
|
17576
|
-
out$
|
|
17576
|
+
out$3.walkSync = walkSync;
|
|
17577
17577
|
function walkStream(directory, optionsOrSettings) {
|
|
17578
17578
|
const settings = getSettings(optionsOrSettings);
|
|
17579
17579
|
const provider = new stream_1$4.default(directory, settings);
|
|
17580
17580
|
return provider.read();
|
|
17581
17581
|
}
|
|
17582
|
-
out$
|
|
17582
|
+
out$3.walkStream = walkStream;
|
|
17583
17583
|
function getSettings(settingsOrOptions = {}) {
|
|
17584
17584
|
if (settingsOrOptions instanceof settings_1$1.default) {
|
|
17585
17585
|
return settingsOrOptions;
|
|
@@ -17589,93 +17589,130 @@ function getSettings(settingsOrOptions = {}) {
|
|
|
17589
17589
|
|
|
17590
17590
|
var reader = {};
|
|
17591
17591
|
|
|
17592
|
-
Object.defineProperty(reader, "__esModule", { value: true });
|
|
17593
|
-
const path$b = require$$0$4;
|
|
17594
|
-
const fsStat$2 = out$
|
|
17595
|
-
const utils$6 = utils$g;
|
|
17596
|
-
class Reader {
|
|
17597
|
-
constructor(_settings) {
|
|
17598
|
-
this._settings = _settings;
|
|
17599
|
-
this._fsStatSettings = new fsStat$2.Settings({
|
|
17600
|
-
followSymbolicLink: this._settings.followSymbolicLinks,
|
|
17601
|
-
fs: this._settings.fs,
|
|
17602
|
-
throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
|
|
17603
|
-
});
|
|
17604
|
-
}
|
|
17605
|
-
_getFullEntryPath(filepath) {
|
|
17606
|
-
return path$b.resolve(this._settings.cwd, filepath);
|
|
17607
|
-
}
|
|
17608
|
-
_makeEntry(stats, pattern) {
|
|
17609
|
-
const entry = {
|
|
17610
|
-
name: pattern,
|
|
17611
|
-
path: pattern,
|
|
17612
|
-
dirent: utils$6.fs.createDirentFromStats(pattern, stats)
|
|
17613
|
-
};
|
|
17614
|
-
if (this._settings.stats) {
|
|
17615
|
-
entry.stats = stats;
|
|
17616
|
-
}
|
|
17617
|
-
return entry;
|
|
17618
|
-
}
|
|
17619
|
-
_isFatalError(error) {
|
|
17620
|
-
return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
|
|
17621
|
-
}
|
|
17622
|
-
}
|
|
17592
|
+
Object.defineProperty(reader, "__esModule", { value: true });
|
|
17593
|
+
const path$b = require$$0$4;
|
|
17594
|
+
const fsStat$2 = out$1;
|
|
17595
|
+
const utils$6 = utils$g;
|
|
17596
|
+
class Reader {
|
|
17597
|
+
constructor(_settings) {
|
|
17598
|
+
this._settings = _settings;
|
|
17599
|
+
this._fsStatSettings = new fsStat$2.Settings({
|
|
17600
|
+
followSymbolicLink: this._settings.followSymbolicLinks,
|
|
17601
|
+
fs: this._settings.fs,
|
|
17602
|
+
throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
|
|
17603
|
+
});
|
|
17604
|
+
}
|
|
17605
|
+
_getFullEntryPath(filepath) {
|
|
17606
|
+
return path$b.resolve(this._settings.cwd, filepath);
|
|
17607
|
+
}
|
|
17608
|
+
_makeEntry(stats, pattern) {
|
|
17609
|
+
const entry = {
|
|
17610
|
+
name: pattern,
|
|
17611
|
+
path: pattern,
|
|
17612
|
+
dirent: utils$6.fs.createDirentFromStats(pattern, stats)
|
|
17613
|
+
};
|
|
17614
|
+
if (this._settings.stats) {
|
|
17615
|
+
entry.stats = stats;
|
|
17616
|
+
}
|
|
17617
|
+
return entry;
|
|
17618
|
+
}
|
|
17619
|
+
_isFatalError(error) {
|
|
17620
|
+
return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
|
|
17621
|
+
}
|
|
17622
|
+
}
|
|
17623
17623
|
reader.default = Reader;
|
|
17624
17624
|
|
|
17625
|
-
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
const
|
|
17629
|
-
const
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17633
|
-
|
|
17634
|
-
|
|
17635
|
-
|
|
17636
|
-
|
|
17637
|
-
|
|
17638
|
-
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17668
|
-
|
|
17669
|
-
|
|
17670
|
-
|
|
17671
|
-
|
|
17672
|
-
|
|
17673
|
-
|
|
17674
|
-
|
|
17675
|
-
|
|
17676
|
-
|
|
17677
|
-
}
|
|
17678
|
-
|
|
17625
|
+
var stream$1 = {};
|
|
17626
|
+
|
|
17627
|
+
Object.defineProperty(stream$1, "__esModule", { value: true });
|
|
17628
|
+
const stream_1$3 = require$$0$7;
|
|
17629
|
+
const fsStat$1 = out$1;
|
|
17630
|
+
const fsWalk$2 = out$3;
|
|
17631
|
+
const reader_1$2 = reader;
|
|
17632
|
+
class ReaderStream extends reader_1$2.default {
|
|
17633
|
+
constructor() {
|
|
17634
|
+
super(...arguments);
|
|
17635
|
+
this._walkStream = fsWalk$2.walkStream;
|
|
17636
|
+
this._stat = fsStat$1.stat;
|
|
17637
|
+
}
|
|
17638
|
+
dynamic(root, options) {
|
|
17639
|
+
return this._walkStream(root, options);
|
|
17640
|
+
}
|
|
17641
|
+
static(patterns, options) {
|
|
17642
|
+
const filepaths = patterns.map(this._getFullEntryPath, this);
|
|
17643
|
+
const stream = new stream_1$3.PassThrough({ objectMode: true });
|
|
17644
|
+
stream._write = (index, _enc, done) => {
|
|
17645
|
+
return this._getEntry(filepaths[index], patterns[index], options)
|
|
17646
|
+
.then((entry) => {
|
|
17647
|
+
if (entry !== null && options.entryFilter(entry)) {
|
|
17648
|
+
stream.push(entry);
|
|
17649
|
+
}
|
|
17650
|
+
if (index === filepaths.length - 1) {
|
|
17651
|
+
stream.end();
|
|
17652
|
+
}
|
|
17653
|
+
done();
|
|
17654
|
+
})
|
|
17655
|
+
.catch(done);
|
|
17656
|
+
};
|
|
17657
|
+
for (let i = 0; i < filepaths.length; i++) {
|
|
17658
|
+
stream.write(i);
|
|
17659
|
+
}
|
|
17660
|
+
return stream;
|
|
17661
|
+
}
|
|
17662
|
+
_getEntry(filepath, pattern, options) {
|
|
17663
|
+
return this._getStat(filepath)
|
|
17664
|
+
.then((stats) => this._makeEntry(stats, pattern))
|
|
17665
|
+
.catch((error) => {
|
|
17666
|
+
if (options.errorFilter(error)) {
|
|
17667
|
+
return null;
|
|
17668
|
+
}
|
|
17669
|
+
throw error;
|
|
17670
|
+
});
|
|
17671
|
+
}
|
|
17672
|
+
_getStat(filepath) {
|
|
17673
|
+
return new Promise((resolve, reject) => {
|
|
17674
|
+
this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
|
17675
|
+
return error === null ? resolve(stats) : reject(error);
|
|
17676
|
+
});
|
|
17677
|
+
});
|
|
17678
|
+
}
|
|
17679
|
+
}
|
|
17680
|
+
stream$1.default = ReaderStream;
|
|
17681
|
+
|
|
17682
|
+
Object.defineProperty(async$6, "__esModule", { value: true });
|
|
17683
|
+
const fsWalk$1 = out$3;
|
|
17684
|
+
const reader_1$1 = reader;
|
|
17685
|
+
const stream_1$2 = stream$1;
|
|
17686
|
+
class ReaderAsync extends reader_1$1.default {
|
|
17687
|
+
constructor() {
|
|
17688
|
+
super(...arguments);
|
|
17689
|
+
this._walkAsync = fsWalk$1.walk;
|
|
17690
|
+
this._readerStream = new stream_1$2.default(this._settings);
|
|
17691
|
+
}
|
|
17692
|
+
dynamic(root, options) {
|
|
17693
|
+
return new Promise((resolve, reject) => {
|
|
17694
|
+
this._walkAsync(root, options, (error, entries) => {
|
|
17695
|
+
if (error === null) {
|
|
17696
|
+
resolve(entries);
|
|
17697
|
+
}
|
|
17698
|
+
else {
|
|
17699
|
+
reject(error);
|
|
17700
|
+
}
|
|
17701
|
+
});
|
|
17702
|
+
});
|
|
17703
|
+
}
|
|
17704
|
+
async static(patterns, options) {
|
|
17705
|
+
const entries = [];
|
|
17706
|
+
const stream = this._readerStream.static(patterns, options);
|
|
17707
|
+
// After #235, replace it with an asynchronous iterator.
|
|
17708
|
+
return new Promise((resolve, reject) => {
|
|
17709
|
+
stream.once('error', reject);
|
|
17710
|
+
stream.on('data', (entry) => entries.push(entry));
|
|
17711
|
+
stream.once('end', () => resolve(entries));
|
|
17712
|
+
});
|
|
17713
|
+
}
|
|
17714
|
+
}
|
|
17715
|
+
async$6.default = ReaderAsync;
|
|
17679
17716
|
|
|
17680
17717
|
var provider = {};
|
|
17681
17718
|
|
|
@@ -17685,569 +17722,568 @@ var partial = {};
|
|
|
17685
17722
|
|
|
17686
17723
|
var matcher = {};
|
|
17687
17724
|
|
|
17688
|
-
Object.defineProperty(matcher, "__esModule", { value: true });
|
|
17689
|
-
const utils$5 = utils$g;
|
|
17690
|
-
class Matcher {
|
|
17691
|
-
constructor(_patterns, _settings, _micromatchOptions) {
|
|
17692
|
-
this._patterns = _patterns;
|
|
17693
|
-
this._settings = _settings;
|
|
17694
|
-
this._micromatchOptions = _micromatchOptions;
|
|
17695
|
-
this._storage = [];
|
|
17696
|
-
this._fillStorage();
|
|
17697
|
-
}
|
|
17698
|
-
_fillStorage() {
|
|
17699
|
-
/**
|
|
17700
|
-
* The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
|
|
17701
|
-
* So, before expand patterns with brace expansion into separated patterns.
|
|
17702
|
-
*/
|
|
17703
|
-
const patterns = utils$5.pattern.expandPatternsWithBraceExpansion(this._patterns);
|
|
17704
|
-
for (const pattern of patterns) {
|
|
17705
|
-
const segments = this._getPatternSegments(pattern);
|
|
17706
|
-
const sections = this._splitSegmentsIntoSections(segments);
|
|
17707
|
-
this._storage.push({
|
|
17708
|
-
complete: sections.length <= 1,
|
|
17709
|
-
pattern,
|
|
17710
|
-
segments,
|
|
17711
|
-
sections
|
|
17712
|
-
});
|
|
17713
|
-
}
|
|
17714
|
-
}
|
|
17715
|
-
_getPatternSegments(pattern) {
|
|
17716
|
-
const parts = utils$5.pattern.getPatternParts(pattern, this._micromatchOptions);
|
|
17717
|
-
return parts.map((part) => {
|
|
17718
|
-
const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings);
|
|
17719
|
-
if (!dynamic) {
|
|
17720
|
-
return {
|
|
17721
|
-
dynamic: false,
|
|
17722
|
-
pattern: part
|
|
17723
|
-
};
|
|
17724
|
-
}
|
|
17725
|
-
return {
|
|
17726
|
-
dynamic: true,
|
|
17727
|
-
pattern: part,
|
|
17728
|
-
patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
|
|
17729
|
-
};
|
|
17730
|
-
});
|
|
17731
|
-
}
|
|
17732
|
-
_splitSegmentsIntoSections(segments) {
|
|
17733
|
-
return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
|
|
17734
|
-
}
|
|
17735
|
-
}
|
|
17725
|
+
Object.defineProperty(matcher, "__esModule", { value: true });
|
|
17726
|
+
const utils$5 = utils$g;
|
|
17727
|
+
class Matcher {
|
|
17728
|
+
constructor(_patterns, _settings, _micromatchOptions) {
|
|
17729
|
+
this._patterns = _patterns;
|
|
17730
|
+
this._settings = _settings;
|
|
17731
|
+
this._micromatchOptions = _micromatchOptions;
|
|
17732
|
+
this._storage = [];
|
|
17733
|
+
this._fillStorage();
|
|
17734
|
+
}
|
|
17735
|
+
_fillStorage() {
|
|
17736
|
+
/**
|
|
17737
|
+
* The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
|
|
17738
|
+
* So, before expand patterns with brace expansion into separated patterns.
|
|
17739
|
+
*/
|
|
17740
|
+
const patterns = utils$5.pattern.expandPatternsWithBraceExpansion(this._patterns);
|
|
17741
|
+
for (const pattern of patterns) {
|
|
17742
|
+
const segments = this._getPatternSegments(pattern);
|
|
17743
|
+
const sections = this._splitSegmentsIntoSections(segments);
|
|
17744
|
+
this._storage.push({
|
|
17745
|
+
complete: sections.length <= 1,
|
|
17746
|
+
pattern,
|
|
17747
|
+
segments,
|
|
17748
|
+
sections
|
|
17749
|
+
});
|
|
17750
|
+
}
|
|
17751
|
+
}
|
|
17752
|
+
_getPatternSegments(pattern) {
|
|
17753
|
+
const parts = utils$5.pattern.getPatternParts(pattern, this._micromatchOptions);
|
|
17754
|
+
return parts.map((part) => {
|
|
17755
|
+
const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings);
|
|
17756
|
+
if (!dynamic) {
|
|
17757
|
+
return {
|
|
17758
|
+
dynamic: false,
|
|
17759
|
+
pattern: part
|
|
17760
|
+
};
|
|
17761
|
+
}
|
|
17762
|
+
return {
|
|
17763
|
+
dynamic: true,
|
|
17764
|
+
pattern: part,
|
|
17765
|
+
patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
|
|
17766
|
+
};
|
|
17767
|
+
});
|
|
17768
|
+
}
|
|
17769
|
+
_splitSegmentsIntoSections(segments) {
|
|
17770
|
+
return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
|
|
17771
|
+
}
|
|
17772
|
+
}
|
|
17736
17773
|
matcher.default = Matcher;
|
|
17737
17774
|
|
|
17738
|
-
Object.defineProperty(partial, "__esModule", { value: true });
|
|
17739
|
-
const matcher_1 = matcher;
|
|
17740
|
-
class PartialMatcher extends matcher_1.default {
|
|
17741
|
-
match(filepath) {
|
|
17742
|
-
const parts = filepath.split('/');
|
|
17743
|
-
const levels = parts.length;
|
|
17744
|
-
const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
|
|
17745
|
-
for (const pattern of patterns) {
|
|
17746
|
-
const section = pattern.sections[0];
|
|
17747
|
-
/**
|
|
17748
|
-
* In this case, the pattern has a globstar and we must read all directories unconditionally,
|
|
17749
|
-
* but only if the level has reached the end of the first group.
|
|
17750
|
-
*
|
|
17751
|
-
* fixtures/{a,b}/**
|
|
17752
|
-
* ^ true/false ^ always true
|
|
17753
|
-
*/
|
|
17754
|
-
if (!pattern.complete && levels > section.length) {
|
|
17755
|
-
return true;
|
|
17756
|
-
}
|
|
17757
|
-
const match = parts.every((part, index) => {
|
|
17758
|
-
const segment = pattern.segments[index];
|
|
17759
|
-
if (segment.dynamic && segment.patternRe.test(part)) {
|
|
17760
|
-
return true;
|
|
17761
|
-
}
|
|
17762
|
-
if (!segment.dynamic && segment.pattern === part) {
|
|
17763
|
-
return true;
|
|
17764
|
-
}
|
|
17765
|
-
return false;
|
|
17766
|
-
});
|
|
17767
|
-
if (match) {
|
|
17768
|
-
return true;
|
|
17769
|
-
}
|
|
17770
|
-
}
|
|
17771
|
-
return false;
|
|
17772
|
-
}
|
|
17773
|
-
}
|
|
17775
|
+
Object.defineProperty(partial, "__esModule", { value: true });
|
|
17776
|
+
const matcher_1 = matcher;
|
|
17777
|
+
class PartialMatcher extends matcher_1.default {
|
|
17778
|
+
match(filepath) {
|
|
17779
|
+
const parts = filepath.split('/');
|
|
17780
|
+
const levels = parts.length;
|
|
17781
|
+
const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
|
|
17782
|
+
for (const pattern of patterns) {
|
|
17783
|
+
const section = pattern.sections[0];
|
|
17784
|
+
/**
|
|
17785
|
+
* In this case, the pattern has a globstar and we must read all directories unconditionally,
|
|
17786
|
+
* but only if the level has reached the end of the first group.
|
|
17787
|
+
*
|
|
17788
|
+
* fixtures/{a,b}/**
|
|
17789
|
+
* ^ true/false ^ always true
|
|
17790
|
+
*/
|
|
17791
|
+
if (!pattern.complete && levels > section.length) {
|
|
17792
|
+
return true;
|
|
17793
|
+
}
|
|
17794
|
+
const match = parts.every((part, index) => {
|
|
17795
|
+
const segment = pattern.segments[index];
|
|
17796
|
+
if (segment.dynamic && segment.patternRe.test(part)) {
|
|
17797
|
+
return true;
|
|
17798
|
+
}
|
|
17799
|
+
if (!segment.dynamic && segment.pattern === part) {
|
|
17800
|
+
return true;
|
|
17801
|
+
}
|
|
17802
|
+
return false;
|
|
17803
|
+
});
|
|
17804
|
+
if (match) {
|
|
17805
|
+
return true;
|
|
17806
|
+
}
|
|
17807
|
+
}
|
|
17808
|
+
return false;
|
|
17809
|
+
}
|
|
17810
|
+
}
|
|
17774
17811
|
partial.default = PartialMatcher;
|
|
17775
17812
|
|
|
17776
|
-
Object.defineProperty(deep, "__esModule", { value: true });
|
|
17777
|
-
const utils$4 = utils$g;
|
|
17778
|
-
const partial_1 = partial;
|
|
17779
|
-
class DeepFilter {
|
|
17780
|
-
constructor(_settings, _micromatchOptions) {
|
|
17781
|
-
this._settings = _settings;
|
|
17782
|
-
this._micromatchOptions = _micromatchOptions;
|
|
17783
|
-
}
|
|
17784
|
-
getFilter(basePath, positive, negative) {
|
|
17785
|
-
const matcher = this._getMatcher(positive);
|
|
17786
|
-
const negativeRe = this._getNegativePatternsRe(negative);
|
|
17787
|
-
return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
|
17788
|
-
}
|
|
17789
|
-
_getMatcher(patterns) {
|
|
17790
|
-
return new partial_1.default(patterns, this._settings, this._micromatchOptions);
|
|
17791
|
-
}
|
|
17792
|
-
_getNegativePatternsRe(patterns) {
|
|
17793
|
-
const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
|
|
17794
|
-
return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
|
17795
|
-
}
|
|
17796
|
-
_filter(basePath, entry, matcher, negativeRe) {
|
|
17797
|
-
if (this._isSkippedByDeep(basePath, entry.path)) {
|
|
17798
|
-
return false;
|
|
17799
|
-
}
|
|
17800
|
-
if (this._isSkippedSymbolicLink(entry)) {
|
|
17801
|
-
return false;
|
|
17802
|
-
}
|
|
17803
|
-
const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
|
|
17804
|
-
if (this._isSkippedByPositivePatterns(filepath, matcher)) {
|
|
17805
|
-
return false;
|
|
17806
|
-
}
|
|
17807
|
-
return this._isSkippedByNegativePatterns(filepath, negativeRe);
|
|
17808
|
-
}
|
|
17809
|
-
_isSkippedByDeep(basePath, entryPath) {
|
|
17810
|
-
/**
|
|
17811
|
-
* Avoid unnecessary depth calculations when it doesn't matter.
|
|
17812
|
-
*/
|
|
17813
|
-
if (this._settings.deep === Infinity) {
|
|
17814
|
-
return false;
|
|
17815
|
-
}
|
|
17816
|
-
return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
|
17817
|
-
}
|
|
17818
|
-
_getEntryLevel(basePath, entryPath) {
|
|
17819
|
-
const entryPathDepth = entryPath.split('/').length;
|
|
17820
|
-
if (basePath === '') {
|
|
17821
|
-
return entryPathDepth;
|
|
17822
|
-
}
|
|
17823
|
-
const basePathDepth = basePath.split('/').length;
|
|
17824
|
-
return entryPathDepth - basePathDepth;
|
|
17825
|
-
}
|
|
17826
|
-
_isSkippedSymbolicLink(entry) {
|
|
17827
|
-
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
|
17828
|
-
}
|
|
17829
|
-
_isSkippedByPositivePatterns(entryPath, matcher) {
|
|
17830
|
-
return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
|
17831
|
-
}
|
|
17832
|
-
_isSkippedByNegativePatterns(entryPath, patternsRe) {
|
|
17833
|
-
return !utils$4.pattern.matchAny(entryPath, patternsRe);
|
|
17834
|
-
}
|
|
17835
|
-
}
|
|
17813
|
+
Object.defineProperty(deep, "__esModule", { value: true });
|
|
17814
|
+
const utils$4 = utils$g;
|
|
17815
|
+
const partial_1 = partial;
|
|
17816
|
+
class DeepFilter {
|
|
17817
|
+
constructor(_settings, _micromatchOptions) {
|
|
17818
|
+
this._settings = _settings;
|
|
17819
|
+
this._micromatchOptions = _micromatchOptions;
|
|
17820
|
+
}
|
|
17821
|
+
getFilter(basePath, positive, negative) {
|
|
17822
|
+
const matcher = this._getMatcher(positive);
|
|
17823
|
+
const negativeRe = this._getNegativePatternsRe(negative);
|
|
17824
|
+
return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
|
17825
|
+
}
|
|
17826
|
+
_getMatcher(patterns) {
|
|
17827
|
+
return new partial_1.default(patterns, this._settings, this._micromatchOptions);
|
|
17828
|
+
}
|
|
17829
|
+
_getNegativePatternsRe(patterns) {
|
|
17830
|
+
const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
|
|
17831
|
+
return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
|
17832
|
+
}
|
|
17833
|
+
_filter(basePath, entry, matcher, negativeRe) {
|
|
17834
|
+
if (this._isSkippedByDeep(basePath, entry.path)) {
|
|
17835
|
+
return false;
|
|
17836
|
+
}
|
|
17837
|
+
if (this._isSkippedSymbolicLink(entry)) {
|
|
17838
|
+
return false;
|
|
17839
|
+
}
|
|
17840
|
+
const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
|
|
17841
|
+
if (this._isSkippedByPositivePatterns(filepath, matcher)) {
|
|
17842
|
+
return false;
|
|
17843
|
+
}
|
|
17844
|
+
return this._isSkippedByNegativePatterns(filepath, negativeRe);
|
|
17845
|
+
}
|
|
17846
|
+
_isSkippedByDeep(basePath, entryPath) {
|
|
17847
|
+
/**
|
|
17848
|
+
* Avoid unnecessary depth calculations when it doesn't matter.
|
|
17849
|
+
*/
|
|
17850
|
+
if (this._settings.deep === Infinity) {
|
|
17851
|
+
return false;
|
|
17852
|
+
}
|
|
17853
|
+
return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
|
17854
|
+
}
|
|
17855
|
+
_getEntryLevel(basePath, entryPath) {
|
|
17856
|
+
const entryPathDepth = entryPath.split('/').length;
|
|
17857
|
+
if (basePath === '') {
|
|
17858
|
+
return entryPathDepth;
|
|
17859
|
+
}
|
|
17860
|
+
const basePathDepth = basePath.split('/').length;
|
|
17861
|
+
return entryPathDepth - basePathDepth;
|
|
17862
|
+
}
|
|
17863
|
+
_isSkippedSymbolicLink(entry) {
|
|
17864
|
+
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
|
17865
|
+
}
|
|
17866
|
+
_isSkippedByPositivePatterns(entryPath, matcher) {
|
|
17867
|
+
return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
|
17868
|
+
}
|
|
17869
|
+
_isSkippedByNegativePatterns(entryPath, patternsRe) {
|
|
17870
|
+
return !utils$4.pattern.matchAny(entryPath, patternsRe);
|
|
17871
|
+
}
|
|
17872
|
+
}
|
|
17836
17873
|
deep.default = DeepFilter;
|
|
17837
17874
|
|
|
17838
17875
|
var entry$1 = {};
|
|
17839
17876
|
|
|
17840
|
-
Object.defineProperty(entry$1, "__esModule", { value: true });
|
|
17841
|
-
const utils$3 = utils$g;
|
|
17842
|
-
class EntryFilter {
|
|
17843
|
-
constructor(_settings, _micromatchOptions) {
|
|
17844
|
-
this._settings = _settings;
|
|
17845
|
-
this._micromatchOptions = _micromatchOptions;
|
|
17846
|
-
this.index = new Map();
|
|
17847
|
-
}
|
|
17848
|
-
getFilter(positive, negative) {
|
|
17849
|
-
const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions);
|
|
17850
|
-
const negativeRe = utils$3.pattern.convertPatternsToRe(negative, this._micromatchOptions);
|
|
17851
|
-
return (entry) => this._filter(entry, positiveRe, negativeRe);
|
|
17852
|
-
}
|
|
17853
|
-
_filter(entry, positiveRe, negativeRe) {
|
|
17854
|
-
if (this._settings.unique && this._isDuplicateEntry(entry)) {
|
|
17855
|
-
return false;
|
|
17856
|
-
}
|
|
17857
|
-
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
|
17858
|
-
return false;
|
|
17859
|
-
}
|
|
17860
|
-
if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
|
|
17861
|
-
return false;
|
|
17862
|
-
}
|
|
17863
|
-
const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
|
|
17864
|
-
const
|
|
17865
|
-
|
|
17866
|
-
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
|
|
17870
|
-
|
|
17871
|
-
|
|
17872
|
-
|
|
17873
|
-
|
|
17874
|
-
|
|
17875
|
-
|
|
17876
|
-
|
|
17877
|
-
|
|
17878
|
-
|
|
17879
|
-
|
|
17880
|
-
|
|
17881
|
-
|
|
17882
|
-
|
|
17883
|
-
|
|
17884
|
-
|
|
17885
|
-
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
|
|
17889
|
-
|
|
17890
|
-
|
|
17891
|
-
|
|
17892
|
-
|
|
17893
|
-
|
|
17894
|
-
|
|
17895
|
-
|
|
17896
|
-
|
|
17897
|
-
|
|
17877
|
+
Object.defineProperty(entry$1, "__esModule", { value: true });
|
|
17878
|
+
const utils$3 = utils$g;
|
|
17879
|
+
class EntryFilter {
|
|
17880
|
+
constructor(_settings, _micromatchOptions) {
|
|
17881
|
+
this._settings = _settings;
|
|
17882
|
+
this._micromatchOptions = _micromatchOptions;
|
|
17883
|
+
this.index = new Map();
|
|
17884
|
+
}
|
|
17885
|
+
getFilter(positive, negative) {
|
|
17886
|
+
const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions);
|
|
17887
|
+
const negativeRe = utils$3.pattern.convertPatternsToRe(negative, this._micromatchOptions);
|
|
17888
|
+
return (entry) => this._filter(entry, positiveRe, negativeRe);
|
|
17889
|
+
}
|
|
17890
|
+
_filter(entry, positiveRe, negativeRe) {
|
|
17891
|
+
if (this._settings.unique && this._isDuplicateEntry(entry)) {
|
|
17892
|
+
return false;
|
|
17893
|
+
}
|
|
17894
|
+
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
|
17895
|
+
return false;
|
|
17896
|
+
}
|
|
17897
|
+
if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
|
|
17898
|
+
return false;
|
|
17899
|
+
}
|
|
17900
|
+
const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
|
|
17901
|
+
const isDirectory = entry.dirent.isDirectory();
|
|
17902
|
+
const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory);
|
|
17903
|
+
if (this._settings.unique && isMatched) {
|
|
17904
|
+
this._createIndexRecord(entry);
|
|
17905
|
+
}
|
|
17906
|
+
return isMatched;
|
|
17907
|
+
}
|
|
17908
|
+
_isDuplicateEntry(entry) {
|
|
17909
|
+
return this.index.has(entry.path);
|
|
17910
|
+
}
|
|
17911
|
+
_createIndexRecord(entry) {
|
|
17912
|
+
this.index.set(entry.path, undefined);
|
|
17913
|
+
}
|
|
17914
|
+
_onlyFileFilter(entry) {
|
|
17915
|
+
return this._settings.onlyFiles && !entry.dirent.isFile();
|
|
17916
|
+
}
|
|
17917
|
+
_onlyDirectoryFilter(entry) {
|
|
17918
|
+
return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
|
17919
|
+
}
|
|
17920
|
+
_isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
|
|
17921
|
+
if (!this._settings.absolute) {
|
|
17922
|
+
return false;
|
|
17923
|
+
}
|
|
17924
|
+
const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, entryPath);
|
|
17925
|
+
return utils$3.pattern.matchAny(fullpath, patternsRe);
|
|
17926
|
+
}
|
|
17927
|
+
_isMatchToPatterns(entryPath, patternsRe, isDirectory) {
|
|
17928
|
+
const filepath = utils$3.path.removeLeadingDotSegment(entryPath);
|
|
17929
|
+
// Trying to match files and directories by patterns.
|
|
17930
|
+
const isMatched = utils$3.pattern.matchAny(filepath, patternsRe);
|
|
17931
|
+
// A pattern with a trailling slash can be used for directory matching.
|
|
17932
|
+
// To apply such pattern, we need to add a tralling slash to the path.
|
|
17933
|
+
if (!isMatched && isDirectory) {
|
|
17934
|
+
return utils$3.pattern.matchAny(filepath + '/', patternsRe);
|
|
17935
|
+
}
|
|
17936
|
+
return isMatched;
|
|
17937
|
+
}
|
|
17938
|
+
}
|
|
17898
17939
|
entry$1.default = EntryFilter;
|
|
17899
17940
|
|
|
17900
17941
|
var error$2 = {};
|
|
17901
17942
|
|
|
17902
|
-
Object.defineProperty(error$2, "__esModule", { value: true });
|
|
17903
|
-
const utils$2 = utils$g;
|
|
17904
|
-
class ErrorFilter {
|
|
17905
|
-
constructor(_settings) {
|
|
17906
|
-
this._settings = _settings;
|
|
17907
|
-
}
|
|
17908
|
-
getFilter() {
|
|
17909
|
-
return (error) => this._isNonFatalError(error);
|
|
17910
|
-
}
|
|
17911
|
-
_isNonFatalError(error) {
|
|
17912
|
-
return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
|
|
17913
|
-
}
|
|
17914
|
-
}
|
|
17943
|
+
Object.defineProperty(error$2, "__esModule", { value: true });
|
|
17944
|
+
const utils$2 = utils$g;
|
|
17945
|
+
class ErrorFilter {
|
|
17946
|
+
constructor(_settings) {
|
|
17947
|
+
this._settings = _settings;
|
|
17948
|
+
}
|
|
17949
|
+
getFilter() {
|
|
17950
|
+
return (error) => this._isNonFatalError(error);
|
|
17951
|
+
}
|
|
17952
|
+
_isNonFatalError(error) {
|
|
17953
|
+
return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
|
|
17954
|
+
}
|
|
17955
|
+
}
|
|
17915
17956
|
error$2.default = ErrorFilter;
|
|
17916
17957
|
|
|
17917
17958
|
var entry = {};
|
|
17918
17959
|
|
|
17919
|
-
Object.defineProperty(entry, "__esModule", { value: true });
|
|
17920
|
-
const utils$1 = utils$g;
|
|
17921
|
-
class EntryTransformer {
|
|
17922
|
-
constructor(_settings) {
|
|
17923
|
-
this._settings = _settings;
|
|
17924
|
-
}
|
|
17925
|
-
getTransformer() {
|
|
17926
|
-
return (entry) => this._transform(entry);
|
|
17927
|
-
}
|
|
17928
|
-
_transform(entry) {
|
|
17929
|
-
let filepath = entry.path;
|
|
17930
|
-
if (this._settings.absolute) {
|
|
17931
|
-
filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
|
|
17932
|
-
filepath = utils$1.path.unixify(filepath);
|
|
17933
|
-
}
|
|
17934
|
-
if (this._settings.markDirectories && entry.dirent.isDirectory()) {
|
|
17935
|
-
filepath += '/';
|
|
17936
|
-
}
|
|
17937
|
-
if (!this._settings.objectMode) {
|
|
17938
|
-
return filepath;
|
|
17939
|
-
}
|
|
17940
|
-
return Object.assign(Object.assign({}, entry), { path: filepath });
|
|
17941
|
-
}
|
|
17942
|
-
}
|
|
17960
|
+
Object.defineProperty(entry, "__esModule", { value: true });
|
|
17961
|
+
const utils$1 = utils$g;
|
|
17962
|
+
class EntryTransformer {
|
|
17963
|
+
constructor(_settings) {
|
|
17964
|
+
this._settings = _settings;
|
|
17965
|
+
}
|
|
17966
|
+
getTransformer() {
|
|
17967
|
+
return (entry) => this._transform(entry);
|
|
17968
|
+
}
|
|
17969
|
+
_transform(entry) {
|
|
17970
|
+
let filepath = entry.path;
|
|
17971
|
+
if (this._settings.absolute) {
|
|
17972
|
+
filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
|
|
17973
|
+
filepath = utils$1.path.unixify(filepath);
|
|
17974
|
+
}
|
|
17975
|
+
if (this._settings.markDirectories && entry.dirent.isDirectory()) {
|
|
17976
|
+
filepath += '/';
|
|
17977
|
+
}
|
|
17978
|
+
if (!this._settings.objectMode) {
|
|
17979
|
+
return filepath;
|
|
17980
|
+
}
|
|
17981
|
+
return Object.assign(Object.assign({}, entry), { path: filepath });
|
|
17982
|
+
}
|
|
17983
|
+
}
|
|
17943
17984
|
entry.default = EntryTransformer;
|
|
17944
17985
|
|
|
17945
|
-
Object.defineProperty(provider, "__esModule", { value: true });
|
|
17946
|
-
const path$a = require$$0$4;
|
|
17947
|
-
const deep_1 = deep;
|
|
17948
|
-
const entry_1 = entry$1;
|
|
17949
|
-
const error_1 = error$2;
|
|
17950
|
-
const entry_2 = entry;
|
|
17951
|
-
class Provider {
|
|
17952
|
-
constructor(_settings) {
|
|
17953
|
-
this._settings = _settings;
|
|
17954
|
-
this.errorFilter = new error_1.default(this._settings);
|
|
17955
|
-
this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
|
|
17956
|
-
this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
|
|
17957
|
-
this.entryTransformer = new entry_2.default(this._settings);
|
|
17958
|
-
}
|
|
17959
|
-
_getRootDirectory(task) {
|
|
17960
|
-
return path$a.resolve(this._settings.cwd, task.base);
|
|
17961
|
-
}
|
|
17962
|
-
_getReaderOptions(task) {
|
|
17963
|
-
const basePath = task.base === '.' ? '' : task.base;
|
|
17964
|
-
return {
|
|
17965
|
-
basePath,
|
|
17966
|
-
pathSegmentSeparator: '/',
|
|
17967
|
-
concurrency: this._settings.concurrency,
|
|
17968
|
-
deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
|
|
17969
|
-
entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
|
|
17970
|
-
errorFilter: this.errorFilter.getFilter(),
|
|
17971
|
-
followSymbolicLinks: this._settings.followSymbolicLinks,
|
|
17972
|
-
fs: this._settings.fs,
|
|
17973
|
-
stats: this._settings.stats,
|
|
17974
|
-
throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
|
|
17975
|
-
transform: this.entryTransformer.getTransformer()
|
|
17976
|
-
};
|
|
17977
|
-
}
|
|
17978
|
-
_getMicromatchOptions() {
|
|
17979
|
-
return {
|
|
17980
|
-
dot: this._settings.dot,
|
|
17981
|
-
matchBase: this._settings.baseNameMatch,
|
|
17982
|
-
nobrace: !this._settings.braceExpansion,
|
|
17983
|
-
nocase: !this._settings.caseSensitiveMatch,
|
|
17984
|
-
noext: !this._settings.extglob,
|
|
17985
|
-
noglobstar: !this._settings.globstar,
|
|
17986
|
-
posix: true,
|
|
17987
|
-
strictSlashes: false
|
|
17988
|
-
};
|
|
17989
|
-
}
|
|
17990
|
-
}
|
|
17986
|
+
Object.defineProperty(provider, "__esModule", { value: true });
|
|
17987
|
+
const path$a = require$$0$4;
|
|
17988
|
+
const deep_1 = deep;
|
|
17989
|
+
const entry_1 = entry$1;
|
|
17990
|
+
const error_1 = error$2;
|
|
17991
|
+
const entry_2 = entry;
|
|
17992
|
+
class Provider {
|
|
17993
|
+
constructor(_settings) {
|
|
17994
|
+
this._settings = _settings;
|
|
17995
|
+
this.errorFilter = new error_1.default(this._settings);
|
|
17996
|
+
this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
|
|
17997
|
+
this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
|
|
17998
|
+
this.entryTransformer = new entry_2.default(this._settings);
|
|
17999
|
+
}
|
|
18000
|
+
_getRootDirectory(task) {
|
|
18001
|
+
return path$a.resolve(this._settings.cwd, task.base);
|
|
18002
|
+
}
|
|
18003
|
+
_getReaderOptions(task) {
|
|
18004
|
+
const basePath = task.base === '.' ? '' : task.base;
|
|
18005
|
+
return {
|
|
18006
|
+
basePath,
|
|
18007
|
+
pathSegmentSeparator: '/',
|
|
18008
|
+
concurrency: this._settings.concurrency,
|
|
18009
|
+
deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
|
|
18010
|
+
entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
|
|
18011
|
+
errorFilter: this.errorFilter.getFilter(),
|
|
18012
|
+
followSymbolicLinks: this._settings.followSymbolicLinks,
|
|
18013
|
+
fs: this._settings.fs,
|
|
18014
|
+
stats: this._settings.stats,
|
|
18015
|
+
throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
|
|
18016
|
+
transform: this.entryTransformer.getTransformer()
|
|
18017
|
+
};
|
|
18018
|
+
}
|
|
18019
|
+
_getMicromatchOptions() {
|
|
18020
|
+
return {
|
|
18021
|
+
dot: this._settings.dot,
|
|
18022
|
+
matchBase: this._settings.baseNameMatch,
|
|
18023
|
+
nobrace: !this._settings.braceExpansion,
|
|
18024
|
+
nocase: !this._settings.caseSensitiveMatch,
|
|
18025
|
+
noext: !this._settings.extglob,
|
|
18026
|
+
noglobstar: !this._settings.globstar,
|
|
18027
|
+
posix: true,
|
|
18028
|
+
strictSlashes: false
|
|
18029
|
+
};
|
|
18030
|
+
}
|
|
18031
|
+
}
|
|
17991
18032
|
provider.default = Provider;
|
|
17992
18033
|
|
|
17993
|
-
Object.defineProperty(async$
|
|
17994
|
-
const
|
|
17995
|
-
const provider_1$2 = provider;
|
|
17996
|
-
class ProviderAsync extends provider_1$2.default {
|
|
17997
|
-
constructor() {
|
|
17998
|
-
super(...arguments);
|
|
17999
|
-
this._reader = new
|
|
18000
|
-
}
|
|
18001
|
-
read(task) {
|
|
18002
|
-
const root = this._getRootDirectory(task);
|
|
18003
|
-
const options = this._getReaderOptions(task);
|
|
18004
|
-
const entries =
|
|
18005
|
-
return
|
|
18006
|
-
|
|
18007
|
-
|
|
18008
|
-
|
|
18009
|
-
|
|
18010
|
-
}
|
|
18011
|
-
|
|
18012
|
-
|
|
18013
|
-
|
|
18014
|
-
|
|
18015
|
-
}
|
|
18016
|
-
return this._reader.static(task.patterns, options);
|
|
18017
|
-
}
|
|
18018
|
-
}
|
|
18019
|
-
async$6.default = ProviderAsync;
|
|
18034
|
+
Object.defineProperty(async$7, "__esModule", { value: true });
|
|
18035
|
+
const async_1$1 = async$6;
|
|
18036
|
+
const provider_1$2 = provider;
|
|
18037
|
+
class ProviderAsync extends provider_1$2.default {
|
|
18038
|
+
constructor() {
|
|
18039
|
+
super(...arguments);
|
|
18040
|
+
this._reader = new async_1$1.default(this._settings);
|
|
18041
|
+
}
|
|
18042
|
+
async read(task) {
|
|
18043
|
+
const root = this._getRootDirectory(task);
|
|
18044
|
+
const options = this._getReaderOptions(task);
|
|
18045
|
+
const entries = await this.api(root, task, options);
|
|
18046
|
+
return entries.map((entry) => options.transform(entry));
|
|
18047
|
+
}
|
|
18048
|
+
api(root, task, options) {
|
|
18049
|
+
if (task.dynamic) {
|
|
18050
|
+
return this._reader.dynamic(root, options);
|
|
18051
|
+
}
|
|
18052
|
+
return this._reader.static(task.patterns, options);
|
|
18053
|
+
}
|
|
18054
|
+
}
|
|
18055
|
+
async$7.default = ProviderAsync;
|
|
18020
18056
|
|
|
18021
18057
|
var stream = {};
|
|
18022
18058
|
|
|
18023
|
-
Object.defineProperty(stream, "__esModule", { value: true });
|
|
18024
|
-
const stream_1$1 = require$$0$7;
|
|
18025
|
-
const stream_2 = stream$
|
|
18026
|
-
const provider_1$1 = provider;
|
|
18027
|
-
class ProviderStream extends provider_1$1.default {
|
|
18028
|
-
constructor() {
|
|
18029
|
-
super(...arguments);
|
|
18030
|
-
this._reader = new stream_2.default(this._settings);
|
|
18031
|
-
}
|
|
18032
|
-
read(task) {
|
|
18033
|
-
const root = this._getRootDirectory(task);
|
|
18034
|
-
const options = this._getReaderOptions(task);
|
|
18035
|
-
const source = this.api(root, task, options);
|
|
18036
|
-
const destination = new stream_1$1.Readable({ objectMode: true, read: () => { } });
|
|
18037
|
-
source
|
|
18038
|
-
.once('error', (error) => destination.emit('error', error))
|
|
18039
|
-
.on('data', (entry) => destination.emit('data', options.transform(entry)))
|
|
18040
|
-
.once('end', () => destination.emit('end'));
|
|
18041
|
-
destination
|
|
18042
|
-
.once('close', () => source.destroy());
|
|
18043
|
-
return destination;
|
|
18044
|
-
}
|
|
18045
|
-
api(root, task, options) {
|
|
18046
|
-
if (task.dynamic) {
|
|
18047
|
-
return this._reader.dynamic(root, options);
|
|
18048
|
-
}
|
|
18049
|
-
return this._reader.static(task.patterns, options);
|
|
18050
|
-
}
|
|
18051
|
-
}
|
|
18059
|
+
Object.defineProperty(stream, "__esModule", { value: true });
|
|
18060
|
+
const stream_1$1 = require$$0$7;
|
|
18061
|
+
const stream_2 = stream$1;
|
|
18062
|
+
const provider_1$1 = provider;
|
|
18063
|
+
class ProviderStream extends provider_1$1.default {
|
|
18064
|
+
constructor() {
|
|
18065
|
+
super(...arguments);
|
|
18066
|
+
this._reader = new stream_2.default(this._settings);
|
|
18067
|
+
}
|
|
18068
|
+
read(task) {
|
|
18069
|
+
const root = this._getRootDirectory(task);
|
|
18070
|
+
const options = this._getReaderOptions(task);
|
|
18071
|
+
const source = this.api(root, task, options);
|
|
18072
|
+
const destination = new stream_1$1.Readable({ objectMode: true, read: () => { } });
|
|
18073
|
+
source
|
|
18074
|
+
.once('error', (error) => destination.emit('error', error))
|
|
18075
|
+
.on('data', (entry) => destination.emit('data', options.transform(entry)))
|
|
18076
|
+
.once('end', () => destination.emit('end'));
|
|
18077
|
+
destination
|
|
18078
|
+
.once('close', () => source.destroy());
|
|
18079
|
+
return destination;
|
|
18080
|
+
}
|
|
18081
|
+
api(root, task, options) {
|
|
18082
|
+
if (task.dynamic) {
|
|
18083
|
+
return this._reader.dynamic(root, options);
|
|
18084
|
+
}
|
|
18085
|
+
return this._reader.static(task.patterns, options);
|
|
18086
|
+
}
|
|
18087
|
+
}
|
|
18052
18088
|
stream.default = ProviderStream;
|
|
18053
18089
|
|
|
18054
18090
|
var sync$2 = {};
|
|
18055
18091
|
|
|
18056
18092
|
var sync$1 = {};
|
|
18057
18093
|
|
|
18058
|
-
Object.defineProperty(sync$1, "__esModule", { value: true });
|
|
18059
|
-
const fsStat = out$
|
|
18060
|
-
const fsWalk = out$
|
|
18061
|
-
const reader_1 = reader;
|
|
18062
|
-
class ReaderSync extends reader_1.default {
|
|
18063
|
-
constructor() {
|
|
18064
|
-
super(...arguments);
|
|
18065
|
-
this._walkSync = fsWalk.walkSync;
|
|
18066
|
-
this._statSync = fsStat.statSync;
|
|
18067
|
-
}
|
|
18068
|
-
dynamic(root, options) {
|
|
18069
|
-
return this._walkSync(root, options);
|
|
18070
|
-
}
|
|
18071
|
-
static(patterns, options) {
|
|
18072
|
-
const entries = [];
|
|
18073
|
-
for (const pattern of patterns) {
|
|
18074
|
-
const filepath = this._getFullEntryPath(pattern);
|
|
18075
|
-
const entry = this._getEntry(filepath, pattern, options);
|
|
18076
|
-
if (entry === null || !options.entryFilter(entry)) {
|
|
18077
|
-
continue;
|
|
18078
|
-
}
|
|
18079
|
-
entries.push(entry);
|
|
18080
|
-
}
|
|
18081
|
-
return entries;
|
|
18082
|
-
}
|
|
18083
|
-
_getEntry(filepath, pattern, options) {
|
|
18084
|
-
try {
|
|
18085
|
-
const stats = this._getStat(filepath);
|
|
18086
|
-
return this._makeEntry(stats, pattern);
|
|
18087
|
-
}
|
|
18088
|
-
catch (error) {
|
|
18089
|
-
if (options.errorFilter(error)) {
|
|
18090
|
-
return null;
|
|
18091
|
-
}
|
|
18092
|
-
throw error;
|
|
18093
|
-
}
|
|
18094
|
-
}
|
|
18095
|
-
_getStat(filepath) {
|
|
18096
|
-
return this._statSync(filepath, this._fsStatSettings);
|
|
18097
|
-
}
|
|
18098
|
-
}
|
|
18094
|
+
Object.defineProperty(sync$1, "__esModule", { value: true });
|
|
18095
|
+
const fsStat = out$1;
|
|
18096
|
+
const fsWalk = out$3;
|
|
18097
|
+
const reader_1 = reader;
|
|
18098
|
+
class ReaderSync extends reader_1.default {
|
|
18099
|
+
constructor() {
|
|
18100
|
+
super(...arguments);
|
|
18101
|
+
this._walkSync = fsWalk.walkSync;
|
|
18102
|
+
this._statSync = fsStat.statSync;
|
|
18103
|
+
}
|
|
18104
|
+
dynamic(root, options) {
|
|
18105
|
+
return this._walkSync(root, options);
|
|
18106
|
+
}
|
|
18107
|
+
static(patterns, options) {
|
|
18108
|
+
const entries = [];
|
|
18109
|
+
for (const pattern of patterns) {
|
|
18110
|
+
const filepath = this._getFullEntryPath(pattern);
|
|
18111
|
+
const entry = this._getEntry(filepath, pattern, options);
|
|
18112
|
+
if (entry === null || !options.entryFilter(entry)) {
|
|
18113
|
+
continue;
|
|
18114
|
+
}
|
|
18115
|
+
entries.push(entry);
|
|
18116
|
+
}
|
|
18117
|
+
return entries;
|
|
18118
|
+
}
|
|
18119
|
+
_getEntry(filepath, pattern, options) {
|
|
18120
|
+
try {
|
|
18121
|
+
const stats = this._getStat(filepath);
|
|
18122
|
+
return this._makeEntry(stats, pattern);
|
|
18123
|
+
}
|
|
18124
|
+
catch (error) {
|
|
18125
|
+
if (options.errorFilter(error)) {
|
|
18126
|
+
return null;
|
|
18127
|
+
}
|
|
18128
|
+
throw error;
|
|
18129
|
+
}
|
|
18130
|
+
}
|
|
18131
|
+
_getStat(filepath) {
|
|
18132
|
+
return this._statSync(filepath, this._fsStatSettings);
|
|
18133
|
+
}
|
|
18134
|
+
}
|
|
18099
18135
|
sync$1.default = ReaderSync;
|
|
18100
18136
|
|
|
18101
|
-
Object.defineProperty(sync$2, "__esModule", { value: true });
|
|
18102
|
-
const sync_1$1 = sync$1;
|
|
18103
|
-
const provider_1 = provider;
|
|
18104
|
-
class ProviderSync extends provider_1.default {
|
|
18105
|
-
constructor() {
|
|
18106
|
-
super(...arguments);
|
|
18107
|
-
this._reader = new sync_1$1.default(this._settings);
|
|
18108
|
-
}
|
|
18109
|
-
read(task) {
|
|
18110
|
-
const root = this._getRootDirectory(task);
|
|
18111
|
-
const options = this._getReaderOptions(task);
|
|
18112
|
-
const entries = this.api(root, task, options);
|
|
18113
|
-
return entries.map(options.transform);
|
|
18114
|
-
}
|
|
18115
|
-
api(root, task, options) {
|
|
18116
|
-
if (task.dynamic) {
|
|
18117
|
-
return this._reader.dynamic(root, options);
|
|
18118
|
-
}
|
|
18119
|
-
return this._reader.static(task.patterns, options);
|
|
18120
|
-
}
|
|
18121
|
-
}
|
|
18137
|
+
Object.defineProperty(sync$2, "__esModule", { value: true });
|
|
18138
|
+
const sync_1$1 = sync$1;
|
|
18139
|
+
const provider_1 = provider;
|
|
18140
|
+
class ProviderSync extends provider_1.default {
|
|
18141
|
+
constructor() {
|
|
18142
|
+
super(...arguments);
|
|
18143
|
+
this._reader = new sync_1$1.default(this._settings);
|
|
18144
|
+
}
|
|
18145
|
+
read(task) {
|
|
18146
|
+
const root = this._getRootDirectory(task);
|
|
18147
|
+
const options = this._getReaderOptions(task);
|
|
18148
|
+
const entries = this.api(root, task, options);
|
|
18149
|
+
return entries.map(options.transform);
|
|
18150
|
+
}
|
|
18151
|
+
api(root, task, options) {
|
|
18152
|
+
if (task.dynamic) {
|
|
18153
|
+
return this._reader.dynamic(root, options);
|
|
18154
|
+
}
|
|
18155
|
+
return this._reader.static(task.patterns, options);
|
|
18156
|
+
}
|
|
18157
|
+
}
|
|
18122
18158
|
sync$2.default = ProviderSync;
|
|
18123
18159
|
|
|
18124
18160
|
var settings = {};
|
|
18125
18161
|
|
|
18126
18162
|
(function (exports) {
|
|
18127
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18128
|
-
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
18129
|
-
const fs = require$$0__default;
|
|
18130
|
-
const os = require$$1;
|
|
18131
|
-
/**
|
|
18132
|
-
* The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
|
|
18133
|
-
* https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
|
|
18134
|
-
*/
|
|
18135
|
-
const CPU_COUNT = Math.max(os.cpus().length, 1);
|
|
18136
|
-
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
18137
|
-
lstat: fs.lstat,
|
|
18138
|
-
lstatSync: fs.lstatSync,
|
|
18139
|
-
stat: fs.stat,
|
|
18140
|
-
statSync: fs.statSync,
|
|
18141
|
-
readdir: fs.readdir,
|
|
18142
|
-
readdirSync: fs.readdirSync
|
|
18143
|
-
};
|
|
18144
|
-
class Settings {
|
|
18145
|
-
constructor(_options = {}) {
|
|
18146
|
-
this._options = _options;
|
|
18147
|
-
this.absolute = this._getValue(this._options.absolute, false);
|
|
18148
|
-
this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
|
|
18149
|
-
this.braceExpansion = this._getValue(this._options.braceExpansion, true);
|
|
18150
|
-
this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
|
|
18151
|
-
this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
|
|
18152
|
-
this.cwd = this._getValue(this._options.cwd, process.cwd());
|
|
18153
|
-
this.deep = this._getValue(this._options.deep, Infinity);
|
|
18154
|
-
this.dot = this._getValue(this._options.dot, false);
|
|
18155
|
-
this.extglob = this._getValue(this._options.extglob, true);
|
|
18156
|
-
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
|
|
18157
|
-
this.fs = this._getFileSystemMethods(this._options.fs);
|
|
18158
|
-
this.globstar = this._getValue(this._options.globstar, true);
|
|
18159
|
-
this.ignore = this._getValue(this._options.ignore, []);
|
|
18160
|
-
this.markDirectories = this._getValue(this._options.markDirectories, false);
|
|
18161
|
-
this.objectMode = this._getValue(this._options.objectMode, false);
|
|
18162
|
-
this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
|
|
18163
|
-
this.onlyFiles = this._getValue(this._options.onlyFiles, true);
|
|
18164
|
-
this.stats = this._getValue(this._options.stats, false);
|
|
18165
|
-
this.suppressErrors = this._getValue(this._options.suppressErrors, false);
|
|
18166
|
-
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
|
|
18167
|
-
this.unique = this._getValue(this._options.unique, true);
|
|
18168
|
-
if (this.onlyDirectories) {
|
|
18169
|
-
this.onlyFiles = false;
|
|
18170
|
-
}
|
|
18171
|
-
if (this.stats) {
|
|
18172
|
-
this.objectMode = true;
|
|
18173
|
-
}
|
|
18174
|
-
}
|
|
18175
|
-
_getValue(option, value) {
|
|
18176
|
-
return option === undefined ? value : option;
|
|
18177
|
-
}
|
|
18178
|
-
_getFileSystemMethods(methods = {}) {
|
|
18179
|
-
return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
|
|
18180
|
-
}
|
|
18181
|
-
}
|
|
18163
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18164
|
+
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
18165
|
+
const fs = require$$0__default;
|
|
18166
|
+
const os = require$$1;
|
|
18167
|
+
/**
|
|
18168
|
+
* The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
|
|
18169
|
+
* https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
|
|
18170
|
+
*/
|
|
18171
|
+
const CPU_COUNT = Math.max(os.cpus().length, 1);
|
|
18172
|
+
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
18173
|
+
lstat: fs.lstat,
|
|
18174
|
+
lstatSync: fs.lstatSync,
|
|
18175
|
+
stat: fs.stat,
|
|
18176
|
+
statSync: fs.statSync,
|
|
18177
|
+
readdir: fs.readdir,
|
|
18178
|
+
readdirSync: fs.readdirSync
|
|
18179
|
+
};
|
|
18180
|
+
class Settings {
|
|
18181
|
+
constructor(_options = {}) {
|
|
18182
|
+
this._options = _options;
|
|
18183
|
+
this.absolute = this._getValue(this._options.absolute, false);
|
|
18184
|
+
this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
|
|
18185
|
+
this.braceExpansion = this._getValue(this._options.braceExpansion, true);
|
|
18186
|
+
this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
|
|
18187
|
+
this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
|
|
18188
|
+
this.cwd = this._getValue(this._options.cwd, process.cwd());
|
|
18189
|
+
this.deep = this._getValue(this._options.deep, Infinity);
|
|
18190
|
+
this.dot = this._getValue(this._options.dot, false);
|
|
18191
|
+
this.extglob = this._getValue(this._options.extglob, true);
|
|
18192
|
+
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
|
|
18193
|
+
this.fs = this._getFileSystemMethods(this._options.fs);
|
|
18194
|
+
this.globstar = this._getValue(this._options.globstar, true);
|
|
18195
|
+
this.ignore = this._getValue(this._options.ignore, []);
|
|
18196
|
+
this.markDirectories = this._getValue(this._options.markDirectories, false);
|
|
18197
|
+
this.objectMode = this._getValue(this._options.objectMode, false);
|
|
18198
|
+
this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
|
|
18199
|
+
this.onlyFiles = this._getValue(this._options.onlyFiles, true);
|
|
18200
|
+
this.stats = this._getValue(this._options.stats, false);
|
|
18201
|
+
this.suppressErrors = this._getValue(this._options.suppressErrors, false);
|
|
18202
|
+
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
|
|
18203
|
+
this.unique = this._getValue(this._options.unique, true);
|
|
18204
|
+
if (this.onlyDirectories) {
|
|
18205
|
+
this.onlyFiles = false;
|
|
18206
|
+
}
|
|
18207
|
+
if (this.stats) {
|
|
18208
|
+
this.objectMode = true;
|
|
18209
|
+
}
|
|
18210
|
+
}
|
|
18211
|
+
_getValue(option, value) {
|
|
18212
|
+
return option === undefined ? value : option;
|
|
18213
|
+
}
|
|
18214
|
+
_getFileSystemMethods(methods = {}) {
|
|
18215
|
+
return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
|
|
18216
|
+
}
|
|
18217
|
+
}
|
|
18182
18218
|
exports.default = Settings;
|
|
18183
18219
|
} (settings));
|
|
18184
18220
|
|
|
18185
|
-
const taskManager = tasks;
|
|
18186
|
-
const patternManager = patterns;
|
|
18187
|
-
const async_1 = async$
|
|
18188
|
-
const stream_1 = stream;
|
|
18189
|
-
const sync_1 = sync$2;
|
|
18190
|
-
const settings_1 = settings;
|
|
18191
|
-
const utils = utils$g;
|
|
18192
|
-
async function FastGlob(source, options) {
|
|
18193
|
-
assertPatternsInput(source);
|
|
18194
|
-
const works = getWorks(source, async_1.default, options);
|
|
18195
|
-
const result = await Promise.all(works);
|
|
18196
|
-
return utils.array.flatten(result);
|
|
18197
|
-
}
|
|
18198
|
-
// https://github.com/typescript-eslint/typescript-eslint/issues/60
|
|
18199
|
-
// eslint-disable-next-line no-redeclare
|
|
18200
|
-
(function (FastGlob) {
|
|
18201
|
-
function sync(source, options) {
|
|
18202
|
-
assertPatternsInput(source);
|
|
18203
|
-
const works = getWorks(source, sync_1.default, options);
|
|
18204
|
-
return utils.array.flatten(works);
|
|
18205
|
-
}
|
|
18206
|
-
FastGlob.sync = sync;
|
|
18207
|
-
function stream(source, options) {
|
|
18208
|
-
assertPatternsInput(source);
|
|
18209
|
-
const works = getWorks(source, stream_1.default, options);
|
|
18210
|
-
/**
|
|
18211
|
-
* The stream returned by the provider cannot work with an asynchronous iterator.
|
|
18212
|
-
* To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
|
|
18213
|
-
* This affects performance (+25%). I don't see best solution right now.
|
|
18214
|
-
*/
|
|
18215
|
-
return utils.stream.merge(works);
|
|
18216
|
-
}
|
|
18217
|
-
FastGlob.stream = stream;
|
|
18218
|
-
function generateTasks(source, options) {
|
|
18219
|
-
assertPatternsInput(source);
|
|
18220
|
-
const patterns = patternManager.transform([].concat(source));
|
|
18221
|
-
const settings = new settings_1.default(options);
|
|
18222
|
-
return taskManager.generate(patterns, settings);
|
|
18223
|
-
}
|
|
18224
|
-
FastGlob.generateTasks = generateTasks;
|
|
18225
|
-
function isDynamicPattern(source, options) {
|
|
18226
|
-
assertPatternsInput(source);
|
|
18227
|
-
const settings = new settings_1.default(options);
|
|
18228
|
-
return utils.pattern.isDynamicPattern(source, settings);
|
|
18229
|
-
}
|
|
18230
|
-
FastGlob.isDynamicPattern = isDynamicPattern;
|
|
18231
|
-
function escapePath(source) {
|
|
18232
|
-
assertPatternsInput(source);
|
|
18233
|
-
return utils.path.escape(source);
|
|
18234
|
-
}
|
|
18235
|
-
FastGlob.escapePath = escapePath;
|
|
18236
|
-
})(FastGlob || (FastGlob = {}));
|
|
18237
|
-
function getWorks(source, _Provider, options) {
|
|
18238
|
-
const patterns = patternManager.transform([].concat(source));
|
|
18239
|
-
const settings = new settings_1.default(options);
|
|
18240
|
-
const tasks = taskManager.generate(patterns, settings);
|
|
18241
|
-
const provider = new _Provider(settings);
|
|
18242
|
-
return tasks.map(provider.read, provider);
|
|
18243
|
-
}
|
|
18244
|
-
function assertPatternsInput(input) {
|
|
18245
|
-
const source = [].concat(input);
|
|
18246
|
-
const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
|
|
18247
|
-
if (!isValidSource) {
|
|
18248
|
-
throw new TypeError('Patterns must be a string (non empty) or an array of strings');
|
|
18249
|
-
}
|
|
18250
|
-
}
|
|
18221
|
+
const taskManager = tasks;
|
|
18222
|
+
const patternManager = patterns;
|
|
18223
|
+
const async_1 = async$7;
|
|
18224
|
+
const stream_1 = stream;
|
|
18225
|
+
const sync_1 = sync$2;
|
|
18226
|
+
const settings_1 = settings;
|
|
18227
|
+
const utils = utils$g;
|
|
18228
|
+
async function FastGlob(source, options) {
|
|
18229
|
+
assertPatternsInput(source);
|
|
18230
|
+
const works = getWorks(source, async_1.default, options);
|
|
18231
|
+
const result = await Promise.all(works);
|
|
18232
|
+
return utils.array.flatten(result);
|
|
18233
|
+
}
|
|
18234
|
+
// https://github.com/typescript-eslint/typescript-eslint/issues/60
|
|
18235
|
+
// eslint-disable-next-line no-redeclare
|
|
18236
|
+
(function (FastGlob) {
|
|
18237
|
+
function sync(source, options) {
|
|
18238
|
+
assertPatternsInput(source);
|
|
18239
|
+
const works = getWorks(source, sync_1.default, options);
|
|
18240
|
+
return utils.array.flatten(works);
|
|
18241
|
+
}
|
|
18242
|
+
FastGlob.sync = sync;
|
|
18243
|
+
function stream(source, options) {
|
|
18244
|
+
assertPatternsInput(source);
|
|
18245
|
+
const works = getWorks(source, stream_1.default, options);
|
|
18246
|
+
/**
|
|
18247
|
+
* The stream returned by the provider cannot work with an asynchronous iterator.
|
|
18248
|
+
* To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
|
|
18249
|
+
* This affects performance (+25%). I don't see best solution right now.
|
|
18250
|
+
*/
|
|
18251
|
+
return utils.stream.merge(works);
|
|
18252
|
+
}
|
|
18253
|
+
FastGlob.stream = stream;
|
|
18254
|
+
function generateTasks(source, options) {
|
|
18255
|
+
assertPatternsInput(source);
|
|
18256
|
+
const patterns = patternManager.transform([].concat(source));
|
|
18257
|
+
const settings = new settings_1.default(options);
|
|
18258
|
+
return taskManager.generate(patterns, settings);
|
|
18259
|
+
}
|
|
18260
|
+
FastGlob.generateTasks = generateTasks;
|
|
18261
|
+
function isDynamicPattern(source, options) {
|
|
18262
|
+
assertPatternsInput(source);
|
|
18263
|
+
const settings = new settings_1.default(options);
|
|
18264
|
+
return utils.pattern.isDynamicPattern(source, settings);
|
|
18265
|
+
}
|
|
18266
|
+
FastGlob.isDynamicPattern = isDynamicPattern;
|
|
18267
|
+
function escapePath(source) {
|
|
18268
|
+
assertPatternsInput(source);
|
|
18269
|
+
return utils.path.escape(source);
|
|
18270
|
+
}
|
|
18271
|
+
FastGlob.escapePath = escapePath;
|
|
18272
|
+
})(FastGlob || (FastGlob = {}));
|
|
18273
|
+
function getWorks(source, _Provider, options) {
|
|
18274
|
+
const patterns = patternManager.transform([].concat(source));
|
|
18275
|
+
const settings = new settings_1.default(options);
|
|
18276
|
+
const tasks = taskManager.generate(patterns, settings);
|
|
18277
|
+
const provider = new _Provider(settings);
|
|
18278
|
+
return tasks.map(provider.read, provider);
|
|
18279
|
+
}
|
|
18280
|
+
function assertPatternsInput(input) {
|
|
18281
|
+
const source = [].concat(input);
|
|
18282
|
+
const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
|
|
18283
|
+
if (!isValidSource) {
|
|
18284
|
+
throw new TypeError('Patterns must be a string (non empty) or an array of strings');
|
|
18285
|
+
}
|
|
18286
|
+
}
|
|
18251
18287
|
var out = FastGlob;
|
|
18252
18288
|
|
|
18253
18289
|
var dist = {};
|
|
@@ -26219,15 +26255,20 @@ class Chunk {
|
|
|
26219
26255
|
}
|
|
26220
26256
|
}
|
|
26221
26257
|
|
|
26222
|
-
|
|
26223
|
-
|
|
26224
|
-
|
|
26225
|
-
if (typeof
|
|
26226
|
-
|
|
26227
|
-
} else
|
|
26228
|
-
|
|
26258
|
+
function getBtoa () {
|
|
26259
|
+
if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
|
|
26260
|
+
return (str) => window.btoa(unescape(encodeURIComponent(str)));
|
|
26261
|
+
} else if (typeof Buffer === 'function') {
|
|
26262
|
+
return (str) => Buffer.from(str, 'utf-8').toString('base64');
|
|
26263
|
+
} else {
|
|
26264
|
+
return () => {
|
|
26265
|
+
throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
|
|
26266
|
+
};
|
|
26267
|
+
}
|
|
26229
26268
|
}
|
|
26230
26269
|
|
|
26270
|
+
const btoa$1 = /*#__PURE__*/ getBtoa();
|
|
26271
|
+
|
|
26231
26272
|
class SourceMap {
|
|
26232
26273
|
constructor(properties) {
|
|
26233
26274
|
this.version = 3;
|
|
@@ -26419,7 +26460,7 @@ class MagicString {
|
|
|
26419
26460
|
indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
|
|
26420
26461
|
sourcemapLocations: { writable: true, value: new BitSet() },
|
|
26421
26462
|
storedNames: { writable: true, value: {} },
|
|
26422
|
-
indentStr: { writable: true, value:
|
|
26463
|
+
indentStr: { writable: true, value: undefined },
|
|
26423
26464
|
});
|
|
26424
26465
|
|
|
26425
26466
|
this.byStart[0] = chunk;
|
|
@@ -26549,7 +26590,19 @@ class MagicString {
|
|
|
26549
26590
|
return new SourceMap(this.generateDecodedMap(options));
|
|
26550
26591
|
}
|
|
26551
26592
|
|
|
26593
|
+
_ensureindentStr() {
|
|
26594
|
+
if (this.indentStr === undefined) {
|
|
26595
|
+
this.indentStr = guessIndent(this.original);
|
|
26596
|
+
}
|
|
26597
|
+
}
|
|
26598
|
+
|
|
26599
|
+
_getRawIndentString() {
|
|
26600
|
+
this._ensureindentStr();
|
|
26601
|
+
return this.indentStr;
|
|
26602
|
+
}
|
|
26603
|
+
|
|
26552
26604
|
getIndentString() {
|
|
26605
|
+
this._ensureindentStr();
|
|
26553
26606
|
return this.indentStr === null ? '\t' : this.indentStr;
|
|
26554
26607
|
}
|
|
26555
26608
|
|
|
@@ -26561,7 +26614,10 @@ class MagicString {
|
|
|
26561
26614
|
indentStr = undefined;
|
|
26562
26615
|
}
|
|
26563
26616
|
|
|
26564
|
-
|
|
26617
|
+
if (indentStr === undefined) {
|
|
26618
|
+
this._ensureindentStr();
|
|
26619
|
+
indentStr = this.indentStr || '\t';
|
|
26620
|
+
}
|
|
26565
26621
|
|
|
26566
26622
|
if (indentStr === '') return this; // noop
|
|
26567
26623
|
|
|
@@ -34176,7 +34232,8 @@ function resolvePlugin(resolveOptions) {
|
|
|
34176
34232
|
// as if they would have been imported through a bare import
|
|
34177
34233
|
// Use the original id to do the check as the resolved id may be the real
|
|
34178
34234
|
// file path after symlinks resolution
|
|
34179
|
-
const isNodeModule =
|
|
34235
|
+
const isNodeModule = nodeModulesInPathRE.test(normalizePath$3(id)) ||
|
|
34236
|
+
nodeModulesInPathRE.test(normalizePath$3(resolved));
|
|
34180
34237
|
if (isNodeModule && !resolved.match(DEP_VERSION_RE)) {
|
|
34181
34238
|
const versionHash = depsOptimizer.metadata.browserHash;
|
|
34182
34239
|
if (versionHash && OPTIMIZABLE_ENTRY_RE.test(resolved)) {
|
|
@@ -37345,7 +37402,7 @@ function markExplicitImport(url) {
|
|
|
37345
37402
|
}
|
|
37346
37403
|
return url;
|
|
37347
37404
|
}
|
|
37348
|
-
|
|
37405
|
+
function extractImportedBindings(id, source, importSpec, importedBindings) {
|
|
37349
37406
|
let bindings = importedBindings.get(id);
|
|
37350
37407
|
if (!bindings) {
|
|
37351
37408
|
bindings = new Set();
|
|
@@ -41628,7 +41685,7 @@ async function createDepsOptimizer(config, server) {
|
|
|
41628
41685
|
}, 0);
|
|
41629
41686
|
}
|
|
41630
41687
|
}
|
|
41631
|
-
|
|
41688
|
+
function startNextDiscoveredBatch() {
|
|
41632
41689
|
newDepsDiscovered = false;
|
|
41633
41690
|
// Add the current depOptimizationProcessing to the queue, these
|
|
41634
41691
|
// promises are going to be resolved once a rerun is committed
|
|
@@ -43221,7 +43278,7 @@ function traverseNodes(node, visitor) {
|
|
|
43221
43278
|
}
|
|
43222
43279
|
async function traverseHtml(html, filePath, visitor) {
|
|
43223
43280
|
// lazy load compiler
|
|
43224
|
-
const { parse } = await import('./dep-
|
|
43281
|
+
const { parse } = await import('./dep-19c40c50.js');
|
|
43225
43282
|
const ast = parse(html, {
|
|
43226
43283
|
sourceCodeLocationInfo: true,
|
|
43227
43284
|
onParseError: (e) => {
|
|
@@ -43251,7 +43308,7 @@ function getScriptInfo(node) {
|
|
|
43251
43308
|
}
|
|
43252
43309
|
return { src, sourceCodeLocation, isModule, isAsync };
|
|
43253
43310
|
}
|
|
43254
|
-
const attrValueStartRE = /=[\s\t\n\r]*(
|
|
43311
|
+
const attrValueStartRE = /=[\s\t\n\r]*(.)/;
|
|
43255
43312
|
function overwriteAttrValue(s, sourceCodeLocation, newValue) {
|
|
43256
43313
|
const srcString = s.slice(sourceCodeLocation.startOffset, sourceCodeLocation.endOffset);
|
|
43257
43314
|
const valueStart = srcString.match(attrValueStartRE);
|
|
@@ -43259,7 +43316,7 @@ function overwriteAttrValue(s, sourceCodeLocation, newValue) {
|
|
|
43259
43316
|
// overwrite attr value can only be called for a well-defined value
|
|
43260
43317
|
throw new Error(`[vite:html] internal error, failed to overwrite attribute value`);
|
|
43261
43318
|
}
|
|
43262
|
-
const wrapOffset = valueStart[1] ? 1 : 0;
|
|
43319
|
+
const wrapOffset = valueStart[1] === '"' || valueStart[1] === "'" ? 1 : 0;
|
|
43263
43320
|
const valueOffset = valueStart.index + valueStart[0].length - 1;
|
|
43264
43321
|
s.overwrite(sourceCodeLocation.startOffset + valueOffset + wrapOffset, sourceCodeLocation.endOffset - wrapOffset, newValue, { contentOnly: true });
|
|
43265
43322
|
return s;
|
|
@@ -44428,7 +44485,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
44428
44485
|
logger: config.logger
|
|
44429
44486
|
}));
|
|
44430
44487
|
if (isModule) {
|
|
44431
|
-
postcssPlugins.unshift((await import('./dep-
|
|
44488
|
+
postcssPlugins.unshift((await import('./dep-57f3662c.js').then(function (n) { return n.i; })).default({
|
|
44432
44489
|
...modulesOptions,
|
|
44433
44490
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
44434
44491
|
modules = _modules;
|
|
@@ -60021,7 +60078,9 @@ function proxyMiddleware(httpServer, options, config) {
|
|
|
60021
60078
|
for (const context in proxies) {
|
|
60022
60079
|
if (doesProxyContextMatchUrl(context, url)) {
|
|
60023
60080
|
const [proxy, opts] = proxies[context];
|
|
60024
|
-
if ((opts.ws ||
|
|
60081
|
+
if ((opts.ws ||
|
|
60082
|
+
opts.target?.toString().startsWith('ws:') ||
|
|
60083
|
+
opts.target?.toString().startsWith('wss:')) &&
|
|
60025
60084
|
req.headers['sec-websocket-protocol'] !== HMR_HEADER) {
|
|
60026
60085
|
if (opts.rewrite) {
|
|
60027
60086
|
req.url = opts.rewrite(url);
|
|
@@ -62553,10 +62612,18 @@ async function preview(inlineConfig = {}) {
|
|
|
62553
62612
|
const previewBase = config.base === './' || config.base === '' ? '/' : config.base;
|
|
62554
62613
|
// static assets
|
|
62555
62614
|
const distDir = path$n.resolve(config.root, config.build.outDir);
|
|
62615
|
+
const headers = config.preview.headers;
|
|
62556
62616
|
app.use(previewBase, sirv(distDir, {
|
|
62557
62617
|
etag: true,
|
|
62558
62618
|
dev: true,
|
|
62559
|
-
single: config.appType === 'spa'
|
|
62619
|
+
single: config.appType === 'spa',
|
|
62620
|
+
setHeaders(res) {
|
|
62621
|
+
if (headers) {
|
|
62622
|
+
for (const name in headers) {
|
|
62623
|
+
res.setHeader(name, headers[name]);
|
|
62624
|
+
}
|
|
62625
|
+
}
|
|
62626
|
+
}
|
|
62560
62627
|
}));
|
|
62561
62628
|
// apply post server hooks from plugins
|
|
62562
62629
|
postHooks.forEach((fn) => fn && fn());
|
|
@@ -62951,16 +63018,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development')
|
|
|
62951
63018
|
const [prePlugins, normalPlugins, postPlugins] = sortUserPlugins(rawUserPlugins);
|
|
62952
63019
|
// run config hooks
|
|
62953
63020
|
const userPlugins = [...prePlugins, ...normalPlugins, ...postPlugins];
|
|
62954
|
-
|
|
62955
|
-
const hook = p.config;
|
|
62956
|
-
const handler = hook && 'handler' in hook ? hook.handler : hook;
|
|
62957
|
-
if (handler) {
|
|
62958
|
-
const res = await handler(config, configEnv);
|
|
62959
|
-
if (res) {
|
|
62960
|
-
config = mergeConfig(config, res);
|
|
62961
|
-
}
|
|
62962
|
-
}
|
|
62963
|
-
}
|
|
63021
|
+
config = await runConfigHook(config, userPlugins, configEnv);
|
|
62964
63022
|
if (process.env.VITE_TEST_WITHOUT_PLUGIN_COMMONJS) {
|
|
62965
63023
|
config = mergeConfig(config, {
|
|
62966
63024
|
optimizeDeps: { disabled: false },
|
|
@@ -63078,16 +63136,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development')
|
|
|
63078
63136
|
...workerNormalPlugins,
|
|
63079
63137
|
...workerPostPlugins
|
|
63080
63138
|
];
|
|
63081
|
-
|
|
63082
|
-
const hook = p.config;
|
|
63083
|
-
const handler = hook && 'handler' in hook ? hook.handler : hook;
|
|
63084
|
-
if (handler) {
|
|
63085
|
-
const res = await handler(workerConfig, configEnv);
|
|
63086
|
-
if (res) {
|
|
63087
|
-
workerConfig = mergeConfig(workerConfig, res);
|
|
63088
|
-
}
|
|
63089
|
-
}
|
|
63090
|
-
}
|
|
63139
|
+
workerConfig = await runConfigHook(workerConfig, workerUserPlugins, configEnv);
|
|
63091
63140
|
const resolvedWorkerOptions = {
|
|
63092
63141
|
format: workerConfig.worker?.format || 'iife',
|
|
63093
63142
|
plugins: [],
|
|
@@ -63448,6 +63497,20 @@ async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {
|
|
|
63448
63497
|
return raw.__esModule ? raw.default : raw;
|
|
63449
63498
|
}
|
|
63450
63499
|
}
|
|
63500
|
+
async function runConfigHook(config, plugins, configEnv) {
|
|
63501
|
+
let conf = config;
|
|
63502
|
+
for (const p of getSortedPluginsByHook('config', plugins)) {
|
|
63503
|
+
const hook = p.config;
|
|
63504
|
+
const handler = hook && 'handler' in hook ? hook.handler : hook;
|
|
63505
|
+
if (handler) {
|
|
63506
|
+
const res = await handler(conf, configEnv);
|
|
63507
|
+
if (res) {
|
|
63508
|
+
conf = mergeConfig(conf, res);
|
|
63509
|
+
}
|
|
63510
|
+
}
|
|
63511
|
+
}
|
|
63512
|
+
return conf;
|
|
63513
|
+
}
|
|
63451
63514
|
function getDepOptimizationConfig(config, ssr) {
|
|
63452
63515
|
return ssr ? config.ssr.optimizeDeps : config.optimizeDeps;
|
|
63453
63516
|
}
|