@lark.js/mvc 0.0.13 → 0.0.15

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 (61) hide show
  1. package/README.md +4 -5
  2. package/dist/apply-style.d.ts +9 -0
  3. package/dist/cache.d.ts +69 -0
  4. package/dist/common.d.ts +64 -0
  5. package/dist/compiler/compile-template.d.ts +16 -0
  6. package/dist/compiler/compile-to-vdom-function.d.ts +13 -0
  7. package/dist/compiler/extract-global-vars.d.ts +17 -0
  8. package/dist/compiler/template-syntax.d.ts +61 -0
  9. package/dist/compiler.cjs +15843 -15805
  10. package/dist/compiler.d.cts +1 -30
  11. package/dist/compiler.d.ts +1 -30
  12. package/dist/compiler.js +15840 -15789
  13. package/dist/cross-site.d.ts +29 -0
  14. package/dist/devtool.cjs +4139 -3166
  15. package/dist/devtool.d.cts +2 -1
  16. package/dist/devtool.d.ts +2 -1
  17. package/dist/devtool.js +4149 -3092
  18. package/dist/dom.d.ts +45 -0
  19. package/dist/event-delegator.d.ts +28 -0
  20. package/dist/event-emitter.d.ts +38 -0
  21. package/dist/frame.d.ts +143 -0
  22. package/dist/framework.d.ts +9 -0
  23. package/dist/hmr.d.ts +53 -0
  24. package/dist/index.amd.js +6285 -0
  25. package/dist/index.cjs +5959 -4484
  26. package/dist/index.d.cts +10 -19
  27. package/dist/index.d.ts +10 -19
  28. package/dist/index.js +5919 -4419
  29. package/dist/index.umd.js +6272 -0
  30. package/dist/mark.d.ts +26 -0
  31. package/dist/module-loader.d.ts +20 -0
  32. package/dist/router.d.ts +14 -0
  33. package/dist/rspack.cjs +15927 -15877
  34. package/dist/rspack.d.cts +45 -23
  35. package/dist/rspack.d.ts +45 -23
  36. package/dist/rspack.js +15926 -15870
  37. package/dist/runtime.amd.js +94 -0
  38. package/dist/runtime.cjs +79 -82
  39. package/dist/runtime.js +85 -19
  40. package/dist/runtime.umd.js +98 -0
  41. package/dist/service.d.ts +173 -0
  42. package/dist/state.d.ts +8 -0
  43. package/dist/store.d.ts +60 -0
  44. package/dist/types.d.ts +1259 -0
  45. package/dist/updater.d.ts +90 -0
  46. package/dist/url-state.d.ts +32 -0
  47. package/dist/utils.d.ts +90 -0
  48. package/dist/vdom.d.ts +45 -0
  49. package/dist/view-registry.d.ts +20 -0
  50. package/dist/view.d.ts +214 -0
  51. package/dist/vite.cjs +15940 -15898
  52. package/dist/vite.d.cts +10 -8
  53. package/dist/vite.d.ts +10 -8
  54. package/dist/vite.js +15937 -15890
  55. package/dist/webpack.cjs +15977 -15877
  56. package/dist/webpack.d.cts +36 -14
  57. package/dist/webpack.d.ts +36 -14
  58. package/dist/webpack.js +15976 -15870
  59. package/package.json +6 -5
  60. package/dist/chunk-66OZBBSP.js +0 -108
  61. /package/{src → dist}/client.d.ts +0 -0
package/dist/rspack.d.cts CHANGED
@@ -1,5 +1,45 @@
1
1
  import { RspackPluginInstance, Compiler } from '@rspack/core';
2
2
 
