尚未检测到更新。GitHub 发布版本后会显示在这里。
Paste a git diff, see which tests need to run and the import chain that explains why. Next.js + TypeScript, Playwright, Azure.
翻译准备中
正在加载完整 README。
查看完整 README ↗Paste a git diff and see exactly which tests need to run. Every selected test comes with the import chain that connects it to your change, so you can check the reasoning instead of trusting it.
Live demo: test-impact-explorer.vercel.app. Click an example to see it work.
Most CI pipelines run the whole test suite on every change. For a JavaScript or
TypeScript codebase you can do better with static analysis: build the import graph,
walk it backwards from the files you touched, and run only the tests that can reach
them. Changing src/utils/date.ts in the bundled sample project needs 3 of its 8
tests, and the tool shows why each of those 3 was picked:
date.ts → payments/gateway.ts → checkout.ts → checkout.spec.ts (3 hops)
git diff, git diff --name-status main, or a
plain list of paths. Handles added, deleted and renamed files.export … from barrels, dynamic
import(), CommonJS require, @/ path aliases, extension-less imports,
index files, and TS ESM-style ./file.js imports that point at file.ts.node_modules, build output and large files are skipped.npx vitest run … for the selected tests.POST /api/analyze for scripts and CI.src/lib/impact/parseImports.ts).index files and .js to .ts
(resolve.ts). Package imports are external and ignored.graph.ts).impact.ts).The analysis is pure TypeScript with no Node or DOM APIs, so the same code runs in the API route, the browser and the unit tests.
It's static analysis, so it can't see dependencies that don't appear as imports:
import(\./locales/${lang}`)` and other computed pathsfs)paths beyond simple prefix aliasesA real CI integration should still run the full suite on main.
curl -X POST http://localhost:3000/api/analyze \
-H "content-type: application/json" \
-d '{
"files": {
"src/a.ts": "export const a = 1;",
"src/b.ts": "import { a } from \"./a\"; export const b = a;",
"src/b.test.ts": "import { b } from \"./b\";"
},
"changes": "M\tsrc/a.ts"
}'
The response has summary (counts and the % of the suite skipped), affectedTests
(each with distance, chain and triggeredBy), skippedTests, impactedFiles,
changes, notFound, graph and warnings. Invalid input gets a 400 with a
message saying what to fix. The full contract is in
specs/003-impact-api.md.
Requires Node.js 20.9 or newer.
npm install
npm run dev # http://localhost:3000
| Script | What it does |
|---|---|
npm run check | Lint, typecheck and unit tests |
npm test | 60 Vitest unit tests for the analyzer |
npm run build && npm run test:e2e | Playwright end-to-end tests on desktop and mobile viewports |
CI runs all of these on every push and pull request
(.github/workflows/ci.yml).
The same e2e suite can check a deployed site:
BASE_URL=https://test-impact-explorer.vercel.app npx playwright test
The live demo runs on Vercel's free Hobby plan. Vercel detects Next.js automatically,
and the app needs no environment variables. Deploy with vercel deploy --prod, or
import the repo at vercel.com/new to deploy on every push.
The repo also includes a workflow that deploys main to Azure and gives each pull
request its own preview URL.
AZURE_STATIC_WEB_APPS_API_TOKEN.main. The workflow builds the app, and Static Web Apps runs the API route
as a managed function.Until the secret exists, the deploy workflow skips itself instead of failing.
src/
app/ Next.js App Router: page, layout, /api/analyze route
components/ Explorer (state), Results, ImpactGraph (SVG)
lib/impact/ The analyzer: parse → resolve → graph → impact (+ unit tests)
lib/sample/ The bundled demo project
specs/ One spec per feature, with acceptance criteria
e2e/ Playwright tests and a fixture repo for the folder upload test
docs/ Screenshots and the agent log
This project was built AI-native: each feature started as a spec in specs/
with acceptance criteria and test cases, then was implemented by directing a coding
agent (Claude Code), and was then reviewed, tested and screenshot-checked before
moving on.
AGENTS.md holds the instructions every coding agent gets: commands,
architecture rules, the definition of done and known traps.docs/agent-log.md lists the real problems that came up
during the build and how each was caught. Some were caught by tests, some by reading
a failure carefully, and some only by looking at screenshots while every test was
green.MIT