@wasm-fmt/shfmt 0.2.2 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +0 -6
  2. package/package.json +6 -3
  3. package/shfmt.js +1 -1
package/README.md CHANGED
@@ -43,12 +43,6 @@ const formatted = format(source, "script.sh", {
43
43
  });
44
44
  ```
45
45
 
46
- ## Node.js < 22.19
47
-
48
- ```JavaScript
49
- import { format } from "@wasm-fmt/shfmt/node";
50
- ```
51
-
52
46
  ## Web
53
47
 
54
48
  For web environments, you need to initialize WASM module manually:
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wasm-fmt/shfmt",
3
3
  "description": "A wasm based shell script formatter",
4
4
  "author": "magic-akari <akari.ccino@gmail.com>",
5
- "version": "0.2.2",
5
+ "version": "0.2.4",
6
6
  "license": "MIT",
7
7
  "keywords": [
8
8
  "wasm",
@@ -25,7 +25,9 @@
25
25
  "types": "./shfmt.d.ts",
26
26
  "webpack": "./shfmt.js",
27
27
  "deno": "./shfmt.js",
28
+ "bun": "./shfmt_node.js",
28
29
  "module-sync": "./shfmt_node.js",
30
+ "node": "./shfmt_node.js",
29
31
  "default": "./shfmt_esm.js"
30
32
  },
31
33
  "./esm": {
@@ -53,12 +55,13 @@
53
55
  "./*": "./*"
54
56
  },
55
57
  "scripts": {
56
- "build": "./scripts/build.sh",
58
+ "build": "tinygo build -o=shfmt.wasm -target=wasm-unknown -no-debug ./src/lib.go",
57
59
  "fmt": "dprint fmt",
58
60
  "test:go": "go test -C src -v",
59
61
  "test:node": "node --test test_node/shfmt.test.js",
60
62
  "test:deno": "deno test test_deno --allow-read",
61
- "test:bun": "bun test test_bun"
63
+ "test:bun": "bun test test_bun",
64
+ "version": "node ./scripts/sync_version.js && git add ."
62
65
  },
63
66
  "engines": {
64
67
  "node": ">=16.17.0"
package/shfmt.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* @ts-self-types="./shfmt.d.ts" */
2
- import wasm from "./shfmt.wasm";
2
+ import * as wasm from "./shfmt.wasm";
3
3
  import { format as _format } from "./shfmt_binding.js";
4
4
 
5
5
  wasm._initialize();