umi 4.0.0-beta.8 → 4.0.0-canary-20240513.3

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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/bin/forkedDev.js +1 -1
  3. package/bin/umi.js +20 -1
  4. package/client/client/plugin.js +213 -116
  5. package/client/client/utils.js +16 -10
  6. package/dist/cli/cli.d.ts +0 -1
  7. package/dist/cli/cli.js +68 -56
  8. package/dist/cli/dev.js +49 -23
  9. package/dist/cli/fork.js +86 -36
  10. package/dist/cli/forkedDev.d.ts +0 -1
  11. package/dist/cli/forkedDev.js +35 -50
  12. package/dist/constants.d.ts +2 -2
  13. package/dist/constants.js +45 -12
  14. package/dist/defineConfig.d.ts +10 -0
  15. package/dist/defineConfig.js +31 -0
  16. package/dist/defineMock.d.ts +8 -0
  17. package/dist/defineMock.js +31 -0
  18. package/dist/index.d.ts +5 -4
  19. package/dist/index.js +39 -26
  20. package/dist/pluginUtils.d.ts +5 -0
  21. package/dist/pluginUtils.js +48 -0
  22. package/dist/service/cwd.js +35 -11
  23. package/dist/service/requireHook.d.ts +1 -0
  24. package/dist/service/requireHook.js +14 -0
  25. package/dist/service/service.d.ts +0 -1
  26. package/dist/service/service.js +69 -40
  27. package/dist/test-setup.d.ts +1 -0
  28. package/dist/test-setup.js +3 -0
  29. package/dist/test.d.ts +119 -0
  30. package/dist/test.js +82 -0
  31. package/eslint.js +7 -0
  32. package/index.d.ts +10 -3
  33. package/package.json +45 -27
  34. package/plugin-utils.d.ts +1 -0
  35. package/plugin-utils.js +1 -0
  36. package/plugin.js +1 -0
  37. package/prettier.js +13 -0
  38. package/stylelint.js +7 -0
  39. package/test-setup.js +1 -0
  40. package/test.d.ts +1 -0
  41. package/test.js +1 -0
  42. package/dist/cli/cli.d.ts.map +0 -1
  43. package/dist/cli/dev.d.ts.map +0 -1
  44. package/dist/cli/fork.d.ts.map +0 -1
  45. package/dist/cli/forkedDev.d.ts.map +0 -1
  46. package/dist/cli/node.d.ts +0 -4
  47. package/dist/cli/node.d.ts.map +0 -1
  48. package/dist/cli/node.js +0 -32
  49. package/dist/client/plugin.d.ts +0 -34
  50. package/dist/client/plugin.d.ts.map +0 -1
  51. package/dist/client/plugin.js +0 -125
  52. package/dist/client/utils.d.ts +0 -6
  53. package/dist/client/utils.d.ts.map +0 -1
  54. package/dist/client/utils.js +0 -20
  55. package/dist/constants.d.ts.map +0 -1
  56. package/dist/index.d.ts.map +0 -1
  57. package/dist/service/cwd.d.ts.map +0 -1
  58. package/dist/service/service.d.ts.map +0 -1
  59. package/index.esm.js +0 -2
