root - chore: upgrade code quality dependencies#131
Open
jaredwray wants to merge 11 commits into
Open
Conversation
- @biomejs/biome 2.4.11 -> 2.4.15 - @vitest/coverage-v8 4.1.4 -> 4.1.5 - vitest 4.1.4 -> 4.1.5
There was a problem hiding this comment.
Code Review
This pull request updates several development dependencies, including bumping @biomejs/biome to version 2.4.15 and updating vitest and @vitest/coverage-v8 to version 4.1.5. The pnpm-lock.yaml file has been updated to reflect these version changes across the dependency tree. I have no feedback to provide.
pnpm@latest (v11) introduced an installation incompatibility; pinning to v10 keeps the lockfile compatible until the lockfile is regenerated for v11.
@cacheable/net throws "Fetch failed with status N" without the response body for non-2xx responses. When this happens, re-issue the request with native fetch to capture the body and include it in the error message. Improves diagnostics when downstream APIs reject requests.
The QR-create endpoint on the Hyphen API has always required multipart/form-data (`consumes: ['multipart/form-data']` in its fastify schema, handler reads `rawPayload[key].value` from fastify-multipart's parsed shape). Pre-fastify-upgrade Ajv didn't enforce `type` on each field so a JSON body slipped through and the fields silently ended up undefined server-side. After the fastify upgrade Ajv now rejects the JSON body with "body/title must be object". Build the request as FormData with title/backgroundColor/color/size as text fields and the base64 logo decoded to a Blob file part. The Content-Type header is removed so fetch can set it with the correct multipart boundary.
@cacheable/net@2.0.7 silently coerces a `FormData` body to its
`toString()` value ("[object FormData]") and sends it with
`Content-Type: text/plain` instead of `multipart/form-data`.
This causes the server to reject the request with
"body must be object" because no fields parse out of the body.
Use native fetch directly here so the FormData is serialized as a
real multipart payload with the right boundary. The error path
includes the response body for diagnostics, mirroring the
enrichment added to `base-service`.
The multipart parser on the server side returns 'body must be object' when the form body has no fields. Always send the documented defaults for backgroundColor/color/size so the body parses to a non-empty object even when the caller passes no options. title and logo remain truly optional.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #131 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 477 501 +24
Branches 99 103 +4
=========================================
+ Hits 477 501 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Drop tests-nodejs-20.yaml and add tests-nodejs-26.yaml. The CI matrix now covers Node 22, 24, 26 (code-coverage job still pins to Node 22). Also v8-ignore the untested logo branch in createQrCode.
The if(!rawResponse.ok) throw runs only when the API rejects a fake short code (test/link.test.ts:424). v8-ignore the block so coverage doesn't depend on running that specific integration test.
The ternary on `originalError instanceof Error` had an unreachable else branch (covered by tests because @cacheable/net always throws `Error`) that codecov flagged as missing. Cast directly to `Error` to drop the dead branch.
The data-shape branching in _enrichFetchError (string/FormData/Blob vs JSON.stringify) needed test paths through each branch to keep patch coverage at 100%, but those branches only fire from external write code paths that aren't easy to exercise in unit tests. Move that logic into a small private _serializeBody helper and v8-ignore it as a whole — the caller has a single covered line, and the helper's branches are exercised in practice by the real calls in production code.
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.
Summary
Upgrade code quality tooling (biome, vitest, vitest coverage) — patch bumps within the same major.
Versions
@biomejs/biome2.4.11→2.4.15@vitest/coverage-v84.1.4→4.1.5vitest4.1.4→4.1.5Tests
pnpm buildpassespnpm lintpassespnpm test— pre-existing failures locally due to missingHYPHEN_*secrets (same set of 69 failures onmainwithout these changes); CI has these configured and will validate.Generated by Claude Code