@dokebi/template-inertia 0.4.27 → 0.4.28

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 CHANGED
@@ -317,10 +317,11 @@ A template can live apart from the app: a `views/<template>/` folder (Layout.vue
317
317
 
318
318
  **Working on a template (0.4.22).**
319
319
 
320
- - **Preview:** `npx dokebi template preview <dir> [--port 5180] [--host 127.0.0.1] [--config <vite config>] [--csp <file>] [--style <file>]...` in the template repository starts a Vite dev server (HMR, the repository's real vue, Inertia and SDK packages; no app server). `/` lists every page and its cases; `/__dokebi/preview/<page>?case=<case>` draws one in the template's Layout, and a `<Link>` to another preview URL is an Inertia visit. API: `startTemplatePreview(options)` of `@dokebi/template-inertia/template` → `{ url, pages, close() }`.
320
+ - **Preview:** `npx dokebi template preview <dir> [--port 5180] [--host 127.0.0.1] [--config <vite config>] [--csp <file>] [--style <file>]... [--words <dir>] [--locales <list>] [--locale <locale>]` in the template repository starts a Vite dev server (HMR, the repository's real vue, Inertia and SDK packages; no app server). `/` lists every page and its cases; `/__dokebi/preview/<page>?case=<case>` draws one in the template's Layout, and a `<Link>` to another preview URL is an Inertia visit. API: `startTemplatePreview(options)` of `@dokebi/template-inertia/template` → `{ url, pages, close() }`.
321
321
  - `Pages/<page>.preview.json` beside the page: an object of named cases, `{ "default": { "total": 12000 }, "empty cart": { "total": 0 } }` (JSON data, case names letters, digits, space, `_ . -`; a page without one gets the case `default` with no props). The first case is the one `/__dokebi/preview/<page>` draws.
322
322
  - `preview.json` of the template folder: `{ "shared": { "app": { "name": "site", "template": "luxe" }, "auth": { … } } }`, under every case (the props the app's shared data gives in production).
323
323
  - The preview files are not in the bundle: `template build` builds the `.vue` pages only.
324
+ - **Languages (0.4.28, D-0300):** the preview offers every language: `--locales ko,en` (else `preview.json`'s `locales`, else every locale folder of the template's `locales/` and of `--words`), the first shown being `--locale` (else `preview.json`'s `locale`, else the first). `--words <dir>` is a folder of the app's catalogs (`<locale>/<namespace>.json`, the shape of `src/shared/locales`) under the template's own words, so keys the template does not override show the app's words, not their keys. The `i18n` prop carries the settings of a language switch, so the app's language buttons (`useI18n().locales`) show, and `switchLocale('en')` draws the page again in that language in the same document (the preview answers in the language of its cookie `dokebi_preview_locale`). The default language is the fallback of the others.
324
325
  - **Pages follow the folder (0.4.27, D-0299):** the list and the page URLs are read from the folder for every request, so a page added or removed while the preview runs is there at once; adding or removing a `Pages/**/*.vue` or `Layout.vue` reloads the open pages and the list (edits stay HMR). The preview starts without any page too (the list says so) — a template of styles alone can grow its first page.
325
326
  - **Stylesheets (0.4.27, D-0298):** `--style theme.css,style.css` links the template's stylesheets in every page, in order, as the app does with the bundle; Vite serves them, so an edit shows at once (HMR).
326
327
  - **CSP (0.4.27, D-0297):** every page is drawn under a `Content-Security-Policy` as the app would send it: web's default policy, or the app's own setting with `--csp <file>` (a JSON file shaped like `securityHeaders.contentSecurityPolicy`: `{ "directives": { … }, "nonce": true, "styleNonce": true }`), plus the template's `csp.json` sources and the preview's HMR socket; with `nonce` Vite and the preview write the nonce on their scripts. What the policy blocks is listed in a box at the bottom of the page (`connect-src blocked https://…`: declare the origin in `csp.json`) and warned in the console. A changed `csp.json` or setting file reloads the page.
@@ -355,6 +356,7 @@ A template can live apart from the app: a `views/<template>/` folder (Layout.vue
355
356
  - **A template declares the other origins it uses (0.4.27, [D-0297](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0297-template-csp-sources.md), web 0.4.28)**: the template folder's `csp.json` goes into the bundle's manifest; the app's `verifyTemplate` may narrow it; the first HTML drawn with the bundle adds those sources to its Content-Security-Policy, and only that host's pages do. `template preview --csp <app setting>` draws the pages under the same policy and lists what it blocks (§4.3).
356
357
  - **The template's look is in the first HTML; a template may have no page (0.4.27, [D-0298](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0298-template-styles-and-pageless-bundles.md))**: `dokebi template build --style theme.css` lists the template's stylesheets in the manifest (`styles`), and the app links them, in order and with the nonce, in the head of every first HTML of that template, where a template's stylesheet used to arrive after the first paint. A folder of stylesheets and carried files alone builds into a bundle without pages (§4.3).
357
358
  - **The preview follows the folder's pages (0.4.27, [D-0299](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0299-preview-follows-pages.md))**: a page added or removed while `dokebi template preview` runs is listed and drawn at once (the open pages reload), where the preview fixed its pages at start; it also starts without any page.
359
+ - **The preview offers every language (0.4.28, [D-0300](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0300-preview-languages.md))**: `template preview --locales ko,en --locale ko [--words <app catalogs>]`: the app's language buttons show in the preview and switch the page, where the preview sent one language without the switch's settings (§4.3).
358
360
  - **A module URL the host answers 404 says why (0.4.23, [D-0292](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0292-vite-host-explains-module-404.md))**: Vite turns `ERR_LOAD_URL` ("Failed to load url … (resolved id: …) in <importer>") into `next()` without the error, so a module it could not load answered an empty 404 and nothing was logged. Now, when a module request (`GET`/`HEAD` under the base with a module or style extension, `?import`, or `Sec-Fetch-Dest: script`) ends that way, the host asks Vite again in the same process and logs warn `INERTIA_VITE_NOT_LOADED` with `url`, `module` (the module URL without `t` and `import`), `root`, `file`, `exists` (with `missing`: `ENOENT`, `directory`, …), `readable`, `real` (when it is a link), `allowed` (Vite's `isFileLoadingAllowed`), `graph` (the module graph's entry for the URL: `id`, `file`, `stale` when its id names another file, `transformed`, `invalidatedAt`), `cause` (the error of one more `transformRequest`: the message Vite dropped, with its `code`) and `loadsNow`. Once per URL until it is served again; repeats are debug with `repeats`. Vite's static middleware serves a file that is there and allowed even when its transform fails, so an empty 404 means that this process saw the file missing or not allowed; when the diagnosis finds it there, readable and allowed after all (`retry: true`), the host invalidates the module, drops a URL entry whose id names another file and runs the request through Vite once more: the warning then says it was served after invalidating it, and `retried` is the status of that second answer. A page, a folder and a virtual `/@id/` URL keep the plain 404.
359
361
  - **Pre-bundled dependencies that load (D-0128, 0.4.4)**: Vite keeps what its dependency optimizer wrote (each dependency's file under `node_modules/.vite/deps` and the `?v=` hash pages get) in memory, and at start trusts `_metadata.json` whenever the lockfile and config hashes match; it never looks at the files again, and it answers a file that is gone with 504 "Outdated Optimize Dep". A folder changed under it (two Vite optimizers on one folder — two `dokebi dev` sessions, a host still closing while the next starts — or a reinstall) therefore left every page blank through app restarts and dev restarts, until `rm -rf node_modules/.vite`. The host now compares its optimizer's files and metadata hashes with the folder when it starts, whenever an app process connects (every app or worker start) and after it answered a 504; when they differ it removes the deps folder and restarts its Vite (warn `INERTIA_VITE_DEPS_STALE` with `trigger` `start`, `client` or `outdated`, `drift` `missing` or `rewritten`, and a sample of the missing files), and the app process is answered after the repair. Open pages reconnect HMR and reload; a new page load gets the new hashes. At most one repair per `devDepsRepairIntervalMs`; faster changes are reported with warn `INERTIA_VITE_DEPS_CHANGING`. The host records its pid in `<cacheDir>/.dokebi/vite-host.json` and warns `INERTIA_VITE_HOST_SHARED` when another live host recorded itself there (stop one of the two `dokebi dev`). App processes pass Vite's status text on (`504 Outdated Optimize Dep`).
360
362
  - SSR: the host runs `ssrLoadModule(<source entry>)` and `render(page)` per request. The app process asks on connections of its own (a render that waits never holds the connections module requests are forwarded on) and cuts the request at `ssr.timeoutMs`, so renders that never finish do not pile up on the host. The source entry is `ssr.entry` (for example `src/apps/admin/views/ssr.js`), otherwise `ssr.js` in the folder of `vite.entry`. When neither exists the start fails (`SSR_ENTRY_MISSING`).
package/dist/index.js CHANGED
@@ -1248,7 +1248,7 @@ class InertiaRuntime {
1248
1248
  }
1249
1249
  export const createPlugin = definePlugin({
1250
1250
  name: 'dokebi-template-inertia',
1251
- version: '0.4.27',
1251
+ version: '0.4.28',
1252
1252
  core: '^0.4.2',
1253
1253
  options,
1254
1254
  entry: parseEntry,
@@ -15,7 +15,7 @@ import { checkTemplateBundle, cspDeclarationProblem, jsonValue, PAGE_META_MAX_BY
15
15
  import { packageVersion } from './template-shared.js';
16
16
  import { registerVueTypeScript } from './vue-typescript.js';
17
17
  /** The builder written into `builtWith` (scripts/testing/check-metadata.mjs keeps it the package version). */
18
- const BUILDER = { name: 'dokebi-template-inertia', version: '0.4.27' };
18
+ const BUILDER = { name: 'dokebi-template-inertia', version: '0.4.28' };
19
19
  /** D-0296: carried files go under this folder of the bundle (served like the pages' files). */
20
20
  export const TEMPLATE_CARRY_FOLDER = 'browser';
21
21
  /** The folders Vite writes under browser/: a carried file never takes them (any case). */
@@ -23,6 +23,15 @@ export interface TemplatePreviewOptions {
23
23
  * in every page as the app does with a bundle's `styles` (and updated by HMR).
24
24
  */
25
25
  readonly styles?: readonly string[];
26
+ /**
27
+ * D-0300: a folder of the app's catalogs (`<locale>/<namespace>.json`), relative to root: the
28
+ * template's own words lie over them, as in the app.
29
+ */
30
+ readonly words?: string;
31
+ /** D-0300: the languages offered (default: preview.json `locales`, else every locale folder). */
32
+ readonly locales?: readonly string[];
33
+ /** D-0300: the language shown first (default: preview.json `locale`, else the first). */
34
+ readonly defaultLocale?: string;
26
35
  readonly logger?: Logger;
27
36
  }
28
37
  export interface TemplatePreviewPage {
@@ -37,11 +46,28 @@ export interface TemplatePreview {
37
46
  }
38
47
  /** The cases of one page (`<Page>.preview.json`): case → props, checked. */
39
48
  export declare function previewCases(file: string): Promise<Record<string, Record<string, unknown>>>;
49
+ /** D-0300: the cookie the preview's language switch writes (the app's switchLocale). */
50
+ export declare const PREVIEW_LOCALE_COOKIE = "dokebi_preview_locale";
51
+ /** D-0300: where the preview's languages and words come from. */
52
+ export interface PreviewWordsOptions {
53
+ /**
54
+ * A folder of the app's catalogs (`<locale>/<namespace>.json`, the shape of src/shared/locales):
55
+ * the template's own words lie over them, as in the app.
56
+ */
57
+ readonly words?: string;
58
+ /** The languages to offer (default: every locale folder of the template and of `words`). */
59
+ readonly locales?: readonly string[];
60
+ /** The language shown first (default: the first of `locales`). */
61
+ readonly defaultLocale?: string;
62
+ }
40
63
  /**
41
- * D-0291 stage 3b: the `i18n` page prop of the preview from the template's own words
42
- * (`locales/<locale>/<namespace>.json`), so pages that call t() draw; undefined without words.
64
+ * D-0291 stage 3b, D-0300: the `i18n` page prop of the preview: the words of `wanted` (or the
65
+ * default language) from the template's `locales/<locale>/<namespace>.json` over the app's
66
+ * catalogs (`options.words`), with the default language's as the fallback, and the settings of a
67
+ * language switch (every language offered, the default, the preview's cookie), so pages that call
68
+ * t() draw and the app's language buttons show and work. Undefined without any words.
43
69
  */
44
- export declare function previewWords(folder: string, wanted?: string): Promise<Record<string, unknown> | undefined>;
70
+ export declare function previewWords(folder: string, wanted?: string, options?: PreviewWordsOptions): Promise<Record<string, unknown> | undefined>;
45
71
  /**
46
72
  * D-0297: the policy of a preview page: the app's setting (or web's default), the template's
47
73
  * declared sources, the HMR socket, and the nonce where the setting asks for one.
@@ -77,53 +77,135 @@ function flatten(input, prefix, out) {
77
77
  out[name] = value;
78
78
  }
79
79
  }
80
- /**
81
- * D-0291 stage 3b: the `i18n` page prop of the preview from the template's own words
82
- * (`locales/<locale>/<namespace>.json`), so pages that call t() draw; undefined without words.
83
- */
84
- export async function previewWords(folder, wanted) {
85
- const root = join(folder, 'locales');
86
- if (!existsSync(root))
87
- return undefined;
88
- const locales = (await readdir(root, { withFileTypes: true }))
89
- .filter((entry) => entry.isDirectory() && !entry.name.startsWith('.'))
80
+ /** D-0300: the cookie the preview's language switch writes (the app's switchLocale). */
81
+ export const PREVIEW_LOCALE_COOKIE = 'dokebi_preview_locale';
82
+ /** A locale folder name: a language tag. */
83
+ const LOCALE = /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,4}$/;
84
+ /** The locale folders of `root`, sorted (none when it is missing). */
85
+ async function localeFolders(root) {
86
+ if (root === undefined || !existsSync(root))
87
+ return [];
88
+ return (await readdir(root, { withFileTypes: true }))
89
+ .filter((entry) => entry.isDirectory() && LOCALE.test(entry.name))
90
90
  .map((entry) => entry.name)
91
91
  .sort();
92
- const locale = wanted !== undefined && locales.includes(wanted) ? wanted : locales[0];
93
- if (locale === undefined)
94
- return undefined;
95
- const messages = {};
96
- const namespaces = [];
97
- for (const entry of await readdir(join(root, locale), { withFileTypes: true })) {
92
+ }
93
+ /** The flat messages and namespaces of one locale folder (`<namespace>.json` files). */
94
+ async function localeWords(root, locale, messages, namespaces) {
95
+ if (root === undefined)
96
+ return;
97
+ const folder = join(root, locale);
98
+ if (!existsSync(folder))
99
+ return;
100
+ for (const entry of await readdir(folder, { withFileTypes: true })) {
98
101
  if (!entry.isFile() || !entry.name.endsWith('.json') || entry.name.startsWith('.'))
99
102
  continue;
100
103
  const namespace = entry.name.slice(0, -'.json'.length);
101
- namespaces.push(namespace);
102
- flatten(JSON.parse(await readFile(join(root, locale, entry.name), 'utf8')), namespace, messages);
104
+ const file = join(folder, entry.name);
105
+ let parsed;
106
+ try {
107
+ parsed = JSON.parse(await readFile(file, 'utf8'));
108
+ }
109
+ catch (error) {
110
+ throw new InertiaUsageError('INVALID_TEMPLATE_PREVIEW', `${file} is not JSON: ${error.message}`);
111
+ }
112
+ if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
113
+ throw new InertiaUsageError('INVALID_TEMPLATE_PREVIEW', `${file} is not an object of words`);
114
+ namespaces.add(namespace);
115
+ flatten(parsed, namespace, messages);
116
+ }
117
+ }
118
+ /**
119
+ * D-0291 stage 3b, D-0300: the `i18n` page prop of the preview: the words of `wanted` (or the
120
+ * default language) from the template's `locales/<locale>/<namespace>.json` over the app's
121
+ * catalogs (`options.words`), with the default language's as the fallback, and the settings of a
122
+ * language switch (every language offered, the default, the preview's cookie), so pages that call
123
+ * t() draw and the app's language buttons show and work. Undefined without any words.
124
+ */
125
+ export async function previewWords(folder, wanted, options = {}) {
126
+ const own = join(folder, 'locales');
127
+ const app = options.words;
128
+ const found = [...new Set([...(await localeFolders(own)), ...(await localeFolders(app))])].sort();
129
+ const locales = options.locales?.length ? [...options.locales] : found;
130
+ for (const locale of locales)
131
+ if (!LOCALE.test(locale))
132
+ throw new InertiaUsageError('INVALID_TEMPLATE_PREVIEW', `${locale} is not a language tag`);
133
+ const defaultLocale = options.defaultLocale !== undefined && locales.includes(options.defaultLocale)
134
+ ? options.defaultLocale
135
+ : locales[0];
136
+ if (defaultLocale === undefined)
137
+ return undefined;
138
+ const locale = wanted !== undefined && locales.includes(wanted) ? wanted : defaultLocale;
139
+ const fallback = locale === defaultLocale ? [locale] : [locale, defaultLocale];
140
+ const messages = {};
141
+ const namespaces = new Set();
142
+ // Each key once, from the first language of the chain that has it (as the server sends a page's
143
+ // messages: the browser takes the last source of a key it is given twice).
144
+ const seen = new Set();
145
+ for (const source of fallback) {
146
+ const words = {};
147
+ // The app's catalogs first, the template's own over them (D-0282).
148
+ await localeWords(app, source, words, namespaces);
149
+ await localeWords(own, source, words, namespaces);
150
+ const fresh = Object.fromEntries(Object.entries(words).filter(([key]) => !seen.has(key)));
151
+ for (const key of Object.keys(fresh))
152
+ seen.add(key);
153
+ if (Object.keys(fresh).length || source === locale)
154
+ messages[source] = fresh;
103
155
  }
104
156
  return {
105
157
  locale,
106
158
  version: 'preview',
107
- fallback: [locale],
108
- namespaces: namespaces.sort(),
109
- messages: { [locale]: messages },
159
+ fallback,
160
+ namespaces: [...namespaces].sort(),
161
+ messages,
162
+ settings: {
163
+ locales,
164
+ defaultLocale,
165
+ missing: 'key',
166
+ timeZone: 'UTC',
167
+ maxOutputLength: 65536,
168
+ cookie: PREVIEW_LOCALE_COOKIE,
169
+ numberFormats: {},
170
+ dateFormats: {},
171
+ },
110
172
  };
111
173
  }
112
- /** `preview.json` of the template folder: `{ shared, locale? }`. */
174
+ /** `preview.json` of the template folder: `{ shared, locale?, locales? }` (the languages). */
113
175
  async function previewLocale(folder) {
114
176
  const file = join(folder, 'preview.json');
115
177
  if (!existsSync(file))
116
- return undefined;
178
+ return {};
117
179
  try {
118
- const locale = JSON.parse(await readFile(file, 'utf8'))
119
- ?.locale;
120
- return typeof locale === 'string' ? locale : undefined;
180
+ const parsed = JSON.parse(await readFile(file, 'utf8'));
181
+ return {
182
+ ...(typeof parsed?.locale === 'string' ? { locale: parsed.locale } : {}),
183
+ ...(Array.isArray(parsed?.locales) && parsed.locales.every((item) => typeof item === 'string')
184
+ ? { locales: parsed.locales }
185
+ : {}),
186
+ };
121
187
  }
122
188
  catch {
123
189
  // Its shape is reported by previewShared.
124
- return undefined;
190
+ return {};
125
191
  }
126
192
  }
193
+ /** D-0300: the preview's language cookie of a request, when it names one. */
194
+ function cookieLocale(header) {
195
+ for (const part of (header ?? '').split(';')) {
196
+ const [name, ...value] = part.trim().split('=');
197
+ if (name === PREVIEW_LOCALE_COOKIE) {
198
+ try {
199
+ return decodeURIComponent(value.join('='));
200
+ }
201
+ catch {
202
+ // A cookie that is not URI-encoded names no language.
203
+ return undefined;
204
+ }
205
+ }
206
+ }
207
+ return undefined;
208
+ }
127
209
  /** `preview.json` of the template folder: `{ shared }`. */
128
210
  async function previewShared(folder) {
129
211
  const file = join(folder, 'preview.json');
@@ -265,6 +347,10 @@ export async function startTemplatePreview(options) {
265
347
  if (cspSetting !== undefined && !existsSync(cspSetting))
266
348
  throw new InertiaUsageError('INVALID_TEMPLATE_PREVIEW', `--csp ${options.csp} is not a file`);
267
349
  const nonce = randomBytes(16).toString('base64');
350
+ // D-0300: the app's catalogs the template's words lie over.
351
+ const appWords = options.words === undefined ? undefined : resolve(root, options.words);
352
+ if (appWords !== undefined && !existsSync(appWords))
353
+ throw new InertiaUsageError('INVALID_TEMPLATE_PREVIEW', `--words ${options.words} is not a folder`);
268
354
  let socketOrigin = () => 'ws://127.0.0.1';
269
355
  const folderUrl = `/${inside.split(sep).join('/')}`;
270
356
  /** D-0299: the pages of the folder now (a few readdir calls). */
@@ -272,7 +358,7 @@ export async function startTemplatePreview(options) {
272
358
  .filter((key) => key.startsWith('Pages/'))
273
359
  .map((key) => key.slice(6));
274
360
  /** The page object of one preview URL. */
275
- const pageObject = async (name, wanted) => {
361
+ const pageObject = async (name, wanted, language) => {
276
362
  const cases = await previewCases(join(folder, 'Pages', `${name}.preview.json`));
277
363
  const chosen = wanted !== null && Object.hasOwn(cases, wanted) ? wanted : Object.keys(cases)[0];
278
364
  const props = {
@@ -282,7 +368,16 @@ export async function startTemplatePreview(options) {
282
368
  };
283
369
  // D-0291 stage 3b: the template's own words, unless the case gives its own i18n.
284
370
  if (props.i18n === undefined) {
285
- const words = await previewWords(folder, await previewLocale(folder));
371
+ // D-0300: every language (options, else preview.json, else the locale folders), the one the
372
+ // language switch chose (its cookie), the app's catalogs under the template's words.
373
+ const chosenLanguages = await previewLocale(folder);
374
+ const defaultLocale = options.defaultLocale ?? chosenLanguages.locale;
375
+ const locales = options.locales ?? chosenLanguages.locales;
376
+ const words = await previewWords(folder, language ?? defaultLocale, {
377
+ ...(appWords === undefined ? {} : { words: appWords }),
378
+ ...(locales === undefined ? {} : { locales }),
379
+ ...(defaultLocale === undefined ? {} : { defaultLocale }),
380
+ });
286
381
  if (words) {
287
382
  props.i18n = words;
288
383
  props.locale ??= words.locale;
@@ -404,7 +499,7 @@ await createInertiaApp({
404
499
  currentNames().then(async (names) => {
405
500
  if (!names.includes(name))
406
501
  return send(404, 'text/plain; charset=utf-8', `No page ${name} in ${options.dir}`);
407
- const { page } = await pageObject(name, url.searchParams.get('case'));
502
+ const { page } = await pageObject(name, url.searchParams.get('case'), cookieLocale(request.headers.cookie));
408
503
  if (request.headers['x-inertia'] === 'true')
409
504
  return send(200, 'application/json; charset=utf-8', JSON.stringify(page), {
410
505
  'x-inertia': 'true',
@@ -1,4 +1,4 @@
1
1
  export { buildTemplateBundle, packageEntry, TEMPLATE_CARRY_FOLDER, TEMPLATE_CSP_FILE, type TemplateBuildOptions, type TemplateBuildResult, templatePages, } from './template-build.js';
2
2
  export { checkTemplateBundle, compatibleLine, cspDeclarationProblem, type ProvidedShared, SERVER_ONLY_SHARED, SHARED_DEFAULTS, sharedProblems, TEMPLATE_CSP_DIRECTIVES, TEMPLATE_FORMAT, TEMPLATE_MANIFEST, TEMPLATE_MAX_BYTES, TEMPLATE_NAME, TEMPLATE_SIGNATURE, TEMPLATE_STYLES_MAX, type TemplateCheck, type TemplateCheckLimits, type TemplateManifest, type TemplatePage, type TemplateProblem, } from './template-bundle.js';
3
- export { PREVIEW_PREFIX, previewCases, previewPolicy, previewWords, startTemplatePreview, type TemplatePreview, type TemplatePreviewOptions, type TemplatePreviewPage, } from './template-preview.js';
3
+ export { PREVIEW_LOCALE_COOKIE, PREVIEW_PREFIX, type PreviewWordsOptions, previewCases, previewPolicy, previewWords, startTemplatePreview, type TemplatePreview, type TemplatePreviewOptions, type TemplatePreviewPage, } from './template-preview.js';
4
4
  export { type DokebiInertiaTemplateOptions, packageVersion, SHARED_FILE, type SharedFile, sharedEntryName, } from './template-shared.js';
package/dist/template.js CHANGED
@@ -2,5 +2,5 @@
2
2
  // the build that `dokebi template build` runs in a template repository.
3
3
  export { buildTemplateBundle, packageEntry, TEMPLATE_CARRY_FOLDER, TEMPLATE_CSP_FILE, templatePages, } from './template-build.js';
4
4
  export { checkTemplateBundle, compatibleLine, cspDeclarationProblem, SERVER_ONLY_SHARED, SHARED_DEFAULTS, sharedProblems, TEMPLATE_CSP_DIRECTIVES, TEMPLATE_FORMAT, TEMPLATE_MANIFEST, TEMPLATE_MAX_BYTES, TEMPLATE_NAME, TEMPLATE_SIGNATURE, TEMPLATE_STYLES_MAX, } from './template-bundle.js';
5
- export { PREVIEW_PREFIX, previewCases, previewPolicy, previewWords, startTemplatePreview, } from './template-preview.js';
5
+ export { PREVIEW_LOCALE_COOKIE, PREVIEW_PREFIX, previewCases, previewPolicy, previewWords, startTemplatePreview, } from './template-preview.js';
6
6
  export { packageVersion, SHARED_FILE, sharedEntryName, } from './template-shared.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dokebi/template-inertia",
3
- "version": "0.4.27",
3
+ "version": "0.4.28",
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",