@i18n-micro/types 1.2.16 → 1.2.17
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/dist/index.d.cts +12 -8
- package/dist/index.d.ts +12 -8
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -270,10 +270,11 @@ export interface ModuleOptions {
|
|
|
270
270
|
*/
|
|
271
271
|
additionalTranslationDirs?: string[];
|
|
272
272
|
/**
|
|
273
|
-
* Controls how translation payloads are emitted (Node: `public/<apiBaseUrl>`; Edge: Nitro `serverAssets`).
|
|
273
|
+
* Controls how translation payloads are emitted (Node server: `public/<apiBaseUrl>`; Edge / function / inline: Nitro `serverAssets`).
|
|
274
274
|
*
|
|
275
|
-
* - **Node
|
|
276
|
-
* - **Edge
|
|
275
|
+
* - **Node server** (`node-server`, `node-cluster`, disk `serveStatic`): `serverAssets` means local SSR via `readFile` under `public/` (no Rollup `raw:`).
|
|
276
|
+
* - **Edge, function presets, and `serveStatic: "inline"`** (`vercel`, `netlify`, `aws-lambda`, winterjs, …): `serverAssets` registers Nitro `serverAssets` (`assets:i18n`),
|
|
277
|
+
* because `public/` is not available to SSR on disk. Does not force a public copy — set `publicAssets: true` for CDN/static.
|
|
277
278
|
*
|
|
278
279
|
* Keep the defaults for the usual all-in-one setup. For large Edge catalogs prefer `mode: 'source'`.
|
|
279
280
|
* For CDN-backed deployments, disable local outputs and set `apiBaseClientHost` / `apiBaseServerHost`.
|
|
@@ -511,13 +512,15 @@ export interface TranslationPayloadOptions {
|
|
|
511
512
|
*/
|
|
512
513
|
mode?: 'premerged' | 'source';
|
|
513
514
|
/**
|
|
514
|
-
* Local SSR payloads: Node
|
|
515
|
+
* Local SSR payloads: a Node server that serves `public/` from disk reads that tree (forces public copy);
|
|
516
|
+
* Edge, function presets, and `serveStatic: "inline"` embed via Nitro `serverAssets`.
|
|
515
517
|
*
|
|
516
|
-
* - **Node
|
|
518
|
+
* - **Node server** (preset serves `public/` itself, e.g. `node-server`): no Nitro `serverAssets` (avoids Rollup `raw:`). SSR reads
|
|
517
519
|
* `public/<apiBaseUrl|publicDir>` as `{page}/{locale}/data.json`; when this is `true`,
|
|
518
520
|
* a public copy is forced even if `publicAssets` is false.
|
|
519
|
-
* - **Edge** (`nitro.node === false
|
|
520
|
-
*
|
|
521
|
+
* - **Edge, function presets, and inline** (`nitro.node === false`, no disk `serveStatic` such as `vercel` /
|
|
522
|
+
* `netlify` / `aws-lambda`, or `serveStatic: "inline"` e.g. winterjs): Nitro `serverAssets` (`assets:i18n`)
|
|
523
|
+
* with the same layout as `mode`. Does **not** force a public copy — set `publicAssets: true` for CDN/static.
|
|
521
524
|
* @default true
|
|
522
525
|
*/
|
|
523
526
|
serverAssets?: boolean;
|
|
@@ -530,7 +533,8 @@ export interface TranslationPayloadOptions {
|
|
|
530
533
|
/**
|
|
531
534
|
* Copy payloads into Nitro public output. Premerged → `{page}/{locale}/data.json` under `apiBaseUrl`; source → compact tree.
|
|
532
535
|
*
|
|
533
|
-
*
|
|
536
|
+
* When SSR reads `public/` (`node-server` and similar), `serverAssets: true` also forces this copy.
|
|
537
|
+
* On Edge / function / `serveStatic: "inline"` presets, copy only when this is `true` (SSR uses the Nitro embed).
|
|
534
538
|
* @default true in premerged mode, false in source mode
|
|
535
539
|
*/
|
|
536
540
|
publicAssets?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -270,10 +270,11 @@ export interface ModuleOptions {
|
|
|
270
270
|
*/
|
|
271
271
|
additionalTranslationDirs?: string[];
|
|
272
272
|
/**
|
|
273
|
-
* Controls how translation payloads are emitted (Node: `public/<apiBaseUrl>`; Edge: Nitro `serverAssets`).
|
|
273
|
+
* Controls how translation payloads are emitted (Node server: `public/<apiBaseUrl>`; Edge / function / inline: Nitro `serverAssets`).
|
|
274
274
|
*
|
|
275
|
-
* - **Node
|
|
276
|
-
* - **Edge
|
|
275
|
+
* - **Node server** (`node-server`, `node-cluster`, disk `serveStatic`): `serverAssets` means local SSR via `readFile` under `public/` (no Rollup `raw:`).
|
|
276
|
+
* - **Edge, function presets, and `serveStatic: "inline"`** (`vercel`, `netlify`, `aws-lambda`, winterjs, …): `serverAssets` registers Nitro `serverAssets` (`assets:i18n`),
|
|
277
|
+
* because `public/` is not available to SSR on disk. Does not force a public copy — set `publicAssets: true` for CDN/static.
|
|
277
278
|
*
|
|
278
279
|
* Keep the defaults for the usual all-in-one setup. For large Edge catalogs prefer `mode: 'source'`.
|
|
279
280
|
* For CDN-backed deployments, disable local outputs and set `apiBaseClientHost` / `apiBaseServerHost`.
|
|
@@ -511,13 +512,15 @@ export interface TranslationPayloadOptions {
|
|
|
511
512
|
*/
|
|
512
513
|
mode?: 'premerged' | 'source';
|
|
513
514
|
/**
|
|
514
|
-
* Local SSR payloads: Node
|
|
515
|
+
* Local SSR payloads: a Node server that serves `public/` from disk reads that tree (forces public copy);
|
|
516
|
+
* Edge, function presets, and `serveStatic: "inline"` embed via Nitro `serverAssets`.
|
|
515
517
|
*
|
|
516
|
-
* - **Node
|
|
518
|
+
* - **Node server** (preset serves `public/` itself, e.g. `node-server`): no Nitro `serverAssets` (avoids Rollup `raw:`). SSR reads
|
|
517
519
|
* `public/<apiBaseUrl|publicDir>` as `{page}/{locale}/data.json`; when this is `true`,
|
|
518
520
|
* a public copy is forced even if `publicAssets` is false.
|
|
519
|
-
* - **Edge** (`nitro.node === false
|
|
520
|
-
*
|
|
521
|
+
* - **Edge, function presets, and inline** (`nitro.node === false`, no disk `serveStatic` such as `vercel` /
|
|
522
|
+
* `netlify` / `aws-lambda`, or `serveStatic: "inline"` e.g. winterjs): Nitro `serverAssets` (`assets:i18n`)
|
|
523
|
+
* with the same layout as `mode`. Does **not** force a public copy — set `publicAssets: true` for CDN/static.
|
|
521
524
|
* @default true
|
|
522
525
|
*/
|
|
523
526
|
serverAssets?: boolean;
|
|
@@ -530,7 +533,8 @@ export interface TranslationPayloadOptions {
|
|
|
530
533
|
/**
|
|
531
534
|
* Copy payloads into Nitro public output. Premerged → `{page}/{locale}/data.json` under `apiBaseUrl`; source → compact tree.
|
|
532
535
|
*
|
|
533
|
-
*
|
|
536
|
+
* When SSR reads `public/` (`node-server` and similar), `serverAssets: true` also forces this copy.
|
|
537
|
+
* On Edge / function / `serveStatic: "inline"` presets, copy only when this is `true` (SSR uses the Nitro embed).
|
|
534
538
|
* @default true in premerged mode, false in source mode
|
|
535
539
|
*/
|
|
536
540
|
publicAssets?: boolean;
|