@dimina-kit/compiler 0.0.2-dev.20260718085557 → 0.0.2-dev.20260718143821

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.
@@ -3,12 +3,12 @@ import {
3
3
  preloadStage,
4
4
  resetCompilerState,
5
5
  runStage
6
- } from "./pool.node-chunks/chunk-LVUKEB4F.js";
6
+ } from "./pool.node-chunks/chunk-LKL7FBHG.js";
7
7
  import {
8
8
  getAppId,
9
9
  getAppName,
10
10
  resetStoreInfo
11
- } from "./pool.node-chunks/chunk-QLBB5HQB.js";
11
+ } from "./pool.node-chunks/chunk-7F3E2G42.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.20260718085557",
3
+ "version": "0.0.2-dev.20260718143821",
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",
@@ -35,7 +35,7 @@
35
35
  "@babel/parser": "^7.29.7",
36
36
  "@vue/compiler-sfc": "^3.5.39",
37
37
  "assert": "^2.1.0",
38
- "autoprefixer": "^10.5.2",
38
+ "autoprefixer": "^10.5.3",
39
39
  "buffer": "^6.0.3",
40
40
  "cheerio": "^1.2.0",
41
41
  "cssnano": "^8.0.2",
@@ -46,10 +46,10 @@
46
46
  "less": "^4.6.7",
47
47
  "magic-string": "^0.30.21",
48
48
  "memfs": "^4.57.8",
49
- "oxc-parser": "^0.137.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.15",
52
+ "postcss": "^8.5.19",
53
53
  "postcss-selector-parser": "^7.1.4",
54
54
  "sass": "^1.101.0",
55
55
  "source-map-js": "^1.2.1",
@@ -57,8 +57,8 @@
57
57
  "util": "^0.12.5"
58
58
  },
59
59
  "peerDependencies": {
60
- "@oxc-parser/binding-wasm32-wasi": "^0.137.0",
61
- "esbuild-wasm": "^0.28.0"
60
+ "@oxc-parser/binding-wasm32-wasi": "^0.139.0",
61
+ "esbuild-wasm": "^0.28.1"
62
62
  },
63
63
  "peerDependenciesMeta": {
64
64
  "@oxc-parser/binding-wasm32-wasi": {
@@ -69,7 +69,7 @@
69
69
  }
70
70
  },
71
71
  "devDependencies": {
72
- "esbuild-wasm": "^0.28.0"
72
+ "esbuild-wasm": "^0.28.1"
73
73
  },
