@vizejs/native 0.776.0 → 0.778.0

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 +65 -0
  2. package/index.js +2 -0
  3. package/package.json +9 -9
package/index.d.ts CHANGED
@@ -16,6 +16,22 @@ export declare class PluginDocumentHandle {
16
16
  scope(id: number): Array<ScopeEntryNapi> | null;
17
17
  }
18
18
 
19
+ /** The plugin lint rules of one `vite.config.*`, linted one file at a time. */
20
+ export declare class PluginLintSession {
21
+ /**
22
+ * Load `configFile` and plan its enabled plugin rules. Throws when the
23
+ * config or its plugin plan is invalid.
24
+ */
25
+ constructor(configFile: string);
26
+ /** Whether the config enables any plugin rule. */
27
+ get enabled(): boolean;
28
+ /**
29
+ * Lint one SFC with every enabled plugin rule. Throws on a planning,
30
+ * sidecar or rule failure.
31
+ */
32
+ lint(source: string, filename: string): any;
33
+ }
34
+
19
35
  /** Compose output hooks with any native compiler's checked result. */
20
36
  export declare function applyOutputPlugins(
21
37
  compiled: CompileResult,
@@ -373,6 +389,11 @@ export declare function compileSfcBatchWithResults(
373
389
  options?: BatchCompileOptionsNapi | undefined | null,
374
390
  ): BatchCompileResultWithFilesNapi;
375
391
 
392
+ export declare function compileTsrx(
393
+ source: string,
394
+ options?: TsrxCompileOptionsNapi | undefined | null,
395
+ ): TsrxCompileResultNapi;
396
+
376
397
  /** Compile Vue template to Vapor mode */
377
398
  export declare function compileVapor(
378
399
  template: string,
@@ -1569,6 +1590,50 @@ export declare function transformViteCssVarsForPipeline(
1569
1590
  productionFilename?: string | undefined | null,
1570
1591
  ): string;
1571
1592
 
1593
+ /** Options for [`compile_tsrx`]. */
1594
+ export interface TsrxCompileOptionsNapi {
1595
+ /** The module's file name, recorded in its source map. */
1596
+ filename?: string;
1597
+ /** `"dom"` (default), `"ssr"` or `"vapor"`. */
1598
+ target?: string;
1599
+ /** Produce a v3 source map in the result's `map`. */
1600
+ sourceMap?: boolean;
1601
+ /**
1602
+ * Erase TypeScript so `code` is JavaScript, as the `.vue` whole-script
1603
+ * erasure prints it. When `false` (default), host code is copied verbatim
1604
+ * and `code` is TypeScript without JSX.
1605
+ */
1606
+ eraseTypes?: boolean;
1607
+ }
1608
+
1609
+ /** Result of [`compile_tsrx`]. */
1610
+ export interface TsrxCompileResultNapi {
1611
+ /** The compiled module, absent when `errors` is non-empty. */
1612
+ code?: string;
1613
+ /** v3 source map (JSON) for `code`, when requested. */
1614
+ map?: string;
1615
+ /** Every diagnostic of a refused module; empty when it compiled. */
1616
+ errors: Array<TsrxDiagnosticNapi>;
1617
+ }
1618
+
1619
+ /** One diagnostic of a refused module. */
1620
+ export interface TsrxDiagnosticNapi {
1621
+ /**
1622
+ * The reference compiler's code for a syntax or template-rule error
1623
+ * (`TSRX2001`, or a shared `TS1012`); `unsupported` for a construct,
1624
+ * target or option that is not supported yet.
1625
+ */
1626
+ code: string;
1627
+ message: string;
1628
+ /** UTF-8 byte offsets into the source. */
1629
+ start: number;
1630
+ end: number;
1631
+ /** 1-based line of `start`. */
1632
+ line: number;
1633
+ /** 0-based UTF-16 column of `start`, as Rollup and Vite locations count. */
1634
+ column: number;
1635
+ }
1636
+
1572
1637
  /** Canon's configuration identity and the exact files observed while resolving it. */
1573
1638
  export interface VueLanguageProjectMetadata {
1574
1639
  configIdentity: string;
package/index.js CHANGED
@@ -27,6 +27,7 @@ module.exports = nativeBinding;
27
27
  module.exports.getVueLanguageProjectMetadata = nativeBinding.getVueLanguageProjectMetadata;
28
28
  module.exports.generateVueLanguageCode = nativeBinding.generateVueLanguageCode;
29
29
  module.exports.PluginDocumentHandle = nativeBinding.PluginDocumentHandle;
30
+ module.exports.PluginLintSession = nativeBinding.PluginLintSession;
30
31
  module.exports.TypeResolutionBatch = nativeBinding.TypeResolutionBatch;
31
32
  module.exports.applyOutputPlugins = nativeBinding.applyOutputPlugins;
32
33
  module.exports.applyViteDefineReplacements = nativeBinding.applyViteDefineReplacements;
@@ -43,6 +44,7 @@ module.exports.compileJsx = nativeBinding.compileJsx;
43
44
  module.exports.compileSfc = nativeBinding.compileSfc;
44
45
  module.exports.compileSfcBatch = nativeBinding.compileSfcBatch;
45
46
  module.exports.compileSfcBatchWithResults = nativeBinding.compileSfcBatchWithResults;
47
+ module.exports.compileTsrx = nativeBinding.compileTsrx;
46
48
  module.exports.compileVapor = nativeBinding.compileVapor;
47
49
  module.exports.compileWithOutputPlugins = nativeBinding.compileWithOutputPlugins;
48
50
  module.exports.compileWithTransformPlugins = nativeBinding.compileWithTransformPlugins;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/native",
3
- "version": "0.776.0",
3
+ "version": "0.778.0",
4
4
  "description": "High-performance Vue.js compiler - Native bindings",
5
5
  "keywords": [
6
6
  "compiler",
@@ -38,14 +38,14 @@
38
38
  "@napi-rs/cli": "3.10.12"
39
39
  },
40
40
  "optionalDependencies": {
41
- "@vizejs/native-darwin-x64": "0.776.0",
42
- "@vizejs/native-darwin-arm64": "0.776.0",
43
- "@vizejs/native-win32-x64-msvc": "0.776.0",
44
- "@vizejs/native-win32-arm64-msvc": "0.776.0",
45
- "@vizejs/native-linux-x64-gnu": "0.776.0",
46
- "@vizejs/native-linux-x64-musl": "0.776.0",
47
- "@vizejs/native-linux-arm64-gnu": "0.776.0",
48
- "@vizejs/native-linux-arm64-musl": "0.776.0"
41
+ "@vizejs/native-darwin-x64": "0.778.0",
42
+ "@vizejs/native-darwin-arm64": "0.778.0",
43
+ "@vizejs/native-win32-x64-msvc": "0.778.0",
44
+ "@vizejs/native-win32-arm64-msvc": "0.778.0",
45
+ "@vizejs/native-linux-x64-gnu": "0.778.0",
46
+ "@vizejs/native-linux-x64-musl": "0.778.0",
47
+ "@vizejs/native-linux-arm64-gnu": "0.778.0",
48
+ "@vizejs/native-linux-arm64-musl": "0.778.0"
49
49
  },
50
50
  "napi": {
51
51
  "binaryName": "vize-vitrine",