@adonisjs/inertia 2.1.0-beta.0 → 2.1.1
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.
|
@@ -355,16 +355,17 @@ var InertiaMiddleware = class {
|
|
|
355
355
|
const { response, request } = ctx;
|
|
356
356
|
ctx.inertia = new Inertia(ctx, this.config, this.vite);
|
|
357
357
|
await next();
|
|
358
|
-
const isInertiaRequest = !!request.header(
|
|
358
|
+
const isInertiaRequest = !!request.header(InertiaHeaders.Inertia);
|
|
359
359
|
if (!isInertiaRequest) return;
|
|
360
|
-
response.header("Vary",
|
|
360
|
+
response.header("Vary", InertiaHeaders.Inertia);
|
|
361
361
|
const method = request.method();
|
|
362
362
|
if (response.getStatus() === 302 && ["PUT", "PATCH", "DELETE"].includes(method)) {
|
|
363
363
|
response.status(303);
|
|
364
364
|
}
|
|
365
365
|
const version = this.config.versionCache.getVersion().toString();
|
|
366
|
-
if (method === "GET" && request.header(
|
|
367
|
-
response.
|
|
366
|
+
if (method === "GET" && request.header(InertiaHeaders.Version, "") !== version) {
|
|
367
|
+
response.removeHeader(InertiaHeaders.Inertia);
|
|
368
|
+
response.header(InertiaHeaders.Location, request.url());
|
|
368
369
|
response.status(409);
|
|
369
370
|
}
|
|
370
371
|
}
|
package/build/index.js
CHANGED
|
@@ -198,7 +198,7 @@ var VersionCache = class {
|
|
|
198
198
|
async #getManifestHash() {
|
|
199
199
|
try {
|
|
200
200
|
const crc32 = await import("crc-32");
|
|
201
|
-
const manifestPath = new URL("public/assets/manifest.json", this.appRoot);
|
|
201
|
+
const manifestPath = new URL("public/assets/.vite/manifest.json", this.appRoot);
|
|
202
202
|
const manifestFile = await readFile(manifestPath, "utf-8");
|
|
203
203
|
this.#cachedVersion = crc32.default.str(manifestFile);
|
|
204
204
|
return this.#cachedVersion;
|
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": "2.1.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.6.0"
|
|
7
7
|
},
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@adonisjs/prettier-config": "^1.4.0",
|
|
45
45
|
"@adonisjs/session": "7.5.0",
|
|
46
46
|
"@adonisjs/tsconfig": "^1.4.0",
|
|
47
|
-
"@adonisjs/vite": "4.0.0
|
|
47
|
+
"@adonisjs/vite": "^4.0.0",
|
|
48
48
|
"@japa/api-client": "^2.0.4",
|
|
49
49
|
"@japa/assert": "3.0.0",
|
|
50
50
|
"@japa/expect-type": "^2.0.2",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@adonisjs/core": "^6.9.1",
|
|
87
87
|
"@adonisjs/session": "^7.4.0",
|
|
88
|
-
"@adonisjs/vite": "4.0.0
|
|
88
|
+
"@adonisjs/vite": "^4.0.0",
|
|
89
89
|
"@japa/api-client": "^2.0.0",
|
|
90
90
|
"edge.js": "^6.0.0"
|
|
91
91
|
},
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"npm": {
|
|
120
120
|
"publish": true,
|
|
121
121
|
"skipChecks": true,
|
|
122
|
-
"tag": "
|
|
122
|
+
"tag": "latest"
|
|
123
123
|
},
|
|
124
124
|
"plugins": {
|
|
125
125
|
"@release-it/conventional-changelog": {
|