Skip to content

Commit

Permalink
Add react native package exports (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
kigawas authored Oct 31, 2024
1 parent 53d1362 commit c2b32fc
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 171 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 0.2.1

- Add React Native package exports

## 0.2.0

- Add xchacha20-poly1305 support
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@

Node/Pure JavaScript symmetric ciphers adapter.

On browsers (or deno), it'll use [`@noble/ciphers`](https://github.com/paulmillr/noble-ciphers)'s implementation for compatibility.
On browsers (or React Native, deno), it'll use [`@noble/ciphers`](https://github.com/paulmillr/noble-ciphers)'s implementation for compatibility.

On node (or bun), it'll use [`node:crypto`](https://nodejs.org/api/crypto.html#cryptocreatecipherivalgorithm-key-iv-options)'s implementation for efficiency.

> [!NOTE]
> You may need to polyfill [`crypto.getRandomValues`](https://github.com/LinusU/react-native-get-random-values) for React Native.
>
> There are some limitations, see [Known limitations](#known-limitations) below.
Check the [example](./example/) folder for bun/deno usage.
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "git+https://github.com/ecies/js-ciphers.git"
},
"version": "0.2.0",
"version": "0.2.1",
"engines": {
"node": ">=16",
"bun": ">=1",
Expand All @@ -33,13 +33,15 @@
"./aes": {
"types": "./dist/aes/node.d.ts",
"browser": "./dist/aes/noble.js",
"react-native": "./dist/aes/noble.js",
"deno": "./dist/aes/noble.js",
"bun": "./dist/aes/node.js",
"default": "./dist/aes/node.js"
},
"./chacha": {
"types": "./dist/chacha/node.d.ts",
"browser": "./dist/chacha/noble.js",
"react-native": "./dist/chacha/noble.js",
"deno": "./dist/chacha/noble.js",
"bun": "./dist/chacha/noble.js",
"default": "./dist/chacha/node.js"
Expand All @@ -53,10 +55,10 @@
"@noble/ciphers": "^1.0.0"
},
"devDependencies": {
"@types/node": "^22.7.6",
"@vitest/coverage-v8": "^2.1.3",
"@types/node": "^22.8.4",
"@vitest/coverage-v8": "^2.1.4",
"typescript": "^5.6.3",
"vitest": "^2.1.3"
"vitest": "^2.1.4"
},
"packageManager": "pnpm@9.12.2+sha512.22721b3a11f81661ae1ec68ce1a7b879425a1ca5b991c975b074ac220b187ce56c708fe5db69f4c962c989452eee76c82877f4ee80f474cebd61ee13461b6228"
"packageManager": "pnpm@9.12.3+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee"
}
Loading

0 comments on commit c2b32fc

Please sign in to comment.