Fix defineProps type resolution in production builds#5
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
awesome-apptly | aadebab | Commit Preview URL Branch Preview URL |
Apr 03 2026, 07:45 PM |
Review Summary by QodoMove component prop interfaces to SFC script blocks
WalkthroughsDescription• Move component prop interfaces to SFC <script> blocks - GoPkgProps moved to go-pkg.vue - ProseHeadingProps moved to prose-heading.vue • Fixes production build failure with @vue/compiler-sfc type resolution • Update prose-h2.vue and prose-h3.vue to import types locally • Document constraint in AGENTS.md for component type definitions Diagramflowchart LR
A["app/utils/go-pkg.ts<br/>app/utils/index.ts"] -->|"Move types"| B["go-pkg.vue<br/>prose-heading.vue"]
B -->|"Import types"| C["prose-h2.vue<br/>prose-h3.vue"]
D["AGENTS.md"] -->|"Document constraint"| E["Type resolution guide"]
File Changes1. app/utils/go-pkg.ts
|
Code Review by Qodo
1. Ambiguous script-block guidance
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR reorganizes component prop type definitions by moving Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
@vue/compiler-sfc cannot resolve Nuxt auto-imported types in defineProps<T>() during production builds. Each component now explicitly resolves its props type in a <script> block. Where the type lives depends on its consumers: - GoPkgProps stays in app/utils/go-pkg.ts (shared with resolveGoPkg). The component imports it explicitly. - ProseHeadingProps moves from app/utils/index.ts to prose-heading.vue (no utility consumer). Sibling components import from it directly. Signed-off-by: Alejandro Mery <amery@apptly.co>
|
Addressed review feedback: |
|
/review |
|
Persistent review updated to latest commit aadebab |
Summary
@vue/compiler-sfccannotresolve Nuxt auto-imported types in
defineProps<T>(). Eachcomponent now explicitly resolves its props type in a
<script>block.GoPkgPropsstays inapp/utils/go-pkg.ts(shared withresolveGoPkg). The component imports it explicitly.ProseHeadingPropsmoves fromapp/utils/index.tstoprose-heading.vue(no utility consumer). Siblingcomponents import from it directly.
AGENTS.md under Components.
Test plan
pnpm clean && pnpm install && pnpm precommitpassespnpm clean && pnpm install && pnpm buildpassesSummary by CodeRabbit
Documentation
Refactor