@i18n-micro/types 1.2.16 → 1.2.18

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
@@ -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**: `serverAssets` means local SSR via `readFile` under `public/` (no Rollup `raw:`).
276
- * - **Edge**: `serverAssets` registers Nitro `serverAssets` (`assets:i18n`); it does not force a public copy.
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 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`.
515
517
  *
516
- * - **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
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`): Nitro `serverAssets` (`assets:i18n`) with the same
520
- * 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.
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
- * 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).
534
538
  * @default true in premerged mode, false in source mode
535
539
  */
536
540
  publicAssets?: boolean;
@@ -583,6 +587,11 @@ export interface ModuleOptionsExtend extends ModuleOptions {
583
587
  export interface ModulePrivateOptionsExtend extends ModuleOptions {
584
588
  /** Absolute path to the Nuxt project root directory. */
585
589
  rootDir: string;
590
+ /**
591
+ * Absolute Nuxt layer roots in merge order (extends first, project last).
592
+ * Used by live/HMR translation reads so layers match build-time merge.
593
+ */
594
+ rootDirs: string[];
586
595
  /** Resolved debug flag. */
587
596
  debug: boolean;
588
597
  /** Resolved path to the translations directory. */
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**: `serverAssets` means local SSR via `readFile` under `public/` (no Rollup `raw:`).
276
- * - **Edge**: `serverAssets` registers Nitro `serverAssets` (`assets:i18n`); it does not force a public copy.
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 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`.
515
517
  *
516
- * - **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
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`): Nitro `serverAssets` (`assets:i18n`) with the same
520
- * 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.
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
- * 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).
534
538
  * @default true in premerged mode, false in source mode
535
539
  */
536
540
  publicAssets?: boolean;
@@ -583,6 +587,11 @@ export interface ModuleOptionsExtend extends ModuleOptions {
583
587
  export interface ModulePrivateOptionsExtend extends ModuleOptions {
584
588
  /** Absolute path to the Nuxt project root directory. */
585
589
  rootDir: string;
590
+ /**
591
+ * Absolute Nuxt layer roots in merge order (extends first, project last).
592
+ * Used by live/HMR translation reads so layers match build-time merge.
593
+ */
594
+ rootDirs: string[];
586
595
  /** Resolved debug flag. */
587
596
  debug: boolean;
588
597
  /** Resolved path to the translations directory. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i18n-micro/types",
3
- "version": "1.2.16",
3
+ "version": "1.2.18",
4
4
  "description": "TypeScript definitions for the Nuxt I18n Micro ecosystem.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -51,9 +51,9 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "publint": "^0.3.24",
54
- "vite": "^8.2.2",
55
- "vite-plugin-dts": "^5.1.0",
56
- "vitest": "^4.1.11"
54
+ "vite": "^8.3.1",
55
+ "vite-plugin-dts": "^5.1.1",
56
+ "vitest": "^5.0.2"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=18"