3
+ /**
4
+ * @lark.js/mvc Vite Plugin for Template Compilation
5
+ *
6
+ * Compiles .html template files using @lark.js/mvc template syntax
7
+ * into JS function modules at build/dev time.
8
+ *
9
+ * 0 configuration — just add the plugin and it works.
10
+ * - All template operators: = (escape), ! (raw), @ (ref lookup), : (binding)
11
+ * - @event attribute processing with $g prefix
12
+ * - $eu (URI encoding), $eq (quote encoding), $i (reference lookup)
13
+ * - Debug mode with line tracking
14
+ * - View ID injection
15
+ * - Auto variable extraction
16
+ *
17
+ * Usage in vite.config.ts:
18
+ * ```ts
19
+ * import { larkMvcPlugin } from '@lark.js/mvc/vite';
20
+ *
21
+ * export default defineConfig({
22
+ * plugins: [larkMvcPlugin()],
23
+ * });
24
+ * ```
25
+ */
26
+
27
+ interface LarkMvcVitePluginOptions {
28
+ /** Enable debug mode with line tracking (default: false) */
29
+ debug?: boolean;
30
+ /** Enable virtual DOM output (default: false) */
31
+ virtualDom?: boolean;
32
+ }
33
+
34
+ type LarkMvcWebpackLoaderOptions = LarkMvcVitePluginOptions;
35
+ /** Plugin options */
36
+ interface LarkMvcWebpackPluginOptions extends LarkMvcWebpackLoaderOptions {
37
+ /** File extension to match (default: /\.html$/) */
38
+ test?: RegExp;
39
+ /** Exclude pattern (default: /node_modules/) */
40
+ exclude?: RegExp;
41
+ }
42
+
3
43
  /**
4
44
  * @lark.js/mvc Rspack Integration for Template Compilation
5
45
  *
@@ -20,7 +60,7 @@ import { RspackPluginInstance, Compiler } from '@rspack/core';
20
60
  * - $encUri (URI encoding), $encQuote (quote encoding), $refFn (reference lookup)
21
61
  * - Debug mode with line tracking
22
62
  * - View ID injection
23
- * - Auto variable extraction via AST analysis (Babel or SWC)
63
+ * - Auto variable extraction via AST analysis (Babel)
24
64
  * - Virtual DOM support (optional)
25
65
  *
26
66
  * Usage with Plugin (recommended):
@@ -32,7 +72,6 @@ import { RspackPluginInstance, Compiler } from '@rspack/core';
32
72
  * new LarkMvcPlugin({
33
73
  * debug: process.env.NODE_ENV !== 'production',
34
74
  * virtualDom: false,
35
- * useSwc: false,
36
75
  * }),
37
76
  * ],
38
77
  * };
@@ -45,7 +84,7 @@ import { RspackPluginInstance, Compiler } from '@rspack/core';
45
84
  * rules: [{
46
85
  * test: /\.html$/,
47
86
  * loader: '@lark.js/mvc/rspack',
48
- * options: { debug: false, virtualDom: false, useSwc: false },
87
+ * options: { debug: false, virtualDom: false },
49
88
  * }],
50
89
  * },
51
90
  * };
@@ -57,24 +96,7 @@ interface LoaderContext {
57
96
  /** Whether in development mode */
58
97
  dev?: boolean;
59
98
  /** Loader options */
60
- getOptions: () => {
61
- debug?: boolean;
62
- virtualDom?: boolean;
63
- useSwc?: boolean;
64
- };
65
- }
66
- /** Plugin options */
67
- interface LarkMvcPluginOptions {
68
- /** Enable debug mode with line tracking (default: false) */
69
- debug?: boolean;
70
- /** Enable virtual DOM output (default: false) */
71
- virtualDom?: boolean;
72
- /** Use SWC instead of Babel for AST analysis (default: false) */
73
- useSwc?: boolean;
74
- /** File extension to match (default: /\.html$/) */
75
- test?: RegExp;
76
- /** Exclude pattern (default: /node_modules/) */
77
- exclude?: RegExp;
99
+ getOptions: () => LarkMvcWebpackLoaderOptions;
78
100
  }
79
101
  /**
80
102
  * Rspack loader entry point.
@@ -103,7 +125,6 @@ declare function larkMvcLoader(this: LoaderContext, source: string): Promise<str
103
125
  * new LarkMvcPlugin({
104
126
  * debug: true,
105
127
  * virtualDom: false,
106
- * useSwc: false,
107
128
  * }),
108
129
  * ],
109
130
  * };
@@ -111,7 +132,7 @@ declare function larkMvcLoader(this: LoaderContext, source: string): Promise<str
111
132
  */
