Skip to content

Comments

Upgrade cryppo-js toolchain and dependencies#39

Merged
vijayshiyani merged 9 commits intomasterfrom
task/upgrade-dependencies
Feb 16, 2026
Merged

Upgrade cryppo-js toolchain and dependencies#39
vijayshiyani merged 9 commits intomasterfrom
task/upgrade-dependencies

Conversation

@vijayshiyani
Copy link
Contributor

@vijayshiyani vijayshiyani commented Feb 13, 2026

Upgrade cryppo-js toolchain and dependencies to v3.0.0

  • BREAKING: Minimum Node.js version raised from 12.4 to 22
  • Upgrade TypeScript 3.9 → 5.9
  • Replace bili/rollup build with dual CJS + ESM tsc output
  • Upgrade node-forge 0.10.0 → 1.3.x
  • Upgrade bson 4 → 7, yaml 1 → 2, buffer 5 → 6
  • Replace Jest + ts-jest with Vitest (native TypeScript support via Vite)
  • Upgrade Prettier 2 → 3
  • Replace TSLint (deprecated) with ESLint 9 flat config
  • Remove Karma browser test runner (deprecated since Apr 2023, no longer maintained; all crypto logic uses node-forge which is pure JS — Vitest covers all code paths)
  • Update GitHub Actions to v4, Node 22

- Target es2022 instead of es5, add es2022 lib
- Add tsconfig.build.cjs.json and tsconfig.build.esm.json for dual CJS+ESM output
- Add .nvmrc pinning Node 22
- Add trailingComma: es5 to Prettier config
- Update bson import to named export, wrap BSON.serialize with Buffer.from
- Switch yaml to named imports, pass schema: yaml-1.1 per-call
- Fix relative imports in decryption.ts and rsa-signature.ts
- Add @ts-expect-error for node-forge createBuffer Uint8Array usage
- Add Uint8Array return type to EncryptionKey.bytes
- Remove obsolete tslint:disable-next-line comments
- Clean up let→const where values are assigned once
- Update jest.config.js with ts-jest transformer config
- Remove try/done()/catch/done(err) wrappers from all async tests
- Jest 30 natively catches async rejections, making done() unnecessary
- Delete tslint.json (TSLint deprecated since 2019)
- Add eslint.config.mjs with typescript-eslint and eslint-config-prettier
- Delete karma.conf.js (Karma deprecated since Apr 2023)
- Remove 9 Karma-related packages (done in package.json commit)
- Add vite.config.ts for serving demo pages
- Update demo HTML: use script type=module, fix paths for Vite
- Move scss imports into TS files (Vite handles them natively)
- Version 3.0.0 with Node >=22.0.0 minimum
- Update all dependency versions in package.json and package-lock.json
- Remove Karma, Parcel, bili, TSLint, sass and legacy type packages
- Add ESLint, Vite, sass-embedded, typescript-eslint as dev deps
- Add package.json exports field for dual CJS+ESM
- Update CI workflows to Node 22, actions v4, npm ci
- Remove npm run browser step from all CI workflows
- Add CHANGELOG.md
- Update README.md to reference Vite instead of Parcel
@linasi
Copy link

linasi commented Feb 15, 2026

LGTM. Not sure why PR is marked as draft tho.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades cryppo-js toolchain and dependencies from v2.0.2 to v3.0.0, representing a major modernization effort. The upgrade includes Node.js 12.4→22, TypeScript 3.9→5.9, and updates to critical runtime dependencies (node-forge, bson, yaml, buffer). The build system transitions from bili/rollup to dual CJS+ESM TypeScript compilation, and the test/lint infrastructure migrates from deprecated tools (TSLint, Karma) to modern alternatives (ESLint 9, Jest 30).

Changes:

  • Raise minimum Node.js version from 12.4 to 22 (breaking change)
  • Replace deprecated tooling: TSLint→ESLint 9, Karma→Jest 30 only, Parcel→Vite
  • Upgrade runtime dependencies: node-forge 0.10→1.3, bson 4→7, yaml 1→2, buffer 5→6
  • Migrate Jest tests from done() callbacks to async/await pattern
  • Update test fixtures for node-forge 1.3 strict AES-256 key length enforcement
  • Modernize build to dual CJS+ESM output with TypeScript compiler

