@trpc-panel/core 1.0.1 → 1.0.3

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.
Files changed (31) hide show
  1. package/README.md +17 -7
  2. package/lib/index.js +19059 -372
  3. package/lib/index.mjs +19026 -369
  4. package/lib/react-app/bundle.js +759 -81
  5. package/lib/react-app/index.css +266 -54
  6. package/lib/scripts/build-react.d.ts +1 -0
  7. package/lib/src/meta.d.ts +1 -5
  8. package/lib/src/parse/__tests__/utils/router.d.ts +13 -53
  9. package/lib/src/parse/input-mappers/zod/parsers/parseZodArrayDef.d.ts +13 -2
  10. package/lib/src/parse/input-mappers/zod/parsers/parseZodBigIntDef.d.ts +7 -3
  11. package/lib/src/parse/input-mappers/zod/parsers/parseZodBooleanFieldDef.d.ts +6 -2
  12. package/lib/src/parse/input-mappers/zod/parsers/parseZodBrandedDef.d.ts +13 -2
  13. package/lib/src/parse/input-mappers/zod/parsers/parseZodDefaultDef.d.ts +14 -2
  14. package/lib/src/parse/input-mappers/zod/parsers/parseZodDiscriminatedUnionDef.d.ts +7 -14
  15. package/lib/src/parse/input-mappers/zod/parsers/parseZodEffectsDef.d.ts +27 -2
  16. package/lib/src/parse/input-mappers/zod/parsers/parseZodEnumDef.d.ts +8 -2
  17. package/lib/src/parse/input-mappers/zod/parsers/parseZodLiteralDef.d.ts +8 -2
  18. package/lib/src/parse/input-mappers/zod/parsers/parseZodNullDef.d.ts +7 -3
  19. package/lib/src/parse/input-mappers/zod/parsers/parseZodNullableDef.d.ts +13 -2
  20. package/lib/src/parse/input-mappers/zod/parsers/parseZodNumberDef.d.ts +6 -2
  21. package/lib/src/parse/input-mappers/zod/parsers/parseZodObjectDef.d.ts +14 -2
  22. package/lib/src/parse/input-mappers/zod/parsers/parseZodOptionalDef.d.ts +14 -3
  23. package/lib/src/parse/input-mappers/zod/parsers/parseZodPromiseDef.d.ts +13 -2
  24. package/lib/src/parse/input-mappers/zod/parsers/parseZodStringDef.d.ts +6 -2
  25. package/lib/src/parse/input-mappers/zod/parsers/parseZodUndefinedDef.d.ts +7 -3
  26. package/lib/src/parse/input-mappers/zod/parsers/parseZodVoidDef.d.ts +7 -3
  27. package/lib/src/parse/input-mappers/zod/selector.d.ts +2 -1
  28. package/lib/src/parse/input-mappers/zod/zod-types.d.ts +5 -3
  29. package/lib/src/parse/parseNodeTypes.d.ts +2 -2
  30. package/lib/src/parse/routerType.d.ts +56 -400
  31. package/package.json +13 -18
package/README.md CHANGED
@@ -19,19 +19,20 @@ Check out our [test app](https://app.trpcpanel.io)
19
19
  - 🐦 Supports nested routers, and nested input objects. The structure of the UI maps one-to-one to your API's routers and procedures.
20
20
  - 🧭 SideNav and VSCode-like procedure / router search to quickly find what you're looking for
21
21
  - ✨ [Transform](#data-transformers) data with built in `superjson` support.
22
+ - 🔧 **Zod v4** support with full compatibility for all Zod types
22
23
 
23
24
  ## Quick Start
24
25
 
25
26
  Install with your preferred package manager:
26
27
 
27
28
  ```sh
28
- yarn add trpc-panel
29
+ npm install @trpc-panel/core
29
30
  ```
30
31
 
31
32
  render your panel and return it from your backend (express example):
32
33
 
33
34
  ```js
34
- import { renderTrpcPanel } from "trpc-panel";
35
+ import { renderTrpcPanel } from "@trpc-panel/core";
35
36
  // ...
36
37
  app.use("/panel", (_, res) => {
37
38
  return res.send(
@@ -48,7 +49,7 @@ In Nextjs you'd want to create an api route somewhere like `src/pages/api/panel.
48
49
 
49
50
  ```ts
50
51
  import type { NextApiRequest, NextApiResponse } from "next";
51
- import { renderTrpcPanel } from "trpc-panel";
52
+ import { renderTrpcPanel } from "@trpc-panel/core";
52
53
  import { appRouter } from "../../server/api/root";
53
54
 
54
55
  export default async function handler(_: NextApiRequest, res: NextApiResponse) {
@@ -77,7 +78,7 @@ Documentation is opt-in, meaning you only need to set it up if you want to use i
77
78
 
78
79
  ```ts
79
80
  import { initTRPC } from "@trpc/server";
80
- import { TRPCPanelMeta } from "trpc-panel";
81
+ import { TRPCPanelMeta } from "@trpc-panel/core";
81
82
 
82
83
  const t = initTRPC.meta<TRPCPanelMeta>().create();
83
84
  ```
@@ -132,11 +133,18 @@ app.use("/panel", (_, res) => {
132
133
 
133
134
  `trpc-panel` welcomes and encourages open source contributions. Please see our [contributing](./CONTRIBUTING.md) guide for information on how to develop locally.
134
135
 
136
+ ## Requirements
137
+
138
+ - **tRPC**: v10 or v11
139
+ - **Zod**: v4.x (^4.2.1 recommended)
140
+
141
+ > **Note**: This version requires Zod v4. If you're using Zod v3, please use an earlier version of trpc-panel.
142
+
135
143
  ## Limitations
136
144
 
137
- Currently, tRPC panel supports tRPC v10 and v11 and only works with zod input schemas. With it's current design it would be feasible to easily add support for other input types as well
145
+ Currently, tRPC panel only works with Zod input schemas. With its current design it would be feasible to easily add support for other input types as well.
138
146
 
139
- There are no plans to support v9 or other previous tRPC versions.
147
+ There are no plans to support tRPC v9 or other previous tRPC versions.
140
148
 
141
149
  ### Supported zod types
142
150
 
@@ -157,13 +165,15 @@ The following are supported
157
165
  - Number
158
166
  - Object
159
167
  - Optional
168
+ - Pipe (transform/preprocess)
160
169
  - Promise
161
170
  - String
162
171
  - Undefined
172
+ - Void
163
173
 
164
174
  We would like to add the following types:
165
175
 
166
- - Union
176
+ - Union (non-discriminated)
167
177
  - Tuple
168
178
  - Record
169
179
  - Never