@modern-js/module-tools 1.5.1 → 1.5.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/CHANGELOG.md +63 -0
- package/dist/js/modern/features/build/logger/logText.js +8 -3
- package/dist/js/modern/features/build/logger/loggerManager.js +7 -2
- package/dist/js/modern/features/build/utils.js +6 -2
- package/dist/js/modern/utils/logger.js +6 -2
- package/dist/js/modern/utils/tspaths-transform/index.js +1 -1
- package/dist/js/node/features/build/logger/logText.js +8 -3
- package/dist/js/node/features/build/logger/loggerManager.js +7 -2
- package/dist/js/node/features/build/utils.js +6 -2
- package/dist/js/node/utils/logger.js +6 -2
- package/dist/js/node/utils/tspaths-transform/index.js +1 -1
- package/package.json +40 -21
- package/.eslintrc.js +0 -10
- package/jest.config.js +0 -7
- package/modern.config.js +0 -6
- package/tsconfig.json +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# @modern-js/module-tools
|
|
2
2
|
|
|
3
|
+
## 1.5.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- da65bf12: chore: merge plugin-fast-refresh into webpack
|
|
8
|
+
- b02a4c35: fix: fix missing peer deps
|
|
9
|
+
- Updated dependencies [f730081c]
|
|
10
|
+
- Updated dependencies [d1ab1f05]
|
|
11
|
+
- Updated dependencies [2ec8181a]
|
|
12
|
+
- Updated dependencies [6451a098]
|
|
13
|
+
- Updated dependencies [b02a4c35]
|
|
14
|
+
- Updated dependencies [7fcfd6cc]
|
|
15
|
+
- Updated dependencies [d5a2cfd8]
|
|
16
|
+
- Updated dependencies [437367c6]
|
|
17
|
+
- @modern-js/core@1.11.1
|
|
18
|
+
- @modern-js/utils@1.7.6
|
|
19
|
+
- @modern-js/babel-preset-module@1.3.6
|
|
20
|
+
- @modern-js/css-config@1.2.6
|
|
21
|
+
- @modern-js/plugin-analyze@1.4.5
|
|
22
|
+
- @modern-js/plugin-changeset@1.2.7
|
|
23
|
+
|
|
24
|
+
## 1.5.3
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- b8cfc42cd: feat: prebundle tsconfig-paths and nanoid
|
|
29
|
+
- Updated dependencies [b8cfc42cd]
|
|
30
|
+
- Updated dependencies [804a5bb8a]
|
|
31
|
+
- Updated dependencies [3680834f2]
|
|
32
|
+
- Updated dependencies [a37960018]
|
|
33
|
+
- @modern-js/utils@1.7.4
|
|
34
|
+
- @modern-js/plugin-analyze@1.4.4
|
|
35
|
+
- @modern-js/core@1.10.3
|
|
36
|
+
- @modern-js/css-config@1.2.6
|
|
37
|
+
- @modern-js/plugin-changeset@1.2.7
|
|
38
|
+
- @modern-js/plugin-fast-refresh@1.2.6
|
|
39
|
+
|
|
40
|
+
## 1.5.2
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
|
|
45
|
+
- Updated dependencies [d5913bd96]
|
|
46
|
+
- Updated dependencies [d32f35134]
|
|
47
|
+
- Updated dependencies [43d9bb5fa]
|
|
48
|
+
- Updated dependencies [d9d398e16]
|
|
49
|
+
- Updated dependencies [6ae4a34ae]
|
|
50
|
+
- Updated dependencies [b80229c79]
|
|
51
|
+
- Updated dependencies [948cc4436]
|
|
52
|
+
- @modern-js/plugin@1.3.4
|
|
53
|
+
- @modern-js/babel-preset-module@1.3.5
|
|
54
|
+
- @modern-js/core@1.10.2
|
|
55
|
+
- @modern-js/css-config@1.2.6
|
|
56
|
+
- @modern-js/i18n-cli-language-detector@1.2.3
|
|
57
|
+
- @modern-js/plugin-analyze@1.4.3
|
|
58
|
+
- @modern-js/plugin-changeset@1.2.7
|
|
59
|
+
- @modern-js/plugin-fast-refresh@1.2.6
|
|
60
|
+
- @modern-js/plugin-i18n@1.2.6
|
|
61
|
+
- @modern-js/new-action@1.3.9
|
|
62
|
+
- @modern-js/babel-compiler@1.2.5
|
|
63
|
+
- @modern-js/style-compiler@1.2.6
|
|
64
|
+
- @modern-js/utils@1.7.3
|
|
65
|
+
|
|
3
66
|
## 1.5.1
|
|
4
67
|
|
|
5
68
|
### Patch Changes
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
1
3
|
import { chalk } from '@modern-js/utils';
|
|
2
4
|
export const colors = {
|
|
3
5
|
title: chalk.rgb(218, 152, 92)
|
|
@@ -27,9 +29,12 @@ ${_contentColor(messageFragments.join(''))}${_noBottomBorder ? '' : `\n${_bottom
|
|
|
27
29
|
// 处理Log内容如何展示
|
|
28
30
|
export class LoggerText {
|
|
29
31
|
constructor(option) {
|
|
30
|
-
this
|
|
31
|
-
|
|
32
|
-
this
|
|
32
|
+
_defineProperty(this, "messages", void 0);
|
|
33
|
+
|
|
34
|
+
_defineProperty(this, "hasErrorMessage", void 0);
|
|
35
|
+
|
|
36
|
+
_defineProperty(this, "option", void 0);
|
|
37
|
+
|
|
33
38
|
this.messages = [];
|
|
34
39
|
this.option = option;
|
|
35
40
|
this.hasErrorMessage = false;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
let _ = t => t,
|
|
2
2
|
_t;
|
|
3
3
|
|
|
4
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* 1. 注册构建任务
|
|
6
8
|
* 2. 监听各个构建任务进程中的信息:process.stdout.on('data' | 'error')
|
|
@@ -13,8 +15,11 @@ const readline = Import.lazy('../../../utils/readline', require);
|
|
|
13
15
|
export class LoggerManager extends EventEmitter {
|
|
14
16
|
constructor() {
|
|
15
17
|
super();
|
|
16
|
-
|
|
17
|
-
this
|
|
18
|
+
|
|
19
|
+
_defineProperty(this, "_compilering", void 0);
|
|
20
|
+
|
|
21
|
+
_defineProperty(this, "_listeners", void 0);
|
|
22
|
+
|
|
18
23
|
this._compilering = false;
|
|
19
24
|
this._listeners = [];
|
|
20
25
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
1
3
|
import * as path from 'path';
|
|
2
4
|
import * as os from 'os';
|
|
3
5
|
import { Import, chalk } from '@modern-js/utils';
|
|
@@ -128,7 +130,8 @@ export const getDtsMapper = (api, config, logger) => {
|
|
|
128
130
|
|
|
129
131
|
export class LogStack {
|
|
130
132
|
constructor() {
|
|
131
|
-
this
|
|
133
|
+
_defineProperty(this, "_codeLogStack", void 0);
|
|
134
|
+
|
|
132
135
|
this._codeLogStack = [];
|
|
133
136
|
}
|
|
134
137
|
|
|
@@ -187,4 +190,5 @@ export class TimeCounter {
|
|
|
187
190
|
}
|
|
188
191
|
|
|
189
192
|
}
|
|
190
|
-
|
|
193
|
+
|
|
194
|
+
_defineProperty(TimeCounter, "_now", void 0);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
1
3
|
import EventEmitter from 'events';
|
|
2
4
|
import { chalk } from '@modern-js/utils';
|
|
3
5
|
export const clearFlag = '\x1Bc';
|
|
@@ -25,8 +27,10 @@ ${_contentColor(messageFragments.join(''))}${_noBottomBorder ? '' : `\n${_bottom
|
|
|
25
27
|
};
|
|
26
28
|
export class LoggerText {
|
|
27
29
|
constructor(option) {
|
|
28
|
-
this
|
|
29
|
-
|
|
30
|
+
_defineProperty(this, "messages", void 0);
|
|
31
|
+
|
|
32
|
+
_defineProperty(this, "option", void 0);
|
|
33
|
+
|
|
30
34
|
this.messages = [];
|
|
31
35
|
this.option = option;
|
|
32
36
|
}
|
|
@@ -3,7 +3,7 @@ import * as parser from '@babel/parser';
|
|
|
3
3
|
import traverse from '@babel/traverse';
|
|
4
4
|
import generator from '@babel/generator';
|
|
5
5
|
import * as t from '@babel/types';
|
|
6
|
-
import { createMatchPath } from 'tsconfig-paths';
|
|
6
|
+
import { createMatchPath } from '@modern-js/utils/tsconfig-paths';
|
|
7
7
|
import { fs } from '@modern-js/utils';
|
|
8
8
|
import { defaultTransformedFunctions } from "./constants";
|
|
9
9
|
import { matchesPattern, isImportCall } from "./utils";
|
|
@@ -7,6 +7,8 @@ exports.logTemplate = exports.colors = exports.clearFlag = exports.LoggerText =
|
|
|
7
7
|
|
|
8
8
|
var _utils = require("@modern-js/utils");
|
|
9
9
|
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
|
|
10
12
|
const colors = {
|
|
11
13
|
title: _utils.chalk.rgb(218, 152, 92)
|
|
12
14
|
};
|
|
@@ -41,9 +43,12 @@ exports.logTemplate = logTemplate;
|
|
|
41
43
|
// 处理Log内容如何展示
|
|
42
44
|
class LoggerText {
|
|
43
45
|
constructor(option) {
|
|
44
|
-
this
|
|
45
|
-
|
|
46
|
-
this
|
|
46
|
+
_defineProperty(this, "messages", void 0);
|
|
47
|
+
|
|
48
|
+
_defineProperty(this, "hasErrorMessage", void 0);
|
|
49
|
+
|
|
50
|
+
_defineProperty(this, "option", void 0);
|
|
51
|
+
|
|
47
52
|
this.messages = [];
|
|
48
53
|
this.option = option;
|
|
49
54
|
this.hasErrorMessage = false;
|
|
@@ -14,6 +14,8 @@ let _ = t => t,
|
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
|
|
17
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
|
|
17
19
|
const logText = _utils.Import.lazy('./logText', require);
|
|
18
20
|
|
|
19
21
|
const readline = _utils.Import.lazy('../../../utils/readline', require);
|
|
@@ -21,8 +23,11 @@ const readline = _utils.Import.lazy('../../../utils/readline', require);
|
|
|
21
23
|
class LoggerManager extends _events.default {
|
|
22
24
|
constructor() {
|
|
23
25
|
super();
|
|
24
|
-
|
|
25
|
-
this
|
|
26
|
+
|
|
27
|
+
_defineProperty(this, "_compilering", void 0);
|
|
28
|
+
|
|
29
|
+
_defineProperty(this, "_listeners", void 0);
|
|
30
|
+
|
|
26
31
|
this._compilering = false;
|
|
27
32
|
this._listeners = [];
|
|
28
33
|
}
|
|
@@ -15,6 +15,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
|
|
18
20
|
const constants = _utils.Import.lazy('./constants', require); // 硬解字符串返回相应格式的对象
|
|
19
21
|
|
|
20
22
|
|
|
@@ -152,7 +154,8 @@ exports.getDtsMapper = getDtsMapper;
|
|
|
152
154
|
|
|
153
155
|
class LogStack {
|
|
154
156
|
constructor() {
|
|
155
|
-
this
|
|
157
|
+
_defineProperty(this, "_codeLogStack", void 0);
|
|
158
|
+
|
|
156
159
|
this._codeLogStack = [];
|
|
157
160
|
}
|
|
158
161
|
|
|
@@ -219,4 +222,5 @@ class TimeCounter {
|
|
|
219
222
|
}
|
|
220
223
|
|
|
221
224
|
exports.TimeCounter = TimeCounter;
|
|
222
|
-
|
|
225
|
+
|
|
226
|
+
_defineProperty(TimeCounter, "_now", void 0);
|
|
@@ -11,6 +11,8 @@ var _utils = require("@modern-js/utils");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
|
|
14
16
|
const clearFlag = '\x1Bc';
|
|
15
17
|
exports.clearFlag = clearFlag;
|
|
16
18
|
|
|
@@ -41,8 +43,10 @@ exports.logTemplate = logTemplate;
|
|
|
41
43
|
|
|
42
44
|
class LoggerText {
|
|
43
45
|
constructor(option) {
|
|
44
|
-
this
|
|
45
|
-
|
|
46
|
+
_defineProperty(this, "messages", void 0);
|
|
47
|
+
|
|
48
|
+
_defineProperty(this, "option", void 0);
|
|
49
|
+
|
|
46
50
|
this.messages = [];
|
|
47
51
|
this.option = option;
|
|
48
52
|
}
|
|
@@ -15,7 +15,7 @@ var _generator = _interopRequireDefault(require("@babel/generator"));
|
|
|
15
15
|
|
|
16
16
|
var t = _interopRequireWildcard(require("@babel/types"));
|
|
17
17
|
|
|
18
|
-
var _tsconfigPaths = require("tsconfig-paths");
|
|
18
|
+
var _tsconfigPaths = require("@modern-js/utils/tsconfig-paths");
|
|
19
19
|
|
|
20
20
|
var _utils = require("@modern-js/utils");
|
|
21
21
|
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.5.
|
|
14
|
+
"version": "1.5.4",
|
|
15
15
|
"bin": {
|
|
16
16
|
"modern": "./bin/modern.js"
|
|
17
17
|
},
|
|
@@ -54,34 +54,30 @@
|
|
|
54
54
|
"@babel/runtime": "^7",
|
|
55
55
|
"@babel/traverse": "^7.15.0",
|
|
56
56
|
"@babel/types": "^7.17.0",
|
|
57
|
-
"@modern-js/babel-compiler": "^1.2.
|
|
58
|
-
"@modern-js/babel-preset-module": "^1.3.
|
|
59
|
-
"@modern-js/core": "^1.
|
|
60
|
-
"@modern-js/css-config": "^1.2.
|
|
61
|
-
"@modern-js/i18n-cli-language-detector": "^1.2.
|
|
62
|
-
"@modern-js/new-action": "^1.3.
|
|
63
|
-
"@modern-js/plugin": "^1.3.
|
|
64
|
-
"@modern-js/plugin-analyze": "^1.4.
|
|
65
|
-
"@modern-js/plugin-changeset": "^1.2.
|
|
66
|
-
"@modern-js/plugin-
|
|
67
|
-
"@modern-js/
|
|
68
|
-
"@modern-js/
|
|
69
|
-
"@modern-js/utils": "^1.7.2",
|
|
57
|
+
"@modern-js/babel-compiler": "^1.2.5",
|
|
58
|
+
"@modern-js/babel-preset-module": "^1.3.6",
|
|
59
|
+
"@modern-js/core": "^1.11.1",
|
|
60
|
+
"@modern-js/css-config": "^1.2.6",
|
|
61
|
+
"@modern-js/i18n-cli-language-detector": "^1.2.3",
|
|
62
|
+
"@modern-js/new-action": "^1.3.9",
|
|
63
|
+
"@modern-js/plugin": "^1.3.5",
|
|
64
|
+
"@modern-js/plugin-analyze": "^1.4.5",
|
|
65
|
+
"@modern-js/plugin-changeset": "^1.2.7",
|
|
66
|
+
"@modern-js/plugin-i18n": "^1.2.6",
|
|
67
|
+
"@modern-js/style-compiler": "^1.2.7",
|
|
68
|
+
"@modern-js/utils": "^1.7.6",
|
|
70
69
|
"normalize-path": "^3.0.0",
|
|
71
70
|
"p-map": "^4",
|
|
72
|
-
"process.argv": "^0.6.0"
|
|
73
|
-
"tsconfig-paths": "^3.10.1"
|
|
71
|
+
"process.argv": "^0.6.0"
|
|
74
72
|
},
|
|
75
73
|
"devDependencies": {
|
|
76
|
-
"@babel/preset-typescript": "^7.15.0",
|
|
77
|
-
"@modern-js/babel-chain": "1.2.2",
|
|
78
74
|
"@scripts/build": "0.0.0",
|
|
79
75
|
"@scripts/jest-config": "0.0.0",
|
|
80
76
|
"@types/babel__core": "^7.1.15",
|
|
81
77
|
"@types/babel__generator": "^7.6.3",
|
|
82
78
|
"@types/babel__traverse": "^7.14.2",
|
|
83
79
|
"@types/glob": "^7.1.4",
|
|
84
|
-
"@types/jest": "^
|
|
80
|
+
"@types/jest": "^27",
|
|
85
81
|
"@types/node": "^14",
|
|
86
82
|
"@types/normalize-path": "^3.0.0",
|
|
87
83
|
"@types/react": "^17",
|
|
@@ -99,10 +95,33 @@
|
|
|
99
95
|
"registry": "https://registry.npmjs.org/",
|
|
100
96
|
"access": "public"
|
|
101
97
|
},
|
|
98
|
+
"wireit": {
|
|
99
|
+
"build": {
|
|
100
|
+
"command": "modern build",
|
|
101
|
+
"files": [
|
|
102
|
+
"src/**/*",
|
|
103
|
+
"tsconfig.json",
|
|
104
|
+
"package.json"
|
|
105
|
+
],
|
|
106
|
+
"output": [
|
|
107
|
+
"dist/**/*"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"test": {
|
|
111
|
+
"command": "jest --passWithNoTests",
|
|
112
|
+
"files": [
|
|
113
|
+
"src/**/*",
|
|
114
|
+
"tsconfig.json",
|
|
115
|
+
"package.json",
|
|
116
|
+
"tests/**/*"
|
|
117
|
+
],
|
|
118
|
+
"output": []
|
|
119
|
+
}
|
|
120
|
+
},
|
|
102
121
|
"scripts": {
|
|
103
122
|
"new": "modern new",
|
|
104
|
-
"build": "
|
|
105
|
-
"test": "
|
|
123
|
+
"build": "wireit",
|
|
124
|
+
"test": "wireit"
|
|
106
125
|
},
|
|
107
126
|
"readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
|
|
108
127
|
}
|
package/.eslintrc.js
DELETED
package/jest.config.js
DELETED
package/modern.config.js
DELETED