chore: add oxlint + oxfmt, upgrade TypeScript to 7, move installs to bun - #15
Merged
Conversation
Follow-up to the review feedback on #10: add a linter and formatter, upgrade TypeScript, and move installs to bun. Tooling matches hyperframes-oss so the template stays consistent with the project it is a template for: `oxlint .` with `.oxlintrc.json`, `oxfmt .` reading `.prettierignore`, and a `bun.lock` in place of `package-lock.json`. TypeScript goes 5.9 -> 7.0.2. Typecheck, the vitest suite and the full client + SSR build all pass on it. package.json and wrangler.jsonc are excluded from the formatter. oxfmt wants to reorder package.json's top-level keys (relocating the whole `cloudflare` block) and to add trailing commas throughout wrangler.jsonc. Both are cosmetic for a spec-compliant parser, but the Deploy to Cloudflare button parses exactly those bytes and is demonstrably strict about them — an empty "preview_image_url": "" broke it in #9. Not worth the risk for no gain. The `npm run prepare-assets` chaining inside the dev/build/deploy scripts is left alone deliberately: it works under both bun and npm, whereas `bun run` there would hard-require bun for npm users. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mechanical first run of the new formatter, kept as its own commit so the tooling change above stays readable. No behaviour changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Splits CI into three jobs so a formatting failure reports separately from a broken typecheck instead of hiding behind it: - lint: oxlint + oxfmt --check - check: typecheck, vitest, composition-manifest freshness - build: the vite client + SSR build, which nothing in CI covered before Installs move to `bun install --frozen-lockfile` via a SHA-pinned setup-bun, matching the existing pinning style. Test runs use `bun run test` rather than `bun test` so vitest is actually the runner. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Problem
Follow-up to Tom's review feedback on #10:
This is that second PR. (The other two items from that comment — committing the codegen'd file and adding typecheck + vitest to CI — Tom already landed in #10.)
Changes
Linter and formatter: oxlint + oxfmt. Tom offered prettier/oxfmt and eslint/oxlint as either-ors. Picked the oxc pair because that is what
hyperframes-ossalready runs, so a template for HyperFrames now matches HyperFrames:oxlint .with.oxlintrc.json(correctness: error, react + typescript plugins) andoxfmt .reading.prettierignore.oxlint reports zero findings on the existing tree, so it lands as a guard rather than a cleanup. I confirmed that is real and not a misconfigured no-op by injecting a throwaway file with a
debuggerstatement and an unkeyed list render — both were caught (no-debugger,react(jsx-key)), then removed.TypeScript 5.9 → 7.0.2. Typecheck, the 23-test vitest suite, and the full client + SSR build all pass on it.
Installs move to bun.
bun.lockreplacespackage-lock.json; README setup steps updated.CI split into three jobs so a formatting failure reports separately instead of hiding behind a broken typecheck:
lintoxlint,oxfmt --checkcheckbuildsetup-bunis SHA-pinned to match the existing pinning style. Tests run viabun run test, notbun test, so vitest stays the runner rather than being silently swapped for bun's.Two deliberate non-changes
package.jsonandwrangler.jsoncare excluded from the formatter. On its first run oxfmt wanted to reorderpackage.json's top-level keys (relocating the entirecloudflareblock belowengines) and to add trailing commas throughoutwrangler.jsonc. Both are cosmetic for a spec-compliant parser, but the Deploy to Cloudflare button parses exactly those bytes and is demonstrably strict about them — an empty"preview_image_url": ""broke it in #9 and surfaced as a misleading wrangler parse error (upstream cloudflare/workers-sdk#14831). Reformatting the input to a known-fragile parser for zero benefit is not a trade worth making. Both files are byte-identical tomainin this branch, and the reasoning is written into.prettierignoreso nobody quietly re-adds them.The
npm run prepare-assetschaining insidedev/build/deployis left as-is. It works under both bun and npm; switching it tobun runwould hard-require bun for anyone still on npm. Install is the thing standardising on bun, not the script bodies.The
Dockerfilestill usesnpm installfor the container's owncontainer/package.json. That is a separate dependency tree baked into the image and unaffected by the root package manager, so it is untouched.Testing
Full CI gate run locally against the committed tree, all green:
The format sweep is isolated in its own commit (
style: apply oxfmt across the tree) so the tooling and CI changes stay reviewable.Not verified end-to-end: that the Deploy button still provisions after the lockfile swap. It cannot be checked without a deploy, and the button caches its verdict per repo path for 30+ minutes. The mitigation is that both files it parses are unchanged here.
— Rames Jusso