@vizejs/native 0.797.0 → 0.799.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 +36 -0
  2. package/index.js +2 -0
  3. package/package.json +9 -9
package/index.d.ts CHANGED
@@ -603,6 +603,40 @@ export declare function findDependentDesignTokens(
603
603
 
604
604
  export declare function flattenDesignTokenCategories(categories: string): string;
605
605
 
606
+ /** Where `formatFile` reads its file name, configuration and overrides. */
607
+ export interface FormatFileOptionsNapi {
608
+ /**
609
+ * File name whose extension selects the formatter and whose directory
610
+ * selects the configuration. Relative names resolve from the working
611
+ * directory. The file is never read or written.
612
+ */
613
+ filename: string;
614
+ /**
615
+ * Vite config file or project directory to read instead of discovering
616
+ * one from `filename`.
617
+ */
618
+ config?: string;
619
+ /** Format with defaults only, without reading any configuration. */
620
+ noConfig?: boolean;
621
+ /** Options applied over the configuration, as `vize fmt` flags are. */
622
+ overrides?: FormatOptionsNapi;
623
+ }
624
+
625
+ /**
626
+ * Format `source` as the contents of `options.filename` on a worker thread,
627
+ * with the configuration and per-file rules `vize fmt` applies to that file.
628
+ */
629
+ export declare function formatFile(
630
+ source: string,
631
+ options: FormatFileOptionsNapi,
632
+ ): Promise<FormatResultNapi>;
633
+
634
+ /** Synchronous `formatFile`. */
635
+ export declare function formatFileSync(
636
+ source: string,
637
+ options: FormatFileOptionsNapi,
638
+ ): FormatResultNapi;
639
+
606
640
  /** Format options for NAPI. */
607
641
  export interface FormatOptionsNapi {
608
642
  /** Existing formatter defaults; explicit options below take precedence. */
@@ -637,6 +671,8 @@ export interface FormatOptionsNapi {
637
671
  jsxSingleQuote?: boolean;
638
672
  /** Change when object properties are quoted. */
639
673
  quoteProps?: "as-needed" | "consistent" | "preserve";
674
+ /** Keep objects multiline when a newline follows '{', or collapse objects that fit. */
675
+ objectWrap?: "preserve" | "collapse";
640
676
  /** Change where trailing commas are printed. */
641
677
  trailingComma?: "all" | "es5" | "none";
642
678
  /** Change parentheses around a sole arrow function parameter. */
package/index.js CHANGED
@@ -60,6 +60,8 @@ module.exports.extractSfcSrcInfo = nativeBinding.extractSfcSrcInfo;
60
60
  module.exports.extractSfcStyleBlocks = nativeBinding.extractSfcStyleBlocks;
61
61
  module.exports.findDependentDesignTokens = nativeBinding.findDependentDesignTokens;
62
62
  module.exports.flattenDesignTokenCategories = nativeBinding.flattenDesignTokenCategories;
63
+ module.exports.formatFile = nativeBinding.formatFile;
64
+ module.exports.formatFileSync = nativeBinding.formatFileSync;
63
65
  module.exports.formatSfc = nativeBinding.formatSfc;
64
66
  module.exports.fromViteVirtualId = nativeBinding.fromViteVirtualId;
65
67
  module.exports.generateArtCatalog = nativeBinding.generateArtCatalog;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/native",
3
- "version": "0.797.0",
3
+ "version": "0.799.0",
4
4
  "description": "High-performance Vue.js compiler - Native bindings",
5
5
  "keywords": [
6
6
  "compiler",
@@ -39,14 +39,14 @@
39
39
  "@napi-rs/cli": "3.10.12"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@vizejs/native-darwin-x64": "0.797.0",
43
- "@vizejs/native-darwin-arm64": "0.797.0",
44
- "@vizejs/native-win32-x64-msvc": "0.797.0",
45
- "@vizejs/native-win32-arm64-msvc": "0.797.0",
46
- "@vizejs/native-linux-x64-gnu": "0.797.0",
47
- "@vizejs/native-linux-x64-musl": "0.797.0",
48
- "@vizejs/native-linux-arm64-gnu": "0.797.0",
49
- "@vizejs/native-linux-arm64-musl": "0.797.0"
42
+ "@vizejs/native-darwin-x64": "0.799.0",
43
+ "@vizejs/native-darwin-arm64": "0.799.0",
44
+ "@vizejs/native-win32-x64-msvc": "0.799.0",
45
+ "@vizejs/native-win32-arm64-msvc": "0.799.0",
46
+ "@vizejs/native-linux-x64-gnu": "0.799.0",
47
+ "@vizejs/native-linux-x64-musl": "0.799.0",
48
+ "@vizejs/native-linux-arm64-gnu": "0.799.0",
49
+ "@vizejs/native-linux-arm64-musl": "0.799.0"
50
50
  },
51
51
  "napi": {
52
52
  "binaryName": "vize-vitrine",