@stryke/trpc-next 0.1.0
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/LICENSE +201 -0
- package/README.md +62 -0
- package/dist/client.cjs +39 -0
- package/dist/client.d.ts +5 -0
- package/dist/client.mjs +1 -0
- package/dist/index.cjs +60 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.mjs +1 -0
- package/dist/server.cjs +30 -0
- package/dist/server.d.ts +33 -0
- package/dist/server.mjs +1 -0
- package/dist/shared.cjs +42 -0
- package/dist/shared.d.ts +7 -0
- package/dist/shared.mjs +1 -0
- package/dist/tanstack-query/client.cjs +47 -0
- package/dist/tanstack-query/client.d.ts +11 -0
- package/dist/tanstack-query/client.mjs +1 -0
- package/dist/tanstack-query/server.cjs +44 -0
- package/dist/tanstack-query/server.d.ts +14 -0
- package/dist/tanstack-query/server.mjs +1 -0
- package/package.json +178 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!-- START header -->
|
|
2
|
+
<!-- END header -->
|
|
3
|
+
|
|
4
|
+
# Stryke - tRPC NextJs Package
|
|
5
|
+
|
|
6
|
+
A package to help in using tRPC in modern NextJs applications
|
|
7
|
+
|
|
8
|
+
<!-- START doctoc -->
|
|
9
|
+
<!-- END doctoc -->
|
|
10
|
+
|
|
11
|
+
## Installing
|
|
12
|
+
|
|
13
|
+
Using [pnpm](http://pnpm.io):
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add -D @stryke/trpc-next
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
<details>
|
|
20
|
+
<summary>Using npm</summary>
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -D @stryke/trpc-next
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
</details>
|
|
27
|
+
|
|
28
|
+
<details>
|
|
29
|
+
<summary>Using yarn</summary>
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
yarn add -D @stryke/trpc-next
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
</details>
|
|
36
|
+
|
|
37
|
+
## Reduced Package Size
|
|
38
|
+
|
|
39
|
+
This project uses [tsup](https://tsup.egoist.dev/) to package the source code
|
|
40
|
+
due to its ability to remove unused code and ship smaller javascript files
|
|
41
|
+
thanks to code splitting. This helps to greatly reduce the size of the package
|
|
42
|
+
and to make it easier to use in other projects.
|
|
43
|
+
|
|
44
|
+
## Development
|
|
45
|
+
|
|
46
|
+
This project is built using [Nx](https://nx.dev). As a result, many of the usual
|
|
47
|
+
commands are available to assist in development.
|
|
48
|
+
|
|
49
|
+
### Building
|
|
50
|
+
|
|
51
|
+
Run `nx build trpc-next` to build the library.
|
|
52
|
+
|
|
53
|
+
### Running unit tests
|
|
54
|
+
|
|
55
|
+
Run `nx test trpc-next` to execute the unit tests via [Jest](https://jestjs.io).
|
|
56
|
+
|
|
57
|
+
### Linting
|
|
58
|
+
|
|
59
|
+
Run `nx lint trpc-next` to run [ESLint](https://eslint.org/) on the package.
|
|
60
|
+
|
|
61
|
+
<!-- START footer -->
|
|
62
|
+
<!-- END footer -->
|
package/dist/client.cjs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createTRPCClient = createTRPCClient;
|
|
8
|
+
exports.createUseAction = createUseAction;
|
|
9
|
+
var _client = require("@trpc/client");
|
|
10
|
+
var _client2 = require("@trpc/next/app-dir/client");
|
|
11
|
+
var _nextHttp = require("@trpc/next/app-dir/links/nextHttp");
|
|
12
|
+
var _shared = require("./shared.cjs");
|
|
13
|
+
function createTRPCClient(r) {
|
|
14
|
+
return (0, _client2.experimental_createTRPCNextAppDirClient)({
|
|
15
|
+
config() {
|
|
16
|
+
return {
|
|
17
|
+
links: [(0, _client.loggerLink)({
|
|
18
|
+
enabled: s => !0
|
|
19
|
+
}), (0, _nextHttp.experimental_nextHttpLink)({
|
|
20
|
+
transformer: _shared.transformer,
|
|
21
|
+
batch: !0,
|
|
22
|
+
url: (0, _shared.getTRPCServerUrl)(r),
|
|
23
|
+
headers() {
|
|
24
|
+
return {
|
|
25
|
+
"x-trpc-source": "client"
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
})]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function createUseAction() {
|
|
34
|
+
return (0, _client2.experimental_createActionHook)({
|
|
35
|
+
links: [(0, _client.loggerLink)(), (0, _client2.experimental_serverActionLink)({
|
|
36
|
+
transformer: _shared.transformer
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UseTRPCActionResult } from "@trpc/next/app-dir/client";
|
|
2
|
+
import type { ActionHandlerDef, TRPCActionHandler } from "@trpc/next/app-dir/server";
|
|
3
|
+
import type { AnyTRPCRouter } from "@trpc/server";
|
|
4
|
+
export declare function createTRPCClient<TRouter extends AnyTRPCRouter>(baseUrl: string): import("@trpc/client").TRPCClient<TRouter>;
|
|
5
|
+
export declare function createUseAction<TRouter extends AnyTRPCRouter>(): <TDef extends ActionHandlerDef>(handler: TRPCActionHandler<TDef>, useActionOpts?: any) => UseTRPCActionResult<TDef>;
|
package/dist/client.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{loggerLink as e}from"@trpc/client";import{experimental_createActionHook as n,experimental_createTRPCNextAppDirClient as o,experimental_serverActionLink as i}from"@trpc/next/app-dir/client";import{experimental_nextHttpLink as p}from"@trpc/next/app-dir/links/nextHttp";import{getTRPCServerUrl as c,transformer as t}from"./shared";export function createTRPCClient(r){return o({config(){return{links:[e({enabled:s=>!0}),p({transformer:t,batch:!0,url:c(r),headers(){return{"x-trpc-source":"client"}}})]}}})}export function createUseAction(){return n({links:[e(),i({transformer:t})]})}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _client = require("./client.cjs");
|
|
7
|
+
Object.keys(_client).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _client[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _client[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _server = require("./server.cjs");
|
|
18
|
+
Object.keys(_server).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _server[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _server[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _shared = require("./shared.cjs");
|
|
29
|
+
Object.keys(_shared).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _shared[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _shared[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _client2 = require("./tanstack-query/client.cjs");
|
|
40
|
+
Object.keys(_client2).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _client2[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _client2[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _server2 = require("./tanstack-query/server.cjs");
|
|
51
|
+
Object.keys(_server2).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _server2[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _server2[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The trpc-next library used by Storm Software for building TypeScript applications.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* A package to help in using tRPC in modern NextJs applications
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export * from "./client";
|
|
10
|
+
export * from "./server";
|
|
11
|
+
export * from "./shared";
|
|
12
|
+
export * from "./tanstack-query/client";
|
|
13
|
+
export * from "./tanstack-query/server";
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./client";export*from"./server";export*from"./shared";export*from"./tanstack-query/client";export*from"./tanstack-query/server";
|
package/dist/server.cjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createTRPCServer = createTRPCServer;
|
|
7
|
+
var _client = require("@trpc/client");
|
|
8
|
+
var _nextCache = require("@trpc/next/app-dir/links/nextCache");
|
|
9
|
+
var _server = require("@trpc/next/app-dir/server");
|
|
10
|
+
var _headers = require("next/headers");
|
|
11
|
+
var _shared = require("./shared.cjs");
|
|
12
|
+
function createTRPCServer(t, r) {
|
|
13
|
+
return (0, _server.experimental_createTRPCNextAppDirServer)({
|
|
14
|
+
config() {
|
|
15
|
+
return {
|
|
16
|
+
links: [(0, _client.loggerLink)({
|
|
17
|
+
enabled: e => !0
|
|
18
|
+
}), (0, _nextCache.experimental_nextCacheLink)({
|
|
19
|
+
revalidate: 5,
|
|
20
|
+
router: t,
|
|
21
|
+
transformer: _shared.transformer,
|
|
22
|
+
createContext: async () => {
|
|
23
|
+
const e = r ? await Promise.resolve(r()) : {};
|
|
24
|
+
return e.headers ??= {}, e.headers["x-trpc-source"] = "rsc-invoke", e.headers.cookie = (await (0, _headers.cookies)()).toString(), e;
|
|
25
|
+
}
|
|
26
|
+
})]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MaybePromise } from "@stryke/types";
|
|
2
|
+
import type { Resolver } from "@trpc/client";
|
|
3
|
+
import type { AnyTRPCRouter, inferRouterContext } from "@trpc/server";
|
|
4
|
+
import type { AnyProcedure, AnyRootTypes, inferProcedureInput, inferTransformedProcedureOutput, ProcedureType, RouterRecord } from "@trpc/server/unstable-core-do-not-import";
|
|
5
|
+
import type { ResolverDef } from "@trpc/tanstack-react-query";
|
|
6
|
+
export type DecorateProcedureServer<TType extends ProcedureType, TDef extends ResolverDef> = TType extends "query" ? {
|
|
7
|
+
query: Resolver<TDef>;
|
|
8
|
+
revalidate: (input?: TDef["input"]) => Promise<{
|
|
9
|
+
revalidated: false;
|
|
10
|
+
error: string;
|
|
11
|
+
} | {
|
|
12
|
+
revalidated: true;
|
|
13
|
+
}>;
|
|
14
|
+
} : TType extends "mutation" ? {
|
|
15
|
+
mutate: Resolver<TDef>;
|
|
16
|
+
} : TType extends "subscription" ? {
|
|
17
|
+
subscribe: Resolver<TDef>;
|
|
18
|
+
} : never;
|
|
19
|
+
export type NextAppDirDecorateRouterRecord<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = {
|
|
20
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyProcedure ? DecorateProcedureServer<$Value["_def"]["type"], {
|
|
21
|
+
input: inferProcedureInput<$Value>;
|
|
22
|
+
output: inferTransformedProcedureOutput<TRoot, $Value>;
|
|
23
|
+
errorShape: TRoot["errorShape"];
|
|
24
|
+
transformer: TRoot["transformer"];
|
|
25
|
+
}> : $Value extends RouterRecord ? NextAppDirDecorateRouterRecord<TRoot, $Value> : never : never;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* This client invokes procedures directly on the server without fetching over HTTP.
|
|
29
|
+
*
|
|
30
|
+
* @param router - The router created by the user
|
|
31
|
+
* @param createContext - An optional function to generate a context
|
|
32
|
+
*/
|
|
33
|
+
export declare function createTRPCServer<TRouter extends AnyTRPCRouter, TContext extends inferRouterContext<TRouter>>(router: TRouter, createContext?: () => MaybePromise<TContext>): NextAppDirDecorateRouterRecord<TRouter["_def"]["_config"]["$types"], TRouter["_def"]["record"]>;
|
package/dist/server.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{loggerLink as o}from"@trpc/client";import{experimental_nextCacheLink as n}from"@trpc/next/app-dir/links/nextCache";import{experimental_createTRPCNextAppDirServer as p}from"@trpc/next/app-dir/server";import{cookies as u}from"next/headers";import{transformer as i}from"./shared";export function createTRPCServer(t,r){return p({config(){return{links:[o({enabled:e=>!0}),n({revalidate:5,router:t,transformer:i,createContext:async()=>{const e=r?await Promise.resolve(r()):{};return e.headers??={},e.headers["x-trpc-source"]="rsc-invoke",e.headers.cookie=(await u()).toString(),e}})]}}})}
|
package/dist/shared.cjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createQueryClient = void 0;
|
|
7
|
+
exports.getTRPCServerUrl = getTRPCServerUrl;
|
|
8
|
+
exports.transformer = void 0;
|
|
9
|
+
var _polyfill = require("@js-temporal/polyfill");
|
|
10
|
+
var _joinPaths = require("@stryke/path/join-paths");
|
|
11
|
+
var _reactQuery = require("@tanstack/react-query");
|
|
12
|
+
var _defu = _interopRequireDefault(require("defu"));
|
|
13
|
+
var _superjson = _interopRequireDefault(require("superjson"));
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function getTRPCServerUrl(e, t = 1) {
|
|
16
|
+
return (0, _joinPaths.joinPaths)(typeof e == "string" ? e : e.host || "", "api", t ? `v${t}` : "", "trpc");
|
|
17
|
+
}
|
|
18
|
+
_superjson.default.registerCustom({
|
|
19
|
+
isApplicable: e => e instanceof _polyfill.Temporal.PlainDate,
|
|
20
|
+
serialize: e => e.toJSON(),
|
|
21
|
+
deserialize: e => _polyfill.Temporal.PlainDate.from(e)
|
|
22
|
+
}, "Temporal.PlainDate"), _superjson.default.registerCustom({
|
|
23
|
+
isApplicable: e => e instanceof _polyfill.Temporal.PlainDateTime,
|
|
24
|
+
serialize: e => e.toJSON(),
|
|
25
|
+
deserialize: e => _polyfill.Temporal.PlainDateTime.from(e)
|
|
26
|
+
}, "Temporal.PlainDateTime");
|
|
27
|
+
const transformer = exports.transformer = _superjson.default,
|
|
28
|
+
createQueryClient = e => new _reactQuery.QueryClient((0, _defu.default)(e, {
|
|
29
|
+
defaultOptions: {
|
|
30
|
+
queries: {
|
|
31
|
+
staleTime: 1e3 * 30
|
|
32
|
+
},
|
|
33
|
+
dehydrate: {
|
|
34
|
+
shouldDehydrateQuery: t => (0, _reactQuery.defaultShouldDehydrateQuery)(t) || t.state.status === "pending",
|
|
35
|
+
serializeData: transformer.serialize
|
|
36
|
+
},
|
|
37
|
+
hydrate: {
|
|
38
|
+
deserializeData: transformer.deserialize
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
exports.createQueryClient = createQueryClient;
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StormURL } from "@stryke/http/types";
|
|
2
|
+
import type { QueryClientConfig } from "@tanstack/react-query";
|
|
3
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
4
|
+
import type { DataTransformer } from "@trpc/server/unstable-core-do-not-import";
|
|
5
|
+
export declare function getTRPCServerUrl(baseUrl: string | StormURL, version?: number | null): any;
|
|
6
|
+
export declare const transformer: DataTransformer;
|
|
7
|
+
export declare const createQueryClient: (config?: Partial<QueryClientConfig>) => QueryClient;
|
package/dist/shared.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Temporal as r}from"@js-temporal/polyfill";import{joinPaths as i}from"@stryke/path/join-paths";import{defaultShouldDehydrateQuery as o,QueryClient as n}from"@tanstack/react-query";import s from"defu";import a from"superjson";export function getTRPCServerUrl(e,t=1){return i(typeof e=="string"?e:e.host||"","api",t?`v${t}`:"","trpc")}a.registerCustom({isApplicable:e=>e instanceof r.PlainDate,serialize:e=>e.toJSON(),deserialize:e=>r.PlainDate.from(e)},"Temporal.PlainDate"),a.registerCustom({isApplicable:e=>e instanceof r.PlainDateTime,serialize:e=>e.toJSON(),deserialize:e=>r.PlainDateTime.from(e)},"Temporal.PlainDateTime");export const transformer=a,createQueryClient=e=>new n(s(e,{defaultOptions:{queries:{staleTime:1e3*30},dehydrate:{shouldDehydrateQuery:t=>o(t)||t.state.status==="pending",serializeData:transformer.serialize},hydrate:{deserializeData:transformer.deserialize}}}));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createTRPCTanstackQueryClient = createTRPCTanstackQueryClient;
|
|
8
|
+
var _environmentChecks = require("@stryke/env/environment-checks");
|
|
9
|
+
var _reactQuery = require("@tanstack/react-query");
|
|
10
|
+
var _reactQueryDevtools = require("@tanstack/react-query-devtools");
|
|
11
|
+
var _client = require("@trpc/client");
|
|
12
|
+
var _tanstackReactQuery = require("@trpc/tanstack-react-query");
|
|
13
|
+
var _react = require("react");
|
|
14
|
+
var _shared = require("../shared.cjs");
|
|
15
|
+
function createTRPCTanstackQueryClient() {
|
|
16
|
+
const {
|
|
17
|
+
TRPCProvider: t,
|
|
18
|
+
useTRPC: o
|
|
19
|
+
} = (0, _tanstackReactQuery.createTRPCContext)();
|
|
20
|
+
return {
|
|
21
|
+
useTRPCTanstackQuery: o,
|
|
22
|
+
TRPCTanstackQueryProvider(n) {
|
|
23
|
+
const {
|
|
24
|
+
children: i,
|
|
25
|
+
baseUrl: u,
|
|
26
|
+
queryClient: e
|
|
27
|
+
} = n,
|
|
28
|
+
[c] = (0, _react.useState)(() => (0, _client.createTRPCClient)({
|
|
29
|
+
links: [(0, _client.loggerLink)({
|
|
30
|
+
enabled: r => _environmentChecks.isDevelopment || r.direction === "down" && r.result instanceof Error
|
|
31
|
+
}), (0, _client.httpBatchStreamLink)({
|
|
32
|
+
transformer: _shared.transformer,
|
|
33
|
+
url: (0, _shared.getTRPCServerUrl)(u),
|
|
34
|
+
headers: {
|
|
35
|
+
"x-trpc-source": "react-query"
|
|
36
|
+
}
|
|
37
|
+
})]
|
|
38
|
+
}));
|
|
39
|
+
return React.createElement(t, {
|
|
40
|
+
trpcClient: c,
|
|
41
|
+
queryClient: e
|
|
42
|
+
}, React.createElement(_reactQuery.QueryClientProvider, {
|
|
43
|
+
client: e
|
|
44
|
+
}, i, React.createElement(_reactQueryDevtools.ReactQueryDevtools, null)));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { StormURL } from "@stryke/http/types";
|
|
2
|
+
import type { QueryClient } from "@tanstack/react-query";
|
|
3
|
+
import type { AnyTRPCRouter } from "@trpc/server";
|
|
4
|
+
export declare function createTRPCTanstackQueryClient<TRouter extends AnyTRPCRouter>(): {
|
|
5
|
+
useTRPCTanstackQuery: () => import("@trpc/tanstack-react-query").TRPCOptionsProxy<TRouter>;
|
|
6
|
+
TRPCTanstackQueryProvider(props: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
baseUrl: string | StormURL;
|
|
9
|
+
queryClient: QueryClient;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{isDevelopment as s}from"@stryke/env/environment-checks";import{QueryClientProvider as a}from"@tanstack/react-query";import{ReactQueryDevtools as l}from"@tanstack/react-query-devtools";import{createTRPCClient as m,httpBatchStreamLink as C,loggerLink as R}from"@trpc/client";import{createTRPCContext as p}from"@trpc/tanstack-react-query";import{useState as y}from"react";import{getTRPCServerUrl as T,transformer as P}from"../shared";export function createTRPCTanstackQueryClient(){const{TRPCProvider:t,useTRPC:o}=p();return{useTRPCTanstackQuery:o,TRPCTanstackQueryProvider(n){const{children:i,baseUrl:u,queryClient:e}=n,[c]=y(()=>m({links:[R({enabled:r=>s||r.direction==="down"&&r.result instanceof Error}),C({transformer:P,url:T(u),headers:{"x-trpc-source":"react-query"}})]}));return React.createElement(t,{trpcClient:c,queryClient:e},React.createElement(a,{client:e},i,React.createElement(l,null)))}}}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createTRPCTanstackQueryServer = createTRPCTanstackQueryServer;
|
|
7
|
+
var _reactQuery = require("@tanstack/react-query");
|
|
8
|
+
var _tanstackReactQuery = require("@trpc/tanstack-react-query");
|
|
9
|
+
var _defu = _interopRequireDefault(require("defu"));
|
|
10
|
+
var _headers = require("next/headers");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
require("server-only");
|
|
13
|
+
var _shared = require("../shared.cjs");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function createTRPCTanstackQueryServer(i, o, a) {
|
|
18
|
+
const c = (0, _react.cache)(async () => {
|
|
19
|
+
const e = o ? await Promise.resolve(o()) : {},
|
|
20
|
+
t = new Headers(await (0, _headers.headers)());
|
|
21
|
+
return t.set("x-trpc-source", "rsc"), (0, _defu.default)({
|
|
22
|
+
headers: Object.fromEntries(t)
|
|
23
|
+
}, e);
|
|
24
|
+
}),
|
|
25
|
+
r = (0, _react.cache)(() => (0, _shared.createQueryClient)(a));
|
|
26
|
+
return {
|
|
27
|
+
trpc: (0, _tanstackReactQuery.createTRPCOptionsProxy)({
|
|
28
|
+
router: i,
|
|
29
|
+
queryClient: r,
|
|
30
|
+
ctx: c
|
|
31
|
+
}),
|
|
32
|
+
getQueryClient: r,
|
|
33
|
+
HydrateClient(e) {
|
|
34
|
+
const t = (0, _reactQuery.dehydrate)(r());
|
|
35
|
+
return _react.default.createElement(_reactQuery.HydrationBoundary, {
|
|
36
|
+
state: t
|
|
37
|
+
}, e.children);
|
|
38
|
+
},
|
|
39
|
+
prefetch(e) {
|
|
40
|
+
const t = r();
|
|
41
|
+
e.queryKey[1]?.type === "infinite" ? t.prefetchInfiniteQuery(e) : t.prefetchQuery(e);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MaybePromise } from "@stryke/types";
|
|
2
|
+
import type { QueryClientConfig } from "@tanstack/react-query";
|
|
3
|
+
import type { AnyTRPCRouter, inferRouterContext } from "@trpc/server";
|
|
4
|
+
import type { TRPCQueryOptions } from "@trpc/tanstack-react-query";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import "server-only";
|
|
7
|
+
export declare function createTRPCTanstackQueryServer<TRouter extends AnyTRPCRouter, TContext extends inferRouterContext<TRouter>>(router: TRouter, createContext?: () => MaybePromise<TContext>, config?: Partial<QueryClientConfig>): {
|
|
8
|
+
trpc: import("@trpc/tanstack-react-query").TRPCOptionsProxy<TRouter>;
|
|
9
|
+
getQueryClient: () => import("@tanstack/react-query").QueryClient;
|
|
10
|
+
HydrateClient(props: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}): any;
|
|
13
|
+
prefetch<T extends ReturnType<TRPCQueryOptions<any>>>(queryOptions: T): void;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dehydrate as s,HydrationBoundary as y}from"@tanstack/react-query";import{createTRPCOptionsProxy as p}from"@trpc/tanstack-react-query";import u from"defu";import{headers as m}from"next/headers";import d,{cache as n}from"react";import"server-only";import{createQueryClient as f}from"../shared";export function createTRPCTanstackQueryServer(i,o,a){const c=n(async()=>{const e=o?await Promise.resolve(o()):{},t=new Headers(await m());return t.set("x-trpc-source","rsc"),u({headers:Object.fromEntries(t)},e)}),r=n(()=>f(a));return{trpc:p({router:i,queryClient:r,ctx:c}),getQueryClient:r,HydrateClient(e){const t=s(r());return d.createElement(y,{state:t},e.children)},prefetch(e){const t=r();e.queryKey[1]?.type==="infinite"?t.prefetchInfiniteQuery(e):t.prefetchQuery(e)}}}
|
package/package.json
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stryke/trpc-next",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A package to help in using tRPC in modern NextJs applications.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "github",
|
|
8
|
+
"url": "https://github.com/storm-software/stryke.git",
|
|
9
|
+
"directory": "packages/trpc-next"
|
|
10
|
+
},
|
|
11
|
+
"private": false,
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"react": "^19.0.0",
|
|
14
|
+
"react-dom": "^19.0.0",
|
|
15
|
+
"react-native": "^0.77.0"
|
|
16
|
+
},
|
|
17
|
+
"peerDependenciesMeta": {
|
|
18
|
+
"react": { "optional": false },
|
|
19
|
+
"react-dom": { "optional": true },
|
|
20
|
+
"react-native": { "optional": true }
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@js-temporal/polyfill": "^0.5.0",
|
|
24
|
+
"@tanstack/react-query": "^5.70.0",
|
|
25
|
+
"@tanstack/react-query-devtools": "^5.70.0",
|
|
26
|
+
"@trpc/client": "^11.0.1",
|
|
27
|
+
"@trpc/next": "^11.0.1",
|
|
28
|
+
"@trpc/server": "^11.0.1",
|
|
29
|
+
"@trpc/tanstack-react-query": "^11.0.1",
|
|
30
|
+
"defu": "^6.1.4",
|
|
31
|
+
"server-only": "^0.0.1",
|
|
32
|
+
"superjson": "2.2.2",
|
|
33
|
+
"@stryke/env": ">=0.6.0",
|
|
34
|
+
"@stryke/http": ">=0.6.0",
|
|
35
|
+
"@stryke/path": ">=0.4.7",
|
|
36
|
+
"@stryke/types": ">=0.7.3"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/react": "^19.0.8",
|
|
40
|
+
"@types/react-dom": "^19.0.3",
|
|
41
|
+
"@types/react-native": "0.72.8"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": { "access": "public" },
|
|
44
|
+
"sideEffects": false,
|
|
45
|
+
"files": ["dist/**/*"],
|
|
46
|
+
"homepage": "https://stormsoftware.com",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://stormsoftware.com/support",
|
|
49
|
+
"email": "support@stormsoftware.com"
|
|
50
|
+
},
|
|
51
|
+
"license": "Apache-2.0",
|
|
52
|
+
"keywords": [
|
|
53
|
+
"stryke",
|
|
54
|
+
"typescript",
|
|
55
|
+
"utilities",
|
|
56
|
+
"storm-software",
|
|
57
|
+
"storm",
|
|
58
|
+
"storm-ops",
|
|
59
|
+
"cyclone-ui",
|
|
60
|
+
"sullivanpj",
|
|
61
|
+
"monorepo"
|
|
62
|
+
],
|
|
63
|
+
"funding": {
|
|
64
|
+
"type": "github",
|
|
65
|
+
"url": "https://github.com/sponsors/storm-software"
|
|
66
|
+
},
|
|
67
|
+
"author": {
|
|
68
|
+
"name": "Storm Software",
|
|
69
|
+
"email": "contact@stormsoftware.com",
|
|
70
|
+
"url": "https://stormsoftware.com"
|
|
71
|
+
},
|
|
72
|
+
"maintainers": [
|
|
73
|
+
{
|
|
74
|
+
"name": "Storm Software",
|
|
75
|
+
"email": "contact@stormsoftware.com",
|
|
76
|
+
"url": "https://stormsoftware.com"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"contributors": [
|
|
80
|
+
{
|
|
81
|
+
"name": "Storm Software",
|
|
82
|
+
"email": "contact@stormsoftware.com",
|
|
83
|
+
"url": "https://stormsoftware.com"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"exports": {
|
|
87
|
+
"./shared": {
|
|
88
|
+
"import": {
|
|
89
|
+
"types": "./dist/shared.d.ts",
|
|
90
|
+
"default": "./dist/shared.mjs"
|
|
91
|
+
},
|
|
92
|
+
"require": {
|
|
93
|
+
"types": "./dist/shared.d.ts",
|
|
94
|
+
"default": "./dist/shared.cjs"
|
|
95
|
+
},
|
|
96
|
+
"default": {
|
|
97
|
+
"types": "./dist/shared.d.ts",
|
|
98
|
+
"default": "./dist/shared.mjs"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"./server": {
|
|
102
|
+
"import": {
|
|
103
|
+
"types": "./dist/server.d.ts",
|
|
104
|
+
"default": "./dist/server.mjs"
|
|
105
|
+
},
|
|
106
|
+
"require": {
|
|
107
|
+
"types": "./dist/server.d.ts",
|
|
108
|
+
"default": "./dist/server.cjs"
|
|
109
|
+
},
|
|
110
|
+
"default": {
|
|
111
|
+
"types": "./dist/server.d.ts",
|
|
112
|
+
"default": "./dist/server.mjs"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"./index": {
|
|
116
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
117
|
+
"require": {
|
|
118
|
+
"types": "./dist/index.d.ts",
|
|
119
|
+
"default": "./dist/index.cjs"
|
|
120
|
+
},
|
|
121
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
122
|
+
},
|
|
123
|
+
"./client": {
|
|
124
|
+
"import": {
|
|
125
|
+
"types": "./dist/client.d.ts",
|
|
126
|
+
"default": "./dist/client.mjs"
|
|
127
|
+
},
|
|
128
|
+
"require": {
|
|
129
|
+
"types": "./dist/client.d.ts",
|
|
130
|
+
"default": "./dist/client.cjs"
|
|
131
|
+
},
|
|
132
|
+
"default": {
|
|
133
|
+
"types": "./dist/client.d.ts",
|
|
134
|
+
"default": "./dist/client.mjs"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"./tanstack-query/server": {
|
|
138
|
+
"import": {
|
|
139
|
+
"types": "./dist/tanstack-query/server.d.ts",
|
|
140
|
+
"default": "./dist/tanstack-query/server.mjs"
|
|
141
|
+
},
|
|
142
|
+
"require": {
|
|
143
|
+
"types": "./dist/tanstack-query/server.d.ts",
|
|
144
|
+
"default": "./dist/tanstack-query/server.cjs"
|
|
145
|
+
},
|
|
146
|
+
"default": {
|
|
147
|
+
"types": "./dist/tanstack-query/server.d.ts",
|
|
148
|
+
"default": "./dist/tanstack-query/server.mjs"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"./tanstack-query/client": {
|
|
152
|
+
"import": {
|
|
153
|
+
"types": "./dist/tanstack-query/client.d.ts",
|
|
154
|
+
"default": "./dist/tanstack-query/client.mjs"
|
|
155
|
+
},
|
|
156
|
+
"require": {
|
|
157
|
+
"types": "./dist/tanstack-query/client.d.ts",
|
|
158
|
+
"default": "./dist/tanstack-query/client.cjs"
|
|
159
|
+
},
|
|
160
|
+
"default": {
|
|
161
|
+
"types": "./dist/tanstack-query/client.d.ts",
|
|
162
|
+
"default": "./dist/tanstack-query/client.mjs"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
".": {
|
|
166
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
|
|
167
|
+
"require": {
|
|
168
|
+
"types": "./dist/index.d.ts",
|
|
169
|
+
"default": "./dist/index.cjs"
|
|
170
|
+
},
|
|
171
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
|
|
172
|
+
},
|
|
173
|
+
"./package.json": "./package.json"
|
|
174
|
+
},
|
|
175
|
+
"main": "./dist/index.cjs",
|
|
176
|
+
"module": "./dist/index.mjs",
|
|
177
|
+
"types": "./dist/index.d.ts"
|
|
178
|
+
}
|