Skip to content

Commit 105ecad

Browse files
authored
fix(*): add browser entries for pkgs (#760)
1 parent 1f5f00d commit 105ecad

File tree

24 files changed

+123
-46
lines changed

24 files changed

+123
-46
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"devDependencies": {
2727
"@emnapi/core": "^0.45.0",
2828
"@emnapi/runtime": "^0.45.0",
29-
"@napi-rs/cli": "^3.0.0-alpha.33",
29+
"@napi-rs/cli": "^3.0.0-alpha.34",
3030
"@swc-node/core": "^1.10.6",
3131
"@swc-node/register": "^1.6.8",
3232
"@swc/core": "^1.3.101",
@@ -46,7 +46,7 @@
4646
"husky": "^8.0.3",
4747
"lerna": "^8.0.1",
4848
"lint-staged": "^15.2.0",
49-
"memfs-browser": "^3.4.13000",
49+
"memfs-browser": "^4.6.0",
5050
"npm-run-all": "^4.1.5",
5151
"prettier": "^3.1.1",
5252
"ts-node": "^10.9.2",

packages/argon2/browser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@node-rs/argon2-wasm32-wasi'

packages/argon2/npm/wasm32-wasi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
"@emnapi/core": "^0.45.0",
4343
"@emnapi/runtime": "^0.45.0",
4444
"@tybys/wasm-util": "^0.8.1",
45-
"memfs-browser": "^3.4.13000"
45+
"memfs-browser": "^4.6.0"
4646
}
4747
}

packages/argon2/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"homepage": "https://github.com/napi-rs/node-rs",
66
"main": "index.js",
77
"types": "index.d.ts",
8+
"browser": "browser.js",
89
"keywords": [
910
"argon2",
1011
"argon2-password",
@@ -37,7 +38,8 @@
3738
},
3839
"files": [
3940
"index.js",
40-
"index.d.ts"
41+
"index.d.ts",
42+
"browser.js"
4143
],
4244
"publishConfig": {
4345
"registry": "https://registry.npmjs.org/",
@@ -60,7 +62,7 @@
6062
"version": "napi version"
6163
},
6264
"devDependencies": {
63-
"@napi-rs/cli": "^3.0.0-alpha.33",
65+
"@napi-rs/cli": "^3.0.0-alpha.34",
6466
"argon2": "^0.31.2",
6567
"cross-env": "^7.0.3"
6668
}

packages/argon2/wasi-worker-browser.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ const handler = new MessageHandler({
1616
// eslint-disable-next-line no-console
1717
console.log.apply(console, arguments)
1818
},
19+
printErr: function () {
20+
// eslint-disable-next-line no-console
21+
console.error.apply(console, arguments)
22+
},
1923
})
2024
return instantiateNapiModuleSync(wasmModule, {
2125
childThread: true,

packages/bcrypt/browser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@node-rs/bcrypt-wasm32-wasi'

packages/bcrypt/npm/wasm32-wasi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
"@emnapi/core": "^0.45.0",
4747
"@emnapi/runtime": "^0.45.0",
4848
"@tybys/wasm-util": "^0.8.1",
49-
"memfs-browser": "^3.4.13000"
49+
"memfs-browser": "^4.6.0"
5050
}
5151
}

packages/bcrypt/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
"license": "MIT",
1919
"main": "index.js",
2020
"typings": "index.d.ts",
21+
"browser": "browser.js",
2122
"files": [
2223
"index.js",
2324
"index.d.ts",
2425
"binding.js",
2526
"binding.d.ts",
27+
"browser.js",
2628
"LICENSE",
2729
"LICENSE.rust-bcrypt"
2830
],
@@ -68,7 +70,7 @@
6870
"url": "https://github.com/napi-rs/node-rs/issues"
6971
},
7072
"devDependencies": {
71-
"@napi-rs/cli": "^3.0.0-alpha.33",
73+
"@napi-rs/cli": "^3.0.0-alpha.34",
7274
"@types/bcrypt": "^5.0.2",
7375
"bcrypt": "^5.1.1",
7476
"bcryptjs": "^2.4.3",

packages/bcrypt/wasi-worker-browser.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ const handler = new MessageHandler({
1616
// eslint-disable-next-line no-console
1717
console.log.apply(console, arguments)
1818
},
19+
printErr: function () {
20+
// eslint-disable-next-line no-console
21+
console.error.apply(console, arguments)
22+
},
1923
})
2024
return instantiateNapiModuleSync(wasmModule, {
2125
childThread: true,

packages/crc32/browser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@node-rs/crc32-wasm32-wasi'

0 commit comments

Comments
 (0)