deckhearth/package.json
Randall Stillwell c72d006666 feat(test): adopt @playwright/test + ship playwright.config.js + visual scaffold (Brief 1 of adopt-playwright-smoke)
Closes P1 #10 step 2 / launch sequence step 10. PR #17 already
plumbed VERCEL_AUTOMATION_BYPASS_SECRET into both workflows' env;
this brief wires the actual @playwright/test dep, the
playwright.config.js that bridges env -> use.extraHTTPHeaders,
and a single visual spec so the screenshot workflow has something
to discover.

Per architect Decision 1 - tests/smoke/app.smoke.spec.ts stays as
.ts (npx eslint exits 0 against the current config); new visual
spec also .ts.

Per Decision 2 - playwright.config.js fail-loud in CI when
VERCEL_AUTOMATION_BYPASS_SECRET is missing (throw at config load
with actionable message naming the env var, rotation command,
AGENTS.md reference); warn-and-no-op in dev. Mirrors lib/rate-limit.js
fail-closed pattern (AGENTS.md Gotcha #12).

Per Decision 3 - two projects partitioned by testMatch:
  - smoke -> tests/smoke/**/*.spec.{ts,js}
  - visual -> tests/visual/**/*.spec.{ts,js}
Shared use: block. Matches the workflows' --project=smoke|visual
invocations.

Per Decision 4 - NO baselines committed. The Mac-vs-Linux platform-
suffix issue (architect Boot-the-brief Finding 7: Playwright's custom
snapshotPathTemplate has no {platform} token) means a Mac-generated
baseline would silently overwrite a Linux CI baseline. Queued as
seed-visual-baselines-on-linux follow-up convoy. First CI run of
Screenshot diff will fail at the test step; existing
continue-on-error: true swallows it and the comment-on-PR step
posts the run link.

Per Decision 5 - no eslint.config.mjs change.

Per Decision 6 - three simple scripts (test:smoke, test:visual,
test:visual:update). No auto-boot wrapper.

Verification:
  - npm ci --dry-run exits 0 (lockfile in sync)
  - npm run lint: 128 problems (baseline match - 81 errors, 47 warnings)
  - npm run test:run: 21/21 vitest pass (no regression)
  - npm run test:smoke (no BASE_URL): dev-path warn-and-continue
    fires "[playwright.config] VERCEL_AUTOMATION_BYPASS_SECRET unset"
    warning, enumerates 3 smoke tests, attempts to run (fails on
    missing local chromium binary - workflows install browsers via
    npx playwright install --with-deps chromium)
  - CI=true npm run test:smoke: CI-path throws at config load with
    "VERCEL_AUTOMATION_BYPASS_SECRET is required in CI to reach
    Vercel-Protection-protected preview deployments. Reseed via:
    gh secret set VERCEL_AUTOMATION_BYPASS_SECRET --body \"<value>\".
    See AGENTS.md \xc2\xa7 7 for the full plumbing context."
  - npx playwright --version: Version 1.60.0

Implementation note: removed the architect's defensive eslint-disable-
next-line no-console directive in the dev-warn branch because the
active eslint config does not enable no-console for repo-root config
files; ESLint reported the directive as unused, which would have
regressed the lint baseline by +1. Behavior unchanged; comment-only
edit per the brief's explicit "comment wording can be tightened"
allowance. Replaced with an explanatory comment noting why the
directive is intentionally absent.

Implementation note 2: alphabetized @playwright/test as the FIRST
entry in devDependencies (before @testing-library/dom) because
"@p" < "@t". The brief's prose said "between @testing-library/react
and autoprefixer" which would have broken alphabetization; followed
the brief's overarching principle ("alphabetical position") instead.

No code paths in pages/** or lib/** touched. No workflow YAML
edited. No AGENTS.md edits (doc-writer pass at convoy close handles
the seed-on-Linux runbook).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 18:44:52 -05:00

48 lines
1.4 KiB
JSON

{
"name": "tcg-vault",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint .",
"setup-db": "node scripts/setup-neon-db.js",
"import-popular": "node scripts/import-popular-sets.js",
"import-all": "node scripts/bulk-import-all.js",
"test": "vitest",
"test:run": "vitest run",
"test:smoke": "playwright test --project=smoke",
"test:visual": "playwright test --project=visual",
"test:visual:update": "playwright test --project=visual --update-snapshots"
},
"dependencies": {
"@neondatabase/serverless": "^1.0.1",
"@upstash/ratelimit": "^2.0.8",
"@upstash/redis": "^1.38.0",
"@vercel/blob": "^1.1.1",
"@vercel/postgres": "^0.10.0",
"bcryptjs": "^3.0.2",
"dotenv": "^17.2.1",
"jsonwebtoken": "^9.0.2",
"next": "^16.2.6",
"node-fetch": "^3.3.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"resend": "^4.7.0"
},
"devDependencies": {
"@playwright/test": "^1.60.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.2",
"autoprefixer": "^10.4.21",
"eslint": "^9.39.4",
"eslint-config-next": "^16.2.6",
"jsdom": "^29.1.1",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.17",
"typescript": "^5.9.3",
"vitest": "^3.2.4"
}
}