Enhance Phase 7 testing, validation, and progress tracking - #5
Merged
Merged
Conversation
…overage and hardening gaps
- Updated progress tracker to reflect completion of Phase 7 Step 3. - Implemented generator and template snapshot tests to ensure output stability across various configurations. - Added tests for generated file paths, package.json, and .env.example for multiple MVP configurations. - Introduced inline snapshots for generated paths and package.json contents. - Enhanced path safety checks to validate generated file paths. - Created a new test file for generated output snapshots in the generator package. - Added a new prompt file for Phase 7 Step 3 detailing implementation requirements and goals.
- Implemented smoke tests to validate generated projects for default and all-compatible configurations. - Created a test helper to write generated projects to temporary directories with path safety checks. - Added a smoke test command in package.json for easy execution. - Updated progress tracker with details of changes and verification results.
…ilder and API interactions
There was a problem hiding this comment.
Pull request overview
This PR strengthens LaunchKit’s Phase 7 “testing, validation, and hardening” efforts by adding broader regression coverage (schema/generator/templates), introducing opt-in generated-project smoke tests, aligning the Auth.js credentials scaffold with the working App Router handler pattern, and updating progress tracking + internal step prompts.
Changes:
- Added generator real-template output snapshot tests and opt-in smoke tests that install/typecheck/build generated projects.
- Updated the Auth.js credentials feature template scaffold and corresponding template assertions.
- Expanded schema validation/metadata tests and improved web API + builder error handling and UX/a11y states; updated Phase 7 tracking docs/prompts.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/templates/src/tests/index.test.ts | Adds template file boundary snapshots and updates Auth.js template assertions. |
| packages/templates/features/authjs-credentials/auth.ts | Refactors Auth scaffold to export authOptions + default NextAuth instance. |
| packages/templates/features/authjs-credentials/app/api/auth/[...nextauth]/route.ts | Switches to explicit App Router handler pattern using NextAuth(authOptions). |
| packages/schema/src/tests/metadata.test.ts | Adds regression check for boolean recommended metadata flags. |
| packages/schema/src/tests/config.test.ts | Expands invalid project name coverage and unsupported option rejection cases. |
| packages/schema/src/tests/compatibility.test.ts | Removes compatibility test that relied on unsupported styling values via casting. |
| packages/generator/vitest.smoke.config.ts | Adds a dedicated Vitest config for slow, opt-in smoke tests. |
| packages/generator/test/smoke/generated-projects.test.ts | Introduces generated-project smoke tests running install/typecheck/build for key configs. |
| packages/generator/src/tests/generated-output-snapshots.test.ts | Adds targeted inline snapshots + assertions for generated output across the MVP matrix. |
| packages/generator/package.json | Adds test:smoke script to run smoke suite with dedicated config. |
| package.json | Adds root test:smoke delegating to the generator workspace. |
| memory.md | Updates Phase memory notes for Phase 7 testing/hardening progress. |
| context/progress-tracker.md | Records Phase 7 verification status, smoke-test results, and remaining manual QA. |
| apps/web/lib/builder/validation.ts | Adds getProjectNameError and improves name-specific error messaging. |
| apps/web/lib/builder/phase-6-verification.test.ts | Adds tests ensuring project-name errors are concise and stable. |
| apps/web/lib/api/generate.ts | Aligns error codes/statuses (415/413) and unifies unsafe output error code. |
| apps/web/lib/api/generate.test.ts | Adds route export coverage (GET/POST) and expands API hardening regression tests. |
| apps/web/lib/api/errors.ts | Introduces a friendly error-message mapper for structured API errors. |
| apps/web/lib/api/client.ts | Uses friendly API error mapping when throwing GenerateProjectApiError. |
| apps/web/lib/api/client.test.ts | Updates expectations for friendly error messages and tests mapper behavior. |
| apps/web/components/builder/steps/project-step.tsx | Improves a11y wiring and visual invalid-state styling for project name input. |
| apps/web/components/builder/steps/preview-step.tsx | Adds a safe failure state when preview generation throws. |
| apps/web/components/builder/steps/download-step.tsx | Adds preview failure handling, improves messages, and refines selected-stack rendering. |
| apps/web/components/builder/preview/script-list.tsx | Improves empty-state copy for scripts. |
| apps/web/components/builder/preview/env-var-list.tsx | Improves empty-state copy for env vars. |
| apps/web/components/builder/preview/dependency-list.tsx | Improves empty-state copy for deps/devDeps. |
| apps/web/components/builder/download/download-status.tsx | Improves live-region behavior and aligns default status messages. |
| apps/web/components/builder/download/download-button.tsx | Adds aria-busy and updates generating label copy. |
| .agents/prompts/phase-07/step-7.md | Adds the Phase 7 Step 7 verification prompt/spec. |
| .agents/prompts/phase-07/step-6.md | Adds the Phase 7 Step 6 prompt/spec for UX failure-state improvements. |
| .agents/prompts/phase-07/step-5.md | Adds the Phase 7 Step 5 prompt/spec for API hardening. |
| .agents/prompts/phase-07/step-4.md | Adds the Phase 7 Step 4 prompt/spec for smoke test implementation. |
| .agents/prompts/phase-07/step-3.md | Adds the Phase 7 Step 3 prompt/spec for generator/template snapshot tests. |
| .agents/prompts/phase-07/step-2.md | Adds the Phase 7 Step 2 prompt/spec for schema regression tests. |
| .agents/prompts/phase-07/step-1.md | Adds the Phase 7 Step 1 prompt/spec for test coverage auditing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+757
to
+772
| async function listFiles(root: string): Promise<string[]> { | ||
| const entries = await readdir(root, { withFileTypes: true }); | ||
| const files: string[] = []; | ||
|
|
||
| for (const entry of entries) { | ||
| const entryPath = join(root, entry.name); | ||
|
|
||
| if (entry.isDirectory()) { | ||
| files.push(...(await listFiles(entryPath))); | ||
| } else { | ||
| files.push(entryPath); | ||
| } | ||
| } | ||
|
|
||
| return files; | ||
| } |
Comment on lines
+774
to
+776
| function listPaths(project: GeneratedProject): string[] { | ||
| return project.files.map((file) => file.path); | ||
| } |
Comment on lines
+503
to
+509
| expect(path).not.toBe(""); | ||
| expect(path.startsWith("/")).toBe(false); | ||
| expect(path.startsWith("src/")).toBe(false); | ||
| expect(segments).not.toContain(""); | ||
| expect(segments).not.toContain("."); | ||
| expect(segments).not.toContain(".."); | ||
| } |
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.