@modern-js/babel-compiler 1.2.3 → 1.2.6
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 +27 -0
- package/dist/js/modern/buildWatch.js +6 -5
- package/dist/js/modern/compilerErrorResult.js +4 -1
- package/dist/js/node/buildWatch.js +6 -5
- package/dist/js/node/compilerErrorResult.js +4 -1
- package/package.json +32 -9
- package/.eslintrc.js +0 -8
- package/jest.config.js +0 -7
- package/modern.config.js +0 -6
- package/tsconfig.json +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @modern-js/babel-compiler
|
|
2
2
|
|
|
3
|
+
## 1.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a1198d509: feat: bump babel 7.18.0
|
|
8
|
+
|
|
9
|
+
## 1.2.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
|
|
14
|
+
- Updated dependencies [d32f35134]
|
|
15
|
+
- Updated dependencies [6ae4a34ae]
|
|
16
|
+
- Updated dependencies [b80229c79]
|
|
17
|
+
- Updated dependencies [948cc4436]
|
|
18
|
+
- @modern-js/utils@1.7.3
|
|
19
|
+
|
|
20
|
+
## 1.2.4
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 0e0537005: fix: unlock @babel/core version
|
|
25
|
+
- 69a728375: fix: remove exports.jsnext:source after publish
|
|
26
|
+
- Updated dependencies [cd7346b0d]
|
|
27
|
+
- Updated dependencies [69a728375]
|
|
28
|
+
- @modern-js/utils@1.7.2
|
|
29
|
+
|
|
3
30
|
## 1.2.3
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -17,7 +17,8 @@ export const BuildWatchEvent = {
|
|
|
17
17
|
export class BuildWatchEmitter extends Event.EventEmitter {
|
|
18
18
|
constructor(...args) {
|
|
19
19
|
super(...args);
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
_defineProperty(this, "_initFn", void 0);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
setInitFn(fn) {
|
|
@@ -42,16 +43,16 @@ export const runBuildWatch = async (option, babelConfig = {}, emitter) => {
|
|
|
42
43
|
quiet
|
|
43
44
|
} = option; // 第一次正常构建
|
|
44
45
|
|
|
45
|
-
const
|
|
46
|
+
const firstBuildResult = await build(option, babelConfig);
|
|
46
47
|
const {
|
|
47
48
|
code
|
|
48
|
-
} =
|
|
49
|
+
} = firstBuildResult;
|
|
49
50
|
|
|
50
51
|
if (code === 1) {
|
|
51
|
-
errorResult.init(
|
|
52
|
+
errorResult.init(firstBuildResult);
|
|
52
53
|
emitter.emit(BuildWatchEvent.firstCompiler, errorResult.value);
|
|
53
54
|
} else {
|
|
54
|
-
emitter.emit(BuildWatchEvent.firstCompiler,
|
|
55
|
+
emitter.emit(BuildWatchEvent.firstCompiler, firstBuildResult);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
return watch(`${watchDir}/**/*.{js,jsx,ts,tsx}`, async ({
|
|
@@ -1,6 +1,9 @@
|
|
|
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
|
export class CompilerErrorResult {
|
|
2
4
|
constructor(initErrorResult) {
|
|
3
|
-
this
|
|
5
|
+
_defineProperty(this, "_messageDetails", void 0);
|
|
6
|
+
|
|
4
7
|
this.init(initErrorResult);
|
|
5
8
|
}
|
|
6
9
|
|
|
@@ -35,7 +35,8 @@ exports.BuildWatchEvent = BuildWatchEvent;
|
|
|
35
35
|
class BuildWatchEmitter extends Event.EventEmitter {
|
|
36
36
|
constructor(...args) {
|
|
37
37
|
super(...args);
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
_defineProperty(this, "_initFn", void 0);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
setInitFn(fn) {
|
|
@@ -63,16 +64,16 @@ const runBuildWatch = async (option, babelConfig = {}, emitter) => {
|
|
|
63
64
|
quiet
|
|
64
65
|
} = option; // 第一次正常构建
|
|
65
66
|
|
|
66
|
-
const
|
|
67
|
+
const firstBuildResult = await (0, _build.build)(option, babelConfig);
|
|
67
68
|
const {
|
|
68
69
|
code
|
|
69
|
-
} =
|
|
70
|
+
} = firstBuildResult;
|
|
70
71
|
|
|
71
72
|
if (code === 1) {
|
|
72
|
-
errorResult.init(
|
|
73
|
+
errorResult.init(firstBuildResult);
|
|
73
74
|
emitter.emit(BuildWatchEvent.firstCompiler, errorResult.value);
|
|
74
75
|
} else {
|
|
75
|
-
emitter.emit(BuildWatchEvent.firstCompiler,
|
|
76
|
+
emitter.emit(BuildWatchEvent.firstCompiler, firstBuildResult);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
return (0, _utils.watch)(`${watchDir}/**/*.{js,jsx,ts,tsx}`, async ({
|
|
@@ -5,9 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.CompilerErrorResult = void 0;
|
|
7
7
|
|
|
8
|
+
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; }
|
|
9
|
+
|
|
8
10
|
class CompilerErrorResult {
|
|
9
11
|
constructor(initErrorResult) {
|
|
10
|
-
this
|
|
12
|
+
_defineProperty(this, "_messageDetails", void 0);
|
|
13
|
+
|
|
11
14
|
this.init(initErrorResult);
|
|
12
15
|
}
|
|
13
16
|
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.2.
|
|
14
|
+
"version": "1.2.6",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@babel/core": "7.
|
|
32
|
-
"@babel/runtime": "^7",
|
|
33
|
-
"@modern-js/utils": "^1.
|
|
31
|
+
"@babel/core": "^7.18.0",
|
|
32
|
+
"@babel/runtime": "^7.18.0",
|
|
33
|
+
"@modern-js/utils": "^1.7.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@babel/plugin-transform-classes": "^7.
|
|
37
|
-
"@babel/preset-typescript": "^7",
|
|
36
|
+
"@babel/plugin-transform-classes": "^7.18.0",
|
|
37
|
+
"@babel/preset-typescript": "^7.17.12",
|
|
38
38
|
"@types/babel__core": "^7.1.15",
|
|
39
39
|
"@types/glob": "^7.1.4",
|
|
40
|
-
"@types/jest": "^
|
|
40
|
+
"@types/jest": "^27",
|
|
41
41
|
"@types/node": "^14",
|
|
42
42
|
"typescript": "^4",
|
|
43
43
|
"@scripts/build": "0.0.0",
|
|
@@ -54,10 +54,33 @@
|
|
|
54
54
|
"registry": "https://registry.npmjs.org/",
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
+
"wireit": {
|
|
58
|
+
"build": {
|
|
59
|
+
"command": "modern build",
|
|
60
|
+
"files": [
|
|
61
|
+
"src/**/*",
|
|
62
|
+
"tsconfig.json",
|
|
63
|
+
"package.json"
|
|
64
|
+
],
|
|
65
|
+
"output": [
|
|
66
|
+
"dist/**/*"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"test": {
|
|
70
|
+
"command": "jest --passWithNoTests",
|
|
71
|
+
"files": [
|
|
72
|
+
"src/**/*",
|
|
73
|
+
"tsconfig.json",
|
|
74
|
+
"package.json",
|
|
75
|
+
"tests/**/*"
|
|
76
|
+
],
|
|
77
|
+
"output": []
|
|
78
|
+
}
|
|
79
|
+
},
|
|
57
80
|
"scripts": {
|
|
58
81
|
"new": "modern new",
|
|
59
|
-
"build": "
|
|
60
|
-
"test": "
|
|
82
|
+
"build": "wireit",
|
|
83
|
+
"test": "wireit"
|
|
61
84
|
},
|
|
62
85
|
"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"
|
|
63
86
|
}
|
package/.eslintrc.js
DELETED
package/jest.config.js
DELETED
package/modern.config.js
DELETED
package/tsconfig.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@modern-js/tsconfig/base",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"jsx": "preserve",
|
|
6
|
-
"baseUrl": "./",
|
|
7
|
-
"outDir": "./out",
|
|
8
|
-
"emitDeclarationOnly": true,
|
|
9
|
-
"isolatedModules": true,
|
|
10
|
-
"paths": {},
|
|
11
|
-
"types": ["node", "jest"]
|
|
12
|
-
},
|
|
13
|
-
"include": ["src"]
|
|
14
|
-
}
|