From ed22b7e87322641023ca878b067cde75392660ce Mon Sep 17 00:00:00 2001 From: Jason Kummerl Date: Sun, 8 Mar 2026 12:26:13 -0400 Subject: [PATCH 1/2] fix(seo): add +page.ts load functions for SSR title/description Add 21 +page.ts files so every route provides title and description via $page.data, ensuring crawlers see unique descriptive tags instead of the generic "Memory Cache" fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --- docs/src/routes/+page.ts | 5 +++++ docs/src/routes/docs/api/cached-decorator/+page.ts | 5 +++++ docs/src/routes/docs/api/memory-cache/+page.ts | 5 +++++ docs/src/routes/docs/examples/+page.ts | 5 +++++ docs/src/routes/docs/examples/api-caching/+page.ts | 4 ++++ docs/src/routes/docs/examples/async-fetching/+page.ts | 5 +++++ docs/src/routes/docs/examples/computed-values/+page.ts | 5 +++++ docs/src/routes/docs/examples/configuration/+page.ts | 5 +++++ docs/src/routes/docs/examples/database-caching/+page.ts | 5 +++++ docs/src/routes/docs/examples/monitoring/+page.ts | 4 ++++ docs/src/routes/docs/examples/multi-tenant/+page.ts | 4 ++++ docs/src/routes/docs/examples/rate-limiting/+page.ts | 4 ++++ docs/src/routes/docs/examples/service-class/+page.ts | 5 +++++ docs/src/routes/docs/examples/sessions/+page.ts | 4 ++++ docs/src/routes/docs/getting-started/+page.ts | 5 +++++ docs/src/routes/examples/+page.ts | 5 +++++ docs/src/routes/examples/basic-cache/+page.ts | 5 +++++ docs/src/routes/examples/cache-statistics/+page.ts | 5 +++++ docs/src/routes/examples/lru-eviction/+page.ts | 5 +++++ docs/src/routes/examples/ttl-expiration/+page.ts | 5 +++++ 20 files changed, 95 insertions(+) create mode 100644 docs/src/routes/+page.ts create mode 100644 docs/src/routes/docs/api/cached-decorator/+page.ts create mode 100644 docs/src/routes/docs/api/memory-cache/+page.ts create mode 100644 docs/src/routes/docs/examples/+page.ts create mode 100644 docs/src/routes/docs/examples/api-caching/+page.ts create mode 100644 docs/src/routes/docs/examples/async-fetching/+page.ts create mode 100644 docs/src/routes/docs/examples/computed-values/+page.ts create mode 100644 docs/src/routes/docs/examples/configuration/+page.ts create mode 100644 docs/src/routes/docs/examples/database-caching/+page.ts create mode 100644 docs/src/routes/docs/examples/monitoring/+page.ts create mode 100644 docs/src/routes/docs/examples/multi-tenant/+page.ts create mode 100644 docs/src/routes/docs/examples/rate-limiting/+page.ts create mode 100644 docs/src/routes/docs/examples/service-class/+page.ts create mode 100644 docs/src/routes/docs/examples/sessions/+page.ts create mode 100644 docs/src/routes/docs/getting-started/+page.ts create mode 100644 docs/src/routes/examples/+page.ts create mode 100644 docs/src/routes/examples/basic-cache/+page.ts create mode 100644 docs/src/routes/examples/cache-statistics/+page.ts create mode 100644 docs/src/routes/examples/lru-eviction/+page.ts create mode 100644 docs/src/routes/examples/ttl-expiration/+page.ts diff --git a/docs/src/routes/+page.ts b/docs/src/routes/+page.ts new file mode 100644 index 0000000..0c80533 --- /dev/null +++ b/docs/src/routes/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Memory Cache - Lightweight TypeScript In-Memory Caching Library', + description: + 'A lightweight, zero-dependency TypeScript in-memory caching library with TTL expiration, LRU eviction, and decorator support.' +}) diff --git a/docs/src/routes/docs/api/cached-decorator/+page.ts b/docs/src/routes/docs/api/cached-decorator/+page.ts new file mode 100644 index 0000000..f1badf8 --- /dev/null +++ b/docs/src/routes/docs/api/cached-decorator/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: '@cached Decorator API - Memory Cache', + description: + 'API reference for the @cached decorator that adds automatic caching to class methods.' +}) diff --git a/docs/src/routes/docs/api/memory-cache/+page.ts b/docs/src/routes/docs/api/memory-cache/+page.ts new file mode 100644 index 0000000..21a3e6a --- /dev/null +++ b/docs/src/routes/docs/api/memory-cache/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'MemoryCache API - Memory Cache', + description: + 'Complete API reference for the MemoryCache class including all methods, options, and configuration.' +}) diff --git a/docs/src/routes/docs/examples/+page.ts b/docs/src/routes/docs/examples/+page.ts new file mode 100644 index 0000000..0d13009 --- /dev/null +++ b/docs/src/routes/docs/examples/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Usage Examples | Memory Cache', + description: + 'Practical examples showing how to use Memory Cache for API caching, sessions, rate limiting, and more.' +}) diff --git a/docs/src/routes/docs/examples/api-caching/+page.ts b/docs/src/routes/docs/examples/api-caching/+page.ts new file mode 100644 index 0000000..72c148b --- /dev/null +++ b/docs/src/routes/docs/examples/api-caching/+page.ts @@ -0,0 +1,4 @@ +export const load = () => ({ + title: 'API Caching | Examples | Memory Cache', + description: 'Cache API responses to reduce latency and external API calls with Memory Cache.' +}) diff --git a/docs/src/routes/docs/examples/async-fetching/+page.ts b/docs/src/routes/docs/examples/async-fetching/+page.ts new file mode 100644 index 0000000..5783aa5 --- /dev/null +++ b/docs/src/routes/docs/examples/async-fetching/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Async Fetching | Examples | Memory Cache', + description: + 'Cache async fetch results with automatic deduplication and stale-while-revalidate patterns.' +}) diff --git a/docs/src/routes/docs/examples/computed-values/+page.ts b/docs/src/routes/docs/examples/computed-values/+page.ts new file mode 100644 index 0000000..48522e6 --- /dev/null +++ b/docs/src/routes/docs/examples/computed-values/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Computed Values | Examples | Memory Cache', + description: + 'Cache expensive computed values and derived data with automatic TTL-based refresh.' +}) diff --git a/docs/src/routes/docs/examples/configuration/+page.ts b/docs/src/routes/docs/examples/configuration/+page.ts new file mode 100644 index 0000000..fd2af66 --- /dev/null +++ b/docs/src/routes/docs/examples/configuration/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Configuration | Examples | Memory Cache', + description: + 'Configure Memory Cache with custom TTL, max size, eviction policies, and other options.' +}) diff --git a/docs/src/routes/docs/examples/database-caching/+page.ts b/docs/src/routes/docs/examples/database-caching/+page.ts new file mode 100644 index 0000000..2014972 --- /dev/null +++ b/docs/src/routes/docs/examples/database-caching/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Database Caching | Examples | Memory Cache', + description: + 'Speed up database queries by caching results in memory with automatic invalidation.' +}) diff --git a/docs/src/routes/docs/examples/monitoring/+page.ts b/docs/src/routes/docs/examples/monitoring/+page.ts new file mode 100644 index 0000000..5c2c0d0 --- /dev/null +++ b/docs/src/routes/docs/examples/monitoring/+page.ts @@ -0,0 +1,4 @@ +export const load = () => ({ + title: 'Monitoring | Examples | Memory Cache', + description: 'Monitor cache health with hit rates, memory usage, and performance metrics.' +}) diff --git a/docs/src/routes/docs/examples/multi-tenant/+page.ts b/docs/src/routes/docs/examples/multi-tenant/+page.ts new file mode 100644 index 0000000..e39634c --- /dev/null +++ b/docs/src/routes/docs/examples/multi-tenant/+page.ts @@ -0,0 +1,4 @@ +export const load = () => ({ + title: 'Multi-Tenant Caching | Examples | Memory Cache', + description: 'Implement isolated per-tenant caches with namespace support in Memory Cache.' +}) diff --git a/docs/src/routes/docs/examples/rate-limiting/+page.ts b/docs/src/routes/docs/examples/rate-limiting/+page.ts new file mode 100644 index 0000000..81869bc --- /dev/null +++ b/docs/src/routes/docs/examples/rate-limiting/+page.ts @@ -0,0 +1,4 @@ +export const load = () => ({ + title: 'Rate Limiting | Examples | Memory Cache', + description: 'Implement simple rate limiting using Memory Cache with TTL-based sliding windows.' +}) diff --git a/docs/src/routes/docs/examples/service-class/+page.ts b/docs/src/routes/docs/examples/service-class/+page.ts new file mode 100644 index 0000000..506ffd6 --- /dev/null +++ b/docs/src/routes/docs/examples/service-class/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Service Class | Examples | Memory Cache', + description: + 'Build a cache-backed service class with the @cached decorator for clean architecture.' +}) diff --git a/docs/src/routes/docs/examples/sessions/+page.ts b/docs/src/routes/docs/examples/sessions/+page.ts new file mode 100644 index 0000000..d01170a --- /dev/null +++ b/docs/src/routes/docs/examples/sessions/+page.ts @@ -0,0 +1,4 @@ +export const load = () => ({ + title: 'Session Management | Examples | Memory Cache', + description: 'Implement in-memory session storage with automatic expiration using Memory Cache.' +}) diff --git a/docs/src/routes/docs/getting-started/+page.ts b/docs/src/routes/docs/getting-started/+page.ts new file mode 100644 index 0000000..1928b65 --- /dev/null +++ b/docs/src/routes/docs/getting-started/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Getting Started - Memory Cache', + description: + 'Install and configure Memory Cache in your TypeScript or JavaScript project with this quick start guide.' +}) diff --git a/docs/src/routes/examples/+page.ts b/docs/src/routes/examples/+page.ts new file mode 100644 index 0000000..266d635 --- /dev/null +++ b/docs/src/routes/examples/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Interactive Examples | Memory Cache', + description: + 'Try interactive examples demonstrating Memory Cache features including TTL, LRU eviction, and cache statistics.' +}) diff --git a/docs/src/routes/examples/basic-cache/+page.ts b/docs/src/routes/examples/basic-cache/+page.ts new file mode 100644 index 0000000..41a5c3b --- /dev/null +++ b/docs/src/routes/examples/basic-cache/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Basic Cache | Examples | Memory Cache', + description: + 'Learn how to create and use a basic in-memory cache with get, set, and delete operations.' +}) diff --git a/docs/src/routes/examples/cache-statistics/+page.ts b/docs/src/routes/examples/cache-statistics/+page.ts new file mode 100644 index 0000000..8247b4b --- /dev/null +++ b/docs/src/routes/examples/cache-statistics/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'Cache Statistics | Examples | Memory Cache', + description: + 'Monitor cache performance with built-in statistics tracking hits, misses, and evictions.' +}) diff --git a/docs/src/routes/examples/lru-eviction/+page.ts b/docs/src/routes/examples/lru-eviction/+page.ts new file mode 100644 index 0000000..6aff2a9 --- /dev/null +++ b/docs/src/routes/examples/lru-eviction/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'LRU Eviction | Examples | Memory Cache', + description: + 'Explore least-recently-used eviction policies to manage cache size and memory usage.' +}) diff --git a/docs/src/routes/examples/ttl-expiration/+page.ts b/docs/src/routes/examples/ttl-expiration/+page.ts new file mode 100644 index 0000000..846f124 --- /dev/null +++ b/docs/src/routes/examples/ttl-expiration/+page.ts @@ -0,0 +1,5 @@ +export const load = () => ({ + title: 'TTL Expiration | Examples | Memory Cache', + description: + 'See how time-to-live expiration works in Memory Cache with configurable TTL per entry.' +}) From cf58a390b7c2f6a831d75fd147d31db8a0a65088 Mon Sep 17 00:00:00 2001 From: Jason Kummerl <jason.h@kummerl.com> Date: Sun, 8 Mar 2026 12:34:22 -0400 Subject: [PATCH 2/2] docs: update CLAUDE.md and add AGENTS.md with project details Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --- AGENTS.md | 1 + CLAUDE.md | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 120000 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 120000 index 0000000..681311e --- /dev/null +++ b/AGENTS.md @@ -0,0 +1 @@ +CLAUDE.md \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md index 1684abc..d1feb16 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,8 +1,12 @@ # CLAUDE.md -## Project +## Project Overview -`@humanspeak/memory-cache` — a lightweight, zero-dependency in-memory cache for TypeScript/JavaScript. +`@humanspeak/memory-cache` — A lightweight, zero-dependency in-memory cache for TypeScript with TTL expiration, LRU eviction, and @cached decorator for method-level memoization. + +- **Package**: `@humanspeak/memory-cache` +- **Homepage**: <https://memory.svelte.page> +- **Repository**: <https://github.com/humanspeak/memory-cache> ## Coding Style