@umijs/utils 4.0.0-rc.2 → 4.0.0-rc.22
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/chalk/index.js +1 -1
- package/compiled/color/index.js +1 -1
- package/compiled/debug/index.js +1 -1
- package/compiled/execa/index.js +1 -1
- package/compiled/fs-extra/index.d.ts +347 -116
- package/compiled/fs-extra/index.js +1 -1
- package/compiled/glob/LICENSE +1 -7
- package/compiled/glob/index.d.ts +3 -1
- package/compiled/glob/index.js +1 -1
- package/compiled/pkg-up/index.js +1 -1
- package/compiled/semver/index.js +1 -1
- package/compiled/semver/package.json +1 -1
- package/compiled/yargs-parser/index.js +1 -1
- package/dist/BaseGenerator/BaseGenerator.d.ts +2 -1
- package/dist/BaseGenerator/BaseGenerator.js +23 -32
- package/dist/BaseGenerator/generateFile.d.ts +2 -1
- package/dist/BaseGenerator/generateFile.js +4 -12
- package/dist/Generator/Generator.d.ts +3 -3
- package/dist/Generator/Generator.js +8 -21
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -2
- package/dist/installDeps.js +8 -2
- package/dist/logger.d.ts +3 -0
- package/dist/logger.js +45 -1
- package/dist/npmClient.d.ts +3 -2
- package/dist/npmClient.js +20 -19
- package/dist/register.d.ts +1 -0
- package/dist/register.js +8 -9
- package/package.json +16 -14
- package/compiled/globby/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
- package/compiled/globby/@nodelib/fs.scandir/out/index.d.ts +0 -12
- package/compiled/globby/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
- package/compiled/globby/@nodelib/fs.scandir/out/settings.d.ts +0 -20
- package/compiled/globby/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
- package/compiled/globby/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
- package/compiled/globby/@nodelib/fs.stat/out/index.d.ts +0 -12
- package/compiled/globby/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
- package/compiled/globby/@nodelib/fs.stat/out/settings.d.ts +0 -16
- package/compiled/globby/@nodelib/fs.stat/out/types/index.d.ts +0 -4
- package/compiled/globby/@nodelib/fs.walk/out/index.d.ts +0 -14
- package/compiled/globby/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
- package/compiled/globby/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
- package/compiled/globby/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
- package/compiled/globby/@nodelib/fs.walk/out/settings.d.ts +0 -30
- package/compiled/globby/@nodelib/fs.walk/out/types/index.d.ts +0 -8
- package/compiled/globby/LICENSE +0 -9
- package/compiled/globby/fast-glob/out/index.d.ts +0 -27
- package/compiled/globby/fast-glob/out/managers/tasks.d.ts +0 -22
- package/compiled/globby/fast-glob/out/settings.d.ts +0 -164
- package/compiled/globby/fast-glob/out/types/index.d.ts +0 -31
- package/compiled/globby/index.d.ts +0 -206
- package/compiled/globby/index.js +0 -37
- package/compiled/globby/package.json +0 -1
package/dist/logger.js
CHANGED
|
@@ -3,11 +3,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.debug = exports.event = exports.info = exports.ready = exports.warn = exports.error = exports.wait = exports.prefixes = void 0;
|
|
6
|
+
exports.getLatestLogFilePath = exports.fatal = exports.debug = exports.event = exports.info = exports.ready = exports.warn = exports.error = exports.wait = exports.prefixes = void 0;
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const pino_1 = __importDefault(require("pino"));
|
|
7
9
|
const chalk_1 = __importDefault(require("../compiled/chalk"));
|
|
10
|
+
const fs_extra_1 = __importDefault(require("../compiled/fs-extra"));
|
|
11
|
+
const loggerDir = (0, path_1.join)(process.cwd(), 'node_modules/.cache/logger');
|
|
12
|
+
const loggerPath = (0, path_1.join)(loggerDir, 'umi.log');
|
|
13
|
+
fs_extra_1.default.mkdirpSync(loggerDir);
|
|
14
|
+
const customLevels = {
|
|
15
|
+
ready: 31,
|
|
16
|
+
event: 32,
|
|
17
|
+
wait: 55,
|
|
18
|
+
// 虽然这里设置了 debug 为 30,但日志中还是 20,符合预期
|
|
19
|
+
// 这里不加会不生成到 umi.log,transport 的 level 配置没有生效,原因不明
|
|
20
|
+
debug: 30,
|
|
21
|
+
};
|
|
22
|
+
const logger = (0, pino_1.default)({
|
|
23
|
+
customLevels,
|
|
24
|
+
}, pino_1.default.transport({
|
|
25
|
+
targets: [
|
|
26
|
+
{
|
|
27
|
+
target: require.resolve('pino/file'),
|
|
28
|
+
options: {
|
|
29
|
+
destination: loggerPath,
|
|
30
|
+
},
|
|
31
|
+
level: 'trace',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}));
|
|
8
35
|
exports.prefixes = {
|
|
9
36
|
wait: chalk_1.default.cyan('wait') + ' -',
|
|
10
37
|
error: chalk_1.default.red('error') + ' -',
|
|
38
|
+
fatal: chalk_1.default.red('fatal') + ' -',
|
|
11
39
|
warn: chalk_1.default.yellow('warn') + ' -',
|
|
12
40
|
ready: chalk_1.default.green('ready') + ' -',
|
|
13
41
|
info: chalk_1.default.cyan('info') + ' -',
|
|
@@ -16,31 +44,47 @@ exports.prefixes = {
|
|
|
16
44
|
};
|
|
17
45
|
function wait(...message) {
|
|
18
46
|
console.log(exports.prefixes.wait, ...message);
|
|
47
|
+
logger.wait(message[0]);
|
|
19
48
|
}
|
|
20
49
|
exports.wait = wait;
|
|
21
50
|
function error(...message) {
|
|
22
51
|
console.error(exports.prefixes.error, ...message);
|
|
52
|
+
logger.error(message[0]);
|
|
23
53
|
}
|
|
24
54
|
exports.error = error;
|
|
25
55
|
function warn(...message) {
|
|
26
56
|
console.warn(exports.prefixes.warn, ...message);
|
|
57
|
+
logger.warn(message[0]);
|
|
27
58
|
}
|
|
28
59
|
exports.warn = warn;
|
|
29
60
|
function ready(...message) {
|
|
30
61
|
console.log(exports.prefixes.ready, ...message);
|
|
62
|
+
logger.ready(message[0]);
|
|
31
63
|
}
|
|
32
64
|
exports.ready = ready;
|
|
33
65
|
function info(...message) {
|
|
34
66
|
console.log(exports.prefixes.info, ...message);
|
|
67
|
+
logger.info(message[0]);
|
|
35
68
|
}
|
|
36
69
|
exports.info = info;
|
|
37
70
|
function event(...message) {
|
|
38
71
|
console.log(exports.prefixes.event, ...message);
|
|
72
|
+
logger.event(message[0]);
|
|
39
73
|
}
|
|
40
74
|
exports.event = event;
|
|
41
75
|
function debug(...message) {
|
|
42
76
|
if (process.env.DEBUG) {
|
|
43
77
|
console.log(exports.prefixes.debug, ...message);
|
|
44
78
|
}
|
|
79
|
+
logger.debug(message[0]);
|
|
45
80
|
}
|
|
46
81
|
exports.debug = debug;
|
|
82
|
+
function fatal(...message) {
|
|
83
|
+
console.error(exports.prefixes.fatal, ...message);
|
|
84
|
+
logger.fatal(message[0]);
|
|
85
|
+
}
|
|
86
|
+
exports.fatal = fatal;
|
|
87
|
+
function getLatestLogFilePath() {
|
|
88
|
+
return loggerPath;
|
|
89
|
+
}
|
|
90
|
+
exports.getLatestLogFilePath = getLatestLogFilePath;
|
package/dist/npmClient.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ export declare enum NpmClientEnum {
|
|
|
7
7
|
yarn = "yarn",
|
|
8
8
|
npm = "npm"
|
|
9
9
|
}
|
|
10
|
-
export declare const getNpmClient: (
|
|
11
|
-
|
|
10
|
+
export declare const getNpmClient: (opts: {
|
|
11
|
+
cwd: string;
|
|
12
|
+
}) => NpmClient;
|
|
12
13
|
export declare const installWithNpmClient: ({ npmClient, cwd, }: {
|
|
13
14
|
npmClient: NpmClient;
|
|
14
15
|
cwd?: string | undefined;
|
package/dist/npmClient.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.installWithNpmClient = exports.
|
|
3
|
+
exports.installWithNpmClient = exports.getNpmClient = exports.NpmClientEnum = exports.npmClients = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
4
6
|
exports.npmClients = ['pnpm', 'tnpm', 'cnpm', 'yarn', 'npm'];
|
|
5
7
|
var NpmClientEnum;
|
|
6
8
|
(function (NpmClientEnum) {
|
|
@@ -10,29 +12,28 @@ var NpmClientEnum;
|
|
|
10
12
|
NpmClientEnum["yarn"] = "yarn";
|
|
11
13
|
NpmClientEnum["npm"] = "npm";
|
|
12
14
|
})(NpmClientEnum = exports.NpmClientEnum || (exports.NpmClientEnum = {}));
|
|
13
|
-
const getNpmClient = () => {
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
const getNpmClient = (opts) => {
|
|
16
|
+
const chokidarPkg = require('chokidar/package.json');
|
|
17
|
+
if (chokidarPkg.__npminstall_done) {
|
|
18
|
+
return chokidarPkg._resolved.includes('registry.npm.alibaba-inc.com')
|
|
19
|
+
? 'tnpm'
|
|
20
|
+
: 'cnpm';
|
|
21
|
+
}
|
|
22
|
+
const chokidarPath = require.resolve('chokidar');
|
|
23
|
+
if (chokidarPath.includes('.pnpm') ||
|
|
24
|
+
(0, fs_1.existsSync)((0, path_1.join)(opts.cwd, 'node_modules', '.pnpm'))) {
|
|
25
|
+
return 'pnpm';
|
|
26
|
+
}
|
|
27
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(opts.cwd, 'yarn.lock')) ||
|
|
28
|
+
(0, fs_1.existsSync)((0, path_1.join)(opts.cwd, 'node_modules', '.yarn-integrity'))) {
|
|
29
|
+
return 'yarn';
|
|
24
30
|
}
|
|
25
31
|
return 'npm';
|
|
26
32
|
};
|
|
27
33
|
exports.getNpmClient = getNpmClient;
|
|
28
|
-
const checkNpmClient = (npmClient) => {
|
|
29
|
-
const userAgent = process.env.npm_config_user_agent;
|
|
30
|
-
return !!(userAgent && userAgent.includes(npmClient));
|
|
31
|
-
};
|
|
32
|
-
exports.checkNpmClient = checkNpmClient;
|
|
33
34
|
const installWithNpmClient = ({ npmClient, cwd, }) => {
|
|
34
|
-
const {
|
|
35
|
-
const npm =
|
|
35
|
+
const { sync } = require('../compiled/cross-spawn');
|
|
36
|
+
const npm = sync(npmClient, [npmClient === 'yarn' ? '' : 'install'], {
|
|
36
37
|
stdio: 'inherit',
|
|
37
38
|
cwd,
|
|
38
39
|
});
|
package/dist/register.d.ts
CHANGED
package/dist/register.js
CHANGED
|
@@ -12,20 +12,19 @@ function transform(opts) {
|
|
|
12
12
|
const { code, filename, implementor } = opts;
|
|
13
13
|
files.push(filename);
|
|
14
14
|
const ext = (0, path_1.extname)(filename);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
return code;
|
|
15
|
+
return implementor.transformSync(code, {
|
|
16
|
+
loader: ext.slice(1),
|
|
17
|
+
// consistent with `tsconfig.base.json`
|
|
18
|
+
// https://github.com/umijs/umi-next/pull/729
|
|
19
|
+
target: 'es2019',
|
|
20
|
+
format: 'cjs',
|
|
21
|
+
}).code;
|
|
23
22
|
}
|
|
24
23
|
function register(opts) {
|
|
25
24
|
files = [];
|
|
26
25
|
if (!registered) {
|
|
27
26
|
revert = (0, pirates_1.addHook)((code, filename) => transform({ code, filename, implementor: opts.implementor }), {
|
|
28
|
-
ext: HOOK_EXTS,
|
|
27
|
+
ext: opts.exts || HOOK_EXTS,
|
|
29
28
|
ignoreNodeModules: true,
|
|
30
29
|
});
|
|
31
30
|
registered = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/utils",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.22",
|
|
4
4
|
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/utils#readme",
|
|
5
5
|
"bugs": "https://github.com/umijs/umi-next/issues",
|
|
6
6
|
"repository": {
|
|
@@ -16,45 +16,47 @@
|
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "pnpm tsc",
|
|
19
|
-
"build:deps": "
|
|
20
|
-
"dev": "pnpm build -- --watch"
|
|
19
|
+
"build:deps": "umi-scripts bundleDeps",
|
|
20
|
+
"dev": "pnpm build -- --watch",
|
|
21
|
+
"test": "umi-scripts jest-turbo"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"chokidar": "3.5.3"
|
|
24
|
+
"chokidar": "3.5.3",
|
|
25
|
+
"pino": "7.11.0"
|
|
24
26
|
},
|
|
25
27
|
"devDependencies": {
|
|
26
28
|
"@types/color": "3.0.3",
|
|
27
29
|
"@types/cross-spawn": "6.0.2",
|
|
28
30
|
"@types/debug": "4.1.7",
|
|
29
|
-
"@types/lodash": "4.14.
|
|
31
|
+
"@types/lodash": "4.14.182",
|
|
30
32
|
"@types/mustache": "4.1.2",
|
|
31
33
|
"@types/prompts": "^2.0.14",
|
|
32
34
|
"@types/rimraf": "3.0.2",
|
|
33
35
|
"@types/semver": "7.3.9",
|
|
34
36
|
"address": "1.1.2",
|
|
35
|
-
"axios": "0.
|
|
36
|
-
"chalk": "5.0.
|
|
37
|
+
"axios": "0.27.2",
|
|
38
|
+
"chalk": "5.0.1",
|
|
37
39
|
"cheerio": "1.0.0-rc.10",
|
|
38
|
-
"color": "4.2.
|
|
40
|
+
"color": "4.2.3",
|
|
39
41
|
"cross-spawn": "7.0.3",
|
|
40
|
-
"debug": "4.3.
|
|
42
|
+
"debug": "4.3.4",
|
|
41
43
|
"deepmerge": "4.2.2",
|
|
42
44
|
"execa": "6.1.0",
|
|
43
|
-
"fs-extra": "10.0.
|
|
44
|
-
"glob": "
|
|
45
|
+
"fs-extra": "10.0.1",
|
|
46
|
+
"glob": "8.0.1",
|
|
45
47
|
"import-lazy": "4.0.0",
|
|
46
48
|
"lodash": "4.17.21",
|
|
47
49
|
"mustache": "4.2.0",
|
|
48
50
|
"pirates": "4.0.5",
|
|
49
51
|
"pkg-up": "4.0.0",
|
|
50
52
|
"portfinder": "1.0.28",
|
|
51
|
-
"prettier": "2.
|
|
53
|
+
"prettier": "2.6.2",
|
|
52
54
|
"prompts": "2.4.2",
|
|
53
55
|
"resolve": "1.22.0",
|
|
54
56
|
"rimraf": "3.0.2",
|
|
55
|
-
"semver": "7.3.
|
|
57
|
+
"semver": "7.3.6",
|
|
56
58
|
"strip-ansi": "7.0.1",
|
|
57
|
-
"yargs-parser": "21.0.
|
|
59
|
+
"yargs-parser": "21.0.1"
|
|
58
60
|
},
|
|
59
61
|
"publishConfig": {
|
|
60
62
|
"access": "public"
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type * as fsStat from '../../../@nodelib/fs.stat';
|
|
2
|
-
import type { Dirent, ErrnoException } from '../types';
|
|
3
|
-
export interface ReaddirAsynchronousMethod {
|
|
4
|
-
(filepath: string, options: {
|
|
5
|
-
withFileTypes: true;
|
|
6
|
-
}, callback: (error: ErrnoException | null, files: Dirent[]) => void): void;
|
|
7
|
-
(filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void;
|
|
8
|
-
}
|
|
9
|
-
export interface ReaddirSynchronousMethod {
|
|
10
|
-
(filepath: string, options: {
|
|
11
|
-
withFileTypes: true;
|
|
12
|
-
}): Dirent[];
|
|
13
|
-
(filepath: string): string[];
|
|
14
|
-
}
|
|
15
|
-
export declare type FileSystemAdapter = fsStat.FileSystemAdapter & {
|
|
16
|
-
readdir: ReaddirAsynchronousMethod;
|
|
17
|
-
readdirSync: ReaddirSynchronousMethod;
|
|
18
|
-
};
|
|
19
|
-
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
|
|
20
|
-
export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs';
|
|
2
|
-
import * as async from './providers/async';
|
|
3
|
-
import Settings, { Options } from './settings';
|
|
4
|
-
import type { Dirent, Entry } from './types';
|
|
5
|
-
declare type AsyncCallback = async.AsyncCallback;
|
|
6
|
-
declare function scandir(path: string, callback: AsyncCallback): void;
|
|
7
|
-
declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
|
8
|
-
declare namespace scandir {
|
|
9
|
-
function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Entry[]>;
|
|
10
|
-
}
|
|
11
|
-
declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[];
|
|
12
|
-
export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type Settings from '../settings';
|
|
3
|
-
import type { Entry } from '../types';
|
|
4
|
-
export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void;
|
|
5
|
-
export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void;
|
|
6
|
-
export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void;
|
|
7
|
-
export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as fsStat from '../../@nodelib/fs.stat';
|
|
2
|
-
import * as fs from './adapters/fs';
|
|
3
|
-
export interface Options {
|
|
4
|
-
followSymbolicLinks?: boolean;
|
|
5
|
-
fs?: Partial<fs.FileSystemAdapter>;
|
|
6
|
-
pathSegmentSeparator?: string;
|
|
7
|
-
stats?: boolean;
|
|
8
|
-
throwErrorOnBrokenSymbolicLink?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export default class Settings {
|
|
11
|
-
private readonly _options;
|
|
12
|
-
readonly followSymbolicLinks: boolean;
|
|
13
|
-
readonly fs: fs.FileSystemAdapter;
|
|
14
|
-
readonly pathSegmentSeparator: string;
|
|
15
|
-
readonly stats: boolean;
|
|
16
|
-
readonly throwErrorOnBrokenSymbolicLink: boolean;
|
|
17
|
-
readonly fsStatSettings: fsStat.Settings;
|
|
18
|
-
constructor(_options?: Options);
|
|
19
|
-
private _getValue;
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type * as fs from 'fs';
|
|
3
|
-
export interface Entry {
|
|
4
|
-
dirent: Dirent;
|
|
5
|
-
name: string;
|
|
6
|
-
path: string;
|
|
7
|
-
stats?: Stats;
|
|
8
|
-
}
|
|
9
|
-
export declare type Stats = fs.Stats;
|
|
10
|
-
export declare type ErrnoException = NodeJS.ErrnoException;
|
|
11
|
-
export interface Dirent {
|
|
12
|
-
isBlockDevice: () => boolean;
|
|
13
|
-
isCharacterDevice: () => boolean;
|
|
14
|
-
isDirectory: () => boolean;
|
|
15
|
-
isFIFO: () => boolean;
|
|
16
|
-
isFile: () => boolean;
|
|
17
|
-
isSocket: () => boolean;
|
|
18
|
-
isSymbolicLink: () => boolean;
|
|
19
|
-
name: string;
|
|
20
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
import type { ErrnoException } from '../types';
|
|
4
|
-
export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void;
|
|
5
|
-
export declare type StatSynchronousMethod = (path: string) => fs.Stats;
|
|
6
|
-
export interface FileSystemAdapter {
|
|
7
|
-
lstat: StatAsynchronousMethod;
|
|
8
|
-
stat: StatAsynchronousMethod;
|
|
9
|
-
lstatSync: StatSynchronousMethod;
|
|
10
|
-
statSync: StatSynchronousMethod;
|
|
11
|
-
}
|
|
12
|
-
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
|
|
13
|
-
export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs';
|
|
2
|
-
import * as async from './providers/async';
|
|
3
|
-
import Settings, { Options } from './settings';
|
|
4
|
-
import type { Stats } from './types';
|
|
5
|
-
declare type AsyncCallback = async.AsyncCallback;
|
|
6
|
-
declare function stat(path: string, callback: AsyncCallback): void;
|
|
7
|
-
declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
|
8
|
-
declare namespace stat {
|
|
9
|
-
function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Stats>;
|
|
10
|
-
}
|
|
11
|
-
declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats;
|
|
12
|
-
export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type Settings from '../settings';
|
|
2
|
-
import type { ErrnoException, Stats } from '../types';
|
|
3
|
-
export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void;
|
|
4
|
-
export declare function read(path: string, settings: Settings, callback: AsyncCallback): void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as fs from './adapters/fs';
|
|
2
|
-
export interface Options {
|
|
3
|
-
followSymbolicLink?: boolean;
|
|
4
|
-
fs?: Partial<fs.FileSystemAdapter>;
|
|
5
|
-
markSymbolicLink?: boolean;
|
|
6
|
-
throwErrorOnBrokenSymbolicLink?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export default class Settings {
|
|
9
|
-
private readonly _options;
|
|
10
|
-
readonly followSymbolicLink: boolean;
|
|
11
|
-
readonly fs: fs.FileSystemAdapter;
|
|
12
|
-
readonly markSymbolicLink: boolean;
|
|
13
|
-
readonly throwErrorOnBrokenSymbolicLink: boolean;
|
|
14
|
-
constructor(_options?: Options);
|
|
15
|
-
private _getValue;
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { Readable } from 'stream';
|
|
3
|
-
import type { Dirent, FileSystemAdapter } from '../../@nodelib/fs.scandir';
|
|
4
|
-
import { AsyncCallback } from './providers/async';
|
|
5
|
-
import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings';
|
|
6
|
-
import type { Entry } from './types';
|
|
7
|
-
declare function walk(directory: string, callback: AsyncCallback): void;
|
|
8
|
-
declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
|
9
|
-
declare namespace walk {
|
|
10
|
-
function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise<Entry[]>;
|
|
11
|
-
}
|
|
12
|
-
declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[];
|
|
13
|
-
declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable;
|
|
14
|
-
export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import AsyncReader from '../readers/async';
|
|
2
|
-
import type Settings from '../settings';
|
|
3
|
-
import type { Entry, Errno } from '../types';
|
|
4
|
-
export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void;
|
|
5
|
-
export default class AsyncProvider {
|
|
6
|
-
private readonly _root;
|
|
7
|
-
private readonly _settings;
|
|
8
|
-
protected readonly _reader: AsyncReader;
|
|
9
|
-
private readonly _storage;
|
|
10
|
-
constructor(_root: string, _settings: Settings);
|
|
11
|
-
read(callback: AsyncCallback): void;
|
|
12
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import * as fsScandir from '../../../@nodelib/fs.scandir';
|
|
4
|
-
import type Settings from '../settings';
|
|
5
|
-
import type { Entry, Errno } from '../types';
|
|
6
|
-
import Reader from './reader';
|
|
7
|
-
declare type EntryEventCallback = (entry: Entry) => void;
|
|
8
|
-
declare type ErrorEventCallback = (error: Errno) => void;
|
|
9
|
-
declare type EndEventCallback = () => void;
|
|
10
|
-
export default class AsyncReader extends Reader {
|
|
11
|
-
protected readonly _settings: Settings;
|
|
12
|
-
protected readonly _scandir: typeof fsScandir.scandir;
|
|
13
|
-
protected readonly _emitter: EventEmitter;
|
|
14
|
-
private readonly _queue;
|
|
15
|
-
private _isFatalError;
|
|
16
|
-
private _isDestroyed;
|
|
17
|
-
constructor(_root: string, _settings: Settings);
|
|
18
|
-
read(): EventEmitter;
|
|
19
|
-
get isDestroyed(): boolean;
|
|
20
|
-
destroy(): void;
|
|
21
|
-
onEntry(callback: EntryEventCallback): void;
|
|
22
|
-
onError(callback: ErrorEventCallback): void;
|
|
23
|
-
onEnd(callback: EndEventCallback): void;
|
|
24
|
-
private _pushToQueue;
|
|
25
|
-
private _worker;
|
|
26
|
-
private _handleError;
|
|
27
|
-
private _handleEntry;
|
|
28
|
-
private _emitEntry;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as fsScandir from '../../@nodelib/fs.scandir';
|
|
2
|
-
import type { Entry, Errno } from './types';
|
|
3
|
-
export declare type FilterFunction<T> = (value: T) => boolean;
|
|
4
|
-
export declare type DeepFilterFunction = FilterFunction<Entry>;
|
|
5
|
-
export declare type EntryFilterFunction = FilterFunction<Entry>;
|
|
6
|
-
export declare type ErrorFilterFunction = FilterFunction<Errno>;
|
|
7
|
-
export interface Options {
|
|
8
|
-
basePath?: string;
|
|
9
|
-
concurrency?: number;
|
|
10
|
-
deepFilter?: DeepFilterFunction;
|
|
11
|
-
entryFilter?: EntryFilterFunction;
|
|
12
|
-
errorFilter?: ErrorFilterFunction;
|
|
13
|
-
followSymbolicLinks?: boolean;
|
|
14
|
-
fs?: Partial<fsScandir.FileSystemAdapter>;
|
|
15
|
-
pathSegmentSeparator?: string;
|
|
16
|
-
stats?: boolean;
|
|
17
|
-
throwErrorOnBrokenSymbolicLink?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export default class Settings {
|
|
20
|
-
private readonly _options;
|
|
21
|
-
readonly basePath?: string;
|
|
22
|
-
readonly concurrency: number;
|
|
23
|
-
readonly deepFilter: DeepFilterFunction | null;
|
|
24
|
-
readonly entryFilter: EntryFilterFunction | null;
|
|
25
|
-
readonly errorFilter: ErrorFilterFunction | null;
|
|
26
|
-
readonly pathSegmentSeparator: string;
|
|
27
|
-
readonly fsScandirSettings: fsScandir.Settings;
|
|
28
|
-
constructor(_options?: Options);
|
|
29
|
-
private _getValue;
|
|
30
|
-
}
|
package/compiled/globby/LICENSE
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as taskManager from './managers/tasks';
|
|
3
|
-
import { Options as OptionsInternal } from './settings';
|
|
4
|
-
import { Entry as EntryInternal, FileSystemAdapter as FileSystemAdapterInternal, Pattern as PatternInternal } from './types';
|
|
5
|
-
declare type EntryObjectModePredicate = {
|
|
6
|
-
[TKey in keyof Pick<OptionsInternal, 'objectMode'>]-?: true;
|
|
7
|
-
};
|
|
8
|
-
declare type EntryStatsPredicate = {
|
|
9
|
-
[TKey in keyof Pick<OptionsInternal, 'stats'>]-?: true;
|
|
10
|
-
};
|
|
11
|
-
declare type EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate;
|
|
12
|
-
declare function FastGlob(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): Promise<EntryInternal[]>;
|
|
13
|
-
declare function FastGlob(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Promise<string[]>;
|
|
14
|
-
declare namespace FastGlob {
|
|
15
|
-
type Options = OptionsInternal;
|
|
16
|
-
type Entry = EntryInternal;
|
|
17
|
-
type Task = taskManager.Task;
|
|
18
|
-
type Pattern = PatternInternal;
|
|
19
|
-
type FileSystemAdapter = FileSystemAdapterInternal;
|
|
20
|
-
function sync(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): EntryInternal[];
|
|
21
|
-
function sync(source: PatternInternal | PatternInternal[], options?: OptionsInternal): string[];
|
|
22
|
-
function stream(source: PatternInternal | PatternInternal[], options?: OptionsInternal): NodeJS.ReadableStream;
|
|
23
|
-
function generateTasks(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Task[];
|
|
24
|
-
function isDynamicPattern(source: PatternInternal, options?: OptionsInternal): boolean;
|
|
25
|
-
function escapePath(source: PatternInternal): PatternInternal;
|
|
26
|
-
}
|
|
27
|
-
export = FastGlob;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import Settings from '../settings';
|
|
2
|
-
import { Pattern, PatternsGroup } from '../types';
|
|
3
|
-
export declare type Task = {
|
|
4
|
-
base: string;
|
|
5
|
-
dynamic: boolean;
|
|
6
|
-
patterns: Pattern[];
|
|
7
|
-
positive: Pattern[];
|
|
8
|
-
negative: Pattern[];
|
|
9
|
-
};
|
|
10
|
-
export declare function generate(patterns: Pattern[], settings: Settings): Task[];
|
|
11
|
-
/**
|
|
12
|
-
* Returns tasks grouped by basic pattern directories.
|
|
13
|
-
*
|
|
14
|
-
* Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
|
|
15
|
-
* This is necessary because directory traversal starts at the base directory and goes deeper.
|
|
16
|
-
*/
|
|
17
|
-
export declare function convertPatternsToTasks(positive: Pattern[], negative: Pattern[], dynamic: boolean): Task[];
|
|
18
|
-
export declare function getPositivePatterns(patterns: Pattern[]): Pattern[];
|
|
19
|
-
export declare function getNegativePatternsAsPositive(patterns: Pattern[], ignore: Pattern[]): Pattern[];
|
|
20
|
-
export declare function groupPatternsByBaseDirectory(patterns: Pattern[]): PatternsGroup;
|
|
21
|
-
export declare function convertPatternGroupsToTasks(positive: PatternsGroup, negative: Pattern[], dynamic: boolean): Task[];
|
|
22
|
-
export declare function convertPatternGroupToTask(base: string, positive: Pattern[], negative: Pattern[], dynamic: boolean): Task;
|