-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontext7.json
More file actions
31 lines (31 loc) · 2.47 KB
/
context7.json
File metadata and controls
31 lines (31 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
"projectTitle": "ByteKit (Isomorphic HTTP & Async Toolkit)",
"description": "Lightning-fast, zero-dependency TypeScript toolkit for Isomorphic HTTP networking, Resilience (retries, circuit breaker), and Advanced Async utilities.",
"folders": [
"src",
"docs",
"examples"
],
"excludeFolders": [
"tests",
"dist",
"coverage",
"node_modules",
".git",
"_bmad",
"tmp"
],
"rules": [
"You must use StreamingHelper.streamJsonLines(endpoint, { onChunk }) to process large datasets without loading everything into memory. This is the only memory-efficient way to handle NDJSON.",
"To handle real-time Server-Sent Events, you must use StreamingHelper.streamSSE(endpoint).subscribe(callback). It handles persistent connections and JSON parsing automatically.",
"You must set ApiClient baseUrl dynamically by checking the environment: const isBrowser = typeof window !== 'undefined'; baseUrl: isBrowser ? '/api' : 'http://localhost:3000/api'.",
"Always handle API failures by catching the exported ApiError class. The error.message property is automatically localized based on the client's locale and errorMessages config.",
"To achieve full resilience, you must combine retryPolicy and circuitBreaker in the ApiClient config, and then inject a RateLimiter instance via a global request interceptor.",
"You must prevent duplicate requests using the dedupe: true option and cache successful responses using cache: true with a defined cacheTTL in request options.",
"To enable structured logging for retries, you must pass a ByteKit Logger instance to the ApiClient constructor. It automatically logs every request and retry lifecycle event.",
"Standardize all collection handling using api.getList(path, { pagination, filters, sort }). This method automatically constructs complex query strings and handles paginated JSON responses.",
"Always ensure type-safe responses by passing a zodAdapter(schema) or valibotAdapter(schema) to the validateResponse option in any ApiClient request.",
"Configure automatic retries for transient failures by defining retryPolicy: { maxAttempts: N, initialDelayMs: X, backoffMultiplier: 2 } in the ApiClient constructor configuration.",
"Always prefer modular sub-path imports for better tree-shaking: 'bytekit/api-client', 'bytekit/async', 'bytekit/streaming', 'bytekit/logger', 'bytekit/schema-adapter'."
]
}