@adonisjs/inertia 3.0.0 → 3.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/build/{chunk-5NMMBA7E.js → chunk-W7TVEB4V.js} +3 -0
- package/build/config.stub +2 -2
- package/build/providers/inertia_provider.js +1 -1
- package/build/react/root.edge.stub +1 -0
- package/build/solid/root.edge.stub +1 -0
- package/build/src/inertia_middleware.js +1 -1
- package/build/src/plugins/japa/api_client.js +10 -2
- package/build/svelte/root.edge.stub +1 -0
- package/build/vue/root.edge.stub +1 -0
- package/package.json +26 -27
|
@@ -364,6 +364,9 @@ var InertiaMiddleware = class {
|
|
|
364
364
|
*/
|
|
365
365
|
#resolveValidationErrors(ctx) {
|
|
366
366
|
const { session, request } = ctx;
|
|
367
|
+
if (!session) {
|
|
368
|
+
return {};
|
|
369
|
+
}
|
|
367
370
|
if (!session.flashMessages.has("errorsBag.E_VALIDATION_ERROR")) {
|
|
368
371
|
return session.flashMessages.get("errorsBag");
|
|
369
372
|
}
|
package/build/config.stub
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
exports({ to: app.configPath('inertia.ts') })
|
|
3
3
|
}}}
|
|
4
4
|
import { defineConfig } from '@adonisjs/inertia'
|
|
5
|
-
import type { InferSharedProps
|
|
5
|
+
import type { InferSharedProps } from '@adonisjs/inertia/types'
|
|
6
6
|
|
|
7
7
|
const inertiaConfig = defineConfig({
|
|
8
8
|
/**
|
|
@@ -29,5 +29,5 @@ const inertiaConfig = defineConfig({
|
|
|
29
29
|
export default inertiaConfig
|
|
30
30
|
|
|
31
31
|
declare module '@adonisjs/inertia/types' {
|
|
32
|
-
export interface SharedProps extends InferSharedProps<typeof inertiaConfig
|
|
32
|
+
export interface SharedProps extends InferSharedProps<typeof inertiaConfig> {}
|
|
33
33
|
}
|
|
@@ -48,7 +48,11 @@ function inertiaApiClient(app) {
|
|
|
48
48
|
ApiResponse.macro(
|
|
49
49
|
"assertInertiaProps",
|
|
50
50
|
function(props) {
|
|
51
|
-
this.
|
|
51
|
+
if (!this.assert) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
"Response assertions are not available. Make sure to install the @japa/assert plugin"
|
|
54
|
+
);
|
|
55
|
+
}
|
|
52
56
|
ensureIsInertiaResponse.call(this);
|
|
53
57
|
this.assert.deepEqual(this.body().props, props);
|
|
54
58
|
return this;
|
|
@@ -57,7 +61,11 @@ function inertiaApiClient(app) {
|
|
|
57
61
|
ApiResponse.macro(
|
|
58
62
|
"assertInertiaPropsContains",
|
|
59
63
|
function(props) {
|
|
60
|
-
this.
|
|
64
|
+
if (!this.assert) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
"Response assertions are not available. Make sure to install the @japa/assert plugin"
|
|
67
|
+
);
|
|
68
|
+
}
|
|
61
69
|
ensureIsInertiaResponse.call(this);
|
|
62
70
|
this.assert.containsSubset(this.body().props, props);
|
|
63
71
|
return this;
|
package/build/vue/root.edge.stub
CHANGED
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": "3.
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.6.0"
|
|
7
7
|
},
|
|
@@ -39,53 +39,53 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@adonisjs/assembler": "^7.8.2",
|
|
42
|
-
"@adonisjs/core": "6.
|
|
42
|
+
"@adonisjs/core": "6.17.1",
|
|
43
43
|
"@adonisjs/eslint-config": "^2.0.0-beta.7",
|
|
44
44
|
"@adonisjs/prettier-config": "^1.4.0",
|
|
45
|
-
"@adonisjs/session": "7.5.
|
|
45
|
+
"@adonisjs/session": "^7.5.1",
|
|
46
46
|
"@adonisjs/tsconfig": "^1.4.0",
|
|
47
47
|
"@adonisjs/vite": "^4.0.0",
|
|
48
|
-
"@japa/api-client": "^
|
|
49
|
-
"@japa/assert": "
|
|
50
|
-
"@japa/expect-type": "^2.0.
|
|
51
|
-
"@japa/file-system": "^2.3.
|
|
52
|
-
"@japa/plugin-adonisjs": "^
|
|
53
|
-
"@japa/runner": "
|
|
54
|
-
"@japa/snapshot": "^2.0.
|
|
55
|
-
"@release-it/conventional-changelog": "^
|
|
56
|
-
"@swc/core": "
|
|
57
|
-
"@types/node": "^22.
|
|
58
|
-
"@types/qs": "^6.9.
|
|
48
|
+
"@japa/api-client": "^3.0.3",
|
|
49
|
+
"@japa/assert": "4.0.1",
|
|
50
|
+
"@japa/expect-type": "^2.0.3",
|
|
51
|
+
"@japa/file-system": "^2.3.2",
|
|
52
|
+
"@japa/plugin-adonisjs": "^4.0.0",
|
|
53
|
+
"@japa/runner": "4.2.0",
|
|
54
|
+
"@japa/snapshot": "^2.0.8",
|
|
55
|
+
"@release-it/conventional-changelog": "^10.0.0",
|
|
56
|
+
"@swc/core": "1.10.7",
|
|
57
|
+
"@types/node": "^22.12.0",
|
|
58
|
+
"@types/qs": "^6.9.18",
|
|
59
59
|
"@types/supertest": "^6.0.2",
|
|
60
60
|
"@vavite/multibuild": "^5.1.0",
|
|
61
61
|
"c8": "^10.1.3",
|
|
62
62
|
"copyfiles": "^2.4.1",
|
|
63
63
|
"del-cli": "^6.0.0",
|
|
64
|
-
"edge-parser": "^9.0.
|
|
65
|
-
"edge.js": "^6.2.
|
|
66
|
-
"eslint": "^9.
|
|
64
|
+
"edge-parser": "^9.0.4",
|
|
65
|
+
"edge.js": "^6.2.1",
|
|
66
|
+
"eslint": "^9.19.0",
|
|
67
67
|
"get-port": "^7.1.0",
|
|
68
68
|
"prettier": "^3.4.2",
|
|
69
|
-
"release-it": "^
|
|
69
|
+
"release-it": "^18.1.2",
|
|
70
70
|
"supertest": "^7.0.0",
|
|
71
|
-
"ts-node-maintained": "^10.9.
|
|
72
|
-
"tsup": "^8.3.
|
|
73
|
-
"typescript": "~5.7.
|
|
74
|
-
"vite": "^6.0.
|
|
71
|
+
"ts-node-maintained": "^10.9.5",
|
|
72
|
+
"tsup": "^8.3.6",
|
|
73
|
+
"typescript": "~5.7.3",
|
|
74
|
+
"vite": "^6.0.11"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@poppinss/utils": "^6.9.2",
|
|
78
78
|
"@tuyau/utils": "^0.0.6",
|
|
79
|
-
"edge-error": "^4.0.
|
|
79
|
+
"edge-error": "^4.0.2",
|
|
80
80
|
"html-entities": "^2.5.2",
|
|
81
81
|
"locate-path": "^7.2.0",
|
|
82
|
-
"qs": "^6.
|
|
82
|
+
"qs": "^6.14.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@adonisjs/core": "^6.9.1",
|
|
86
86
|
"@adonisjs/session": "^7.4.0",
|
|
87
87
|
"@adonisjs/vite": "^4.0.0",
|
|
88
|
-
"@japa/api-client": "^2.0.0",
|
|
88
|
+
"@japa/api-client": "^2.0.0 || ^3.0.0",
|
|
89
89
|
"edge.js": "^6.0.0"
|
|
90
90
|
},
|
|
91
91
|
"peerDependenciesMeta": {
|
|
@@ -154,6 +154,5 @@
|
|
|
154
154
|
"format": "esm",
|
|
155
155
|
"dts": true,
|
|
156
156
|
"target": "esnext"
|
|
157
|
-
}
|
|
158
|
-
"packageManager": "pnpm@9.15.2+sha512.93e57b0126f0df74ce6bff29680394c0ba54ec47246b9cf321f0121d8d9bb03f750a705f24edc3c1180853afd7c2c3b94196d0a3d53d3e069d9e2793ef11f321"
|
|
157
|
+
}
|
|
159
158
|
}
|