@@ -1,42 +1,71 @@
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
- });
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
10
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Service = void 0;
13
- const core_1 = require("@umijs/core");
14
- const fs_1 = require("fs");
15
- const path_1 = require("path");
16
- const constants_1 = require("../constants");
17
- const cwd_1 = require("./cwd");
18
- class Service extends core_1.Service {
19
- constructor(opts) {
20
- process.env.UMI_DIR = (0, path_1.dirname)(require.resolve('../../package'));
21
- const cwd = (0, cwd_1.getCwd)();
22
- super(Object.assign(Object.assign({}, opts), { env: process.env.NODE_ENV, cwd, defaultConfigFiles: constants_1.DEFAULT_CONFIG_FILES, frameworkName: constants_1.FRAMEWORK_NAME, presets: [require.resolve('@umijs/preset-umi'), ...((opts === null || opts === void 0 ? void 0 : opts.presets) || [])], plugins: [
23
- (0, fs_1.existsSync)((0, path_1.join)(cwd, 'plugin.ts')) && (0, path_1.join)(cwd, 'plugin.ts'),
24
- (0, fs_1.existsSync)((0, path_1.join)(cwd, 'plugin.js')) && (0, path_1.join)(cwd, 'plugin.js'),
25
- ].filter(Boolean) }));
26
- }
27
- run2(opts) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- let name = opts.name;
30
- if ((opts === null || opts === void 0 ? void 0 : opts.args.version) || name === 'v') {
31
- name = 'version';
32
- }
33
- else if ((opts === null || opts === void 0 ? void 0 : opts.args.help) || !name || name === 'h') {
34
- name = 'help';
35
- }
36
- // TODO
37
- // initWebpack
38
- return yield this.run(Object.assign(Object.assign({}, opts), { name }));
39
- });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/service/service.ts
30
+ var service_exports = {};
31
+ __export(service_exports, {
32
+ Service: () => Service
33
+ });
34
+ module.exports = __toCommonJS(service_exports);
35
+ var import_core = require("@umijs/core");
36
+ var import_fs = require("fs");
37
+ var import_path = require("path");
38
+ var import_constants = require("../constants");
39
+ var import_cwd = require("./cwd");
40
+ var Service = class extends import_core.Service {
41
+ constructor(opts) {
42
+ process.env.UMI_DIR = (0, import_path.dirname)(require.resolve("../../package"));
43
+ const cwd = (0, import_cwd.getCwd)();
44
+ require("./requireHook");
45
+ super({
46
+ ...opts,
47
+ env: process.env.NODE_ENV,
48
+ cwd,
49
+ defaultConfigFiles: (opts == null ? void 0 : opts.defaultConfigFiles) || import_constants.DEFAULT_CONFIG_FILES,
50
+ frameworkName: (opts == null ? void 0 : opts.frameworkName) || import_constants.FRAMEWORK_NAME,
51
+ presets: [require.resolve("@umijs/preset-umi"), ...(opts == null ? void 0 : opts.presets) || []],
52
+ plugins: [
53
+ (0, import_fs.existsSync)((0, import_path.join)(cwd, "plugin.ts")) && (0, import_path.join)(cwd, "plugin.ts"),
54
+ (0, import_fs.existsSync)((0, import_path.join)(cwd, "plugin.js")) && (0, import_path.join)(cwd, "plugin.js")
55
+ ].filter(Boolean)
56
+ });
57
+ }
58
+ async run2(opts) {
59
+ let name = opts.name;
60
+ if ((opts == null ? void 0 : opts.args.version) || name === "v") {
61
+ name = "version";
62
+ } else if ((opts == null ? void 0 : opts.args.help) || !name || name === "h") {
63
+ name = "help";
40
64
  }
41
- }
42
- exports.Service = Service;
65
+ return await this.run({ ...opts, name });
66
+ }
67
+ };
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ Service
71
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ // src/test-setup.ts
2
+ var import_plugin = require("@@/core/plugin");
3
+ (0, import_plugin.createPluginManager)();
package/dist/test.d.ts ADDED
@@ -0,0 +1,119 @@
1
+ import { Config } from '@umijs/test';
2
+ export * from '@umijs/test';
3
+ export declare function getAliasPathWithKey(alias: Record<string, string>, key: string): string;
4
+ export declare function getUmiAlias(): Promise<any>;
5
+ export declare function configUmiAlias(config: Config.InitialOptions): Promise<Partial<{
6
+ automock: boolean;
7
+ bail: number | boolean;
8
+ cache: boolean;
9
+ cacheDirectory: string;
10
+ ci: boolean;
11
+ clearMocks: boolean;
12
+ changedFilesWithAncestor: boolean;
13
+ changedSince: string;
14
+ collectCoverage: boolean;
15
+ collectCoverageFrom: string[];
16
+ collectCoverageOnlyFrom: {
17
+ [key: string]: boolean;
18
+ };
19
+ coverageDirectory: string;
20
+ coveragePathIgnorePatterns: string[];
21
+ coverageProvider: "babel" | "v8";
22
+ coverageReporters: Config.CoverageReporters;
23
+ coverageThreshold: {
24
+ [path: string]: Config.CoverageThresholdValue;
25
+ global: Config.CoverageThresholdValue;
26
+ };
27
+ dependencyExtractor: string;
28
+ detectLeaks: boolean;
29
+ detectOpenHandles: boolean;
30
+ displayName: string | Config.DisplayName;
31
+ expand: boolean;
32
+ extensionsToTreatAsEsm: string[];
33
+ extraGlobals: string[];
34
+ filter: string;
35
+ findRelatedTests: boolean;
36
+ forceCoverageMatch: string[];
37
+ forceExit: boolean;
38
+ json: boolean;
39
+ globals: Config.ConfigGlobals;
40
+ globalSetup: string | null | undefined;
41
+ globalTeardown: string | null | undefined;
42
+ haste: Config.HasteConfig;
43
+ injectGlobals: boolean;
44
+ reporters: (string | Config.ReporterConfig)[];
45
+ logHeapUsage: boolean;
46
+ lastCommit: boolean;
47
+ listTests: boolean;
48
+ maxConcurrency: number;
49
+ maxWorkers: string | number;
50
+ moduleDirectories: string[];
51
+ moduleFileExtensions: string[];
52
+ moduleLoader: string;
53
+ moduleNameMapper: {
54
+ [key: string]: string | string[];
55
+ };
56
+ modulePathIgnorePatterns: string[];
57
+ modulePaths: string[];
58
+ name: string;
59
+ noStackTrace: boolean;
60
+ notify: boolean;
61
+ notifyMode: string;
62
+ onlyChanged: boolean;
63
+ onlyFailures: boolean;
64
+ outputFile: string;
65
+ passWithNoTests: boolean;
66
+ preprocessorIgnorePatterns: string[];
67
+ preset: string | null | undefined;
68
+ prettierPath: string | null | undefined;
69
+ projects: (string | Config.InitialProjectOptions)[];
70
+ replname: string | null | undefined;
71
+ resetMocks: boolean;
72
+ resetModules: boolean;
73
+ resolver: string | null | undefined;
74
+ restoreMocks: boolean;
75
+ rootDir: string;
76
+ roots: string[];
77
+ runner: string;
78
+ runTestsByPath: boolean;
79
+ scriptPreprocessor: string;
80
+ setupFiles: string[];
81
+ setupTestFrameworkScriptFile: string;
82
+ setupFilesAfterEnv: string[];
83
+ silent: boolean;
84
+ skipFilter: boolean;
85
+ skipNodeResolution: boolean;
86
+ slowTestThreshold: number;
87
+ snapshotResolver: string;
88
+ snapshotSerializers: string[];
89
+ snapshotFormat: Config.PrettyFormatOptions;
90
+ errorOnDeprecated: boolean;
91
+ testEnvironment: string;
92
+ testEnvironmentOptions: Record<string, unknown>;
93
+ testFailureExitCode: string | number;
94
+ testLocationInResults: boolean;
95
+ testMatch: string[];
96
+ testNamePattern: string;
97
+ testPathDirs: string[];
98
+ testPathIgnorePatterns: string[];
99
+ testRegex: string | string[];
100
+ testResultsProcessor: string;
101
+ testRunner: string;
102
+ testSequencer: string;
103
+ testURL: string;
104
+ testTimeout: number;
105
+ timers: "real" | "fake" | "modern" | "legacy";
106
+ transform: {
107
+ [regex: string]: string | Config.TransformerConfig;
108
+ };
109
+ transformIgnorePatterns: string[];
110
+ watchPathIgnorePatterns: string[];
111
+ unmockedModulePathPatterns: string[];
112
+ updateSnapshot: boolean;
113
+ useStderr: boolean;
114
+ verbose?: boolean | undefined;
115
+ watch: boolean;
116
+ watchAll: boolean;
117
+ watchman: boolean;
118
+ watchPlugins: (string | [string, Record<string, unknown>])[];
119
+ }>>;
package/dist/test.js ADDED
@@ -0,0 +1,82 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/test.ts
21
+ var test_exports = {};
22
+ __export(test_exports, {
23
+ configUmiAlias: () => configUmiAlias,
24
+ getAliasPathWithKey: () => getAliasPathWithKey,
25
+ getUmiAlias: () => getUmiAlias
26
+ });
27
+ module.exports = __toCommonJS(test_exports);
28
+ var import_utils = require("@umijs/utils");
29
+ var import_fs = require("fs");
30
+ var import_service = require("./service/service");
31
+ __reExport(test_exports, require("@umijs/test"), module.exports);
32
+ function getAliasPathWithKey(alias, key) {
33
+ if (alias[key]) {
34
+ return getAliasPathWithKey(alias, alias[key]);
35
+ }
36
+ const aliasKeys = Object.keys(alias);
37
+ const keyStartedWith = aliasKeys.find(
38
+ (k) => !k.endsWith("$") && key.startsWith(`${k}/`)
39
+ );
40
+ if (keyStartedWith) {
41
+ const realPath = alias[keyStartedWith];
42
+ const newKey = realPath + key.slice(keyStartedWith.length);
43
+ return getAliasPathWithKey(alias, newKey);
44
+ } else {
45
+ return key;
46
+ }
47
+ }
48
+ var service;
49
+ async function getUmiAlias() {
50
+ if (!service) {
51
+ service = new import_service.Service();
52
+ await service.run2({
53
+ name: "setup",
54
+ args: { quiet: true }
55
+ });
56
+ }
57
+ return service.config.alias;
58
+ }
59
+ async function configUmiAlias(config) {
60
+ (0, import_utils.setNoDeprecation)();
61
+ config.moduleNameMapper || (config.moduleNameMapper = {});
62
+ const alias = await getUmiAlias();
63
+ for (const key of Object.keys(alias)) {
64
+ const aliasPath = getAliasPathWithKey(alias, key);
65
+ if (key.endsWith("$")) {
66
+ config.moduleNameMapper[`^${key}`] = aliasPath;
67
+ } else if ((0, import_fs.existsSync)(aliasPath) && (0, import_fs.statSync)(aliasPath).isDirectory()) {
68
+ config.moduleNameMapper[`^${key}/(.*)$`] = `${aliasPath}/$1`;
69
+ config.moduleNameMapper[`^${key}$`] = aliasPath;
70
+ } else {
71
+ config.moduleNameMapper[`^${key}$`] = aliasPath;
72
+ }
73
+ }
74
+ return config;
75
+ }
76
+ // Annotate the CommonJS export names for ESM import in node:
77
+ 0 && (module.exports = {
78
+ configUmiAlias,
79
+ getAliasPathWithKey,
80
+ getUmiAlias,
81
+ ...require("@umijs/test")
82
+ });
package/eslint.js ADDED
@@ -0,0 +1,7 @@
1
+ try {
2
+ require.resolve('@umijs/lint/package.json');
3
+ } catch (err) {
4
+ throw new Error('@umijs/lint is not built-in, please install it manually before run umi lint.');
5
+ }
6
+
7
+ module.exports = process.env.LEGACY_ESLINT ? require('@umijs/lint/dist/config/eslint/legacy') : require('@umijs/lint/dist/config/eslint');
package/index.d.ts CHANGED
@@ -1,3 +1,10 @@
1
- export type { IApi } from '@umijs/preset-umi';
2
- export * from '@umijs/renderer-react';
3
- export * from './dist/index';
1
+ // @ts-ignore
2
+ export * from '@@/exports';
3
+ export type {
4
+ IApi,
5
+ webpack,
6
+ IRoute,
7
+ UmiApiRequest,
8
+ UmiApiResponse,
9
+ } from '@umijs/preset-umi';
10
+ export * from './dist';
package/package.json CHANGED
@@ -1,44 +1,62 @@
1
1
  {
2
2
  "name": "umi",
3
- "version": "4.0.0-beta.8",
3
+ "version": "4.0.0-canary-20240513.3",
4
4
  "description": "umi",
5
+ "homepage": "https://github.com/umijs/umi/tree/master/packages/umi#readme",
6
+ "bugs": "https://github.com/umijs/umi/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/umijs/umi"
10
+ },
11
+ "license": "MIT",
5
12
  "main": "dist/index.js",
