@adonisjs/inertia 1.0.0-3 → 1.0.0-4

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.
@@ -67,6 +67,7 @@ var Inertia = class {
67
67
  if (!isInertiaRequest) {
68
68
  return this.ctx.view.render(this.config.rootView, { ...viewProps, page: pageObject });
69
69
  }
70
+ this.ctx.response.header("x-inertia", "true");
70
71
  return pageObject;
71
72
  }
72
73
  /**
@@ -105,7 +106,6 @@ var InertiaMiddleware = class {
105
106
  if (!isInertiaRequest)
106
107
  return;
107
108
  response.header("Vary", "Accept");
108
- response.header("X-Inertia", "true");
109
109
  const method = request.method();
110
110
  if (response.getStatus() === 302 && ["PUT", "PATCH", "DELETE"].includes(method)) {
111
111
  response.status(303);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InertiaMiddleware
3
- } from "../chunk-GDULL3NT.js";
3
+ } from "../chunk-PZZVHQTV.js";
4
4
 
5
5
  // providers/inertia_provider.ts
6
6
  import { configProvider } from "@adonisjs/core";
@@ -15,7 +15,7 @@ var InertiaProvider = class {
15
15
  async registerEdgePlugin() {
16
16
  try {
17
17
  const edgeExports = await import("edge.js");
18
- const { edgePluginInertia } = await import("../plugin-QOPSYJCV.js");
18
+ const { edgePluginInertia } = await import("../src/plugins/edge/plugin.js");
19
19
  edgeExports.default.use(edgePluginInertia());
20
20
  } catch {
21
21
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InertiaMiddleware
3
- } from "../chunk-GDULL3NT.js";
3
+ } from "../chunk-PZZVHQTV.js";
4
4
  export {
5
5
  InertiaMiddleware as default
6
6
  };
@@ -0,0 +1,8 @@
1
+ import { PluginFn } from 'edge.js/types';
2
+
3
+ /**
4
+ * Register the Inertia tags and globals within Edge
5
+ */
6
+ declare const edgePluginInertia: () => PluginFn<undefined>;
7
+
8
+ export { edgePluginInertia };
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": "1.0.0-3",
4
+ "version": "1.0.0-4",
5
5
  "engines": {
6
6
  "node": ">=18.16.0"
7
7
  },
@@ -16,7 +16,7 @@
16
16
  "./services/main": "./build/services/inertia.js",
17
17
  "./inertia_middleware": "./build/src/inertia_middleware.js",
18
18
  "./inertia_provider": "./build/providers/inertia_provider.js",
19
- "./plugins/edge": "./build/src/plugins/edge.js",
19
+ "./plugins/edge": "./build/src/plugins/edge/plugin.js",
20
20
  "./plugins/api_client": "./build/src/plugins/api_client.js"
21
21
  },
22
22
  "scripts": {
@@ -126,7 +126,7 @@
126
126
  "./services/inertia.ts",
127
127
  "./src/inertia_middleware.ts",
128
128
  "./providers/inertia_provider.ts",
129
- "./src/plugins/edge.ts",
129
+ "./src/plugins/edge/plugin.ts",
130
130
  "./src/plugins/api_client.ts"
131
131
  ],
132
132
  "outDir": "./build",