feat!: add Node and Web dual build with async API (v4.0.0)#43
Merged
Conversation
BREAKING CHANGE: All crypto methods now return Promises (async API). Migrate by adding await or .then() to encryptStringWithRsaPublicKey, decryptStringWithRsaPrivateKey, encrypt, decrypt, createPrivateAndPublicKeys, encryptBufferWithRsaPublicKey, decryptBufferWithRsaPrivateKey. BREAKING CHANGE: Entry points are now build/node and build/web (conditional exports). The old single build/index.js is no longer published. BREAKING CHANGE: decryptBufferWithRsaPrivateKey return type is now Promise<Uint8Array> (was Buffer). In Node the runtime value is still Buffer. - Add src/node (Node crypto, RSA-OAEP) and src/web (Web Crypto API) - Add src/shared (types, helpers without Node/Buffer) for both builds - Same INodeRSA interface; encrypt(private)/decrypt(public) throw in browser - Add tests: functionalty.node.spec.ts, functionalty.web.spec.ts - Package: exports, main/module/browser/types, files; version 4.0.0 - Build: tsconfig.node.json, tsconfig.web.json; dual tsc output - Docs: tsconfig.doc.json, FEATURE_PARITY.md, README/CHANGELOG updates - Changelog: conventional-changelog-cli script, .versionrc.json - CI: publish workflow runs on push to master (install, test, build, publish) Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: All crypto methods now return Promises (async API). Migrate by adding await or .then() to encryptStringWithRsaPublicKey, decryptStringWithRsaPrivateKey, encrypt, decrypt, createPrivateAndPublicKeys, encryptBufferWithRsaPublicKey, decryptBufferWithRsaPrivateKey.
BREAKING CHANGE: Entry points are now build/node and build/web (conditional exports). The old single build/index.js is no longer published.
BREAKING CHANGE: decryptBufferWithRsaPrivateKey return type is now Promise (was Buffer). In Node the runtime value is still Buffer.
Pull Request Checklist
Please ensure that your pull request meets the following requirements:
npm testand all tests have passed.Description of Changes
Please provide a brief description of the changes made in this pull request:
Related Issues
If this pull request addresses one or more issues, please list them below (e.g.,
Fixes #123):Additional Context
Provide any additional context or screenshots that may be helpful during the review process: