@dokebi/template-inertia 0.4.2 → 0.4.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.
@@ -5,7 +5,8 @@
5
5
  "properties": {
6
6
  "version": {
7
7
  "type": "string",
8
- "description": "Asset version sent with every page; a client with another one reloads (409). Unset: development (and a warning)."
8
+ "pattern": "^(?:[\\x21-\\x7e](?:[\\x20-\\x7e]{0,126}[\\x21-\\x7e])?)?$",
9
+ "description": "Asset version sent with every page; a client with another one reloads (409). Unset: development (and a warning). Up to 128 printable ASCII characters without leading or trailing spaces: the client sends it back in the X-Inertia-Version header."
9
10
  },
10
11
  "rootId": {
11
12
  "type": "string",
@@ -82,6 +83,13 @@
82
83
  "minLength": 1,
83
84
  "pattern": "^(?!.*\\.\\.)",
84
85
  "description": "Development (D-0045): source module of the bundle rendered through Vite, e.g. src/apps/admin/views/ssr.js. Default: ssr.js beside vite.entry"
86
+ },
87
+ "timeoutMs": {
88
+ "type": "integer",
89
+ "minimum": 1,
90
+ "maximum": 600000,
91
+ "default": 5000,
92
+ "description": "How long one render(page) may take in ms; past it the render fails with SSR_TIMEOUT, handled as failure says (fallback: the client-rendered page). Size it above your slowest page render (D-0107)"
85
93
  }
86
94
  },
87
95
  "required": [
@@ -89,6 +97,24 @@
89
97
  ],
90
98
  "description": "Render the first HTML of each page on the server (D-0039) with the SSR build output, imported once at start. A missing bundle stops the start."
91
99
  },
