feat: add test fix types replace to supabase#35
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
91e2fab to
72edaae
Compare
72edaae to
4681f0a
Compare
There was a problem hiding this comment.
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-imagesand/server/api/get-imageto 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 theawaitwill avoid turning this component into an async-setup component.
} = await useEventGame(props, data, {
openModal,
4681f0a to
7983734
Compare
7983734 to
a278c87
Compare
a278c87 to
076ea3b
Compare
7acfa12 to
b51e3af
Compare
b51e3af to
5343819
Compare
5343819 to
462b898
Compare
Copilot stopped work on behalf of
makuchpatryk due to an error
May 26, 2026 14:31
69e7575 to
1116fbe
Compare
1116fbe to
661129b
Compare
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.
No description provided.