@adonisjs/inertia 4.0.0-next.1 → 4.0.0-next.11
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/build/debug-CBMTuPUm.js +3 -0
- package/build/factories/main.js +59 -172
- package/build/headers-DafWEpBh.js +11 -0
- package/build/index.js +5 -24
- package/build/inertia-D5A2KtfR.js +57 -0
- package/build/inertia_manager-Di3J3hSG.js +403 -0
- package/build/providers/inertia_provider.d.ts +2 -2
- package/build/providers/inertia_provider.js +25 -79
- package/build/src/client/helpers.d.ts +27 -0
- package/build/src/client/helpers.js +13 -0
- package/build/src/client/react/context.d.ts +24 -0
- package/build/src/client/react/index.d.ts +3 -0
- package/build/src/client/react/index.js +29 -0
- package/build/src/client/react/link.d.ts +64 -0
- package/build/src/client/react/router.d.ts +33 -0
- package/build/src/client/vite.d.ts +3 -1
- package/build/src/client/vite.js +16 -29
- package/build/src/define_config.d.ts +1 -0
- package/build/src/index_pages.d.ts +27 -0
- package/build/src/inertia.d.ts +15 -7
- package/build/src/inertia_manager.d.ts +1 -0
- package/build/src/inertia_middleware.d.ts +6 -3
- package/build/src/inertia_middleware.js +45 -111
- package/build/src/plugins/edge/plugin.js +49 -81
- package/build/src/plugins/japa/api_client.js +44 -59
- package/build/src/props.d.ts +16 -9
- package/build/src/server_renderer.d.ts +2 -2
- package/build/src/types.d.ts +17 -28
- package/build/src/types.js +1 -0
- package/build/tests/types/react.spec.d.ts +65 -0
- package/package.json +47 -25
- package/build/chunk-4EZ2J6OA.js +0 -7
- package/build/chunk-74S2VAL7.js +0 -761
- package/build/chunk-DISC5OYC.js +0 -46
- package/build/chunk-MLKGABMK.js +0 -9
- package/build/chunk-PDP56GPP.js +0 -75
|
@@ -1,66 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
InertiaHeaders
|
|
3
|
-
} from "../../../chunk-DISC5OYC.js";
|
|
4
|
-
import "../../../chunk-MLKGABMK.js";
|
|
5
|
-
|
|
6
|
-
// src/plugins/japa/api_client.ts
|
|
1
|
+
import { t as InertiaHeaders } from "../../../headers-DafWEpBh.js";
|
|
7
2
|
import { ApiRequest, ApiResponse } from "@japa/api-client";
|
|
8
3
|
function ensureIsInertiaResponse() {
|
|
9
|
-
|
|
10
|
-
throw new Error(
|
|
11
|
-
'Not an Inertia response. Make sure to use "withInertia()" method when making the request'
|
|
12
|
-
);
|
|
13
|
-
}
|
|
4
|
+
if (!this.header("x-inertia")) throw new Error("Not an Inertia response. Make sure to use \"withInertia()\" method when making the request");
|
|
14
5
|
}
|
|
15
6
|
function ensureHasAssert(assertLib) {
|
|
16
|
-
|
|
17
|
-
throw new Error(
|
|
18
|
-
"Response assertions are not available. Make sure to install the @japa/assert plugin"
|
|
19
|
-
);
|
|
20
|
-
}
|
|
7
|
+
if (!assertLib) throw new Error("Response assertions are not available. Make sure to install the @japa/assert plugin");
|
|
21
8
|
}
|
|
22
9
|
function inertiaApiClient(app) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
10
|
+
return async () => {
|
|
11
|
+
const inertiaConfig = app.config.get("inertia");
|
|
12
|
+
ApiRequest.macro("withInertia", function() {
|
|
13
|
+
this.header(InertiaHeaders.Inertia, "true");
|
|
14
|
+
this.header(InertiaHeaders.Version, String(inertiaConfig.assetsVersion ?? "1"));
|
|
15
|
+
return this;
|
|
16
|
+
});
|
|
17
|
+
ApiRequest.macro("withInertiaPartialReload", function(component, data) {
|
|
18
|
+
this.withInertia();
|
|
19
|
+
this.header(InertiaHeaders.PartialComponent, component);
|
|
20
|
+
this.header(InertiaHeaders.PartialOnly, data.join(","));
|
|
21
|
+
return this;
|
|
22
|
+
});
|
|
23
|
+
ApiResponse.getter("inertiaComponent", function() {
|
|
24
|
+
ensureIsInertiaResponse.call(this);
|
|
25
|
+
return this.body().component;
|
|
26
|
+
});
|
|
27
|
+
ApiResponse.getter("inertiaProps", function() {
|
|
28
|
+
ensureIsInertiaResponse.call(this);
|
|
29
|
+
return this.body().props;
|
|
30
|
+
});
|
|
31
|
+
ApiResponse.macro("assertInertiaComponent", function(component) {
|
|
32
|
+
ensureIsInertiaResponse.call(this);
|
|
33
|
+
ensureHasAssert(this.assert);
|
|
34
|
+
this.assert.equal(this.body().component, component);
|
|
35
|
+
return this;
|
|
36
|
+
});
|
|
37
|
+
ApiResponse.macro("assertInertiaProps", function(props) {
|
|
38
|
+
ensureIsInertiaResponse.call(this);
|
|
39
|
+
ensureHasAssert(this.assert);
|
|
40
|
+
this.assert.deepEqual(this.body().props, props);
|
|
41
|
+
return this;
|
|
42
|
+
});
|
|
43
|
+
ApiResponse.macro("assertInertiaPropsContains", function(props) {
|
|
44
|
+
ensureIsInertiaResponse.call(this);
|
|
45
|
+
ensureHasAssert(this.assert);
|
|
46
|
+
this.assert.containSubset(this.body().props, props);
|
|
47
|
+
return this;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
63
50
|
}
|
|
64
|
-
export {
|
|
65
|
-
inertiaApiClient
|
|
66
|
-
};
|
|
51
|
+
export { inertiaApiClient };
|
package/build/src/props.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type AsyncOrSync } from '@
|
|
1
|
+
import { type AsyncOrSync } from '@adonisjs/core/types/common';
|
|
2
2
|
import { type DeferProp, type PageProps, type AlwaysProp, type OptionalProp, type MergeableProp, type ComponentProps, type UnPackedPageProps } from './types.ts';
|
|
3
|
+
import { type ContainerResolver } from '@adonisjs/core/container';
|
|
3
4
|
/**
|
|
4
5
|
* Creates a deferred prop that is never included in standard visits but must be shared with
|
|
5
6
|
* the client during standard visits. Can be explicitly requested and supports merging.
|
|
@@ -138,9 +139,10 @@ export declare function deepMerge<T extends UnPackedPageProps | DeferProp<UnPack
|
|
|
138
139
|
* This function is useful for runtime type checking and conditional prop handling.
|
|
139
140
|
*
|
|
140
141
|
* @param propValue - The object to check for deferred prop characteristics
|
|
142
|
+
* @returns True if the prop value is a deferred prop
|
|
141
143
|
*
|
|
142
144
|
* @example
|
|
143
|
-
* ```
|
|
145
|
+
* ```js
|
|
144
146
|
* const prop = defer(() => ({ data: 'value' }))
|
|
145
147
|
*
|
|
146
148
|
* if (isDeferredProp(prop)) {
|
|
@@ -157,9 +159,10 @@ export declare function isDeferredProp<T extends UnPackedPageProps>(propValue: O
|
|
|
157
159
|
* existing props rather than replaced during updates.
|
|
158
160
|
*
|
|
159
161
|
* @param propValue - The object to check for mergeable prop characteristics
|
|
162
|
+
* @returns True if the prop value is a mergeable prop
|
|
160
163
|
*
|
|
161
164
|
* @example
|
|
162
|
-
* ```
|
|
165
|
+
* ```js
|
|
163
166
|
* const prop = merge({ items: [1, 2, 3] })
|
|
164
167
|
*
|
|
165
168
|
* if (isMergeableProp(prop)) {
|
|
@@ -176,9 +179,10 @@ export declare function isMergeableProp<T extends UnPackedPageProps | DeferProp<
|
|
|
176
179
|
* responses, regardless of cherry-picking or selective prop requests.
|
|
177
180
|
*
|
|
178
181
|
* @param propValue - The object to check for always prop characteristics
|
|
182
|
+
* @returns True if the prop value is an always prop
|
|
179
183
|
*
|
|
180
184
|
* @example
|
|
181
|
-
* ```
|
|
185
|
+
* ```js
|
|
182
186
|
* const prop = always({ userId: 123, permissions: ['read', 'write'] })
|
|
183
187
|
*
|
|
184
188
|
* if (isAlwaysProp(prop)) {
|
|
@@ -195,9 +199,10 @@ export declare function isAlwaysProp<T extends UnPackedPageProps>(propValue: Obj
|
|
|
195
199
|
* when explicitly requested by the client, never in standard visits.
|
|
196
200
|
*
|
|
197
201
|
* @param propValue - The object to check for optional prop characteristics
|
|
202
|
+
* @returns True if the prop value is an optional prop
|
|
198
203
|
*
|
|
199
204
|
* @example
|
|
200
|
-
* ```
|
|
205
|
+
* ```js
|
|
201
206
|
* const prop = optional(() => ({ detailedData: 'expensive computation' }))
|
|
202
207
|
*
|
|
203
208
|
* if (isOptionalProp(prop)) {
|
|
@@ -218,7 +223,8 @@ export declare function isOptionalProp<T extends UnPackedPageProps>(propValue: O
|
|
|
218
223
|
* - Regular props: Included normally
|
|
219
224
|
*
|
|
220
225
|
* @param pageProps - The page props to process
|
|
221
|
-
* @
|
|
226
|
+
* @param containerResolver - Container resolver for dependency injection
|
|
227
|
+
* @returns Promise resolving to object containing processed props, deferred props list, and merge props list
|
|
222
228
|
*
|
|
223
229
|
* @example
|
|
224
230
|
* ```js
|
|
@@ -230,7 +236,7 @@ export declare function isOptionalProp<T extends UnPackedPageProps>(propValue: O
|
|
|
230
236
|
* // Returns: { props: { user: {...} }, deferredProps: { default: ['posts'] }, mergeProps: ['settings'] }
|
|
231
237
|
* ```
|
|
232
238
|
*/
|
|
233
|
-
export declare function buildStandardVisitProps(pageProps: PageProps): Promise<{
|
|
239
|
+
export declare function buildStandardVisitProps(pageProps: PageProps, containerResolver: ContainerResolver<any>): Promise<{
|
|
234
240
|
props: ComponentProps;
|
|
235
241
|
mergeProps: string[];
|
|
236
242
|
deepMergeProps: string[];
|
|
@@ -250,7 +256,8 @@ export declare function buildStandardVisitProps(pageProps: PageProps): Promise<{
|
|
|
250
256
|
*
|
|
251
257
|
* @param pageProps - The page props to process
|
|
252
258
|
* @param cherryPickProps - Array of prop names to include
|
|
253
|
-
* @
|
|
259
|
+
* @param containerResolver - Container resolver for dependency injection
|
|
260
|
+
* @returns Promise resolving to object containing processed props and merge props list
|
|
254
261
|
*
|
|
255
262
|
* @example
|
|
256
263
|
* ```js
|
|
@@ -261,7 +268,7 @@ export declare function buildStandardVisitProps(pageProps: PageProps): Promise<{
|
|
|
261
268
|
* // Returns: { props: { posts: [...], stats: [...] }, mergeProps: [], deferredProps: {} }
|
|
262
269
|
* ```
|
|
263
270
|
*/
|
|
264
|
-
export declare function buildPartialRequestProps(pageProps: PageProps, cherryPickProps: string[]): Promise<{
|
|
271
|
+
export declare function buildPartialRequestProps(pageProps: PageProps, cherryPickProps: string[], containerResolver: ContainerResolver<any>): Promise<{
|
|
265
272
|
props: ComponentProps;
|
|
266
273
|
mergeProps: string[];
|
|
267
274
|
deepMergeProps: string[];
|
|
@@ -36,7 +36,7 @@ export declare class ServerRenderer {
|
|
|
36
36
|
* @returns Promise resolving to an object with rendered head and body HTML
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
|
-
* ```
|
|
39
|
+
* ```js
|
|
40
40
|
* const pageObject = {
|
|
41
41
|
* component: 'Home',
|
|
42
42
|
* props: { user: { name: 'John' } },
|
|
@@ -47,7 +47,7 @@ export declare class ServerRenderer {
|
|
|
47
47
|
* const { head, body } = await renderer.render(pageObject)
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
|
-
render(pageObject: PageObject): Promise<{
|
|
50
|
+
render(pageObject: PageObject<any>): Promise<{
|
|
51
51
|
head: string[];
|
|
52
52
|
body: string;
|
|
53
53
|
}>;
|
package/build/src/types.d.ts
CHANGED
|
@@ -1,37 +1,30 @@
|
|
|
1
1
|
import type { HttpContext } from '@adonisjs/core/http';
|
|
2
2
|
import { type ContainerResolver } from '@adonisjs/core/container';
|
|
3
3
|
import type { JSONDataTypes } from '@adonisjs/core/types/transformers';
|
|
4
|
-
import type { AsyncOrSync, DeepPartial, Prettify } from '@
|
|
4
|
+
import type { AsyncOrSync, DeepPartial, Prettify } from '@adonisjs/core/types/common';
|
|
5
5
|
import { type DEEP_MERGE, type ALWAYS_PROP, type OPTIONAL_PROP, type TO_BE_MERGED, type DEFERRED_PROP } from './symbols.ts';
|
|
6
6
|
/**
|
|
7
|
-
* Representation of a resource item, collection and paginator that can be
|
|
7
|
+
* Representation of a resource item, collection and paginator that can be resolved to
|
|
8
|
+
* get normalized objects
|
|
8
9
|
*
|
|
9
|
-
* @template T - The type that the
|
|
10
|
+
* @template T - The type that the resource resolves to
|
|
10
11
|
*/
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
* Serializes the object using the container resolver
|
|
14
|
-
*
|
|
15
|
-
* @param container - The container resolver instance
|
|
16
|
-
* @param depth - Current serialization depth
|
|
17
|
-
* @param maxDepth - Maximum allowed serialization depth
|
|
18
|
-
* @returns Promise that resolves to the serialized object
|
|
19
|
-
*/
|
|
20
|
-
serialize(container: ContainerResolver<any>, depth: number, maxDepth?: number): Promise<T>;
|
|
12
|
+
export type ResolvableOf<T> = {
|
|
13
|
+
resolve(container: ContainerResolver<any>, depth: number, maxDepth?: number): Promise<T>;
|
|
21
14
|
};
|
|
22
15
|
/**
|
|
23
16
|
* Union type representing unpacked page prop values that can be either JSON data or serializable objects
|
|
24
17
|
*
|
|
25
18
|
* @template T - The JSON data type, defaults to JSONDataTypes
|
|
26
19
|
*/
|
|
27
|
-
export type UnPackedPageProps<T extends JSONDataTypes = JSONDataTypes> = T |
|
|
20
|
+
export type UnPackedPageProps<T extends JSONDataTypes = JSONDataTypes> = T | ResolvableOf<T>;
|
|
28
21
|
/**
|
|
29
22
|
* Utility type that extracts the resolved type from a SerializableOf wrapper
|
|
30
23
|
* If the type is already unwrapped, returns it as-is
|
|
31
24
|
*
|
|
32
25
|
* @template T - The type to unwrap, potentially wrapped in SerializableOf
|
|
33
26
|
*/
|
|
34
|
-
export type UnpackProp<T> = T extends
|
|
27
|
+
export type UnpackProp<T> = T extends ResolvableOf<infer A> ? A : T;
|
|
35
28
|
/**
|
|
36
29
|
* Information extracted from Inertia request headers
|
|
37
30
|
* Contains metadata about the current request type and filtering preferences
|
|
@@ -117,13 +110,13 @@ type PagePropsLazyDataTypes<T extends JSONDataTypes> =
|
|
|
117
110
|
* - Can be explicitly requested for
|
|
118
111
|
* - Can be dropped during cherry-picking
|
|
119
112
|
*/
|
|
120
|
-
DeferProp<T |
|
|
113
|
+
DeferProp<T | ResolvableOf<T>>
|
|
121
114
|
/**
|
|
122
115
|
* - Never included on standard visit
|
|
123
116
|
* - Can be explicitly requested for
|
|
124
117
|
* - Can be dropped during cherry-picking
|
|
125
118
|
*/
|
|
126
|
-
| OptionalProp<T |
|
|
119
|
+
| OptionalProp<T | ResolvableOf<T>>;
|
|
127
120
|
/**
|
|
128
121
|
* Eager props are always included during standard Inertia visits, but
|
|
129
122
|
* can be removed via cherry-picking when only specific props are requested
|
|
@@ -140,17 +133,17 @@ T
|
|
|
140
133
|
* - Always included on standard visit.
|
|
141
134
|
* - Can be dropped during cherry-picking
|
|
142
135
|
*/
|
|
143
|
-
|
|
|
136
|
+
| ResolvableOf<T>
|
|
144
137
|
/**
|
|
145
138
|
* - Always included on standard visit.
|
|
146
139
|
* - Can be dropped during cherry-picking
|
|
147
140
|
*/
|
|
148
|
-
| (() => AsyncOrSync<T |
|
|
141
|
+
| (() => AsyncOrSync<T | ResolvableOf<T>>)
|
|
149
142
|
/**
|
|
150
143
|
* - Always included on standard visit
|
|
151
144
|
* - Cannot be dropped during cherry-picking
|
|
152
145
|
*/
|
|
153
|
-
| AlwaysProp<T |
|
|
146
|
+
| AlwaysProp<T | ResolvableOf<T>>;
|
|
154
147
|
/**
|
|
155
148
|
* Following is the list of acceptable Page props data types
|
|
156
149
|
* Combines both eager and lazy prop data types for comprehensive prop handling
|
|
@@ -175,7 +168,7 @@ export type ComponentProps = Record<string, JSONDataTypes>;
|
|
|
175
168
|
* @template Props - The page props object type to analyze
|
|
176
169
|
*/
|
|
177
170
|
export type GetOptionalProps<Props> = {
|
|
178
|
-
[K in keyof Props]: Props[K] extends OptionalProp<any> ? K : Props[K] extends DeferProp<any> ? K : [undefined] extends Props[K] ? K : Props[K] extends MergeableProp<infer A> ? A extends DeferProp<any> ? K : never : never;
|
|
171
|
+
[K in keyof Props]: Props[K] extends OptionalProp<any> ? K : Props[K] extends DeferProp<any> ? K : [undefined] extends [Props[K]] ? K : Props[K] extends MergeableProp<infer A> ? A extends DeferProp<any> ? K : never : never;
|
|
179
172
|
}[keyof Props];
|
|
180
173
|
/**
|
|
181
174
|
* Utility type to extract required prop keys from a props object
|
|
@@ -184,7 +177,7 @@ export type GetOptionalProps<Props> = {
|
|
|
184
177
|
* @template Props - The page props object type to analyze
|
|
185
178
|
*/
|
|
186
179
|
export type GetRequiredProps<Props> = {
|
|
187
|
-
[K in keyof Props]: Props[K] extends OptionalProp<any> ? never : Props[K] extends DeferProp<any> ? never : [undefined] extends Props[K] ? never : Props[K] extends MergeableProp<infer A> ? A extends DeferProp<any> ? never : K : K;
|
|
180
|
+
[K in keyof Props]: Props[K] extends OptionalProp<any> ? never : Props[K] extends DeferProp<any> ? never : [undefined] extends [Props[K]] ? never : Props[K] extends MergeableProp<infer A> ? A extends DeferProp<any> ? never : K : K;
|
|
188
181
|
}[keyof Props];
|
|
189
182
|
/**
|
|
190
183
|
* Utility type to simplify value of a required prop by unwrapping branded types
|
|
@@ -242,10 +235,6 @@ export type InertiaConfig = {
|
|
|
242
235
|
* application
|
|
243
236
|
*/
|
|
244
237
|
rootView: string | ((ctx: HttpContext) => string);
|
|
245
|
-
/**
|
|
246
|
-
* The entrypoint file to load in order to boot the frontend application.
|
|
247
|
-
*/
|
|
248
|
-
entrypoint: string;
|
|
249
238
|
/**
|
|
250
239
|
* A fixed asset version value to use. Otherwise, it will be read from the
|
|
251
240
|
* Vite manifest file.
|
|
@@ -290,7 +279,7 @@ export type InertiaConfigInput = DeepPartial<InertiaConfig>;
|
|
|
290
279
|
*
|
|
291
280
|
* @template Props - The props type for the page component
|
|
292
281
|
*/
|
|
293
|
-
export type PageObject<Props
|
|
282
|
+
export type PageObject<Props> = {
|
|
294
283
|
/**
|
|
295
284
|
* The name/path of the component to render
|
|
296
285
|
*/
|
|
@@ -373,7 +362,7 @@ export interface InertiaPages {
|
|
|
373
362
|
* @param page - The page object containing component and props data
|
|
374
363
|
* @returns Promise resolving to an object with head tags and body HTML
|
|
375
364
|
*/
|
|
376
|
-
export type RenderInertiaSsrApp = (page: PageObject) => Promise<{
|
|
365
|
+
export type RenderInertiaSsrApp = (page: PageObject<any>) => Promise<{
|
|
377
366
|
head: string[];
|
|
378
367
|
body: string;
|
|
379
368
|
}>;
|
package/build/src/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
declare const routes: {
|
|
2
|
+
readonly 'users.index': {
|
|
3
|
+
readonly methods: ["GET", "HEAD"];
|
|
4
|
+
readonly pattern: "/";
|
|
5
|
+
readonly tokens: [{
|
|
6
|
+
readonly old: "/";
|
|
7
|
+
readonly type: 0;
|
|
8
|
+
readonly val: "/";
|
|
9
|
+
readonly end: "";
|
|
10
|
+
}];
|
|
11
|
+
readonly types: {
|
|
12
|
+
body: {};
|
|
13
|
+
paramsTuple: [];
|
|
14
|
+
params: {};
|
|
15
|
+
query: {};
|
|
16
|
+
response: unknown;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly 'users.comments.edit': {
|
|
20
|
+
readonly methods: ["GET", "HEAD"];
|
|
21
|
+
readonly pattern: "/users/:id/comments/:comment_id/edit";
|
|
22
|
+
readonly tokens: [{
|
|
23
|
+
readonly old: "/users";
|
|
24
|
+
readonly type: 0;
|
|
25
|
+
readonly val: "users";
|
|
26
|
+
readonly end: "/";
|
|
27
|
+
}, {
|
|
28
|
+
readonly old: ":id";
|
|
29
|
+
readonly type: 1;
|
|
30
|
+
readonly val: "id";
|
|
31
|
+
readonly end: "/";
|
|
32
|
+
}, {
|
|
33
|
+
readonly old: "/comments";
|
|
34
|
+
readonly type: 0;
|
|
35
|
+
readonly val: "comments";
|
|
36
|
+
readonly end: "/";
|
|
37
|
+
}, {
|
|
38
|
+
readonly old: ":comment_id";
|
|
39
|
+
readonly type: 1;
|
|
40
|
+
readonly val: "comment_id";
|
|
41
|
+
readonly end: "/edit";
|
|
42
|
+
}, {
|
|
43
|
+
readonly old: "/edit";
|
|
44
|
+
readonly type: 0;
|
|
45
|
+
readonly val: "edit";
|
|
46
|
+
readonly end: "";
|
|
47
|
+
}];
|
|
48
|
+
readonly types: {
|
|
49
|
+
body: {};
|
|
50
|
+
paramsTuple: [string, string];
|
|
51
|
+
params: {
|
|
52
|
+
id: string;
|
|
53
|
+
comment_id: string;
|
|
54
|
+
};
|
|
55
|
+
query: {};
|
|
56
|
+
response: unknown;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
declare module '@tuyau/core/types' {
|
|
61
|
+
type Registry = typeof routes;
|
|
62
|
+
interface UserRegistry extends Registry {
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/inertia",
|
|
3
3
|
"description": "Official Inertia.js adapter for AdonisJS",
|
|
4
|
-
"version": "4.0.0-next.
|
|
4
|
+
"version": "4.0.0-next.11",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
7
7
|
},
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
"./plugins/edge": "./build/src/plugins/edge/plugin.js",
|
|
19
19
|
"./plugins/api_client": "./build/src/plugins/japa/api_client.js",
|
|
20
20
|
"./vite": "./build/src/client/vite.js",
|
|
21
|
+
"./helpers": "./build/src/client/helpers.js",
|
|
22
|
+
"./react": "./build/src/client/react/index.js",
|
|
21
23
|
"./factories": "./build/factories/main.js"
|
|
22
24
|
},
|
|
23
25
|
"scripts": {
|
|
@@ -25,7 +27,7 @@
|
|
|
25
27
|
"test": "c8 npm run quick:test",
|
|
26
28
|
"typecheck": "tsc --noEmit",
|
|
27
29
|
"clean": "del-cli build",
|
|
28
|
-
"compile": "
|
|
30
|
+
"compile": "tsdown && tsc --emitDeclarationOnly --declaration",
|
|
29
31
|
"copy:templates": "copyfiles --up 1 \"stubs/**/*.stub\" build",
|
|
30
32
|
"prebuild": "npm run lint && npm run clean",
|
|
31
33
|
"build": "npm run compile",
|
|
@@ -41,13 +43,14 @@
|
|
|
41
43
|
"docs": "typedoc"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"@adonisjs/assembler": "^8.0.0-next.
|
|
45
|
-
"@adonisjs/core": "^7.0.0-next.
|
|
46
|
-
"@adonisjs/eslint-config": "^3.0.0-next.
|
|
46
|
+
"@adonisjs/assembler": "^8.0.0-next.14",
|
|
47
|
+
"@adonisjs/core": "^7.0.0-next.10",
|
|
48
|
+
"@adonisjs/eslint-config": "^3.0.0-next.4",
|
|
47
49
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
48
50
|
"@adonisjs/session": "^8.0.0-next.0",
|
|
49
|
-
"@adonisjs/tsconfig": "^2.0.0-next.
|
|
50
|
-
"@adonisjs/vite": "^5.0
|
|
51
|
+
"@adonisjs/tsconfig": "^2.0.0-next.3",
|
|
52
|
+
"@adonisjs/vite": "^5.1.0-next.0",
|
|
53
|
+
"@inertiajs/react": "^2.2.19",
|
|
51
54
|
"@japa/api-client": "^3.1.0",
|
|
52
55
|
"@japa/assert": "4.1.1",
|
|
53
56
|
"@japa/expect-type": "^2.0.3",
|
|
@@ -56,22 +59,25 @@
|
|
|
56
59
|
"@japa/runner": "4.4.0",
|
|
57
60
|
"@japa/snapshot": "^2.0.9",
|
|
58
61
|
"@poppinss/ts-exec": "^1.4.1",
|
|
59
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
60
|
-
"@
|
|
62
|
+
"@release-it/conventional-changelog": "^10.0.2",
|
|
63
|
+
"@tuyau/core": "^1.0.0-beta.1",
|
|
64
|
+
"@types/node": "^24.10.1",
|
|
65
|
+
"@types/react": "^19.2.7",
|
|
61
66
|
"@types/supertest": "^6.0.3",
|
|
62
67
|
"c8": "^10.1.3",
|
|
63
68
|
"copyfiles": "^2.4.1",
|
|
64
|
-
"cross-env": "^10.
|
|
65
|
-
"del-cli": "^
|
|
69
|
+
"cross-env": "^10.1.0",
|
|
70
|
+
"del-cli": "^7.0.0",
|
|
66
71
|
"edge.js": "^6.3.0",
|
|
67
|
-
"eslint": "^9.
|
|
72
|
+
"eslint": "^9.39.1",
|
|
68
73
|
"get-port": "^7.1.0",
|
|
69
|
-
"prettier": "^3.
|
|
70
|
-
"
|
|
74
|
+
"prettier": "^3.7.3",
|
|
75
|
+
"react": "^19.2.0",
|
|
76
|
+
"release-it": "^19.0.6",
|
|
71
77
|
"supertest": "^7.1.4",
|
|
72
|
-
"
|
|
73
|
-
"typescript": "~5.9.
|
|
74
|
-
"vite": "^7.
|
|
78
|
+
"tsdown": "^0.17.0-beta.4",
|
|
79
|
+
"typescript": "~5.9.3",
|
|
80
|
+
"vite": "^7.2.6"
|
|
75
81
|
},
|
|
76
82
|
"dependencies": {
|
|
77
83
|
"@poppinss/utils": "^7.0.0-next.3",
|
|
@@ -79,13 +85,16 @@
|
|
|
79
85
|
"html-entities": "^2.6.0"
|
|
80
86
|
},
|
|
81
87
|
"peerDependencies": {
|
|
82
|
-
"@adonisjs/assembler": "^8.0.0-next.
|
|
83
|
-
"@adonisjs/core": "^7.0.0-next.
|
|
88
|
+
"@adonisjs/assembler": "^8.0.0-next.14",
|
|
89
|
+
"@adonisjs/core": "^7.0.0-next.10",
|
|
84
90
|
"@adonisjs/session": "^8.0.0-next.0",
|
|
85
|
-
"@adonisjs/vite": "^5.0
|
|
91
|
+
"@adonisjs/vite": "^5.1.0-next.0",
|
|
92
|
+
"@inertiajs/react": "^2.2.15",
|
|
86
93
|
"@japa/api-client": "^3.1.0",
|
|
87
94
|
"@japa/plugin-adonisjs": "^5.0.0-next.0",
|
|
88
|
-
"
|
|
95
|
+
"@tuyau/core": "^1.0.0-beta.1",
|
|
96
|
+
"edge.js": "^6.0.0",
|
|
97
|
+
"react": "^19.2.0"
|
|
89
98
|
},
|
|
90
99
|
"peerDependenciesMeta": {
|
|
91
100
|
"@adonisjs/assembler": {
|
|
@@ -96,6 +105,15 @@
|
|
|
96
105
|
},
|
|
97
106
|
"@japa/plugin-adonisjs": {
|
|
98
107
|
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"react": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"@tuyau/core": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"@inertiajs/react": {
|
|
116
|
+
"optional": true
|
|
99
117
|
}
|
|
100
118
|
},
|
|
101
119
|
"keywords": [
|
|
@@ -132,8 +150,7 @@
|
|
|
132
150
|
},
|
|
133
151
|
"npm": {
|
|
134
152
|
"publish": true,
|
|
135
|
-
"skipChecks": true
|
|
136
|
-
"tag": "latest"
|
|
153
|
+
"skipChecks": true
|
|
137
154
|
},
|
|
138
155
|
"plugins": {
|
|
139
156
|
"@release-it/conventional-changelog": {
|
|
@@ -143,21 +160,26 @@
|
|
|
143
160
|
}
|
|
144
161
|
}
|
|
145
162
|
},
|
|
146
|
-
"
|
|
163
|
+
"tsdown": {
|
|
147
164
|
"entry": [
|
|
148
165
|
"./index.ts",
|
|
149
166
|
"./src/types.ts",
|
|
150
167
|
"./src/client/vite.ts",
|
|
168
|
+
"./src/client/helpers.ts",
|
|
151
169
|
"./factories/main.ts",
|
|
152
170
|
"./src/inertia_middleware.ts",
|
|
153
171
|
"./providers/inertia_provider.ts",
|
|
154
172
|
"./src/plugins/edge/plugin.ts",
|
|
155
|
-
"./src/plugins/japa/api_client.ts"
|
|
173
|
+
"./src/plugins/japa/api_client.ts",
|
|
174
|
+
"./src/client/react/index.tsx"
|
|
156
175
|
],
|
|
157
176
|
"outDir": "./build",
|
|
158
177
|
"clean": true,
|
|
159
178
|
"format": "esm",
|
|
179
|
+
"minify": "dce-only",
|
|
180
|
+
"fixedExtension": false,
|
|
160
181
|
"dts": false,
|
|
182
|
+
"treeshake": false,
|
|
161
183
|
"sourcemaps": false,
|
|
162
184
|
"target": "esnext"
|
|
163
185
|
},
|