100
+ "devHosts": {
101
+ "type": "array",
102
+ "items": {
103
+ "type": "string",
104
+ "maxLength": 254,
105
+ "pattern": "^\\.?[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$"
106
+ },
107
+ "maxItems": 256,
108
+ "default": [],
109
+ "description": "Development (DOKEBI_VITE_DEV=1): host names besides loopback names, IP addresses and @dokebi/app domains that may load the Vite dev routes, such as a tunnel host; .example.com also allows its subdomains (D-0107)"
110
+ },
111
+ "devDepsRepairIntervalMs": {
112
+ "type": "integer",
113
+ "minimum": 1000,
114
+ "maximum": 3600000,
115
+ "default": 10000,
116
+ "description": "Development (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 with INERTIA_VITE_DEPS_CHANGING (D-0128). Read by the host when dokebi dev starts."
117
+ },
92
118
  "encryptHistory": {
93
119
  "anyOf": [
94
120
  {
@@ -101,10 +127,110 @@
101
127
  "default": "sealed",
102
128
  "description": "Inertia history encryption (D-0062): true, false, or sealed (default) = on for requests of seal hosts"
103
129
  },
130
+ "viteManifestMaxBytes": {
131
+ "type": "integer",
132
+ "minimum": 1024,
133
+ "maximum": 67108864,
134
+ "default": 4194304,
135
+ "description": "Largest Vite build manifest read at start; a larger one stops the start with VITE_MANIFEST_INVALID (D-0114). An app with thousands of chunks may need more."
136
+ },
137
+ "assetCacheMaxBytes": {
138
+ "type": "integer",
139
+ "minimum": 0,
140
+ "maximum": 67108864,
141
+ "default": 4194304,
142
+ "description": "Built files up to this size are kept in memory after their first request; larger ones are streamed from disk on every request (D-0114). 0 streams every file. Memory is at most the sum of the built files at or below it."
143
+ },
144
+ "logRepeatWindowMs": {
145
+ "type": "integer",
146
+ "minimum": 1000,
147
+ "maximum": 3600000,
148
+ "default": 10000,
149
+ "description": "Window of the repeated per-request failure logs (an SSR render that failed, a shared-data or flash hook that threw) in ms: the first is logged in full, the rest of the window are counted (D-0114)."
150
+ },
151
+ "bootFallback": {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "properties": {
155
+ "enabled": {
156
+ "type": "boolean",
157
+ "default": true,
158
+ "description": "Show the text in the root of the first HTML (false: an empty root, as before)"
159
+ },
160
+ "timeoutMs": {
161
+ "type": "integer",
162
+ "minimum": 1000,
163
+ "maximum": 120000,
164
+ "default": 10000,
165
+ "description": "How long \"loading\" shows before \"could not load — reload\" (ms)"
166
+ },
167
+ "messages": {
168
+ "type": "object",
169
+ "additionalProperties": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "properties": {
173
+ "loading": {
174
+ "type": "string",
175
+ "minLength": 1,
176
+ "maxLength": 200
177
+ },
178
+ "failed": {
179
+ "type": "string",
180
+ "minLength": 1,
181
+ "maxLength": 200
182
+ },
183
+ "reload": {
184
+ "type": "string",
185
+ "minLength": 1,
186
+ "maxLength": 200
187
+ }
188
+ }
189
+ },
190
+ "description": "Texts by language tag of <html lang> (ko, en, pt-BR) over the built-in Korean and English ones"
191
+ },
192
+ "stylesheet": {
193
+ "type": "string",
194
+ "maxLength": 2048,
195
+ "pattern": "^\\/[^/]",
196
+ "description": "A local stylesheet (/assets/boot.css) linked right after the built-in style: the app's own look of the box ([data-dokebi-boot] selectors), shown before any script of the app runs, also under dokebi dev"
197
+ },
198
+ "logo": {
199
+ "type": "string",
200
+ "maxLength": 2048,
201
+ "pattern": "^\\/[^/]",
202
+ "description": "A local image (/assets/logo.svg) above the spinner and the could-not-load text of the box, decorative (alt is empty)"
203
+ }
204
+ },
205
+ "default": {
206
+ "enabled": true,
207
+ "timeoutMs": 10000
208
+ },
209
+ "description": "The first HTML while the app loads (Studio v2): a centered spinner (\"loading\" for screen readers), then \"could not load\" with a reload button after timeoutMs (by CSS, also under a CSP without inline scripts) or at once when the entry script fails to load; stylesheet restyles it. Not on a server-rendered page."
210
+ },
104
211
  "errorPage": {
105
212
  "type": "string",
106
213
  "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*(?:\\/[A-Za-z0-9][A-Za-z0-9_-]*)*$",
107
214
  "description": "Page component (for example Error) rendered with { status, error, message, hint } for error answers of Inertia visits and full page loads (D-0074). Unset: JSON for visits, a small HTML page for page loads."
215
+ },
216
+ "routeIds": {
217
+ "type": "object",
218
+ "additionalProperties": false,
219
+ "properties": {
220
+ "assets": {
221
+ "type": "string",
222
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$",
223
+ "x-dokebi-secret": false,
224
+ "description": "Id of the GET routes of the built files of vite.manifest (one per file); default template-inertia.assets"
225
+ },
226
+ "viteDev": {
227
+ "type": "string",
228
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,63}$",
229
+ "x-dokebi-secret": false,
230
+ "description": "Id of the GET <vite base>* routes of the Vite dev server (dokebi dev, one per base); default template-inertia.viteDev"
231
+ }
232
+ },
233
+ "description": "Ids of the routes dokebi-template-inertia adds (D-0142), by route key: assets (default template-inertia.assets), viteDev (default template-inertia.viteDev). An id is 1-64 letters, digits, '.', '_' or '-' starting with a letter; an id another route of the same app has fails the start (DUPLICATE_ROUTE_ID)"
108
234
  }
109
235
  }
110
236
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dokebi/template-inertia",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
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",
@@ -21,7 +21,19 @@
21
21
  "types": "./dist/index.d.ts",
