@adonisjs/inertia 1.2.1 → 1.2.3

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,9 @@ 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
+ _ServerRenderer.runtime.clearCache();
21
+ render = await _ServerRenderer.runtime.executeEntrypoint(this.config.ssr.entrypoint);
20
22
  } else {
21
23
  render = await import(pathToFileURL(this.config.ssr.bundle).href);
22
24
  }
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-QNLKQLLS.js";
4
4
 
5
5
  // providers/inertia_provider.ts
6
6
  import { configProvider } from "@adonisjs/core";
@@ -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-QNLKQLLS.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';
@@ -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
  */
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.1",
4
+ "version": "1.2.3",
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": {