@wasm-fmt/gofmt 0.4.7 → 0.4.8

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
@@ -1,16 +1,23 @@
1
1
  [![Test](https://github.com/wasm-fmt/gofmt/actions/workflows/test.yml/badge.svg)](https://github.com/wasm-fmt/gofmt/actions/workflows/test.yml)
2
- [![npm](https://img.shields.io/npm/v/@wasm-fmt/gofmt)](https://www.npmjs.com/package/@wasm-fmt/gofmt)
3
2
 
4
3
  # Install
5
4
 
5
+ [![npm](https://img.shields.io/npm/v/@wasm-fmt/gofmt)](https://www.npmjs.com/package/@wasm-fmt/gofmt)
6
+
6
7
  ```bash
7
8
  npm install @wasm-fmt/gofmt
8
9
  ```
9
10
 
11
+ [![jsr.io](https://jsr.io/badges/@fmt/gofmt)](https://jsr.io/@fmt/gofmt)
12
+
13
+ ```bash
14
+ npx jsr add @fmt/gofmt
15
+ ```
16
+
10
17
  # Usage
11
18
 
12
19
  ```JavaScript
13
- import init, { format } from '@wasm-fmt/gofmt';
20
+ import init, { format } from "@wasm-fmt/gofmt";
14
21
 
15
22
  await init();
16
23
 
@@ -28,7 +35,7 @@ console.log(formatted);
28
35
  Vite users tip:
29
36
 
30
37
  ```JavaScript
31
- import init, { format } from '@wasm-fmt/gofmt/vite';
38
+ import init, { format } from "@wasm-fmt/gofmt/vite";
32
39
  ```
33
40
 
34
41
  # Build from source
package/gofmt.js CHANGED
@@ -3,6 +3,7 @@
3
3
  // license that can be found in the LICENSE file.
4
4
  //
5
5
  // This file has been modified for use by the TinyGo compiler.
6
+
6
7
  const encoder = new TextEncoder("utf-8");
7
8
  const decoder = new TextDecoder("utf-8");
8
9
  let reinterpretBuf = new DataView(new ArrayBuffer(8));
@@ -114,7 +115,7 @@
114
115
  this.importObject = {
115
116
  wasi_snapshot_preview1: {
116
117
  // https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#fd_write
117
- fd_write() {},
118
+ fd_write: () => 0, // dummy
118
119
  },
119
120
  gojs: {
120
121
  // func ticks() float64
@@ -283,6 +284,7 @@
283
284
  };
284
285
  }
285
286
  }
287
+
286
288
  /**
287
289
  * ================== End of wasm_exec.js ==================
288
290
  */
package/gofmt.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wasm-fmt/gofmt",
3
3
  "description": "A wasm based golang formatter",
4
4
  "author": "magic-akari <akari.ccino@gamil.com>",
5
- "version": "0.4.7",
5
+ "version": "0.4.8",
6
6
  "license": "MIT",
7
7
  "keywords": [
8
8
  "wasm",