feat: generate page files for page types#63
Merged
angeloashmore merged 5 commits intomainfrom Mar 24, 2026
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Each framework adapter now creates page files when a page type is synced. The generated route path matches the route added to prismic.config.json. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add App Router vs Pages Router distinction for Next.js page templates, generating getStaticProps/getStaticPaths for Pages Router projects. Fix Nuxt templates to conditionally cast uid based on TypeScript usage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
99ace4e to
6740a64
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Individual test timeouts are unnecessary with the global timeout in vitest config. Adding retry: 1 improves CI reliability for flaky integration tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Resolves: #61
Description
Automatically generate framework-appropriate page files when page types are synced. Each adapter (Next.js, Nuxt, SvelteKit) creates minimal page templates matching the route derived in
prismic.config.json, so developers get working pages out of the box after syncing their content models.Note: E2E tests only cover Next.js App Router without JavaScript for now. Expanding the test suite will come later.
Checklist
Preview
How to QA 1
Note
Medium Risk
Medium risk: adds new file-generation behavior across Next.js/Nuxt/SvelteKit adapters based on routing rules, which could create files in unexpected paths or generate incorrect templates for some project setups. Changes are additive and avoid overwriting existing files, limiting impact.
Overview
Automatically scaffolds framework page files when a Prismic Custom Type with
format: "page"is created/synced, using the route derived fromprismic.config.json(via exportedbuildRoutePath).Adds new page templates for Next.js (App Router + Pages Router, JS/TS, repeatable vs single), Nuxt (repeatable vs single, JS/TS), and SvelteKit (generates both
+page.svelteand+page.server.*). Generation is non-destructive: adapters skip writing if the target page file already exists.Extends E2E test utilities with
stubNodeModuleand atoHaveFilematcher, and adds sync tests (currently covering Next.js App Router) to verify page files are created for page types, not created for non-page types, and not overwritten.Written by Cursor Bugbot for commit 99ace4e. This will update automatically on new commits. Configure here.
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