@dimina/compiler 1.0.12-beta.6 → 1.0.12-beta.8
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/bin/index.cjs +1 -1
- package/dist/bin/index.js +1 -1
- package/dist/core/logic-compiler.cjs +12 -7
- package/dist/core/logic-compiler.js +12 -7
- package/dist/core/style-compiler.cjs +2 -0
- package/dist/core/style-compiler.js +2 -0
- package/dist/core/view-compiler.cjs +7253 -73
- package/dist/core/view-compiler.js +7253 -73
- package/dist/index.cjs +9 -6
- package/dist/index.js +9 -6
- package/package.json +6 -6
package/dist/bin/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const process = require("node:process");
|
|
|
5
5
|
const chokidar = require("chokidar");
|
|
6
6
|
const commander = require("commander");
|
|
7
7
|
const index = require("../index.cjs");
|
|
8
|
-
const version = "1.0.12-beta.
|
|
8
|
+
const version = "1.0.12-beta.8";
|
|
9
9
|
const pack = {
|
|
10
10
|
version
|
|
11
11
|
};
|
package/dist/bin/index.js
CHANGED
|
@@ -11,6 +11,15 @@ const ts = require("typescript");
|
|
|
11
11
|
const transformModulesCommonjs = require("@babel/plugin-transform-modules-commonjs");
|
|
12
12
|
const env = require("../env-Cmen1qwy.cjs");
|
|
13
13
|
const traverse = _traverse.default ? _traverse.default : _traverse;
|
|
14
|
+
const BABEL_TRANSFORM_CONFIG = {
|
|
15
|
+
comments: false,
|
|
16
|
+
configFile: false,
|
|
17
|
+
babelrc: false,
|
|
18
|
+
plugins: [
|
|
19
|
+
// 将 ES6 import/export 转换为 CommonJS
|
|
20
|
+
transformModulesCommonjs
|
|
21
|
+
]
|
|
22
|
+
};
|
|
14
23
|
const processedModules = /* @__PURE__ */ new Set();
|
|
15
24
|
if (!node_worker_threads.isMainThread) {
|
|
16
25
|
node_worker_threads.parentPort.on("message", async ({ pages, storeInfo }) => {
|
|
@@ -42,8 +51,10 @@ ${error.stack}`);
|
|
|
42
51
|
}
|
|
43
52
|
}
|
|
44
53
|
await writeCompileRes(mainCompileRes, null);
|
|
54
|
+
processedModules.clear();
|
|
45
55
|
node_worker_threads.parentPort.postMessage({ success: true });
|
|
46
56
|
} catch (error) {
|
|
57
|
+
processedModules.clear();
|
|
47
58
|
node_worker_threads.parentPort.postMessage({
|
|
48
59
|
success: false,
|
|
49
60
|
error: {
|
|
@@ -237,13 +248,7 @@ function buildJSByPath(packageName, module2, compileRes, mainCompileRes, addExtr
|
|
|
237
248
|
}
|
|
238
249
|
}
|
|
239
250
|
});
|
|
240
|
-
const { code } = babel.transformFromAstSync(ast, "",
|
|
241
|
-
comments: false,
|
|
242
|
-
plugins: [
|
|
243
|
-
// 将 ES6 import/export 转换为 CommonJS
|
|
244
|
-
transformModulesCommonjs
|
|
245
|
-
]
|
|
246
|
-
});
|
|
251
|
+
const { code } = babel.transformFromAstSync(ast, "", BABEL_TRANSFORM_CONFIG);
|
|
247
252
|
compileInfo.code = code;
|
|
248
253
|
processedModules.add(packageName + currentPath);
|
|
249
254
|
}
|
|
@@ -9,6 +9,15 @@ import ts from "typescript";
|
|
|
9
9
|
import transformModulesCommonjs from "@babel/plugin-transform-modules-commonjs";
|
|
10
10
|
import { r as resetStoreInfo, g as getTargetPath, i as hasCompileInfo, b as getContentByPath, j as getAppConfigInfo, a as getComponent, d as getWorkPath } from "../env-Csj3AHY4.js";
|
|
11
11
|
const traverse = _traverse.default ? _traverse.default : _traverse;
|
|
12
|
+
const BABEL_TRANSFORM_CONFIG = {
|
|
13
|
+
comments: false,
|
|
14
|
+
configFile: false,
|
|
15
|
+
babelrc: false,
|
|
16
|
+
plugins: [
|
|
17
|
+
// 将 ES6 import/export 转换为 CommonJS
|
|
18
|
+
transformModulesCommonjs
|
|
19
|
+
]
|
|
20
|
+
};
|
|
12
21
|
const processedModules = /* @__PURE__ */ new Set();
|
|
13
22
|
if (!isMainThread) {
|
|
14
23
|
parentPort.on("message", async ({ pages, storeInfo }) => {
|
|
@@ -40,8 +49,10 @@ ${error.stack}`);
|
|
|
40
49
|
}
|
|
41
50
|
}
|
|
42
51
|
await writeCompileRes(mainCompileRes, null);
|
|
52
|
+
processedModules.clear();
|
|
43
53
|
parentPort.postMessage({ success: true });
|
|
44
54
|
} catch (error) {
|
|
55
|
+
processedModules.clear();
|
|
45
56
|
parentPort.postMessage({
|
|
46
57
|
success: false,
|
|
47
58
|
error: {
|
|
@@ -235,13 +246,7 @@ function buildJSByPath(packageName, module, compileRes, mainCompileRes, addExtra
|
|
|
235
246
|
}
|
|
236
247
|
}
|
|
237
248
|
});
|
|
238
|
-
const { code } = babel.transformFromAstSync(ast, "",
|
|
239
|
-
comments: false,
|
|
240
|
-
plugins: [
|
|
241
|
-
// 将 ES6 import/export 转换为 CommonJS
|
|
242
|
-
transformModulesCommonjs
|
|
243
|
-
]
|
|
244
|
-
});
|
|
249
|
+
const { code } = babel.transformFromAstSync(ast, "", BABEL_TRANSFORM_CONFIG);
|
|
245
250
|
compileInfo.code = code;
|
|
246
251
|
processedModules.add(packageName + currentPath);
|
|
247
252
|
}
|
|
@@ -48,8 +48,10 @@ if (!node_worker_threads.isMainThread) {
|
|
|
48
48
|
for (const [root, subPages] of Object.entries(pages.subPages)) {
|
|
49
49
|
await compileSS(subPages.info, root, progress);
|
|
50
50
|
}
|
|
51
|
+
compileRes.clear();
|
|
51
52
|
node_worker_threads.parentPort.postMessage({ success: true });
|
|
52
53
|
} catch (error) {
|
|
54
|
+
compileRes.clear();
|
|
53
55
|
node_worker_threads.parentPort.postMessage({
|
|
54
56
|
success: false,
|
|
55
57
|
error: {
|
|
@@ -29,8 +29,10 @@ if (!isMainThread) {
|
|
|
29
29
|
for (const [root, subPages] of Object.entries(pages.subPages)) {
|
|
30
30
|
await compileSS(subPages.info, root, progress);
|
|
31
31
|
}
|
|
32
|
+
compileRes.clear();
|
|
32
33
|
parentPort.postMessage({ success: true });
|
|
33
34
|
} catch (error) {
|
|
35
|
+
compileRes.clear();
|
|
34
36
|
parentPort.postMessage({
|
|
35
37
|
success: false,
|
|
36
38
|
error: {
|