@modern-js/babel-compiler 2.48.0 → 2.48.2
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/dist/cjs/buildWatch.js
CHANGED
|
@@ -34,7 +34,6 @@ __export(buildWatch_exports, {
|
|
|
34
34
|
runBuildWatch: () => runBuildWatch
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(buildWatch_exports);
|
|
37
|
-
var import_define_property = require("@swc/helpers/_/_define_property");
|
|
38
37
|
var path = __toESM(require("path"));
|
|
39
38
|
var Event = __toESM(require("events"));
|
|
40
39
|
var import_utils = require("@modern-js/utils");
|
|
@@ -55,10 +54,6 @@ class BuildWatchEmitter extends Event.EventEmitter {
|
|
|
55
54
|
}
|
|
56
55
|
return null;
|
|
57
56
|
}
|
|
58
|
-
constructor(...args) {
|
|
59
|
-
super(...args);
|
|
60
|
-
(0, import_define_property._)(this, "_initFn", void 0);
|
|
61
|
-
}
|
|
62
57
|
}
|
|
63
58
|
const runBuildWatch = async (option, babelConfig = {}, emitter) => {
|
|
64
59
|
emitter.emit(BuildWatchEvent.compiling);
|
|
@@ -21,7 +21,6 @@ __export(compilerErrorResult_exports, {
|
|
|
21
21
|
CompilerErrorResult: () => CompilerErrorResult
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(compilerErrorResult_exports);
|
|
24
|
-
var import_define_property = require("@swc/helpers/_/_define_property");
|
|
25
24
|
class CompilerErrorResult {
|
|
26
25
|
init(initErrorResult) {
|
|
27
26
|
this._messageDetails = (initErrorResult === null || initErrorResult === void 0 ? void 0 : initErrorResult.messageDetails) || [];
|
|
@@ -55,7 +54,6 @@ class CompilerErrorResult {
|
|
|
55
54
|
return this._messageDetails.length > 0;
|
|
56
55
|
}
|
|
57
56
|
constructor(initErrorResult) {
|
|
58
|
-
(0, import_define_property._)(this, "_messageDetails", void 0);
|
|
59
57
|
this.init(initErrorResult);
|
|
60
58
|
}
|
|
61
59
|
}
|
package/dist/esm/buildWatch.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { _ as _assert_this_initialized } from "@swc/helpers/_/_assert_this_initialized";
|
|
2
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
3
2
|
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
|
|
4
|
-
import { _ as _create_class } from "@swc/helpers/_/_create_class";
|
|
5
|
-
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
6
3
|
import { _ as _inherits } from "@swc/helpers/_/_inherits";
|
|
7
4
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
8
5
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
@@ -24,39 +21,29 @@ var BuildWatchEmitter = /* @__PURE__ */ function(_Event_EventEmitter) {
|
|
|
24
21
|
var _super = _create_super(BuildWatchEmitter2);
|
|
25
22
|
function BuildWatchEmitter2() {
|
|
26
23
|
_class_call_check(this, BuildWatchEmitter2);
|
|
27
|
-
|
|
28
|
-
_this = _super.apply(this, arguments);
|
|
29
|
-
_define_property(_assert_this_initialized(_this), "_initFn", void 0);
|
|
30
|
-
return _this;
|
|
24
|
+
return _super.apply(this, arguments);
|
|
31
25
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
null
|
|
54
|
-
];
|
|
55
|
-
});
|
|
56
|
-
})();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
]);
|
|
26
|
+
var _proto = BuildWatchEmitter2.prototype;
|
|
27
|
+
_proto.setInitFn = function setInitFn(fn) {
|
|
28
|
+
this._initFn = fn;
|
|
29
|
+
};
|
|
30
|
+
_proto.watch = function watch2() {
|
|
31
|
+
var _this = this;
|
|
32
|
+
return _async_to_generator(function() {
|
|
33
|
+
return _ts_generator(this, function(_state) {
|
|
34
|
+
if (typeof _this._initFn === "function") {
|
|
35
|
+
return [
|
|
36
|
+
2,
|
|
37
|
+
_this._initFn(_this)
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
2,
|
|
42
|
+
null
|
|
43
|
+
];
|
|
44
|
+
});
|
|
45
|
+
})();
|
|
46
|
+
};
|
|
60
47
|
return BuildWatchEmitter2;
|
|
61
48
|
}(Event.EventEmitter);
|
|
62
49
|
var runBuildWatch = function() {
|
|
@@ -1,64 +1,57 @@
|
|
|
1
1
|
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
|
|
2
2
|
import { _ as _create_class } from "@swc/helpers/_/_create_class";
|
|
3
|
-
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
4
3
|
var CompilerErrorResult = /* @__PURE__ */ function() {
|
|
5
4
|
"use strict";
|
|
6
5
|
function CompilerErrorResult2(initErrorResult) {
|
|
7
6
|
_class_call_check(this, CompilerErrorResult2);
|
|
8
|
-
_define_property(this, "_messageDetails", void 0);
|
|
9
7
|
this.init(initErrorResult);
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var messageDetail = _step.value;
|
|
25
|
-
var addError = !_this._messageDetails.some(function(detail) {
|
|
26
|
-
if (detail.filename === messageDetail.filename) {
|
|
27
|
-
detail.content = messageDetail.content;
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
return false;
|
|
31
|
-
});
|
|
32
|
-
if (addError) {
|
|
33
|
-
_this._messageDetails.push(messageDetail);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
for (var _iterator = messageDetails[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)
|
|
37
|
-
_loop();
|
|
38
|
-
} catch (err) {
|
|
39
|
-
_didIteratorError = true;
|
|
40
|
-
_iteratorError = err;
|
|
41
|
-
} finally {
|
|
42
|
-
try {
|
|
43
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
44
|
-
_iterator.return();
|
|
45
|
-
}
|
|
46
|
-
} finally {
|
|
47
|
-
if (_didIteratorError) {
|
|
48
|
-
throw _iteratorError;
|
|
49
|
-
}
|
|
9
|
+
var _proto = CompilerErrorResult2.prototype;
|
|
10
|
+
_proto.init = function init(initErrorResult) {
|
|
11
|
+
this._messageDetails = (initErrorResult === null || initErrorResult === void 0 ? void 0 : initErrorResult.messageDetails) || [];
|
|
12
|
+
};
|
|
13
|
+
_proto.update = function update(messageDetails) {
|
|
14
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
15
|
+
try {
|
|
16
|
+
var _this = this, _loop = function() {
|
|
17
|
+
var messageDetail = _step.value;
|
|
18
|
+
var addError = !_this._messageDetails.some(function(detail) {
|
|
19
|
+
if (detail.filename === messageDetail.filename) {
|
|
20
|
+
detail.content = messageDetail.content;
|
|
21
|
+
return true;
|
|
50
22
|
}
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
key: "removeByFileName",
|
|
56
|
-
value: function removeByFileName(filename) {
|
|
57
|
-
this._messageDetails = this._messageDetails.filter(function(detail) {
|
|
58
|
-
return detail.filename !== filename;
|
|
23
|
+
return false;
|
|
59
24
|
});
|
|
25
|
+
if (addError) {
|
|
26
|
+
_this._messageDetails.push(messageDetail);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
for (var _iterator = messageDetails[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)
|
|
30
|
+
_loop();
|
|
31
|
+
} catch (err) {
|
|
32
|
+
_didIteratorError = true;
|
|
33
|
+
_iteratorError = err;
|
|
34
|
+
} finally {
|
|
35
|
+
try {
|
|
36
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
37
|
+
_iterator.return();
|
|
38
|
+
}
|
|
39
|
+
} finally {
|
|
40
|
+
if (_didIteratorError) {
|
|
41
|
+
throw _iteratorError;
|
|
42
|
+
}
|
|
60
43
|
}
|
|
61
|
-
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
_proto.removeByFileName = function removeByFileName(filename) {
|
|
47
|
+
this._messageDetails = this._messageDetails.filter(function(detail) {
|
|
48
|
+
return detail.filename !== filename;
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
_proto.checkExistError = function checkExistError() {
|
|
52
|
+
return this._messageDetails.length > 0;
|
|
53
|
+
};
|
|
54
|
+
_create_class(CompilerErrorResult2, [
|
|
62
55
|
{
|
|
63
56
|
key: "value",
|
|
64
57
|
get: function get() {
|
|
@@ -69,12 +62,6 @@ var CompilerErrorResult = /* @__PURE__ */ function() {
|
|
|
69
62
|
messageDetails: this._messageDetails
|
|
70
63
|
};
|
|
71
64
|
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
key: "checkExistError",
|
|
75
|
-
value: function checkExistError() {
|
|
76
|
-
return this._messageDetails.length > 0;
|
|
77
|
-
}
|
|
78
65
|
}
|
|
79
66
|
]);
|
|
80
67
|
return CompilerErrorResult2;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
1
|
import * as path from "path";
|
|
3
2
|
import * as Event from "events";
|
|
4
3
|
import { logger, watch, WatchChangeType } from "@modern-js/utils";
|
|
@@ -19,10 +18,6 @@ class BuildWatchEmitter extends Event.EventEmitter {
|
|
|
19
18
|
}
|
|
20
19
|
return null;
|
|
21
20
|
}
|
|
22
|
-
constructor(...args) {
|
|
23
|
-
super(...args);
|
|
24
|
-
_define_property(this, "_initFn", void 0);
|
|
25
|
-
}
|
|
26
21
|
}
|
|
27
22
|
const runBuildWatch = async (option, babelConfig = {}, emitter) => {
|
|
28
23
|
emitter.emit(BuildWatchEvent.compiling);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
1
|
class CompilerErrorResult {
|
|
3
2
|
init(initErrorResult) {
|
|
4
3
|
this._messageDetails = (initErrorResult === null || initErrorResult === void 0 ? void 0 : initErrorResult.messageDetails) || [];
|
|
@@ -32,7 +31,6 @@ class CompilerErrorResult {
|
|
|
32
31
|
return this._messageDetails.length > 0;
|
|
33
32
|
}
|
|
34
33
|
constructor(initErrorResult) {
|
|
35
|
-
_define_property(this, "_messageDetails", void 0);
|
|
36
34
|
this.init(initErrorResult);
|
|
37
35
|
}
|
|
38
36
|
}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.48.
|
|
18
|
+
"version": "2.48.2",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/core": "^7.23.2",
|
|
35
35
|
"@swc/helpers": "0.5.3",
|
|
36
|
-
"@modern-js/utils": "2.48.
|
|
36
|
+
"@modern-js/utils": "2.48.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@babel/plugin-transform-classes": "^7.22.15",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@types/node": "^14",
|
|
45
45
|
"typescript": "^5",
|
|
46
46
|
"jest": "^29",
|
|
47
|
-
"@scripts/
|
|
48
|
-
"@scripts/
|
|
47
|
+
"@scripts/jest-config": "2.48.2",
|
|
48
|
+
"@scripts/build": "2.48.2"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false,
|
|
51
51
|
"publishConfig": {
|