@modern-js/module-tools 2.0.0-beta.1 → 2.0.0-beta.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.
- package/CHANGELOG.md +126 -0
- package/bin/modern.js +6 -1
- package/dist/js/modern/commands/build.js +2 -2
- package/dist/js/modern/features/build/bundle/runSpeedy.js +2 -0
- package/dist/js/modern/index.js +6 -2
- package/dist/js/modern/schema/output.js +11 -0
- package/dist/js/modern/utils/babel.js +6 -2
- package/dist/js/modern/utils/valide.js +10 -8
- package/dist/js/node/commands/build.js +2 -2
- package/dist/js/node/features/build/bundle/runSpeedy.js +2 -0
- package/dist/js/node/index.js +7 -11
- package/dist/js/node/schema/output.js +11 -0
- package/dist/js/node/utils/babel.js +6 -2
- package/dist/js/node/utils/valide.js +10 -8
- package/dist/types/features/build/normalize.d.ts +1 -1
- package/dist/types/hooks/build.d.ts +6 -6
- package/dist/types/hooks/index.d.ts +3 -3
- package/dist/types/index.d.ts +0 -1
- package/dist/types/utils/babel.d.ts +2 -2
- package/dist/types/utils/valide.d.ts +2 -2
- package/package.json +19 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,131 @@
|
|
|
1
1
|
# @modern-js/module-tools
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.3
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dda38c9c3e: chore: v2
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- e4558a0: feat:
|
|
12
|
+
|
|
13
|
+
1. add `runBin` function
|
|
14
|
+
2. config internal plugins constants in the app/module/doc tools
|
|
15
|
+
3. add app/module/doc tools internal plugins
|
|
16
|
+
|
|
17
|
+
feat:
|
|
18
|
+
|
|
19
|
+
1. 添加 `runBin` 函数
|
|
20
|
+
2. 在 app/module/doc tools 里配置内部插件
|
|
21
|
+
3. 增加 app/module/doc tools 使用的插件常量
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- d61ca88a0b: update speedy version
|
|
26
|
+
更新依赖里 speedy 的版本
|
|
27
|
+
- b8bbe036c7: feat: export Hooks type
|
|
28
|
+
feat: 导出 Hooks 类型
|
|
29
|
+
- ebbeed1ece: update speedy-core to fix sass resolve error
|
|
30
|
+
更新 speedy-core 版本以修复 sass resolve 错误
|
|
31
|
+
- d4a456659b: chore: rename plugin-jarvis to plugin-lint
|
|
32
|
+
|
|
33
|
+
chore: 重命名 plugin-jarvis 为 plugin-lint
|
|
34
|
+
|
|
35
|
+
- 14b712da84: fix: use consistent alias type and default value across packages
|
|
36
|
+
|
|
37
|
+
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [c9e800d39a]
|
|
40
|
+
- Updated dependencies [6aca875]
|
|
41
|
+
- Updated dependencies [85edee888c]
|
|
42
|
+
- Updated dependencies [2e60319]
|
|
43
|
+
- Updated dependencies [92f0eade39]
|
|
44
|
+
- Updated dependencies [edd1cfb1af]
|
|
45
|
+
- Updated dependencies [cc971eabfc]
|
|
46
|
+
- Updated dependencies [5b9049f2e9]
|
|
47
|
+
- Updated dependencies [a3af050]
|
|
48
|
+
- Updated dependencies [d4a456659b]
|
|
49
|
+
- Updated dependencies [92004d1906]
|
|
50
|
+
- Updated dependencies [b8bbe036c7]
|
|
51
|
+
- Updated dependencies [f680410]
|
|
52
|
+
- Updated dependencies [d5a31df781]
|
|
53
|
+
- Updated dependencies [dda38c9c3e]
|
|
54
|
+
- Updated dependencies [8b8e1bb571]
|
|
55
|
+
- Updated dependencies [3bbea92b2a]
|
|
56
|
+
- Updated dependencies [b710adb]
|
|
57
|
+
- Updated dependencies [b7a96c3]
|
|
58
|
+
- Updated dependencies [cce8ece]
|
|
59
|
+
- Updated dependencies [f179749375]
|
|
60
|
+
- Updated dependencies [ea7cf06]
|
|
61
|
+
- Updated dependencies [bbe4c4a]
|
|
62
|
+
- Updated dependencies [e4558a0]
|
|
63
|
+
- Updated dependencies [abf3421a75]
|
|
64
|
+
- Updated dependencies [543be9558e]
|
|
65
|
+
- Updated dependencies [14b712da84]
|
|
66
|
+
- @modern-js/core@2.0.0-beta.3
|
|
67
|
+
- @modern-js/utils@2.0.0-beta.3
|
|
68
|
+
- @modern-js/plugin-lint@2.0.0-beta.3
|
|
69
|
+
- @modern-js/plugin@2.0.0-beta.3
|
|
70
|
+
- @modern-js/babel-preset-module@2.0.0-beta.3
|
|
71
|
+
- @modern-js/plugin-changeset@2.0.0-beta.3
|
|
72
|
+
- @modern-js/plugin-i18n@2.0.0-beta.3
|
|
73
|
+
- @modern-js/new-action@2.0.0-beta.3
|
|
74
|
+
- @modern-js/babel-compiler@2.0.0-beta.3
|
|
75
|
+
- @modern-js/style-compiler@2.0.0-beta.3
|
|
76
|
+
- @modern-js/upgrade@2.0.0-beta.3
|
|
77
|
+
|
|
78
|
+
## 2.0.0-beta.2
|
|
79
|
+
|
|
80
|
+
### Major Changes
|
|
81
|
+
|
|
82
|
+
- dda38c9c3e: chore: v2
|
|
83
|
+
|
|
84
|
+
### Patch Changes
|
|
85
|
+
|
|
86
|
+
- d61ca88: update speedy version
|
|
87
|
+
更新依赖里 speedy 的版本
|
|
88
|
+
- b8bbe036c7: feat: export Hooks type
|
|
89
|
+
feat: 导出 Hooks 类型
|
|
90
|
+
- ebbeed1: update speedy-core to fix sass resolve error
|
|
91
|
+
更新 speedy-core 版本以修复 sass resolve 错误
|
|
92
|
+
- d4a4566: chore: rename plugin-jarvis to plugin-lint
|
|
93
|
+
|
|
94
|
+
chore: 重命名 plugin-jarvis 为 plugin-lint
|
|
95
|
+
|
|
96
|
+
- 14b712da84: fix: use consistent alias type and default value across packages
|
|
97
|
+
|
|
98
|
+
fix: 在各个包中使用一致的 alias 类型定义和默认值
|
|
99
|
+
|
|
100
|
+
- Updated dependencies [c9e800d39a]
|
|
101
|
+
- Updated dependencies [85edee888c]
|
|
102
|
+
- Updated dependencies [92f0ead]
|
|
103
|
+
- Updated dependencies [edd1cfb1af]
|
|
104
|
+
- Updated dependencies [cc971eabfc]
|
|
105
|
+
- Updated dependencies [5b9049f2e9]
|
|
106
|
+
- Updated dependencies [d4a4566]
|
|
107
|
+
- Updated dependencies [92004d1]
|
|
108
|
+
- Updated dependencies [b8bbe036c7]
|
|
109
|
+
- Updated dependencies [d5a31df781]
|
|
110
|
+
- Updated dependencies [dda38c9c3e]
|
|
111
|
+
- Updated dependencies [8b8e1bb571]
|
|
112
|
+
- Updated dependencies [3bbea92b2a]
|
|
113
|
+
- Updated dependencies [f179749]
|
|
114
|
+
- Updated dependencies [abf3421a75]
|
|
115
|
+
- Updated dependencies [543be9558e]
|
|
116
|
+
- Updated dependencies [14b712da84]
|
|
117
|
+
- @modern-js/core@2.0.0-beta.2
|
|
118
|
+
- @modern-js/utils@2.0.0-beta.2
|
|
119
|
+
- @modern-js/plugin-lint@2.0.0-beta.2
|
|
120
|
+
- @modern-js/plugin@2.0.0-beta.2
|
|
121
|
+
- @modern-js/babel-preset-module@2.0.0-beta.2
|
|
122
|
+
- @modern-js/plugin-changeset@2.0.0-beta.2
|
|
123
|
+
- @modern-js/plugin-i18n@2.0.0-beta.2
|
|
124
|
+
- @modern-js/new-action@2.0.0-beta.2
|
|
125
|
+
- @modern-js/babel-compiler@2.0.0-beta.2
|
|
126
|
+
- @modern-js/style-compiler@2.0.0-beta.2
|
|
127
|
+
- @modern-js/upgrade@2.0.0-beta.2
|
|
128
|
+
|
|
3
129
|
## 2.0.0-beta.1
|
|
4
130
|
|
|
5
131
|
### Major Changes
|
package/bin/modern.js
CHANGED
|
@@ -32,7 +32,7 @@ export const init = api => {
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
export const build = async (api, buildCommandOption) => {
|
|
35
|
-
var _modernConfig$output
|
|
35
|
+
var _modernConfig$output$, _modernConfig$output;
|
|
36
36
|
const {
|
|
37
37
|
watch = false,
|
|
38
38
|
tsconfig: tsconfigName,
|
|
@@ -48,7 +48,7 @@ export const build = async (api, buildCommandOption) => {
|
|
|
48
48
|
} = api.useAppContext();
|
|
49
49
|
const modernConfig = api.useResolvedConfigContext();
|
|
50
50
|
const tsconfigPath = path.join(appDirectory, tsconfigName);
|
|
51
|
-
const outputPath = (_modernConfig$output$ = modernConfig.output.path) !== null && _modernConfig$output$ !== void 0 ? _modernConfig$output$ : 'dist';
|
|
51
|
+
const outputPath = (_modernConfig$output$ = modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig$output = modernConfig.output) === null || _modernConfig$output === void 0 ? void 0 : _modernConfig$output.path) !== null && _modernConfig$output$ !== void 0 ? _modernConfig$output$ : 'dist';
|
|
52
52
|
const isTsProject = tsConfigutils.existTsConfigFile(tsconfigPath);
|
|
53
53
|
const enableDtsGen = isTsProject && dts;
|
|
54
54
|
valid.valideBeforeTask({
|
package/dist/js/modern/index.js
CHANGED
|
@@ -8,7 +8,9 @@ const cli = Import.lazy('./cli', require);
|
|
|
8
8
|
const local = Import.lazy('./locale', require);
|
|
9
9
|
const schema = Import.lazy('./schema', require);
|
|
10
10
|
const lang = Import.lazy('./utils/language', require);
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
// export { defineConfig } from '@modern-js/core';
|
|
13
|
+
|
|
12
14
|
const isBuildMode = process.argv.slice(2)[0] === 'build';
|
|
13
15
|
export default (() => ({
|
|
14
16
|
name: '@modern-js/module-tools',
|
|
@@ -37,10 +39,12 @@ export default (() => ({
|
|
|
37
39
|
},
|
|
38
40
|
config() {
|
|
39
41
|
return {
|
|
42
|
+
source: {},
|
|
40
43
|
output: {
|
|
41
44
|
enableSourceMap: false,
|
|
42
45
|
jsPath: 'js'
|
|
43
|
-
}
|
|
46
|
+
},
|
|
47
|
+
tools: {}
|
|
44
48
|
};
|
|
45
49
|
},
|
|
46
50
|
commands({
|
|
@@ -31,4 +31,15 @@ export const outputSchema = [/** packageMode will deprecated */
|
|
|
31
31
|
typeof: 'string',
|
|
32
32
|
default: 'styles'
|
|
33
33
|
}
|
|
34
|
+
}, {
|
|
35
|
+
target: 'output.jsPath',
|
|
36
|
+
schema: {
|
|
37
|
+
typeof: 'string',
|
|
38
|
+
default: ''
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
target: 'output.disableSourceMap',
|
|
42
|
+
schema: {
|
|
43
|
+
typeof: 'boolean'
|
|
44
|
+
}
|
|
34
45
|
}, ...buildSchema];
|
|
@@ -21,6 +21,7 @@ export const getFinalAlias = (modernConfig, option) => {
|
|
|
21
21
|
return aliasConfig;
|
|
22
22
|
};
|
|
23
23
|
export const resolveBabelConfig = (appDirectory, modernConfig, sourceMap, bundlelessOptions, option) => {
|
|
24
|
+
var _modernConfig$tools;
|
|
24
25
|
const {
|
|
25
26
|
source: {
|
|
26
27
|
envVars,
|
|
@@ -33,6 +34,9 @@ export const resolveBabelConfig = (appDirectory, modernConfig, sourceMap, bundle
|
|
|
33
34
|
tools: {
|
|
34
35
|
lodash: userLodashOption,
|
|
35
36
|
styledComponents
|
|
37
|
+
} = {
|
|
38
|
+
lodash: {},
|
|
39
|
+
styledComponents: {}
|
|
36
40
|
}
|
|
37
41
|
} = modernConfig;
|
|
38
42
|
|
|
@@ -46,7 +50,7 @@ export const resolveBabelConfig = (appDirectory, modernConfig, sourceMap, bundle
|
|
|
46
50
|
id: ['lodash', 'ramda']
|
|
47
51
|
},
|
|
48
52
|
// TODO: 需要处理类型问题
|
|
49
|
-
userLodashOption);
|
|
53
|
+
userLodashOption || {});
|
|
50
54
|
// babel config
|
|
51
55
|
const internalBabelConfig = getBabelConfig({
|
|
52
56
|
appDirectory,
|
|
@@ -75,6 +79,6 @@ export const resolveBabelConfig = (appDirectory, modernConfig, sourceMap, bundle
|
|
|
75
79
|
// Preventing warning when files are too large
|
|
76
80
|
internalBabelConfig.compact = false;
|
|
77
81
|
internalBabelConfig.sourceMaps = sourceMap === 'external' ? true : sourceMap;
|
|
78
|
-
const userBabelConfig = modernConfig.tools.babel;
|
|
82
|
+
const userBabelConfig = (_modernConfig$tools = modernConfig.tools) === null || _modernConfig$tools === void 0 ? void 0 : _modernConfig$tools.babel;
|
|
79
83
|
return applyUserBabelConfig(internalBabelConfig, userBabelConfig);
|
|
80
84
|
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { validAlias } from '@modern-js/utils';
|
|
2
2
|
export const valideBeforeTask = ({
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
4
|
modernConfig,
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
6
|
tsconfigPath
|
|
5
7
|
}) => {
|
|
6
|
-
const modernConfigValidResult = modernConfigValid(modernConfig, {
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
if (modernConfigValidResult) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
8
|
+
// const modernConfigValidResult = modernConfigValid(modernConfig, {
|
|
9
|
+
// tsconfigPath,
|
|
10
|
+
// });
|
|
11
|
+
// if (modernConfigValidResult) {
|
|
12
|
+
// console.error(modernConfigValidResult);
|
|
13
|
+
// // eslint-disable-next-line no-process-exit
|
|
14
|
+
// process.exit(0);
|
|
15
|
+
// }
|
|
14
16
|
};
|
|
15
17
|
export const modernConfigValid = (modernConfig, option) => {
|
|
16
18
|
const valids = [validAlias];
|
|
@@ -42,7 +42,7 @@ const init = api => {
|
|
|
42
42
|
};
|
|
43
43
|
exports.init = init;
|
|
44
44
|
const build = async (api, buildCommandOption) => {
|
|
45
|
-
var _modernConfig$output
|
|
45
|
+
var _modernConfig$output$, _modernConfig$output;
|
|
46
46
|
const {
|
|
47
47
|
watch = false,
|
|
48
48
|
tsconfig: tsconfigName,
|
|
@@ -58,7 +58,7 @@ const build = async (api, buildCommandOption) => {
|
|
|
58
58
|
} = api.useAppContext();
|
|
59
59
|
const modernConfig = api.useResolvedConfigContext();
|
|
60
60
|
const tsconfigPath = path.join(appDirectory, tsconfigName);
|
|
61
|
-
const outputPath = (_modernConfig$output$ = modernConfig.output.path) !== null && _modernConfig$output$ !== void 0 ? _modernConfig$output$ : 'dist';
|
|
61
|
+
const outputPath = (_modernConfig$output$ = modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig$output = modernConfig.output) === null || _modernConfig$output === void 0 ? void 0 : _modernConfig$output.path) !== null && _modernConfig$output$ !== void 0 ? _modernConfig$output$ : 'dist';
|
|
62
62
|
const isTsProject = tsConfigutils.existTsConfigFile(tsconfigPath);
|
|
63
63
|
const enableDtsGen = isTsProject && dts;
|
|
64
64
|
valid.valideBeforeTask({
|
package/dist/js/node/index.js
CHANGED
|
@@ -3,16 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
defineConfig: true
|
|
8
|
-
};
|
|
6
|
+
var _exportNames = {};
|
|
9
7
|
exports.default = void 0;
|
|
10
|
-
Object.defineProperty(exports, "defineConfig", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _core.defineConfig;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
8
|
var _utils = require("@modern-js/utils");
|
|
17
9
|
var _pluginChangeset = _interopRequireDefault(require("@modern-js/plugin-changeset"));
|
|
18
10
|
var _pluginLint = _interopRequireDefault(require("@modern-js/plugin-lint"));
|
|
@@ -29,13 +21,15 @@ Object.keys(_types).forEach(function (key) {
|
|
|
29
21
|
}
|
|
30
22
|
});
|
|
31
23
|
});
|
|
32
|
-
var _core = require("@modern-js/core");
|
|
33
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
25
|
const upgradeModel = _utils.Import.lazy('@modern-js/upgrade', require);
|
|
35
26
|
const cli = _utils.Import.lazy('./cli', require);
|
|
36
27
|
const local = _utils.Import.lazy('./locale', require);
|
|
37
28
|
const schema = _utils.Import.lazy('./schema', require);
|
|
38
29
|
const lang = _utils.Import.lazy('./utils/language', require);
|
|
30
|
+
|
|
31
|
+
// export { defineConfig } from '@modern-js/core';
|
|
32
|
+
|
|
39
33
|
const isBuildMode = process.argv.slice(2)[0] === 'build';
|
|
40
34
|
var _default = () => ({
|
|
41
35
|
name: '@modern-js/module-tools',
|
|
@@ -64,10 +58,12 @@ var _default = () => ({
|
|
|
64
58
|
},
|
|
65
59
|
config() {
|
|
66
60
|
return {
|
|
61
|
+
source: {},
|
|
67
62
|
output: {
|
|
68
63
|
enableSourceMap: false,
|
|
69
64
|
jsPath: 'js'
|
|
70
|
-
}
|
|
65
|
+
},
|
|
66
|
+
tools: {}
|
|
71
67
|
};
|
|
72
68
|
},
|
|
73
69
|
commands({
|
|
@@ -37,5 +37,16 @@ const outputSchema = [/** packageMode will deprecated */
|
|
|
37
37
|
typeof: 'string',
|
|
38
38
|
default: 'styles'
|
|
39
39
|
}
|
|
40
|
+
}, {
|
|
41
|
+
target: 'output.jsPath',
|
|
42
|
+
schema: {
|
|
43
|
+
typeof: 'string',
|
|
44
|
+
default: ''
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
target: 'output.disableSourceMap',
|
|
48
|
+
schema: {
|
|
49
|
+
typeof: 'boolean'
|
|
50
|
+
}
|
|
40
51
|
}, ..._buildConfig.buildSchema];
|
|
41
52
|
exports.outputSchema = outputSchema;
|
|
@@ -29,6 +29,7 @@ const getFinalAlias = (modernConfig, option) => {
|
|
|
29
29
|
};
|
|
30
30
|
exports.getFinalAlias = getFinalAlias;
|
|
31
31
|
const resolveBabelConfig = (appDirectory, modernConfig, sourceMap, bundlelessOptions, option) => {
|
|
32
|
+
var _modernConfig$tools;
|
|
32
33
|
const {
|
|
33
34
|
source: {
|
|
34
35
|
envVars,
|
|
@@ -41,6 +42,9 @@ const resolveBabelConfig = (appDirectory, modernConfig, sourceMap, bundlelessOpt
|
|
|
41
42
|
tools: {
|
|
42
43
|
lodash: userLodashOption,
|
|
43
44
|
styledComponents
|
|
45
|
+
} = {
|
|
46
|
+
lodash: {},
|
|
47
|
+
styledComponents: {}
|
|
44
48
|
}
|
|
45
49
|
} = modernConfig;
|
|
46
50
|
|
|
@@ -54,7 +58,7 @@ const resolveBabelConfig = (appDirectory, modernConfig, sourceMap, bundlelessOpt
|
|
|
54
58
|
id: ['lodash', 'ramda']
|
|
55
59
|
},
|
|
56
60
|
// TODO: 需要处理类型问题
|
|
57
|
-
userLodashOption);
|
|
61
|
+
userLodashOption || {});
|
|
58
62
|
// babel config
|
|
59
63
|
const internalBabelConfig = (0, _babelPresetModule.getBabelConfig)({
|
|
60
64
|
appDirectory,
|
|
@@ -83,7 +87,7 @@ const resolveBabelConfig = (appDirectory, modernConfig, sourceMap, bundlelessOpt
|
|
|
83
87
|
// Preventing warning when files are too large
|
|
84
88
|
internalBabelConfig.compact = false;
|
|
85
89
|
internalBabelConfig.sourceMaps = sourceMap === 'external' ? true : sourceMap;
|
|
86
|
-
const userBabelConfig = modernConfig.tools.babel;
|
|
90
|
+
const userBabelConfig = (_modernConfig$tools = modernConfig.tools) === null || _modernConfig$tools === void 0 ? void 0 : _modernConfig$tools.babel;
|
|
87
91
|
return (0, _babelPresetModule.applyUserBabelConfig)(internalBabelConfig, userBabelConfig);
|
|
88
92
|
};
|
|
89
93
|
exports.resolveBabelConfig = resolveBabelConfig;
|
|
@@ -6,17 +6,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.valideBeforeTask = exports.modernConfigValid = void 0;
|
|
7
7
|
var _utils = require("@modern-js/utils");
|
|
8
8
|
const valideBeforeTask = ({
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
10
|
modernConfig,
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
12
|
tsconfigPath
|
|
11
13
|
}) => {
|
|
12
|
-
const modernConfigValidResult = modernConfigValid(modernConfig, {
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
if (modernConfigValidResult) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
14
|
+
// const modernConfigValidResult = modernConfigValid(modernConfig, {
|
|
15
|
+
// tsconfigPath,
|
|
16
|
+
// });
|
|
17
|
+
// if (modernConfigValidResult) {
|
|
18
|
+
// console.error(modernConfigValidResult);
|
|
19
|
+
// // eslint-disable-next-line no-process-exit
|
|
20
|
+
// process.exit(0);
|
|
21
|
+
// }
|
|
20
22
|
};
|
|
21
23
|
exports.valideBeforeTask = valideBeforeTask;
|
|
22
24
|
const modernConfigValid = (modernConfig, option) => {
|
|
@@ -2,7 +2,7 @@ import type { PluginAPI } from '@modern-js/core';
|
|
|
2
2
|
import type { BuildConfig, BaseBuildConfig, SourceMap } from '../../schema/types';
|
|
3
3
|
import type { IBuildFeatOption } from '../../types';
|
|
4
4
|
import type { NormalizedBuildConfig } from './types';
|
|
5
|
-
export declare const getNormalizeModuleConfigByPackageModeAndFileds: (api: PluginAPI, buildFeatOption: IBuildFeatOption) => BuildConfig;
|
|
5
|
+
export declare const getNormalizeModuleConfigByPackageModeAndFileds: (api: PluginAPI, buildFeatOption: IBuildFeatOption) => BuildConfig[];
|
|
6
6
|
export declare const getFinalTsconfig: (config: {
|
|
7
7
|
tsconfig?: string;
|
|
8
8
|
}, buildFeatOption: IBuildFeatOption) => string;
|
|
@@ -10,13 +10,13 @@ export declare const platformBuild: import("@modern-js/plugin").ParallelWorkflow
|
|
|
10
10
|
params: string[];
|
|
11
11
|
}>;
|
|
12
12
|
export declare const moduleLessConfig: import("@modern-js/plugin").AsyncPipeline<{
|
|
13
|
-
modernConfig: NormalizedConfig
|
|
13
|
+
modernConfig: NormalizedConfig<any>;
|
|
14
14
|
}, LessOption | undefined>;
|
|
15
15
|
export declare const moduleSassConfig: import("@modern-js/plugin").AsyncPipeline<{
|
|
16
|
-
modernConfig: NormalizedConfig
|
|
16
|
+
modernConfig: NormalizedConfig<any>;
|
|
17
17
|
}, SassOptions<"sync"> | undefined>;
|
|
18
18
|
export declare const moduleTailwindConfig: import("@modern-js/plugin").AsyncPipeline<{
|
|
19
|
-
modernConfig: NormalizedConfig
|
|
19
|
+
modernConfig: NormalizedConfig<any>;
|
|
20
20
|
}, any>;
|
|
21
21
|
export declare const buildHooks: {
|
|
22
22
|
platformBuild: import("@modern-js/plugin").ParallelWorkflow<PlatformBuildOption, {
|
|
@@ -26,13 +26,13 @@ export declare const buildHooks: {
|
|
|
26
26
|
params: string[];
|
|
27
27
|
}>;
|
|
28
28
|
moduleLessConfig: import("@modern-js/plugin").AsyncPipeline<{
|
|
29
|
-
modernConfig: NormalizedConfig
|
|
29
|
+
modernConfig: NormalizedConfig<any>;
|
|
30
30
|
}, LessOption | undefined>;
|
|
31
31
|
moduleSassConfig: import("@modern-js/plugin").AsyncPipeline<{
|
|
32
|
-
modernConfig: NormalizedConfig
|
|
32
|
+
modernConfig: NormalizedConfig<any>;
|
|
33
33
|
}, SassOptions<"sync"> | undefined>;
|
|
34
34
|
moduleTailwindConfig: import("@modern-js/plugin").AsyncPipeline<{
|
|
35
|
-
modernConfig: NormalizedConfig
|
|
35
|
+
modernConfig: NormalizedConfig<any>;
|
|
36
36
|
}, any>;
|
|
37
37
|
};
|
|
38
38
|
export declare const lifecycle: () => void;
|
|
@@ -18,13 +18,13 @@ export declare const hooks: {
|
|
|
18
18
|
params: string[];
|
|
19
19
|
}>;
|
|
20
20
|
moduleLessConfig: import("@modern-js/plugin").AsyncPipeline<{
|
|
21
|
-
modernConfig: import("@modern-js/core").NormalizedConfig
|
|
21
|
+
modernConfig: import("@modern-js/core").NormalizedConfig<any, {}, {}, {}>;
|
|
22
22
|
}, import("@modern-js/style-compiler").LessOption | undefined>;
|
|
23
23
|
moduleSassConfig: import("@modern-js/plugin").AsyncPipeline<{
|
|
24
|
-
modernConfig: import("@modern-js/core").NormalizedConfig
|
|
24
|
+
modernConfig: import("@modern-js/core").NormalizedConfig<any, {}, {}, {}>;
|
|
25
25
|
}, import("@modern-js/style-compiler").SassOptions<"sync"> | undefined>;
|
|
26
26
|
moduleTailwindConfig: import("@modern-js/plugin").AsyncPipeline<{
|
|
27
|
-
modernConfig: import("@modern-js/core").NormalizedConfig
|
|
27
|
+
modernConfig: import("@modern-js/core").NormalizedConfig<any, {}, {}, {}>;
|
|
28
28
|
}, any>;
|
|
29
29
|
};
|
|
30
30
|
export declare type ModuleHooks = typeof hooks;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,5 @@ import type { CliPlugin } from '@modern-js/core';
|
|
|
2
2
|
import { ModuleHooks } from './hooks';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export type { ModuleHooks, CliPlugin };
|
|
5
|
-
export { defineConfig } from '@modern-js/core';
|
|
6
5
|
declare const _default: () => CliPlugin;
|
|
7
6
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import type { NormalizedConfig } from '@modern-js/core';
|
|
|
2
2
|
import type { IPackageModeValue } from '../types';
|
|
3
3
|
import type { BundlelessOptions, SourceMap } from '../schema/types';
|
|
4
4
|
export declare const getFinalAlias: any;
|
|
5
|
-
export declare const resolveBabelConfig: (appDirectory: string, modernConfig: NormalizedConfig
|
|
5
|
+
export declare const resolveBabelConfig: (appDirectory: string, modernConfig: NormalizedConfig<any>, sourceMap: SourceMap, bundlelessOptions: Required<BundlelessOptions>, option: Pick<IPackageModeValue, 'syntax' | 'type'> & {
|
|
6
6
|
sourceAbsDir: string;
|
|
7
7
|
tsconfigPath: string;
|
|
8
|
-
}) =>
|
|
8
|
+
}) => any;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { NormalizedConfig } from '@modern-js/core';
|
|
2
2
|
export interface IValideOption {
|
|
3
|
-
modernConfig: NormalizedConfig
|
|
3
|
+
modernConfig: NormalizedConfig<any>;
|
|
4
4
|
tsconfigPath: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const valideBeforeTask: ({
|
|
7
7
|
modernConfig,
|
|
8
8
|
tsconfigPath
|
|
9
9
|
}: IValideOption) => void;
|
|
10
|
-
export declare const modernConfigValid: (modernConfig: NormalizedConfig
|
|
10
|
+
export declare const modernConfigValid: (modernConfig: NormalizedConfig<any>, option: {
|
|
11
11
|
tsconfigPath: string;
|
|
12
12
|
}) => string | null;
|
package/package.json
CHANGED
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.0.0-beta.
|
|
14
|
+
"version": "2.0.0-beta.3",
|
|
15
15
|
"bin": {
|
|
16
|
-
"modern": "./bin/modern.js"
|
|
16
|
+
"modern": "./bin/modern.js",
|
|
17
|
+
"modern-module": "./bin/modern.js"
|
|
17
18
|
},
|
|
18
19
|
"jsnext:source": "./src/index.ts",
|
|
19
20
|
"types": "./dist/types/index.d.ts",
|
|
@@ -66,17 +67,17 @@
|
|
|
66
67
|
"rollup-plugin-dts": "^4.2.1",
|
|
67
68
|
"rollup-plugin-hashbang": "^3.0.0",
|
|
68
69
|
"signal-exit": "^3.0.7",
|
|
69
|
-
"@modern-js/babel-
|
|
70
|
-
"@modern-js/
|
|
71
|
-
"@modern-js/
|
|
72
|
-
"@modern-js/
|
|
73
|
-
"@modern-js/
|
|
74
|
-
"@modern-js/plugin
|
|
75
|
-
"@modern-js/plugin-
|
|
76
|
-
"@modern-js/plugin-
|
|
77
|
-
"@modern-js/
|
|
78
|
-
"@modern-js/
|
|
79
|
-
"@modern-js/
|
|
70
|
+
"@modern-js/babel-compiler": "2.0.0-beta.3",
|
|
71
|
+
"@modern-js/babel-preset-module": "2.0.0-beta.3",
|
|
72
|
+
"@modern-js/core": "2.0.0-beta.3",
|
|
73
|
+
"@modern-js/new-action": "2.0.0-beta.3",
|
|
74
|
+
"@modern-js/upgrade": "2.0.0-beta.3",
|
|
75
|
+
"@modern-js/plugin": "2.0.0-beta.3",
|
|
76
|
+
"@modern-js/plugin-changeset": "2.0.0-beta.3",
|
|
77
|
+
"@modern-js/plugin-i18n": "2.0.0-beta.3",
|
|
78
|
+
"@modern-js/plugin-lint": "2.0.0-beta.3",
|
|
79
|
+
"@modern-js/style-compiler": "2.0.0-beta.3",
|
|
80
|
+
"@modern-js/utils": "2.0.0-beta.3"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
83
|
"@types/babel__core": "^7.1.15",
|
|
@@ -91,8 +92,8 @@
|
|
|
91
92
|
"typescript": "^4",
|
|
92
93
|
"ajv": "^8",
|
|
93
94
|
"ajv-keywords": "^5",
|
|
94
|
-
"@scripts/build": "2.0.0-beta.
|
|
95
|
-
"@scripts/jest-config": "2.0.0-beta.
|
|
95
|
+
"@scripts/build": "2.0.0-beta.3",
|
|
96
|
+
"@scripts/jest-config": "2.0.0-beta.3"
|
|
96
97
|
},
|
|
97
98
|
"sideEffects": false,
|
|
98
99
|
"modernConfig": {
|
|
@@ -105,9 +106,9 @@
|
|
|
105
106
|
"access": "public"
|
|
106
107
|
},
|
|
107
108
|
"scripts": {
|
|
108
|
-
"new": "modern new",
|
|
109
|
-
"build": "modern build",
|
|
109
|
+
"new": "modern-lib new",
|
|
110
|
+
"build": "modern-lib build",
|
|
110
111
|
"test": "jest --passWithNoTests",
|
|
111
|
-
"dev": "modern build --watch"
|
|
112
|
+
"dev": "modern-lib build --watch"
|
|
112
113
|
}
|
|
113
114
|
}
|