Repository navigation
fix: Android 3-digit hex + iOS UPC-A, repair toolchain, replace CI - #20
Conversation
The CircleCI config ran circleci/node:10 while package.json requires Node >= 18 and pins Yarn 3.6.1, and its install step used Yarn v1 flags (--cwd, --frozen-lockfile) that Yarn 3 rejects, so the pipeline could not run at all.
The file is gitignored and regenerated without a trailing newline on every `expo start`/`expo run`, which reintroduced a prettier/prettier error after each run of the example app.
checkSum() weighted digits from the left (x1, x3, x1, ...), which is the EAN-13 rule. Applied to a 12-digit UPC-A the weights land on the wrong parity, so every valid code failed validation, drawOutputImage() returned nil and the view stayed blank. drawUPCA() was correct and simply never reached. The check digit is always rightmost and always counts x1, so anchoring the alternation there is correct for both lengths. Verified on the simulator: the UPC-A sample region went from 100% background to a real barcode, with EAN-13 unchanged.
Added: iOS UPC-A fixRunning the example on an iOS simulator (first iOS build in this branch) surfaced a second, pre-existing bug: UPC-A rendered nothing on iOS, while Android rendered it fine.
For the example's own The check digit is always rightmost and always counts x1, so anchoring the alternation there is correct for both lengths. Verified on iPhone 17 Pro simulator, sampling the UPC-A cell:
Also verified on both platforms that Known remaining divergence (not addressed here)iOS requires exactly 12 digits with a valid check digit for UPC-A (13 for EAN-13). Android accepts |
The license badge pointed at github.com/nicovitt, an unrelated account. Keywords listed only the platforms, so npm searches for barcode, qrcode, pdf417 and the rest never surfaced the package.
What
Repairs a broken dev toolchain, fixes one Android rendering bug, and replaces a CI pipeline that could not run.
fix:3-digit hex colors on AndroidBarcodeView.handleColorexpanded#RGBby concatenating the digits rather than doubling them, so#0AFbecame#0AF0AFinstead of#00AAFF. iOS already expanded correctly, so the two platforms disagreed on every shorthand color.Verified on a physical device (Huawei JNY-LX1, RN 0.83): two QR codes rendered side by side with
#0AFand#00AAFFnow sample to identical pixels.chore:toolchain repairbabel.config.jsreferencedmetro-react-native-babel-preset, replaced by@react-native/babel-presetin RN 0.73 and no longer installed. Jest could not transform anything and ESLint failed to parse any file it read through Babel.typechecknow runs againsttsconfig.build.json. The root config also pulls inexample/, whose@/*aliases are invisible from the root and whosereact-native@0.83.2collides with the root's0.73.2— both declare the same ambientcodegenNativeComponentmodule with incompatibleHostComponent<P>definitions.@types/react-native(obsolete since RN 0.71 ships its own types) and theresolutionspin holding@types/reactat 17, which was also forcing 17 onto the example app that needs 19.expo-env.d.ts.ci:CircleCI → GitHub ActionsThe CircleCI config ran
circleci/node:10against a package requiring Node >= 18 and pinning Yarn 3.6.1, with Yarn v1 install flags that Yarn 3 rejects. It also invokedyarn typescript, a script that no longer exists.style:/docs:Prettier formatting across
src/andexample/, and a newCLAUDE.md.Checks
yarn lint,yarn typecheck,yarn test, andyarn prepareall pass locally.Notes
yarn lintstill emits 35 warnings, all inexample/— 34 arereact/react-in-jsx-scopefalse positives from@react-native/eslint-config@0.72.2predating the automatic JSX runtime. Warnings only; lint exits 0.yarn testruns a singleit.todoplaceholder. There is no real coverage yet.src/BarcodeCreatorNativeComponent.ts; not addressed here.