Repository navigation
Complete repo hardening and issue closure batch - #15
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository by adding CI quality gates (including secret scanning), introducing a Vitest + Testing Library test baseline, re-enabling lint coverage for operational scripts, updating dependencies, and documenting local setup and script usage.
Changes:
- Add GitHub Actions CI workflow with lint/test/build/audit plus gitleaks secret scanning.
- Introduce Vitest configuration + JSDOM setup and add initial unit/component/page tests.
- Re-enable ESLint coverage for
scripts/**, add script-focused lint command, and refresh README guidance (env + scripts).
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/ci.yml |
Adds CI jobs for gitleaks secret scanning and quality gates (lint/test/build/audit). |
eslint.config.mjs |
Removes scripts/** from global ignores and adds a scripts-specific rule override. |
package.json |
Adds lint:scripts, test, test:watch scripts; adds testing deps and upgrades several packages. |
package-lock.json |
Locks new/updated dependency versions for CI-reproducible installs. |
vitest.config.ts |
Configures Vitest with JSDOM, setup file, globals, and @ path alias. |
src/test/setup.ts |
Adds Testing Library jest-dom matchers and a matchMedia mock for JSDOM. |
src/lib/utils.test.ts |
Adds unit tests for cn utility behavior. |
src/hooks/use-pwa-install.test.tsx |
Adds hook tests for PWA installability/installation behavior. |
src/components/ui/status-indicator.test.tsx |
Adds component tests for StatusIndicator variants and helpers. |
src/app/offline/page.test.tsx |
Adds a page-level render smoke test for the offline route. |
README.md |
Documents local env setup, quality commands, and portable script usage examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| test: { | ||
| environment: "jsdom", | ||
| setupFiles: ["./src/test/setup.ts"], | ||
| globals: true, |
| @@ -0,0 +1,16 @@ | |||
| import { cn } from "./utils"; | |||
| @@ -0,0 +1,30 @@ | |||
| import { render, screen } from "@testing-library/react"; | |||
| import { StatusBadge, StatusDot, StatusIndicator } from "./status-indicator"; | |||
| @@ -0,0 +1,25 @@ | |||
| import { render, screen } from "@testing-library/react"; | |||
| import type { ReactNode } from "react"; | |||
| import OfflinePage from "./page"; | |||
Comment on lines
+1
to
+9
| import { act, renderHook, waitFor } from "@testing-library/react"; | ||
| import { usePWAInstall } from "./use-pwa-install"; | ||
|
|
||
| describe("usePWAInstall", () => { | ||
| const originalAlert = window.alert; | ||
| const originalUserAgent = navigator.userAgent; | ||
|
|
||
| beforeEach(() => { | ||
| Object.defineProperty(window, "alert", { value: vi.fn(), configurable: true }); |
Comment on lines
+8
to
+17
| beforeEach(() => { | ||
| Object.defineProperty(window, "alert", { value: vi.fn(), configurable: true }); | ||
| Object.defineProperty(navigator, "userAgent", { value: "Mozilla/5.0 Chrome", configurable: true }); | ||
| Object.defineProperty(navigator, "vendor", { value: "Google Inc", configurable: true }); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| Object.defineProperty(window, "alert", { value: originalAlert, configurable: true }); | ||
| Object.defineProperty(navigator, "userAgent", { value: originalUserAgent, configurable: true }); | ||
| }); |
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 |
Comment on lines
37
to
+52
| "devDependencies": { | ||
| "@tailwindcss/postcss": "^4", | ||
| "@types/node": "^20", | ||
| "@types/react": "^19", | ||
| "@tailwindcss/postcss": "^4.2.1", | ||
| "@testing-library/jest-dom": "^6.9.1", | ||
| "@testing-library/react": "^16.3.2", | ||
| "@types/node": "^20.19.37", | ||
| "@types/react": "^19.2.14", | ||
| "@types/react-dom": "^19", | ||
| "dotenv": "^17.2.3", | ||
| "eslint": "^9", | ||
| "dotenv": "^17.3.1", | ||
| "eslint": "^9.39.4", | ||
| "eslint-config-next": "16.1.7", | ||
| "tailwindcss": "^4", | ||
| "jsdom": "^26.1.0", | ||
| "tailwindcss": "^4.2.1", | ||
| "ts-node": "^10.9.2", | ||
| "tsx": "^4.21.0", | ||
| "typescript": "^5" | ||
| "typescript": "^5", | ||
| "vitest": "^3.2.4" |
This was referenced Mar 17, 2026
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.
This PR completes the open improvement backlog with verified implementation.\n\n## Completed\n- Added CI workflow with lint, test, build, and audit gates\n- Added secret scan gate (gitleaks)\n- Added Vitest + Testing Library baseline with 11 passing tests\n- Re-enabled script linting scope in ESLint config\n- Dependency maintenance batch applied and validated\n- Improved README with env + script usage guidance\n\n## Verification\n- npm run lint\n- npm test\n- npm run build\n- npm audit --json\n\nCloses #9\nCloses #10\nCloses #11\nCloses #12\nCloses #13\nCloses #14