@wasm-fmt/mago_fmt 0.6.2 → 0.6.4

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.
package/README.md CHANGED
@@ -86,6 +86,12 @@ await init();
86
86
  // ...
87
87
  ```
88
88
 
89
+ Or use the `./bundler` entry with [vite-plugin-wasm](https://www.npmjs.com/package/vite-plugin-wasm)
90
+
91
+ ```javascript
92
+ import { format } from "@wasm-fmt/mago_fmt/bundler";
93
+ ```
94
+
89
95
  ## Entry Points
90
96
 
91
97
  - `.` - Auto-detects environment (Node.js uses node, Webpack uses bundler, default is ESM)
package/jsr.jsonc CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://jsr.io/schema/config-file.v1.json",
3
3
  "name": "@fmt/mago-fmt",
4
- "version": "0.6.2",
4
+ "version": "0.6.4",
5
5
  "exports": {
6
6
  ".": "./mago_fmt.js",
7
7
  "./esm": "./mago_fmt_esm.js",
package/mago_fmt_bg.wasm CHANGED
Binary file
@@ -12,12 +12,24 @@ export interface Settings {
12
12
  * @remarks Available presets:
13
13
  * - `default` - Default preset (PER-CS compatible)
14
14
  * - `psr-12` - PSR-12 preset
15
- * - `laravel` / `pint` - Laravel Pint's 'laravel' preset
16
- * - `drupal` - Drupal's coding standard
17
- * - `tempest` - Tempest framework compatible
15
+ * - `pint` - Pint preset (Laravel Pint compatible)
16
+ * - `tempest` - Tempest preset (Tempest framework compatible)
18
17
  * - `hack` - Hack preset (`hackfmt` compatible)
19
- */
20
- preset?: "default" | "psr-12" | "laravel" | "pint" | "drupal" | "tempest" | "hack";
18
+ * - `drupal` - Drupal preset
19
+ */
20
+ preset?:
21
+ | "default"
22
+ | "per-cs"
23
+ | "psr-12"
24
+ | "pint"
25
+ | "laravel-pint"
26
+ | "laravel"
27
+ | "tempest"
28
+ | "tempest-php"
29
+ | "hack"
30
+ | "hackfmt"
31
+ | "hhvm"
32
+ | "drupal";
21
33
 
22
34
  /**
23
35
  * Maximum line length that the printer will wrap on.
@@ -398,6 +410,28 @@ export interface Settings {
398
410
  */
399
411
  "first-method-chain-on-new-line"?: boolean;
400
412
 
413
+ /**
414
+ * When a method chain breaks across multiple lines, place the semicolon on its own line.
415
+ *
416
+ * When enabled:
417
+ * ```php
418
+ * $object->method1()
419
+ * ->method2()
420
+ * ->method3()
421
+ * ;
422
+ * ```
423
+ *
424
+ * When disabled:
425
+ * ```php
426
+ * $object->method1()
427
+ * ->method2()
428
+ * ->method3();
429
+ * ```
430
+ *
431
+ * @default false
432
+ */
433
+ "method-chain-semicolon-on-next-line"?: boolean;
434
+
401
435
  /**
402
436
  * Whether to preserve line breaks in method chains, even if they could fit on a single line.
403
437
  * @default false
@@ -637,14 +671,21 @@ export interface Settings {
637
671
  * }
638
672
  * ```
639
673
  *
640
- * @example "null-pipe"
674
+ * @example "null_pipe"
641
675
  * ```php
642
676
  * function foo(null|string $bar) {
643
677
  * return $bar;
644
678
  * }
645
679
  * ```
680
+ *
681
+ * @example "null_pipe_last"
682
+ * ```php
683
+ * function foo(string|null $bar) {
684
+ * return $bar;
685
+ * }
686
+ * ```
646
687
  */
647
- "null-type-hint"?: "null-pipe" | "question";
688
+ "null-type-hint"?: "null_pipe" | "null_pipe_last" | "question";
648
689
 
649
690
  /**
650
691
  * Whether to include parentheses around `new` when followed by a member access.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "magic-akari <akari.ccino@gmail.com>"
6
6
  ],
7
7
  "description": "A WASM based PHP Formatter",
8
- "version": "0.6.2",
8
+ "version": "0.6.4",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",