@napi-rs/cli 3.0.0 → 3.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@napi-rs/cli",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Cli tools for napi-rs",
5
5
  "author": "LongYinan <lynweklm@gmail.com>",
6
6
  "homepage": "https://github.com/napi-rs/napi-rs",
@@ -132,5 +132,5 @@
132
132
  "e2e/**/*.spec.ts"
133
133
  ]
134
134
  },
135
- "gitHead": "cdbf2bc43945175eabe56b19a6bb0f8584dbc34c"
135
+ "gitHead": "78d76709fa1fbd3f531060cb3dd912c995870873"
136
136
  }
@@ -6,12 +6,12 @@ export const createWasiBrowserBinding = (
6
6
  asyncInit = false,
7
7
  buffer = false,
8
8
  ) => {
9
- const fsImport = fs ? `import { memfs } from '@napi-rs/wasm-runtime/fs'` : ''
10
- const bufferImport = buffer
11
- ? fs
12
- ? ``
13
- : `import { Buffer } from 'buffer'`
9
+ const fsImport = fs
10
+ ? buffer
11
+ ? `import { memfs, Buffer } from '@napi-rs/wasm-runtime/fs'`
12
+ : `import { memfs } from '@napi-rs/wasm-runtime/fs'`
14
13
  : ''
14
+ const bufferImport = buffer && !fs ? `import { Buffer } from 'buffer'` : ''
15
15
  const wasiCreation = fs
16
16
  ? `
17
17
  export const { fs: __fs, vol: __volume } = memfs()