Port to Bun, upgrade dependencies and move CI to GitHub Actions - #16
Merged
Merged
Conversation
Replace npm with Bun as package manager, script runner and server runtime. Client and server become workspaces under the root, so a single bun install sets up everything. - Swap nodemon for bun --watch - Drop the unused node-sass (sass is already used) and concurrently - Declare dotenv and @graphql-tools/merge as server dependencies, since isolated installs no longer hoist them - Import defineConfig from vitest/config in the server, which does not depend on vite - Run CI on oven/bun and re-enable the server test job Co-Authored-By: Claude Opus 5.5 <[email protected]>
Apollo Server 5, Mongoose 9, MongoDB driver 7, mongodb-memory-server 11 and Vitest 5. graphql stays on 16, which Apollo Server 5 requires. - Drop dotenv in favour of Bun's built-in .env loading - Remove the connect options the MongoDB 7 driver no longer accepts - Download the MongoDB binary in a global setup, so parallel test files don't race for the same lockfile on a cold cache Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Vite 8, Vitest 5, @vitejs/plugin-react 6, jsdom 30, Sass, Playwright and dotenv. Vitest now resolves its config from --root, so point it at the tests with --dir instead to keep vite.config.ts in use. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also bumps Testing Library to 16, which needs @testing-library/dom as an explicit peer. React 19 treats a value returned from a ref callback as its cleanup, so the search result ref callback no longer returns the assignment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
react-router-dom was folded into react-router in v7. RouterProvider comes from react-router/dom so it can use react-dom's flushSync. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Move the search adornment from the removed TextField InputProps to slotProps.input - Wrap the user menu items in a MenuList, which MenuItem now requires Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Import React hooks, ApolloProvider and MockedProvider from their new /react entry points, and add the rxjs peer dependency - Drop MockedProvider's removed addTypename prop - Type every query document with TypedDocumentNode, since untyped results are now unknown instead of any The typed results surfaced a few latent bugs: the movies page checked the length of the result object instead of the movie list, so it never showed "No movies found", and pressing Enter in an empty search threw. Co-Authored-By: Claude Opus 5.5 <[email protected]>
faker is used at runtime by UserContext, so it moves to dependencies. uuid ships its own types, so @types/uuid is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ESLint 10 is out, but eslint-plugin-react and eslint-plugin-import only support up to 9. - Replace .eslintrc.cjs with eslint.config.mjs and the typescript-eslint meta package - Resolve imports with eslint-import-resolver-typescript, since the node resolver doesn't understand exports-only packages like react-router 8 - Derive the movie count on the movies page during render, which the new react-hooks set-state-in-effect rule requires - Remove a stale disable comment in the server Co-Authored-By: Claude Opus 5.5 <[email protected]>
TypeScript 7 ships without a JS API, which typescript-eslint needs. Following the side-by-side setup from the 7.0 release notes, typescript is aliased to @typescript/typescript6 for tooling, and TypeScript 7 is installed as @typescript/native so tsc runs the 7.0 compiler. TypeScript no longer includes every @types package by default, so the client declares the Vitest globals it uses explicitly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replace the deprecated grid-gap with gap, which the new property-no-deprecated rule flags. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Snapshot changes are markup only: MUI class names and icon paths, React 19 useId formats, and CSS module hashes. The StarRating snapshot test now waits for the fetched rating, since Apollo 4's MockedProvider delays responses and the snapshot was otherwise taken before the rating arrived. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Oxlint's type-aware rules run on tsgolint, which is built on the TypeScript 7 compiler. That removes the need for typescript-eslint and the TypeScript 6 alias, so typescript is a plain ^7 dependency again. - The React, hooks and fast refresh rules are native Oxlint rules - Import sorting keeps eslint-plugin-simple-import-sort, loaded as an Oxlint JS plugin - Prettier runs on its own instead of through ESLint - Drops ESLint and ten plugins, configs and resolvers - VS Code recommends the Oxc extension and fixes on save with it Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fast refresh only works for files that export components alone, so UserContext.tsx now only exports the provider. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Await Playwright's web-first assertions, which silently passed when left floating, and wait for URLs directly instead of wrapping waitForURL in a truthy check - Assert rejections with rejects.toThrow in the server tests, which passed when nothing was thrown - Sort ratings numerically in the rating order test - Mark fire-and-forget navigate and Apollo calls with void, and stop awaiting setTimeout in the search component - Await the waitFor in the UserContext test and assert on the rating in the StarRating test - Go to /movie/852436 in e2e tests, which no longer live under /project2 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The config parsed SCSS with the LESS parser and CSS-in-JS with postcss-lit, though the project only has SCSS modules. Switching to the SCSS standard config also makes most of the disabled rules unnecessary. Drops postcss-less, postcss-lit, stylelint-config-standard and stylelint-scss, which the SCSS config already includes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep only the options that differ from Prettier 3's defaults, and run it on the whole repository instead of src folders only. Prettier already skips gitignored files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mostly CRLF line endings, which endOfLine: auto used to hide, and markdown and GraphQL files outside src. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Follows the current Vite template: tsconfig.app.json covers src with vite/client and Vitest globals types, and tsconfig.node.json covers the config files and e2e tests, which were not type-checked before. The root tsconfig only references the two, and tsc -b checks both. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Serve tests from http://localhost:5173 instead of the old /project2 base path, which Vite no longer uses - Point the dev server at the local API during e2e runs and start the server with cwd instead of cd - Report to GitHub annotations in CI - Drop dotenv, which the config no longer needs, and the unused @vitest/ui - Make test:unit a single run, add test:unit:watch and typecheck Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bun's test runner replaces Vitest and Vite on the server, and runs the suite in about 1.5 seconds. The MongoDB binary download moves to a test preload. - Move mongodb-memory-server to devDependencies, so production installs on Render don't download a MongoDB binary - Drop the direct mongodb dependency, which only Mongoose uses, and the unused config/db.js - Compare genre ids instead of matching Mongoose documents with objectContaining, which bun:test can't read Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rename the package to bingewatcher, drop the unused directories field, and replace the pipeline script with check, which runs the same steps as CI. Build scripts only cover the client, since the server has no build step. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lint, client tests, server tests and e2e tests run as parallel jobs. There is no build job, since Vercel builds the client and Render runs the server from source. To keep the jobs fast: - A composite action caches Bun's package store, and each job installs only the workspaces it needs - The MongoDB binary and Playwright's Chromium are cached, and only the headless shell is installed - Superseded runs on the same branch are cancelled The e2e job needs a DB_URI secret pointing at the test database, and fails early when it's missing. The GitLab config stays as a legacy file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Rewrite the root README around the new requirements and setup, with env files, scripts, e2e tests, CI and deployment - Update the client and server READMEs to the new scripts, bun test and the server's environment variables - Describe the GitHub Actions jobs and the DB_URI secret in ci.md - Replace the NTNU VM guide with deployment docs for Vercel and Render - Fix stale paths and tools in the Playwright, testing, database and file structure docs Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replaces an any and its stale ESLint disable comment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Barrel imports from @mui/icons-material load every icon module in tests and in the dev server, since neither tree-shakes. Path imports, which some files already used, cut the unit tests' import time roughly in half. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Threads start faster than the default forked processes, which makes the suite about 15% faster. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The click tests checked hashed CSS module class names, which never match, so their assertions always passed. They also finished before the mutation resolved, leaving a state update to land after jsdom was torn down, which failed CI once tests ran in threads. Both tests now wait for the button's accessible name to flip, and the small button test checks that no text label renders. Co-Authored-By: Claude Opus 5.5 <[email protected]>
start:e2e starts the server against mongodb-memory-server, seeded with a small, predictable set of genres and movies. The server now reads the database URI from its first argument or the URI variable, which drops the CI and NODE_ENV=manual special cases the old GitLab job needed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tests that expect the test database's movies are tagged @test-db and skipped, unless E2E_TEST_DB_URI points at that database. The rest run against the seeded e2e server, so CI no longer needs a DB_URI secret. The e2e servers use their own ports, so a run never reuses a dev server connected to another database. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch was successfully deployed
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.
Moves the project from npm to Bun, upgrades every dependency, replaces ESLint with Oxlint, and ports CI from GitLab to GitHub Actions.
Bun
clientandserverare Bun workspaces, so onebun installsets up everything. A singlebun.lockreplaces the threepackage-lock.jsonfiles.bun --watchreplaces nodemon, and Bun's built-in.envloading replaces dotenv.bun testinstead of Vitest, in about 1.5 s.Upgrades
react-router-dom6 →react-router8graphqlstays on 16, which both Apollo Server 5 and Apollo Client 4 require.Tooling
eslint-plugin-simple-import-sortas an Oxlint JS plugin. ESLint, typescript-eslint and ten plugins, configs and resolvers are gone. Linting takes about 1.3 s.stylelint-config-standard-scss. Before, it parsed SCSS with the LESS parser and had a CSS-in-JS parser for files with no CSS.endOfLine: autoexposed some CRLF files, which are reformatted.tsconfig.app.jsonandtsconfig.node.json, checked withtsc -b. This also type-checks the e2e tests and config files, which weren't checked before.bun run checkruns every check CI runs, except e2e.Fixes
/project2base path.start:e2e, a server backed by an in-memory MongoDB with a small seeded dataset, so no database access or secrets are needed.@test-dband skipped, unlessE2E_TEST_DB_URIis set.URI. This drops theCIandNODE_ENV=manualmodes the old GitLab job needed.UserContextanduseUsermove to their own module, so fast refresh works.try/catcharoundexpect, so they passed when nothing threw.CI on GitHub Actions
ci.ymlruns four parallel jobs on pull requests and pushes tomain: lint and typecheck, client unit tests, server tests, and e2e. There's no build job, since Vercel and Render build on deploy. With warm caches each job takes about 20 s.What keeps it fast:
.gitlab-ci.ymlstays as a legacy file.Deployment
Neither platform's settings are changed here. docs/deployment.md lists the expected settings:
bun run build, outputclient/dist.bun install --frozen-lockfile --production --filter bingewatcher-server, thenbun run start. This skipsmongodb-memory-server, which moved to devDependencies.Testing
bun run checkpasses: lint, style lint, format, typecheck, 67 client tests and 21 server tests.@test-dbtests weren't run, since the test database isn't available.🤖 Generated with Claude Code