Reviewed changes

Copilot reviewed 38 out of 42 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Update version to 3.0.0, upgrade all dependencies, change build scripts for dual CJS+ESM output, update exports field
tsconfig.json Upgrade target to es2022, update lib to es2022
tsconfig.build.cjs.json New config for CommonJS build output to dist/cjs
tsconfig.build.esm.json New config for ES module build output to dist/esm with bundler resolution
eslint.config.mjs New ESLint 9 flat config replacing deprecated TSLint
tslint.json Removed deprecated TSLint configuration
jest.config.js Update ts-jest configuration for Jest 30 with migration notes
karma.conf.js Removed deprecated Karma browser test configuration
vite.config.ts New Vite configuration for demo pages
src/util.ts Update BSON and YAML imports for v7 and v2 APIs, add @ts-expect-error for node-forge type issues, format changes
src/encryption-key.ts Add explicit return type annotation to bytes getter
src/encryption/encryption.ts Change variable declarations from let to const, add @ts-expect-error comments for node-forge
src/decryption/decryption.ts Update imports organization, add @ts-expect-error for node-forge
src/signing/rsa-signature.ts Fix import path from ../../src/util to ../util
src/key-pairs/rsa.ts Remove tslint disable comments
src/key-derivation/derived-key.ts Remove tslint disable comments
test/**/*.spec.ts Migrate all async tests from done() callback pattern to async/await
test/encryption/encryption.spec.ts Update test fixtures with proper 32-byte keys for node-forge 1.3, add explanatory comment
test/decryption/decryption.spec.ts Update test fixtures with proper 32-byte keys and auth tags, add explanatory comment
test/serialization.test.ts Remove tslint disable comments
test/compatibility/compatibility.test.ts Add block scope to switch case, add @ts-expect-error comment
demo/*.html Remove stylesheet links from head, update script tags to type="module", fix navigation paths
demo/*.ts Add stylesheet imports at top of each demo file
.github/workflows/*.yaml Update Node version 10.x/13.x→22.x, upgrade actions to v4, change npm install→npm ci
CHANGELOG.md New changelog documenting v3.0.0 changes
.nvmrc New file specifying Node 22
.prettierrc Add trailingComma: 'es5' option
.npmignore Add eslint.config.mjs to ignore list
.gitignore Remove Parcel-specific comment
README.md Update demo port from 1234 (Parcel) to 5173 (Vite)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Rename demo/styles.scss to styles.css (CSS nesting is native)
- Update style imports in demo TS files
- Remove jest-junit reporter from jest.config.js
- Remove junit.xml from .gitignore and .npmignore
- Remove jest, ts-jest, @types/jest; add vitest
- Move test config into vite.config.ts, delete jest.config.js
- Replace jest.setTimeout/jasmine blocks with per-test timeout args
- Replace JEST_WORKER_ID with VITEST_POOL_ID for Node-only tests
- Add test/vitest-globals.d.ts for global type definitions
- Update .npmignore, CHANGELOG.md
@vijayshiyani vijayshiyani marked this pull request as ready for review February 16, 2026 00:11
@vijayshiyani vijayshiyani changed the title Task/upgrade dependencies Upgrade cryppo-js toolchain and dependencies Feb 16, 2026
@vijayshiyani
Copy link
Contributor Author

LGTM. Not sure why PR is marked as draft tho.

@linasi
I was experimenting with Vitest because Jest was too slow for compatibility tests, taking eight minutes. There was also a mismatch: jest@30 with ts-jest@29 and no version 30 of ts-node available. All good now, ready for review.

@linasi linasi removed their assignment Feb 16, 2026
Copy link

@linasi linasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@vijayshiyani vijayshiyani merged commit 8bb2b20 into master Feb 16, 2026
1 check 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.

2 participants