Skip to content

feat: add --extends option to support nuxt layer extension#933

Merged
danielroe merged 8 commits intonuxt:mainfrom
sanjayy-gowdaa:extends-layer
Jul 7, 2025
Merged

feat: add --extends option to support nuxt layer extension#933
danielroe merged 8 commits intonuxt:mainfrom
sanjayy-gowdaa:extends-layer

Conversation

@sanjayy-gowdaa
Copy link
Contributor

🔗 Linked issue

Resolves #930

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This PR adds a new --extends CLI option to core Nuxt commands, enabling users to extend Nuxt layers directly from the command line. This addresses the need for a unified CLI experience across the Nuxt ecosystem.

Problem: Currently, projects like Docus need to create their own CLI tools (e.g., docus build)

Changes:

  • Add extendsArgs to _shared.ts for consistent argument definition
  • Add --extends support to core commands: build, dev, generate, preview
  • Add --extends support to utility commands: analyze, typecheck, prepare

@sanjayy-gowdaa sanjayy-gowdaa requested a review from danielroe as a code owner July 1, 2025 20:27
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 1, 2025

nuxt-cli-playground

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

commit: 11a55a7

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2025

Codecov Report

Attention: Patch coverage is 18.91892% with 30 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@50b1fcf). Learn more about missing BASE report.

Files with missing lines Patch % Lines
packages/nuxi/src/commands/typecheck.ts 0.00% 5 Missing ⚠️
playground/some-layer/pages/extended.vue 0.00% 4 Missing and 1 partial ⚠️
packages/nuxi/src/commands/dev.ts 0.00% 4 Missing ⚠️
packages/nuxi/src/commands/analyze.ts 0.00% 3 Missing ⚠️
packages/nuxi/src/commands/build.ts 0.00% 3 Missing ⚠️
packages/nuxi/src/commands/prepare.ts 0.00% 3 Missing ⚠️
packages/nuxi/src/commands/preview.ts 0.00% 3 Missing ⚠️
packages/nuxi/src/commands/generate.ts 0.00% 2 Missing ⚠️
packages/nuxi/src/dev/utils.ts 0.00% 1 Missing ⚠️
playground/some-layer/nuxt.config.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #933   +/-   ##
=======================================
  Coverage        ?   12.52%           
=======================================
  Files           ?       74           
  Lines           ?     3897           
  Branches        ?      112           
=======================================
  Hits            ?      488           
  Misses          ?     3375           
  Partials        ?       34           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 1, 2025

CodSpeed Performance Report

Merging #933 will not alter performance

Comparing sanjayy-gowdaa:extends-layer (11a55a7) with main (50b1fcf)

Summary

✅ 2 untouched benchmarks

@sanjayy-gowdaa sanjayy-gowdaa requested a review from danielroe July 1, 2025 22:47
@danielroe danielroe changed the title feat: add --extends option to support nuxt layer extension feat: add --extends option to support nuxt layer extension Jul 7, 2025
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great - thank you ❤

@danielroe danielroe merged commit 76fb10f into nuxt:main Jul 7, 2025
11 of 14 checks passed
@github-actions github-actions bot mentioned this pull request Jul 7, 2025
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.

allow --extends to extend a nuxt layer

3 participants