112
133
  declare class LarkMvcPlugin implements RspackPluginInstance {
113
134
  private options;
114
- constructor(options?: LarkMvcPluginOptions);
135
+ constructor(options?: LarkMvcWebpackPluginOptions);
115
136
  /**
116
137
  * Rspack plugin entry point.
117
138
  * Called by rspack when the plugin is applied.
@@ -120,3 +141,4 @@ declare class LarkMvcPlugin implements RspackPluginInstance {
120
141
  }
121
142
 
122
143
  export { LarkMvcPlugin, larkMvcLoader as default, larkMvcLoader };
144
+ export type { LarkMvcWebpackLoaderOptions, LarkMvcWebpackPluginOptions };
package/dist/rspack.d.ts CHANGED
@@ -1,5 +1,45 @@
1
1
  import { RspackPluginInstance, Compiler } from '@rspack/core';
2
2
 
3
+ /**
4
+ * @lark.js/mvc Vite Plugin for Template Compilation
5
+ *
6
+ * Compiles .html template files using @lark.js/mvc template syntax
7
+ * into JS function modules at build/dev time.
8
+ *
9
+ * 0 configuration — just add the plugin and it works.
10
+ * - All template operators: = (escape), ! (raw), @ (ref lookup), : (binding)
11
+ * - @event attribute processing with $g prefix
12
+ * - $eu (URI encoding), $eq (quote encoding), $i (reference lookup)
13
+ * - Debug mode with line tracking
14
+ * - View ID injection
15
+ * - Auto variable extraction
16
+ *
17
+ * Usage in vite.config.ts:
18
+ * ```ts
19
+ * import { larkMvcPlugin } from '@lark.js/mvc/vite';
20
+ *
21
+ * export default defineConfig({
22
+ * plugins: [larkMvcPlugin()],
23
+ * });
24
+ * ```
25
+ */
26
+
27
+ interface LarkMvcVitePluginOptions {
28
+ /** Enable debug mode with line tracking (default: false) */
29
+ debug?: boolean;
30
+ /** Enable virtual DOM output (default: false) */
31
+ virtualDom?: boolean;
32
+ }
33
+
34
+ type LarkMvcWebpackLoaderOptions = LarkMvcVitePluginOptions;
35
+ /** Plugin options */
36
+ interface LarkMvcWebpackPluginOptions extends LarkMvcWebpackLoaderOptions {
37
+ /** File extension to match (default: /\.html$/) */
38
+ test?: RegExp;
39
+ /** Exclude pattern (default: /node_modules/) */
40
+ exclude?: RegExp;
41
+ }
42
+
3
43
  /**
4
44
  * @lark.js/mvc Rspack Integration for Template Compilation
5
45
  *
@@ -20,7 +60,7 @@ import { RspackPluginInstance, Compiler } from '@rspack/core';
20
60
  * - $encUri (URI encoding), $encQuote (quote encoding), $refFn (reference lookup)
21
61
  * - Debug mode with line tracking
22
62
  * - View ID injection
23
- * - Auto variable extraction via AST analysis (Babel or SWC)
63
+ * - Auto variable extraction via AST analysis (Babel)
24
64
  * - Virtual DOM support (optional)
25
65
  *
26
66
  * Usage with Plugin (recommended):
@@ -32,7 +72,6 @@ import { RspackPluginInstance, Compiler } from '@rspack/core';
32
72
  * new LarkMvcPlugin({
33
73
  * debug: process.env.NODE_ENV !== 'production',
34
74
  * virtualDom: false,
35
- * useSwc: false,
36
75
  * }),
37
76
  * ],
38
77
  * };
@@ -45,7 +84,7 @@ import { RspackPluginInstance, Compiler } from '@rspack/core';
45
84
  * rules: [{
46
85
  * test: /\.html$/,
47
86
  * loader: '@lark.js/mvc/rspack',
48
- * options: { debug: false, virtualDom: false, useSwc: false },
87
+ * options: { debug: false, virtualDom: false },
49
88
  * }],
50
89
  * },
51
90
  * };
@@ -57,24 +96,7 @@ interface LoaderContext {
57
96
  /** Whether in development mode */
58
97
  dev?: boolean;
59
98
  /** Loader options */
60
- getOptions: () => {
61
- debug?: boolean;
62
- virtualDom?: boolean;
63
- useSwc?: boolean;
64
- };
65
- }
66
- /** Plugin options */
67
- interface LarkMvcPluginOptions {
68
- /** Enable debug mode with line tracking (default: false) */
69
- debug?: boolean;
70
- /** Enable virtual DOM output (default: false) */
71
- virtualDom?: boolean;
72
- /** Use SWC instead of Babel for AST analysis (default: false) */
73
- useSwc?: boolean;
74
- /** File extension to match (default: /\.html$/) */
75
- test?: RegExp;
76
- /** Exclude pattern (default: /node_modules/) */
77
- exclude?: RegExp;
99
+ getOptions: () => LarkMvcWebpackLoaderOptions;
78
100
  }
79
101
  /**
80
102
  * Rspack loader entry point.
@@ -103,7 +125,6 @@ declare function larkMvcLoader(this: LoaderContext, source: string): Promise<str
103
125
  * new LarkMvcPlugin({
104
126
  * debug: true,
105
127
  * virtualDom: false,
106
- * useSwc: false,
107
128
  * }),
108
129
  * ],
109
130
  * };
@@ -111,7 +132,7 @@ declare function larkMvcLoader(this: LoaderContext, source: string): Promise<str
111
132
  */
112
133
  declare class LarkMvcPlugin implements RspackPluginInstance {
113
134
  private options;
114
- constructor(options?: LarkMvcPluginOptions);
135
+ constructor(options?: LarkMvcWebpackPluginOptions);
115
136
  /**
116
137
  * Rspack plugin entry point.
117
138
  * Called by rspack when the plugin is applied.
@@ -120,3 +141,4 @@ declare class LarkMvcPlugin implements RspackPluginInstance {
120
141
  }
121
142
 
122
143
  export { LarkMvcPlugin, larkMvcLoader as default, larkMvcLoader };
144
+ export type { LarkMvcWebpackLoaderOptions, LarkMvcWebpackPluginOptions };