@vizejs/native 0.428.1 → 0.429.1

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 (3) hide show
  1. package/index.d.ts +327 -149
  2. package/index.js +3 -0
  3. package/package.json +9 -9
package/index.d.ts CHANGED
@@ -1,5 +1,28 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
+ /**
4
+ * The proxy arm the spike measured and rejected: the same document behind
5
+ * a handle whose every read is one napi call.
6
+ */
7
+ export declare class PluginDocumentHandle {
8
+ /** How many nodes the document has (ids are `0..count`). */
9
+ count(): number;
10
+ kind(id: number): string | null;
11
+ /** The owning node, or -1. */
12
+ parent(id: number): number;
13
+ /** `name`, `value`, `alias.value`, `alias.key` or `alias.index`. */
14
+ field(id: number, key: string): string | null;
15
+ /** The names scope `id` binds (`templateScopes`), or `null`. */
16
+ scope(id: number): Array<ScopeEntryNapi> | null;
17
+ }
18
+
19
+ /** Compose output hooks with any native compiler's checked result. */
20
+ export declare function applyOutputPlugins(
21
+ compiled: CompileResult,
22
+ plugins: Array<OutputPluginNapi>,
23
+ options?: OutputPluginOptionsNapi | undefined | null,
24
+ ): OutputPluginsCompileResultNapi;
25
+
3
26
  export declare function applyViteDefineReplacements(
4
27
  code: string,
5
28
  defines: Array<DefineReplacementNapi>,
@@ -68,8 +91,6 @@ export interface BatchCompileOptionsNapi {
68
91
  customRenderer?: boolean;
69
92
  customElements?: Array<string>;
70
93
  templateSyntax?: string;
71
- /** Preserve template comments; disabled by default for direct native calls. */
72
- templateComments?: boolean;
73
94
  experimentalInTagComments?: boolean;
74
95
  experimentalPatternedTemplate?: boolean;
75
96
  experimentalSelfComponent?: boolean;
@@ -78,11 +99,18 @@ export interface BatchCompileOptionsNapi {
78
99
  runtimeModuleName?: string;
79
100
  runtimeGlobalName?: string;
80
101
  vueVersion?: string;
102
+ styleTrim?: boolean;
103
+ templateCacheHandlers?: boolean;
104
+ templateComments?: boolean;
105
+ templateHoistStatic?: boolean;
106
+ templatePrefixIdentifiers?: boolean;
81
107
  /** Preserve TypeScript in output when true */
82
108
  isTs?: boolean;
83
- /** Worker threads for this call (1-256). Omit to use Rayon's global pool.
109
+ /**
110
+ * Worker threads for this call (1-256). Omit to use Rayon's global pool.
84
111
  * Concurrent explicit calls share a process-wide 256-worker budget.
85
- * Capacity exhaustion fails immediately with a `WouldDeadlock` error. */
112
+ * Capacity exhaustion fails immediately with a `WouldDeadlock` error.
113
+ */
86
114
  threads?: number;
87
115
  /**
88
116
  * Include per-block style metadata (incl. `styles[].content`). Default OFF.
@@ -133,8 +161,11 @@ export interface BatchFileInputNapi {
133
161
  export interface BatchFileResultNapi {
134
162
  path: string;
135
163
  code: string;
136
- /** Source Map v3 document (JSON) describing `code`, present only when
137
- * `includeSourceMap` was requested and a line could be anchored (#3399). */
164
+ /**
165
+ * Source Map v3 document (JSON) describing `code`, present only when
166
+ * `includeSourceMap` was requested and an emitted token maps to the
167
+ * authored file (#3399).
168
+ */
138
169
  map?: string;
139
170
  css?: string;
140
171
  scopeId: string;
@@ -147,6 +178,7 @@ export interface BatchFileResultNapi {
147
178
  styles: Array<StyleBlockNapi>;
148
179
  customBlocks: Array<CustomBlockNapi>;
149
180
  macroArtifacts: Array<MacroArtifactNapi>;
181
+ moduleShape?: ModuleShapeNapi;
150
182
  }
151
183
 
152
184
  /** Batch type check result for NAPI */
@@ -164,9 +196,6 @@ export declare function buildInspectorGraph(
164
196
  files: Array<InspectorSourceFileNapi>,
165
197
  ): InspectorGraphNapi;
166
198
 
167
- /** Resolve effective lint rules and provenance using Vize's execution matcher. */
168
- export declare function inspectLintPlan(plan: string, root: string, files: Array<string>): string;
169
-
170
199
  /** Catalog entry for NAPI */
171
200
  export interface CatalogEntryNapi {
172
201
  title: string;
@@ -236,7 +265,7 @@ export interface CompileResult {
236
265
 
237
266
  /** Compiler options for bindings */
238
267
  export interface CompilerOptions {
239
- /** Vue template whitespace strategy: "condense" (default) or "preserve". */
268
+ /** Vue template whitespace strategy, or Vize's opt-in "vue2-line-breaks" migration mode. */
240
269
  whitespace?: string;
241
270
  /** Output mode: "module" or "function" */
242
271
  mode?: string;
@@ -272,7 +301,10 @@ export interface CompilerOptions {
272
301
  experimentalPatternedTemplate?: boolean;
273
302
  /** Enable experimental reserved `<Self>` component references. */
274
303
  experimentalSelfComponent?: boolean;
275
- /** Accepted for option-shape parity; strict slot checks run through SFC/check surfaces. */
304
+ /**
305
+ * Accepted for option-shape parity; strict slot child checks run through
306
+ * SFC/check surfaces rather than direct template compilation.
307
+ */
276
308
  experimentalStrictSlotChildren?: boolean;
277
309
  /** Enable experimental server-script related RFC surface. */
278
310
  experimentalServerScript?: boolean;
@@ -317,6 +349,24 @@ export declare function compileVapor(
317
349
  options?: CompilerOptions | undefined | null,
318
350
  ): CompileResult;
319
351
 
352
+ /** Compile normally, then run checked, map-preserving output hooks. */
353
+ export declare function compileWithOutputPlugins(
354
+ template: string,
355
+ plugins: Array<OutputPluginNapi>,
356
+ options?: CompilerOptions | undefined | null,
357
+ hostOptions?: OutputPluginOptionsNapi | undefined | null,
358
+ ): OutputPluginsCompileResultNapi;
359
+
360
+ /**
361
+ * Compile a template using bounded, deterministic edits to the native L2
362
+ * artifact. Unsupported edits and incompatible canonical output are errors.
363
+ */
364
+ export declare function compileWithTransformPlugins(
365
+ template: string,
366
+ plugins: Array<TransformPluginNapi>,
367
+ options?: TransformCompileOptionsNapi | undefined | null,
368
+ ): TransformCompileOutputNapi;
369
+
320
370
  export declare function createViteBareImportBases(
321
371
  root: string,
322
372
  importer?: string | undefined | null,
@@ -575,12 +625,79 @@ export interface HmrHashesNapi {
575
625
  styleHash?: string;
576
626
  }
577
627
 
628
+ /** HTML-family self-closing options for NAPI */
629
+ export interface HtmlSelfClosingHtmlOptionsNapi {
630
+ void?: string;
631
+ normal?: string;
632
+ component?: string;
633
+ }
634
+
635
+ /** HTML self-closing options for NAPI */
636
+ export interface HtmlSelfClosingOptionsNapi {
637
+ html?: HtmlSelfClosingHtmlOptionsNapi;
638
+ svg?: string;
639
+ math?: string;
640
+ }
641
+
642
+ /** Resolve lint severities and their winning config items with CLI-identical glob semantics. */
643
+ export declare function inspectLintPlan(plan: string, root: string, files: Array<string>): string;
644
+
645
+ export interface InspectorGraphEdgeNapi {
646
+ from: string;
647
+ to: string;
648
+ kind: string;
649
+ specifier: string;
650
+ }
651
+
652
+ export interface InspectorGraphNapi {
653
+ nodes: Array<InspectorGraphNodeNapi>;
654
+ edges: Array<InspectorGraphEdgeNapi>;
655
+ }
656
+
657
+ export interface InspectorGraphNodeNapi {
658
+ path: string;
659
+ kind: string;
660
+ isEntry: boolean;
661
+ sourceBytes: number;
662
+ sourceLines: number;
663
+ }
664
+
665
+ export interface InspectorSourceFileNapi {
666
+ path: string;
667
+ source: string;
668
+ }
669
+
578
670
  export declare function isBuiltinViteDefine(key: string): boolean;
579
671
 
580
672
  export declare function isSfcImportableAssetUrl(url: string): boolean;
581
673
 
582
674
  export declare function isViteBareSpecifier(id: string): boolean;
583
675
 
676
+ export interface JsFactProviderNapi {
677
+ name: string;
678
+ version: string;
679
+ fingerprint: string;
680
+ visit?: Array<string>;
681
+ demands?: Array<string>;
682
+ provides: Array<string>;
683
+ cacheInputs?: Array<PluginCacheInputNapi>;
684
+ run: (arg: string) => string;
685
+ }
686
+
687
+ /** A plugin as the SDK's `definePlugin` hands it to the host. */
688
+ export interface JsPluginNapi {
689
+ name: string;
690
+ version: string;
691
+ /** The SDK's digest of the plugin's rule sources. */
692
+ fingerprint: string;
693
+ visit?: Array<string>;
694
+ demands?: Array<string>;
695
+ /** Configuration and ambient values read by the rule. Required for caching. */
696
+ cacheInputs?: Array<PluginCacheInputNapi>;
697
+ /** `(batchJson) => reportsJson` — one call per document. */
698
+ run: (arg: string) => string;
699
+ }
700
+
584
701
  /** Options for [`compile_jsx`]. */
585
702
  export interface JsxCompileOptionsNapi {
586
703
  /** Source filename, used to infer the language when `lang` is omitted. */
@@ -596,17 +713,19 @@ export interface JsxCompileOptionsNapi {
596
713
  * Per-component `"use vue:vapor"` / `"use vue:vdom"` directives override it.
597
714
  */
598
715
  jsxMode?: string;
599
- /**
600
- * JSX semantics: `"native"` (default) or `"babel"`. Babel compatibility is
601
- * only defined for VDOM output.
602
- */
603
- jsxCompat?: "native" | "babel";
604
716
  /**
605
717
  * Legacy default-mode toggle: `true` compiles components to Vapor, `false`
606
718
  * (default) to VDOM. Kept for back-compat; prefer `jsxMode`. Ignored when
607
719
  * `jsxMode` is set.
608
720
  */
609
721
  vapor?: boolean;
722
+ /**
723
+ * JSX semantics: `"native"` (default) or `"babel"`. Mirrors the
724
+ * `compiler.jsxCompat` config key (#3391). `"babel"` opts into
725
+ * `@vue/babel-plugin-jsx` semantics; it has no Vapor meaning and is
726
+ * diagnosed when combined with Vapor output.
727
+ */
728
+ jsxCompat?: string;
610
729
  /**
611
730
  * Emit a v3 source map for the generated render code. When `true`, the
612
731
  * result's `map` carries the map JSON; when `false` (default), `map` is
@@ -711,69 +830,6 @@ export interface LintResultNapi {
711
830
  timeMs: number;
712
831
  }
713
832
 
714
- /** A plugin as the SDK's `definePlugin` hands it to the host. */
715
- export interface JsPluginNapi {
716
- name: string;
717
- version: string;
718
- /** The SDK's digest of the plugin's rule sources. */
719
- fingerprint: string;
720
- visit?: Array<string>;
721
- demands?: Array<string>;
722
- /** Configuration and ambient values read by the rule. Required for caching. */
723
- cacheInputs?: Array<PluginCacheInputNapi>;
724
- /** `(batchJson) => reportsJson` — one call per document. */
725
- run: (arg: string) => string;
726
- }
727
-
728
- /** One stable value a cached JS plugin declares it reads outside the batch. */
729
- export interface PluginCacheInputNapi {
730
- name: string;
731
- value: string;
732
- }
733
-
734
- export interface PluginLintOptionsNapi {
735
- filename?: string;
736
- /** Reuse a result whose content key this process has already seen. */
737
- cache?: boolean;
738
- /** Optional directory for reusing results across Node processes. */
739
- cacheDir?: string;
740
- }
741
-
742
- export interface PluginDiagnosticNapi {
743
- ruleId: string;
744
- plugin: string;
745
- severity: string;
746
- message: string;
747
- start: number;
748
- end: number;
749
- line: number;
750
- column: number;
751
- endLine: number;
752
- endColumn: number;
753
- }
754
-
755
- /** One plugin's cost in this lint run. */
756
- export interface PluginCostNapi {
757
- name: string;
758
- version: string;
759
- contentKey: string;
760
- /** Nodes in the plugin's batch (0 when served from the cache). */
761
- nodes: number;
762
- batchBytes: number;
763
- reports: number;
764
- cached: boolean;
765
- /** Host time for this plugin: batch build, the JS call, report mapping. */
766
- elapsedNs: number;
767
- /** The JS call alone. */
768
- jsNs: number;
769
- }
770
-
771
- export interface PluginLintOutputNapi {
772
- filename: string;
773
- diagnostics: Array<PluginDiagnosticNapi>;
774
- plugins: Array<PluginCostNapi>;
775
- }
776
-
777
833
  /**
778
834
  * Lint one SFC with JS plugins: one batch and one call per plugin, every
779
835
  * plugin's cost attributed, diagnostics in the host's one order.
@@ -784,34 +840,6 @@ export declare function lintWithPlugins(
784
840
  options?: PluginLintOptionsNapi | undefined | null,
785
841
  ): PluginLintOutputNapi;
786
842
 
787
- /**
788
- * The proxy arm the spike measured and rejected: the same document behind
789
- * a handle whose every read is one napi call.
790
- */
791
- export declare class PluginDocumentHandle {
792
- /** How many nodes the document has (ids are `0..count`). */
793
- count(): number;
794
- kind(id: number): string | null;
795
- /** The owning node, or -1. */
796
- parent(id: number): number;
797
- /** `name`, `value`, `alias.value`, `alias.key` or `alias.index`. */
798
- field(id: number, key: string): string | null;
799
- /** The names scope `id` binds (`templateScopes`), or `null`. */
800
- scope(id: number): Array<ScopeEntryNapi> | null;
801
- }
802
-
803
- /** Open the proxy-arm handle over one SFC, computing `templateScopes`. */
804
- export declare function openPluginDocument(
805
- source: string,
806
- filename?: string | undefined | null,
807
- ): PluginDocumentHandle;
808
-
809
- /** One `templateScopes` entry on the proxy arm. */
810
- export interface ScopeEntryNapi {
811
- name: string;
812
- position: string;
813
- }
814
-
815
843
  export interface MacroArtifactNapi {
816
844
  kind: string;
817
845
  name: string;
@@ -822,29 +850,26 @@ export interface MacroArtifactNapi {
822
850
  end: number;
823
851
  }
824
852
 
825
- export interface InspectorGraphEdgeNapi {
826
- from: string;
827
- to: string;
828
- kind: string;
829
- specifier: string;
830
- }
831
-
832
- export interface InspectorGraphNapi {
833
- nodes: Array<InspectorGraphNodeNapi>;
834
- edges: Array<InspectorGraphEdgeNapi>;
835
- }
836
-
837
- export interface InspectorGraphNodeNapi {
838
- path: string;
839
- kind: string;
840
- isEntry: boolean;
841
- sourceBytes: number;
842
- sourceLines: number;
853
+ /**
854
+ * The emitted module's shape, so the JS plugins do not re-parse it (#3425).
855
+ *
856
+ * Absent when the module did not parse, in which case the consumer falls back
857
+ * to its own analysis — the behaviour before this field existed.
858
+ */
859
+ export interface ModuleShapeNapi {
860
+ hasDefaultExport: boolean;
861
+ hasSfcMainDefined: boolean;
862
+ hasNamedRenderExport: boolean;
863
+ hasNamedSsrRenderExport: boolean;
864
+ defaultExportStart?: number;
865
+ defaultExportKeywordEnd?: number;
866
+ defaultExportEnd?: number;
867
+ defaultExportIsSfcMain: boolean;
843
868
  }
844
869
 
845
- export interface InspectorSourceFileNapi {
846
- path: string;
847
- source: string;
870
+ /** No-mutating-props options for NAPI */
871
+ export interface NoMutatingPropsOptionsNapi {
872
+ shallowOnly?: boolean;
848
873
  }
849
874
 
850
875
  export declare function normalizeViteCssModuleFilename(filename: string): string;
@@ -875,6 +900,51 @@ export declare function normalizeViteVirtualVueModuleId(id: string): string;
875
900
  */
876
901
  export declare function normalizeVizeConfig(value: unknown): unknown;
877
902
 
903
+ /** Open the proxy-arm handle over one SFC, computing `templateScopes`. */
904
+ export declare function openPluginDocument(
905
+ source: string,
906
+ filename?: string | undefined | null,
907
+ ): PluginDocumentHandle;
908
+
909
+ export interface OutputPluginCacheInputNapi {
910
+ name: string;
911
+ value: string;
912
+ }
913
+
914
+ export interface OutputPluginCostNapi {
915
+ name: string;
916
+ version: string;
917
+ family: string;
918
+ contentKey: string;
919
+ batchBytes: number;
920
+ operations: number;
921
+ cached: boolean;
922
+ elapsedNs: number;
923
+ jsNs: number;
924
+ }
925
+
926
+ export interface OutputPluginNapi {
927
+ name: string;
928
+ version: string;
929
+ fingerprint: string;
930
+ family: string;
931
+ cacheInputs?: Array<OutputPluginCacheInputNapi>;
932
+ /** One serialized batch in, one edit/addition array out. */
933
+ run: (arg: string) => string;
934
+ }
935
+
936
+ export interface OutputPluginOptionsNapi {
937
+ cache?: boolean;
938
+ cacheDir?: string;
939
+ /** Uncached misses audit by default; cached misses always audit. */
940
+ auditDeterminism?: boolean;
941
+ }
942
+
943
+ export interface OutputPluginsCompileResultNapi {
944
+ result: CompileResult;
945
+ plugins: Array<OutputPluginCostNapi>;
946
+ }
947
+
878
948
  /** Palette options for NAPI */
879
949
  export interface PaletteOptionsNapi {
880
950
  inferOptions?: boolean;
@@ -956,28 +1026,74 @@ export interface PatinaLintOptionsNapi {
956
1026
  attributeHyphenation?: string;
957
1027
  }
958
1028
 
959
- /** No-mutating-props options for NAPI */
960
- export interface NoMutatingPropsOptionsNapi {
961
- shallowOnly?: boolean;
1029
+ /** One stable value a cached JS plugin declares it reads outside the batch. */
1030
+ export interface PluginCacheInputNapi {
1031
+ name: string;
1032
+ value: string;
962
1033
  }
963
1034
 
964
- /** SFC element order options for NAPI */
965
- export interface SfcElementOrderOptionsNapi {
966
- order?: Array<string | Array<string>>;
1035
+ /** One plugin's cost in this lint run. */
1036
+ export interface PluginCostNapi {
1037
+ name: string;
1038
+ version: string;
1039
+ contentKey: string;
1040
+ /** Nodes in the plugin's batch (0 when served from the cache). */
1041
+ nodes: number;
1042
+ batchBytes: number;
1043
+ reports: number;
1044
+ cached: boolean;
1045
+ /** JS executions (two for an audited miss, zero for a hit). */
1046
+ executions: number;
1047
+ /** Host time for this plugin: batch build, the JS call, report mapping. */
1048
+ elapsedNs: number;
1049
+ /** The JS call alone. */
1050
+ jsNs: number;
967
1051
  }
968
1052
 
969
- /** HTML self-closing options for NAPI */
970
- export interface HtmlSelfClosingOptionsNapi {
971
- html?: HtmlSelfClosingHtmlOptionsNapi;
972
- svg?: string;
973
- math?: string;
1053
+ export interface PluginDiagnosticNapi {
1054
+ ruleId: string;
1055
+ plugin: string;
1056
+ severity: string;
1057
+ message: string;
1058
+ start: number;
1059
+ end: number;
1060
+ line: number;
1061
+ column: number;
1062
+ endLine: number;
1063
+ endColumn: number;
974
1064
  }
975
1065
 
976
- /** HTML-family self-closing options for NAPI */
977
- export interface HtmlSelfClosingHtmlOptionsNapi {
978
- void?: string;
979
- normal?: string;
980
- component?: string;
1066
+ /** One plugin autofix, confined to the reported node's source span. */
1067
+ export interface PluginFixNapi {
1068
+ ruleId: string;
1069
+ plugin: string;
1070
+ start: number;
1071
+ end: number;
1072
+ text: string;
1073
+ }
1074
+
1075
+ export interface PluginLintOptionsNapi {
1076
+ filename?: string;
1077
+ /** Reuse a result whose content key this process has already seen. */
1078
+ cache?: boolean;
1079
+ /** Optional directory for reusing results across Node processes. */
1080
+ cacheDir?: string;
1081
+ /**
1082
+ * Run identical batches twice and reject different diagnostics or fixes.
1083
+ * Always enabled for cache misses.
1084
+ */
1085
+ validateDeterminism?: boolean;
1086
+ /** Namespaced providers resolved from each plugin's static fact demand. */
1087
+ factProviders?: Array<JsFactProviderNapi>;
1088
+ }
1089
+
1090
+ export interface PluginLintOutputNapi {
1091
+ filename: string;
1092
+ diagnostics: Array<PluginDiagnosticNapi>;
1093
+ plugins: Array<PluginCostNapi>;
1094
+ /** Suggested replacements over host-owned node spans. */
1095
+ fixes: Array<PluginFixNapi>;
1096
+ factProviders: Array<ProviderCostNapi>;
981
1097
  }
982
1098
 
983
1099
  export declare function printCssAst(
@@ -1004,6 +1120,19 @@ export interface PropDefinitionNapi {
1004
1120
  defaultValue?: any;
1005
1121
  }
1006
1122
 
1123
+ export interface ProviderCostNapi {
1124
+ name: string;
1125
+ version: string;
1126
+ contentKey: string;
1127
+ providedGroups: number;
1128
+ nodes: number;
1129
+ batchBytes: number;
1130
+ elapsedNs: number;
1131
+ jsNs: number;
1132
+ audited: boolean;
1133
+ cached: boolean;
1134
+ }
1135
+
1007
1136
  /** Range config for NAPI */
1008
1137
  export interface RangeConfigNapi {
1009
1138
  min: number;
@@ -1065,6 +1194,12 @@ export declare function rewriteViteStaticAssetUrls(
1065
1194
 
1066
1195
  export declare function runCli(args: Array<string>): void;
1067
1196
 
1197
+ /** One `templateScopes` entry on the proxy arm. */
1198
+ export interface ScopeEntryNapi {
1199
+ name: string;
1200
+ position: string;
1201
+ }
1202
+
1068
1203
  export declare function scopeViteCssForPipeline(css: string, scopeId: string): string;
1069
1204
 
1070
1205
  /** Select option for NAPI */
@@ -1088,8 +1223,6 @@ export interface SfcCompileOptionsNapi {
1088
1223
  customRenderer?: boolean;
1089
1224
  customElements?: Array<string>;
1090
1225
  templateSyntax?: string;
1091
- /** Preserve template comments; disabled by default for direct native calls. */
1092
- templateComments?: boolean;
1093
1226
  experimentalInTagComments?: boolean;
1094
1227
  experimentalPatternedTemplate?: boolean;
1095
1228
  experimentalSelfComponent?: boolean;
@@ -1098,6 +1231,11 @@ export interface SfcCompileOptionsNapi {
1098
1231
  runtimeModuleName?: string;
1099
1232
  runtimeGlobalName?: string;
1100
1233
  vueVersion?: string;
1234
+ styleTrim?: boolean;
1235
+ templateCacheHandlers?: boolean;
1236
+ templateComments?: boolean;
1237
+ templateHoistStatic?: boolean;
1238
+ templatePrefixIdentifiers?: boolean;
1101
1239
  /** Preserve TypeScript in output when true */
1102
1240
  isTs?: boolean;
1103
1241
  /** Scope ID for scoped CSS (e.g., "data-v-abc123") */
@@ -1106,9 +1244,12 @@ export interface SfcCompileOptionsNapi {
1106
1244
 
1107
1245
  export interface SfcCompileResultNapi {
1108
1246
  code: string;
1109
- /** Source Map v3 document (JSON) describing `code`, present only when
1110
- * `sourceMap` was requested and at least one authored line could be
1111
- * anchored (#3399). Its single `sources` entry is the authored `.vue` path. */
1247
+ /**
1248
+ * Source Map v3 document (JSON) describing `code`, present only when
1249
+ * `sourceMap` was requested and at least one emitted token maps to the
1250
+ * authored file (#3399). It is the compiler's structured SFC module map;
1251
+ * its single `sources` entry is the authored `.vue` path.
1252
+ */
1112
1253
  map?: string;
1113
1254
  css?: string;
1114
1255
  errors: Array<string>;
@@ -1120,6 +1261,12 @@ export interface SfcCompileResultNapi {
1120
1261
  styles: Array<StyleBlockNapi>;
1121
1262
  customBlocks: Array<CustomBlockNapi>;
1122
1263
  macroArtifacts: Array<MacroArtifactNapi>;
1264
+ moduleShape?: ModuleShapeNapi;
1265
+ }
1266
+
1267
+ /** SFC element order options for NAPI */
1268
+ export interface SfcElementOrderOptionsNapi {
1269
+ order?: Array<any>;
1123
1270
  }
1124
1271
 
1125
1272
  export interface SfcParseOptionsNapi {
@@ -1159,6 +1306,37 @@ export interface TemplateAssetUrlNapi {
1159
1306
 
1160
1307
  export declare function toViteBrowserImportPrefix(replacement: string): string;
1161
1308
 
1309
+ export interface TransformCompileOptionsNapi {
1310
+ filename?: string;
1311
+ sourceMap?: boolean;
1312
+ hoistStatic?: boolean;
1313
+ cache?: boolean;
1314
+ cacheDir?: string;
1315
+ }
1316
+
1317
+ export interface TransformCompileOutputNapi {
1318
+ result: CompileResult;
1319
+ plugins: Array<TransformPluginCostNapi>;
1320
+ }
1321
+
1322
+ export interface TransformPluginCostNapi {
1323
+ name: string;
1324
+ contentKey: string;
1325
+ nodes: number;
1326
+ edits: number;
1327
+ cached: boolean;
1328
+ elapsedNs: number;
1329
+ jsNs: number;
1330
+ }
1331
+
1332
+ export interface TransformPluginNapi {
1333
+ name: string;
1334
+ version: string;
1335
+ fingerprint: string;
1336
+ cacheInputs?: Array<PluginCacheInputNapi>;
1337
+ run: (arg: string) => string;
1338
+ }
1339
+
1162
1340
  export declare function transformViteCssVarsForPipeline(css: string, scopeId: string): string;
1163
1341
 
1164
1342
  /**
package/index.js CHANGED
@@ -6,6 +6,7 @@ const nativeBinding = require("./native-binding");
6
6
 
7
7
  module.exports = nativeBinding;
8
8
  module.exports.PluginDocumentHandle = nativeBinding.PluginDocumentHandle;
9
+ module.exports.applyOutputPlugins = nativeBinding.applyOutputPlugins;
9
10
  module.exports.applyViteDefineReplacements = nativeBinding.applyViteDefineReplacements;
10
11
  module.exports.artToCsf = nativeBinding.artToCsf;
11
12
  module.exports.buildDesignTokenMap = nativeBinding.buildDesignTokenMap;
@@ -20,6 +21,8 @@ module.exports.compileSfc = nativeBinding.compileSfc;
20
21
  module.exports.compileSfcBatch = nativeBinding.compileSfcBatch;
21
22
  module.exports.compileSfcBatchWithResults = nativeBinding.compileSfcBatchWithResults;
22
23
  module.exports.compileVapor = nativeBinding.compileVapor;
24
+ module.exports.compileWithOutputPlugins = nativeBinding.compileWithOutputPlugins;
25
+ module.exports.compileWithTransformPlugins = nativeBinding.compileWithTransformPlugins;
23
26
  module.exports.createViteBareImportBases = nativeBinding.createViteBareImportBases;
24
27
  module.exports.createViteBareImportCandidates = nativeBinding.createViteBareImportCandidates;
25
28
  module.exports.createViteVirtualId = nativeBinding.createViteVirtualId;
package/package.json CHANGED
@@ -47,14 +47,14 @@
47
47
  ]
48
48
  },
49
49
  "optionalDependencies": {
50
- "@vizejs/native-darwin-arm64": "0.428.1",
51
- "@vizejs/native-darwin-x64": "0.428.1",
52
- "@vizejs/native-linux-arm64-gnu": "0.428.1",
53
- "@vizejs/native-linux-arm64-musl": "0.428.1",
54
- "@vizejs/native-linux-x64-gnu": "0.428.1",
55
- "@vizejs/native-linux-x64-musl": "0.428.1",
56
- "@vizejs/native-win32-arm64-msvc": "0.428.1",
57
- "@vizejs/native-win32-x64-msvc": "0.428.1"
50
+ "@vizejs/native-darwin-arm64": "0.429.1",
51
+ "@vizejs/native-darwin-x64": "0.429.1",
52
+ "@vizejs/native-linux-arm64-gnu": "0.429.1",
53
+ "@vizejs/native-linux-arm64-musl": "0.429.1",
54
+ "@vizejs/native-linux-x64-gnu": "0.429.1",
55
+ "@vizejs/native-linux-x64-musl": "0.429.1",
56
+ "@vizejs/native-win32-arm64-msvc": "0.429.1",
57
+ "@vizejs/native-win32-x64-msvc": "0.429.1"
58
58
  },
59
59
  "publishConfig": {
60
60
  "access": "public"
@@ -65,7 +65,7 @@
65
65
  "url": "https://github.com/ubugeeei-prod/vize"
66
66
  },
67
67
  "types": "index.d.ts",
68
- "version": "0.428.1",
68
+ "version": "0.429.1",
69
69
  "scripts": {
70
70
  "build": "node ./scripts/build-local.mjs --release",
71
71
  "build:ci": "napi build --platform --profile ci --manifest-path ../../crates/vize_vitrine/Cargo.toml -p vize_vitrine --features napi,legacy --output-dir . && node ./scripts/sync-entrypoint.mjs",