github zxing-js/library v0.22.0

7 hours ago

Changelog: feature/modernize26 vs master

New Feature: MicroQR Code Support

  • Added full MicroQR Code reader implementation (src/core/microqr/)
    • Detector, decoder, bit matrix parser, data masking, format information, version handling
  • Registered MicroQRCodeReader in MultiFormatReader and BarcodeFormat
  • Exported all MicroQR types from src/index.ts
  • Added test suite with black-box tests and 3 sample images (src/test/resources/blackbox/microqr-1/)

Bug Fixes

  • RSS14Reader (src/core/oned/rss/RSS14Reader.ts): Fixed finder pattern center calculation — off-by-one corrected (startEnd[0] + startEnd[1] - 1); non-throwing errors (other than NotFoundException) no longer silently swallowed; new String() replaced with String(); strict equality (===) fixes
  • StringEncoding (src/core/util/StringEncoding.ts): Removed shouldDecodeOnFallback workaround for ISO-8859-1 — Node ≥ 18 native TextDecoder handles all Latin-1 bytes correctly, fixing URIError: URI malformed on characters like ó
  • RSS14Reader finder pattern: findFinderPattern()[1] now correctly points to the outside pixel of the finder pattern

Toolchain Modernization

Area Before After
TypeScript v3 v6
Test runner Mocha + Karma Jest 30 + ts-jest
Linter TSLint ESLint 10 + @typescript-eslint v8 (flat config)
Bundler config rollup.config.js (Rollup v2) rollup.config.mjs (Rollup v4)
Node requirement >= 10.4.0 >= 24.0.0
Package manager yarn npm

Configuration Changes

  • Added jest.config.js, tsconfig.test.json, src/test/jest.setup.ts
  • Added eslint.config.mjs (flat config); removed .eslintrc, tslint.json
  • Removed karma.conf.js
  • Updated tsconfig.json: added ignoreDeprecations: "6.0", strictNullChecks: false, useUnknownInCatchVariables: false, lib: ["es2020","dom"], rootDir: "./src"
  • Updated tsconfig.lib-cjs.json and tsconfig.lib-esm.json: added ignoreDeprecations: "6.0"
  • CI/CD workflows updated for Node 24 and new toolchain

Package Changes

  • Version: 0.21.30.22.0
  • License: MITApache-2.0. Actually License has always been Apache but package.json stated it was MIT which is wrong!
  • Removed: chai, mocha, karma-*, tslint, nyc, sinon, @types/chai, @types/mocha, @types/seedrandom@2
  • Added: jest, ts-jest, eslint@10, typescript-eslint, @types/jest, @types/seedrandom@3
  • Updated: rollup v2→v4, sharp v0.32→v0.34, typescript v3→v6, seedrandom v2→v3, terser (removed deprecated --screw-ie8 flag)

Don't miss a new library release

NewReleases is sending notifications on new releases.