@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 CHANGED
@@ -259,10 +259,22 @@ export interface ModuleOptions {
259
259
  */
260
260
  translationDir?: string;
261
261
  /**
262
- * Controls how translation payloads are emitted (Node: `public/<apiBaseUrl>`; Edge: Nitro `serverAssets`).
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
- * - **Node**: `serverAssets` means local SSR via `readFile` under `public/` (no Rollup `raw:`).
265
- * - **Edge**: `serverAssets` registers Nitro `serverAssets` (`assets:i18n`); it does not force a public copy.
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 reads `public/<apiBaseUrl>` (forces public copy); Edge embeds via Nitro `serverAssets`.
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**: no Nitro `serverAssets` (avoids Rollup `raw:`). SSR reads
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`): Nitro `serverAssets` (`assets:i18n`) with the same
509
- * layout as `mode`. Does **not** force a public copy — set `publicAssets: true` for CDN.
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
- * On Node this tree is also the SSR source when `serverAssets` forces a public copy.
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
- * Controls how translation payloads are emitted (Node: `public/<apiBaseUrl>`; Edge: Nitro `serverAssets`).
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
- * - **Node**: `serverAssets` means local SSR via `readFile` under `public/` (no Rollup `raw:`).
265
- * - **Edge**: `serverAssets` registers Nitro `serverAssets` (`assets:i18n`); it does not force a public copy.
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 reads `public/<apiBaseUrl>` (forces public copy); Edge embeds via Nitro `serverAssets`.
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**: no Nitro `serverAssets` (avoids Rollup `raw:`). SSR reads
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`): Nitro `serverAssets` (`assets:i18n`) with the same
509
- * layout as `mode`. Does **not** force a public copy — set `publicAssets: true` for CDN.
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
- * On Node this tree is also the SSR source when `serverAssets` forces a public copy.
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i18n-micro/types",
3
- "version": "1.2.15",
3
+ "version": "1.2.17",
4
4
  "description": "TypeScript definitions for the Nuxt I18n Micro ecosystem.",
5
5
  "keywords": [
6
6
  "i18n",