@dimina-kit/compiler 0.0.2-dev.20260728080958 → 0.0.2-dev.20260728110120

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.
Files changed (25) hide show
  1. package/dist/compile-core.browser.js +14975 -16294
  2. package/dist/compile-core.node-chunks/chunk-2VRS523Z.js +8 -0
  3. package/dist/compile-core.node-chunks/chunk-LUD2P6RM.js +211 -0
  4. package/dist/compile-core.node-chunks/{chunk-M62ZDT7T.js → chunk-QJ34C5KK.js} +66 -542
  5. package/dist/compile-core.node-chunks/{logic-compiler-AEZPY2MO.js → logic-compiler-2SQFOFEO.js} +113 -37
  6. package/dist/compile-core.node-chunks/style-compiler-ZEJ3XLTS.js +277 -0
  7. package/dist/compile-core.node-chunks/{view-compiler-2SMUHAPD.js → view-compiler-WQNV7H5G.js} +161 -425
  8. package/dist/compile-core.node.js +6 -11
  9. package/dist/pool.node-chunks/{chunk-CKQISGZS.js → chunk-7FGOYOXU.js} +66 -542
  10. package/dist/pool.node-chunks/chunk-C7GEIDCP.js +211 -0
  11. package/dist/pool.node-chunks/chunk-KLXXOLDF.js +8 -0
  12. package/dist/pool.node-chunks/{chunk-WX4462A5.js → chunk-PDHO4Y56.js} +6 -11
  13. package/dist/pool.node-chunks/{logic-compiler-P4T4OMTG.js → logic-compiler-BODAINZQ.js} +113 -37
  14. package/dist/pool.node-chunks/style-compiler-TUNDVSR5.js +277 -0
  15. package/dist/pool.node-chunks/{view-compiler-2D7HPYIN.js → view-compiler-HOFFL63K.js} +161 -425
  16. package/dist/pool.node.js +2 -2
  17. package/dist/stage-worker.browser.js +2156 -3475
  18. package/dist/stage-worker.node.js +2 -2
  19. package/package.json +4 -4
  20. package/dist/compile-core.node-chunks/chunk-23PCGQQU.js +0 -141
  21. package/dist/compile-core.node-chunks/chunk-QYHGF3MS.js +0 -1601
  22. package/dist/compile-core.node-chunks/style-compiler-4PHMBQIC.js +0 -470
  23. package/dist/pool.node-chunks/chunk-LGB3AH5C.js +0 -1601
  24. package/dist/pool.node-chunks/chunk-VHWKAXDL.js +0 -141
  25. package/dist/pool.node-chunks/style-compiler-W7EA2Y7R.js +0 -470
@@ -3,12 +3,12 @@ import {
3
3
  preloadStage,
4
4
  resetCompilerState,
5
5
  runStage
6
- } from "./pool.node-chunks/chunk-WX4462A5.js";
6
+ } from "./pool.node-chunks/chunk-PDHO4Y56.js";
7
7
  import {
8
8
  getAppId,
9
9
  getAppName,
10
10
  resetStoreInfo
11
- } from "./pool.node-chunks/chunk-CKQISGZS.js";
11
+ } from "./pool.node-chunks/chunk-7FGOYOXU.js";
12
12
 
13
13
  // src/stage-worker-node.js
14
14
  import { createRequire } from "node:module";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimina-kit/compiler",
3
- "version": "0.0.2-dev.20260728080958",
3
+ "version": "0.0.2-dev.20260728110120",
4
4
  "description": "dmcc compiler bundles (browser + node) that drive @dimina/compiler against a caller-injected node:fs replacement (no bundled fs)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -46,10 +46,10 @@
46
46
  "less": "^4.8.1",
47
47
  "magic-string": "^0.30.21",
48
48
  "memfs": "^4.57.8",
49
- "oxc-parser": "^0.140.0",
49
+ "oxc-parser": "^0.139.0",
50
50
  "oxc-walker": "^1.0.0",
51
51
  "path-browserify": "^1.0.1",
52
- "postcss": "^8.5.23",
52
+ "postcss": "^8.5.24",
53
53
  "postcss-selector-parser": "^7.1.4",
54
54
  "sass": "^1.102.0",
55
55
  "source-map-js": "^1.2.1",
@@ -57,7 +57,7 @@
57
57
  "util": "^0.12.5"
58
58
  },
59
59
  "peerDependencies": {
60
- "@oxc-parser/binding-wasm32-wasi": "^0.140.0",
60
+ "@oxc-parser/binding-wasm32-wasi": "^0.139.0",
61
61
  "esbuild-wasm": "^0.28.1"
62
62
  },
