feat(kit,schema): add `module:before`/`module:done` hooks by danielroe · Pull Request #36173 · nuxt/nuxt · GitHub
Skip to content

feat(kit,schema): add module:before/module:done hooks - #36173

Merged
danielroe merged 1 commit into
mainfrom
feat/module-timings
Aug 26, 2026
Merged

danielroe merged 1 commit into
mainfrom
feat/module-timings

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

this adds two module hooks, which we will use in nuxt/cli v4 to show individual module setup time as the dev server/build runs - as it's happening

@danielroe
danielroe requested a review from harlan-zw August 26, 2026 10:24
@github-actions github-actions Bot added 5.x ✨ enhancement New feature or improvement to existing functionality labels Aug 26, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f43b158-5e38-40a2-9ab2-201b734a6d17

📥 Commits

Reviewing files that changed from the base of the PR and between 85c6795 and fb4a95c.

📒 Files selected for processing (6)
  • docs/4.api/6.advanced/1.hooks.md
  • packages/kit/src/module/define.ts
  • packages/kit/src/module/install.ts
  • packages/kit/test/module.test.ts
  • packages/schema/src/index.ts
  • packages/schema/src/types/hooks.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


Walkthrough

The change adds typed module:before and module:done build-time hooks. Module installation now provides module names, metadata, entry paths, and setup timings. Setup timing measurement and related diagnostics move from module definition to module installation. The public schema exports ModuleInstallInfo. Tests cover hook emission, module naming, timing data, entry paths, and explicit installModule usage.

Merge Risk: ⚪ Minimal · up to fb4a9

This change adds module lifecycle hooks without any identified merge-blocking correctness or production risk; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. (1 skipped: 1… 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 summarises the main change: adding the module:before and module:done hooks.
Description check ✅ Passed The description explains that the pull request adds two module hooks for displaying individual module setup times in Nuxt CLI v4.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/module-timings

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 Aug 26, 2026

Copy link
Copy Markdown

@harlan-zw harlan-zw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool, looks good.

Opens up some DX opportunities beyond CLI that I'll have a play with.

@danielroe
danielroe added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit e0deb2c Aug 26, 2026
61 of 63 checks passed
@danielroe
danielroe deleted the feat/module-timings branch August 26, 2026 15:13
@github-actions github-actions Bot mentioned this pull request Aug 26, 2026
@github-actions github-actions Bot mentioned this pull request Aug 28, 2026
@github-actions github-actions Bot mentioned this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.x ✨ enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants