Skip to content

feat(docs): publish raw markdown/yaml docs as @nuxt/docs - #31353

Merged
danielroe merged 4 commits into
mainfrom
feat/docs-package
Apr 3, 2025
Merged

danielroe merged 4 commits into
mainfrom
feat/docs-package

Conversation

@antfu

@antfu antfu commented Mar 13, 2025 •

Copy link
Copy Markdown
Member

This is a proposal that we should publish our docs together with the monorepo as an additional resource to be consumed by other integrations, namely LLM agents (https://github.com/antfu/nuxt-mcp), but potentially other tools like Nuxt DevTools to present offline docs, etc.

The benefit is that the version of the docs is explicitly matched to the runtime versions. Eliminate the problem of version mismatch between installed and online docs. It also allows consuming those data offline without API requests.

I feel that all the projects with docs should adapt to this (if we agree on this, I'd also do the same for other packages like VueUse, UnoCSS, etc.)

@antfu
antfu requested a review from danielroe as a code owner March 13, 2025 10:59
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai

coderabbitai Bot commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The update involves a modification to the pnpm-workspace.yaml configuration file by adding the line - docs to the list of packages. This change explicitly incorporates the docs directory into the workspace's package management, ensuring that it is now treated as part of the overall project structure. Additionally, the .github/workflows/semantic-pull-requests.yml file has been updated to include the new scope docs in the scopes parameter of the Validate PR title step, allowing for more specific categorisation of pull requests related to documentation. No other entries or functionalities in the respective files have been altered.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0369c09 and bddbfaf.

⛔ Files ignored due to path filters (2)
  • docs/package.json is excluded by !**/package.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (2)
  • .github/workflows/semantic-pull-requests.yml (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm-workspace.yaml
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: code
  • GitHub Check: build
  • GitHub Check: codeql (javascript-typescript)
🔇 Additional comments (1)
.github/workflows/semantic-pull-requests.yml (1)

25-27: New "docs" scope added correctly.

The inclusion of "docs" in the scopes list aligns perfectly with the PR objectives of publishing documentation alongside the monorepo. This update ensures that any changes to documentation are properly classified and tracked by the semantic pull request checks.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions Bot added 3.x ✨ enhancement New feature or improvement to existing functionality labels Mar 13, 2025
@pkg-pr-new

pkg-pr-new Bot commented Mar 13, 2025 •

Copy link
Copy Markdown

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@31353

nuxt

npm i https://pkg.pr.new/nuxt@31353

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@31353

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@31353

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@31353

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@31353

commit: bddbfaf

@codspeed

codspeed Bot commented Mar 13, 2025 •

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #31353 will not alter performance

Comparing feat/docs-package (bddbfaf) with main (f6b0b7f)

Summary

✅ 10 untouched benchmarks

Comment thread docs/package.json Resolved
Co-authored-by: Horu <73709188+HigherOrderLogic@users.noreply.github.com>
@danielroe

Copy link
Copy Markdown
Member

do you think it would be possible to run twoslash to augment docs at build time?

at the moment two slash often type errors because the nuxt/nuxt.com environment or nuxt version is different, and that will be increased when we support displaying different docs versions on the site

@antfu

antfu commented Mar 17, 2025

Copy link
Copy Markdown
Member Author

That's an interesting idea! It's definitely possible, let me see how it can be built! I created twoslashes/twoslash#67 to track on it

@danielroe

Copy link
Copy Markdown
Member

I agree this is an excellent change, and I think we can also migrate from the nuxt.config markdown currently present in @nuxt/schema to include this in @nuxt/docs instead.

after first publish, we should also update nuxt/nuxt.com to pull from the new @nuxt/docs package (cc: @HugoRCD @atinux)

@HugoRCD

HugoRCD commented Mar 17, 2025

Copy link
Copy Markdown
Member

I agree this is an excellent change, and I think we can also migrate from the nuxt.config markdown currently present in @nuxt/schema to include this in @nuxt/docs instead.

after first publish, we should also update nuxt/nuxt.com to pull from the new @nuxt/docs package (cc: @HugoRCD @atinux)

Really cool idea, I had already added nuxt-llms to the new version of the doc but this would clearly be even better!

@atinux

atinux commented Mar 19, 2025

Copy link
Copy Markdown
Member

This is now I believe it's also the right time to stop generating the nuxt configuration file on nuxt.com (see https://github.com/nuxt/nuxt.com/blob/main/server/plugins/docs-config.ts) as it will make sense to have it directly part of the @nuxt/docs package

@danielroe danielroe added this to the v3.17 milestone Mar 19, 2025
@danielroe

Copy link
Copy Markdown
Member

Excellent - sounds like we are agreed.

One more important comment for a future PR (cc: @HugoRCD):

right now the docs are dependent on components in nuxt/nuxt.com, including components from nuxt/ui-pro. that means that even if we publish separately it's still not truly consumable anywhere but nuxt/nuxt.com

I think it would be good to consider making the docs 'pure' (or bundling all components used inside them?) so that they are truly independent. added to that, they would not need to be updated if/when nuxt/ui or nuxt/ui-pro is updated, meaning we wouldn't need to coordinate updates to the docs markdown source and the website (e.g. #31150).

any transforms that use components from the nuxt/nuxt.com codebase could be applied in a plugin or module in nuxt/nuxt.com itself.

@atinux

atinux commented Mar 19, 2025

Copy link
Copy Markdown
Member

Agree! I think we can share the same Undocs content transformers so the @nuxt/docs can use as less as possible the MDC syntax.

https://undocs.pages.dev/guide/content-transformation

@socket-security

Copy link
Copy Markdown

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/semver@7.7.1 None 0 96.7 kB npm-cli-ops

🚮 Removed packages: npm/jiti@2.4.2, npm/klona@2.0.6, npm/knip@5.46.5, npm/knitwork@1.2.0

View full report↗︎

@danielroe danielroe changed the title feat: publish raw docs as @nuxt/docs package feat(docs): publish raw markdown/yaml documentation as @nuxt/docs Apr 3, 2025
@danielroe danielroe changed the title feat(docs): publish raw markdown/yaml documentation as @nuxt/docs feat(docs): publish raw markdown/yaml docs as @nuxt/docs Apr 3, 2025
@danielroe
danielroe merged commit 6abda6e into main Apr 3, 2025
@danielroe
danielroe deleted the feat/docs-package branch April 3, 2025 15:51
@github-actions github-actions Bot mentioned this pull request Apr 3, 2025
@github-actions github-actions Bot mentioned this pull request Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants