@vitarx/plugin-vite 0.0.1-alpha.0 → 0.0.1-alpha.2

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 (44) hide show
  1. package/dist/components.d.ts +86 -0
  2. package/dist/constants/index.d.ts +58 -0
  3. package/dist/context.d.ts +118 -0
  4. package/dist/error.d.ts +117 -0
  5. package/dist/hmr-client/index.d.ts +56 -0
  6. package/dist/hmr-client/update.d.ts +7 -0
  7. package/dist/hmr-client/utils.d.ts +23 -0
  8. package/dist/index.d.ts +22 -0
  9. package/dist/index.js +3 -4
  10. package/dist/passes/components/ifBlock.d.ts +12 -0
  11. package/dist/passes/components/index.d.ts +17 -0
  12. package/dist/passes/components/switch.d.ts +14 -0
  13. package/dist/passes/directives/index.d.ts +6 -0
  14. package/dist/passes/directives/processDirectives.d.ts +17 -0
  15. package/dist/passes/directives/processDirectives.js +14 -9
  16. package/dist/passes/directives/vIf.d.ts +20 -0
  17. package/dist/passes/hmr/index.d.ts +5 -0
  18. package/dist/passes/hmr/inject.d.ts +15 -0
  19. package/dist/passes/imports/collectImports.d.ts +22 -0
  20. package/dist/passes/imports/collectRefVariables.d.ts +22 -0
  21. package/dist/passes/imports/index.d.ts +7 -0
  22. package/dist/passes/imports/injectImports.d.ts +14 -0
  23. package/dist/passes/index.d.ts +10 -0
  24. package/dist/passes/jsx/index.d.ts +7 -0
  25. package/dist/passes/jsx/processChildren.d.ts +14 -0
  26. package/dist/passes/jsx/processJSXElement.d.ts +22 -0
  27. package/dist/passes/jsx/processJSXFragment.d.ts +14 -0
  28. package/dist/passes/props/attribute.d.ts +30 -0
  29. package/dist/passes/props/attribute.js +21 -25
  30. package/dist/passes/props/index.d.ts +40 -0
  31. package/dist/passes/props/index.js +1 -1
  32. package/dist/passes/props/types.d.ts +52 -0
  33. package/dist/passes/props/vmodel.d.ts +27 -0
  34. package/dist/transform.d.ts +15 -0
  35. package/dist/utils/ast-builders.d.ts +75 -0
  36. package/dist/utils/ast-guards.d.ts +12 -0
  37. package/dist/utils/branch-factory.d.ts +47 -0
  38. package/dist/utils/component-collect.d.ts +17 -0
  39. package/dist/utils/generate.d.ts +5 -0
  40. package/dist/utils/index.d.ts +8 -0
  41. package/dist/utils/jsx-helpers.d.ts +67 -0
  42. package/dist/utils/pattern-helpers.d.ts +20 -0
  43. package/dist/utils/vif-helpers.d.ts +31 -0
  44. package/package.json +1 -1
@@ -0,0 +1,31 @@
1
+ /**
2
+ * v-if 链处理工具模块
3
+ * 统一处理 v-if/v-else-if/v-else 链的验证和收集
4
+ * @module utils/vif-helpers
5
+ */
6
+ import * as t from '@babel/types';
7
+ /**
8
+ * v-if 链信息
9
+ */
10
+ export interface VIfChainInfo {
11
+ /** 链中的元素节点 */
12
+ nodes: t.JSXElement[];
13
+ /** 条件表达式数组 */
14
+ conditions: t.Expression[];
15
+ /** 结束索引 */
16
+ endIndex: number;
17
+ }
18
+ /**
19
+ * 验证 v-if 链的合法性
20
+ */
21
+ export declare function validateVIfChain(children: t.JSXElement[]): void;
22
+ /**
23
+ * 从 JSX 元素数组收集 v-if 链信息
24
+ */
25
+ export declare function collectVIfChainInfo(nodes: t.JSXElement[]): VIfChainInfo;
26
+ /**
27
+ * 收集 Fragment 中的 v-if 链
28
+ */
29
+ export declare function collectFragmentVIfChains(children: t.Node[]): Array<VIfChainInfo & {
30
+ endIndex: number;
31
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitarx/plugin-vite",
3
- "version": "0.0.1-alpha.0",
3
+ "version": "0.0.1-alpha.2",
4
4
  "description": "The official plugin for Vitarx support in Vite.",
5
5
  "author": "ZhuChongLin <8210856@qq.com>",
6
6
  "license": "MIT",