Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This focus helps guide our project decisions as a community and what we choose t
- [Setup](#setup)
- [Development workflow](#development-workflow)
- [Available commands](#available-commands)
- [Clearing caches during development](#clearing-caches-during-development)
- [Project structure](#project-structure)
- [Local connector CLI](#local-connector-cli)
- [Mock connector (for local development)](#mock-connector-for-local-development)
Expand Down Expand Up @@ -124,6 +125,34 @@ pnpm test:a11y # Lighthouse accessibility audits
pnpm test:perf # Lighthouse performance audits (CLS)
```

### Clearing caches during development

Nitro persists `defineCachedEventHandler` results to disk at `.nuxt/cache/nitro/`. This cache **survives dev server restarts**. If you're iterating on a cached API route and want fresh results, delete the relevant cache directory:

```bash
# Clear all Nitro handler caches
rm -rf .nuxt/cache/nitro/handlers/

# Clear a specific handler cache (e.g. picks)
rm -rf .nuxt/cache/nitro/handlers/npmx-picks/
```
Comment on lines +132 to +138
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor: comment label doesn't match the directory name in the example.

Line 136 says (e.g. picks) but the path immediately below it is npmx-picks/. Aligning the comment with the actual directory name avoids confusion.

✏️ Suggested fix
-# Clear a specific handler cache (e.g. picks)
+# Clear a specific handler cache (e.g. npmx-picks)
 rm -rf .nuxt/cache/nitro/handlers/npmx-picks/


Alternatively, you can bypass the cache entirely in development by adding `shouldBypassCache: () => import.meta.dev` to your `defineCachedEventHandler` options:

```ts
export default defineCachedEventHandler(
async event => {
// ...
},
{
maxAge: 60 * 5,
shouldBypassCache: () => import.meta.dev,
},
)
```

The `.cache/` directory is a separate storage mount used for fetch-cache and atproto data.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor: .cache/ note lacks actionable context.

The note mentions the directory but leaves contributors without any guidance. Someone hitting stale fetch-cache or atproto data won't know whether or how to clear it. Consider either scoping the note ("the commands above do not affect .cache/") or adding a corresponding clear command.

✏️ Suggested expansion
-The `.cache/` directory is a separate storage mount used for fetch-cache and atproto data.
+The `.cache/` directory is a separate storage mount used for fetch-cache and atproto data. The commands above do not affect it; to clear it, run `rm -rf .cache/`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The `.cache/` directory is a separate storage mount used for fetch-cache and atproto data.
The `.cache/` directory is a separate storage mount used for fetch-cache and atproto data. The commands above do not affect it; to clear it, run `rm -rf .cache/`.


### Project structure

```
Expand Down
Loading