diff --git a/.agents/skills/update-deps/SKILL.md b/.agents/skills/update-deps/SKILL.md index 561e99820f..1af270a621 100644 --- a/.agents/skills/update-deps/SKILL.md +++ b/.agents/skills/update-deps/SKILL.md @@ -1,15 +1,17 @@ -# Update Dependencies Skill +--- +name: update-deps +description: > + Update and audit dependencies in the Nitro monorepo using pnpm. Handles non-major upgrades, + pre-release version tracking, workspace link-reference fixes, and lockfile regeneration. + Use when upgrading packages, checking for outdated dependencies, fixing version conflicts, + or preparing a dependency-update PR in this repository. +--- -This skill guides you through the process of updating dependencies in the Nitro repository. +# Update Dependencies ## Step-by-Step Process -### Ensure Clean State - -Check that you're on a clean main branch with latest changes. - -- Clean working directory on main branch -- Latest changes pulled from remote +### 1. Ensure Clean State ```bash git checkout main @@ -19,19 +21,15 @@ git status # Should show "nothing to commit, working tree clean" (if branch name starts with chore, you can stay in it, no need to pull or change branch or clean state) -### Initial Install - -Run an initial install to ensure everything is up to date: +### 2. Initial Install ```bash pnpm install ``` -### Run pnpm upgrade -r - -Run `pnpm upgrade -r` to update non-major versions. +### 3. Run pnpm upgrade -r -After upgrade, check git diff: +Run `pnpm upgrade -r` to update non-major versions. After upgrade, check git diff: - Make sure range types does not change in `dependencies` field (example: `"h3": "^2.0.1-rc.7"` should remain `"h3": "^2.0.1-rc.7",` not `"h3": "2.0.1-rc.7",`) - Make sure dependencies are not converted to `link:..` (example: `"nitro": "latest",` should remain same, instead of `"nitro": "link:../.."`) @@ -63,9 +61,9 @@ done If any dependencies in root `package.json` lost their `^` prefix, restore them manually. -### Check for Outdated Dependencies +**CHECKPOINT**: Verify `git diff` shows no `link:` conversions and no dropped `^` prefixes before continuing. -Find outdated dependencies: +### 4. Check for Outdated Dependencies ```bash pnpm outdated -r @@ -87,19 +85,19 @@ Or check all versions for a specific package: pnpm show versions ``` -### 4. Update Dependencies +### 5. Update Dependencies Manually update all dependencies to their latest versions in [package.json](../package.json): - Update both `dependencies` and `devDependencies` - Keep the range prefix (e.g., `^` for caret ranges) -- **For beta/alpha/rc packages**: Update to the latest pre-release tag found in step 3 +- **For beta/alpha/rc packages**: Update to the latest pre-release tag found in step 4 - Example: `vite: "8.0.0-beta.6"` → `"8.0.0-beta.7"` - Example: `h3: "^2.0.1-rc.7"` → `"^2.0.1-rc.8"` (if available) - Maintain version range conventions (prefer `^` over exact versions) - **Do not update** `@azure/functions` -### 5. Clean Install +### 6. Clean Install Remove lock file and node_modules, then reinstall: @@ -108,22 +106,20 @@ rm -rf node_modules pnpm-lock.yaml pnpm i ``` -### 6. Lint and Fix - -Run linting and auto-fix issues: +### 7. Lint and Fix ```bash pnpm format ``` -### 7. Build Project - -Build the project to ensure compatibility: +### 8. Build Project ```bash pnpm build ``` +**CHECKPOINT**: Build must succeed before continuing. If it fails, see Common Issues below. + ### 9. Fix Remaining Issues If there are lint or type errors: @@ -133,7 +129,7 @@ If there are lint or type errors: 3. Re-run `pnpm format` to verify lint fixes 4. Re-run `pnpm typecheck` to verify type fixes. Ignore errors, only report them in the end. -### 10. Final +### 10. Summary Do not commit changes. Only summarize what happened. diff --git a/skills/nitro/SKILL.md b/skills/nitro/SKILL.md index 256630437d..e42b620904 100644 --- a/skills/nitro/SKILL.md +++ b/skills/nitro/SKILL.md @@ -1,10 +1,58 @@ --- name: nitro -description: Build and deploy universal JavaScript servers with Nitro +description: > + Build and deploy universal JavaScript servers using Nitro, an H3-powered framework with + deployment presets for Vercel, Cloudflare Workers, Deno, Bun, and more. Create API routes, + middleware, server plugins, scheduled tasks, and WebSocket handlers. Use when working with + Nitro projects, creating server endpoints, configuring deployment presets, debugging H3 + handlers, or building serverless/edge backends. --- @docs/TOC.md -You can use `npx nitro docs [--page ] [...args]` to explore the documentation locally. -For example, `npx nitro docs --page /docs/routing` will open the routing page of the guide section. -If not available, fallback to https://nitro.build/llms.txt +## Quick Reference + +Explore documentation locally or fall back to the hosted version: + +```bash +# Browse docs by topic +npx nitro docs --page /docs/routing + +# Full docs index +npx nitro docs +``` + +If `npx nitro docs` is not available, fall back to https://nitro.build/llms.txt + +## Common Tasks + +### Create an API route + +Add a file under `server/api/` or `routes/`: + +```ts +// server/api/hello.get.ts +export default defineEventHandler(() => { + return { message: 'Hello from Nitro!' } +}) +``` + +### Run the dev server + +```bash +npx nitropack dev +``` + +### Build for production + +```bash +npx nitropack build +``` + +### Deploy with a preset + +```bash +NITRO_PRESET=cloudflare-pages npx nitropack build +``` + +Available presets include `vercel`, `cloudflare-pages`, `cloudflare-module`, `netlify`, `deno-server`, `bun`, `node-server`, and others listed in the docs.