@crup/react-timer-hook 0.0.1-alpha.4 → 0.0.1-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,6 +12,16 @@
12
12
 
13
13
  📚 Docs: https://crup.github.io/react-timer-hook/
14
14
 
15
+ ## Docs and live examples
16
+
17
+ The documentation site is built with Docusaurus and includes live React playgrounds for 15 recipes:
18
+
19
+ - Basic: clock, stopwatch, absolute countdown, pausable countdown, manual controls
20
+ - Intermediate: once-only `onEnd`, polling, poll-and-cancel, backend events, debug logs
21
+ - Advanced: many display timers, timer groups, global controls, per-item polling, dynamic items
22
+
23
+ Open: https://crup.github.io/react-timer-hook/
24
+
15
25
  ## Why it is different
16
26
 
17
27
  Most timer libraries mix scheduling, lifecycle, formatting, and app behavior. This package keeps the core small:
@@ -128,20 +138,51 @@ Current local build:
128
138
 
129
139
  | File | Raw | Gzip | Brotli |
130
140
  | --- | ---: | ---: | ---: |
131
- | `dist/index.js` | 27.32 kB | 4.69 kB | 4.18 kB |
132
- | `dist/index.cjs` | 29.18 kB | 5.08 kB | 4.50 kB |
141
+ | `dist/index.js` | 11.82 kB | 3.55 kB | 3.20 kB |
142
+ | `dist/index.cjs` | 12.94 kB | 3.79 kB | 3.42 kB |
133
143
  | `dist/index.d.ts` | 3.95 kB | 992 B | 888 B |
134
144
 
135
145
  CI writes a size summary to the GitHub Actions UI and posts a bundle-size comment on pull requests.
136
146
 
137
147
  ## AI-friendly
138
148
 
139
- Agents can start with:
149
+ End users do not need these files. They are for coding agents, docs-aware IDEs, and MCP clients.
150
+
151
+ ### MCP setup
152
+
153
+ Clone the repo, install dependencies, and point your MCP client at the local stdio server:
154
+
155
+ ```sh
156
+ git clone https://github.com/crup/react-timer-hook.git
157
+ cd react-timer-hook
158
+ pnpm install
159
+ ```
160
+
161
+ ```json
162
+ {
163
+ "mcpServers": {
164
+ "react-timer-hook-docs": {
165
+ "command": "node",
166
+ "args": ["/absolute/path/to/react-timer-hook/mcp/server.mjs"]
167
+ }
168
+ }
169
+ }
170
+ ```
171
+
172
+ The MCP server exposes:
173
+
174
+ ```txt
175
+ react-timer-hook://package
176
+ react-timer-hook://api
177
+ react-timer-hook://recipes
178
+ ```
179
+
180
+ Agents can use hosted context:
140
181
 
141
182
  - https://crup.github.io/react-timer-hook/llms.txt
142
183
  - https://crup.github.io/react-timer-hook/llms-full.txt
143
184
 
144
- Local helpers:
185
+ Local MCP/docs helpers:
145
186
 
146
187
  ```sh
147
188
  pnpm ai:context