vitest 0.23.1 → 0.23.4
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/browser.d.ts +3 -3
- package/dist/browser.mjs +7 -7
- package/dist/{chunk-api-setup.9e83ca0a.mjs → chunk-api-setup.11cfd513.mjs} +5 -5
- package/dist/{chunk-constants.6196597b.mjs → chunk-constants.71e8a211.mjs} +0 -0
- package/dist/{chunk-install-pkg.e081fc1b.mjs → chunk-install-pkg.3aa3eae6.mjs} +3 -3
- package/dist/{chunk-integrations-globals.b1aa52c3.mjs → chunk-integrations-globals.d8c90af9.mjs} +6 -6
- package/dist/{chunk-mock-date.f63a5ff2.mjs → chunk-mock-date.2917be60.mjs} +2 -2
- package/dist/{chunk-node-git.6f289b0a.mjs → chunk-node-git.a44b4872.mjs} +4 -4
- package/dist/{chunk-runtime-chain.8bfc559b.mjs → chunk-runtime-chain.0ab05798.mjs} +13 -25
- package/dist/{chunk-runtime-error.252dd130.mjs → chunk-runtime-error.f5506f40.mjs} +45 -30
- package/dist/{chunk-runtime-hooks.c6b06bd8.mjs → chunk-runtime-hooks.e4219ed5.mjs} +3 -3
- package/dist/{chunk-runtime-mocker.d9690273.mjs → chunk-runtime-mocker.4bbb070f.mjs} +19 -9
- package/dist/{chunk-runtime-rpc.48bd94e3.mjs → chunk-runtime-rpc.00a890d2.mjs} +1 -1
- package/dist/{chunk-utils-source-map.a1647f5f.mjs → chunk-utils-source-map.2be5aa48.mjs} +2 -2
- package/dist/{chunk-vite-node-client.998e04d0.mjs → chunk-vite-node-client.da0a17ff.mjs} +2 -2
- package/dist/{chunk-vite-node-debug.2d8a1dc3.mjs → chunk-vite-node-debug.536c4c5b.mjs} +1 -1
- package/dist/{chunk-vite-node-externalize.3035bd5b.mjs → chunk-vite-node-externalize.8d8032d0.mjs} +1192 -1101
- package/dist/{chunk-vite-node-utils.8a9b3014.mjs → chunk-vite-node-utils.473cd0b2.mjs} +1 -1
- package/dist/cli-wrapper.mjs +7 -5
- package/dist/cli.mjs +9 -9
- package/dist/config.d.ts +1 -1
- package/dist/entry.mjs +7 -7
- package/dist/environments.d.ts +1 -1
- package/dist/{global-ea084c9f.d.ts → global-e98f203b.d.ts} +22 -5
- package/dist/{index-5f09f4d0.d.ts → index-6e18a03a.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +6 -6
- package/dist/loader.mjs +3 -3
- package/dist/node.d.ts +2 -2
- package/dist/node.mjs +9 -9
- package/dist/suite.mjs +5 -5
- package/dist/{vendor-index.731a22f2.mjs → vendor-index.29636037.mjs} +0 -0
- package/dist/{vendor-index.62ce5c33.mjs → vendor-index.2ae8040a.mjs} +0 -0
- package/dist/{vendor-index.13e3bda3.mjs → vendor-index.9d9196cc.mjs} +0 -0
- package/dist/{vendor-index.4aeeb598.mjs → vendor-index.fbec8a81.mjs} +2 -2
- package/dist/worker.mjs +6 -6
- package/package.json +12 -12
package/dist/{chunk-vite-node-externalize.3035bd5b.mjs → chunk-vite-node-externalize.8d8032d0.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as resolve, j as join, b as basename, d as dirname, c as distDir, e as rootDir, p as picocolors, i as isAbsolute, r as relative, f as configFiles, g as defaultPort, n as normalize, t as toNamespacedPath, E as EXIT_CODE_RESTART } from './chunk-constants.
|
|
1
|
+
import { a as resolve, j as join, b as basename, d as dirname, c as distDir, e as rootDir, p as picocolors, i as isAbsolute, r as relative, f as configFiles, g as defaultPort, n as normalize, t as toNamespacedPath, E as EXIT_CODE_RESTART } from './chunk-constants.71e8a211.mjs';
|
|
2
2
|
import { p as pLimit, g as getCoverageProvider, C as CoverageProviderMap } from './chunk-integrations-coverage.99c020eb.mjs';
|
|
3
3
|
import { g as getEnvPackageName } from './chunk-env-node.ceb43f1c.mjs';
|
|
4
|
-
import { A as AggregateErrorPonyfill, s as slash$2, o as isNode, p as relativePath, z as getTests, e as getFullName, x as hasFailed, B as hasFailedSnapshot, C as getSuites, j as notNullish, v as shuffle, t as toArray$1, n as noop$1, D as deepMerge, b as getCallLastIndex, E as ensurePackageInstalled, F as stdout } from './chunk-mock-date.
|
|
4
|
+
import { A as AggregateErrorPonyfill, s as slash$2, o as isNode, p as relativePath, z as getTests, e as getFullName, x as hasFailed, B as hasFailedSnapshot, C as getSuites, j as notNullish, v as shuffle, t as toArray$1, n as noop$1, D as deepMerge, b as getCallLastIndex, E as ensurePackageInstalled, F as stdout } from './chunk-mock-date.2917be60.mjs';
|
|
5
5
|
import { loadConfigFromFile, normalizePath, createServer, mergeConfig } from 'vite';
|
|
6
6
|
import path$a from 'path';
|
|
7
7
|
import url, { fileURLToPath } from 'url';
|
|
@@ -12,24 +12,24 @@ import util$2 from 'util';
|
|
|
12
12
|
import require$$0$1 from 'stream';
|
|
13
13
|
import require$$2 from 'events';
|
|
14
14
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
15
|
-
import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.
|
|
15
|
+
import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.da0a17ff.mjs';
|
|
16
16
|
import { performance } from 'perf_hooks';
|
|
17
17
|
import createDebug from 'debug';
|
|
18
|
-
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap } from './chunk-vite-node-utils.
|
|
18
|
+
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap } from './chunk-vite-node-utils.473cd0b2.mjs';
|
|
19
19
|
import { MessageChannel } from 'worker_threads';
|
|
20
20
|
import { Tinypool } from 'tinypool';
|
|
21
|
-
import { c as stripAnsi, d as cliTruncate, p as parseStacktrace, i as interpretSourcePos, e as stringWidth, h as ansiStyles, j as sliceAnsi, s as stringify$5, u as unifiedDiff, b as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.
|
|
21
|
+
import { c as stripAnsi, d as cliTruncate, p as parseStacktrace, i as interpretSourcePos, e as stringWidth, h as ansiStyles, j as sliceAnsi, s as stringify$5, u as unifiedDiff, b as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.2be5aa48.mjs';
|
|
22
22
|
import { b as safeSetInterval, c as safeClearInterval, s as safeSetTimeout, a as safeClearTimeout } from './chunk-utils-timers.b48455ed.mjs';
|
|
23
23
|
import { resolveModule } from 'local-pkg';
|
|
24
24
|
import { createHash } from 'crypto';
|
|
25
|
-
import { o as onetime } from './vendor-index.
|
|
26
|
-
import { s as signalExit } from './vendor-index.
|
|
25
|
+
import { o as onetime } from './vendor-index.9d9196cc.mjs';
|
|
26
|
+
import { s as signalExit } from './vendor-index.29636037.mjs';
|
|
27
27
|
import MagicString from './chunk-magic-string.56b2b543.mjs';
|
|
28
28
|
import { stripLiteral } from 'strip-literal';
|
|
29
29
|
import require$$0$2 from 'readline';
|
|
30
30
|
import { p as prompts } from './vendor-index.ae96af6e.mjs';
|
|
31
31
|
|
|
32
|
-
var version$1 = "0.23.
|
|
32
|
+
var version$1 = "0.23.4";
|
|
33
33
|
|
|
34
34
|
class EndError extends Error {
|
|
35
35
|
constructor(value) {
|
|
@@ -179,91 +179,91 @@ var utils$k = {};
|
|
|
179
179
|
|
|
180
180
|
var array$1 = {};
|
|
181
181
|
|
|
182
|
-
Object.defineProperty(array$1, "__esModule", { value: true });
|
|
183
|
-
array$1.splitWhen = array$1.flatten = void 0;
|
|
184
|
-
function flatten(items) {
|
|
185
|
-
return items.reduce((collection, item) => [].concat(collection, item), []);
|
|
186
|
-
}
|
|
187
|
-
array$1.flatten = flatten;
|
|
188
|
-
function splitWhen(items, predicate) {
|
|
189
|
-
const result = [[]];
|
|
190
|
-
let groupIndex = 0;
|
|
191
|
-
for (const item of items) {
|
|
192
|
-
if (predicate(item)) {
|
|
193
|
-
groupIndex++;
|
|
194
|
-
result[groupIndex] = [];
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
result[groupIndex].push(item);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return result;
|
|
201
|
-
}
|
|
182
|
+
Object.defineProperty(array$1, "__esModule", { value: true });
|
|
183
|
+
array$1.splitWhen = array$1.flatten = void 0;
|
|
184
|
+
function flatten(items) {
|
|
185
|
+
return items.reduce((collection, item) => [].concat(collection, item), []);
|
|
186
|
+
}
|
|
187
|
+
array$1.flatten = flatten;
|
|
188
|
+
function splitWhen(items, predicate) {
|
|
189
|
+
const result = [[]];
|
|
190
|
+
let groupIndex = 0;
|
|
191
|
+
for (const item of items) {
|
|
192
|
+
if (predicate(item)) {
|
|
193
|
+
groupIndex++;
|
|
194
|
+
result[groupIndex] = [];
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
result[groupIndex].push(item);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return result;
|
|
201
|
+
}
|
|
202
202
|
array$1.splitWhen = splitWhen;
|
|
203
203
|
|
|
204
204
|
var errno$1 = {};
|
|
205
205
|
|
|
206
|
-
Object.defineProperty(errno$1, "__esModule", { value: true });
|
|
207
|
-
errno$1.isEnoentCodeError = void 0;
|
|
208
|
-
function isEnoentCodeError(error) {
|
|
209
|
-
return error.code === 'ENOENT';
|
|
210
|
-
}
|
|
206
|
+
Object.defineProperty(errno$1, "__esModule", { value: true });
|
|
207
|
+
errno$1.isEnoentCodeError = void 0;
|
|
208
|
+
function isEnoentCodeError(error) {
|
|
209
|
+
return error.code === 'ENOENT';
|
|
210
|
+
}
|
|
211
211
|
errno$1.isEnoentCodeError = isEnoentCodeError;
|
|
212
212
|
|
|
213
213
|
var fs$7 = {};
|
|
214
214
|
|
|
215
|
-
Object.defineProperty(fs$7, "__esModule", { value: true });
|
|
216
|
-
fs$7.createDirentFromStats = void 0;
|
|
217
|
-
class DirentFromStats$1 {
|
|
218
|
-
constructor(name, stats) {
|
|
219
|
-
this.name = name;
|
|
220
|
-
this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
|
221
|
-
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
|
222
|
-
this.isDirectory = stats.isDirectory.bind(stats);
|
|
223
|
-
this.isFIFO = stats.isFIFO.bind(stats);
|
|
224
|
-
this.isFile = stats.isFile.bind(stats);
|
|
225
|
-
this.isSocket = stats.isSocket.bind(stats);
|
|
226
|
-
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
function createDirentFromStats$1(name, stats) {
|
|
230
|
-
return new DirentFromStats$1(name, stats);
|
|
231
|
-
}
|
|
215
|
+
Object.defineProperty(fs$7, "__esModule", { value: true });
|
|
216
|
+
fs$7.createDirentFromStats = void 0;
|
|
217
|
+
class DirentFromStats$1 {
|
|
218
|
+
constructor(name, stats) {
|
|
219
|
+
this.name = name;
|
|
220
|
+
this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
|
221
|
+
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
|
222
|
+
this.isDirectory = stats.isDirectory.bind(stats);
|
|
223
|
+
this.isFIFO = stats.isFIFO.bind(stats);
|
|
224
|
+
this.isFile = stats.isFile.bind(stats);
|
|
225
|
+
this.isSocket = stats.isSocket.bind(stats);
|
|
226
|
+
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function createDirentFromStats$1(name, stats) {
|
|
230
|
+
return new DirentFromStats$1(name, stats);
|
|
231
|
+
}
|
|
232
232
|
fs$7.createDirentFromStats = createDirentFromStats$1;
|
|
233
233
|
|
|
234
234
|
var path$9 = {};
|
|
235
235
|
|
|
236
|
-
Object.defineProperty(path$9, "__esModule", { value: true });
|
|
237
|
-
path$9.removeLeadingDotSegment = path$9.escape = path$9.makeAbsolute = path$9.unixify = void 0;
|
|
238
|
-
const path$8 = path$a;
|
|
239
|
-
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
|
|
240
|
-
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
|
|
241
|
-
/**
|
|
242
|
-
* Designed to work only with simple paths: `dir\\file`.
|
|
243
|
-
*/
|
|
244
|
-
function unixify(filepath) {
|
|
245
|
-
return filepath.replace(/\\/g, '/');
|
|
246
|
-
}
|
|
247
|
-
path$9.unixify = unixify;
|
|
248
|
-
function makeAbsolute(cwd, filepath) {
|
|
249
|
-
return path$8.resolve(cwd, filepath);
|
|
250
|
-
}
|
|
251
|
-
path$9.makeAbsolute = makeAbsolute;
|
|
252
|
-
function escape(pattern) {
|
|
253
|
-
return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
|
254
|
-
}
|
|
255
|
-
path$9.escape = escape;
|
|
256
|
-
function removeLeadingDotSegment(entry) {
|
|
257
|
-
// We do not use `startsWith` because this is 10x slower than current implementation for some cases.
|
|
258
|
-
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
|
259
|
-
if (entry.charAt(0) === '.') {
|
|
260
|
-
const secondCharactery = entry.charAt(1);
|
|
261
|
-
if (secondCharactery === '/' || secondCharactery === '\\') {
|
|
262
|
-
return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return entry;
|
|
266
|
-
}
|
|
236
|
+
Object.defineProperty(path$9, "__esModule", { value: true });
|
|
237
|
+
path$9.removeLeadingDotSegment = path$9.escape = path$9.makeAbsolute = path$9.unixify = void 0;
|
|
238
|
+
const path$8 = path$a;
|
|
239
|
+
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
|
|
240
|
+
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
|
|
241
|
+
/**
|
|
242
|
+
* Designed to work only with simple paths: `dir\\file`.
|
|
243
|
+
*/
|
|
244
|
+
function unixify(filepath) {
|
|
245
|
+
return filepath.replace(/\\/g, '/');
|
|
246
|
+
}
|
|
247
|
+
path$9.unixify = unixify;
|
|
248
|
+
function makeAbsolute(cwd, filepath) {
|
|
249
|
+
return path$8.resolve(cwd, filepath);
|
|
250
|
+
}
|
|
251
|
+
path$9.makeAbsolute = makeAbsolute;
|
|
252
|
+
function escape(pattern) {
|
|
253
|
+
return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
|
254
|
+
}
|
|
255
|
+
path$9.escape = escape;
|
|
256
|
+
function removeLeadingDotSegment(entry) {
|
|
257
|
+
// We do not use `startsWith` because this is 10x slower than current implementation for some cases.
|
|
258
|
+
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
|
259
|
+
if (entry.charAt(0) === '.') {
|
|
260
|
+
const secondCharactery = entry.charAt(1);
|
|
261
|
+
if (secondCharactery === '/' || secondCharactery === '\\') {
|
|
262
|
+
return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return entry;
|
|
266
|
+
}
|
|
267
267
|
path$9.removeLeadingDotSegment = removeLeadingDotSegment;
|
|
268
268
|
|
|
269
269
|
var pattern$1 = {};
|
|
@@ -4441,173 +4441,173 @@ micromatch$1.braceExpand = (pattern, options) => {
|
|
|
4441
4441
|
|
|
4442
4442
|
var micromatch_1 = micromatch$1;
|
|
4443
4443
|
|
|
4444
|
-
Object.defineProperty(pattern$1, "__esModule", { value: true });
|
|
4445
|
-
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;
|
|
4446
|
-
const path$5 = path$a;
|
|
4447
|
-
const globParent = globParent$1;
|
|
4448
|
-
const micromatch = micromatch_1;
|
|
4449
|
-
const GLOBSTAR = '**';
|
|
4450
|
-
const ESCAPE_SYMBOL = '\\';
|
|
4451
|
-
const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
|
|
4452
|
-
const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
|
|
4453
|
-
const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
|
|
4454
|
-
const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
|
|
4455
|
-
const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
|
|
4456
|
-
function isStaticPattern(pattern, options = {}) {
|
|
4457
|
-
return !isDynamicPattern(pattern, options);
|
|
4458
|
-
}
|
|
4459
|
-
pattern$1.isStaticPattern = isStaticPattern;
|
|
4460
|
-
function isDynamicPattern(pattern, options = {}) {
|
|
4461
|
-
/**
|
|
4462
|
-
* A special case with an empty string is necessary for matching patterns that start with a forward slash.
|
|
4463
|
-
* An empty string cannot be a dynamic pattern.
|
|
4464
|
-
* For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
|
|
4465
|
-
*/
|
|
4466
|
-
if (pattern === '') {
|
|
4467
|
-
return false;
|
|
4468
|
-
}
|
|
4469
|
-
/**
|
|
4470
|
-
* When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
|
|
4471
|
-
* filepath directly (without read directory).
|
|
4472
|
-
*/
|
|
4473
|
-
if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
|
|
4474
|
-
return true;
|
|
4475
|
-
}
|
|
4476
|
-
if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
|
|
4477
|
-
return true;
|
|
4478
|
-
}
|
|
4479
|
-
if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
|
|
4480
|
-
return true;
|
|
4481
|
-
}
|
|
4482
|
-
if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
|
|
4483
|
-
return true;
|
|
4484
|
-
}
|
|
4485
|
-
return false;
|
|
4486
|
-
}
|
|
4487
|
-
pattern$1.isDynamicPattern = isDynamicPattern;
|
|
4488
|
-
function hasBraceExpansion(pattern) {
|
|
4489
|
-
const openingBraceIndex = pattern.indexOf('{');
|
|
4490
|
-
if (openingBraceIndex === -1) {
|
|
4491
|
-
return false;
|
|
4492
|
-
}
|
|
4493
|
-
const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1);
|
|
4494
|
-
if (closingBraceIndex === -1) {
|
|
4495
|
-
return false;
|
|
4496
|
-
}
|
|
4497
|
-
const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
|
|
4498
|
-
return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
|
|
4499
|
-
}
|
|
4500
|
-
function convertToPositivePattern(pattern) {
|
|
4501
|
-
return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
|
|
4502
|
-
}
|
|
4503
|
-
pattern$1.convertToPositivePattern = convertToPositivePattern;
|
|
4504
|
-
function convertToNegativePattern(pattern) {
|
|
4505
|
-
return '!' + pattern;
|
|
4506
|
-
}
|
|
4507
|
-
pattern$1.convertToNegativePattern = convertToNegativePattern;
|
|
4508
|
-
function isNegativePattern(pattern) {
|
|
4509
|
-
return pattern.startsWith('!') && pattern[1] !== '(';
|
|
4510
|
-
}
|
|
4511
|
-
pattern$1.isNegativePattern = isNegativePattern;
|
|
4512
|
-
function isPositivePattern(pattern) {
|
|
4513
|
-
return !isNegativePattern(pattern);
|
|
4514
|
-
}
|
|
4515
|
-
pattern$1.isPositivePattern = isPositivePattern;
|
|
4516
|
-
function getNegativePatterns(patterns) {
|
|
4517
|
-
return patterns.filter(isNegativePattern);
|
|
4518
|
-
}
|
|
4519
|
-
pattern$1.getNegativePatterns = getNegativePatterns;
|
|
4520
|
-
function getPositivePatterns$1(patterns) {
|
|
4521
|
-
return patterns.filter(isPositivePattern);
|
|
4522
|
-
}
|
|
4523
|
-
pattern$1.getPositivePatterns = getPositivePatterns$1;
|
|
4524
|
-
/**
|
|
4525
|
-
* Returns patterns that can be applied inside the current directory.
|
|
4526
|
-
*
|
|
4527
|
-
* @example
|
|
4528
|
-
* // ['./*', '*', 'a/*']
|
|
4529
|
-
* getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
|
|
4530
|
-
*/
|
|
4531
|
-
function getPatternsInsideCurrentDirectory(patterns) {
|
|
4532
|
-
return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
|
|
4533
|
-
}
|
|
4534
|
-
pattern$1.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
|
|
4535
|
-
/**
|
|
4536
|
-
* Returns patterns to be expanded relative to (outside) the current directory.
|
|
4537
|
-
*
|
|
4538
|
-
* @example
|
|
4539
|
-
* // ['../*', './../*']
|
|
4540
|
-
* getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
|
|
4541
|
-
*/
|
|
4542
|
-
function getPatternsOutsideCurrentDirectory(patterns) {
|
|
4543
|
-
return patterns.filter(isPatternRelatedToParentDirectory);
|
|
4544
|
-
}
|
|
4545
|
-
pattern$1.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
|
|
4546
|
-
function isPatternRelatedToParentDirectory(pattern) {
|
|
4547
|
-
return pattern.startsWith('..') || pattern.startsWith('./..');
|
|
4548
|
-
}
|
|
4549
|
-
pattern$1.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
|
|
4550
|
-
function getBaseDirectory(pattern) {
|
|
4551
|
-
return globParent(pattern, { flipBackslashes: false });
|
|
4552
|
-
}
|
|
4553
|
-
pattern$1.getBaseDirectory = getBaseDirectory;
|
|
4554
|
-
function hasGlobStar(pattern) {
|
|
4555
|
-
return pattern.includes(GLOBSTAR);
|
|
4556
|
-
}
|
|
4557
|
-
pattern$1.hasGlobStar = hasGlobStar;
|
|
4558
|
-
function endsWithSlashGlobStar(pattern) {
|
|
4559
|
-
return pattern.endsWith('/' + GLOBSTAR);
|
|
4560
|
-
}
|
|
4561
|
-
pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
4562
|
-
function isAffectDepthOfReadingPattern(pattern) {
|
|
4563
|
-
const basename = path$5.basename(pattern);
|
|
4564
|
-
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
|
4565
|
-
}
|
|
4566
|
-
pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
4567
|
-
function expandPatternsWithBraceExpansion(patterns) {
|
|
4568
|
-
return patterns.reduce((collection, pattern) => {
|
|
4569
|
-
return collection.concat(expandBraceExpansion(pattern));
|
|
4570
|
-
}, []);
|
|
4571
|
-
}
|
|
4572
|
-
pattern$1.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4573
|
-
function expandBraceExpansion(pattern) {
|
|
4574
|
-
return micromatch.braces(pattern, {
|
|
4575
|
-
expand: true,
|
|
4576
|
-
nodupes: true
|
|
4577
|
-
});
|
|
4578
|
-
}
|
|
4579
|
-
pattern$1.expandBraceExpansion = expandBraceExpansion;
|
|
4580
|
-
function getPatternParts(pattern, options) {
|
|
4581
|
-
let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
|
|
4582
|
-
/**
|
|
4583
|
-
* The scan method returns an empty array in some cases.
|
|
4584
|
-
* See micromatch/picomatch#58 for more details.
|
|
4585
|
-
*/
|
|
4586
|
-
if (parts.length === 0) {
|
|
4587
|
-
parts = [pattern];
|
|
4588
|
-
}
|
|
4589
|
-
/**
|
|
4590
|
-
* The scan method does not return an empty part for the pattern with a forward slash.
|
|
4591
|
-
* This is another part of micromatch/picomatch#58.
|
|
4592
|
-
*/
|
|
4593
|
-
if (parts[0].startsWith('/')) {
|
|
4594
|
-
parts[0] = parts[0].slice(1);
|
|
4595
|
-
parts.unshift('');
|
|
4596
|
-
}
|
|
4597
|
-
return parts;
|
|
4598
|
-
}
|
|
4599
|
-
pattern$1.getPatternParts = getPatternParts;
|
|
4600
|
-
function makeRe(pattern, options) {
|
|
4601
|
-
return micromatch.makeRe(pattern, options);
|
|
4602
|
-
}
|
|
4603
|
-
pattern$1.makeRe = makeRe;
|
|
4604
|
-
function convertPatternsToRe(patterns, options) {
|
|
4605
|
-
return patterns.map((pattern) => makeRe(pattern, options));
|
|
4606
|
-
}
|
|
4607
|
-
pattern$1.convertPatternsToRe = convertPatternsToRe;
|
|
4608
|
-
function matchAny(entry, patternsRe) {
|
|
4609
|
-
return patternsRe.some((patternRe) => patternRe.test(entry));
|
|
4610
|
-
}
|
|
4444
|
+
Object.defineProperty(pattern$1, "__esModule", { value: true });
|
|
4445
|
+
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;
|
|
4446
|
+
const path$5 = path$a;
|
|
4447
|
+
const globParent = globParent$1;
|
|
4448
|
+
const micromatch = micromatch_1;
|
|
4449
|
+
const GLOBSTAR = '**';
|
|
4450
|
+
const ESCAPE_SYMBOL = '\\';
|
|
4451
|
+
const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
|
|
4452
|
+
const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
|
|
4453
|
+
const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
|
|
4454
|
+
const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
|
|
4455
|
+
const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
|
|
4456
|
+
function isStaticPattern(pattern, options = {}) {
|
|
4457
|
+
return !isDynamicPattern(pattern, options);
|
|
4458
|
+
}
|
|
4459
|
+
pattern$1.isStaticPattern = isStaticPattern;
|
|
4460
|
+
function isDynamicPattern(pattern, options = {}) {
|
|
4461
|
+
/**
|
|
4462
|
+
* A special case with an empty string is necessary for matching patterns that start with a forward slash.
|
|
4463
|
+
* An empty string cannot be a dynamic pattern.
|
|
4464
|
+
* For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
|
|
4465
|
+
*/
|
|
4466
|
+
if (pattern === '') {
|
|
4467
|
+
return false;
|
|
4468
|
+
}
|
|
4469
|
+
/**
|
|
4470
|
+
* When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
|
|
4471
|
+
* filepath directly (without read directory).
|
|
4472
|
+
*/
|
|
4473
|
+
if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
|
|
4474
|
+
return true;
|
|
4475
|
+
}
|
|
4476
|
+
if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
|
|
4477
|
+
return true;
|
|
4478
|
+
}
|
|
4479
|
+
if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
|
|
4480
|
+
return true;
|
|
4481
|
+
}
|
|
4482
|
+
if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
|
|
4483
|
+
return true;
|
|
4484
|
+
}
|
|
4485
|
+
return false;
|
|
4486
|
+
}
|
|
4487
|
+
pattern$1.isDynamicPattern = isDynamicPattern;
|
|
4488
|
+
function hasBraceExpansion(pattern) {
|
|
4489
|
+
const openingBraceIndex = pattern.indexOf('{');
|
|
4490
|
+
if (openingBraceIndex === -1) {
|
|
4491
|
+
return false;
|
|
4492
|
+
}
|
|
4493
|
+
const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1);
|
|
4494
|
+
if (closingBraceIndex === -1) {
|
|
4495
|
+
return false;
|
|
4496
|
+
}
|
|
4497
|
+
const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
|
|
4498
|
+
return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
|
|
4499
|
+
}
|
|
4500
|
+
function convertToPositivePattern(pattern) {
|
|
4501
|
+
return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
|
|
4502
|
+
}
|
|
4503
|
+
pattern$1.convertToPositivePattern = convertToPositivePattern;
|
|
4504
|
+
function convertToNegativePattern(pattern) {
|
|
4505
|
+
return '!' + pattern;
|
|
4506
|
+
}
|
|
4507
|
+
pattern$1.convertToNegativePattern = convertToNegativePattern;
|
|
4508
|
+
function isNegativePattern(pattern) {
|
|
4509
|
+
return pattern.startsWith('!') && pattern[1] !== '(';
|
|
4510
|
+
}
|
|
4511
|
+
pattern$1.isNegativePattern = isNegativePattern;
|
|
4512
|
+
function isPositivePattern(pattern) {
|
|
4513
|
+
return !isNegativePattern(pattern);
|
|
4514
|
+
}
|
|
4515
|
+
pattern$1.isPositivePattern = isPositivePattern;
|
|
4516
|
+
function getNegativePatterns(patterns) {
|
|
4517
|
+
return patterns.filter(isNegativePattern);
|
|
4518
|
+
}
|
|
4519
|
+
pattern$1.getNegativePatterns = getNegativePatterns;
|
|
4520
|
+
function getPositivePatterns$1(patterns) {
|
|
4521
|
+
return patterns.filter(isPositivePattern);
|
|
4522
|
+
}
|
|
4523
|
+
pattern$1.getPositivePatterns = getPositivePatterns$1;
|
|
4524
|
+
/**
|
|
4525
|
+
* Returns patterns that can be applied inside the current directory.
|
|
4526
|
+
*
|
|
4527
|
+
* @example
|
|
4528
|
+
* // ['./*', '*', 'a/*']
|
|
4529
|
+
* getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
|
|
4530
|
+
*/
|
|
4531
|
+
function getPatternsInsideCurrentDirectory(patterns) {
|
|
4532
|
+
return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
|
|
4533
|
+
}
|
|
4534
|
+
pattern$1.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
|
|
4535
|
+
/**
|
|
4536
|
+
* Returns patterns to be expanded relative to (outside) the current directory.
|
|
4537
|
+
*
|
|
4538
|
+
* @example
|
|
4539
|
+
* // ['../*', './../*']
|
|
4540
|
+
* getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
|
|
4541
|
+
*/
|
|
4542
|
+
function getPatternsOutsideCurrentDirectory(patterns) {
|
|
4543
|
+
return patterns.filter(isPatternRelatedToParentDirectory);
|
|
4544
|
+
}
|
|
4545
|
+
pattern$1.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
|
|
4546
|
+
function isPatternRelatedToParentDirectory(pattern) {
|
|
4547
|
+
return pattern.startsWith('..') || pattern.startsWith('./..');
|
|
4548
|
+
}
|
|
4549
|
+
pattern$1.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
|
|
4550
|
+
function getBaseDirectory(pattern) {
|
|
4551
|
+
return globParent(pattern, { flipBackslashes: false });
|
|
4552
|
+
}
|
|
4553
|
+
pattern$1.getBaseDirectory = getBaseDirectory;
|
|
4554
|
+
function hasGlobStar(pattern) {
|
|
4555
|
+
return pattern.includes(GLOBSTAR);
|
|
4556
|
+
}
|
|
4557
|
+
pattern$1.hasGlobStar = hasGlobStar;
|
|
4558
|
+
function endsWithSlashGlobStar(pattern) {
|
|
4559
|
+
return pattern.endsWith('/' + GLOBSTAR);
|
|
4560
|
+
}
|
|
4561
|
+
pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
4562
|
+
function isAffectDepthOfReadingPattern(pattern) {
|
|
4563
|
+
const basename = path$5.basename(pattern);
|
|
4564
|
+
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
|
4565
|
+
}
|
|
4566
|
+
pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
4567
|
+
function expandPatternsWithBraceExpansion(patterns) {
|
|
4568
|
+
return patterns.reduce((collection, pattern) => {
|
|
4569
|
+
return collection.concat(expandBraceExpansion(pattern));
|
|
4570
|
+
}, []);
|
|
4571
|
+
}
|
|
4572
|
+
pattern$1.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4573
|
+
function expandBraceExpansion(pattern) {
|
|
4574
|
+
return micromatch.braces(pattern, {
|
|
4575
|
+
expand: true,
|
|
4576
|
+
nodupes: true
|
|
4577
|
+
});
|
|
4578
|
+
}
|
|
4579
|
+
pattern$1.expandBraceExpansion = expandBraceExpansion;
|
|
4580
|
+
function getPatternParts(pattern, options) {
|
|
4581
|
+
let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
|
|
4582
|
+
/**
|
|
4583
|
+
* The scan method returns an empty array in some cases.
|
|
4584
|
+
* See micromatch/picomatch#58 for more details.
|
|
4585
|
+
*/
|
|
4586
|
+
if (parts.length === 0) {
|
|
4587
|
+
parts = [pattern];
|
|
4588
|
+
}
|
|
4589
|
+
/**
|
|
4590
|
+
* The scan method does not return an empty part for the pattern with a forward slash.
|
|
4591
|
+
* This is another part of micromatch/picomatch#58.
|
|
4592
|
+
*/
|
|
4593
|
+
if (parts[0].startsWith('/')) {
|
|
4594
|
+
parts[0] = parts[0].slice(1);
|
|
4595
|
+
parts.unshift('');
|
|
4596
|
+
}
|
|
4597
|
+
return parts;
|
|
4598
|
+
}
|
|
4599
|
+
pattern$1.getPatternParts = getPatternParts;
|
|
4600
|
+
function makeRe(pattern, options) {
|
|
4601
|
+
return micromatch.makeRe(pattern, options);
|
|
4602
|
+
}
|
|
4603
|
+
pattern$1.makeRe = makeRe;
|
|
4604
|
+
function convertPatternsToRe(patterns, options) {
|
|
4605
|
+
return patterns.map((pattern) => makeRe(pattern, options));
|
|
4606
|
+
}
|
|
4607
|
+
pattern$1.convertPatternsToRe = convertPatternsToRe;
|
|
4608
|
+
function matchAny(entry, patternsRe) {
|
|
4609
|
+
return patternsRe.some((patternRe) => patternRe.test(entry));
|
|
4610
|
+
}
|
|
4611
4611
|
pattern$1.matchAny = matchAny;
|
|
4612
4612
|
|
|
4613
4613
|
var stream$4 = {};
|
|
@@ -4756,166 +4756,176 @@ function pauseStreams (streams, options) {
|
|
|
4756
4756
|
return streams
|
|
4757
4757
|
}
|
|
4758
4758
|
|
|
4759
|
-
Object.defineProperty(stream$4, "__esModule", { value: true });
|
|
4760
|
-
stream$4.merge = void 0;
|
|
4761
|
-
const merge2 = merge2_1;
|
|
4762
|
-
function merge(streams) {
|
|
4763
|
-
const mergedStream = merge2(streams);
|
|
4764
|
-
streams.forEach((stream) => {
|
|
4765
|
-
stream.once('error', (error) => mergedStream.emit('error', error));
|
|
4766
|
-
});
|
|
4767
|
-
mergedStream.once('close', () => propagateCloseEventToSources(streams));
|
|
4768
|
-
mergedStream.once('end', () => propagateCloseEventToSources(streams));
|
|
4769
|
-
return mergedStream;
|
|
4770
|
-
}
|
|
4771
|
-
stream$4.merge = merge;
|
|
4772
|
-
function propagateCloseEventToSources(streams) {
|
|
4773
|
-
streams.forEach((stream) => stream.emit('close'));
|
|
4759
|
+
Object.defineProperty(stream$4, "__esModule", { value: true });
|
|
4760
|
+
stream$4.merge = void 0;
|
|
4761
|
+
const merge2 = merge2_1;
|
|
4762
|
+
function merge(streams) {
|
|
4763
|
+
const mergedStream = merge2(streams);
|
|
4764
|
+
streams.forEach((stream) => {
|
|
4765
|
+
stream.once('error', (error) => mergedStream.emit('error', error));
|
|
4766
|
+
});
|
|
4767
|
+
mergedStream.once('close', () => propagateCloseEventToSources(streams));
|
|
4768
|
+
mergedStream.once('end', () => propagateCloseEventToSources(streams));
|
|
4769
|
+
return mergedStream;
|
|
4770
|
+
}
|
|
4771
|
+
stream$4.merge = merge;
|
|
4772
|
+
function propagateCloseEventToSources(streams) {
|
|
4773
|
+
streams.forEach((stream) => stream.emit('close'));
|
|
4774
4774
|
}
|
|
4775
4775
|
|
|
4776
4776
|
var string$1 = {};
|
|
4777
4777
|
|
|
4778
|
-
Object.defineProperty(string$1, "__esModule", { value: true });
|
|
4779
|
-
string$1.isEmpty = string$1.isString = void 0;
|
|
4780
|
-
function isString(input) {
|
|
4781
|
-
return typeof input === 'string';
|
|
4782
|
-
}
|
|
4783
|
-
string$1.isString = isString;
|
|
4784
|
-
function isEmpty(input) {
|
|
4785
|
-
return input === '';
|
|
4786
|
-
}
|
|
4778
|
+
Object.defineProperty(string$1, "__esModule", { value: true });
|
|
4779
|
+
string$1.isEmpty = string$1.isString = void 0;
|
|
4780
|
+
function isString(input) {
|
|
4781
|
+
return typeof input === 'string';
|
|
4782
|
+
}
|
|
4783
|
+
string$1.isString = isString;
|
|
4784
|
+
function isEmpty(input) {
|
|
4785
|
+
return input === '';
|
|
4786
|
+
}
|
|
4787
4787
|
string$1.isEmpty = isEmpty;
|
|
4788
4788
|
|
|
4789
|
-
Object.defineProperty(utils$k, "__esModule", { value: true });
|
|
4790
|
-
utils$k.string = utils$k.stream = utils$k.pattern = utils$k.path = utils$k.fs = utils$k.errno = utils$k.array = void 0;
|
|
4791
|
-
const array = array$1;
|
|
4792
|
-
utils$k.array = array;
|
|
4793
|
-
const errno = errno$1;
|
|
4794
|
-
utils$k.errno = errno;
|
|
4795
|
-
const fs$6 = fs$7;
|
|
4796
|
-
utils$k.fs = fs$6;
|
|
4797
|
-
const path$4 = path$9;
|
|
4798
|
-
utils$k.path = path$4;
|
|
4799
|
-
const pattern = pattern$1;
|
|
4800
|
-
utils$k.pattern = pattern;
|
|
4801
|
-
const stream$3 = stream$4;
|
|
4802
|
-
utils$k.stream = stream$3;
|
|
4803
|
-
const string = string$1;
|
|
4789
|
+
Object.defineProperty(utils$k, "__esModule", { value: true });
|
|
4790
|
+
utils$k.string = utils$k.stream = utils$k.pattern = utils$k.path = utils$k.fs = utils$k.errno = utils$k.array = void 0;
|
|
4791
|
+
const array = array$1;
|
|
4792
|
+
utils$k.array = array;
|
|
4793
|
+
const errno = errno$1;
|
|
4794
|
+
utils$k.errno = errno;
|
|
4795
|
+
const fs$6 = fs$7;
|
|
4796
|
+
utils$k.fs = fs$6;
|
|
4797
|
+
const path$4 = path$9;
|
|
4798
|
+
utils$k.path = path$4;
|
|
4799
|
+
const pattern = pattern$1;
|
|
4800
|
+
utils$k.pattern = pattern;
|
|
4801
|
+
const stream$3 = stream$4;
|
|
4802
|
+
utils$k.stream = stream$3;
|
|
4803
|
+
const string = string$1;
|
|
4804
4804
|
utils$k.string = string;
|
|
4805
4805
|
|
|
4806
|
-
Object.defineProperty(tasks, "__esModule", { value: true });
|
|
4807
|
-
tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0;
|
|
4808
|
-
const utils$a = utils$k;
|
|
4809
|
-
function generate(patterns, settings) {
|
|
4810
|
-
const positivePatterns = getPositivePatterns(patterns);
|
|
4811
|
-
const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
|
|
4812
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isStaticPattern(pattern, settings));
|
|
4813
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isDynamicPattern(pattern, settings));
|
|
4814
|
-
const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
|
|
4815
|
-
const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
|
|
4816
|
-
return staticTasks.concat(dynamicTasks);
|
|
4817
|
-
}
|
|
4818
|
-
tasks.generate = generate;
|
|
4819
|
-
/**
|
|
4820
|
-
* Returns tasks grouped by basic pattern directories.
|
|
4821
|
-
*
|
|
4822
|
-
* Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
|
|
4823
|
-
* This is necessary because directory traversal starts at the base directory and goes deeper.
|
|
4824
|
-
*/
|
|
4825
|
-
function convertPatternsToTasks(positive, negative, dynamic) {
|
|
4826
|
-
const tasks = [];
|
|
4827
|
-
const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive);
|
|
4828
|
-
const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive);
|
|
4829
|
-
const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
|
|
4830
|
-
const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
|
|
4831
|
-
tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
|
|
4832
|
-
/*
|
|
4833
|
-
* For the sake of reducing future accesses to the file system, we merge all tasks within the current directory
|
|
4834
|
-
* into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest.
|
|
4835
|
-
*/
|
|
4836
|
-
if ('.' in insideCurrentDirectoryGroup) {
|
|
4837
|
-
tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic));
|
|
4838
|
-
}
|
|
4839
|
-
else {
|
|
4840
|
-
tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
|
|
4841
|
-
}
|
|
4842
|
-
return tasks;
|
|
4843
|
-
}
|
|
4844
|
-
tasks.convertPatternsToTasks = convertPatternsToTasks;
|
|
4845
|
-
function getPositivePatterns(patterns) {
|
|
4846
|
-
return utils$a.pattern.getPositivePatterns(patterns);
|
|
4847
|
-
}
|
|
4848
|
-
tasks.getPositivePatterns = getPositivePatterns;
|
|
4849
|
-
function getNegativePatternsAsPositive(patterns, ignore) {
|
|
4850
|
-
const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore);
|
|
4851
|
-
const positive = negative.map(utils$a.pattern.convertToPositivePattern);
|
|
4852
|
-
return positive;
|
|
4853
|
-
}
|
|
4854
|
-
tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
4855
|
-
function groupPatternsByBaseDirectory(patterns) {
|
|
4856
|
-
const group = {};
|
|
4857
|
-
return patterns.reduce((collection, pattern) => {
|
|
4858
|
-
const base = utils$a.pattern.getBaseDirectory(pattern);
|
|
4859
|
-
if (base in collection) {
|
|
4860
|
-
collection[base].push(pattern);
|
|
4861
|
-
}
|
|
4862
|
-
else {
|
|
4863
|
-
collection[base] = [pattern];
|
|
4864
|
-
}
|
|
4865
|
-
return collection;
|
|
4866
|
-
}, group);
|
|
4867
|
-
}
|
|
4868
|
-
tasks.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
4869
|
-
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
4870
|
-
return Object.keys(positive).map((base) => {
|
|
4871
|
-
return convertPatternGroupToTask(base, positive[base], negative, dynamic);
|
|
4872
|
-
});
|
|
4873
|
-
}
|
|
4874
|
-
tasks.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
|
|
4875
|
-
function convertPatternGroupToTask(base, positive, negative, dynamic) {
|
|
4876
|
-
return {
|
|
4877
|
-
dynamic,
|
|
4878
|
-
positive,
|
|
4879
|
-
negative,
|
|
4880
|
-
base,
|
|
4881
|
-
patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern))
|
|
4882
|
-
};
|
|
4883
|
-
}
|
|
4806
|
+
Object.defineProperty(tasks, "__esModule", { value: true });
|
|
4807
|
+
tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0;
|
|
4808
|
+
const utils$a = utils$k;
|
|
4809
|
+
function generate(patterns, settings) {
|
|
4810
|
+
const positivePatterns = getPositivePatterns(patterns);
|
|
4811
|
+
const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
|
|
4812
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isStaticPattern(pattern, settings));
|
|
4813
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isDynamicPattern(pattern, settings));
|
|
4814
|
+
const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
|
|
4815
|
+
const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
|
|
4816
|
+
return staticTasks.concat(dynamicTasks);
|
|
4817
|
+
}
|
|
4818
|
+
tasks.generate = generate;
|
|
4819
|
+
/**
|
|
4820
|
+
* Returns tasks grouped by basic pattern directories.
|
|
4821
|
+
*
|
|
4822
|
+
* Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
|
|
4823
|
+
* This is necessary because directory traversal starts at the base directory and goes deeper.
|
|
4824
|
+
*/
|
|
4825
|
+
function convertPatternsToTasks(positive, negative, dynamic) {
|
|
4826
|
+
const tasks = [];
|
|
4827
|
+
const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive);
|
|
4828
|
+
const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive);
|
|
4829
|
+
const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
|
|
4830
|
+
const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
|
|
4831
|
+
tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
|
|
4832
|
+
/*
|
|
4833
|
+
* For the sake of reducing future accesses to the file system, we merge all tasks within the current directory
|
|
4834
|
+
* into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest.
|
|
4835
|
+
*/
|
|
4836
|
+
if ('.' in insideCurrentDirectoryGroup) {
|
|
4837
|
+
tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic));
|
|
4838
|
+
}
|
|
4839
|
+
else {
|
|
4840
|
+
tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
|
|
4841
|
+
}
|
|
4842
|
+
return tasks;
|
|
4843
|
+
}
|
|
4844
|
+
tasks.convertPatternsToTasks = convertPatternsToTasks;
|
|
4845
|
+
function getPositivePatterns(patterns) {
|
|
4846
|
+
return utils$a.pattern.getPositivePatterns(patterns);
|
|
4847
|
+
}
|
|
4848
|
+
tasks.getPositivePatterns = getPositivePatterns;
|
|
4849
|
+
function getNegativePatternsAsPositive(patterns, ignore) {
|
|
4850
|
+
const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore);
|
|
4851
|
+
const positive = negative.map(utils$a.pattern.convertToPositivePattern);
|
|
4852
|
+
return positive;
|
|
4853
|
+
}
|
|
4854
|
+
tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
4855
|
+
function groupPatternsByBaseDirectory(patterns) {
|
|
4856
|
+
const group = {};
|
|
4857
|
+
return patterns.reduce((collection, pattern) => {
|
|
4858
|
+
const base = utils$a.pattern.getBaseDirectory(pattern);
|
|
4859
|
+
if (base in collection) {
|
|
4860
|
+
collection[base].push(pattern);
|
|
4861
|
+
}
|
|
4862
|
+
else {
|
|
4863
|
+
collection[base] = [pattern];
|
|
4864
|
+
}
|
|
4865
|
+
return collection;
|
|
4866
|
+
}, group);
|
|
4867
|
+
}
|
|
4868
|
+
tasks.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
4869
|
+
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
4870
|
+
return Object.keys(positive).map((base) => {
|
|
4871
|
+
return convertPatternGroupToTask(base, positive[base], negative, dynamic);
|
|
4872
|
+
});
|
|
4873
|
+
}
|
|
4874
|
+
tasks.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
|
|
4875
|
+
function convertPatternGroupToTask(base, positive, negative, dynamic) {
|
|
4876
|
+
return {
|
|
4877
|
+
dynamic,
|
|
4878
|
+
positive,
|
|
4879
|
+
negative,
|
|
4880
|
+
base,
|
|
4881
|
+
patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern))
|
|
4882
|
+
};
|
|
4883
|
+
}
|
|
4884
4884
|
tasks.convertPatternGroupToTask = convertPatternGroupToTask;
|
|
4885
4885
|
|
|
4886
4886
|
var patterns = {};
|
|
4887
4887
|
|
|
4888
|
-
Object.defineProperty(patterns, "__esModule", { value: true });
|
|
4889
|
-
patterns.removeDuplicateSlashes = patterns.transform = void 0;
|
|
4890
|
-
/**
|
|
4891
|
-
* Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
|
|
4892
|
-
* The latter is due to the presence of the device path at the beginning of the UNC path.
|
|
4893
|
-
* @todo rewrite to negative lookbehind with the next major release.
|
|
4894
|
-
*/
|
|
4895
|
-
const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
|
|
4896
|
-
function transform(patterns) {
|
|
4897
|
-
return patterns.map((pattern) => removeDuplicateSlashes(pattern));
|
|
4898
|
-
}
|
|
4899
|
-
patterns.transform = transform;
|
|
4900
|
-
/**
|
|
4901
|
-
* This package only works with forward slashes as a path separator.
|
|
4902
|
-
* Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
|
|
4903
|
-
*/
|
|
4904
|
-
function removeDuplicateSlashes(pattern) {
|
|
4905
|
-
return pattern.replace(DOUBLE_SLASH_RE, '/');
|
|
4906
|
-
}
|
|
4888
|
+
Object.defineProperty(patterns, "__esModule", { value: true });
|
|
4889
|
+
patterns.removeDuplicateSlashes = patterns.transform = void 0;
|
|
4890
|
+
/**
|
|
4891
|
+
* Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
|
|
4892
|
+
* The latter is due to the presence of the device path at the beginning of the UNC path.
|
|
4893
|
+
* @todo rewrite to negative lookbehind with the next major release.
|
|
4894
|
+
*/
|
|
4895
|
+
const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
|
|
4896
|
+
function transform(patterns) {
|
|
4897
|
+
return patterns.map((pattern) => removeDuplicateSlashes(pattern));
|
|
4898
|
+
}
|
|
4899
|
+
patterns.transform = transform;
|
|
4900
|
+
/**
|
|
4901
|
+
* This package only works with forward slashes as a path separator.
|
|
4902
|
+
* Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
|
|
4903
|
+
*/
|
|
4904
|
+
function removeDuplicateSlashes(pattern) {
|
|
4905
|
+
return pattern.replace(DOUBLE_SLASH_RE, '/');
|
|
4906
|
+
}
|
|
4907
4907
|
patterns.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
4908
4908
|
|
|
4909
|
-
var async$
|
|
4909
|
+
var async$7 = {};
|
|
4910
4910
|
|
|
4911
|
-
var
|
|
4911
|
+
var async$6 = {};
|
|
4912
4912
|
|
|
4913
4913
|
var out$3 = {};
|
|
4914
4914
|
|
|
4915
4915
|
var async$5 = {};
|
|
4916
4916
|
|
|
4917
|
-
|
|
4918
|
-
|
|
4917
|
+
var async$4 = {};
|
|
4918
|
+
|
|
4919
|
+
var out$2 = {};
|
|
4920
|
+
|
|
4921
|
+
var async$3 = {};
|
|
4922
|
+
|
|
4923
|
+
var out$1 = {};
|
|
4924
|
+
|
|
4925
|
+
var async$2 = {};
|
|
4926
|
+
|
|
4927
|
+
Object.defineProperty(async$2, "__esModule", { value: true });
|
|
4928
|
+
async$2.read = void 0;
|
|
4919
4929
|
function read$3(path, settings, callback) {
|
|
4920
4930
|
settings.fs.lstat(path, (lstatError, lstat) => {
|
|
4921
4931
|
if (lstatError !== null) {
|
|
@@ -4942,7 +4952,7 @@ function read$3(path, settings, callback) {
|
|
|
4942
4952
|
});
|
|
4943
4953
|
});
|
|
4944
4954
|
}
|
|
4945
|
-
async$
|
|
4955
|
+
async$2.read = read$3;
|
|
4946
4956
|
function callFailureCallback$2(callback, error) {
|
|
4947
4957
|
callback(error);
|
|
4948
4958
|
}
|
|
@@ -5014,25 +5024,25 @@ class Settings$2 {
|
|
|
5014
5024
|
}
|
|
5015
5025
|
settings$3.default = Settings$2;
|
|
5016
5026
|
|
|
5017
|
-
Object.defineProperty(out$
|
|
5018
|
-
out$
|
|
5019
|
-
const async$
|
|
5027
|
+
Object.defineProperty(out$1, "__esModule", { value: true });
|
|
5028
|
+
out$1.statSync = out$1.stat = out$1.Settings = void 0;
|
|
5029
|
+
const async$1 = async$2;
|
|
5020
5030
|
const sync$6 = sync$7;
|
|
5021
5031
|
const settings_1$3 = settings$3;
|
|
5022
|
-
out$
|
|
5032
|
+
out$1.Settings = settings_1$3.default;
|
|
5023
5033
|
function stat(path, optionsOrSettingsOrCallback, callback) {
|
|
5024
5034
|
if (typeof optionsOrSettingsOrCallback === 'function') {
|
|
5025
|
-
async$
|
|
5035
|
+
async$1.read(path, getSettings$2(), optionsOrSettingsOrCallback);
|
|
5026
5036
|
return;
|
|
5027
5037
|
}
|
|
5028
|
-
async$
|
|
5038
|
+
async$1.read(path, getSettings$2(optionsOrSettingsOrCallback), callback);
|
|
5029
5039
|
}
|
|
5030
|
-
out$
|
|
5040
|
+
out$1.stat = stat;
|
|
5031
5041
|
function statSync(path, optionsOrSettings) {
|
|
5032
5042
|
const settings = getSettings$2(optionsOrSettings);
|
|
5033
5043
|
return sync$6.read(path, settings);
|
|
5034
5044
|
}
|
|
5035
|
-
out$
|
|
5045
|
+
out$1.statSync = statSync;
|
|
5036
5046
|
function getSettings$2(settingsOrOptions = {}) {
|
|
5037
5047
|
if (settingsOrOptions instanceof settings_1$3.default) {
|
|
5038
5048
|
return settingsOrOptions;
|
|
@@ -5040,16 +5050,6 @@ function getSettings$2(settingsOrOptions = {}) {
|
|
|
5040
5050
|
return new settings_1$3.default(settingsOrOptions);
|
|
5041
5051
|
}
|
|
5042
5052
|
|
|
5043
|
-
var out$2 = {};
|
|
5044
|
-
|
|
5045
|
-
var async$3 = {};
|
|
5046
|
-
|
|
5047
|
-
var async$2 = {};
|
|
5048
|
-
|
|
5049
|
-
var out$1 = {};
|
|
5050
|
-
|
|
5051
|
-
var async$1 = {};
|
|
5052
|
-
|
|
5053
5053
|
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
5054
5054
|
|
|
5055
5055
|
let promise;
|
|
@@ -5176,9 +5176,9 @@ function joinPathSegments$1(a, b, separator) {
|
|
|
5176
5176
|
}
|
|
5177
5177
|
common$6.joinPathSegments = joinPathSegments$1;
|
|
5178
5178
|
|
|
5179
|
-
Object.defineProperty(async$
|
|
5180
|
-
async$
|
|
5181
|
-
const fsStat$5 = out$
|
|
5179
|
+
Object.defineProperty(async$3, "__esModule", { value: true });
|
|
5180
|
+
async$3.readdir = async$3.readdirWithFileTypes = async$3.read = void 0;
|
|
5181
|
+
const fsStat$5 = out$1;
|
|
5182
5182
|
const rpl = runParallel_1;
|
|
5183
5183
|
const constants_1$1 = constants;
|
|
5184
5184
|
const utils$8 = utils$9;
|
|
@@ -5190,7 +5190,7 @@ function read$1(directory, settings, callback) {
|
|
|
5190
5190
|
}
|
|
5191
5191
|
readdir$1(directory, settings, callback);
|
|
5192
5192
|
}
|
|
5193
|
-
async$
|
|
5193
|
+
async$3.read = read$1;
|
|
5194
5194
|
function readdirWithFileTypes$1(directory, settings, callback) {
|
|
5195
5195
|
settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5196
5196
|
if (readdirError !== null) {
|
|
@@ -5216,7 +5216,7 @@ function readdirWithFileTypes$1(directory, settings, callback) {
|
|
|
5216
5216
|
});
|
|
5217
5217
|
});
|
|
5218
5218
|
}
|
|
5219
|
-
async$
|
|
5219
|
+
async$3.readdirWithFileTypes = readdirWithFileTypes$1;
|
|
5220
5220
|
function makeRplTaskEntry(entry, settings) {
|
|
5221
5221
|
return (done) => {
|
|
5222
5222
|
if (!entry.dirent.isSymbolicLink()) {
|
|
@@ -5272,7 +5272,7 @@ function readdir$1(directory, settings, callback) {
|
|
|
5272
5272
|
});
|
|
5273
5273
|
});
|
|
5274
5274
|
}
|
|
5275
|
-
async$
|
|
5275
|
+
async$3.readdir = readdir$1;
|
|
5276
5276
|
function callFailureCallback$1(callback, error) {
|
|
5277
5277
|
callback(error);
|
|
5278
5278
|
}
|
|
@@ -5284,7 +5284,7 @@ var sync$5 = {};
|
|
|
5284
5284
|
|
|
5285
5285
|
Object.defineProperty(sync$5, "__esModule", { value: true });
|
|
5286
5286
|
sync$5.readdir = sync$5.readdirWithFileTypes = sync$5.read = void 0;
|
|
5287
|
-
const fsStat$4 = out$
|
|
5287
|
+
const fsStat$4 = out$1;
|
|
5288
5288
|
const constants_1 = constants;
|
|
5289
5289
|
const utils$7 = utils$9;
|
|
5290
5290
|
const common$4 = common$6;
|
|
@@ -5363,7 +5363,7 @@ var fs$1 = {};
|
|
|
5363
5363
|
|
|
5364
5364
|
Object.defineProperty(settings$2, "__esModule", { value: true });
|
|
5365
5365
|
const path$3 = path$a;
|
|
5366
|
-
const fsStat$3 = out$
|
|
5366
|
+
const fsStat$3 = out$1;
|
|
5367
5367
|
const fs = fs$1;
|
|
5368
5368
|
class Settings$1 {
|
|
5369
5369
|
constructor(_options = {}) {
|
|
@@ -5385,12 +5385,12 @@ class Settings$1 {
|
|
|
5385
5385
|
}
|
|
5386
5386
|
settings$2.default = Settings$1;
|
|
5387
5387
|
|
|
5388
|
-
Object.defineProperty(out$
|
|
5389
|
-
out$
|
|
5390
|
-
const async = async$
|
|
5388
|
+
Object.defineProperty(out$2, "__esModule", { value: true });
|
|
5389
|
+
out$2.Settings = out$2.scandirSync = out$2.scandir = void 0;
|
|
5390
|
+
const async = async$3;
|
|
5391
5391
|
const sync$4 = sync$5;
|
|
5392
5392
|
const settings_1$2 = settings$2;
|
|
5393
|
-
out$
|
|
5393
|
+
out$2.Settings = settings_1$2.default;
|
|
5394
5394
|
function scandir(path, optionsOrSettingsOrCallback, callback) {
|
|
5395
5395
|
if (typeof optionsOrSettingsOrCallback === 'function') {
|
|
5396
5396
|
async.read(path, getSettings$1(), optionsOrSettingsOrCallback);
|
|
@@ -5398,12 +5398,12 @@ function scandir(path, optionsOrSettingsOrCallback, callback) {
|
|
|
5398
5398
|
}
|
|
5399
5399
|
async.read(path, getSettings$1(optionsOrSettingsOrCallback), callback);
|
|
5400
5400
|
}
|
|
5401
|
-
out$
|
|
5401
|
+
out$2.scandir = scandir;
|
|
5402
5402
|
function scandirSync(path, optionsOrSettings) {
|
|
5403
5403
|
const settings = getSettings$1(optionsOrSettings);
|
|
5404
5404
|
return sync$4.read(path, settings);
|
|
5405
5405
|
}
|
|
5406
|
-
out$
|
|
5406
|
+
out$2.scandirSync = scandirSync;
|
|
5407
5407
|
function getSettings$1(settingsOrOptions = {}) {
|
|
5408
5408
|
if (settingsOrOptions instanceof settings_1$2.default) {
|
|
5409
5409
|
return settingsOrOptions;
|
|
@@ -5773,13 +5773,13 @@ class Reader$1 {
|
|
|
5773
5773
|
}
|
|
5774
5774
|
reader$1.default = Reader$1;
|
|
5775
5775
|
|
|
5776
|
-
Object.defineProperty(async$
|
|
5776
|
+
Object.defineProperty(async$4, "__esModule", { value: true });
|
|
5777
5777
|
const events_1 = require$$2;
|
|
5778
|
-
const fsScandir$2 = out$
|
|
5778
|
+
const fsScandir$2 = out$2;
|
|
5779
5779
|
const fastq = queue.exports;
|
|
5780
5780
|
const common$1 = common$3;
|
|
5781
|
-
const reader_1$
|
|
5782
|
-
class AsyncReader extends reader_1$
|
|
5781
|
+
const reader_1$4 = reader$1;
|
|
5782
|
+
class AsyncReader extends reader_1$4.default {
|
|
5783
5783
|
constructor(_root, _settings) {
|
|
5784
5784
|
super(_root, _settings);
|
|
5785
5785
|
this._settings = _settings;
|
|
@@ -5868,15 +5868,15 @@ class AsyncReader extends reader_1$3.default {
|
|
|
5868
5868
|
this._emitter.emit('entry', entry);
|
|
5869
5869
|
}
|
|
5870
5870
|
}
|
|
5871
|
-
async$
|
|
5871
|
+
async$4.default = AsyncReader;
|
|
5872
5872
|
|
|
5873
|
-
Object.defineProperty(async$
|
|
5874
|
-
const async_1$
|
|
5873
|
+
Object.defineProperty(async$5, "__esModule", { value: true });
|
|
5874
|
+
const async_1$4 = async$4;
|
|
5875
5875
|
class AsyncProvider {
|
|
5876
5876
|
constructor(_root, _settings) {
|
|
5877
5877
|
this._root = _root;
|
|
5878
5878
|
this._settings = _settings;
|
|
5879
|
-
this._reader = new async_1$
|
|
5879
|
+
this._reader = new async_1$4.default(this._root, this._settings);
|
|
5880
5880
|
this._storage = [];
|
|
5881
5881
|
}
|
|
5882
5882
|
read(callback) {
|
|
@@ -5892,7 +5892,7 @@ class AsyncProvider {
|
|
|
5892
5892
|
this._reader.read();
|
|
5893
5893
|
}
|
|
5894
5894
|
}
|
|
5895
|
-
async$
|
|
5895
|
+
async$5.default = AsyncProvider;
|
|
5896
5896
|
function callFailureCallback(callback, error) {
|
|
5897
5897
|
callback(error);
|
|
5898
5898
|
}
|
|
@@ -5900,16 +5900,16 @@ function callSuccessCallback(callback, entries) {
|
|
|
5900
5900
|
callback(null, entries);
|
|
5901
5901
|
}
|
|
5902
5902
|
|
|
5903
|
-
var stream$
|
|
5903
|
+
var stream$2 = {};
|
|
5904
5904
|
|
|
5905
|
-
Object.defineProperty(stream$
|
|
5905
|
+
Object.defineProperty(stream$2, "__esModule", { value: true });
|
|
5906
5906
|
const stream_1$5 = require$$0$1;
|
|
5907
|
-
const async_1$
|
|
5907
|
+
const async_1$3 = async$4;
|
|
5908
5908
|
class StreamProvider {
|
|
5909
5909
|
constructor(_root, _settings) {
|
|
5910
5910
|
this._root = _root;
|
|
5911
5911
|
this._settings = _settings;
|
|
5912
|
-
this._reader = new async_1$
|
|
5912
|
+
this._reader = new async_1$3.default(this._root, this._settings);
|
|
5913
5913
|
this._stream = new stream_1$5.Readable({
|
|
5914
5914
|
objectMode: true,
|
|
5915
5915
|
read: () => { },
|
|
@@ -5934,17 +5934,17 @@ class StreamProvider {
|
|
|
5934
5934
|
return this._stream;
|
|
5935
5935
|
}
|
|
5936
5936
|
}
|
|
5937
|
-
stream$
|
|
5937
|
+
stream$2.default = StreamProvider;
|
|
5938
5938
|
|
|
5939
5939
|
var sync$3 = {};
|
|
5940
5940
|
|
|
5941
5941
|
var sync$2 = {};
|
|
5942
5942
|
|
|
5943
5943
|
Object.defineProperty(sync$2, "__esModule", { value: true });
|
|
5944
|
-
const fsScandir$1 = out$
|
|
5944
|
+
const fsScandir$1 = out$2;
|
|
5945
5945
|
const common = common$3;
|
|
5946
|
-
const reader_1$
|
|
5947
|
-
class SyncReader extends reader_1$
|
|
5946
|
+
const reader_1$3 = reader$1;
|
|
5947
|
+
class SyncReader extends reader_1$3.default {
|
|
5948
5948
|
constructor() {
|
|
5949
5949
|
super(...arguments);
|
|
5950
5950
|
this._scandir = fsScandir$1.scandirSync;
|
|
@@ -6017,7 +6017,7 @@ var settings$1 = {};
|
|
|
6017
6017
|
|
|
6018
6018
|
Object.defineProperty(settings$1, "__esModule", { value: true });
|
|
6019
6019
|
const path$2 = path$a;
|
|
6020
|
-
const fsScandir = out$
|
|
6020
|
+
const fsScandir = out$2;
|
|
6021
6021
|
class Settings {
|
|
6022
6022
|
constructor(_options = {}) {
|
|
6023
6023
|
this._options = _options;
|
|
@@ -6041,33 +6041,33 @@ class Settings {
|
|
|
6041
6041
|
}
|
|
6042
6042
|
settings$1.default = Settings;
|
|
6043
6043
|
|
|
6044
|
-
Object.defineProperty(out$
|
|
6045
|
-
out$
|
|
6046
|
-
const async_1$
|
|
6047
|
-
const stream_1$4 = stream$
|
|
6044
|
+
Object.defineProperty(out$3, "__esModule", { value: true });
|
|
6045
|
+
out$3.Settings = out$3.walkStream = out$3.walkSync = out$3.walk = void 0;
|
|
6046
|
+
const async_1$2 = async$5;
|
|
6047
|
+
const stream_1$4 = stream$2;
|
|
6048
6048
|
const sync_1$2 = sync$3;
|
|
6049
6049
|
const settings_1$1 = settings$1;
|
|
6050
|
-
out$
|
|
6050
|
+
out$3.Settings = settings_1$1.default;
|
|
6051
6051
|
function walk(directory, optionsOrSettingsOrCallback, callback) {
|
|
6052
6052
|
if (typeof optionsOrSettingsOrCallback === 'function') {
|
|
6053
|
-
new async_1$
|
|
6053
|
+
new async_1$2.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
|
|
6054
6054
|
return;
|
|
6055
6055
|
}
|
|
6056
|
-
new async_1$
|
|
6056
|
+
new async_1$2.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
|
|
6057
6057
|
}
|
|
6058
|
-
out$
|
|
6058
|
+
out$3.walk = walk;
|
|
6059
6059
|
function walkSync(directory, optionsOrSettings) {
|
|
6060
6060
|
const settings = getSettings(optionsOrSettings);
|
|
6061
6061
|
const provider = new sync_1$2.default(directory, settings);
|
|
6062
6062
|
return provider.read();
|
|
6063
6063
|
}
|
|
6064
|
-
out$
|
|
6064
|
+
out$3.walkSync = walkSync;
|
|
6065
6065
|
function walkStream(directory, optionsOrSettings) {
|
|
6066
6066
|
const settings = getSettings(optionsOrSettings);
|
|
6067
6067
|
const provider = new stream_1$4.default(directory, settings);
|
|
6068
6068
|
return provider.read();
|
|
6069
6069
|
}
|
|
6070
|
-
out$
|
|
6070
|
+
out$3.walkStream = walkStream;
|
|
6071
6071
|
function getSettings(settingsOrOptions = {}) {
|
|
6072
6072
|
if (settingsOrOptions instanceof settings_1$1.default) {
|
|
6073
6073
|
return settingsOrOptions;
|
|
@@ -6077,93 +6077,130 @@ function getSettings(settingsOrOptions = {}) {
|
|
|
6077
6077
|
|
|
6078
6078
|
var reader = {};
|
|
6079
6079
|
|
|
6080
|
-
Object.defineProperty(reader, "__esModule", { value: true });
|
|
6081
|
-
const path$1 = path$a;
|
|
6082
|
-
const fsStat$2 = out$
|
|
6083
|
-
const utils$6 = utils$k;
|
|
6084
|
-
class Reader {
|
|
6085
|
-
constructor(_settings) {
|
|
6086
|
-
this._settings = _settings;
|
|
6087
|
-
this._fsStatSettings = new fsStat$2.Settings({
|
|
6088
|
-
followSymbolicLink: this._settings.followSymbolicLinks,
|
|
6089
|
-
fs: this._settings.fs,
|
|
6090
|
-
throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
|
|
6091
|
-
});
|
|
6092
|
-
}
|
|
6093
|
-
_getFullEntryPath(filepath) {
|
|
6094
|
-
return path$1.resolve(this._settings.cwd, filepath);
|
|
6095
|
-
}
|
|
6096
|
-
_makeEntry(stats, pattern) {
|
|
6097
|
-
const entry = {
|
|
6098
|
-
name: pattern,
|
|
6099
|
-
path: pattern,
|
|
6100
|
-
dirent: utils$6.fs.createDirentFromStats(pattern, stats)
|
|
6101
|
-
};
|
|
6102
|
-
if (this._settings.stats) {
|
|
6103
|
-
entry.stats = stats;
|
|
6104
|
-
}
|
|
6105
|
-
return entry;
|
|
6106
|
-
}
|
|
6107
|
-
_isFatalError(error) {
|
|
6108
|
-
return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
|
|
6109
|
-
}
|
|
6110
|
-
}
|
|
6080
|
+
Object.defineProperty(reader, "__esModule", { value: true });
|
|
6081
|
+
const path$1 = path$a;
|
|
6082
|
+
const fsStat$2 = out$1;
|
|
6083
|
+
const utils$6 = utils$k;
|
|
6084
|
+
class Reader {
|
|
6085
|
+
constructor(_settings) {
|
|
6086
|
+
this._settings = _settings;
|
|
6087
|
+
this._fsStatSettings = new fsStat$2.Settings({
|
|
6088
|
+
followSymbolicLink: this._settings.followSymbolicLinks,
|
|
6089
|
+
fs: this._settings.fs,
|
|
6090
|
+
throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
|
|
6091
|
+
});
|
|
6092
|
+
}
|
|
6093
|
+
_getFullEntryPath(filepath) {
|
|
6094
|
+
return path$1.resolve(this._settings.cwd, filepath);
|
|
6095
|
+
}
|
|
6096
|
+
_makeEntry(stats, pattern) {
|
|
6097
|
+
const entry = {
|
|
6098
|
+
name: pattern,
|
|
6099
|
+
path: pattern,
|
|
6100
|
+
dirent: utils$6.fs.createDirentFromStats(pattern, stats)
|
|
6101
|
+
};
|
|
6102
|
+
if (this._settings.stats) {
|
|
6103
|
+
entry.stats = stats;
|
|
6104
|
+
}
|
|
6105
|
+
return entry;
|
|
6106
|
+
}
|
|
6107
|
+
_isFatalError(error) {
|
|
6108
|
+
return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
|
|
6109
|
+
}
|
|
6110
|
+
}
|
|
6111
6111
|
reader.default = Reader;
|
|
6112
6112
|
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
const
|
|
6117
|
-
const
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
}
|
|
6166
|
-
|
|
6113
|
+
var stream$1 = {};
|
|
6114
|
+
|
|
6115
|
+
Object.defineProperty(stream$1, "__esModule", { value: true });
|
|
6116
|
+
const stream_1$3 = require$$0$1;
|
|
6117
|
+
const fsStat$1 = out$1;
|
|
6118
|
+
const fsWalk$2 = out$3;
|
|
6119
|
+
const reader_1$2 = reader;
|
|
6120
|
+
class ReaderStream extends reader_1$2.default {
|
|
6121
|
+
constructor() {
|
|
6122
|
+
super(...arguments);
|
|
6123
|
+
this._walkStream = fsWalk$2.walkStream;
|
|
6124
|
+
this._stat = fsStat$1.stat;
|
|
6125
|
+
}
|
|
6126
|
+
dynamic(root, options) {
|
|
6127
|
+
return this._walkStream(root, options);
|
|
6128
|
+
}
|
|
6129
|
+
static(patterns, options) {
|
|
6130
|
+
const filepaths = patterns.map(this._getFullEntryPath, this);
|
|
6131
|
+
const stream = new stream_1$3.PassThrough({ objectMode: true });
|
|
6132
|
+
stream._write = (index, _enc, done) => {
|
|
6133
|
+
return this._getEntry(filepaths[index], patterns[index], options)
|
|
6134
|
+
.then((entry) => {
|
|
6135
|
+
if (entry !== null && options.entryFilter(entry)) {
|
|
6136
|
+
stream.push(entry);
|
|
6137
|
+
}
|
|
6138
|
+
if (index === filepaths.length - 1) {
|
|
6139
|
+
stream.end();
|
|
6140
|
+
}
|
|
6141
|
+
done();
|
|
6142
|
+
})
|
|
6143
|
+
.catch(done);
|
|
6144
|
+
};
|
|
6145
|
+
for (let i = 0; i < filepaths.length; i++) {
|
|
6146
|
+
stream.write(i);
|
|
6147
|
+
}
|
|
6148
|
+
return stream;
|
|
6149
|
+
}
|
|
6150
|
+
_getEntry(filepath, pattern, options) {
|
|
6151
|
+
return this._getStat(filepath)
|
|
6152
|
+
.then((stats) => this._makeEntry(stats, pattern))
|
|
6153
|
+
.catch((error) => {
|
|
6154
|
+
if (options.errorFilter(error)) {
|
|
6155
|
+
return null;
|
|
6156
|
+
}
|
|
6157
|
+
throw error;
|
|
6158
|
+
});
|
|
6159
|
+
}
|
|
6160
|
+
_getStat(filepath) {
|
|
6161
|
+
return new Promise((resolve, reject) => {
|
|
6162
|
+
this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
|
6163
|
+
return error === null ? resolve(stats) : reject(error);
|
|
6164
|
+
});
|
|
6165
|
+
});
|
|
6166
|
+
}
|
|
6167
|
+
}
|
|
6168
|
+
stream$1.default = ReaderStream;
|
|
6169
|
+
|
|
6170
|
+
Object.defineProperty(async$6, "__esModule", { value: true });
|
|
6171
|
+
const fsWalk$1 = out$3;
|
|
6172
|
+
const reader_1$1 = reader;
|
|
6173
|
+
const stream_1$2 = stream$1;
|
|
6174
|
+
class ReaderAsync extends reader_1$1.default {
|
|
6175
|
+
constructor() {
|
|
6176
|
+
super(...arguments);
|
|
6177
|
+
this._walkAsync = fsWalk$1.walk;
|
|
6178
|
+
this._readerStream = new stream_1$2.default(this._settings);
|
|
6179
|
+
}
|
|
6180
|
+
dynamic(root, options) {
|
|
6181
|
+
return new Promise((resolve, reject) => {
|
|
6182
|
+
this._walkAsync(root, options, (error, entries) => {
|
|
6183
|
+
if (error === null) {
|
|
6184
|
+
resolve(entries);
|
|
6185
|
+
}
|
|
6186
|
+
else {
|
|
6187
|
+
reject(error);
|
|
6188
|
+
}
|
|
6189
|
+
});
|
|
6190
|
+
});
|
|
6191
|
+
}
|
|
6192
|
+
async static(patterns, options) {
|
|
6193
|
+
const entries = [];
|
|
6194
|
+
const stream = this._readerStream.static(patterns, options);
|
|
6195
|
+
// After #235, replace it with an asynchronous iterator.
|
|
6196
|
+
return new Promise((resolve, reject) => {
|
|
6197
|
+
stream.once('error', reject);
|
|
6198
|
+
stream.on('data', (entry) => entries.push(entry));
|
|
6199
|
+
stream.once('end', () => resolve(entries));
|
|
6200
|
+
});
|
|
6201
|
+
}
|
|
6202
|
+
}
|
|
6203
|
+
async$6.default = ReaderAsync;
|
|
6167
6204
|
|
|
6168
6205
|
var provider = {};
|
|
6169
6206
|
|
|
@@ -6173,569 +6210,568 @@ var partial = {};
|
|
|
6173
6210
|
|
|
6174
6211
|
var matcher = {};
|
|
6175
6212
|
|
|
6176
|
-
Object.defineProperty(matcher, "__esModule", { value: true });
|
|
6177
|
-
const utils$5 = utils$k;
|
|
6178
|
-
class Matcher {
|
|
6179
|
-
constructor(_patterns, _settings, _micromatchOptions) {
|
|
6180
|
-
this._patterns = _patterns;
|
|
6181
|
-
this._settings = _settings;
|
|
6182
|
-
this._micromatchOptions = _micromatchOptions;
|
|
6183
|
-
this._storage = [];
|
|
6184
|
-
this._fillStorage();
|
|
6185
|
-
}
|
|
6186
|
-
_fillStorage() {
|
|
6187
|
-
/**
|
|
6188
|
-
* The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
|
|
6189
|
-
* So, before expand patterns with brace expansion into separated patterns.
|
|
6190
|
-
*/
|
|
6191
|
-
const patterns = utils$5.pattern.expandPatternsWithBraceExpansion(this._patterns);
|
|
6192
|
-
for (const pattern of patterns) {
|
|
6193
|
-
const segments = this._getPatternSegments(pattern);
|
|
6194
|
-
const sections = this._splitSegmentsIntoSections(segments);
|
|
6195
|
-
this._storage.push({
|
|
6196
|
-
complete: sections.length <= 1,
|
|
6197
|
-
pattern,
|
|
6198
|
-
segments,
|
|
6199
|
-
sections
|
|
6200
|
-
});
|
|
6201
|
-
}
|
|
6202
|
-
}
|
|
6203
|
-
_getPatternSegments(pattern) {
|
|
6204
|
-
const parts = utils$5.pattern.getPatternParts(pattern, this._micromatchOptions);
|
|
6205
|
-
return parts.map((part) => {
|
|
6206
|
-
const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings);
|
|
6207
|
-
if (!dynamic) {
|
|
6208
|
-
return {
|
|
6209
|
-
dynamic: false,
|
|
6210
|
-
pattern: part
|
|
6211
|
-
};
|
|
6212
|
-
}
|
|
6213
|
-
return {
|
|
6214
|
-
dynamic: true,
|
|
6215
|
-
pattern: part,
|
|
6216
|
-
patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
|
|
6217
|
-
};
|
|
6218
|
-
});
|
|
6219
|
-
}
|
|
6220
|
-
_splitSegmentsIntoSections(segments) {
|
|
6221
|
-
return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
|
|
6222
|
-
}
|
|
6223
|
-
}
|
|
6213
|
+
Object.defineProperty(matcher, "__esModule", { value: true });
|
|
6214
|
+
const utils$5 = utils$k;
|
|
6215
|
+
class Matcher {
|
|
6216
|
+
constructor(_patterns, _settings, _micromatchOptions) {
|
|
6217
|
+
this._patterns = _patterns;
|
|
6218
|
+
this._settings = _settings;
|
|
6219
|
+
this._micromatchOptions = _micromatchOptions;
|
|
6220
|
+
this._storage = [];
|
|
6221
|
+
this._fillStorage();
|
|
6222
|
+
}
|
|
6223
|
+
_fillStorage() {
|
|
6224
|
+
/**
|
|
6225
|
+
* The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
|
|
6226
|
+
* So, before expand patterns with brace expansion into separated patterns.
|
|
6227
|
+
*/
|
|
6228
|
+
const patterns = utils$5.pattern.expandPatternsWithBraceExpansion(this._patterns);
|
|
6229
|
+
for (const pattern of patterns) {
|
|
6230
|
+
const segments = this._getPatternSegments(pattern);
|
|
6231
|
+
const sections = this._splitSegmentsIntoSections(segments);
|
|
6232
|
+
this._storage.push({
|
|
6233
|
+
complete: sections.length <= 1,
|
|
6234
|
+
pattern,
|
|
6235
|
+
segments,
|
|
6236
|
+
sections
|
|
6237
|
+
});
|
|
6238
|
+
}
|
|
6239
|
+
}
|
|
6240
|
+
_getPatternSegments(pattern) {
|
|
6241
|
+
const parts = utils$5.pattern.getPatternParts(pattern, this._micromatchOptions);
|
|
6242
|
+
return parts.map((part) => {
|
|
6243
|
+
const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings);
|
|
6244
|
+
if (!dynamic) {
|
|
6245
|
+
return {
|
|
6246
|
+
dynamic: false,
|
|
6247
|
+
pattern: part
|
|
6248
|
+
};
|
|
6249
|
+
}
|
|
6250
|
+
return {
|
|
6251
|
+
dynamic: true,
|
|
6252
|
+
pattern: part,
|
|
6253
|
+
patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
|
|
6254
|
+
};
|
|
6255
|
+
});
|
|
6256
|
+
}
|
|
6257
|
+
_splitSegmentsIntoSections(segments) {
|
|
6258
|
+
return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
|
|
6259
|
+
}
|
|
6260
|
+
}
|
|
6224
6261
|
matcher.default = Matcher;
|
|
6225
6262
|
|
|
6226
|
-
Object.defineProperty(partial, "__esModule", { value: true });
|
|
6227
|
-
const matcher_1 = matcher;
|
|
6228
|
-
class PartialMatcher extends matcher_1.default {
|
|
6229
|
-
match(filepath) {
|
|
6230
|
-
const parts = filepath.split('/');
|
|
6231
|
-
const levels = parts.length;
|
|
6232
|
-
const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
|
|
6233
|
-
for (const pattern of patterns) {
|
|
6234
|
-
const section = pattern.sections[0];
|
|
6235
|
-
/**
|
|
6236
|
-
* In this case, the pattern has a globstar and we must read all directories unconditionally,
|
|
6237
|
-
* but only if the level has reached the end of the first group.
|
|
6238
|
-
*
|
|
6239
|
-
* fixtures/{a,b}/**
|
|
6240
|
-
* ^ true/false ^ always true
|
|
6241
|
-
*/
|
|
6242
|
-
if (!pattern.complete && levels > section.length) {
|
|
6243
|
-
return true;
|
|
6244
|
-
}
|
|
6245
|
-
const match = parts.every((part, index) => {
|
|
6246
|
-
const segment = pattern.segments[index];
|
|
6247
|
-
if (segment.dynamic && segment.patternRe.test(part)) {
|
|
6248
|
-
return true;
|
|
6249
|
-
}
|
|
6250
|
-
if (!segment.dynamic && segment.pattern === part) {
|
|
6251
|
-
return true;
|
|
6252
|
-
}
|
|
6253
|
-
return false;
|
|
6254
|
-
});
|
|
6255
|
-
if (match) {
|
|
6256
|
-
return true;
|
|
6257
|
-
}
|
|
6258
|
-
}
|
|
6259
|
-
return false;
|
|
6260
|
-
}
|
|
6261
|
-
}
|
|
6263
|
+
Object.defineProperty(partial, "__esModule", { value: true });
|
|
6264
|
+
const matcher_1 = matcher;
|
|
6265
|
+
class PartialMatcher extends matcher_1.default {
|
|
6266
|
+
match(filepath) {
|
|
6267
|
+
const parts = filepath.split('/');
|
|
6268
|
+
const levels = parts.length;
|
|
6269
|
+
const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
|
|
6270
|
+
for (const pattern of patterns) {
|
|
6271
|
+
const section = pattern.sections[0];
|
|
6272
|
+
/**
|
|
6273
|
+
* In this case, the pattern has a globstar and we must read all directories unconditionally,
|
|
6274
|
+
* but only if the level has reached the end of the first group.
|
|
6275
|
+
*
|
|
6276
|
+
* fixtures/{a,b}/**
|
|
6277
|
+
* ^ true/false ^ always true
|
|
6278
|
+
*/
|
|
6279
|
+
if (!pattern.complete && levels > section.length) {
|
|
6280
|
+
return true;
|
|
6281
|
+
}
|
|
6282
|
+
const match = parts.every((part, index) => {
|
|
6283
|
+
const segment = pattern.segments[index];
|
|
6284
|
+
if (segment.dynamic && segment.patternRe.test(part)) {
|
|
6285
|
+
return true;
|
|
6286
|
+
}
|
|
6287
|
+
if (!segment.dynamic && segment.pattern === part) {
|
|
6288
|
+
return true;
|
|
6289
|
+
}
|
|
6290
|
+
return false;
|
|
6291
|
+
});
|
|
6292
|
+
if (match) {
|
|
6293
|
+
return true;
|
|
6294
|
+
}
|
|
6295
|
+
}
|
|
6296
|
+
return false;
|
|
6297
|
+
}
|
|
6298
|
+
}
|
|
6262
6299
|
partial.default = PartialMatcher;
|
|
6263
6300
|
|
|
6264
|
-
Object.defineProperty(deep, "__esModule", { value: true });
|
|
6265
|
-
const utils$4 = utils$k;
|
|
6266
|
-
const partial_1 = partial;
|
|
6267
|
-
class DeepFilter {
|
|
6268
|
-
constructor(_settings, _micromatchOptions) {
|
|
6269
|
-
this._settings = _settings;
|
|
6270
|
-
this._micromatchOptions = _micromatchOptions;
|
|
6271
|
-
}
|
|
6272
|
-
getFilter(basePath, positive, negative) {
|
|
6273
|
-
const matcher = this._getMatcher(positive);
|
|
6274
|
-
const negativeRe = this._getNegativePatternsRe(negative);
|
|
6275
|
-
return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
|
6276
|
-
}
|
|
6277
|
-
_getMatcher(patterns) {
|
|
6278
|
-
return new partial_1.default(patterns, this._settings, this._micromatchOptions);
|
|
6279
|
-
}
|
|
6280
|
-
_getNegativePatternsRe(patterns) {
|
|
6281
|
-
const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
|
|
6282
|
-
return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
|
6283
|
-
}
|
|
6284
|
-
_filter(basePath, entry, matcher, negativeRe) {
|
|
6285
|
-
if (this._isSkippedByDeep(basePath, entry.path)) {
|
|
6286
|
-
return false;
|
|
6287
|
-
}
|
|
6288
|
-
if (this._isSkippedSymbolicLink(entry)) {
|
|
6289
|
-
return false;
|
|
6290
|
-
}
|
|
6291
|
-
const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
|
|
6292
|
-
if (this._isSkippedByPositivePatterns(filepath, matcher)) {
|
|
6293
|
-
return false;
|
|
6294
|
-
}
|
|
6295
|
-
return this._isSkippedByNegativePatterns(filepath, negativeRe);
|
|
6296
|
-
}
|
|
6297
|
-
_isSkippedByDeep(basePath, entryPath) {
|
|
6298
|
-
/**
|
|
6299
|
-
* Avoid unnecessary depth calculations when it doesn't matter.
|
|
6300
|
-
*/
|
|
6301
|
-
if (this._settings.deep === Infinity) {
|
|
6302
|
-
return false;
|
|
6303
|
-
}
|
|
6304
|
-
return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
|
6305
|
-
}
|
|
6306
|
-
_getEntryLevel(basePath, entryPath) {
|
|
6307
|
-
const entryPathDepth = entryPath.split('/').length;
|
|
6308
|
-
if (basePath === '') {
|
|
6309
|
-
return entryPathDepth;
|
|
6310
|
-
}
|
|
6311
|
-
const basePathDepth = basePath.split('/').length;
|
|
6312
|
-
return entryPathDepth - basePathDepth;
|
|
6313
|
-
}
|
|
6314
|
-
_isSkippedSymbolicLink(entry) {
|
|
6315
|
-
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
|
6316
|
-
}
|
|
6317
|
-
_isSkippedByPositivePatterns(entryPath, matcher) {
|
|
6318
|
-
return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
|
6319
|
-
}
|
|
6320
|
-
_isSkippedByNegativePatterns(entryPath, patternsRe) {
|
|
6321
|
-
return !utils$4.pattern.matchAny(entryPath, patternsRe);
|
|
6322
|
-
}
|
|
6323
|
-
}
|
|
6301
|
+
Object.defineProperty(deep, "__esModule", { value: true });
|
|
6302
|
+
const utils$4 = utils$k;
|
|
6303
|
+
const partial_1 = partial;
|
|
6304
|
+
class DeepFilter {
|
|
6305
|
+
constructor(_settings, _micromatchOptions) {
|
|
6306
|
+
this._settings = _settings;
|
|
6307
|
+
this._micromatchOptions = _micromatchOptions;
|
|
6308
|
+
}
|
|
6309
|
+
getFilter(basePath, positive, negative) {
|
|
6310
|
+
const matcher = this._getMatcher(positive);
|
|
6311
|
+
const negativeRe = this._getNegativePatternsRe(negative);
|
|
6312
|
+
return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
|
6313
|
+
}
|
|
6314
|
+
_getMatcher(patterns) {
|
|
6315
|
+
return new partial_1.default(patterns, this._settings, this._micromatchOptions);
|
|
6316
|
+
}
|
|
6317
|
+
_getNegativePatternsRe(patterns) {
|
|
6318
|
+
const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
|
|
6319
|
+
return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
|
6320
|
+
}
|
|
6321
|
+
_filter(basePath, entry, matcher, negativeRe) {
|
|
6322
|
+
if (this._isSkippedByDeep(basePath, entry.path)) {
|
|
6323
|
+
return false;
|
|
6324
|
+
}
|
|
6325
|
+
if (this._isSkippedSymbolicLink(entry)) {
|
|
6326
|
+
return false;
|
|
6327
|
+
}
|
|
6328
|
+
const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
|
|
6329
|
+
if (this._isSkippedByPositivePatterns(filepath, matcher)) {
|
|
6330
|
+
return false;
|
|
6331
|
+
}
|
|
6332
|
+
return this._isSkippedByNegativePatterns(filepath, negativeRe);
|
|
6333
|
+
}
|
|
6334
|
+
_isSkippedByDeep(basePath, entryPath) {
|
|
6335
|
+
/**
|
|
6336
|
+
* Avoid unnecessary depth calculations when it doesn't matter.
|
|
6337
|
+
*/
|
|
6338
|
+
if (this._settings.deep === Infinity) {
|
|
6339
|
+
return false;
|
|
6340
|
+
}
|
|
6341
|
+
return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
|
6342
|
+
}
|
|
6343
|
+
_getEntryLevel(basePath, entryPath) {
|
|
6344
|
+
const entryPathDepth = entryPath.split('/').length;
|
|
6345
|
+
if (basePath === '') {
|
|
6346
|
+
return entryPathDepth;
|
|
6347
|
+
}
|
|
6348
|
+
const basePathDepth = basePath.split('/').length;
|
|
6349
|
+
return entryPathDepth - basePathDepth;
|
|
6350
|
+
}
|
|
6351
|
+
_isSkippedSymbolicLink(entry) {
|
|
6352
|
+
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
|
6353
|
+
}
|
|
6354
|
+
_isSkippedByPositivePatterns(entryPath, matcher) {
|
|
6355
|
+
return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
|
6356
|
+
}
|
|
6357
|
+
_isSkippedByNegativePatterns(entryPath, patternsRe) {
|
|
6358
|
+
return !utils$4.pattern.matchAny(entryPath, patternsRe);
|
|
6359
|
+
}
|
|
6360
|
+
}
|
|
6324
6361
|
deep.default = DeepFilter;
|
|
6325
6362
|
|
|
6326
6363
|
var entry$1 = {};
|
|
6327
6364
|
|
|
6328
|
-
Object.defineProperty(entry$1, "__esModule", { value: true });
|
|
6329
|
-
const utils$3 = utils$k;
|
|
6330
|
-
class EntryFilter {
|
|
6331
|
-
constructor(_settings, _micromatchOptions) {
|
|
6332
|
-
this._settings = _settings;
|
|
6333
|
-
this._micromatchOptions = _micromatchOptions;
|
|
6334
|
-
this.index = new Map();
|
|
6335
|
-
}
|
|
6336
|
-
getFilter(positive, negative) {
|
|
6337
|
-
const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions);
|
|
6338
|
-
const negativeRe = utils$3.pattern.convertPatternsToRe(negative, this._micromatchOptions);
|
|
6339
|
-
return (entry) => this._filter(entry, positiveRe, negativeRe);
|
|
6340
|
-
}
|
|
6341
|
-
_filter(entry, positiveRe, negativeRe) {
|
|
6342
|
-
if (this._settings.unique && this._isDuplicateEntry(entry)) {
|
|
6343
|
-
return false;
|
|
6344
|
-
}
|
|
6345
|
-
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
|
6346
|
-
return false;
|
|
6347
|
-
}
|
|
6348
|
-
if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
|
|
6349
|
-
return false;
|
|
6350
|
-
}
|
|
6351
|
-
const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
|
|
6352
|
-
const
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6365
|
+
Object.defineProperty(entry$1, "__esModule", { value: true });
|
|
6366
|
+
const utils$3 = utils$k;
|
|
6367
|
+
class EntryFilter {
|
|
6368
|
+
constructor(_settings, _micromatchOptions) {
|
|
6369
|
+
this._settings = _settings;
|
|
6370
|
+
this._micromatchOptions = _micromatchOptions;
|
|
6371
|
+
this.index = new Map();
|
|
6372
|
+
}
|
|
6373
|
+
getFilter(positive, negative) {
|
|
6374
|
+
const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions);
|
|
6375
|
+
const negativeRe = utils$3.pattern.convertPatternsToRe(negative, this._micromatchOptions);
|
|
6376
|
+
return (entry) => this._filter(entry, positiveRe, negativeRe);
|
|
6377
|
+
}
|
|
6378
|
+
_filter(entry, positiveRe, negativeRe) {
|
|
6379
|
+
if (this._settings.unique && this._isDuplicateEntry(entry)) {
|
|
6380
|
+
return false;
|
|
6381
|
+
}
|
|
6382
|
+
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
|
6383
|
+
return false;
|
|
6384
|
+
}
|
|
6385
|
+
if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
|
|
6386
|
+
return false;
|
|
6387
|
+
}
|
|
6388
|
+
const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
|
|
6389
|
+
const isDirectory = entry.dirent.isDirectory();
|
|
6390
|
+
const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory);
|
|
6391
|
+
if (this._settings.unique && isMatched) {
|
|
6392
|
+
this._createIndexRecord(entry);
|
|
6393
|
+
}
|
|
6394
|
+
return isMatched;
|
|
6395
|
+
}
|
|
6396
|
+
_isDuplicateEntry(entry) {
|
|
6397
|
+
return this.index.has(entry.path);
|
|
6398
|
+
}
|
|
6399
|
+
_createIndexRecord(entry) {
|
|
6400
|
+
this.index.set(entry.path, undefined);
|
|
6401
|
+
}
|
|
6402
|
+
_onlyFileFilter(entry) {
|
|
6403
|
+
return this._settings.onlyFiles && !entry.dirent.isFile();
|
|
6404
|
+
}
|
|
6405
|
+
_onlyDirectoryFilter(entry) {
|
|
6406
|
+
return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
|
6407
|
+
}
|
|
6408
|
+
_isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
|
|
6409
|
+
if (!this._settings.absolute) {
|
|
6410
|
+
return false;
|
|
6411
|
+
}
|
|
6412
|
+
const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, entryPath);
|
|
6413
|
+
return utils$3.pattern.matchAny(fullpath, patternsRe);
|
|
6414
|
+
}
|
|
6415
|
+
_isMatchToPatterns(entryPath, patternsRe, isDirectory) {
|
|
6416
|
+
const filepath = utils$3.path.removeLeadingDotSegment(entryPath);
|
|
6417
|
+
// Trying to match files and directories by patterns.
|
|
6418
|
+
const isMatched = utils$3.pattern.matchAny(filepath, patternsRe);
|
|
6419
|
+
// A pattern with a trailling slash can be used for directory matching.
|
|
6420
|
+
// To apply such pattern, we need to add a tralling slash to the path.
|
|
6421
|
+
if (!isMatched && isDirectory) {
|
|
6422
|
+
return utils$3.pattern.matchAny(filepath + '/', patternsRe);
|
|
6423
|
+
}
|
|
6424
|
+
return isMatched;
|
|
6425
|
+
}
|
|
6426
|
+
}
|
|
6386
6427
|
entry$1.default = EntryFilter;
|
|
6387
6428
|
|
|
6388
6429
|
var error = {};
|
|
6389
6430
|
|
|
6390
|
-
Object.defineProperty(error, "__esModule", { value: true });
|
|
6391
|
-
const utils$2 = utils$k;
|
|
6392
|
-
class ErrorFilter {
|
|
6393
|
-
constructor(_settings) {
|
|
6394
|
-
this._settings = _settings;
|
|
6395
|
-
}
|
|
6396
|
-
getFilter() {
|
|
6397
|
-
return (error) => this._isNonFatalError(error);
|
|
6398
|
-
}
|
|
6399
|
-
_isNonFatalError(error) {
|
|
6400
|
-
return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
|
|
6401
|
-
}
|
|
6402
|
-
}
|
|
6431
|
+
Object.defineProperty(error, "__esModule", { value: true });
|
|
6432
|
+
const utils$2 = utils$k;
|
|
6433
|
+
class ErrorFilter {
|
|
6434
|
+
constructor(_settings) {
|
|
6435
|
+
this._settings = _settings;
|
|
6436
|
+
}
|
|
6437
|
+
getFilter() {
|
|
6438
|
+
return (error) => this._isNonFatalError(error);
|
|
6439
|
+
}
|
|
6440
|
+
_isNonFatalError(error) {
|
|
6441
|
+
return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
|
|
6442
|
+
}
|
|
6443
|
+
}
|
|
6403
6444
|
error.default = ErrorFilter;
|
|
6404
6445
|
|
|
6405
6446
|
var entry = {};
|
|
6406
6447
|
|
|
6407
|
-
Object.defineProperty(entry, "__esModule", { value: true });
|
|
6408
|
-
const utils$1 = utils$k;
|
|
6409
|
-
class EntryTransformer {
|
|
6410
|
-
constructor(_settings) {
|
|
6411
|
-
this._settings = _settings;
|
|
6412
|
-
}
|
|
6413
|
-
getTransformer() {
|
|
6414
|
-
return (entry) => this._transform(entry);
|
|
6415
|
-
}
|
|
6416
|
-
_transform(entry) {
|
|
6417
|
-
let filepath = entry.path;
|
|
6418
|
-
if (this._settings.absolute) {
|
|
6419
|
-
filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
|
|
6420
|
-
filepath = utils$1.path.unixify(filepath);
|
|
6421
|
-
}
|
|
6422
|
-
if (this._settings.markDirectories && entry.dirent.isDirectory()) {
|
|
6423
|
-
filepath += '/';
|
|
6424
|
-
}
|
|
6425
|
-
if (!this._settings.objectMode) {
|
|
6426
|
-
return filepath;
|
|
6427
|
-
}
|
|
6428
|
-
return Object.assign(Object.assign({}, entry), { path: filepath });
|
|
6429
|
-
}
|
|
6430
|
-
}
|
|
6448
|
+
Object.defineProperty(entry, "__esModule", { value: true });
|
|
6449
|
+
const utils$1 = utils$k;
|
|
6450
|
+
class EntryTransformer {
|
|
6451
|
+
constructor(_settings) {
|
|
6452
|
+
this._settings = _settings;
|
|
6453
|
+
}
|
|
6454
|
+
getTransformer() {
|
|
6455
|
+
return (entry) => this._transform(entry);
|
|
6456
|
+
}
|
|
6457
|
+
_transform(entry) {
|
|
6458
|
+
let filepath = entry.path;
|
|
6459
|
+
if (this._settings.absolute) {
|
|
6460
|
+
filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
|
|
6461
|
+
filepath = utils$1.path.unixify(filepath);
|
|
6462
|
+
}
|
|
6463
|
+
if (this._settings.markDirectories && entry.dirent.isDirectory()) {
|
|
6464
|
+
filepath += '/';
|
|
6465
|
+
}
|
|
6466
|
+
if (!this._settings.objectMode) {
|
|
6467
|
+
return filepath;
|
|
6468
|
+
}
|
|
6469
|
+
return Object.assign(Object.assign({}, entry), { path: filepath });
|
|
6470
|
+
}
|
|
6471
|
+
}
|
|
6431
6472
|
entry.default = EntryTransformer;
|
|
6432
6473
|
|
|
6433
|
-
Object.defineProperty(provider, "__esModule", { value: true });
|
|
6434
|
-
const path = path$a;
|
|
6435
|
-
const deep_1 = deep;
|
|
6436
|
-
const entry_1 = entry$1;
|
|
6437
|
-
const error_1 = error;
|
|
6438
|
-
const entry_2 = entry;
|
|
6439
|
-
class Provider {
|
|
6440
|
-
constructor(_settings) {
|
|
6441
|
-
this._settings = _settings;
|
|
6442
|
-
this.errorFilter = new error_1.default(this._settings);
|
|
6443
|
-
this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
|
|
6444
|
-
this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
|
|
6445
|
-
this.entryTransformer = new entry_2.default(this._settings);
|
|
6446
|
-
}
|
|
6447
|
-
_getRootDirectory(task) {
|
|
6448
|
-
return path.resolve(this._settings.cwd, task.base);
|
|
6449
|
-
}
|
|
6450
|
-
_getReaderOptions(task) {
|
|
6451
|
-
const basePath = task.base === '.' ? '' : task.base;
|
|
6452
|
-
return {
|
|
6453
|
-
basePath,
|
|
6454
|
-
pathSegmentSeparator: '/',
|
|
6455
|
-
concurrency: this._settings.concurrency,
|
|
6456
|
-
deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
|
|
6457
|
-
entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
|
|
6458
|
-
errorFilter: this.errorFilter.getFilter(),
|
|
6459
|
-
followSymbolicLinks: this._settings.followSymbolicLinks,
|
|
6460
|
-
fs: this._settings.fs,
|
|
6461
|
-
stats: this._settings.stats,
|
|
6462
|
-
throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
|
|
6463
|
-
transform: this.entryTransformer.getTransformer()
|
|
6464
|
-
};
|
|
6465
|
-
}
|
|
6466
|
-
_getMicromatchOptions() {
|
|
6467
|
-
return {
|
|
6468
|
-
dot: this._settings.dot,
|
|
6469
|
-
matchBase: this._settings.baseNameMatch,
|
|
6470
|
-
nobrace: !this._settings.braceExpansion,
|
|
6471
|
-
nocase: !this._settings.caseSensitiveMatch,
|
|
6472
|
-
noext: !this._settings.extglob,
|
|
6473
|
-
noglobstar: !this._settings.globstar,
|
|
6474
|
-
posix: true,
|
|
6475
|
-
strictSlashes: false
|
|
6476
|
-
};
|
|
6477
|
-
}
|
|
6478
|
-
}
|
|
6474
|
+
Object.defineProperty(provider, "__esModule", { value: true });
|
|
6475
|
+
const path = path$a;
|
|
6476
|
+
const deep_1 = deep;
|
|
6477
|
+
const entry_1 = entry$1;
|
|
6478
|
+
const error_1 = error;
|
|
6479
|
+
const entry_2 = entry;
|
|
6480
|
+
class Provider {
|
|
6481
|
+
constructor(_settings) {
|
|
6482
|
+
this._settings = _settings;
|
|
6483
|
+
this.errorFilter = new error_1.default(this._settings);
|
|
6484
|
+
this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
|
|
6485
|
+
this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
|
|
6486
|
+
this.entryTransformer = new entry_2.default(this._settings);
|
|
6487
|
+
}
|
|
6488
|
+
_getRootDirectory(task) {
|
|
6489
|
+
return path.resolve(this._settings.cwd, task.base);
|
|
6490
|
+
}
|
|
6491
|
+
_getReaderOptions(task) {
|
|
6492
|
+
const basePath = task.base === '.' ? '' : task.base;
|
|
6493
|
+
return {
|
|
6494
|
+
basePath,
|
|
6495
|
+
pathSegmentSeparator: '/',
|
|
6496
|
+
concurrency: this._settings.concurrency,
|
|
6497
|
+
deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
|
|
6498
|
+
entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
|
|
6499
|
+
errorFilter: this.errorFilter.getFilter(),
|
|
6500
|
+
followSymbolicLinks: this._settings.followSymbolicLinks,
|
|
6501
|
+
fs: this._settings.fs,
|
|
6502
|
+
stats: this._settings.stats,
|
|
6503
|
+
throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
|
|
6504
|
+
transform: this.entryTransformer.getTransformer()
|
|
6505
|
+
};
|
|
6506
|
+
}
|
|
6507
|
+
_getMicromatchOptions() {
|
|
6508
|
+
return {
|
|
6509
|
+
dot: this._settings.dot,
|
|
6510
|
+
matchBase: this._settings.baseNameMatch,
|
|
6511
|
+
nobrace: !this._settings.braceExpansion,
|
|
6512
|
+
nocase: !this._settings.caseSensitiveMatch,
|
|
6513
|
+
noext: !this._settings.extglob,
|
|
6514
|
+
noglobstar: !this._settings.globstar,
|
|
6515
|
+
posix: true,
|
|
6516
|
+
strictSlashes: false
|
|
6517
|
+
};
|
|
6518
|
+
}
|
|
6519
|
+
}
|
|
6479
6520
|
provider.default = Provider;
|
|
6480
6521
|
|
|
6481
|
-
Object.defineProperty(async$
|
|
6482
|
-
const
|
|
6483
|
-
const provider_1$2 = provider;
|
|
6484
|
-
class ProviderAsync extends provider_1$2.default {
|
|
6485
|
-
constructor() {
|
|
6486
|
-
super(...arguments);
|
|
6487
|
-
this._reader = new
|
|
6488
|
-
}
|
|
6489
|
-
read(task) {
|
|
6490
|
-
const root = this._getRootDirectory(task);
|
|
6491
|
-
const options = this._getReaderOptions(task);
|
|
6492
|
-
const entries =
|
|
6493
|
-
return
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
}
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
}
|
|
6504
|
-
return this._reader.static(task.patterns, options);
|
|
6505
|
-
}
|
|
6506
|
-
}
|
|
6507
|
-
async$6.default = ProviderAsync;
|
|
6522
|
+
Object.defineProperty(async$7, "__esModule", { value: true });
|
|
6523
|
+
const async_1$1 = async$6;
|
|
6524
|
+
const provider_1$2 = provider;
|
|
6525
|
+
class ProviderAsync extends provider_1$2.default {
|
|
6526
|
+
constructor() {
|
|
6527
|
+
super(...arguments);
|
|
6528
|
+
this._reader = new async_1$1.default(this._settings);
|
|
6529
|
+
}
|
|
6530
|
+
async read(task) {
|
|
6531
|
+
const root = this._getRootDirectory(task);
|
|
6532
|
+
const options = this._getReaderOptions(task);
|
|
6533
|
+
const entries = await this.api(root, task, options);
|
|
6534
|
+
return entries.map((entry) => options.transform(entry));
|
|
6535
|
+
}
|
|
6536
|
+
api(root, task, options) {
|
|
6537
|
+
if (task.dynamic) {
|
|
6538
|
+
return this._reader.dynamic(root, options);
|
|
6539
|
+
}
|
|
6540
|
+
return this._reader.static(task.patterns, options);
|
|
6541
|
+
}
|
|
6542
|
+
}
|
|
6543
|
+
async$7.default = ProviderAsync;
|
|
6508
6544
|
|
|
6509
6545
|
var stream = {};
|
|
6510
6546
|
|
|
6511
|
-
Object.defineProperty(stream, "__esModule", { value: true });
|
|
6512
|
-
const stream_1$1 = require$$0$1;
|
|
6513
|
-
const stream_2 = stream$
|
|
6514
|
-
const provider_1$1 = provider;
|
|
6515
|
-
class ProviderStream extends provider_1$1.default {
|
|
6516
|
-
constructor() {
|
|
6517
|
-
super(...arguments);
|
|
6518
|
-
this._reader = new stream_2.default(this._settings);
|
|
6519
|
-
}
|
|
6520
|
-
read(task) {
|
|
6521
|
-
const root = this._getRootDirectory(task);
|
|
6522
|
-
const options = this._getReaderOptions(task);
|
|
6523
|
-
const source = this.api(root, task, options);
|
|
6524
|
-
const destination = new stream_1$1.Readable({ objectMode: true, read: () => { } });
|
|
6525
|
-
source
|
|
6526
|
-
.once('error', (error) => destination.emit('error', error))
|
|
6527
|
-
.on('data', (entry) => destination.emit('data', options.transform(entry)))
|
|
6528
|
-
.once('end', () => destination.emit('end'));
|
|
6529
|
-
destination
|
|
6530
|
-
.once('close', () => source.destroy());
|
|
6531
|
-
return destination;
|
|
6532
|
-
}
|
|
6533
|
-
api(root, task, options) {
|
|
6534
|
-
if (task.dynamic) {
|
|
6535
|
-
return this._reader.dynamic(root, options);
|
|
6536
|
-
}
|
|
6537
|
-
return this._reader.static(task.patterns, options);
|
|
6538
|
-
}
|
|
6539
|
-
}
|
|
6547
|
+
Object.defineProperty(stream, "__esModule", { value: true });
|
|
6548
|
+
const stream_1$1 = require$$0$1;
|
|
6549
|
+
const stream_2 = stream$1;
|
|
6550
|
+
const provider_1$1 = provider;
|
|
6551
|
+
class ProviderStream extends provider_1$1.default {
|
|
6552
|
+
constructor() {
|
|
6553
|
+
super(...arguments);
|
|
6554
|
+
this._reader = new stream_2.default(this._settings);
|
|
6555
|
+
}
|
|
6556
|
+
read(task) {
|
|
6557
|
+
const root = this._getRootDirectory(task);
|
|
6558
|
+
const options = this._getReaderOptions(task);
|
|
6559
|
+
const source = this.api(root, task, options);
|
|
6560
|
+
const destination = new stream_1$1.Readable({ objectMode: true, read: () => { } });
|
|
6561
|
+
source
|
|
6562
|
+
.once('error', (error) => destination.emit('error', error))
|
|
6563
|
+
.on('data', (entry) => destination.emit('data', options.transform(entry)))
|
|
6564
|
+
.once('end', () => destination.emit('end'));
|
|
6565
|
+
destination
|
|
6566
|
+
.once('close', () => source.destroy());
|
|
6567
|
+
return destination;
|
|
6568
|
+
}
|
|
6569
|
+
api(root, task, options) {
|
|
6570
|
+
if (task.dynamic) {
|
|
6571
|
+
return this._reader.dynamic(root, options);
|
|
6572
|
+
}
|
|
6573
|
+
return this._reader.static(task.patterns, options);
|
|
6574
|
+
}
|
|
6575
|
+
}
|
|
6540
6576
|
stream.default = ProviderStream;
|
|
6541
6577
|
|
|
6542
6578
|
var sync$1 = {};
|
|
6543
6579
|
|
|
6544
6580
|
var sync = {};
|
|
6545
6581
|
|
|
6546
|
-
Object.defineProperty(sync, "__esModule", { value: true });
|
|
6547
|
-
const fsStat = out$
|
|
6548
|
-
const fsWalk = out$
|
|
6549
|
-
const reader_1 = reader;
|
|
6550
|
-
class ReaderSync extends reader_1.default {
|
|
6551
|
-
constructor() {
|
|
6552
|
-
super(...arguments);
|
|
6553
|
-
this._walkSync = fsWalk.walkSync;
|
|
6554
|
-
this._statSync = fsStat.statSync;
|
|
6555
|
-
}
|
|
6556
|
-
dynamic(root, options) {
|
|
6557
|
-
return this._walkSync(root, options);
|
|
6558
|
-
}
|
|
6559
|
-
static(patterns, options) {
|
|
6560
|
-
const entries = [];
|
|
6561
|
-
for (const pattern of patterns) {
|
|
6562
|
-
const filepath = this._getFullEntryPath(pattern);
|
|
6563
|
-
const entry = this._getEntry(filepath, pattern, options);
|
|
6564
|
-
if (entry === null || !options.entryFilter(entry)) {
|
|
6565
|
-
continue;
|
|
6566
|
-
}
|
|
6567
|
-
entries.push(entry);
|
|
6568
|
-
}
|
|
6569
|
-
return entries;
|
|
6570
|
-
}
|
|
6571
|
-
_getEntry(filepath, pattern, options) {
|
|
6572
|
-
try {
|
|
6573
|
-
const stats = this._getStat(filepath);
|
|
6574
|
-
return this._makeEntry(stats, pattern);
|
|
6575
|
-
}
|
|
6576
|
-
catch (error) {
|
|
6577
|
-
if (options.errorFilter(error)) {
|
|
6578
|
-
return null;
|
|
6579
|
-
}
|
|
6580
|
-
throw error;
|
|
6581
|
-
}
|
|
6582
|
-
}
|
|
6583
|
-
_getStat(filepath) {
|
|
6584
|
-
return this._statSync(filepath, this._fsStatSettings);
|
|
6585
|
-
}
|
|
6586
|
-
}
|
|
6582
|
+
Object.defineProperty(sync, "__esModule", { value: true });
|
|
6583
|
+
const fsStat = out$1;
|
|
6584
|
+
const fsWalk = out$3;
|
|
6585
|
+
const reader_1 = reader;
|
|
6586
|
+
class ReaderSync extends reader_1.default {
|
|
6587
|
+
constructor() {
|
|
6588
|
+
super(...arguments);
|
|
6589
|
+
this._walkSync = fsWalk.walkSync;
|
|
6590
|
+
this._statSync = fsStat.statSync;
|
|
6591
|
+
}
|
|
6592
|
+
dynamic(root, options) {
|
|
6593
|
+
return this._walkSync(root, options);
|
|
6594
|
+
}
|
|
6595
|
+
static(patterns, options) {
|
|
6596
|
+
const entries = [];
|
|
6597
|
+
for (const pattern of patterns) {
|
|
6598
|
+
const filepath = this._getFullEntryPath(pattern);
|
|
6599
|
+
const entry = this._getEntry(filepath, pattern, options);
|
|
6600
|
+
if (entry === null || !options.entryFilter(entry)) {
|
|
6601
|
+
continue;
|
|
6602
|
+
}
|
|
6603
|
+
entries.push(entry);
|
|
6604
|
+
}
|
|
6605
|
+
return entries;
|
|
6606
|
+
}
|
|
6607
|
+
_getEntry(filepath, pattern, options) {
|
|
6608
|
+
try {
|
|
6609
|
+
const stats = this._getStat(filepath);
|
|
6610
|
+
return this._makeEntry(stats, pattern);
|
|
6611
|
+
}
|
|
6612
|
+
catch (error) {
|
|
6613
|
+
if (options.errorFilter(error)) {
|
|
6614
|
+
return null;
|
|
6615
|
+
}
|
|
6616
|
+
throw error;
|
|
6617
|
+
}
|
|
6618
|
+
}
|
|
6619
|
+
_getStat(filepath) {
|
|
6620
|
+
return this._statSync(filepath, this._fsStatSettings);
|
|
6621
|
+
}
|
|
6622
|
+
}
|
|
6587
6623
|
sync.default = ReaderSync;
|
|
6588
6624
|
|
|
6589
|
-
Object.defineProperty(sync$1, "__esModule", { value: true });
|
|
6590
|
-
const sync_1$1 = sync;
|
|
6591
|
-
const provider_1 = provider;
|
|
6592
|
-
class ProviderSync extends provider_1.default {
|
|
6593
|
-
constructor() {
|
|
6594
|
-
super(...arguments);
|
|
6595
|
-
this._reader = new sync_1$1.default(this._settings);
|
|
6596
|
-
}
|
|
6597
|
-
read(task) {
|
|
6598
|
-
const root = this._getRootDirectory(task);
|
|
6599
|
-
const options = this._getReaderOptions(task);
|
|
6600
|
-
const entries = this.api(root, task, options);
|
|
6601
|
-
return entries.map(options.transform);
|
|
6602
|
-
}
|
|
6603
|
-
api(root, task, options) {
|
|
6604
|
-
if (task.dynamic) {
|
|
6605
|
-
return this._reader.dynamic(root, options);
|
|
6606
|
-
}
|
|
6607
|
-
return this._reader.static(task.patterns, options);
|
|
6608
|
-
}
|
|
6609
|
-
}
|
|
6625
|
+
Object.defineProperty(sync$1, "__esModule", { value: true });
|
|
6626
|
+
const sync_1$1 = sync;
|
|
6627
|
+
const provider_1 = provider;
|
|
6628
|
+
class ProviderSync extends provider_1.default {
|
|
6629
|
+
constructor() {
|
|
6630
|
+
super(...arguments);
|
|
6631
|
+
this._reader = new sync_1$1.default(this._settings);
|
|
6632
|
+
}
|
|
6633
|
+
read(task) {
|
|
6634
|
+
const root = this._getRootDirectory(task);
|
|
6635
|
+
const options = this._getReaderOptions(task);
|
|
6636
|
+
const entries = this.api(root, task, options);
|
|
6637
|
+
return entries.map(options.transform);
|
|
6638
|
+
}
|
|
6639
|
+
api(root, task, options) {
|
|
6640
|
+
if (task.dynamic) {
|
|
6641
|
+
return this._reader.dynamic(root, options);
|
|
6642
|
+
}
|
|
6643
|
+
return this._reader.static(task.patterns, options);
|
|
6644
|
+
}
|
|
6645
|
+
}
|
|
6610
6646
|
sync$1.default = ProviderSync;
|
|
6611
6647
|
|
|
6612
6648
|
var settings = {};
|
|
6613
6649
|
|
|
6614
6650
|
(function (exports) {
|
|
6615
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6616
|
-
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
6617
|
-
const fs = fs$8;
|
|
6618
|
-
const os = require$$0;
|
|
6619
|
-
/**
|
|
6620
|
-
* The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
|
|
6621
|
-
* https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
|
|
6622
|
-
*/
|
|
6623
|
-
const CPU_COUNT = Math.max(os.cpus().length, 1);
|
|
6624
|
-
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
6625
|
-
lstat: fs.lstat,
|
|
6626
|
-
lstatSync: fs.lstatSync,
|
|
6627
|
-
stat: fs.stat,
|
|
6628
|
-
statSync: fs.statSync,
|
|
6629
|
-
readdir: fs.readdir,
|
|
6630
|
-
readdirSync: fs.readdirSync
|
|
6631
|
-
};
|
|
6632
|
-
class Settings {
|
|
6633
|
-
constructor(_options = {}) {
|
|
6634
|
-
this._options = _options;
|
|
6635
|
-
this.absolute = this._getValue(this._options.absolute, false);
|
|
6636
|
-
this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
|
|
6637
|
-
this.braceExpansion = this._getValue(this._options.braceExpansion, true);
|
|
6638
|
-
this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
|
|
6639
|
-
this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
|
|
6640
|
-
this.cwd = this._getValue(this._options.cwd, process.cwd());
|
|
6641
|
-
this.deep = this._getValue(this._options.deep, Infinity);
|
|
6642
|
-
this.dot = this._getValue(this._options.dot, false);
|
|
6643
|
-
this.extglob = this._getValue(this._options.extglob, true);
|
|
6644
|
-
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
|
|
6645
|
-
this.fs = this._getFileSystemMethods(this._options.fs);
|
|
6646
|
-
this.globstar = this._getValue(this._options.globstar, true);
|
|
6647
|
-
this.ignore = this._getValue(this._options.ignore, []);
|
|
6648
|
-
this.markDirectories = this._getValue(this._options.markDirectories, false);
|
|
6649
|
-
this.objectMode = this._getValue(this._options.objectMode, false);
|
|
6650
|
-
this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
|
|
6651
|
-
this.onlyFiles = this._getValue(this._options.onlyFiles, true);
|
|
6652
|
-
this.stats = this._getValue(this._options.stats, false);
|
|
6653
|
-
this.suppressErrors = this._getValue(this._options.suppressErrors, false);
|
|
6654
|
-
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
|
|
6655
|
-
this.unique = this._getValue(this._options.unique, true);
|
|
6656
|
-
if (this.onlyDirectories) {
|
|
6657
|
-
this.onlyFiles = false;
|
|
6658
|
-
}
|
|
6659
|
-
if (this.stats) {
|
|
6660
|
-
this.objectMode = true;
|
|
6661
|
-
}
|
|
6662
|
-
}
|
|
6663
|
-
_getValue(option, value) {
|
|
6664
|
-
return option === undefined ? value : option;
|
|
6665
|
-
}
|
|
6666
|
-
_getFileSystemMethods(methods = {}) {
|
|
6667
|
-
return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
|
|
6668
|
-
}
|
|
6669
|
-
}
|
|
6651
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6652
|
+
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
6653
|
+
const fs = fs$8;
|
|
6654
|
+
const os = require$$0;
|
|
6655
|
+
/**
|
|
6656
|
+
* The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
|
|
6657
|
+
* https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
|
|
6658
|
+
*/
|
|
6659
|
+
const CPU_COUNT = Math.max(os.cpus().length, 1);
|
|
6660
|
+
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
6661
|
+
lstat: fs.lstat,
|
|
6662
|
+
lstatSync: fs.lstatSync,
|
|
6663
|
+
stat: fs.stat,
|
|
6664
|
+
statSync: fs.statSync,
|
|
6665
|
+
readdir: fs.readdir,
|
|
6666
|
+
readdirSync: fs.readdirSync
|
|
6667
|
+
};
|
|
6668
|
+
class Settings {
|
|
6669
|
+
constructor(_options = {}) {
|
|
6670
|
+
this._options = _options;
|
|
6671
|
+
this.absolute = this._getValue(this._options.absolute, false);
|
|
6672
|
+
this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
|
|
6673
|
+
this.braceExpansion = this._getValue(this._options.braceExpansion, true);
|
|
6674
|
+
this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
|
|
6675
|
+
this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
|
|
6676
|
+
this.cwd = this._getValue(this._options.cwd, process.cwd());
|
|
6677
|
+
this.deep = this._getValue(this._options.deep, Infinity);
|
|
6678
|
+
this.dot = this._getValue(this._options.dot, false);
|
|
6679
|
+
this.extglob = this._getValue(this._options.extglob, true);
|
|
6680
|
+
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
|
|
6681
|
+
this.fs = this._getFileSystemMethods(this._options.fs);
|
|
6682
|
+
this.globstar = this._getValue(this._options.globstar, true);
|
|
6683
|
+
this.ignore = this._getValue(this._options.ignore, []);
|
|
6684
|
+
this.markDirectories = this._getValue(this._options.markDirectories, false);
|
|
6685
|
+
this.objectMode = this._getValue(this._options.objectMode, false);
|
|
6686
|
+
this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
|
|
6687
|
+
this.onlyFiles = this._getValue(this._options.onlyFiles, true);
|
|
6688
|
+
this.stats = this._getValue(this._options.stats, false);
|
|
6689
|
+
this.suppressErrors = this._getValue(this._options.suppressErrors, false);
|
|
6690
|
+
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
|
|
6691
|
+
this.unique = this._getValue(this._options.unique, true);
|
|
6692
|
+
if (this.onlyDirectories) {
|
|
6693
|
+
this.onlyFiles = false;
|
|
6694
|
+
}
|
|
6695
|
+
if (this.stats) {
|
|
6696
|
+
this.objectMode = true;
|
|
6697
|
+
}
|
|
6698
|
+
}
|
|
6699
|
+
_getValue(option, value) {
|
|
6700
|
+
return option === undefined ? value : option;
|
|
6701
|
+
}
|
|
6702
|
+
_getFileSystemMethods(methods = {}) {
|
|
6703
|
+
return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
|
|
6704
|
+
}
|
|
6705
|
+
}
|
|
6670
6706
|
exports.default = Settings;
|
|
6671
6707
|
} (settings));
|
|
6672
6708
|
|
|
6673
|
-
const taskManager = tasks;
|
|
6674
|
-
const patternManager = patterns;
|
|
6675
|
-
const async_1 = async$
|
|
6676
|
-
const stream_1 = stream;
|
|
6677
|
-
const sync_1 = sync$1;
|
|
6678
|
-
const settings_1 = settings;
|
|
6679
|
-
const utils = utils$k;
|
|
6680
|
-
async function FastGlob(source, options) {
|
|
6681
|
-
assertPatternsInput(source);
|
|
6682
|
-
const works = getWorks(source, async_1.default, options);
|
|
6683
|
-
const result = await Promise.all(works);
|
|
6684
|
-
return utils.array.flatten(result);
|
|
6685
|
-
}
|
|
6686
|
-
// https://github.com/typescript-eslint/typescript-eslint/issues/60
|
|
6687
|
-
// eslint-disable-next-line no-redeclare
|
|
6688
|
-
(function (FastGlob) {
|
|
6689
|
-
function sync(source, options) {
|
|
6690
|
-
assertPatternsInput(source);
|
|
6691
|
-
const works = getWorks(source, sync_1.default, options);
|
|
6692
|
-
return utils.array.flatten(works);
|
|
6693
|
-
}
|
|
6694
|
-
FastGlob.sync = sync;
|
|
6695
|
-
function stream(source, options) {
|
|
6696
|
-
assertPatternsInput(source);
|
|
6697
|
-
const works = getWorks(source, stream_1.default, options);
|
|
6698
|
-
/**
|
|
6699
|
-
* The stream returned by the provider cannot work with an asynchronous iterator.
|
|
6700
|
-
* To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
|
|
6701
|
-
* This affects performance (+25%). I don't see best solution right now.
|
|
6702
|
-
*/
|
|
6703
|
-
return utils.stream.merge(works);
|
|
6704
|
-
}
|
|
6705
|
-
FastGlob.stream = stream;
|
|
6706
|
-
function generateTasks(source, options) {
|
|
6707
|
-
assertPatternsInput(source);
|
|
6708
|
-
const patterns = patternManager.transform([].concat(source));
|
|
6709
|
-
const settings = new settings_1.default(options);
|
|
6710
|
-
return taskManager.generate(patterns, settings);
|
|
6711
|
-
}
|
|
6712
|
-
FastGlob.generateTasks = generateTasks;
|
|
6713
|
-
function isDynamicPattern(source, options) {
|
|
6714
|
-
assertPatternsInput(source);
|
|
6715
|
-
const settings = new settings_1.default(options);
|
|
6716
|
-
return utils.pattern.isDynamicPattern(source, settings);
|
|
6717
|
-
}
|
|
6718
|
-
FastGlob.isDynamicPattern = isDynamicPattern;
|
|
6719
|
-
function escapePath(source) {
|
|
6720
|
-
assertPatternsInput(source);
|
|
6721
|
-
return utils.path.escape(source);
|
|
6722
|
-
}
|
|
6723
|
-
FastGlob.escapePath = escapePath;
|
|
6724
|
-
})(FastGlob || (FastGlob = {}));
|
|
6725
|
-
function getWorks(source, _Provider, options) {
|
|
6726
|
-
const patterns = patternManager.transform([].concat(source));
|
|
6727
|
-
const settings = new settings_1.default(options);
|
|
6728
|
-
const tasks = taskManager.generate(patterns, settings);
|
|
6729
|
-
const provider = new _Provider(settings);
|
|
6730
|
-
return tasks.map(provider.read, provider);
|
|
6731
|
-
}
|
|
6732
|
-
function assertPatternsInput(input) {
|
|
6733
|
-
const source = [].concat(input);
|
|
6734
|
-
const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
|
|
6735
|
-
if (!isValidSource) {
|
|
6736
|
-
throw new TypeError('Patterns must be a string (non empty) or an array of strings');
|
|
6737
|
-
}
|
|
6738
|
-
}
|
|
6709
|
+
const taskManager = tasks;
|
|
6710
|
+
const patternManager = patterns;
|
|
6711
|
+
const async_1 = async$7;
|
|
6712
|
+
const stream_1 = stream;
|
|
6713
|
+
const sync_1 = sync$1;
|
|
6714
|
+
const settings_1 = settings;
|
|
6715
|
+
const utils = utils$k;
|
|
6716
|
+
async function FastGlob(source, options) {
|
|
6717
|
+
assertPatternsInput(source);
|
|
6718
|
+
const works = getWorks(source, async_1.default, options);
|
|
6719
|
+
const result = await Promise.all(works);
|
|
6720
|
+
return utils.array.flatten(result);
|
|
6721
|
+
}
|
|
6722
|
+
// https://github.com/typescript-eslint/typescript-eslint/issues/60
|
|
6723
|
+
// eslint-disable-next-line no-redeclare
|
|
6724
|
+
(function (FastGlob) {
|
|
6725
|
+
function sync(source, options) {
|
|
6726
|
+
assertPatternsInput(source);
|
|
6727
|
+
const works = getWorks(source, sync_1.default, options);
|
|
6728
|
+
return utils.array.flatten(works);
|
|
6729
|
+
}
|
|
6730
|
+
FastGlob.sync = sync;
|
|
6731
|
+
function stream(source, options) {
|
|
6732
|
+
assertPatternsInput(source);
|
|
6733
|
+
const works = getWorks(source, stream_1.default, options);
|
|
6734
|
+
/**
|
|
6735
|
+
* The stream returned by the provider cannot work with an asynchronous iterator.
|
|
6736
|
+
* To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
|
|
6737
|
+
* This affects performance (+25%). I don't see best solution right now.
|
|
6738
|
+
*/
|
|
6739
|
+
return utils.stream.merge(works);
|
|
6740
|
+
}
|
|
6741
|
+
FastGlob.stream = stream;
|
|
6742
|
+
function generateTasks(source, options) {
|
|
6743
|
+
assertPatternsInput(source);
|
|
6744
|
+
const patterns = patternManager.transform([].concat(source));
|
|
6745
|
+
const settings = new settings_1.default(options);
|
|
6746
|
+
return taskManager.generate(patterns, settings);
|
|
6747
|
+
}
|
|
6748
|
+
FastGlob.generateTasks = generateTasks;
|
|
6749
|
+
function isDynamicPattern(source, options) {
|
|
6750
|
+
assertPatternsInput(source);
|
|
6751
|
+
const settings = new settings_1.default(options);
|
|
6752
|
+
return utils.pattern.isDynamicPattern(source, settings);
|
|
6753
|
+
}
|
|
6754
|
+
FastGlob.isDynamicPattern = isDynamicPattern;
|
|
6755
|
+
function escapePath(source) {
|
|
6756
|
+
assertPatternsInput(source);
|
|
6757
|
+
return utils.path.escape(source);
|
|
6758
|
+
}
|
|
6759
|
+
FastGlob.escapePath = escapePath;
|
|
6760
|
+
})(FastGlob || (FastGlob = {}));
|
|
6761
|
+
function getWorks(source, _Provider, options) {
|
|
6762
|
+
const patterns = patternManager.transform([].concat(source));
|
|
6763
|
+
const settings = new settings_1.default(options);
|
|
6764
|
+
const tasks = taskManager.generate(patterns, settings);
|
|
6765
|
+
const provider = new _Provider(settings);
|
|
6766
|
+
return tasks.map(provider.read, provider);
|
|
6767
|
+
}
|
|
6768
|
+
function assertPatternsInput(input) {
|
|
6769
|
+
const source = [].concat(input);
|
|
6770
|
+
const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
|
|
6771
|
+
if (!isValidSource) {
|
|
6772
|
+
throw new TypeError('Patterns must be a string (non empty) or an array of strings');
|
|
6773
|
+
}
|
|
6774
|
+
}
|
|
6739
6775
|
var out = FastGlob;
|
|
6740
6776
|
|
|
6741
6777
|
const ESM_EXT_RE = /\.(es|esm|esm-browser|esm-bundler|es6|module)\.js$/;
|
|
@@ -6853,7 +6889,7 @@ class ViteNodeServer {
|
|
|
6853
6889
|
}, options.debug ?? {});
|
|
6854
6890
|
}
|
|
6855
6891
|
if (options.debug)
|
|
6856
|
-
import('./chunk-vite-node-debug.
|
|
6892
|
+
import('./chunk-vite-node-debug.536c4c5b.mjs').then((r) => this.debugger = new r.Debugger(server.config.root, options.debug));
|
|
6857
6893
|
}
|
|
6858
6894
|
shouldExternalize(id) {
|
|
6859
6895
|
return shouldExternalize(id, this.options.deps, this.externalizeCache);
|
|
@@ -7345,6 +7381,9 @@ class BaseReporter {
|
|
|
7345
7381
|
this._timeStart = new Date();
|
|
7346
7382
|
this.registerUnhandledRejection();
|
|
7347
7383
|
}
|
|
7384
|
+
get mode() {
|
|
7385
|
+
return this.ctx.config.mode;
|
|
7386
|
+
}
|
|
7348
7387
|
onInit(ctx) {
|
|
7349
7388
|
this.ctx = ctx;
|
|
7350
7389
|
ctx.logger.printBanner();
|
|
@@ -7485,31 +7524,15 @@ ${BADGE}${TRIGGER} ${picocolors.exports.blue(`x${rerun}`)}
|
|
|
7485
7524
|
)));
|
|
7486
7525
|
}
|
|
7487
7526
|
async reportSummary(files) {
|
|
7488
|
-
|
|
7489
|
-
|
|
7527
|
+
await this.printErrorsSummary(files);
|
|
7528
|
+
if (this.mode === "benchmark")
|
|
7529
|
+
await this.reportBenchmarkSummary(files);
|
|
7530
|
+
else
|
|
7531
|
+
await this.reportTestSummary(files);
|
|
7532
|
+
}
|
|
7533
|
+
async reportTestSummary(files) {
|
|
7490
7534
|
const tests = getTests(files);
|
|
7491
|
-
const
|
|
7492
|
-
var _a2;
|
|
7493
|
-
return (_a2 = i.result) == null ? void 0 : _a2.error;
|
|
7494
|
-
});
|
|
7495
|
-
const failedTests = tests.filter((i) => {
|
|
7496
|
-
var _a2;
|
|
7497
|
-
return ((_a2 = i.result) == null ? void 0 : _a2.state) === "fail";
|
|
7498
|
-
});
|
|
7499
|
-
const failedTotal = failedSuites.length + failedTests.length;
|
|
7500
|
-
let current = 1;
|
|
7501
|
-
const errorDivider = () => logger.error(`${picocolors.exports.red(picocolors.exports.dim(divider(`[${current++}/${failedTotal}]`, void 0, 1)))}
|
|
7502
|
-
`);
|
|
7503
|
-
if (failedSuites.length) {
|
|
7504
|
-
logger.error(picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` Failed Suites ${failedSuites.length} `)))));
|
|
7505
|
-
logger.error();
|
|
7506
|
-
await this.printTaskErrors(failedSuites, errorDivider);
|
|
7507
|
-
}
|
|
7508
|
-
if (failedTests.length) {
|
|
7509
|
-
logger.error(picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` Failed Tests ${failedTests.length} `)))));
|
|
7510
|
-
logger.error();
|
|
7511
|
-
await this.printTaskErrors(failedTests, errorDivider);
|
|
7512
|
-
}
|
|
7535
|
+
const logger = this.ctx.logger;
|
|
7513
7536
|
const executionTime = this.end - this.start;
|
|
7514
7537
|
const collectTime = files.reduce((acc, test) => acc + Math.max(0, test.collectDuration || 0), 0);
|
|
7515
7538
|
const setupTime = files.reduce((acc, test) => acc + Math.max(0, test.setupDuration || 0), 0);
|
|
@@ -7542,6 +7565,59 @@ ${BADGE}${TRIGGER} ${picocolors.exports.blue(`x${rerun}`)}
|
|
|
7542
7565
|
logger.log(padTitle("Duration"), time(executionTime) + picocolors.exports.dim(` (transform ${time(transformTime)}, setup ${time(setupTime)}, collect ${time(collectTime)}, tests ${time(testsTime)})`));
|
|
7543
7566
|
logger.log();
|
|
7544
7567
|
}
|
|
7568
|
+
async printErrorsSummary(files) {
|
|
7569
|
+
const logger = this.ctx.logger;
|
|
7570
|
+
const suites = getSuites(files);
|
|
7571
|
+
const tests = getTests(files);
|
|
7572
|
+
const failedSuites = suites.filter((i) => {
|
|
7573
|
+
var _a2;
|
|
7574
|
+
return (_a2 = i.result) == null ? void 0 : _a2.error;
|
|
7575
|
+
});
|
|
7576
|
+
const failedTests = tests.filter((i) => {
|
|
7577
|
+
var _a2;
|
|
7578
|
+
return ((_a2 = i.result) == null ? void 0 : _a2.state) === "fail";
|
|
7579
|
+
});
|
|
7580
|
+
const failedTotal = failedSuites.length + failedTests.length;
|
|
7581
|
+
let current = 1;
|
|
7582
|
+
const errorDivider = () => logger.error(`${picocolors.exports.red(picocolors.exports.dim(divider(`[${current++}/${failedTotal}]`, void 0, 1)))}
|
|
7583
|
+
`);
|
|
7584
|
+
if (failedSuites.length) {
|
|
7585
|
+
logger.error(picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` Failed Suites ${failedSuites.length} `)))));
|
|
7586
|
+
logger.error();
|
|
7587
|
+
await this.printTaskErrors(failedSuites, errorDivider);
|
|
7588
|
+
}
|
|
7589
|
+
if (failedTests.length) {
|
|
7590
|
+
logger.error(picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` Failed Tests ${failedTests.length} `)))));
|
|
7591
|
+
logger.error();
|
|
7592
|
+
await this.printTaskErrors(failedTests, errorDivider);
|
|
7593
|
+
}
|
|
7594
|
+
return tests;
|
|
7595
|
+
}
|
|
7596
|
+
async reportBenchmarkSummary(files) {
|
|
7597
|
+
const logger = this.ctx.logger;
|
|
7598
|
+
const benchs = getTests(files);
|
|
7599
|
+
const topBenchs = benchs.filter((i) => {
|
|
7600
|
+
var _a2, _b;
|
|
7601
|
+
return ((_b = (_a2 = i.result) == null ? void 0 : _a2.benchmark) == null ? void 0 : _b.rank) === 1;
|
|
7602
|
+
});
|
|
7603
|
+
logger.log(`
|
|
7604
|
+
${picocolors.exports.cyan(picocolors.exports.inverse(picocolors.exports.bold(" BENCH ")))} ${picocolors.exports.cyan("Summary")}
|
|
7605
|
+
`);
|
|
7606
|
+
for (const bench of topBenchs) {
|
|
7607
|
+
const group = bench.suite;
|
|
7608
|
+
const groupName = getFullName(group);
|
|
7609
|
+
logger.log(` ${bench.name}${picocolors.exports.dim(` - ${groupName}`)}`);
|
|
7610
|
+
const siblings = group.tasks.filter((i) => {
|
|
7611
|
+
var _a2;
|
|
7612
|
+
return ((_a2 = i.result) == null ? void 0 : _a2.benchmark) && i !== bench;
|
|
7613
|
+
}).sort((a, b) => a.result.benchmark.rank - b.result.benchmark.rank);
|
|
7614
|
+
for (const sibling of siblings) {
|
|
7615
|
+
const number = `${(sibling.result.benchmark.mean / bench.result.benchmark.mean).toFixed(2)}x`;
|
|
7616
|
+
logger.log(` ${picocolors.exports.green(number)} ${picocolors.exports.gray("faster than")} ${sibling.name}`);
|
|
7617
|
+
}
|
|
7618
|
+
logger.log("");
|
|
7619
|
+
}
|
|
7620
|
+
}
|
|
7545
7621
|
async printTaskErrors(tasks, errorDivider) {
|
|
7546
7622
|
var _a2;
|
|
7547
7623
|
const errorsQueue = [];
|
|
@@ -7859,8 +7935,8 @@ class DotReporter extends BaseReporter {
|
|
|
7859
7935
|
}
|
|
7860
7936
|
}
|
|
7861
7937
|
|
|
7862
|
-
const getOutputFile = (
|
|
7863
|
-
if (!config.outputFile)
|
|
7938
|
+
const getOutputFile = (config, reporter) => {
|
|
7939
|
+
if (!(config == null ? void 0 : config.outputFile))
|
|
7864
7940
|
return;
|
|
7865
7941
|
if (typeof config.outputFile === "string")
|
|
7866
7942
|
return config.outputFile;
|
|
@@ -7979,7 +8055,7 @@ class JsonReporter$1 {
|
|
|
7979
8055
|
await this.logTasks(files);
|
|
7980
8056
|
}
|
|
7981
8057
|
async writeReport(report) {
|
|
7982
|
-
const outputFile = getOutputFile(this.ctx, "json");
|
|
8058
|
+
const outputFile = getOutputFile(this.ctx.config, "json");
|
|
7983
8059
|
if (outputFile) {
|
|
7984
8060
|
const reportFile = resolve(this.ctx.config.root, outputFile);
|
|
7985
8061
|
const outputDirectory = dirname(reportFile);
|
|
@@ -8154,7 +8230,7 @@ function getDuration(task) {
|
|
|
8154
8230
|
class JUnitReporter {
|
|
8155
8231
|
async onInit(ctx) {
|
|
8156
8232
|
this.ctx = ctx;
|
|
8157
|
-
const outputFile = getOutputFile(this.ctx, "junit");
|
|
8233
|
+
const outputFile = getOutputFile(this.ctx.config, "junit");
|
|
8158
8234
|
if (outputFile) {
|
|
8159
8235
|
this.reportFile = resolve(this.ctx.config.root, outputFile);
|
|
8160
8236
|
const outputDirectory = dirname(this.reportFile);
|
|
@@ -8309,25 +8385,28 @@ class JsonReporter {
|
|
|
8309
8385
|
this.ctx = ctx;
|
|
8310
8386
|
}
|
|
8311
8387
|
async logTasks(files) {
|
|
8388
|
+
var _a;
|
|
8312
8389
|
const suites = getSuites(files);
|
|
8313
8390
|
const numTotalTestSuites = suites.length;
|
|
8314
8391
|
const tests = getTests(files);
|
|
8315
8392
|
const numTotalTests = tests.length;
|
|
8316
8393
|
const testResults = {};
|
|
8317
|
-
const outputFile = getOutputFile(this.ctx, "json");
|
|
8394
|
+
const outputFile = getOutputFile(this.ctx.config.benchmark, "json");
|
|
8318
8395
|
for (const file of files) {
|
|
8319
8396
|
const tests2 = getTests([file]);
|
|
8320
8397
|
for (const test of tests2) {
|
|
8321
|
-
const res = test.result.benchmark;
|
|
8398
|
+
const res = (_a = test.result) == null ? void 0 : _a.benchmark;
|
|
8399
|
+
if (!res || test.mode === "skip")
|
|
8400
|
+
continue;
|
|
8322
8401
|
if (!outputFile)
|
|
8323
8402
|
res.samples = "ignore on terminal";
|
|
8324
8403
|
testResults[test.suite.name] = (testResults[test.suite.name] || []).concat(res);
|
|
8325
8404
|
}
|
|
8326
8405
|
if (tests2.some((t) => {
|
|
8327
|
-
var
|
|
8328
|
-
return ((
|
|
8406
|
+
var _a2;
|
|
8407
|
+
return ((_a2 = t.result) == null ? void 0 : _a2.state) === "run";
|
|
8329
8408
|
})) {
|
|
8330
|
-
this.ctx.logger.warn("WARNING: Some tests are still running when generating the
|
|
8409
|
+
this.ctx.logger.warn("WARNING: Some tests are still running when generating the json report.This is likely an internal bug in Vitest.Please report it to https://github.com/vitest-dev/vitest/issues");
|
|
8331
8410
|
}
|
|
8332
8411
|
}
|
|
8333
8412
|
const result = {
|
|
@@ -8341,14 +8420,14 @@ class JsonReporter {
|
|
|
8341
8420
|
await this.logTasks(files);
|
|
8342
8421
|
}
|
|
8343
8422
|
async writeReport(report) {
|
|
8344
|
-
const outputFile = getOutputFile(this.ctx, "json");
|
|
8423
|
+
const outputFile = getOutputFile(this.ctx.config.benchmark, "json");
|
|
8345
8424
|
if (outputFile) {
|
|
8346
8425
|
const reportFile = resolve(this.ctx.config.root, outputFile);
|
|
8347
8426
|
const outputDirectory = dirname(reportFile);
|
|
8348
8427
|
if (!existsSync(outputDirectory))
|
|
8349
8428
|
await promises.mkdir(outputDirectory, { recursive: true });
|
|
8350
8429
|
await promises.writeFile(reportFile, report, "utf-8");
|
|
8351
|
-
this.ctx.logger.log(`
|
|
8430
|
+
this.ctx.logger.log(`json report written to ${reportFile}`);
|
|
8352
8431
|
} else {
|
|
8353
8432
|
this.ctx.logger.log(report);
|
|
8354
8433
|
}
|
|
@@ -8855,6 +8934,16 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
8855
8934
|
resolved.include = resolved.benchmark.include;
|
|
8856
8935
|
resolved.exclude = resolved.benchmark.exclude;
|
|
8857
8936
|
resolved.includeSource = resolved.benchmark.includeSource;
|
|
8937
|
+
const reporters = Array.from(/* @__PURE__ */ new Set([
|
|
8938
|
+
...toArray$1(resolved.benchmark.reporters),
|
|
8939
|
+
...toArray$1(options.reporter)
|
|
8940
|
+
])).filter(Boolean);
|
|
8941
|
+
if (reporters.length)
|
|
8942
|
+
resolved.benchmark.reporters = reporters;
|
|
8943
|
+
else
|
|
8944
|
+
resolved.benchmark.reporters = ["default"];
|
|
8945
|
+
if (options.outputFile)
|
|
8946
|
+
resolved.benchmark.outputFile = options.outputFile;
|
|
8858
8947
|
}
|
|
8859
8948
|
resolved.setupFiles = toArray$1(resolved.setupFiles || []).map(
|
|
8860
8949
|
(file) => normalize(
|
|
@@ -8864,10 +8953,12 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
8864
8953
|
resolved.api = resolveApiConfig(options);
|
|
8865
8954
|
if (options.related)
|
|
8866
8955
|
resolved.related = toArray$1(options.related).map((file) => resolve(resolved.root, file));
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8956
|
+
if (mode !== "benchmark") {
|
|
8957
|
+
resolved.reporters = Array.from(/* @__PURE__ */ new Set([
|
|
8958
|
+
...toArray$1(resolved.reporters),
|
|
8959
|
+
...toArray$1(resolved.reporter)
|
|
8960
|
+
])).filter(Boolean);
|
|
8961
|
+
}
|
|
8871
8962
|
if (!resolved.reporters.length)
|
|
8872
8963
|
resolved.reporters.push("default");
|
|
8873
8964
|
if (resolved.changed)
|
|
@@ -9373,7 +9464,7 @@ createLogUpdate(process$1.stdout);
|
|
|
9373
9464
|
|
|
9374
9465
|
createLogUpdate(process$1.stderr);
|
|
9375
9466
|
|
|
9376
|
-
var version = "0.23.
|
|
9467
|
+
var version = "0.23.4";
|
|
9377
9468
|
|
|
9378
9469
|
function fileFromParsedStack(stack) {
|
|
9379
9470
|
var _a, _b;
|
|
@@ -9788,7 +9879,7 @@ class Vitest {
|
|
|
9788
9879
|
}
|
|
9789
9880
|
async filterTestsBySource(tests) {
|
|
9790
9881
|
if (this.config.changed && !this.config.related) {
|
|
9791
|
-
const { VitestGit } = await import('./chunk-node-git.
|
|
9882
|
+
const { VitestGit } = await import('./chunk-node-git.a44b4872.mjs');
|
|
9792
9883
|
const vitestGit = new VitestGit(this.config.root);
|
|
9793
9884
|
const related2 = await vitestGit.findChangedFiles({
|
|
9794
9885
|
changedSince: this.config.changed
|
|
@@ -10459,7 +10550,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
|
|
|
10459
10550
|
try {
|
|
10460
10551
|
await ctx.setServer(options, server);
|
|
10461
10552
|
if (options.api && options.watch)
|
|
10462
|
-
(await import('./chunk-api-setup.
|
|
10553
|
+
(await import('./chunk-api-setup.11cfd513.mjs')).setup(ctx);
|
|
10463
10554
|
} catch (err) {
|
|
10464
10555
|
ctx.logger.printError(err, true);
|
|
10465
10556
|
process.exit(1);
|