6
- "module": "index.esm.js",
7
13
  "types": "index.d.ts",
14
+ "bin": {
15
+ "umi": "bin/umi.js"
16
+ },
8
17
  "files": [
18
+ "bin",
19
+ "client",
9
20
  "dist",
21
+ "eslint.js",
10
22
  "index.d.ts",
11
23
  "index.esm.js",
12
- "client",
13
- "bin"
24
+ "plugin-utils.d.ts",
25
+ "plugin-utils.js",
26
+ "plugin.js",
27
+ "prettier.js",
28
+ "stylelint.js",
29
+ "test-setup.js",
30
+ "test.d.ts",
31
+ "test.js"
14
32
  ],
15
- "bin": {
16
- "umi": "bin/umi.js"
33
+ "dependencies": {
34
+ "@babel/runtime": "7.23.6",
35
+ "prettier-plugin-organize-imports": "^3.2.2",
36
+ "prettier-plugin-packagejson": "2.4.3",
37
+ "@umijs/bundler-utils": "4.0.0-canary-20240513.3",
38
+ "@umijs/core": "4.0.0-canary-20240513.3",
39
+ "@umijs/renderer-react": "4.0.0-canary-20240513.3",
40
+ "@umijs/bundler-webpack": "4.0.0-canary-20240513.3",
41
+ "@umijs/preset-umi": "4.0.0-canary-20240513.3",
42
+ "@umijs/server": "4.0.0-canary-20240513.3",
43
+ "@umijs/test": "4.0.0-canary-20240513.3",
44
+ "@umijs/utils": "4.0.0-canary-20240513.3",
45
+ "@umijs/lint": "4.0.0-canary-20240513.3"
17
46
  },
18
- "scripts": {
19
- "build": "pnpm tsc",
20
- "build:client": "pnpm tsc --project ./tsconfig.client.json",
21
- "build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
22
- "dev": "pnpm build -- --watch"
47
+ "engines": {
48
+ "node": ">=14"
23
49
  },
24
- "repository": {
25
- "type": "git",
26
- "url": "https://github.com/umijs/umi-next"
50
+ "publishConfig": {
51
+ "access": "public"
27
52
  },
28
53
  "authors": [
29
54
  "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
30
55
  ],
31
- "license": "MIT",
32
- "bugs": "https://github.com/umijs/umi-next/issues",
33
- "homepage": "https://github.com/umijs/umi-next/tree/master/packages/umi#readme",
34
- "publishConfig": {
35
- "access": "public"
36
- },
37
- "dependencies": {
38
- "@umijs/core": "4.0.0-beta.8",
39
- "@umijs/preset-umi": "4.0.0-beta.8",
40
- "@umijs/renderer-react": "4.0.0-beta.8",
41
- "@umijs/utils": "4.0.0-beta.8",
42
- "v8-compile-cache": "2.3.0"
56
+ "scripts": {
57
+ "build": "umi-scripts father build",
58
+ "build:deps": "umi-scripts bundleDeps",
59
+ "dev": "umi-scripts father dev",
60
+ "test": "umi-scripts jest-turbo"
43
61
  }
44
- }
62
+ }
@@ -0,0 +1 @@
1
+ export * from './dist/pluginUtils';
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/pluginUtils');
package/plugin.js ADDED
@@ -0,0 +1 @@
1
+ export { getPluginManager } from '@@/core/plugin';
package/prettier.js ADDED
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ printWidth: 80,
3
+ singleQuote: true,
4
+ trailingComma: 'all',
5
+ proseWrap: 'never',
6
+ endOfLine: 'lf',
7
+ overrides: [{ files: '.prettierrc', options: { parser: 'json' } }],
8
+ plugins: [
9
+ require.resolve('prettier-plugin-packagejson'),
10
+ require.resolve('prettier-plugin-organize-imports'),
11
+ ],
12
+ pluginSearchDirs: false,
13
+ };
package/stylelint.js ADDED
@@ -0,0 +1,7 @@
1
+ try {
2
+ require.resolve('@umijs/lint/package.json');
3
+ } catch (err) {
4
+ throw new Error('@umijs/lint is not built-in, please install it manually before run umi lint.');
5
+ }
6
+
7
+ module.exports = require('@umijs/lint/dist/config/stylelint');
package/test-setup.js ADDED
@@ -0,0 +1 @@
1
+ require('./dist/test-setup');
package/test.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/test';
package/test.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/test');
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAWA,UAAU,KAAK;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAsB,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,iBAmCrC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AAEA,wBAAgB,GAAG,SAiBlB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fork.d.ts","sourceRoot":"","sources":["../../src/cli/fork.ts"],"names":[],"mappings":";AAIA,UAAU,KAAK;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,wCA0ClD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"forkedDev.d.ts","sourceRoot":"","sources":["../../src/cli/forkedDev.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export declare function checkVersion(): void;
2
- export declare function checkLocal(): void;
3
- export declare function setNodeTitle(name?: string): void;
4
- export declare function setNoDeprecation(): void;
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/cli/node.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,SAQ3B;AAED,wBAAgB,UAAU,SAIzB;AAED,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,QAIzC;AAED,wBAAgB,gBAAgB,SAK/B"}
package/dist/cli/node.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setNoDeprecation = exports.setNodeTitle = exports.checkLocal = exports.checkVersion = void 0;
4
- const utils_1 = require("@umijs/utils");
5
- const constants_1 = require("../constants");
6
- function checkVersion() {
7
- const v = parseInt(process.version.slice(1));
8
- if (v < constants_1.MIN_NODE_VERSION || v === constants_1.EXCLUDE_NODE_VERSION) {
9
- utils_1.logger.error(`Your node version ${v} is not supported, please upgrade to ${constants_1.MIN_NODE_VERSION} or above except ${constants_1.EXCLUDE_NODE_VERSION}.`);
10
- process.exit(1);
11
- }
12
- }
13
- exports.checkVersion = checkVersion;
14
- function checkLocal() {
15
- if (__filename.includes(`packages/${constants_1.FRAMEWORK_NAME}`)) {
16
- utils_1.logger.info('@local');
17
- }
18
- }
19
- exports.checkLocal = checkLocal;
20
- function setNodeTitle(name) {
21
- if (process.title === 'node') {
22
- process.title = name || constants_1.FRAMEWORK_NAME;
23
- }
24
- }
25
- exports.setNodeTitle = setNodeTitle;
26
- function setNoDeprecation() {
27
- // Use magic to suppress node deprecation warnings
28
- // See: https://github.com/nodejs/node/blob/master/lib/internal/process/warning.js#L77
29
- // @ts-ignore
30
- process.noDeprecation = '1';
31
- }
32
- exports.setNoDeprecation = setNoDeprecation;
@@ -1,34 +0,0 @@
1
- export declare enum ApplyPluginsType {
2
- compose = "compose",
3
- modify = "modify",
4
- event = "event"
5
- }
6
- interface IPlugin {
7
- path?: string;
8
- apply: Record<string, any>;
9
- }
10
- export declare class PluginManager {
11
- opts: {
12
- validKeys: string[];
13
- };
14
- hooks: {
15
- [key: string]: any;
16
- };
17
- constructor(opts: {
18
- validKeys: string[];
19
- });
20
- register(plugin: IPlugin): void;
21
- getHooks(keyWithDot: string): any;
22
- applyPlugins({ key, type, initialValue, args, async, }: {
23
- key: string;
24
- type: ApplyPluginsType;
25
- initialValue?: any;
26
- args?: object;
27
- async?: boolean;
28
- }): any;
29
- static create(opts: {
30
- validKeys: string[];
31
- plugins: IPlugin[];
32
- }): PluginManager;
33
- }
34
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/client/plugin.ts"],"names":[],"mappings":"AAEA,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,UAAU,OAAO;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B;AAED,qBAAa,aAAa;IACxB,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC9B,KAAK,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAM;gBACK,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE;IAIzC,QAAQ,CAAC,MAAM,EAAE,OAAO;IAcxB,QAAQ,CAAC,UAAU,EAAE,MAAM;IAqB3B,YAAY,CAAC,EACX,GAAG,EACH,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,KAAK,GACN,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,gBAAgB,CAAC;QACvB,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;IA4ED,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,EAAE,CAAA;KAAE;CAShE"}