@unpackjs/core 1.6.2 → 1.6.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/compiled/css-loader/index.js +20 -20
- package/compiled/less-loader/index.js +8 -8
- package/compiled/postcss-loader/index.js +34 -34
- package/compiled/sass-loader/index.js +10 -8
- package/compiled/sass-loader/package.json +1 -1
- package/compiled/style-loader/index.js +10 -10
- package/dist/bundler-config/chunkSplit.cjs +39 -3
- package/dist/bundler-config/chunkSplit.d.ts.map +1 -1
- package/dist/bundler-config/chunkSplit.js +39 -3
- package/dist/bundler-config/experimentCss.cjs +2 -2
- package/dist/bundler-config/experimentCss.js +1 -1
- package/dist/bundler-config/helper.cjs +2 -2
- package/dist/bundler-config/helper.js +1 -1
- package/dist/bundler-config/index.cjs +8 -4
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +8 -4
- package/dist/constants.cjs +4 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -1
- package/dist/createUnpack.cjs +3 -3
- package/dist/createUnpack.js +4 -4
- package/dist/plugin-progress/rspack.cjs +12 -11
- package/dist/plugin-progress/rspack.js +12 -11
- package/dist/plugin-progress/webpack.cjs +12 -11
- package/dist/plugin-progress/webpack.js +12 -11
- package/dist/progressBar.cjs +5 -5
- package/dist/progressBar.js +4 -4
- package/dist/run/dev.cjs +1 -1
- package/dist/run/dev.js +1 -1
- package/dist/thread-loader/worker.js +1 -1
- package/dist/typed-css-modules/plugin.cjs +2 -2
- package/dist/typed-css-modules/plugin.d.ts.map +1 -1
- package/dist/typed-css-modules/plugin.js +1 -1
- package/dist/types/chunkSplit.d.ts +1 -1
- package/dist/types/chunkSplit.d.ts.map +1 -1
- package/dist/utils.cjs +17 -10
- package/dist/utils.d.ts +2 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +14 -8
- package/package.json +8 -17
- package/compiled/fast-glob/index.d.ts +0 -237
- package/compiled/fast-glob/index.js +0 -5726
- package/compiled/fast-glob/license +0 -21
- package/compiled/fast-glob/package.json +0 -1
- package/compiled/log-update/index.d.ts +0 -1
- package/compiled/log-update/index.js +0 -1970
- package/compiled/log-update/package.json +0 -1
- package/dist/lightningcss/index.cjs +0 -21
- package/dist/lightningcss/index.d.ts +0 -2
- package/dist/lightningcss/index.d.ts.map +0 -1
- package/dist/lightningcss/index.js +0 -10
- package/dist/typed-css-modules/index.cjs +0 -21
- package/dist/typed-css-modules/index.d.ts +0 -2
- package/dist/typed-css-modules/index.d.ts.map +0 -1
- package/dist/typed-css-modules/index.js +0 -10
package/dist/utils.cjs
CHANGED
|
@@ -27,6 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
var utils_exports = {};
|
|
29
29
|
__export(utils_exports, {
|
|
30
|
+
clearLine: () => clearLine,
|
|
30
31
|
debounce: () => debounce,
|
|
31
32
|
getAddressUrls: () => getAddressUrls,
|
|
32
33
|
getCompiledPkgPath: () => getCompiledPkgPath,
|
|
@@ -49,13 +50,13 @@ __export(utils_exports, {
|
|
|
49
50
|
isUndefined: () => isUndefined,
|
|
50
51
|
isWatch: () => isWatch,
|
|
51
52
|
isWin: () => isWin,
|
|
53
|
+
logUpdate: () => logUpdate,
|
|
52
54
|
mergeConfig: () => mergeConfig,
|
|
53
55
|
prettyTime: () => prettyTime,
|
|
54
56
|
setDevServer: () => setDevServer,
|
|
55
57
|
setNodeEnv: () => setNodeEnv,
|
|
56
58
|
setValueByPath: () => setValueByPath,
|
|
57
|
-
trackPerformance: () => trackPerformance
|
|
58
|
-
uniqueId: () => uniqueId
|
|
59
|
+
trackPerformance: () => trackPerformance
|
|
59
60
|
});
|
|
60
61
|
module.exports = __toCommonJS(utils_exports);
|
|
61
62
|
var import_colors = __toESM(require("./colors.cjs"));
|
|
@@ -91,7 +92,7 @@ const prettyTime = (seconds) => {
|
|
|
91
92
|
const factor = 10 ** len;
|
|
92
93
|
return Math.floor(num * factor) / factor;
|
|
93
94
|
};
|
|
94
|
-
if (seconds <
|
|
95
|
+
if (seconds < 1) {
|
|
95
96
|
return `${toFixed(seconds * 1e3, 0)}ms`;
|
|
96
97
|
}
|
|
97
98
|
if (seconds < 60) {
|
|
@@ -147,11 +148,6 @@ const getUserDepPath = (root, deps) => {
|
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
150
|
};
|
|
150
|
-
const uniqueId = (length) => {
|
|
151
|
-
const generateId = () => Date.now().toString(36);
|
|
152
|
-
const ids = Array.from({ length }, generateId);
|
|
153
|
-
return ids.join("").slice(0, length);
|
|
154
|
-
};
|
|
155
151
|
function getTime() {
|
|
156
152
|
const now = /* @__PURE__ */ new Date();
|
|
157
153
|
const hours = String(now.getHours()).padStart(2, "0");
|
|
@@ -261,8 +257,19 @@ const getUserDepVersion = (root, dep) => {
|
|
|
261
257
|
const packageInfo = JSON.parse(import_node_fs.default.readFileSync(import_node_path.default.resolve(depPath, "package.json"), "utf-8"));
|
|
262
258
|
return packageInfo.version;
|
|
263
259
|
};
|
|
260
|
+
const clearLine = () => {
|
|
261
|
+
if (!process.stdout.isTTY)
|
|
262
|
+
return;
|
|
263
|
+
process.stdout.clearLine(0);
|
|
264
|
+
process.stdout.cursorTo(0);
|
|
265
|
+
};
|
|
266
|
+
const logUpdate = (output) => {
|
|
267
|
+
clearLine();
|
|
268
|
+
process.stdout.write(output);
|
|
269
|
+
};
|
|
264
270
|
// Annotate the CommonJS export names for ESM import in node:
|
|
265
271
|
0 && (module.exports = {
|
|
272
|
+
clearLine,
|
|
266
273
|
debounce,
|
|
267
274
|
getAddressUrls,
|
|
268
275
|
getCompiledPkgPath,
|
|
@@ -285,11 +292,11 @@ const getUserDepVersion = (root, dep) => {
|
|
|
285
292
|
isUndefined,
|
|
286
293
|
isWatch,
|
|
287
294
|
isWin,
|
|
295
|
+
logUpdate,
|
|
288
296
|
mergeConfig,
|
|
289
297
|
prettyTime,
|
|
290
298
|
setDevServer,
|
|
291
299
|
setNodeEnv,
|
|
292
300
|
setValueByPath,
|
|
293
|
-
trackPerformance
|
|
294
|
-
uniqueId
|
|
301
|
+
trackPerformance
|
|
295
302
|
});
|
package/dist/utils.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export declare const setValueByPath: (target: any, pathArray: (string | number)[
|
|
|
20
20
|
export declare const getPort: (startPort: number) => Promise<number>;
|
|
21
21
|
export declare const getCompiledPkgPath: (packageName: CompiledPkgName) => string;
|
|
22
22
|
export declare const getUserDepPath: (root: string, deps: string | string[]) => string | undefined;
|
|
23
|
-
export declare const uniqueId: (length: number) => string;
|
|
24
23
|
export declare function getTime(): string;
|
|
25
24
|
export declare const debounce: (fn: any, delay: any) => (...args: any[]) => void;
|
|
26
25
|
type AddressUrl = {
|
|
@@ -40,5 +39,7 @@ export declare const trackPerformance: (msg?: string) => void;
|
|
|
40
39
|
export declare const getPathInJs: (absPath: string) => string;
|
|
41
40
|
export declare const mergeConfig: any;
|
|
42
41
|
export declare const getUserDepVersion: (root: string, dep: string) => any;
|
|
42
|
+
export declare const clearLine: () => void;
|
|
43
|
+
export declare const logUpdate: (output: string) => void;
|
|
43
44
|
export {};
|
|
44
45
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG7D,eAAO,MAAM,UAAU,QAAiC,OAAO,CAAA;AAE/D,eAAO,MAAM,UAAU,QAAS,OAAO,SAEtC,CAAA;AAED,eAAO,MAAM,YAAY,gBAAiB,OAAO,SAEhD,CAAA;AAED,eAAO,MAAM,KAAK,QAAO,OAAyC,CAAA;AAElE,eAAO,M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CAAA;AAED,eAAO,MAAM,cAAc,WAAY,GAAG,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,SAAS,GAAG,SAUrF,CAAA;AAED,eAAO,MAAM,OAAO,cAAe,MAAM,KAAG,OAAO,CAAC,MAAM,CAWzD,CAAA;AAED,eAAO,MAAM,kBAAkB,gBAAiB,eAAe,WACb,CAAA;AAElD,eAAO,MAAM,cAAc,SAAU,MAAM,QAAQ,MAAM,GAAG,MAAM,EAAE,KAAG,MAAM,GAAG,SAQ/E,CAAA;AAED,wBAAgB,OAAO,WAMtB;AAED,eAAO,MAAM,QAAQ,mDAQpB,CAAA;AA6CD,KAAK,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEhD,eAAO,MAAM,cAAc,8BAIxB;IACD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,KAAG,UAAU,EAuCb,CAAA;AAED,eAAO,MAAM,gBAAgB,SAAU,MAAM,SAY5C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAa,MAAM,WAE1C,CAAA;AAED,eAAO,MAAM,WAAW,KAAQ,CAAA;AAEhC,eAAO,MAAM,iBAAiB,SAAU,MAAM,OAAO,MAAM,QAK1D,CAAA;AAED,eAAO,MAAM,SAAS,YAIrB,CAAA;AAED,eAAO,MAAM,SAAS,WAAY,MAAM,SAGvC,CAAA"}
|
package/dist/utils.js
CHANGED
|
@@ -40,7 +40,7 @@ const prettyTime = (seconds) => {
|
|
|
40
40
|
const factor = 10 ** len;
|
|
41
41
|
return Math.floor(num * factor) / factor;
|
|
42
42
|
};
|
|
43
|
-
if (seconds <
|
|
43
|
+
if (seconds < 1) {
|
|
44
44
|
return `${toFixed(seconds * 1e3, 0)}ms`;
|
|
45
45
|
}
|
|
46
46
|
if (seconds < 60) {
|
|
@@ -96,11 +96,6 @@ const getUserDepPath = (root, deps) => {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
const uniqueId = (length) => {
|
|
100
|
-
const generateId = () => Date.now().toString(36);
|
|
101
|
-
const ids = Array.from({ length }, generateId);
|
|
102
|
-
return ids.join("").slice(0, length);
|
|
103
|
-
};
|
|
104
99
|
function getTime() {
|
|
105
100
|
const now = /* @__PURE__ */ new Date();
|
|
106
101
|
const hours = String(now.getHours()).padStart(2, "0");
|
|
@@ -210,7 +205,18 @@ const getUserDepVersion = (root, dep) => {
|
|
|
210
205
|
const packageInfo = JSON.parse(fs.readFileSync(path2.resolve(depPath, "package.json"), "utf-8"));
|
|
211
206
|
return packageInfo.version;
|
|
212
207
|
};
|
|
208
|
+
const clearLine = () => {
|
|
209
|
+
if (!process.stdout.isTTY)
|
|
210
|
+
return;
|
|
211
|
+
process.stdout.clearLine(0);
|
|
212
|
+
process.stdout.cursorTo(0);
|
|
213
|
+
};
|
|
214
|
+
const logUpdate = (output) => {
|
|
215
|
+
clearLine();
|
|
216
|
+
process.stdout.write(output);
|
|
217
|
+
};
|
|
213
218
|
export {
|
|
219
|
+
clearLine,
|
|
214
220
|
debounce,
|
|
215
221
|
getAddressUrls,
|
|
216
222
|
getCompiledPkgPath,
|
|
@@ -233,11 +239,11 @@ export {
|
|
|
233
239
|
isUndefined,
|
|
234
240
|
isWatch,
|
|
235
241
|
isWin,
|
|
242
|
+
logUpdate,
|
|
236
243
|
mergeConfig,
|
|
237
244
|
prettyTime,
|
|
238
245
|
setDevServer,
|
|
239
246
|
setNodeEnv,
|
|
240
247
|
setValueByPath,
|
|
241
|
-
trackPerformance
|
|
242
|
-
uniqueId
|
|
248
|
+
trackPerformance
|
|
243
249
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unpackjs/core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -9,14 +9,6 @@
|
|
|
9
9
|
"import": "./dist/index.js",
|
|
10
10
|
"require": "./dist/index.cjs"
|
|
11
11
|
},
|
|
12
|
-
"./fast-glob": {
|
|
13
|
-
"types": "./compiled/fast-glob/index.d.ts",
|
|
14
|
-
"default": "./compiled/fast-glob/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./log-update": {
|
|
17
|
-
"types": "./compiled/log-update/index.d.ts",
|
|
18
|
-
"default": "./compiled/log-update/index.js"
|
|
19
|
-
},
|
|
20
12
|
"./portfinder": {
|
|
21
13
|
"types": "./compiled/portfinder/index.d.ts",
|
|
22
14
|
"default": "./compiled/portfinder/index.js"
|
|
@@ -84,21 +76,18 @@
|
|
|
84
76
|
"chokidar": "4.0.1",
|
|
85
77
|
"commander": "12.1.0",
|
|
86
78
|
"css-loader": "7.1.2",
|
|
87
|
-
"fast-glob": "3.3.2",
|
|
88
79
|
"less-loader": "12.2.0",
|
|
89
80
|
"line-diff": "2.1.1",
|
|
90
|
-
"log-update": "4.0.0",
|
|
91
81
|
"portfinder": "1.0.32",
|
|
92
82
|
"postcss-loader": "8.1.1",
|
|
93
|
-
"sass-loader": "16.0.
|
|
83
|
+
"sass-loader": "16.0.3",
|
|
94
84
|
"semver": "7.6.3",
|
|
95
85
|
"style-loader": "4.0.0",
|
|
96
86
|
"webpack-bundle-analyzer": "4.10.2",
|
|
97
87
|
"webpack-merge": "6.0.1"
|
|
98
88
|
},
|
|
99
89
|
"dependencies": {
|
|
100
|
-
"
|
|
101
|
-
"@rspack/core": "1.0.14",
|
|
90
|
+
"@rspack/core": "1.1.0",
|
|
102
91
|
"@types/less": "3.0.6",
|
|
103
92
|
"copy-webpack-plugin": "12.0.2",
|
|
104
93
|
"esbuild": "0.24.0",
|
|
@@ -106,14 +95,16 @@
|
|
|
106
95
|
"fork-ts-checker-webpack-plugin": "9.0.2",
|
|
107
96
|
"html-webpack-plugin": "5.6.3",
|
|
108
97
|
"json5": "2.2.3",
|
|
109
|
-
"lightningcss": "1.
|
|
98
|
+
"lightningcss": "1.28.1",
|
|
110
99
|
"loader-runner": "4.3.0",
|
|
111
|
-
"mini-css-extract-plugin": "2.9.
|
|
100
|
+
"mini-css-extract-plugin": "2.9.2",
|
|
112
101
|
"neo-async": "2.6.2",
|
|
113
102
|
"open": "8.4.2",
|
|
103
|
+
"picocolors": "1.1.1",
|
|
114
104
|
"postcss": "8.4.47",
|
|
105
|
+
"tinyglobby": "0.2.10",
|
|
115
106
|
"typed-css-modules": "0.9.1",
|
|
116
|
-
"webpack": "5.
|
|
107
|
+
"webpack": "5.96.1",
|
|
117
108
|
"webpack-dev-server": "5.1.0"
|
|
118
109
|
},
|
|
119
110
|
"scripts": {
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
|
|
4
|
-
declare type ErrnoException$1 = NodeJS.ErrnoException;
|
|
5
|
-
|
|
6
|
-
declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException$1 | null, stats: fs.Stats) => void) => void;
|
|
7
|
-
declare type StatSynchronousMethod = (path: string) => fs.Stats;
|
|
8
|
-
interface FileSystemAdapter$2 {
|
|
9
|
-
lstat: StatAsynchronousMethod;
|
|
10
|
-
stat: StatAsynchronousMethod;
|
|
11
|
-
lstatSync: StatSynchronousMethod;
|
|
12
|
-
statSync: StatSynchronousMethod;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface Entry$2 {
|
|
16
|
-
dirent: Dirent;
|
|
17
|
-
name: string;
|
|
18
|
-
path: string;
|
|
19
|
-
stats?: Stats;
|
|
20
|
-
}
|
|
21
|
-
declare type Stats = fs.Stats;
|
|
22
|
-
declare type ErrnoException = NodeJS.ErrnoException;
|
|
23
|
-
interface Dirent {
|
|
24
|
-
isBlockDevice: () => boolean;
|
|
25
|
-
isCharacterDevice: () => boolean;
|
|
26
|
-
isDirectory: () => boolean;
|
|
27
|
-
isFIFO: () => boolean;
|
|
28
|
-
isFile: () => boolean;
|
|
29
|
-
isSocket: () => boolean;
|
|
30
|
-
isSymbolicLink: () => boolean;
|
|
31
|
-
name: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface ReaddirAsynchronousMethod {
|
|
35
|
-
(filepath: string, options: {
|
|
36
|
-
withFileTypes: true;
|
|
37
|
-
}, callback: (error: ErrnoException | null, files: Dirent[]) => void): void;
|
|
38
|
-
(filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void;
|
|
39
|
-
}
|
|
40
|
-
interface ReaddirSynchronousMethod {
|
|
41
|
-
(filepath: string, options: {
|
|
42
|
-
withFileTypes: true;
|
|
43
|
-
}): Dirent[];
|
|
44
|
-
(filepath: string): string[];
|
|
45
|
-
}
|
|
46
|
-
declare type FileSystemAdapter$1 = FileSystemAdapter$2 & {
|
|
47
|
-
readdir: ReaddirAsynchronousMethod;
|
|
48
|
-
readdirSync: ReaddirSynchronousMethod;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
declare type Entry$1 = Entry$2;
|
|
52
|
-
|
|
53
|
-
type Entry = Entry$1;
|
|
54
|
-
type Pattern = string;
|
|
55
|
-
type FileSystemAdapter = FileSystemAdapter$1;
|
|
56
|
-
|
|
57
|
-
type Options = {
|
|
58
|
-
/**
|
|
59
|
-
* Return the absolute path for entries.
|
|
60
|
-
*
|
|
61
|
-
* @default false
|
|
62
|
-
*/
|
|
63
|
-
absolute?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* If set to `true`, then patterns without slashes will be matched against
|
|
66
|
-
* the basename of the path if it contains slashes.
|
|
67
|
-
*
|
|
68
|
-
* @default false
|
|
69
|
-
*/
|
|
70
|
-
baseNameMatch?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Enables Bash-like brace expansion.
|
|
73
|
-
*
|
|
74
|
-
* @default true
|
|
75
|
-
*/
|
|
76
|
-
braceExpansion?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Enables a case-sensitive mode for matching files.
|
|
79
|
-
*
|
|
80
|
-
* @default true
|
|
81
|
-
*/
|
|
82
|
-
caseSensitiveMatch?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Specifies the maximum number of concurrent requests from a reader to read
|
|
85
|
-
* directories.
|
|
86
|
-
*
|
|
87
|
-
* @default os.cpus().length
|
|
88
|
-
*/
|
|
89
|
-
concurrency?: number;
|
|
90
|
-
/**
|
|
91
|
-
* The current working directory in which to search.
|
|
92
|
-
*
|
|
93
|
-
* @default process.cwd()
|
|
94
|
-
*/
|
|
95
|
-
cwd?: string;
|
|
96
|
-
/**
|
|
97
|
-
* Specifies the maximum depth of a read directory relative to the start
|
|
98
|
-
* directory.
|
|
99
|
-
*
|
|
100
|
-
* @default Infinity
|
|
101
|
-
*/
|
|
102
|
-
deep?: number;
|
|
103
|
-
/**
|
|
104
|
-
* Allow patterns to match entries that begin with a period (`.`).
|
|
105
|
-
*
|
|
106
|
-
* @default false
|
|
107
|
-
*/
|
|
108
|
-
dot?: boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Enables Bash-like `extglob` functionality.
|
|
111
|
-
*
|
|
112
|
-
* @default true
|
|
113
|
-
*/
|
|
114
|
-
extglob?: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Indicates whether to traverse descendants of symbolic link directories.
|
|
117
|
-
*
|
|
118
|
-
* @default true
|
|
119
|
-
*/
|
|
120
|
-
followSymbolicLinks?: boolean;
|
|
121
|
-
/**
|
|
122
|
-
* Custom implementation of methods for working with the file system.
|
|
123
|
-
*
|
|
124
|
-
* @default fs.*
|
|
125
|
-
*/
|
|
126
|
-
fs?: Partial<FileSystemAdapter>;
|
|
127
|
-
/**
|
|
128
|
-
* Enables recursively repeats a pattern containing `**`.
|
|
129
|
-
* If `false`, `**` behaves exactly like `*`.
|
|
130
|
-
*
|
|
131
|
-
* @default true
|
|
132
|
-
*/
|
|
133
|
-
globstar?: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* An array of glob patterns to exclude matches.
|
|
136
|
-
* This is an alternative way to use negative patterns.
|
|
137
|
-
*
|
|
138
|
-
* @default []
|
|
139
|
-
*/
|
|
140
|
-
ignore?: Pattern[];
|
|
141
|
-
/**
|
|
142
|
-
* Mark the directory path with the final slash.
|
|
143
|
-
*
|
|
144
|
-
* @default false
|
|
145
|
-
*/
|
|
146
|
-
markDirectories?: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Returns objects (instead of strings) describing entries.
|
|
149
|
-
*
|
|
150
|
-
* @default false
|
|
151
|
-
*/
|
|
152
|
-
objectMode?: boolean;
|
|
153
|
-
/**
|
|
154
|
-
* Return only directories.
|
|
155
|
-
*
|
|
156
|
-
* @default false
|
|
157
|
-
*/
|
|
158
|
-
onlyDirectories?: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Return only files.
|
|
161
|
-
*
|
|
162
|
-
* @default true
|
|
163
|
-
*/
|
|
164
|
-
onlyFiles?: boolean;
|
|
165
|
-
/**
|
|
166
|
-
* Enables an object mode (`objectMode`) with an additional `stats` field.
|
|
167
|
-
*
|
|
168
|
-
* @default false
|
|
169
|
-
*/
|
|
170
|
-
stats?: boolean;
|
|
171
|
-
/**
|
|
172
|
-
* By default this package suppress only `ENOENT` errors.
|
|
173
|
-
* Set to `true` to suppress any error.
|
|
174
|
-
*
|
|
175
|
-
* @default false
|
|
176
|
-
*/
|
|
177
|
-
suppressErrors?: boolean;
|
|
178
|
-
/**
|
|
179
|
-
* Throw an error when symbolic link is broken if `true` or safely
|
|
180
|
-
* return `lstat` call if `false`.
|
|
181
|
-
*
|
|
182
|
-
* @default false
|
|
183
|
-
*/
|
|
184
|
-
throwErrorOnBrokenSymbolicLink?: boolean;
|
|
185
|
-
/**
|
|
186
|
-
* Ensures that the returned entries are unique.
|
|
187
|
-
*
|
|
188
|
-
* @default true
|
|
189
|
-
*/
|
|
190
|
-
unique?: boolean;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
type Task = {
|
|
194
|
-
base: string;
|
|
195
|
-
dynamic: boolean;
|
|
196
|
-
patterns: Pattern[];
|
|
197
|
-
positive: Pattern[];
|
|
198
|
-
negative: Pattern[];
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
type EntryObjectModePredicate = {
|
|
202
|
-
[TKey in keyof Pick<Options, 'objectMode'>]-?: true;
|
|
203
|
-
};
|
|
204
|
-
type EntryStatsPredicate = {
|
|
205
|
-
[TKey in keyof Pick<Options, 'stats'>]-?: true;
|
|
206
|
-
};
|
|
207
|
-
type EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate;
|
|
208
|
-
declare function FastGlob(source: Pattern | Pattern[], options: Options & EntryObjectPredicate): Promise<Entry[]>;
|
|
209
|
-
declare function FastGlob(source: Pattern | Pattern[], options?: Options): Promise<string[]>;
|
|
210
|
-
declare namespace FastGlob {
|
|
211
|
-
type Options = Options;
|
|
212
|
-
type Entry = Entry;
|
|
213
|
-
type Task = Task;
|
|
214
|
-
type Pattern = Pattern;
|
|
215
|
-
type FileSystemAdapter = FileSystemAdapter;
|
|
216
|
-
const glob: typeof FastGlob;
|
|
217
|
-
const globSync: typeof sync;
|
|
218
|
-
const globStream: typeof stream;
|
|
219
|
-
const async: typeof FastGlob;
|
|
220
|
-
function sync(source: Pattern | Pattern[], options: Options & EntryObjectPredicate): Entry[];
|
|
221
|
-
function sync(source: Pattern | Pattern[], options?: Options): string[];
|
|
222
|
-
function stream(source: Pattern | Pattern[], options?: Options): NodeJS.ReadableStream;
|
|
223
|
-
function generateTasks(source: Pattern | Pattern[], options?: Options): Task[];
|
|
224
|
-
function isDynamicPattern(source: Pattern, options?: Options): boolean;
|
|
225
|
-
function escapePath(source: string): Pattern;
|
|
226
|
-
function convertPathToPattern(source: string): Pattern;
|
|
227
|
-
namespace posix {
|
|
228
|
-
function escapePath(source: string): Pattern;
|
|
229
|
-
function convertPathToPattern(source: string): Pattern;
|
|
230
|
-
}
|
|
231
|
-
namespace win32 {
|
|
232
|
-
function escapePath(source: string): Pattern;
|
|
233
|
-
function convertPathToPattern(source: string): Pattern;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export { FastGlob as default };
|