63
63
  "peerDependenciesMeta": {
@@ -1,141 +0,0 @@
1
- // src/shims/worker_threads.js
2
- var isMainThread = true;
3
- var parentPort = null;
4
-
5
- // ../../dimina/fe/packages/compiler/src/core/sourcemap.js
6
- import { SourceMapConsumer, SourceMapGenerator } from "source-map-js";
7
- function wrapModDefine(module) {
8
- const code = module.code.endsWith("\n") ? module.code : module.code + "\n";
9
- const extraLine = module.extraInfoCode || "";
10
- const header = `modDefine('${module.path}', function(require, module, exports) {
11
- ${extraLine}`;
12
- const footer = "});\n";
13
- return { header, code, footer };
14
- }
15
- function appendSourceMap(smg, map, lineOffset, columnOffset) {
16
- const mapObject = typeof map === "string" ? JSON.parse(map) : map;
17
- const consumer = new SourceMapConsumer(mapObject);
18
- consumer.eachMapping((mapping) => {
19
- if (mapping.source == null || mapping.originalLine == null || mapping.originalColumn == null) {
20
- return;
21
- }
22
- smg.addMapping({
23
- generated: {
24
- line: mapping.generatedLine + lineOffset,
25
- column: mapping.generatedColumn + (mapping.generatedLine === 1 ? columnOffset : 0)
26
- },
27
- original: {
28
- line: mapping.originalLine,
29
- column: mapping.originalColumn
30
- },
31
- source: mapping.source,
32
- name: mapping.name
33
- });
34
- });
35
- if (mapObject.sourcesContent) {
36
- mapObject.sources.forEach((source, index) => {
37
- smg.setSourceContent(source, mapObject.sourcesContent[index]);
38
- });
39
- }
40
- }
41
- function advanceGeneratedPosition(position, code) {
42
- const lines = code.split("\n");
43
- if (lines.length === 1) {
44
- position.column += code.length;
45
- return;
46
- }
47
- position.line += lines.length - 1;
48
- position.column = lines.at(-1).length;
49
- }
50
- function concatSourcemap(chunks, file = "") {
51
- const smg = new SourceMapGenerator({ file });
52
- const position = { line: 1, column: 0 };
53
- let code = "";
54
- for (const chunk of chunks) {
55
- const chunkCode = typeof chunk === "string" ? chunk : chunk.code;
56
- if (typeof chunk !== "string" && chunk.map) {
57
- appendSourceMap(smg, chunk.map, position.line - 1, position.column);
58
- }
59
- code += chunkCode;
60
- advanceGeneratedPosition(position, chunkCode);
61
- }
62
- return { code, sourcemap: smg.toString() };
63
- }
64
- function createLineSourcemap(generatedCode, source, sourceContent, startLine = 1) {
65
- const smg = new SourceMapGenerator({ file: source });
66
- const generatedLineCount = generatedCode.split("\n").length;
67
- const sourceLineCount = Math.max(1, sourceContent.split("\n").length);
68
- for (let line = 1; line <= generatedLineCount; line++) {
69
- smg.addMapping({
70
- generated: { line, column: 0 },
71
- original: {
72
- line: Math.min(sourceLineCount, startLine + line - 1),
73
- column: 0
74
- },
75
- source
76
- });
77
- }
78
- smg.setSourceContent(source, sourceContent);
79
- return JSON.parse(smg.toString());
80
- }
81
- function mergeSourcemap(compileRes, file = "logic.js") {
82
- const chunks = [];
83
- for (const module of compileRes) {
84
- const { header, code, footer } = wrapModDefine(module);
85
- chunks.push(header, { code, map: module.map }, footer);
86
- }
87
- const { code: bundleCode, sourcemap } = concatSourcemap(chunks, file);
88
- return { bundleCode, sourcemap };
89
- }
90
- function remapSourcemap(nextMap, prevMap) {
91
- if (!nextMap) {
92
- return prevMap;
93
- }
94
- if (!prevMap) {
95
- return nextMap;
96
- }
97
- const nextMapObj = typeof nextMap === "string" ? JSON.parse(nextMap) : nextMap;
98
- const prevMapObj = typeof prevMap === "string" ? JSON.parse(prevMap) : prevMap;
99
- const smg = new SourceMapGenerator({ file: nextMapObj.file || prevMapObj.file || "" });
100
- const prevSmc = new SourceMapConsumer(prevMapObj);
101
- const nextSmc = new SourceMapConsumer(nextMapObj);
102
- nextSmc.eachMapping((mapping) => {
103
- if (mapping.source == null || mapping.originalLine == null || mapping.originalColumn == null) {
104
- return;
105
- }
106
- const original = prevSmc.originalPositionFor({
107
- line: mapping.originalLine,
108
- column: mapping.originalColumn
109
- });
110
- if (original.source == null || original.line == null || original.column == null) {
111
- return;
112
- }
113
- smg.addMapping({
114
- generated: {
115
- line: mapping.generatedLine,
116
- column: mapping.generatedColumn
117
- },
118
- original: {
119
- line: original.line,
120
- column: original.column
121
- },
122
- source: original.source,
123
- name: original.name || mapping.name
124
- });
125
- });
126
- if (prevMapObj.sourcesContent) {
127
- prevMapObj.sources.forEach((src, i) => {
128
- smg.setSourceContent(src, prevMapObj.sourcesContent[i]);
129
- });
130
- }
131
- return smg.toString();
132
- }
133
-
134
- export {
135
- isMainThread,
136
- parentPort,
137
- concatSourcemap,
138
- createLineSourcemap,
139
- mergeSourcemap,
140
- remapSourcemap
141
- };