@dokebi/template-inertia 0.4.14 → 0.4.16
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/AI.md +1 -1
- package/dist/index.js +8 -4
- package/dist/vite-watch.js +1 -1
- package/package.json +3 -3
package/AI.md
CHANGED
|
@@ -28,7 +28,7 @@ npm run build # dist/ (browser) + dist/ssr
|
|
|
28
28
|
| `scripts` · `styles` | string[] | none | module scripts and stylesheets of the first HTML (local URLs starting with `/`) |
|
|
29
29
|
| `vite: { manifest, entry, base? }` | object | none | computes scripts, styles and version from the manifest; `base` defaults to `/`. Refused together with version, scripts or styles |
|
|
30
30
|
| `ssr: { bundle, failure?, entry?, timeoutMs? }` | object | none | server rendering. `failure`: `fallback` (default) or `error`. `entry` is the bundle's source module used in development mode (§5.1). `timeoutMs` (1 to 600000, default 5000): how long one `render(page)` may take; past it the render fails with `SSR_TIMEOUT` and `failure` decides ([D-0107](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0107-stream-and-render-bounds.md)). Size it above your slowest page render (`ssrStats()` and the `INERTIA_SSR_FAILED` logs show cut renders) |
|
|
31
|
-
| `devHosts` | string[] | `[]` | development only (`DOKEBI_VITE_DEV=1`): host names, besides loopback names, IP addresses and @dokebi/app domains, that may load the Vite dev routes, for example a tunnel host. `.example.com` also allows its subdomains. At most 256 names; no `*`, no port ([D-0107](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0107-stream-and-render-bounds.md)) |
|
|
31
|
+
| `devHosts` | string[] | `[]` | development only (`DOKEBI_VITE_DEV=1`): host names, besides loopback names, IP addresses and @dokebi/app domains (with a domain provider, the domains of the moment, D-0252), that may load the Vite dev routes, for example a tunnel host. `.example.com` also allows its subdomains. At most 256 names; no `*`, no port ([D-0107](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0107-stream-and-render-bounds.md)) |
|
|
32
32
|
| `devDepsRepairIntervalMs` | integer 1000–3600000 | 10000 | development only (`dokebi dev`): the Vite dev host re-optimizes the pre-bundled dependencies (`node_modules/.vite/deps`) when they changed on disk under it, at most once per this many ms; a cache that keeps changing faster is reported (`INERTIA_VITE_DEPS_CHANGING`). Read by the host when `dokebi dev` starts (§5.1, [D-0128](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0128-vite-deps-cache-repair.md)) |
|
|
33
33
|
| `encryptHistory` | `true` · `false` · `'sealed'` | `'sealed'` | Inertia history encryption; `'sealed'` turns it on for sealed requests (D-0062) |
|
|
34
34
|
| `routeIds: { assets?, viteDev? }` | strings | `template-inertia.assets`, `template-inertia.viteDev` | the route ids of the routes this plugin adds ([D-0142](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0142-plugin-route-ids.md)): `assets` every built file of `vite.manifest` (one route per file, one id), `viteDev` the `<base>*` routes of the Vite dev server (development only). `request.routeOptions.config.id` and `dokebi describe` `routes[].id` show them (describe serves no build, so it lists neither). An id taken by another route of the same app fails the start (`DUPLICATE_ROUTE_ID`) |
|
package/dist/index.js
CHANGED
|
@@ -133,7 +133,10 @@ function renderWithin(render, page, timeoutMs, late) {
|
|
|
133
133
|
class DevHosts {
|
|
134
134
|
#exact;
|
|
135
135
|
#suffixes;
|
|
136
|
-
|
|
136
|
+
/** D-0252: a domain of the app group now (a domain provider adds them while the app runs). */
|
|
137
|
+
#known;
|
|
138
|
+
constructor(appDomains, configured, known = () => false) {
|
|
139
|
+
this.#known = known;
|
|
137
140
|
const exact = new Set(appDomains.map((host) => host.toLowerCase().replace(/:\d+$/, '')));
|
|
138
141
|
const suffixes = [];
|
|
139
142
|
for (const host of configured) {
|
|
@@ -157,7 +160,8 @@ class DevHosts {
|
|
|
157
160
|
host.endsWith('.localhost') ||
|
|
158
161
|
isIP(host) !== 0 ||
|
|
159
162
|
this.#exact.has(host) ||
|
|
160
|
-
this.#suffixes.some((suffix) => host.endsWith(suffix))
|
|
163
|
+
this.#suffixes.some((suffix) => host.endsWith(suffix)) ||
|
|
164
|
+
this.#known(host));
|
|
161
165
|
}
|
|
162
166
|
}
|
|
163
167
|
/**
|
|
@@ -563,7 +567,7 @@ class InertiaRuntime {
|
|
|
563
567
|
// domains of @dokebi/app (the same in every cluster worker) and `devHosts` (D-0107 §5).
|
|
564
568
|
const appDomains = context.app.config['dokebi-app']
|
|
565
569
|
?.domains;
|
|
566
|
-
const devHosts = new DevHosts(Object.keys(appDomains ?? {}), this.settings.devHosts);
|
|
570
|
+
const devHosts = new DevHosts(Object.keys(appDomains ?? {}), this.settings.devHosts, (name) => server.apps?.domainApp(name) !== undefined);
|
|
567
571
|
const hostName = (request) => server
|
|
568
572
|
.requestHost(request)
|
|
569
573
|
.toLowerCase()
|
|
@@ -1061,7 +1065,7 @@ class InertiaRuntime {
|
|
|
1061
1065
|
}
|
|
1062
1066
|
export const createPlugin = definePlugin({
|
|
1063
1067
|
name: 'dokebi-template-inertia',
|
|
1064
|
-
version: '0.4.
|
|
1068
|
+
version: '0.4.16',
|
|
1065
1069
|
core: '^0.4.2',
|
|
1066
1070
|
options,
|
|
1067
1071
|
entry: parseEntry,
|
package/dist/vite-watch.js
CHANGED
|
@@ -119,7 +119,7 @@ export class ServedFiles {
|
|
|
119
119
|
return undefined;
|
|
120
120
|
// Once per 10 seconds, with how many failed since the last warning (D-0047).
|
|
121
121
|
this.#statFailures++;
|
|
122
|
-
const now =
|
|
122
|
+
const now = performance.now(); // D-0254: the warn interval is monotonic.
|
|
123
123
|
if (now - this.#warnedAt >= 10_000) {
|
|
124
124
|
this.#logger.log('warn', 'Vite dev host could not read the state of a file', {
|
|
125
125
|
code: 'INERTIA_VITE_WATCH_STAT_FAILED',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dokebi/template-inertia",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "Inertia v3 server adapter for Dokebi: page JSON, Vite manifest assets and optional server-side rendering.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dokebi",
|
|
@@ -144,8 +144,8 @@
|
|
|
144
144
|
},
|
|
145
145
|
"devDependencies": {
|
|
146
146
|
"@dokebi/i18n": "0.2.8",
|
|
147
|
-
"@dokebi/session": "0.4.
|
|
148
|
-
"@dokebi/web": "0.4.
|
|
147
|
+
"@dokebi/session": "0.4.10",
|
|
148
|
+
"@dokebi/web": "0.4.21",
|
|
149
149
|
"@dokebi/websocket": "0.4.9",
|
|
150
150
|
"@dokebi/websocket-hub": "0.4.5",
|
|
151
151
|
"@inertiajs/vue3": "3.9.1",
|