@umijs/utils 4.0.0-rc.9 → 4.0.2
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/@hapi/joi/index.d.ts +2218 -0
- package/compiled/@hapi/joi/index.js +1 -0
- package/compiled/@hapi/joi/package.json +1 -0
- package/compiled/color/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/semver/index.js +1 -1
- package/compiled/semver/package.json +1 -1
- package/dist/BaseGenerator/BaseGenerator.js +21 -29
- package/dist/BaseGenerator/generateFile.js +3 -12
- package/dist/Generator/Generator.js +5 -18
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/installDeps.js +3 -1
- package/dist/isLocalDev.d.ts +4 -0
- package/dist/isLocalDev.js +15 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.js +45 -1
- package/dist/npmClient.d.ts +3 -2
- package/dist/npmClient.js +18 -17
- package/dist/register.js +3 -1
- package/package.json +18 -13
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -27,31 +18,32 @@ class BaseGenerator extends Generator_1.default {
|
|
|
27
18
|
prompting() {
|
|
28
19
|
return this.questions;
|
|
29
20
|
}
|
|
30
|
-
writing() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
async writing() {
|
|
22
|
+
const context = {
|
|
23
|
+
...this.data,
|
|
24
|
+
...this.prompts,
|
|
25
|
+
};
|
|
26
|
+
if ((0, fs_1.statSync)(this.path).isDirectory()) {
|
|
27
|
+
this.copyDirectory({
|
|
28
|
+
context,
|
|
29
|
+
path: this.path,
|
|
30
|
+
target: this.target,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
if (this.path.endsWith('.tpl')) {
|
|
35
|
+
this.copyTpl({
|
|
36
|
+
templatePath: this.path,
|
|
37
37
|
target: this.target,
|
|
38
|
+
context,
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
else {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
target: this.target,
|
|
45
|
-
context,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const absTarget = this.target;
|
|
50
|
-
fs_extra_1.default.mkdirpSync((0, path_1.dirname)(absTarget));
|
|
51
|
-
(0, fs_1.copyFileSync)(this.path, absTarget);
|
|
52
|
-
}
|
|
42
|
+
const absTarget = this.target;
|
|
43
|
+
fs_extra_1.default.mkdirpSync((0, path_1.dirname)(absTarget));
|
|
44
|
+
(0, fs_1.copyFileSync)(this.path, absTarget);
|
|
53
45
|
}
|
|
54
|
-
}
|
|
46
|
+
}
|
|
55
47
|
}
|
|
56
48
|
}
|
|
57
49
|
exports.default = BaseGenerator;
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
6
|
const BaseGenerator_1 = __importDefault(require("./BaseGenerator"));
|
|
16
|
-
const generateFile = ({ path, target, baseDir, data, questions, }) =>
|
|
7
|
+
const generateFile = async ({ path, target, baseDir, data, questions, }) => {
|
|
17
8
|
const generator = new BaseGenerator_1.default({
|
|
18
9
|
path,
|
|
19
10
|
target,
|
|
@@ -21,6 +12,6 @@ const generateFile = ({ path, target, baseDir, data, questions, }) => __awaiter(
|
|
|
21
12
|
data,
|
|
22
13
|
questions,
|
|
23
14
|
});
|
|
24
|
-
|
|
25
|
-
}
|
|
15
|
+
await generator.run();
|
|
16
|
+
};
|
|
26
17
|
exports.default = generateFile;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -25,19 +16,15 @@ class Generator {
|
|
|
25
16
|
this.args = args;
|
|
26
17
|
this.prompts = {};
|
|
27
18
|
}
|
|
28
|
-
run() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
yield this.writing();
|
|
33
|
-
});
|
|
19
|
+
async run() {
|
|
20
|
+
const questions = this.prompting();
|
|
21
|
+
this.prompts = await (0, prompts_1.default)(questions);
|
|
22
|
+
await this.writing();
|
|
34
23
|
}
|
|
35
24
|
prompting() {
|
|
36
25
|
return [];
|
|
37
26
|
}
|
|
38
|
-
writing() {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () { });
|
|
40
|
-
}
|
|
27
|
+
async writing() { }
|
|
41
28
|
copyTpl(opts) {
|
|
42
29
|
const tpl = (0, fs_1.readFileSync)(opts.templatePath, 'utf-8');
|
|
43
30
|
const content = mustache_1.default.render(tpl, opts.context);
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import cheerio from '../compiled/cheerio';
|
|
|
6
6
|
import crossSpawn from '../compiled/cross-spawn';
|
|
7
7
|
import debug from '../compiled/debug';
|
|
8
8
|
import deepmerge from '../compiled/deepmerge';
|
|
9
|
+
import * as execa from '../compiled/execa';
|
|
9
10
|
import fsExtra from '../compiled/fs-extra';
|
|
10
11
|
import glob from '../compiled/glob';
|
|
11
12
|
import lodash from '../compiled/lodash';
|
|
@@ -26,10 +27,11 @@ import * as logger from './logger';
|
|
|
26
27
|
import updatePackageJSON from './updatePackageJSON';
|
|
27
28
|
export * from './getCorejsVersion';
|
|
28
29
|
export * from './importLazy';
|
|
30
|
+
export * from './isLocalDev';
|
|
29
31
|
export * from './isStyleFile';
|
|
30
32
|
export * from './npmClient';
|
|
31
33
|
export * from './randomColor/randomColor';
|
|
32
34
|
export * as register from './register';
|
|
33
35
|
export * from './tryPaths';
|
|
34
36
|
export * from './winPath';
|
|
35
|
-
export { address, axios, chalk, cheerio, chokidar, crossSpawn, debug, deepmerge, fsExtra, glob, Generator, BaseGenerator, generateFile, installDeps, lodash, logger, Mustache, pkgUp, portfinder, prompts, resolve, rimraf, semver, stripAnsi, updatePackageJSON, yParser, };
|
|
37
|
+
export { address, axios, chalk, cheerio, chokidar, crossSpawn, debug, deepmerge, execa, fsExtra, glob, Generator, BaseGenerator, generateFile, installDeps, lodash, logger, Mustache, pkgUp, portfinder, prompts, resolve, rimraf, semver, stripAnsi, updatePackageJSON, yParser, };
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.yParser = exports.updatePackageJSON = exports.stripAnsi = exports.semver = exports.rimraf = exports.resolve = exports.prompts = exports.portfinder = exports.pkgUp = exports.Mustache = exports.logger = exports.lodash = exports.installDeps = exports.generateFile = exports.BaseGenerator = exports.Generator = exports.glob = exports.fsExtra = exports.deepmerge = exports.debug = exports.crossSpawn = exports.chokidar = exports.cheerio = exports.chalk = exports.axios = exports.address = exports.register = void 0;
|
|
32
|
+
exports.yParser = exports.updatePackageJSON = exports.stripAnsi = exports.semver = exports.rimraf = exports.resolve = exports.prompts = exports.portfinder = exports.pkgUp = exports.Mustache = exports.logger = exports.lodash = exports.installDeps = exports.generateFile = exports.BaseGenerator = exports.Generator = exports.glob = exports.fsExtra = exports.execa = exports.deepmerge = exports.debug = exports.crossSpawn = exports.chokidar = exports.cheerio = exports.chalk = exports.axios = exports.address = exports.register = void 0;
|
|
33
33
|
const chokidar = __importStar(require("chokidar"));
|
|
34
34
|
exports.chokidar = chokidar;
|
|
35
35
|
const address_1 = __importDefault(require("../compiled/address"));
|
|
@@ -46,6 +46,8 @@ const debug_1 = __importDefault(require("../compiled/debug"));
|
|
|
46
46
|
exports.debug = debug_1.default;
|
|
47
47
|
const deepmerge_1 = __importDefault(require("../compiled/deepmerge"));
|
|
48
48
|
exports.deepmerge = deepmerge_1.default;
|
|
49
|
+
const execa = __importStar(require("../compiled/execa"));
|
|
50
|
+
exports.execa = execa;
|
|
49
51
|
const fs_extra_1 = __importDefault(require("../compiled/fs-extra"));
|
|
50
52
|
exports.fsExtra = fs_extra_1.default;
|
|
51
53
|
const glob_1 = __importDefault(require("../compiled/glob"));
|
|
@@ -85,6 +87,7 @@ const updatePackageJSON_1 = __importDefault(require("./updatePackageJSON"));
|
|
|
85
87
|
exports.updatePackageJSON = updatePackageJSON_1.default;
|
|
86
88
|
__exportStar(require("./getCorejsVersion"), exports);
|
|
87
89
|
__exportStar(require("./importLazy"), exports);
|
|
90
|
+
__exportStar(require("./isLocalDev"), exports);
|
|
88
91
|
__exportStar(require("./isStyleFile"), exports);
|
|
89
92
|
__exportStar(require("./npmClient"), exports);
|
|
90
93
|
__exportStar(require("./randomColor/randomColor"), exports);
|
package/dist/installDeps.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isLocalDev = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const root = (0, path_1.join)(__dirname, '../../../');
|
|
7
|
+
const rootPkg = (0, path_1.join)(root, './package.json');
|
|
8
|
+
/**
|
|
9
|
+
* Check whether it is development in local
|
|
10
|
+
*/
|
|
11
|
+
const isLocalDev = () => {
|
|
12
|
+
const isLocal = (0, fs_1.existsSync)(rootPkg) && require(rootPkg)._local;
|
|
13
|
+
return isLocal ? root : false;
|
|
14
|
+
};
|
|
15
|
+
exports.isLocalDev = isLocalDev;
|
package/dist/logger.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const prefixes: {
|
|
2
2
|
wait: string;
|
|
3
3
|
error: string;
|
|
4
|
+
fatal: string;
|
|
4
5
|
warn: string;
|
|
5
6
|
ready: string;
|
|
6
7
|
info: string;
|
|
@@ -14,3 +15,5 @@ export declare function ready(...message: any[]): void;
|
|
|
14
15
|
export declare function info(...message: any[]): void;
|
|
15
16
|
export declare function event(...message: any[]): void;
|
|
16
17
|
export declare function debug(...message: any[]): void;
|
|
18
|
+
export declare function fatal(...message: any[]): void;
|
|
19
|
+
export declare function getLatestLogFilePath(): string;
|
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,26 +12,25 @@ 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
35
|
const { sync } = require('../compiled/cross-spawn');
|
|
35
36
|
const npm = sync(npmClient, [npmClient === 'yarn' ? '' : 'install'], {
|
package/dist/register.js
CHANGED
|
@@ -14,7 +14,9 @@ function transform(opts) {
|
|
|
14
14
|
const ext = (0, path_1.extname)(filename);
|
|
15
15
|
return implementor.transformSync(code, {
|
|
16
16
|
loader: ext.slice(1),
|
|
17
|
-
|
|
17
|
+
// consistent with `tsconfig.base.json`
|
|
18
|
+
// https://github.com/umijs/umi-next/pull/729
|
|
19
|
+
target: 'es2019',
|
|
18
20
|
format: 'cjs',
|
|
19
21
|
}).code;
|
|
20
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/utils",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
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,44 +16,47 @@
|
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "pnpm tsc",
|
|
19
|
-
"build:deps": "
|
|
20
|
-
"dev": "pnpm build --
|
|
21
|
-
"test": "
|
|
19
|
+
"build:deps": "umi-scripts bundleDeps",
|
|
20
|
+
"dev": "pnpm build --watch",
|
|
21
|
+
"test": "umi-scripts jest-turbo"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"chokidar": "3.5.3"
|
|
24
|
+
"chokidar": "3.5.3",
|
|
25
|
+
"pino": "7.11.0"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
28
|
+
"@hapi/joi": "17.1.1",
|
|
27
29
|
"@types/color": "3.0.3",
|
|
28
30
|
"@types/cross-spawn": "6.0.2",
|
|
29
31
|
"@types/debug": "4.1.7",
|
|
30
|
-
"@types/
|
|
32
|
+
"@types/hapi__joi": "17.1.8",
|
|
33
|
+
"@types/lodash": "4.14.182",
|
|
31
34
|
"@types/mustache": "4.1.2",
|
|
32
35
|
"@types/prompts": "^2.0.14",
|
|
33
36
|
"@types/rimraf": "3.0.2",
|
|
34
37
|
"@types/semver": "7.3.9",
|
|
35
38
|
"address": "1.1.2",
|
|
36
|
-
"axios": "0.
|
|
39
|
+
"axios": "0.27.2",
|
|
37
40
|
"chalk": "5.0.1",
|
|
38
41
|
"cheerio": "1.0.0-rc.10",
|
|
39
|
-
"color": "4.2.
|
|
42
|
+
"color": "4.2.3",
|
|
40
43
|
"cross-spawn": "7.0.3",
|
|
41
44
|
"debug": "4.3.4",
|
|
42
45
|
"deepmerge": "4.2.2",
|
|
43
46
|
"execa": "6.1.0",
|
|
44
47
|
"fs-extra": "10.0.1",
|
|
45
|
-
"glob": "
|
|
48
|
+
"glob": "8.0.1",
|
|
46
49
|
"import-lazy": "4.0.0",
|
|
47
50
|
"lodash": "4.17.21",
|
|
48
51
|
"mustache": "4.2.0",
|
|
49
52
|
"pirates": "4.0.5",
|
|
50
53
|
"pkg-up": "4.0.0",
|
|
51
54
|
"portfinder": "1.0.28",
|
|
52
|
-
"prettier": "2.6.
|
|
55
|
+
"prettier": "2.6.2",
|
|
53
56
|
"prompts": "2.4.2",
|
|
54
57
|
"resolve": "1.22.0",
|
|
55
58
|
"rimraf": "3.0.2",
|
|
56
|
-
"semver": "7.3.
|
|
59
|
+
"semver": "7.3.6",
|
|
57
60
|
"strip-ansi": "7.0.1",
|
|
58
61
|
"yargs-parser": "21.0.1"
|
|
59
62
|
},
|
|
@@ -88,7 +91,8 @@
|
|
|
88
91
|
"semver",
|
|
89
92
|
"strip-ansi",
|
|
90
93
|
"yargs-parser",
|
|
91
|
-
"pirates"
|
|
94
|
+
"pirates",
|
|
95
|
+
"@hapi/joi"
|
|
92
96
|
],
|
|
93
97
|
"externals": {
|
|
94
98
|
"address": "$$LOCAL",
|
|
@@ -109,7 +113,8 @@
|
|
|
109
113
|
"semver": "$$LOCAL",
|
|
110
114
|
"strip-ansi": "$$LOCAL",
|
|
111
115
|
"yargs-parser": "$$LOCAL",
|
|
112
|
-
"pirates": "$$LOCAL"
|
|
116
|
+
"pirates": "$$LOCAL",
|
|
117
|
+
"@hapi/joi": "$$LOCAL"
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
}
|