Skip to content

fix(make:layout): use resolvable imports in Layout stub - #332

Merged
cossssmin merged 1 commit into
masterfrom
fix/layout-stub-imports
Aug 1, 2026
Merged

fix(make:layout): use resolvable imports in Layout stub#332
cossssmin merged 1 commit into
masterfrom
fix/layout-stub-imports

Conversation

@cossssmin

@cossssmin cossssmin commented Aug 1, 2026

Copy link
Copy Markdown
Member

Problem

make:layout scaffolds a stub that imports two framework internals via relative paths:

import { outlookFallbackProp } from './utils.ts'
import { useOutlookFallback } from '../composables/useOutlookFallback'

These only resolve from inside node_modules/@maizzle/framework/dist/components/. The CLI places the file at ./components by default, so both paths dangle and a fresh maizzle build crashes immediately:

Error: Failed to load url ./utils.ts ... Does the file exist?

Fix

  • Import useOutlookFallback from the public @maizzle/framework entrypoint (it's already exported there).
  • Inline the outlookFallback prop definition into defineProps(). outlookFallbackProp isn't on the public entrypoint, and Vue's <script setup> compiler rejects defineProps() referencing a locally-declared const, so it has to be inlined.

Closes #331

Summary by CodeRabbit

  • Bug Fixes
    • Improved Outlook fallback handling in generated layouts.
    • Ensured the Outlook fallback option is recognized consistently when configuring layout output.
    • Preserved the existing default behavior when the option is not specified.

The scaffolded Layout stub imported outlookFallbackProp and
useOutlookFallback via relative paths that only resolve inside
the framework's dist/components dir, so a fresh build of a
scaffolded layout crashed. Import useOutlookFallback from the
public @maizzle/framework entrypoint and inline the
outlookFallback prop definition.

Closes #331
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e723dc39-a198-4b5a-a848-0df81157d473

📥 Commits

Reviewing files that changed from the base of the PR and between f0cd757 and 0ceab5b.

📒 Files selected for processing (1)
  • src/commands/make/stubs/Layout.vue

📝 Walkthrough

Walkthrough

Layout.vue now imports useOutlookFallback from @maizzle/framework and declares outlookFallback locally as an optional Boolean prop with a null default.

Changes

Outlook fallback integration

Layer / File(s) Summary
Update Outlook fallback integration
src/commands/make/stubs/Layout.vue
The component uses the framework composable and replaces the shared prop declaration with a local Boolean prop that defaults to null.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

  • maizzle/cli#331 — Directly addresses the broken imports and prop declaration in Layout.vue.
  • maizzle/framework#1816 — Directly addresses the broken relative imports and local prop issue in Layout.vue.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the make:layout fix and the use of resolvable imports, which matches the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/layout-stub-imports

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cossssmin
cossssmin merged commit 5bfe9bb into master Aug 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make:layout scaffold generates broken relative imports, crashes on build

1 participant