@compelem/compiler 0.30.0-beta.3 → 0.30.0-beta.4

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.
@@ -73,10 +73,6 @@ type ReactiveKind = 'prop' | 'state' | 'computed';
73
73
  interface ReactiveField {
74
74
  name: string;
75
75
  kind: ReactiveKind;
76
- /** 静态初始化器里的默认值表达式源码(用于静态取值内联),无则 undefined */
77
- init?: string;
78
- /** 是否为深层对象(init 是对象/数组字面量),影响依赖路径展开 */
79
- shallow: boolean;
80
76
  }
81
77
  /** 一个组件的完整静态分析结果。 */
82
78
  interface ComponentAnalysis {
@@ -103,7 +99,7 @@ interface ComponentAnalysis {
103
99
  bodyStart: number;
104
100
  /** `@tag` 名称,无则 undefined */
105
101
  tagName?: string;
106
- /** 响应式字段(含继承链上收集到的,按声明顺序) */
102
+ /** 本类自身声明的响应式字段(按声明顺序;继承链由依赖提取另行上溯) */
107
103
  fields: Map<string, ReactiveField>;
108
104
  /** 本类自身定义的实例方法名(D2:自有方法值不可变,不推入依赖,无需拒绝) */
109
105
  ownMethods: Set<string>;
@@ -164,7 +160,8 @@ interface ComponentAnalysis {
164
160
  /** 插件选项。 */
165
161
  interface CompilerOptions {
166
162
  /**
167
- * 参与编译的文件过滤。默认只处理 `.ts` 且源码里出现 `extends CompElem` 的文件。
163
+ * 参与编译的文件过滤。默认处理 `.ts`,且源码里出现 `extends CompElem`、`@tag(`
164
+ * 或家族装饰器(@prop/@state/@computed/@query)之一。
168
165
  * ⚠️ 不要放宽到 `.js`:IIFE 打包产物里指令名不在 scope,会触发 D3 误报。
169
166
  */
170
167
  include?: (id: string, code: string) => boolean;
@@ -216,15 +213,10 @@ interface VitePluginOptions extends CompilerOptions {
216
213
  * 仅对真实文件生效(跳过 `?v=` 之类的虚拟 id),且只在编译确有改动时写。
217
214
  */
218
215
  emitJs?: boolean;
219
- /**
220
- * 调试编译产物用:令 sourcemap 以上游注入后的 TS 为 0 级原�? * 这样 DevTools 直接显示编译后代码(含 `__ce_static__` / buildTemplate / fx),
221
- * 在这些区域打的断点能命中。代价:跳过「编译后代码 → 原始模板」的映射,
222
- * 栈帧行号指向注入后的 TS 而非用户源码里的模板位置。默认 `false`。
223
- */
224
216
  debugSourceMap?: boolean;
225
217
  }
226
218
  /** compelem 编译期优化插件。 */
227
219
  declare function compelemCompiler(options?: VitePluginOptions): MinimalPlugin;
228
220
  //#endregion
229
221
  export { ComponentAnalysis as a, ReactiveKind as c, CompilerOptions as i, compelemCompiler as n, DEBUG_DIV as o, CompiledStatic as r, ReactiveField as s, VitePluginOptions as t };
230
- //# sourceMappingURL=vite-BAl4p1jA.d.ts.map
222
+ //# sourceMappingURL=vite-D178A0gy.d.ts.map
package/dist/vite.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as compelemCompiler, t as VitePluginOptions } from "./vite-BAl4p1jA.js";
1
+ import { n as compelemCompiler, t as VitePluginOptions } from "./vite-D178A0gy.js";
2
2
  export { VitePluginOptions, compelemCompiler, compelemCompiler as default };
package/dist/vite.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as vite_default, t as compelemCompiler } from "./vite-DwMiG3VM.js";
1
+ import { n as vite_default, t as compelemCompiler } from "./vite-CY_6E-Ut.js";
2
2
 
3
3
  export { compelemCompiler, vite_default as default };
package/package.json CHANGED
@@ -1,57 +1,61 @@
1
- {
2
- "name": "@compelem/compiler",
3
- "version": "0.30.0-beta.3",
4
- "description": "A compiler for compelem",
5
- "type": "module",
6
- "license": "MIT",
7
- "author": "holyhigh2",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/holyhigh2/compelem-compiler.git"
11
- },
12
- "keywords": [
13
- "compelem",
14
- "compiler",
15
- "webcomponents",
16
- "vite-plugin",
17
- "rolldown",
18
- "reactive"
19
- ],
20
- "exports": {
21
- ".": {
22
- "types": "./dist/index.d.ts",
23
- "import": "./dist/index.js"
24
- },
25
- "./vite": {
26
- "types": "./dist/vite.d.ts",
27
- "import": "./dist/vite.js"
28
- }
29
- },
30
- "main": "./dist/index.js",
31
- "types": "./dist/index.d.ts",
32
- "files": [
33
- "dist",
34
- "README.md",
35
- "LICENSE"
36
- ],
37
- "scripts": {
38
- "build": "tsdown",
39
- "dev": "tsdown --watch",
40
- "typecheck": "tsc --noEmit"
41
- },
42
- "dependencies": {
43
- "magic-string": "^0.30.11"
44
- },
45
- "devDependencies": {
46
- "@types/node": "^22.10.0",
47
- "happy-dom": "^20.14.5",
48
- "myfx": "^2.0.0-beta.2",
49
- "rolldown": "^1.2.9",
50
- "tsdown": "^0.15.0",
51
- "typescript": "^5.7.3",
52
- "vite": "^8.3.0"
53
- },
54
- "engines": {
55
- "node": ">=18"
56
- }
1
+ {
2
+ "name": "@compelem/compiler",
3
+ "version": "0.30.0-beta.4",
4
+ "description": "A compiler for compelem",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "holyhigh2",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/holyhigh2/compelem-compiler.git"
11
+ },
12
+ "keywords": [
13
+ "compelem",
14
+ "compiler",
15
+ "webcomponents",
16
+ "vite-plugin",
17
+ "rolldown",
18
+ "reactive"
19
+ ],
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js"
24
+ },
25
+ "./vite": {
26
+ "types": "./dist/vite.d.ts",
27
+ "import": "./dist/vite.js"
28
+ }
29
+ },
30
+ "main": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "files": [
33
+ "dist",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "scripts": {
38
+ "build": "tsdown",
39
+ "dev": "tsdown --watch",
40
+ "typecheck": "tsc --noEmit"
41
+ },
42
+ "dependencies": {
43
+ "@babel/parser": "^7.28.4",
44
+ "magic-string": "^0.30.11"
45
+ },
46
+ "peerDependencies": {
47
+ "myfx": "^2.0.0-beta.4"
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^22.10.0",
51
+ "happy-dom": "^20.14.5",
52
+ "myfx": "^2.0.0-beta.4",
53
+ "rolldown": "^1.2.9",
54
+ "tsdown": "^0.15.0",
55
+ "typescript": "^5.7.3",
56
+ "vite": "^8.3.0"
57
+ },
58
+ "engines": {
59
+ "node": ">=18"
60
+ }
57
61
  }