@modern-js/module-tools 1.21.3 → 2.0.0-beta.0
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 +38 -16
- package/dist/js/modern/features/build/utils.js +11 -7
- package/dist/js/modern/utils/babel.js +2 -2
- package/dist/js/node/features/build/utils.js +12 -9
- package/dist/js/node/utils/babel.js +1 -1
- package/dist/types/features/build/utils.d.ts +1 -2
- package/dist/types/hooks/index.d.ts +2 -1
- package/dist/types/index.d.ts +2 -0
- package/package.json +17 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
# @modern-js/module-tools
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
3
|
+
## 2.0.0-beta.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dda38c9: chore: v2
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- b8bbe036c: feat: export Hooks type
|
|
12
|
+
feat: 导出 Hooks 类型
|
|
13
|
+
- 14b712d: fix: use consistent alias type and default value across packages
|
|
14
|
+
|
|
15
|
+
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [c9e800d39]
|
|
18
|
+
- Updated dependencies [85edee8]
|
|
19
|
+
- Updated dependencies [edd1cfb1a]
|
|
20
|
+
- Updated dependencies [cc971eabf]
|
|
21
|
+
- Updated dependencies [5b9049f]
|
|
22
|
+
- Updated dependencies [b8bbe036c]
|
|
23
|
+
- Updated dependencies [d5a31df78]
|
|
24
|
+
- Updated dependencies [dda38c9]
|
|
25
|
+
- Updated dependencies [8b8e1bb57]
|
|
26
|
+
- Updated dependencies [3bbea92b2]
|
|
27
|
+
- Updated dependencies [abf3421]
|
|
28
|
+
- Updated dependencies [543be95]
|
|
29
|
+
- Updated dependencies [14b712d]
|
|
30
|
+
- @modern-js/core@2.0.0-beta.0
|
|
31
|
+
- @modern-js/utils@2.0.0-beta.0
|
|
32
|
+
- @modern-js/plugin@2.0.0-beta.0
|
|
33
|
+
- @modern-js/babel-preset-module@2.0.0-beta.0
|
|
34
|
+
- @modern-js/plugin-changeset@2.0.0-beta.0
|
|
35
|
+
- @modern-js/plugin-i18n@2.0.0-beta.0
|
|
36
|
+
- @modern-js/plugin-jarvis@2.0.0-beta.0
|
|
37
|
+
- @modern-js/new-action@2.0.0-beta.0
|
|
38
|
+
- @modern-js/babel-compiler@2.0.0-beta.0
|
|
39
|
+
- @modern-js/style-compiler@2.0.0-beta.0
|
|
40
|
+
- @modern-js/upgrade@2.0.0-beta.0
|
|
19
41
|
|
|
20
42
|
## 1.21.2
|
|
21
43
|
|
|
@@ -4,7 +4,6 @@ import * as os from 'os';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { chalk, Import, fs } from '@modern-js/utils';
|
|
6
6
|
const constants = Import.lazy('./constants', require);
|
|
7
|
-
const cssConfig = Import.lazy('@modern-js/css-config', require);
|
|
8
7
|
/**
|
|
9
8
|
* 处理日志信息
|
|
10
9
|
*/
|
|
@@ -74,14 +73,19 @@ export const watchSectionTitle = (str, status) => {
|
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
return `${chalk.bgWhite.gray.underline(str)} ${chalk.blue.underline('Log')}`;
|
|
77
|
-
};
|
|
78
|
-
export const getPostcssOption = (appDirectory, modernConfig) => {
|
|
79
|
-
var _postcssOption$postcs;
|
|
76
|
+
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
80
77
|
|
|
81
|
-
|
|
78
|
+
export const getPostcssOption = (...args) => {
|
|
79
|
+
// const postcssOption: any = cssConfig.getPostcssConfig(
|
|
80
|
+
// appDirectory,
|
|
81
|
+
// modernConfig,
|
|
82
|
+
// false,
|
|
83
|
+
// );
|
|
82
84
|
return {
|
|
83
|
-
plugins:
|
|
84
|
-
enableSourceMap:
|
|
85
|
+
plugins: [],
|
|
86
|
+
enableSourceMap: false,
|
|
87
|
+
// plugins: postcssOption?.postcssOptions?.plugins || [],
|
|
88
|
+
// enableSourceMap: (postcssOption as any)?.sourceMap || false,
|
|
85
89
|
options: {}
|
|
86
90
|
};
|
|
87
91
|
};
|
|
@@ -6,9 +6,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { getBabelConfig, applyUserBabelConfig } from '@modern-js/babel-preset-module';
|
|
9
|
-
import {
|
|
9
|
+
import { getAliasConfig, isUseSSRBundle, applyOptionsChain } from '@modern-js/utils';
|
|
10
10
|
export const getFinalAlias = (modernConfig, option) => {
|
|
11
|
-
const aliasConfig =
|
|
11
|
+
const aliasConfig = getAliasConfig(modernConfig.source.alias, option); // 排除内部别名,因为不需要处理
|
|
12
12
|
|
|
13
13
|
const finalPaths = {};
|
|
14
14
|
const internalAliasPrefix = '@modern-js/runtime';
|
|
@@ -20,8 +20,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
22
|
const constants = _utils.Import.lazy('./constants', require);
|
|
23
|
-
|
|
24
|
-
const cssConfig = _utils.Import.lazy('@modern-js/css-config', require);
|
|
25
23
|
/**
|
|
26
24
|
* 处理日志信息
|
|
27
25
|
*/
|
|
@@ -98,17 +96,22 @@ const watchSectionTitle = (str, status) => {
|
|
|
98
96
|
}
|
|
99
97
|
|
|
100
98
|
return `${_utils.chalk.bgWhite.gray.underline(str)} ${_utils.chalk.blue.underline('Log')}`;
|
|
101
|
-
};
|
|
99
|
+
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
102
100
|
|
|
103
|
-
exports.watchSectionTitle = watchSectionTitle;
|
|
104
101
|
|
|
105
|
-
|
|
106
|
-
var _postcssOption$postcs;
|
|
102
|
+
exports.watchSectionTitle = watchSectionTitle;
|
|
107
103
|
|
|
108
|
-
|
|
104
|
+
const getPostcssOption = (...args) => {
|
|
105
|
+
// const postcssOption: any = cssConfig.getPostcssConfig(
|
|
106
|
+
// appDirectory,
|
|
107
|
+
// modernConfig,
|
|
108
|
+
// false,
|
|
109
|
+
// );
|
|
109
110
|
return {
|
|
110
|
-
plugins:
|
|
111
|
-
enableSourceMap:
|
|
111
|
+
plugins: [],
|
|
112
|
+
enableSourceMap: false,
|
|
113
|
+
// plugins: postcssOption?.postcssOptions?.plugins || [],
|
|
114
|
+
// enableSourceMap: (postcssOption as any)?.sourceMap || false,
|
|
112
115
|
options: {}
|
|
113
116
|
};
|
|
114
117
|
};
|
|
@@ -20,7 +20,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
22
|
const getFinalAlias = (modernConfig, option) => {
|
|
23
|
-
const aliasConfig = (0, _utils.
|
|
23
|
+
const aliasConfig = (0, _utils.getAliasConfig)(modernConfig.source.alias, option); // 排除内部别名,因为不需要处理
|
|
24
24
|
|
|
25
25
|
const finalPaths = {};
|
|
26
26
|
const internalAliasPrefix = '@modern-js/runtime';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { NormalizedConfig } from '@modern-js/core';
|
|
2
1
|
import type { PostcssOption } from '@modern-js/style-compiler';
|
|
3
2
|
/**
|
|
4
3
|
* 处理日志信息
|
|
@@ -34,5 +33,5 @@ export declare enum SectionTitleStatus {
|
|
|
34
33
|
Log = 2,
|
|
35
34
|
}
|
|
36
35
|
export declare const watchSectionTitle: (str: string, status: SectionTitleStatus) => string;
|
|
37
|
-
export declare const getPostcssOption: (
|
|
36
|
+
export declare const getPostcssOption: (...args: any[]) => PostcssOption;
|
|
38
37
|
export declare const getAllDeps: <T>(appDirectory: string) => string[];
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "
|
|
14
|
+
"version": "2.0.0-beta.0",
|
|
15
15
|
"bin": {
|
|
16
16
|
"modern": "./bin/modern.js"
|
|
17
17
|
},
|
|
@@ -54,18 +54,18 @@
|
|
|
54
54
|
"@babel/runtime": "^7.18.0",
|
|
55
55
|
"@babel/traverse": "^7.18.0",
|
|
56
56
|
"@babel/types": "^7.18.0",
|
|
57
|
-
"@modern-js/babel-compiler": "
|
|
58
|
-
"@modern-js/babel-preset-module": "
|
|
59
|
-
"@modern-js/core": "
|
|
60
|
-
"@modern-js/css-config": "1.21.
|
|
61
|
-
"@modern-js/new-action": "
|
|
62
|
-
"@modern-js/upgrade": "
|
|
63
|
-
"@modern-js/plugin": "
|
|
64
|
-
"@modern-js/plugin-changeset": "
|
|
65
|
-
"@modern-js/plugin-i18n": "
|
|
66
|
-
"@modern-js/plugin-jarvis": "
|
|
67
|
-
"@modern-js/style-compiler": "
|
|
68
|
-
"@modern-js/utils": "
|
|
57
|
+
"@modern-js/babel-compiler": "2.0.0-beta.0",
|
|
58
|
+
"@modern-js/babel-preset-module": "2.0.0-beta.0",
|
|
59
|
+
"@modern-js/core": "2.0.0-beta.0",
|
|
60
|
+
"@modern-js/css-config": "1.21.1",
|
|
61
|
+
"@modern-js/new-action": "2.0.0-beta.0",
|
|
62
|
+
"@modern-js/upgrade": "2.0.0-beta.0",
|
|
63
|
+
"@modern-js/plugin": "2.0.0-beta.0",
|
|
64
|
+
"@modern-js/plugin-changeset": "2.0.0-beta.0",
|
|
65
|
+
"@modern-js/plugin-i18n": "2.0.0-beta.0",
|
|
66
|
+
"@modern-js/plugin-jarvis": "2.0.0-beta.0",
|
|
67
|
+
"@modern-js/style-compiler": "2.0.0-beta.0",
|
|
68
|
+
"@modern-js/utils": "2.0.0-beta.0",
|
|
69
69
|
"@rollup/plugin-json": "~4.1.0",
|
|
70
70
|
"@speedy-js/speedy-types": "0.13.2-modern.1",
|
|
71
71
|
"@speedy-js/speedy-core": "0.13.2-modern.1",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"signal-exit": "^3.0.7"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@scripts/build": "
|
|
83
|
-
"@scripts/jest-config": "
|
|
82
|
+
"@scripts/build": "2.0.0-beta.0",
|
|
83
|
+
"@scripts/jest-config": "2.0.0-beta.0",
|
|
84
84
|
"@types/babel__core": "^7.1.15",
|
|
85
85
|
"@types/babel__generator": "^7.6.3",
|
|
86
86
|
"@types/babel__traverse": "^7.14.2",
|
|
@@ -104,34 +104,10 @@
|
|
|
104
104
|
"registry": "https://registry.npmjs.org/",
|
|
105
105
|
"access": "public"
|
|
106
106
|
},
|
|
107
|
-
"wireit": {
|
|
108
|
-
"build": {
|
|
109
|
-
"command": "modern build",
|
|
110
|
-
"files": [
|
|
111
|
-
"src/**/*",
|
|
112
|
-
"tsconfig.json",
|
|
113
|
-
"package.json",
|
|
114
|
-
"./modern.config.js"
|
|
115
|
-
],
|
|
116
|
-
"output": [
|
|
117
|
-
"dist/**/*"
|
|
118
|
-
]
|
|
119
|
-
},
|
|
120
|
-
"test": {
|
|
121
|
-
"command": "jest --passWithNoTests",
|
|
122
|
-
"files": [
|
|
123
|
-
"src/**/*",
|
|
124
|
-
"tsconfig.json",
|
|
125
|
-
"package.json",
|
|
126
|
-
"tests/**/*"
|
|
127
|
-
],
|
|
128
|
-
"output": []
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
107
|
"scripts": {
|
|
132
108
|
"new": "modern new",
|
|
133
|
-
"build": "
|
|
134
|
-
"test": "
|
|
109
|
+
"build": "modern build",
|
|
110
|
+
"test": "jest --passWithNoTests",
|
|
135
111
|
"dev": "modern build --watch"
|
|
136
112
|
}
|
|
137
113
|
}
|