@modern-js/module-tools 1.0.0-rc.2 → 1.0.0-rc.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 +21 -0
- package/README.md +1 -1
- package/dist/js/modern/utils/copy.js +4 -2
- package/dist/js/node/commands/index.js +4 -4
- package/dist/js/node/features/build/constants.js +1 -1
- package/dist/js/node/features/build/logger/logText.js +1 -1
- package/dist/js/node/features/build/utils.js +1 -1
- package/dist/js/node/features/dev/index.js +1 -1
- package/dist/js/node/index.js +1 -1
- package/dist/js/node/tasks/build-source-code.js +1 -1
- package/dist/js/node/utils/copy.js +4 -2
- package/dist/js/node/utils/logger.js +1 -1
- package/dist/js/node/utils/tsconfig.js +1 -1
- package/dist/js/node/utils/tspaths-transform/utils.js +1 -1
- package/dist/js/node/utils/valide.js +1 -1
- package/package.json +22 -18
- package/src/utils/copy.ts +3 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @modern-js/module-tools
|
|
2
|
+
|
|
3
|
+
## 1.0.0-rc.3
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- feat: initial
|
|
7
|
+
- Updated dependencies [undefined]
|
|
8
|
+
- @modern-js/babel-preset-module@1.0.0-rc.3
|
|
9
|
+
- @modern-js/core@1.0.0-rc.3
|
|
10
|
+
- @modern-js/css-config@1.0.0-rc.3
|
|
11
|
+
- @modern-js/i18n-cli-language-detector@1.0.0-rc.3
|
|
12
|
+
- @modern-js/plugin-analyze@1.0.0-rc.3
|
|
13
|
+
- @modern-js/plugin-changeset@1.0.0-rc.3
|
|
14
|
+
- @modern-js/plugin-fast-refresh@1.0.0-rc.3
|
|
15
|
+
- @modern-js/plugin-i18n@1.0.0-rc.3
|
|
16
|
+
- @modern-js/new-action@1.0.0-rc.3
|
|
17
|
+
- @modern-js/babel-compiler@1.0.0-rc.3
|
|
18
|
+
- @modern-js/style-compiler@1.0.0-rc.3
|
|
19
|
+
- @modern-js/module-tools-hooks@1.0.0-rc.3
|
|
20
|
+
- @modern-js/plugin@1.0.0-rc.3
|
|
21
|
+
- @modern-js/utils@1.0.0-rc.3
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
<p align="center">
|
|
3
|
-
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs.png" width="300" alt="Modern.js Logo" /></a>
|
|
3
|
+
<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>
|
|
4
4
|
</p>
|
|
5
5
|
|
|
6
6
|
<p align="center">现代 Web 工程体系</p>
|
|
@@ -21,9 +21,11 @@ export const copyTask = async option => {
|
|
|
21
21
|
const {
|
|
22
22
|
output: {
|
|
23
23
|
copy,
|
|
24
|
-
path: outputPath = 'dist'
|
|
24
|
+
path: outputPath = 'dist',
|
|
25
|
+
jsPath = 'js'
|
|
25
26
|
}
|
|
26
27
|
} = modernConfig;
|
|
28
|
+
const copyDistDir = path.join(outputPath, jsPath);
|
|
27
29
|
|
|
28
30
|
if (!copy) {
|
|
29
31
|
return;
|
|
@@ -70,7 +72,7 @@ export const copyTask = async option => {
|
|
|
70
72
|
const relativeFrom = path.relative(context, item); // 如果 to 是目录,通过相对路径计算完整的产物路径;如果 to 是文件,直接作为最终产物路径
|
|
71
73
|
|
|
72
74
|
const fileName = isToDirectory ? path.join(to, relativeFrom) : to;
|
|
73
|
-
const finalToPath = path.resolve(
|
|
75
|
+
const finalToPath = path.resolve(copyDistDir, fileName);
|
|
74
76
|
fs.copySync(item, finalToPath);
|
|
75
77
|
});
|
|
76
78
|
}
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "build", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _build.build;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "dev", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _dev.dev;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.runTscWatchTitle = exports.runTscTitle = exports.runStyleCompilerTitle = exports.runBabelCompilerTitle = exports.clearFlag = exports.PACKAGE_MODES = exports.DEFAULT_PACKAGE_MODE = void 0;
|
|
7
7
|
// Universal JS 的默认选择,三份构建产物,支持 Node.js,对现代浏览器有优化
|
|
8
8
|
const universalJs = [{
|
|
9
9
|
type: 'module',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.logTemplate = exports.colors = exports.clearFlag = exports.LoggerText = void 0;
|
|
7
7
|
|
|
8
8
|
var _utils = require("@modern-js/utils");
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.logTemplate = exports.getDtsMapper = exports.getCodeMapper = exports.getCodeInitMapper = exports.TimeCounter = exports.LogStack = void 0;
|
|
7
7
|
|
|
8
8
|
var path = _interopRequireWildcard(require("path"));
|
|
9
9
|
|
package/dist/js/node/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.initEnv = exports.
|
|
6
|
+
exports.initEnv = exports.getWillCompilerCode = exports.buildSourceCode = exports.Compiler = void 0;
|
|
7
7
|
|
|
8
8
|
var _utils = require("@modern-js/utils");
|
|
9
9
|
|
|
@@ -37,9 +37,11 @@ const copyTask = async option => {
|
|
|
37
37
|
const {
|
|
38
38
|
output: {
|
|
39
39
|
copy,
|
|
40
|
-
path: outputPath = 'dist'
|
|
40
|
+
path: outputPath = 'dist',
|
|
41
|
+
jsPath = 'js'
|
|
41
42
|
}
|
|
42
43
|
} = modernConfig;
|
|
44
|
+
const copyDistDir = path.join(outputPath, jsPath);
|
|
43
45
|
|
|
44
46
|
if (!copy) {
|
|
45
47
|
return;
|
|
@@ -86,7 +88,7 @@ const copyTask = async option => {
|
|
|
86
88
|
const relativeFrom = path.relative(context, item); // 如果 to 是目录,通过相对路径计算完整的产物路径;如果 to 是文件,直接作为最终产物路径
|
|
87
89
|
|
|
88
90
|
const fileName = isToDirectory ? path.join(to, relativeFrom) : to;
|
|
89
|
-
const finalToPath = path.resolve(
|
|
91
|
+
const finalToPath = path.resolve(copyDistDir, fileName);
|
|
90
92
|
|
|
91
93
|
_utils.fs.copySync(item, finalToPath);
|
|
92
94
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.logTemplate = exports.clearFlag = exports.LoggerText = exports.LoggerManager = void 0;
|
|
7
7
|
|
|
8
8
|
var _events = _interopRequireDefault(require("events"));
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/module-tools",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"bin": {
|
|
5
5
|
"modern": "./bin/modern.js"
|
|
6
6
|
},
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"@babel/runtime": "^7",
|
|
34
34
|
"@babel/traverse": "^7.15.0",
|
|
35
35
|
"@babel/types": "^7.15.0",
|
|
36
|
-
"@modern-js/babel-compiler": "^1.0.0-rc.
|
|
37
|
-
"@modern-js/babel-preset-module": "^1.0.0-rc.
|
|
38
|
-
"@modern-js/core": "^1.0.0-rc.
|
|
39
|
-
"@modern-js/css-config": "^1.0.0-rc.
|
|
40
|
-
"@modern-js/i18n-cli-language-detector": "^1.0.0-rc.
|
|
41
|
-
"@modern-js/module-tools-hooks": "^1.0.0-rc.
|
|
42
|
-
"@modern-js/new-action": "^1.0.0-rc.
|
|
43
|
-
"@modern-js/plugin": "^1.0.0-rc.
|
|
44
|
-
"@modern-js/plugin-analyze": "^1.0.0-rc.
|
|
45
|
-
"@modern-js/plugin-changeset": "^1.0.0-rc.
|
|
46
|
-
"@modern-js/plugin-fast-refresh": "^1.0.0-rc.
|
|
47
|
-
"@modern-js/plugin-i18n": "^1.0.0-rc.
|
|
48
|
-
"@modern-js/style-compiler": "^1.0.0-rc.
|
|
49
|
-
"@modern-js/utils": "^1.0.0-rc.
|
|
36
|
+
"@modern-js/babel-compiler": "^1.0.0-rc.3",
|
|
37
|
+
"@modern-js/babel-preset-module": "^1.0.0-rc.3",
|
|
38
|
+
"@modern-js/core": "^1.0.0-rc.3",
|
|
39
|
+
"@modern-js/css-config": "^1.0.0-rc.3",
|
|
40
|
+
"@modern-js/i18n-cli-language-detector": "^1.0.0-rc.3",
|
|
41
|
+
"@modern-js/module-tools-hooks": "^1.0.0-rc.3",
|
|
42
|
+
"@modern-js/new-action": "^1.0.0-rc.3",
|
|
43
|
+
"@modern-js/plugin": "^1.0.0-rc.3",
|
|
44
|
+
"@modern-js/plugin-analyze": "^1.0.0-rc.3",
|
|
45
|
+
"@modern-js/plugin-changeset": "^1.0.0-rc.3",
|
|
46
|
+
"@modern-js/plugin-fast-refresh": "^1.0.0-rc.3",
|
|
47
|
+
"@modern-js/plugin-i18n": "^1.0.0-rc.3",
|
|
48
|
+
"@modern-js/style-compiler": "^1.0.0-rc.3",
|
|
49
|
+
"@modern-js/utils": "^1.0.0-rc.3",
|
|
50
50
|
"chalk": "^4.1.2",
|
|
51
51
|
"chokidar": "^3.5.2",
|
|
52
52
|
"dotenv": "^10.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@babel/preset-typescript": "^7.15.0",
|
|
68
|
-
"@modern-js/babel-chain": "^1.0.0-rc.
|
|
68
|
+
"@modern-js/babel-chain": "^1.0.0-rc.3",
|
|
69
69
|
"@types/babel__core": "^7.1.15",
|
|
70
70
|
"@types/babel__generator": "^7.6.3",
|
|
71
71
|
"@types/babel__traverse": "^7.14.2",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"@types/signale": "^1.4.2",
|
|
79
79
|
"commander": "^8.1.0",
|
|
80
80
|
"typescript": "^4",
|
|
81
|
-
"@modern-js/plugin-testing": "^1.0.0-rc.
|
|
82
|
-
"@modern-js/module-tools": "^1.0.0-rc.
|
|
81
|
+
"@modern-js/plugin-testing": "^1.0.0-rc.3",
|
|
82
|
+
"@modern-js/module-tools": "^1.0.0-rc.3"
|
|
83
83
|
},
|
|
84
84
|
"sideEffects": false,
|
|
85
85
|
"modernConfig": {
|
|
@@ -87,6 +87,10 @@
|
|
|
87
87
|
"packageMode": "node-js"
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
|
+
"publicCnfig": {
|
|
91
|
+
"registry": "https://registry.npmjs.org/",
|
|
92
|
+
"access": "public"
|
|
93
|
+
},
|
|
90
94
|
"scripts": {
|
|
91
95
|
"new": "modern new",
|
|
92
96
|
"build": "modern build",
|
package/src/utils/copy.ts
CHANGED
|
@@ -17,8 +17,9 @@ export const copyTask = async (option: {
|
|
|
17
17
|
const { modernConfig, appContext } = option;
|
|
18
18
|
const { appDirectory } = appContext;
|
|
19
19
|
const {
|
|
20
|
-
output: { copy, path: outputPath = 'dist' },
|
|
20
|
+
output: { copy, path: outputPath = 'dist', jsPath = 'js' },
|
|
21
21
|
} = modernConfig;
|
|
22
|
+
const copyDistDir = path.join(outputPath, jsPath);
|
|
22
23
|
|
|
23
24
|
if (!copy) {
|
|
24
25
|
return;
|
|
@@ -60,7 +61,7 @@ export const copyTask = async (option: {
|
|
|
60
61
|
const relativeFrom = path.relative(context, item);
|
|
61
62
|
// 如果 to 是目录,通过相对路径计算完整的产物路径;如果 to 是文件,直接作为最终产物路径
|
|
62
63
|
const fileName = isToDirectory ? path.join(to, relativeFrom) : to;
|
|
63
|
-
const finalToPath = path.resolve(
|
|
64
|
+
const finalToPath = path.resolve(copyDistDir, fileName);
|
|
64
65
|
fs.copySync(item, finalToPath);
|
|
65
66
|
});
|
|
66
67
|
}
|