Remove crypto-browserify

This commit is contained in:
Franck Royer 2022-05-09 23:32:43 +10:00
parent 1fd32639b9
commit 00be6b147d
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
8 changed files with 11 additions and 8 deletions

View File

@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Prefer the use of `BigInt` over integer literal (`n` postfix) to facilitate the use of a polyfill. - Prefer the use of `BigInt` over integer literal (`n` postfix) to facilitate the use of a polyfill.
- Replaced `secp256k1` and hence `elliptic` dependencies with `@noble/secp256k1`,
reducing package size, number of dependency and removing need for `crypto-browserify` polyfill.
### Fixed ### Fixed

View File

@ -8,7 +8,7 @@ module.exports = {
Object.assign(config.resolve.fallback, { Object.assign(config.resolve.fallback, {
assert: require.resolve("assert"), assert: require.resolve("assert"),
buffer: require.resolve("buffer"), buffer: require.resolve("buffer"),
crypto: require.resolve("crypto-browserify"), crypto: false,
http: require.resolve("http-browserify"), http: require.resolve("http-browserify"),
https: require.resolve("https-browserify"), https: require.resolve("https-browserify"),
stream: require.resolve("stream-browserify"), stream: require.resolve("stream-browserify"),
@ -41,7 +41,7 @@ module.exports = {
Object.assign(config.resolve.fallback, { Object.assign(config.resolve.fallback, {
assert: require.resolve("assert"), assert: require.resolve("assert"),
buffer: require.resolve("buffer"), buffer: require.resolve("buffer"),
crypto: require.resolve("crypto-browserify"), crypto: false,
http: require.resolve("http-browserify"), http: require.resolve("http-browserify"),
https: require.resolve("https-browserify"), https: require.resolve("https-browserify"),
stream: require.resolve("stream-browserify"), stream: require.resolve("stream-browserify"),

1
package-lock.json generated
View File

@ -45,7 +45,6 @@
"assert": "^2.0.0", "assert": "^2.0.0",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"chai": "^4.3.4", "chai": "^4.3.4",
"crypto-browserify": "^3.12.0",
"cspell": "^5.14.0", "cspell": "^5.14.0",
"eslint": "^8.6.0", "eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",

View File

@ -61,6 +61,9 @@
"deploy": "node ci/deploy.js", "deploy": "node ci/deploy.js",
"reset-hard": "git clean -dfx && git reset --hard && npm i && npm run build && for d in examples/*/; do (cd $d; npm i); done" "reset-hard": "git clean -dfx && git reset --hard && npm i && npm run build && for d in examples/*/; do (cd $d; npm i); done"
}, },
"browser": {
"crypto": false
},
"engines": { "engines": {
"node": ">=16" "node": ">=16"
}, },
@ -101,7 +104,6 @@
"assert": "^2.0.0", "assert": "^2.0.0",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"chai": "^4.3.4", "chai": "^4.3.4",
"crypto-browserify": "^3.12.0",
"cspell": "^5.14.0", "cspell": "^5.14.0",
"eslint": "^8.6.0", "eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",

View File

@ -24,7 +24,7 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
fallback: { fallback: {
buffer: require.resolve('buffer/'), buffer: require.resolve('buffer/'),
crypto: require.resolve('crypto-browserify'), crypto: false,
stream: require.resolve('stream-browserify'), stream: require.resolve('stream-browserify'),
assert: require.resolve('assert'), assert: require.resolve('assert'),
}, },

View File

@ -24,7 +24,7 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
fallback: { fallback: {
buffer: require.resolve('buffer/'), buffer: require.resolve('buffer/'),
crypto: require.resolve('crypto-browserify'), crypto: false,
stream: require.resolve('stream-browserify'), stream: require.resolve('stream-browserify'),
assert: require.resolve('assert'), assert: require.resolve('assert'),
}, },

View File

@ -24,7 +24,7 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
fallback: { fallback: {
buffer: require.resolve('buffer/'), buffer: require.resolve('buffer/'),
crypto: require.resolve('crypto-browserify'), crypto: false,
stream: require.resolve('stream-browserify'), stream: require.resolve('stream-browserify'),
assert: require.resolve('assert'), assert: require.resolve('assert'),
}, },

View File

@ -24,7 +24,7 @@ module.exports = {
extensions: ['.ts', '.js'], extensions: ['.ts', '.js'],
fallback: { fallback: {
buffer: require.resolve('buffer/'), buffer: require.resolve('buffer/'),
crypto: require.resolve('crypto-browserify'), crypto: false,
stream: require.resolve('stream-browserify'), stream: require.resolve('stream-browserify'),
assert: require.resolve('assert'), assert: require.resolve('assert'),
}, },