74
74
  "scripts": {
75
75
  "build:node": "node scripts/build-compiler.js node",
@@ -1,211 +0,0 @@
1
- import {
2
- getViewScriptTags
3
- } from "./chunk-O5CWW2ZX.js";
4
-
5
- // ../../dimina/fe/packages/compiler/src/common/compatibility.js
6
- import { Parser } from "htmlparser2";
7
-
8
- // ../../dimina/fe/packages/compiler/src/common/compatibility-reference.js
9
- var supportedBuiltinComponents = [
10
- "block",
11
- "button",
12
- "canvas",
13
- "checkbox",
14
- "checkbox-group",
15
- "cover-image",
16
- "cover-view",
17
- "form",
18
- "icon",
19
- "image",
20
- "input",
21
- "label",
22
- "movable-area",
23
- "movable-view",
24
- "navigation-bar",
25
- "navigator",
26
- "picker",
27
- "picker-view",
28
- "picker-view-column",
29
- "progress",
30
- "radio",
31
- "radio-group",
32
- "rich-text",
33
- "scroll-view",
34
- "slider",
35
- "slot",
36
- "swiper",
37
- "swiper-item",
38
- "switch",
39
- "template",
40
- "text",
41
- "textarea",
42
- "video",
43
- "view",
44
- "web-view",
45
- "wxs",
46
- "include",
47
- "import"
48
- ];
49
- var supportedWxApis = [
50
- "env",
51
- "canIUse",
52
- "getUpdateManager",
53
- "openSystemBluetoothSetting",
54
- "getWindowInfo",
55
- "getSystemSetting",
56
- "getSystemInfoSync",
57
- "getSystemInfoAsync",
58
- "getSystemInfo",
59
- "reLaunch",
60
- "redirectTo",
61
- "navigateTo",
62
- "navigateBack",
63
- "showToast",
64
- "showModal",
65
- "showLoading",
66
- "showActionSheet",
67
- "hideToast",
68
- "hideLoading",
69
- "setNavigationBarTitle",
70
- "setNavigationBarColor",
71
- "pageScrollTo",
72
- "getMenuButtonBoundingClientRect",
73
- "createAnimation",
74
- "createCanvasContext",
75
- "createOffscreenCanvas",
76
- "canvasToTempFilePath",
77
- "createSelectorQuery",
78
- "createIntersectionObserver",
79
- "request",
80
- "downloadFile",
81
- "uploadFile",
82
- "setStorageSync",
83
- "getStorageSync",
84
- "removeStorageSync",
85
- "clearStorageSync",
86
- "setStorage",
87
- "getStorage",
88
- "removeStorage",
89
- "clearStorage",
90
- "getStorageInfoSync",
91
- "getStorageInfo",
92
- "saveImageToPhotosAlbum",
93
- "previewImage",
94
- "compressImage",
95
- "chooseImage",
96
- "chooseMedia",
97
- "chooseContact",
98
- "addPhoneContact",
99
- "setClipboardData",
100
- "getClipboardData",
101
- "vibrateShort",
102
- "vibrateLong",
103
- "hideKeyboard",
104
- "getNetworkType",
105
- "makePhoneCall",
106
- "extBridge",
107
- "extOnBridge",
108
- "extOffBridge"
109
- ];
110
-
111
- // ../../dimina/fe/packages/compiler/src/common/compatibility.js
112
- var cachedReference = null;
113
- var warnedItems = /* @__PURE__ */ new Set();
114
- function loadReference() {
115
- if (cachedReference) {
116
- return cachedReference;
117
- }
118
- cachedReference = {
119
- supportedBuiltinComponents: new Set(supportedBuiltinComponents),
120
- supportedWxApis: new Set(supportedWxApis)
121
- };
122
- return cachedReference;
123
- }
124
- function getWxMemberName(node) {
125
- if (node?.type !== "MemberExpression") {
126
- return null;
127
- }
128
- if (node.object?.type !== "Identifier" || node.object.name !== "wx") {
129
- return null;
130
- }
131
- if (!node.computed && node.property?.type === "Identifier") {
132
- return node.property.name;
133
- }
134
- if (node.computed && (node.property?.type === "StringLiteral" || node.property?.type === "Literal") && typeof node.property.value === "string") {
135
- return node.property.value;
136
- }
137
- return null;
138
- }
139
- function warnUnsupportedWxApi(apiName, filePath, line) {
140
- const { supportedWxApis: supportedWxApis2 } = loadReference();
141
- if (!apiName || supportedWxApis2.has(apiName)) {
142
- return;
143
- }
144
- const location = formatLocation(filePath, line);
145
- warnOnce("api", apiName, location, `[compat] Unsupported wx API: wx.${apiName}${location}`);
146
- }
147
- function warnUnsupportedComponent(tagName, filePath, line) {
148
- const { supportedBuiltinComponents: supportedBuiltinComponents2 } = loadReference();
149
- if (!tagName || supportedBuiltinComponents2.has(tagName) || getViewScriptTags().includes(tagName)) {
150
- return;
151
- }
152
- const location = formatLocation(filePath, line);
153
- warnOnce("component", tagName, location, `[compat] Unsupported or undeclared component: <${tagName}>${location}`);
154
- }
155
- function checkTemplateCompatibility(content, filePath, components = {}) {
156
- let parser;
157
- parser = new Parser(
158
- {
159
- onopentag(tagName) {
160
- if (components?.[tagName]) {
161
- return;
162
- }
163
- const line = getLineByIndex(content, parser.startIndex);
164
- warnUnsupportedComponent(tagName, filePath, line);
165
- },
166
- onerror(error) {
167
- console.warn("[compat]", `Failed to parse template for compatibility diagnostics: ${filePath}`, error.message);
168
- }
169
- },
170
- {
171
- xmlMode: true,
172
- lowerCaseTags: false,
173
- lowerCaseAttributeNames: false,
174
- withStartIndices: true
175
- }
176
- );
177
- parser.write(content);
178
- parser.end();
179
- }
180
- function getLineByIndex(content, index) {
181
- if (typeof index !== "number" || index < 0) {
182
- return null;
183
- }
184
- let line = 1;
185
- for (let i = 0; i < index; i++) {
186
- if (content.charCodeAt(i) === 10) {
187
- line++;
188
- }
189
- }
190
- return line;
191
- }
192
- function formatLocation(filePath, line) {
193
- if (!filePath) {
194
- return "";
195
- }
196
- return line ? ` (${filePath}:${line})` : ` (${filePath})`;
197
- }
198
- function warnOnce(type, name, location, message) {
199
- const key = `${type}:${name}:${location}`;
200
- if (warnedItems.has(key)) {
201
- return;
202
- }
203
- warnedItems.add(key);
204
- console.warn(message);
205
- }
206
-
207
- export {
208
- getWxMemberName,
209
- warnUnsupportedWxApi,
210
- checkTemplateCompatibility
211
- };
@@ -1,211 +0,0 @@
1
- import {
2
- getViewScriptTags
3
- } from "./chunk-QLBB5HQB.js";
4
-
5
- // ../../dimina/fe/packages/compiler/src/common/compatibility.js
6
- import { Parser } from "htmlparser2";
7
-
8
- // ../../dimina/fe/packages/compiler/src/common/compatibility-reference.js
9
- var supportedBuiltinComponents = [
10
- "block",
11
- "button",
12
- "canvas",
13
- "checkbox",
14
- "checkbox-group",
15
- "cover-image",
16
- "cover-view",
17
- "form",
18
- "icon",
19
- "image",
20
- "input",
21
- "label",
22
- "movable-area",
23
- "movable-view",
24
- "navigation-bar",
25
- "navigator",
26
- "picker",
27
- "picker-view",
28
- "picker-view-column",
29
- "progress",
30
- "radio",
31
- "radio-group",
32
- "rich-text",
33
- "scroll-view",
34
- "slider",
35
- "slot",
36
- "swiper",
37
- "swiper-item",
38
- "switch",
39
- "template",
40
- "text",
41
- "textarea",
42
- "video",
43
- "view",
44
- "web-view",
45
- "wxs",
46
- "include",
47
- "import"
48
- ];
49
- var supportedWxApis = [
50
- "env",
51
- "canIUse",
52
- "getUpdateManager",
53
- "openSystemBluetoothSetting",
54
- "getWindowInfo",
55
- "getSystemSetting",
56
- "getSystemInfoSync",
57
- "getSystemInfoAsync",
58
- "getSystemInfo",
59
- "reLaunch",
60
- "redirectTo",
61
- "navigateTo",
62
- "navigateBack",
63
- "showToast",
64
- "showModal",
65
- "showLoading",
66
- "showActionSheet",
67
- "hideToast",
68
- "hideLoading",
69
- "setNavigationBarTitle",
70
- "setNavigationBarColor",
71
- "pageScrollTo",
72
- "getMenuButtonBoundingClientRect",
73
- "createAnimation",
74
- "createCanvasContext",
75
- "createOffscreenCanvas",
76
- "canvasToTempFilePath",
77
- "createSelectorQuery",
78
- "createIntersectionObserver",
79
- "request",
80
- "downloadFile",
81
- "uploadFile",
82
- "setStorageSync",
83
- "getStorageSync",
84
- "removeStorageSync",
85
- "clearStorageSync",
86
- "setStorage",
87
- "getStorage",
88
- "removeStorage",
89
- "clearStorage",
90
- "getStorageInfoSync",
91
- "getStorageInfo",
92
- "saveImageToPhotosAlbum",
93
- "previewImage",
94
- "compressImage",
95
- "chooseImage",
96
- "chooseMedia",
97
- "chooseContact",
98
- "addPhoneContact",
99
- "setClipboardData",
100
- "getClipboardData",
101
- "vibrateShort",
102
- "vibrateLong",
103
- "hideKeyboard",
104
- "getNetworkType",
105
- "makePhoneCall",
106
- "extBridge",
107
- "extOnBridge",
108
- "extOffBridge"
109
- ];
110
-
111
- // ../../dimina/fe/packages/compiler/src/common/compatibility.js
112
- var cachedReference = null;
113
- var warnedItems = /* @__PURE__ */ new Set();
114
- function loadReference() {
115
- if (cachedReference) {
116
- return cachedReference;
117
- }
118
- cachedReference = {
119
- supportedBuiltinComponents: new Set(supportedBuiltinComponents),
120
- supportedWxApis: new Set(supportedWxApis)
121
- };
122
- return cachedReference;
123
- }
124
- function getWxMemberName(node) {
125
- if (node?.type !== "MemberExpression") {
126
- return null;
127
- }
128
- if (node.object?.type !== "Identifier" || node.object.name !== "wx") {
129
- return null;
130
- }
131
- if (!node.computed && node.property?.type === "Identifier") {
132
- return node.property.name;
133
- }
134
- if (node.computed && (node.property?.type === "StringLiteral" || node.property?.type === "Literal") && typeof node.property.value === "string") {
135
- return node.property.value;
136
- }
137
- return null;
138
- }
139
- function warnUnsupportedWxApi(apiName, filePath, line) {
140
- const { supportedWxApis: supportedWxApis2 } = loadReference();
141
- if (!apiName || supportedWxApis2.has(apiName)) {
142
- return;
143
- }
144
- const location = formatLocation(filePath, line);
145
- warnOnce("api", apiName, location, `[compat] Unsupported wx API: wx.${apiName}${location}`);
146
- }
147
- function warnUnsupportedComponent(tagName, filePath, line) {
148
- const { supportedBuiltinComponents: supportedBuiltinComponents2 } = loadReference();
149
- if (!tagName || supportedBuiltinComponents2.has(tagName) || getViewScriptTags().includes(tagName)) {
150
- return;
151
- }
152
- const location = formatLocation(filePath, line);
153
- warnOnce("component", tagName, location, `[compat] Unsupported or undeclared component: <${tagName}>${location}`);
154
- }
155
- function checkTemplateCompatibility(content, filePath, components = {}) {
156
- let parser;
157
- parser = new Parser(
158
- {
159
- onopentag(tagName) {
160
- if (components?.[tagName]) {
161
- return;
162
- }
163
- const line = getLineByIndex(content, parser.startIndex);
164
- warnUnsupportedComponent(tagName, filePath, line);
165
- },
166
- onerror(error) {
167
- console.warn("[compat]", `Failed to parse template for compatibility diagnostics: ${filePath}`, error.message);
168
- }
169
- },
170
- {
171
- xmlMode: true,
172
- lowerCaseTags: false,
173
- lowerCaseAttributeNames: false,
174
- withStartIndices: true
175
- }
176
- );
177
- parser.write(content);
178
- parser.end();
179
- }
180
- function getLineByIndex(content, index) {
181
- if (typeof index !== "number" || index < 0) {
182
- return null;
183
- }
184
- let line = 1;
185
- for (let i = 0; i < index; i++) {
186
- if (content.charCodeAt(i) === 10) {
187
- line++;
188
- }
189
- }
190
- return line;
191
- }
192
- function formatLocation(filePath, line) {
193
- if (!filePath) {
194
- return "";
195
- }
196
- return line ? ` (${filePath}:${line})` : ` (${filePath})`;
197
- }
198
- function warnOnce(type, name, location, message) {
199
- const key = `${type}:${name}:${location}`;
200
- if (warnedItems.has(key)) {
201
- return;
202
- }
203
- warnedItems.add(key);
204
- console.warn(message);
205
- }
206
-
207
- export {
208
- getWxMemberName,
209
- warnUnsupportedWxApi,
210
- checkTemplateCompatibility
211
- };