@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 +15 -2
- package/dist/factory-6sY9ZEqy.d.cts +1932 -0
- package/dist/factory-6sY9ZEqy.d.ts +1932 -0
- package/dist/index.cjs +892 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +55 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/{provider-2AIXk8yy.d.ts → react/index.d.cts} +18 -1929
- package/dist/react/index.d.ts +13673 -8
- package/dist/react/index.js +37 -3
- package/dist/react/index.js.map +1 -1
- package/dist/schemas/index.cjs +850 -0
- package/dist/schemas/index.cjs.map +1 -0
- package/dist/schemas/index.d.cts +2584 -0
- package/dist/schemas/index.d.ts +185 -185
- package/dist/server.cjs +1038 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +3869 -0
- package/dist/server.d.ts +247 -247
- package/dist/ws/index.cjs +613 -0
- package/dist/ws/index.cjs.map +1 -0
- package/dist/ws/index.d.cts +298 -0
- package/package.json +54 -15
- package/dist/chunk-DV6XOONA.js +0 -41
- package/dist/chunk-DV6XOONA.js.map +0 -1
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
|
-
#
|
|
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
|