@adonisjs/inertia 1.2.0 → 1.2.2

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.
@@ -1,10 +1,11 @@
1
1
  // src/server_renderer.ts
2
2
  import { pathToFileURL } from "node:url";
3
- var ServerRenderer = class {
3
+ var ServerRenderer = class _ServerRenderer {
4
4
  constructor(config, vite) {
5
5
  this.config = config;
6
6
  this.vite = vite;
7
7
  }
8
+ static runtime;
8
9
  /**
9
10
  * Render the page on the server
10
11
  *
@@ -15,8 +16,8 @@ var ServerRenderer = class {
15
16
  let render;
16
17
  const devServer = this.vite?.getDevServer();
17
18
  if (devServer) {
18
- const runtime = await this.vite.createRuntime();
19
- render = await runtime.executeEntrypoint(this.config.ssr.entrypoint);
19
+ _ServerRenderer.runtime ??= await this.vite.createRuntime();
20
+ render = await _ServerRenderer.runtime.executeEntrypoint(this.config.ssr.entrypoint);
20
21
  } else {
21
22
  render = await import(pathToFileURL(this.config.ssr.bundle).href);
22
23
  }
package/build/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import Configure from '@adonisjs/core/commands/configure';
2
2
  import { ConfigProvider } from '@adonisjs/core/types';
3
- import { S as SharedData, I as InertiaConfig, R as ResolvedConfig } from './types-fb05P61I.js';
3
+ import { S as SharedData, I as InertiaConfig, R as ResolvedConfig } from './types-YRkkep62.js';
4
4
  import '@adonisjs/core/http';
5
5
  import '@tuyau/utils/types';
6
6
  import '@adonisjs/vite';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InertiaMiddleware
3
- } from "../chunk-TSAZ2E7H.js";
3
+ } from "../chunk-G6UKVO4B.js";
4
4
 
5
5
  // providers/inertia_provider.ts
6
6
  import { configProvider } from "@adonisjs/core";
@@ -30,7 +30,7 @@ export default function Home() {
30
30
  <div className="relative opacity-80">
31
31
  <svg fill="none" viewBox="0 0 240 105">
32
32
  <path fill="#F9F9F8" d="M0 4a4 4 0 0 1 4-4h232a4 4 0 0 1 4 4v101H0V4Z" />
33
- <g fill="#000" fill-rule="evenodd" clipPath="url(#a)" clipRule="evenodd">
33
+ <g fill="#000" fillRule="evenodd" clipPath="url(#a)" clipRule="evenodd">
34
34
  <path d="M24 11.444c0 4.391 1.053 5.445 5.444 5.445s5.445-1.054 5.445-5.445c0-4.39-1.054-5.444-5.445-5.444C25.054 6 24 7.053 24 11.444Zm2.195 1.131 1.708-3.88c.288-.655.843-1.01 1.541-1.01.699 0 1.253.355 1.542 1.01l1.707 3.88c.078.189.144.433.144.644 0 .964-.676 1.64-1.64 1.64-.33 0-.59-.083-.854-.168-.271-.087-.545-.175-.899-.175-.35 0-.63.089-.906.176-.267.085-.53.168-.846.168-.964 0-1.64-.677-1.64-1.641 0-.211.066-.455.143-.644Zm3.25-3.204-1.686 3.814c.499-.233 1.075-.344 1.685-.344.588 0 1.187.111 1.664.344l-1.664-3.814Zm26.473-.678c-.378 0-.65.268-.65.64 0 .374.272.641.65.641s.651-.267.651-.64-.273-.64-.65-.64Zm-11.907 5.502c-1.009 0-1.738-.745-1.738-1.91 0-1.187.73-1.933 1.737-1.933.468 0 .814.158 1.019.468V8.86h1.05v5.25h-1.05v-.372c-.2.304-.546.456-1.019.456Zm-.667-1.91c0-.652.352-1.077.887-1.077.54 0 .887.42.887 1.071 0 .64-.346 1.056-.887 1.056-.535 0-.887-.415-.887-1.05Zm4.384-.011c0-.646.351-1.06.877-1.06.53 0 .882.414.882 1.06 0 .646-.352 1.06-.883 1.06-.525 0-.876-.414-.876-1.06Zm11.571.835c0 .194-.147.31-.52.31-.42 0-.682-.221-.682-.489h-1.05c.026.725.714 1.265 1.711 1.265.946 0 1.55-.42 1.55-1.165 0-.557-.358-.945-1.066-1.087l-.762-.152c-.23-.047-.367-.163-.367-.315 0-.226.23-.347.525-.347.42 0 .583.195.583.426h.997c-.026-.683-.562-1.203-1.56-1.203-.929 0-1.559.468-1.559 1.176 0 .64.415.93 1.035 1.06l.756.164c.247.052.41.157.41.357Zm-2.85 1.002h-1.05v-3.675h1.05v3.675Zm-4.264-3.675v.384c.268-.31.625-.468 1.066-.468.824 0 1.36.536 1.36 1.365v2.394h-1.05v-2.173c0-.446-.252-.714-.688-.714-.436 0-.688.268-.688.714v2.173h-1.05v-3.675h1.05Zm-3.58-.084c-1.119 0-1.948.809-1.948 1.922s.83 1.921 1.948 1.921c1.123 0 1.953-.808 1.953-1.921s-.83-1.922-1.953-1.922Zm-8.758.856c-.535 0-.887.425-.887 1.076 0 .636.352 1.05.887 1.05.54 0 .887-.414.887-1.055 0-.65-.346-1.07-.887-1.07Zm-1.958 1.076c0 1.166.73 1.911 1.732 1.911.478 0 .82-.152 1.024-.456v.372h1.05v-3.675h-1.05v.384c-.21-.31-.556-.468-1.024-.468-1.003 0-1.732.746-1.732 1.932Z" />
35
35
  </g>
36
36
  <rect width="8" height="3" x="162" y="9.944" fill="#DAD9D6" rx="1" />
@@ -77,7 +77,7 @@ export default function Home() {
77
77
  </svg>
78
78
  </div>
79
79
 
80
- <div className="mt-1.5 space-y-1">
80
+ <div className="space-y-1">
81
81
  <h2 className="text-lg font-semibold">
82
82
  <a href="https://docs.adonisjs.com" target="_blank">
83
83
  <span>Documentation</span>
@@ -186,9 +186,9 @@ export default function Home() {
186
186
  <g
187
187
  fill="none"
188
188
  stroke="currentColor"
189
- stroke-linecap="round"
190
- stroke-linejoin="round"
191
- stroke-width="2"
189
+ strokeLinecap="round"
190
+ strokeLinejoin="round"
191
+ strokeWidth="2"
192
192
  >
193
193
  <path d="M4 6a8 3 0 1 0 16 0A8 3 0 1 0 4 6" />
194
194
  <path d="M4 6v6a8 3 0 0 0 16 0V6" />
@@ -339,7 +339,7 @@ export default function Home() {
339
339
  </div>
340
340
  </div>
341
341
 
342
- <div className="text-sm text-center [&>code]:font-medium [&>code]:text-[#a599ff] bg-sand-12 text-sand-1 relative py-2">
342
+ <div className="text-sm text-center [&>code]:font-medium [&>code]:text-[#a599ff] bg-sand-12 text-sand-1 fixed bottom-0 left-0 right-0 py-2">
343
343
  Route for this page is registered in <code>start/routes.ts</code> file, rendering{' '}
344
344
  <code>inertia/pages/home.tsx</code> template
345
345
  </div>
@@ -90,7 +90,7 @@ export default function Home() {
90
90
  </svg>
91
91
  </div>
92
92
 
93
- <div class="mt-1.5 space-y-1">
93
+ <div class="space-y-1">
94
94
  <h2 class="text-lg font-semibold">
95
95
  <a href="https://docs.adonisjs.com" target="_blank">
96
96
  <span>Documentation</span>
@@ -348,7 +348,7 @@ export default function Home() {
348
348
  </div>
349
349
  </div>
350
350
 
351
- <div class="text-sm text-center [&>code]:font-medium [&>code]:text-[#a599ff] bg-sand-12 text-sand-1 relative py-2">
351
+ <div class="text-sm text-center [&>code]:font-medium [&>code]:text-[#a599ff] bg-sand-12 text-sand-1 fixed bottom-0 left-0 right-0 py-2">
352
352
  Route for this page is registered in <code>start/routes.ts</code> file, rendering{' '}
353
353
  <code>inertia/pages/home.tsx</code> template
354
354
  </div>
@@ -1,7 +1,7 @@
1
1
  import { Vite } from '@adonisjs/vite';
2
2
  import { HttpContext } from '@adonisjs/core/http';
3
3
  import { NextFn } from '@adonisjs/core/types/http';
4
- import { a as Inertia, R as ResolvedConfig } from '../types-fb05P61I.js';
4
+ import { a as Inertia, R as ResolvedConfig } from '../types-YRkkep62.js';
5
5
  import '@adonisjs/core/types';
6
6
  import '@tuyau/utils/types';
7
7
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InertiaMiddleware
3
- } from "../chunk-TSAZ2E7H.js";
3
+ } from "../chunk-G6UKVO4B.js";
4
4
  export {
5
5
  InertiaMiddleware as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { PluginFn } from '@japa/runner/types';
2
2
  import { ApplicationService } from '@adonisjs/core/types';
3
- import { P as PageProps } from '../../../types-fb05P61I.js';
3
+ import { P as PageProps } from '../../../types-YRkkep62.js';
4
4
  import '@adonisjs/core/http';
5
5
  import '@tuyau/utils/types';
6
6
  import '@adonisjs/vite';
@@ -1,5 +1,5 @@
1
1
  import '@adonisjs/core/types';
2
2
  import '@adonisjs/core/http';
3
3
  import '@tuyau/utils/types';
4
- export { A as AssetsVersion, D as Data, I as InertiaConfig, f as InferPageProps, d as InferSharedProps, M as MaybePromise, c as PageObject, P as PageProps, g as RenderInertiaSsrApp, R as ResolvedConfig, S as SharedData, b as SharedDatumFactory, e as SharedProps } from '../types-fb05P61I.js';
4
+ export { A as AssetsVersion, D as Data, I as InertiaConfig, f as InferPageProps, d as InferSharedProps, M as MaybePromise, c as PageObject, P as PageProps, g as RenderInertiaSsrApp, R as ResolvedConfig, S as SharedData, b as SharedDatumFactory, e as SharedProps } from '../types-YRkkep62.js';
5
5
  import '@adonisjs/vite';
@@ -74,7 +74,7 @@
74
74
  </svg>
75
75
  </div>
76
76
 
77
- <div class="mt-1.5 space-y-1">
77
+ <div class="space-y-1">
78
78
  <h2 class="text-lg font-semibold">
79
79
  <a href="https://docs.adonisjs.com" target="_blank">
80
80
  <span>Documentation</span>
@@ -332,8 +332,8 @@
332
332
  </div>
333
333
  </div>
334
334
 
335
- <div class="text-sm text-center [&>code]:font-medium [&>code]:text-[#a599ff] bg-sand-12 text-sand-1 relative py-2">
336
- Route for this page is registered in <code>start/routes.ts</code> file, rendering{' '}
335
+ <div class="text-sm text-center [&>code]:font-medium [&>code]:text-[#a599ff] bg-sand-12 text-sand-1 fixed bottom-0 left-0 right-0 py-2">
336
+ Route for this page is registered in <code>start/routes.ts</code> file, rendering
337
337
  <code>inertia/pages/home.svelte</code> template
338
338
  </div>
339
339
  </div>
@@ -191,7 +191,7 @@ interface SharedProps {
191
191
  * }
192
192
  * ```
193
193
  */
194
- type InferPageProps<Controller, Method extends keyof Controller> = Controller[Method] extends (...args: any[]) => any ? Simplify<Serialize<InferProps<Exclude<Awaited<ReturnType<Controller[Method]>>, string>['props']> & SharedProps>> : never;
194
+ type InferPageProps<Controller, Method extends keyof Controller> = Controller[Method] extends (...args: any[]) => any ? Simplify<Serialize<InferProps<Extract<Awaited<ReturnType<Controller[Method]>>, PageObject>['props']> & SharedProps>> : never;
195
195
  /**
196
196
  * Signature for the method in the SSR entrypoint file
197
197
  */
@@ -77,7 +77,7 @@
77
77
  </svg>
78
78
  </div>
79
79
 
80
- <div class="mt-1.5 space-y-1">
80
+ <div class="space-y-1">
81
81
  <h2 class="text-lg font-semibold">
82
82
  <a href="https://docs.adonisjs.com" target="_blank">
83
83
  <span>Documentation</span>
@@ -335,8 +335,8 @@
335
335
  </div>
336
336
  </div>
337
337
 
338
- <div class="text-sm text-center [&>code]:font-medium [&>code]:text-[#a599ff] bg-sand-12 text-sand-1 relative py-2">
339
- Route for this page is registered in <code>start/routes.ts</code> file, rendering{' '}
338
+ <div class="text-sm text-center [&>code]:font-medium [&>code]:text-[#a599ff] bg-sand-12 text-sand-1 fixed bottom-0 left-0 right-0 py-2">
339
+ Route for this page is registered in <code>start/routes.ts</code> file, rendering
340
340
  <code>inertia/pages/home.vue</code> template
341
341
  </div>
342
342
  </div>
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.2.0",
4
+ "version": "1.2.2",
5
5
  "engines": {
6
6
  "node": ">=20.6.0"
7
7
  },
@@ -25,9 +25,9 @@
25
25
  "clean": "del-cli build",
26
26
  "copy:templates": "copyfiles --up 1 \"stubs/**/*.stub\" build",
27
27
  "typecheck": "tsc --noEmit",
28
- "lint": "eslint . --ext=.ts",
28
+ "lint": "eslint",
29
29
  "format": "prettier --write .",
30
- "quick:test": "node --enable-source-maps --loader=ts-node/esm bin/test.ts",
30
+ "quick:test": "node --import=ts-node-maintained/register/esm bin/test.ts",
31
31
  "pretest": "npm run lint",
32
32
  "test": "c8 npm run quick:test",
33
33
  "prebuild": "npm run lint && npm run clean",
@@ -38,12 +38,12 @@
38
38
  "prepublishOnly": "npm run build"
39
39
  },
40
40
  "devDependencies": {
41
- "@adonisjs/assembler": "^7.7.0",
42
- "@adonisjs/core": "6.9.1",
43
- "@adonisjs/eslint-config": "^1.3.0",
44
- "@adonisjs/prettier-config": "^1.3.0",
45
- "@adonisjs/session": "7.4.0",
46
- "@adonisjs/tsconfig": "^1.3.0",
41
+ "@adonisjs/assembler": "^7.8.2",
42
+ "@adonisjs/core": "6.14.0",
43
+ "@adonisjs/eslint-config": "^2.0.0-beta.7",
44
+ "@adonisjs/prettier-config": "^1.4.0",
45
+ "@adonisjs/session": "7.5.0",
46
+ "@adonisjs/tsconfig": "^1.4.0",
47
47
  "@adonisjs/vite": "^3.0.0",
48
48
  "@japa/api-client": "^2.0.3",
49
49
  "@japa/assert": "3.0.0",
@@ -51,35 +51,36 @@
51
51
  "@japa/file-system": "^2.3.0",
52
52
  "@japa/plugin-adonisjs": "^3.0.1",
53
53
  "@japa/runner": "3.1.4",
54
- "@japa/snapshot": "^2.0.5",
55
- "@swc/core": "^1.5.24",
56
- "@types/node": "^20.13.0",
57
- "@types/qs": "^6.9.15",
54
+ "@japa/snapshot": "^2.0.6",
55
+ "@release-it/conventional-changelog": "^8.0.2",
56
+ "@swc/core": "^1.7.26",
57
+ "@types/node": "^22.7.4",
58
+ "@types/qs": "^6.9.16",
58
59
  "@types/supertest": "^6.0.2",
59
- "@vavite/multibuild": "^4.1.1",
60
- "c8": "^9.1.0",
60
+ "@vavite/multibuild": "^4.1.3",
61
+ "c8": "^10.1.2",
61
62
  "copyfiles": "^2.4.1",
62
63
  "del-cli": "^5.1.0",
63
- "edge-parser": "^9.0.2",
64
- "edge.js": "^6.0.2",
65
- "eslint": "^8.57.0",
64
+ "edge-parser": "^9.0.3",
65
+ "edge.js": "^6.2.0",
66
+ "eslint": "^9.11.1",
66
67
  "get-port": "^7.1.0",
67
- "prettier": "^3.3.0",
68
- "release-it": "^17.3.0",
68
+ "prettier": "^3.3.3",
69
+ "release-it": "^17.6.0",
69
70
  "supertest": "^7.0.0",
70
- "ts-node": "^10.9.2",
71
- "tsup": "^8.0.2",
72
- "typescript": "~5.4.5",
73
- "vite": "^5.2.12"
71
+ "ts-node-maintained": "^10.9.4",
72
+ "tsup": "^8.3.0",
73
+ "typescript": "~5.6.2",
74
+ "vite": "^5.4.8"
74
75
  },
75
76
  "dependencies": {
76
- "@poppinss/utils": "^6.7.3",
77
+ "@poppinss/utils": "^6.8.3",
77
78
  "@tuyau/utils": "^0.0.4",
78
79
  "crc-32": "^1.2.2",
79
80
  "edge-error": "^4.0.1",
80
81
  "html-entities": "^2.5.2",
81
82
  "locate-path": "^7.2.0",
82
- "qs": "^6.12.1"
83
+ "qs": "^6.13.0"
83
84
  },
84
85
  "peerDependencies": {
85
86
  "@adonisjs/core": "^6.9.1",
@@ -99,24 +100,29 @@
99
100
  "inertia",
100
101
  "adonisjs"
101
102
  ],
102
- "eslintConfig": {
103
- "extends": "@adonisjs/eslint-config/package"
104
- },
105
103
  "prettier": "@adonisjs/prettier-config",
106
- "publishConfig": {
107
- "access": "public",
108
- "tag": "latest"
109
- },
110
104
  "release-it": {
111
105
  "git": {
106
+ "requireCleanWorkingDir": true,
107
+ "requireUpstream": true,
112
108
  "commitMessage": "chore(release): ${version}",
113
109
  "tagAnnotation": "v${version}",
110
+ "push": true,
114
111
  "tagName": "v${version}"
115
112
  },
116
113
  "github": {
117
- "release": true,
118
- "releaseName": "v${version}",
119
- "web": true
114
+ "release": true
115
+ },
116
+ "npm": {
117
+ "publish": true,
118
+ "skipChecks": true
119
+ },
120
+ "plugins": {
121
+ "@release-it/conventional-changelog": {
122
+ "preset": {
123
+ "name": "angular"
124
+ }
125
+ }
120
126
  }
121
127
  },
122
128
  "c8": {