@i18n-micro/types 1.2.15 → 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 +23 -8
- package/dist/index.d.ts +23 -8
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -259,10 +259,22 @@ export interface ModuleOptions {
|
|
|
259
259
|
*/
|
|
260
260
|
translationDir?: string;
|
|
261
261
|
/**
|
|
262
|
-
*
|
|
262
|
+
* Extra directories (relative to the project root / each Nuxt layer root) whose top-level
|
|
263
|
+
* `{locale}.json` files are deep-merged into the global dictionary before `translationDir`.
|
|
263
264
|
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
265
|
+
* Merge order: each entry in array order (across layers), then `translationDir` (wins on conflicts).
|
|
266
|
+
* Only root `{locale}.json` files are read — `pages/` under these dirs is ignored.
|
|
267
|
+
*
|
|
268
|
+
* Example: `translationDir: 'frontend'`, `additionalTranslationDirs: ['common']` → `common/en.json` then `frontend/en.json`.
|
|
269
|
+
* @default []
|
|
270
|
+
*/
|
|
271
|
+
additionalTranslationDirs?: string[];
|
|
272
|
+
/**
|
|
273
|
+
* Controls how translation payloads are emitted (Node server: `public/<apiBaseUrl>`; Edge / function / inline: Nitro `serverAssets`).
|
|
274
|
+
*
|
|
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.
|
|
266
278
|
*
|
|
267
279
|
* Keep the defaults for the usual all-in-one setup. For large Edge catalogs prefer `mode: 'source'`.
|
|
268
280
|
* For CDN-backed deployments, disable local outputs and set `apiBaseClientHost` / `apiBaseServerHost`.
|
|
@@ -500,13 +512,15 @@ export interface TranslationPayloadOptions {
|
|
|
500
512
|
*/
|
|
501
513
|
mode?: 'premerged' | 'source';
|
|
502
514
|
/**
|
|
503
|
-
* 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`.
|
|
504
517
|
*
|
|
505
|
-
* - **Node
|
|
518
|
+
* - **Node server** (preset serves `public/` itself, e.g. `node-server`): no Nitro `serverAssets` (avoids Rollup `raw:`). SSR reads
|
|
506
519
|
* `public/<apiBaseUrl|publicDir>` as `{page}/{locale}/data.json`; when this is `true`,
|
|
507
520
|
* a public copy is forced even if `publicAssets` is false.
|
|
508
|
-
* - **Edge** (`nitro.node === false
|
|
509
|
-
*
|
|
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.
|
|
510
524
|
* @default true
|
|
511
525
|
*/
|
|
512
526
|
serverAssets?: boolean;
|
|
@@ -519,7 +533,8 @@ export interface TranslationPayloadOptions {
|
|
|
519
533
|
/**
|
|
520
534
|
* Copy payloads into Nitro public output. Premerged → `{page}/{locale}/data.json` under `apiBaseUrl`; source → compact tree.
|
|
521
535
|
*
|
|
522
|
-
*
|
|
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).
|
|
523
538
|
* @default true in premerged mode, false in source mode
|
|
524
539
|
*/
|
|
525
540
|
publicAssets?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -259,10 +259,22 @@ export interface ModuleOptions {
|
|
|
259
259
|
*/
|
|
260
260
|
translationDir?: string;
|
|
261
261
|
/**
|
|
262
|
-
*
|
|
262
|
+
* Extra directories (relative to the project root / each Nuxt layer root) whose top-level
|
|
263
|
+
* `{locale}.json` files are deep-merged into the global dictionary before `translationDir`.
|
|
263
264
|
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
265
|
+
* Merge order: each entry in array order (across layers), then `translationDir` (wins on conflicts).
|
|
266
|
+
* Only root `{locale}.json` files are read — `pages/` under these dirs is ignored.
|
|
267
|
+
*
|
|
268
|
+
* Example: `translationDir: 'frontend'`, `additionalTranslationDirs: ['common']` → `common/en.json` then `frontend/en.json`.
|
|
269
|
+
* @default []
|
|
270
|
+
*/
|
|
271
|
+
additionalTranslationDirs?: string[];
|
|
272
|
+
/**
|
|
273
|
+
* Controls how translation payloads are emitted (Node server: `public/<apiBaseUrl>`; Edge / function / inline: Nitro `serverAssets`).
|
|
274
|
+
*
|
|
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.
|
|
266
278
|
*
|
|
267
279
|
* Keep the defaults for the usual all-in-one setup. For large Edge catalogs prefer `mode: 'source'`.
|
|
268
280
|
* For CDN-backed deployments, disable local outputs and set `apiBaseClientHost` / `apiBaseServerHost`.
|
|
@@ -500,13 +512,15 @@ export interface TranslationPayloadOptions {
|
|
|
500
512
|
*/
|
|
501
513
|
mode?: 'premerged' | 'source';
|
|
502
514
|
/**
|
|
503
|
-
* 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`.
|
|
504
517
|
*
|
|
505
|
-
* - **Node
|
|
518
|
+
* - **Node server** (preset serves `public/` itself, e.g. `node-server`): no Nitro `serverAssets` (avoids Rollup `raw:`). SSR reads
|
|
506
519
|
* `public/<apiBaseUrl|publicDir>` as `{page}/{locale}/data.json`; when this is `true`,
|
|
507
520
|
* a public copy is forced even if `publicAssets` is false.
|
|
508
|
-
* - **Edge** (`nitro.node === false
|
|
509
|
-
*
|
|
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.
|
|
510
524
|
* @default true
|
|
511
525
|
*/
|
|
512
526
|
serverAssets?: boolean;
|
|
@@ -519,7 +533,8 @@ export interface TranslationPayloadOptions {
|
|
|
519
533
|
/**
|
|
520
534
|
* Copy payloads into Nitro public output. Premerged → `{page}/{locale}/data.json` under `apiBaseUrl`; source → compact tree.
|
|
521
535
|
*
|
|
522
|
-
*
|
|
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).
|
|
523
538
|
* @default true in premerged mode, false in source mode
|
|
524
539
|
*/
|
|
525
540
|
publicAssets?: boolean;
|