Skip to content

refactor(module): directly use magicast to update nuxt config - #1396

Merged
danielroe merged 2 commits into
mainfrom
refactor/magicast
Jul 26, 2026
Merged

danielroe merged 2 commits into
mainfrom
refactor/magicast

Conversation

@danielroe

Copy link
Copy Markdown
Member

πŸ”— Linked issue

πŸ“š Description

currently we were using c12 v3 to update nuxt config + load dotenv, but this runs the risk of getting out of sync with nuxt.

we need to expose a nuxt/kit utility to updateNuxtConfig but in the meantime (and as a fallback) we need to use magicast (which also, previously, we should have declared as a dependency - it was only working by accident!) to do the writing

@pkg-pr-new

pkg-pr-new Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
  • nuxt-cli-playground

    npm i https://pkg.pr.new/create-nuxt@1396
    
    npm i https://pkg.pr.new/nuxi@1396
    
    npm i https://pkg.pr.new/@nuxt/cli@1396
    

commit: f4cf458

@coderabbitai

coderabbitai Bot commented Jul 26, 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: 341f5bfc-4110-44ce-9b06-5b07cd189e29

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between bbf82f0 and f4cf458.

πŸ“’ Files selected for processing (1)
  • packages/nuxt-cli/test/unit/utils/config.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/nuxt-cli/test/unit/utils/config.spec.ts

πŸ“ Walkthrough

Walkthrough

The CLI removes its c12 dependency, adds magicast as a runtime dependency, and introduces a local updateConfig utility for resolving, creating, parsing, mutating, and writing Nuxt config files. Module commands use the new utility. Preview dotenv handling now relies on Nuxt loading state and closes the Nuxt instance. Local dotenv types and related comments are updated, with unit tests covering the utility and revised command mocks.

Estimated code review effort: 3 (Moderate) | ~25 minutes

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Title check βœ… Passed The title clearly captures the main refactor: switching Nuxt config updates to magicast directly.
Description check βœ… Passed The description matches the change set, explaining the move away from c12 toward magicast for Nuxt config updates.
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 docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/magicast

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.

@codspeed

codspeed Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

βœ… 2 untouched benchmarks


Comparing refactor/magicast (f4cf458) with main (ee930ed)

Open in CodSpeed

@danielroe
danielroe merged commit d0b43f8 into main Jul 26, 2026
19 checks passed
@danielroe
danielroe deleted the refactor/magicast branch July 26, 2026 13:27
This was referenced Jul 26, 2026
This was referenced Aug 24, 2026
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.

1 participant