@anvil-js/client 0.0.1 → 0.0.2

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
@@ -3,10 +3,23 @@
3
3
  Typed client for the [Anvil](https://anvil.my) API: the tRPC router types,
4
4
  Zod schemas, TanStack Query React hooks, and the Essential WebSocket client.
5
5
 
6
+ Works in **ESM and CommonJS** — usable in a bundler, a modern `import`
7
+ script, or a plain `require()` Node script (e.g. a Discord bot). The root
8
+ entry has **no React dependency**.
9
+
6
10
  ```bash
7
11
  npm i @anvil-js/client
8
- # react hooks need react as a peer:
9
- npm i react @tanstack/react-query
12
+ # only if you use the React hooks (@anvil-js/client/react):
13
+ npm i react @tanstack/react-query @trpc/react-query
14
+ ```
15
+
16
+ ```js
17
+ // CommonJS (Discord bot, plain script)
18
+ const { createAnvilClient } = require('@anvil-js/client');
19
+ ```
20
+ ```ts
21
+ // ESM / TypeScript
22
+ import { createAnvilClient } from '@anvil-js/client';
10
23
  ```
11
24
 
12
25
  ## Entry points