22
22
  "import": "./dist/index.js"
23
23
  },
24
- "./vite-host": "./dist/vite-host.js"
24
+ "./vite": {
25
+ "types": "./dist/vite-plugin.d.ts",
26
+ "import": "./dist/vite-plugin.js"
27
+ },
28
+ "./vite-host": "./dist/vite-host.js",
29
+ "./prune": {
30
+ "types": "./dist/prune.d.ts",
31
+ "import": "./dist/prune.js"
32
+ },
33
+ "./i18n": {
34
+ "types": "./dist/i18n.d.ts",
35
+ "import": "./dist/i18n.js"
36
+ }
25
37
  },
26
38
  "files": [
27
39
  "dist",
@@ -35,23 +47,29 @@
35
47
  "node": ">=24.0.0"
36
48
  },
37
49
  "scripts": {
38
- "build": "tsc -p tsconfig.json && node -e \"import('./dist/options.js').then(async (m) => { const { renderOptionsSchema } = await import('@dokebi/core'); process.stdout.write(renderOptionsSchema(m.options)); })\" > options.schema.json",
50
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.i18n.json && node -e \"import('./dist/options.js').then(async (m) => { const { renderOptionsSchema } = await import('@dokebi/core'); process.stdout.write(renderOptionsSchema(m.options)); })\" > options.schema.json",
39
51
  "typecheck": "tsc -p tsconfig.test.json --noEmit",
40
52
  "test": "node -e \"require('node:fs').rmSync('.tmp/tests',{recursive:true,force:true})\" && tsc -p tsconfig.test.json && node --test .tmp/tests/tests/*.test.js"
41
53
  },
42
54
  "peerDependencies": {
43
- "@dokebi/core": "^0.4.0",
44
- "@dokebi/web": "^0.4.2",
45
- "fastify": "^5.12.7"
55
+ "@dokebi/core": "^0.4.2",
56
+ "@dokebi/web": "^0.4.3",
57
+ "fastify": "^5.12.7",
58
+ "vue": "^3.5.0"
59
+ },
60
+ "peerDependenciesMeta": {
61
+ "vue": {
62
+ "optional": true
63
+ }
46
64
  },
47
65
  "dokebi": {
48
66
  "schemaVersion": 2,
49
67
  "id": "dokebi-template-inertia",
50
- "core": "^0.4.0",
68
+ "core": "^0.4.2",
51
69
  "dependencies": [
52
70
  {
53
71
  "name": "dokebi-web",
54
- "version": "^0.4.2"
72
+ "version": "^0.4.3"
55
73
  },
56
74
  {
57
75
  "name": "dokebi-session",
@@ -62,6 +80,9 @@
62
80
  "contributes": [
63
81
  "dokebi-web:view-engine"
64
82
  ],
83
+ "collects": [
84
+ "dokebi-web:view-data"
85
+ ],
65
86
  "install": {
66
87
  "entry": {
67
88
  "source": "templates/shared.ts",
@@ -109,12 +130,18 @@
109
130
  "Vue and Vite are not server dependencies (they are dev dependencies of the app)"
110
131
  ],
111
132
  "recipes": [
112
- "blog"
133
+ "blog",
134
+ "site"
113
135
  ]
114
136
  },
115
137
  "devDependencies": {
116
- "@dokebi/session": "0.4.1",
117
- "@dokebi/web": "0.4.2"
138
+ "@dokebi/i18n": "0.2.0",
139
+ "@dokebi/session": "0.4.4",
140
+ "@dokebi/web": "0.4.3",
141
+ "@dokebi/websocket": "0.4.2",
142
+ "@dokebi/websocket-hub": "0.4.2",
143
+ "@inertiajs/vue3": "3.9.1",
144
+ "vue": "3.5.44"
118
145
  },
119
146
  "publishConfig": {
120
147
  "access": "public",