Skip to content

feat!: add Node and Web dual build with async API (v4.0.0)#43

Merged
miladezzat merged 1 commit into
masterfrom
development
Jan 31, 2026
Merged

feat!: add Node and Web dual build with async API (v4.0.0)#43
miladezzat merged 1 commit into
masterfrom
development

Conversation

@miladezzat
Copy link
Copy Markdown
Owner

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.

  • 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)

Pull Request Checklist

Please ensure that your pull request meets the following requirements:

  • My code follows the existing code style and structure.
  • I have run npm test and all tests have passed.
  • I have added/updated unit tests for any new or modified functionality.
  • I have updated the documentation (if needed).
  • This pull request is ready for review and merging.

Description of Changes

Please provide a brief description of the changes made in this pull request:

  • What does this pull request do?
  • What problems does it solve?
  • Are there any side effects or breaking changes?

Related Issues

If this pull request addresses one or more issues, please list them below (e.g., Fixes #123):

  • Fixes #

Additional Context

Provide any additional context or screenshots that may be helpful during the review process:

  • Context: [Link to any relevant context, issue, or resources]
  • Screenshots (if applicable):

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>
@miladezzat
Copy link
Copy Markdown
Owner Author

resolve issue #42 and #41

@miladezzat miladezzat merged commit 1dc11ef into master Jan 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant