Skip to content

feat: add test fix types replace to supabase#35

Merged
makuchpatryk merged 3 commits into
mainfrom
feat-add-extra-vitest
May 26, 2026
Merged

feat: add test fix types replace to supabase#35
makuchpatryk merged 3 commits into
mainfrom
feat-add-extra-vitest

Conversation

@makuchpatryk
Copy link
Copy Markdown
Collaborator

No description provided.

@makuchpatryk makuchpatryk requested a review from Copilot May 25, 2026 21:46
@makuchpatryk makuchpatryk self-assigned this May 25, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
perplex-image Ready Ready Preview, Comment May 26, 2026 3:39pm

Added two-step type checking:
- nuxt typecheck: type-checks .vue and .ts files via vue-tsc
- tsc --noEmit: ensures all project .ts files are covered

Also added ignoreDeprecations to suppress TypeScript 7.0 deprecation warning.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Vitest-based unit testing for key composables, updates the game’s multi-select/drag highlighting behavior (with corresponding E2E updates), and replaces the server-side image source from Pexels-proxying routes to a Supabase-backed adapter (plus an image upload script).

Changes:

  • Added Vitest unit test setup and new unit tests for core/game composables.
  • Enhanced multi-select drag UX (selection/highlight state + new drag events) and updated Playwright E2E tests accordingly.
  • Switched /server/api/get-images and /server/api/get-image to use a new Supabase adapter; added an image upload/compress script and updated runtime config/CSP.

Reviewed changes

Copilot reviewed 46 out of 50 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
vitest.config.js Switches Vitest config import, adds unit test setup/include, expands aliases.
types/nuxt-icon.d.ts Adds a #imports typing shim for Nuxt auto-imports.
tsconfig.json Adjusts TS options and adds path aliases (including #imports).
tests/units/useStopwatch.test.ts Adds unit tests for stopwatch composable.
tests/units/useShuffle.test.ts Adds unit tests for shuffle/piece generation logic.
tests/units/useImage.test.ts Adds unit tests for shuffle + imageToBase64.
tests/units/useEventGame.test.ts Adds unit tests for selection/swaps/drag behaviors.
tests/units/setup.ts Adds Vitest setup stubs for Nuxt auto-imported composables in tests.
tests/units/mocks/fixtures.ts Adds shared factories for unit test data.
tests/e2e/README.md Formatting/consistency edits to E2E docs.
tests/e2e/multi-select.spec.ts Updates selectors and adds coverage for group-drag preview highlighting.
tests/e2e/main.spec.ts Formatting updates to keep assertions readable.
tests/e2e/fixtures.ts Updates fixture naming/docs; removes Pexels-specific field(s).
tests/e2e/advanced.spec.ts Updates layout assertions to match new UI controls.
specs/unit-tests.md Adds a written plan/spec for unit test coverage and setup.
server/utils/adapters/supabase-adapter.ts Implements Supabase-backed image adapter (list/get by ID).
server/utils/adapters/image-adapter.ts Adds adapter interface for image providers.
server/api/get-images.ts Replaces Pexels proxy with Supabase adapter list call.
server/api/get-image.ts Replaces Pexels proxy with Supabase adapter single-image call.
scripts/uploadImages/upload.ts Adds local script to compress to WebP and upload to Supabase Storage.
scripts/uploadImages/README.md Documents the Supabase upload script.
scripts/uploadImages/.gitignore Ignores upload working directories.
README.md Replaces starter README with project-focused README and commands.
pnpm-workspace.yaml Adds pnpm build allowances (native deps like sharp).
package.json Adds typecheck script, upload script, deps for Supabase/sharp/tsx, bumps Vitest.
nuxt.config.ts Adds Supabase runtime config and updates CSP for Supabase domains.
modules/ui/index.ts Adds TS suppression comments for Nuxt module auto-discovery typing.
modules/game/views/MainView.vue Updates image selection types and changes preview/loading rendering.
modules/game/views/GameView.vue Updates UI layout and integrates new highlight/drag events.
modules/game/types/index.ts Renames types and changes highlight field to highlightPositions.
modules/game/pages/game/[...id].vue Derives level from query and passes to GameView.
modules/game/index.ts Adds TS suppression comments for Nuxt module auto-discovery typing.
modules/game/composables/useShuffle.ts Makes composable synchronous; imports computed explicitly.
modules/game/composables/useEventGame.ts Makes composable synchronous; adds highlightPositions + drag context events.
modules/game/components/SelectImageModal.vue Updates types and fixes template formatting.
modules/game/components/Piece.vue Adds drag-start/drag-end events and data-selected/data-highlighted attrs for tests.
modules/core/types/index.ts Renames Pexels types to generic image types and removes avg_color.
modules/core/store/images.ts Updates store typing and switches to new API response shape.
modules/core/index.ts Adds TS suppression comments for Nuxt module auto-discovery typing.
modules/core/composables/useStopwatch.ts Makes composable synchronous; imports ref explicitly.
modules/core/composables/useImage.ts Makes composable synchronous.
layouts/game.vue Formatting cleanup.
layouts/default.vue Formatting cleanup.
E2E_TESTS_SETUP.md Formatting/consistency edits.
CLAUDE.md Adds repository working agreement / workflow documentation.
.github/workflows/main.yml Minor formatting fix.
.github/workflows/e2e.yml Minor formatting cleanup.
.github/copilot-instructions.md Markdown formatting adjustments.
.github/actions/install/action.yml YAML quoting/formatting cleanup.
Comments suppressed due to low confidence (1)

modules/game/views/GameView.vue:60

  • useEventGame() was changed to a sync function, but it’s still awaited here. Removing the await will avoid turning this component into an async-setup component.
} = await useEventGame(props, data, {
  openModal,

Comment thread modules/game/views/GameView.vue
Comment thread modules/game/views/MainView.vue Outdated
Comment thread server/utils/adapters/supabase-adapter.ts
Comment thread README.md
Comment thread modules/core/types/index.ts
Comment thread README.md
Comment thread README.md
Comment thread tests/units/useImage.test.ts
Comment thread CLAUDE.md
Comment thread vitest.config.js
@makuchpatryk makuchpatryk force-pushed the feat-add-extra-vitest branch from 1116fbe to 661129b Compare May 26, 2026 15:30
@makuchpatryk makuchpatryk merged commit 45614e5 into main May 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants