@orpc/react 0.0.0-next-20241126071108 → 0.0.0-next.19fea10

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 (58) hide show
  1. package/dist/index.js +26 -4924
  2. package/dist/src/react-hooks.d.ts +2 -2
  3. package/dist/src/react-utils.d.ts +2 -2
  4. package/package.json +17 -21
  5. package/dist/index.js.map +0 -1
  6. package/dist/src/general-hooks.d.ts.map +0 -1
  7. package/dist/src/general-utils.d.ts.map +0 -1
  8. package/dist/src/index.d.ts.map +0 -1
  9. package/dist/src/orpc-path.d.ts.map +0 -1
  10. package/dist/src/procedure-hooks.d.ts.map +0 -1
  11. package/dist/src/procedure-utils.d.ts.map +0 -1
  12. package/dist/src/react-context.d.ts.map +0 -1
  13. package/dist/src/react-hooks.d.ts.map +0 -1
  14. package/dist/src/react-utils.d.ts.map +0 -1
  15. package/dist/src/react.d.ts.map +0 -1
  16. package/dist/src/tanstack-key.d.ts.map +0 -1
  17. package/dist/src/tanstack-query.d.ts.map +0 -1
  18. package/dist/src/types.d.ts.map +0 -1
  19. package/dist/src/use-queries/builder.d.ts.map +0 -1
  20. package/dist/src/use-queries/builders.d.ts.map +0 -1
  21. package/dist/src/use-queries/hook.d.ts.map +0 -1
  22. package/dist/tsconfig.tsbuildinfo +0 -1
  23. package/src/general-hooks.test-d.ts +0 -151
  24. package/src/general-hooks.test.tsx +0 -232
  25. package/src/general-hooks.ts +0 -101
  26. package/src/general-utils.test-d.ts +0 -454
  27. package/src/general-utils.test.tsx +0 -818
  28. package/src/general-utils.ts +0 -393
  29. package/src/index.ts +0 -8
  30. package/src/orpc-path.test-d.ts +0 -13
  31. package/src/orpc-path.test.ts +0 -12
  32. package/src/orpc-path.ts +0 -24
  33. package/src/procedure-hooks.test-d.ts +0 -321
  34. package/src/procedure-hooks.test.tsx +0 -388
  35. package/src/procedure-hooks.ts +0 -271
  36. package/src/procedure-utils.test-d.ts +0 -476
  37. package/src/procedure-utils.test.tsx +0 -330
  38. package/src/procedure-utils.ts +0 -312
  39. package/src/react-context.ts +0 -43
  40. package/src/react-hooks.ts +0 -94
  41. package/src/react-utils.ts +0 -99
  42. package/src/react.test-d.ts +0 -89
  43. package/src/react.test.tsx +0 -102
  44. package/src/react.tsx +0 -81
  45. package/src/tanstack-key.test-d.ts +0 -35
  46. package/src/tanstack-key.test.ts +0 -62
  47. package/src/tanstack-key.ts +0 -64
  48. package/src/tanstack-query.ts +0 -27
  49. package/src/types.ts +0 -7
  50. package/src/use-queries/builder.test-d.ts +0 -29
  51. package/src/use-queries/builder.test.ts +0 -25
  52. package/src/use-queries/builder.ts +0 -71
  53. package/src/use-queries/builders.test-d.ts +0 -30
  54. package/src/use-queries/builders.test.tsx +0 -29
  55. package/src/use-queries/builders.ts +0 -101
  56. package/src/use-queries/hook.test-d.ts +0 -64
  57. package/src/use-queries/hook.test.tsx +0 -89
  58. package/src/use-queries/hook.ts +0 -57
@@ -1,5 +1,5 @@
1
1
  import type { ContractProcedure, ContractRouter, SchemaOutput } from '@orpc/contract';
2
- import type { Procedure, Router } from '@orpc/server';
2
+ import type { Lazy, Procedure, Router } from '@orpc/server';
3
3
  import type { ORPCContext } from './react-context';
4
4
  import { type GeneralHooks } from './general-hooks';
5
5
  import { type ProcedureHooks } from './procedure-hooks';
@@ -7,7 +7,7 @@ export type ORPCHooksWithContractRouter<TRouter extends ContractRouter> = {
7
7
  [K in keyof TRouter]: TRouter[K] extends ContractProcedure<infer UInputSchema, infer UOutputSchema> ? ProcedureHooks<UInputSchema, UOutputSchema, SchemaOutput<UOutputSchema>> & GeneralHooks<UInputSchema, UOutputSchema, SchemaOutput<UOutputSchema>> : TRouter[K] extends ContractRouter ? ORPCHooksWithContractRouter<TRouter[K]> : never;
8
8
  } & GeneralHooks<undefined, undefined, unknown>;
9
9
  export type ORPCHooksWithRouter<TRouter extends Router<any>> = {
10
- [K in keyof TRouter]: TRouter[K] extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> ? ProcedureHooks<UInputSchema, UOutputSchema, UFuncOutput> & GeneralHooks<UInputSchema, UOutputSchema, UFuncOutput> : TRouter[K] extends Router<any> ? ORPCHooksWithRouter<TRouter[K]> : never;
10
+ [K in keyof TRouter]: TRouter[K] extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> | Lazy<Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput>> ? ProcedureHooks<UInputSchema, UOutputSchema, UFuncOutput> & GeneralHooks<UInputSchema, UOutputSchema, UFuncOutput> : TRouter[K] extends Router<any> ? ORPCHooksWithRouter<TRouter[K]> : never;
11
11
  } & GeneralHooks<undefined, undefined, unknown>;
12
12
  export interface CreateORPCHooksOptions<TRouter extends ContractRouter | Router<any>> {
13
13
  context: ORPCContext<TRouter>;
@@ -1,5 +1,5 @@
1
1
  import type { ContractProcedure, ContractRouter, SchemaOutput } from '@orpc/contract';
2
- import type { Procedure, Router } from '@orpc/server';
2
+ import type { Lazy, Procedure, Router } from '@orpc/server';
3
3
  import type { ORPCContextValue } from './react-context';
4
4
  import { type GeneralUtils } from './general-utils';
5
5
  import { type ProcedureUtils } from './procedure-utils';
@@ -7,7 +7,7 @@ export type ORPCUtilsWithContractRouter<TRouter extends ContractRouter> = {
7
7
  [K in keyof TRouter]: TRouter[K] extends ContractProcedure<infer UInputSchema, infer UOutputSchema> ? ProcedureUtils<UInputSchema, UOutputSchema, SchemaOutput<UOutputSchema>> & GeneralUtils<UInputSchema, UOutputSchema, SchemaOutput<UOutputSchema>> : TRouter[K] extends ContractRouter ? ORPCUtilsWithContractRouter<TRouter[K]> : never;
8
8
  } & GeneralUtils<undefined, undefined, unknown>;
9
9
  export type ORPCUtilsWithRouter<TRouter extends Router<any>> = {
10
- [K in keyof TRouter]: TRouter[K] extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> ? ProcedureUtils<UInputSchema, UOutputSchema, UFuncOutput> & GeneralUtils<UInputSchema, UOutputSchema, UFuncOutput> : TRouter[K] extends Router<any> ? ORPCUtilsWithRouter<TRouter[K]> : never;
10
+ [K in keyof TRouter]: TRouter[K] extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> | Lazy<Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput>> ? ProcedureUtils<UInputSchema, UOutputSchema, UFuncOutput> & GeneralUtils<UInputSchema, UOutputSchema, UFuncOutput> : TRouter[K] extends Router<any> ? ORPCUtilsWithRouter<TRouter[K]> : never;
11
11
  } & GeneralUtils<undefined, undefined, unknown>;
12
12
  export interface CreateORPCUtilsOptions<TRouter extends ContractRouter | Router<any>> {
13
13
  contextValue: ORPCContextValue<TRouter>;
package/package.json CHANGED
@@ -1,25 +1,18 @@
1
1
  {
2
2
  "name": "@orpc/react",
3
3
  "type": "module",
4
- "version": "0.0.0-next-20241126071108",
5
- "author": {
6
- "name": "unnoq",
7
- "email": "contact@unnoq.com",
8
- "url": "https://unnoq.com"
9
- },
4
+ "version": "0.0.0-next.19fea10",
10
5
  "license": "MIT",
11
- "homepage": "https://github.com/unnoq/orpc",
6
+ "homepage": "https://orpc.unnoq.com",
12
7
  "repository": {
13
8
  "type": "git",
14
- "url": "https://github.com/unnoq/orpc.git",
9
+ "url": "git+https://github.com/unnoq/orpc.git",
15
10
  "directory": "packages/react"
16
11
  },
17
12
  "keywords": [
18
- "unnoq"
13
+ "unnoq",
14
+ "orpc"
19
15
  ],
20
- "publishConfig": {
21
- "access": "public"
22
- },
23
16
  "exports": {
24
17
  ".": {
25
18
  "types": "./dist/src/index.d.ts",
@@ -31,19 +24,22 @@
31
24
  }
32
25
  },
33
26
  "files": [
34
- "dist",
35
- "src"
27
+ "!**/*.map",
28
+ "!**/*.tsbuildinfo",
29
+ "dist"
36
30
  ],
31
+ "peerDependencies": {
32
+ "@tanstack/react-query": ">=5.59.0",
33
+ "react": ">=18.3.0",
34
+ "@orpc/client": "0.0.0-next.19fea10",
35
+ "@orpc/contract": "0.0.0-next.19fea10",
36
+ "@orpc/server": "0.0.0-next.19fea10"
37
+ },
37
38
  "dependencies": {
38
- "@orpc/client": "0.0.0-next-20241126071108",
39
- "@orpc/shared": "0.0.0-next-20241126071108"
39
+ "@orpc/shared": "0.0.0-next.19fea10"
40
40
  },
41
41
  "devDependencies": {
42
- "@tanstack/react-query": "^5.59.9",
43
- "react": "^18.3.1",
44
- "zod": "^3.23.8",
45
- "@orpc/contract": "0.0.0-next-20241126071108",
46
- "@orpc/server": "0.0.0-next-20241126071108"
42
+ "zod": "^3.23.8"
47
43
  },
48
44
  "scripts": {
49
45
  "build": "tsup --clean --sourcemap --entry.index=src/index.ts --format=esm --onSuccess='tsc -b --noCheck'",