@intlayer/next-i18next 9.5.11 → 9.6.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"serverSideTranslations.cjs","names":["getAppLogger","colorize","CYAN"],"sources":["../../src/serverSideTranslations.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\n\n/**\n * Drop-in replacement for next-i18next's `serverSideTranslations`.\n *\n * In next-i18next this function loads translation JSON files and injects\n * them as `_nextI18Next` props so `useTranslation` can hydrate on the client.\n *\n * With Intlayer all dictionaries are compiled at build time so no runtime\n * loading is needed. This function returns the minimal shape expected by\n * `appWithTranslation` / `useTranslation` for drop-in compatibility.\n *\n * @deprecated serverSideTranslations has no use case with intlayer.\n * Dictionaries are compiled at build time and loaded automatically.\n *\n * @param locale - The active locale (e.g. from `getStaticProps` context).\n * @param namespacesRequired - Namespace list; recorded but not loaded.\n * @param configOverride - Config override; recorded but not applied.\n *\n * @example\n * ```ts\n * export const getStaticProps = async ({ locale }) => ({\n * props: {\n * ...(await serverSideTranslations(locale, ['common'])),\n * },\n * });\n * ```\n */\nexport const serverSideTranslations = async (\n locale: string,\n namespacesRequired?: string[],\n configOverride?: Record<string, unknown>\n): Promise<{ _nextI18Next: Record<string, unknown> }> => {\n if (process.env.NODE_ENV === 'development') {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('serverSideTranslations', CYAN)} has no use case with intlayer. Dictionaries are compiled at build time and loaded automatically under the hood.`\n );\n }\n\n return {\n _nextI18Next: {\n initialLocale: locale,\n initialI18nStore: {},\n ns: namespacesRequired ?? ['common'],\n userConfig: configOverride ?? null,\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,yBAAyB,OACpC,QACA,oBACA,mBACuD;CACvD,IAAI,QAAQ,IAAI,aAAa,eAE3B,IADkBA,sCAAa,EAAE,gCAAI,CAC7B,CAAC,CACP,OAAGC,kCAAS,0BAA0BC,4BAAI,EAAE,iHAC9C;CAGF,OAAO,EACL,cAAc;EACZ,eAAe;EACf,kBAAkB,CAAC;EACnB,IAAI,sBAAsB,CAAC,QAAQ;EACnC,YAAY,kBAAkB;CAChC,EACF;AACF"}
1
+ {"version":3,"file":"serverSideTranslations.cjs","names":["getAppLogger","colorize","CYAN"],"sources":["../../src/serverSideTranslations.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\n\n/**\n * Drop-in replacement for next-i18next's `serverSideTranslations`.\n *\n * In next-i18next this function loads translation JSON files and injects\n * them as `_nextI18Next` props so `useTranslation` can hydrate on the client.\n *\n * With Intlayer all dictionaries are compiled at build time so no runtime\n * loading is needed. This function returns the minimal shape expected by\n * `appWithTranslation` / `useTranslation` for drop-in compatibility.\n *\n * @deprecated serverSideTranslations has no use case with intlayer.\n * Dictionaries are compiled at build time and loaded automatically.\n *\n * @param locale - The active locale (e.g. from `getStaticProps` context).\n * @param namespacesRequired - Namespace list; recorded but not loaded.\n * @param configOverride - Config override; recorded but not applied.\n *\n * @example\n * ```ts\n * export const getStaticProps = async ({ locale }) => ({\n * props: {\n * ...(await serverSideTranslations(locale, ['common'])),\n * },\n * });\n * ```\n */\nexport const serverSideTranslations = async (\n locale: string,\n namespacesRequired?: string[],\n configOverride?: Record<string, unknown>\n): Promise<{ _nextI18Next: Record<string, unknown> }> => {\n if (process.env.NODE_ENV === 'development') {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('serverSideTranslations', CYAN)} has no use case with intlayer. Dictionaries are compiled at build time and loaded automatically under the hood.`\n );\n }\n\n return {\n _nextI18Next: {\n initialLocale: locale,\n initialI18nStore: {},\n ns: namespacesRequired ?? ['common'],\n userConfig: configOverride ?? null,\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,yBAAyB,OACpC,QACA,oBACA,mBACuD;CACvD,6BAA6B,eAE3B,IADkBA,sCAAa,EAAE,gCAAI,CAC7B,CAAC,CACP,OAAGC,kCAAS,0BAA0BC,4BAAI,EAAE,iHAC9C;CAGF,OAAO,EACL,cAAc;EACZ,eAAe;EACf,kBAAkB,CAAC;EACnB,IAAI,sBAAsB,CAAC,QAAQ;EACnC,YAAY,kBAAkB;CAChC,EACF;AACF"}
@@ -30,7 +30,7 @@ import { colorize, getAppLogger } from "@intlayer/config/logger";
30
30
  * ```
31
31
  */
32
32
  const serverSideTranslations = async (locale, namespacesRequired, configOverride) => {
33
- getAppLogger({ log })(`${colorize("serverSideTranslations", CYAN)} has no use case with intlayer. Dictionaries are compiled at build time and loaded automatically under the hood.`);
33
+ if (process.env.NODE_ENV === "development") getAppLogger({ log })(`${colorize("serverSideTranslations", CYAN)} has no use case with intlayer. Dictionaries are compiled at build time and loaded automatically under the hood.`);
34
34
  return { _nextI18Next: {
35
35
  initialLocale: locale,
36
36
  initialI18nStore: {},
@@ -1 +1 @@
1
- {"version":3,"file":"serverSideTranslations.mjs","names":[],"sources":["../../src/serverSideTranslations.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\n\n/**\n * Drop-in replacement for next-i18next's `serverSideTranslations`.\n *\n * In next-i18next this function loads translation JSON files and injects\n * them as `_nextI18Next` props so `useTranslation` can hydrate on the client.\n *\n * With Intlayer all dictionaries are compiled at build time so no runtime\n * loading is needed. This function returns the minimal shape expected by\n * `appWithTranslation` / `useTranslation` for drop-in compatibility.\n *\n * @deprecated serverSideTranslations has no use case with intlayer.\n * Dictionaries are compiled at build time and loaded automatically.\n *\n * @param locale - The active locale (e.g. from `getStaticProps` context).\n * @param namespacesRequired - Namespace list; recorded but not loaded.\n * @param configOverride - Config override; recorded but not applied.\n *\n * @example\n * ```ts\n * export const getStaticProps = async ({ locale }) => ({\n * props: {\n * ...(await serverSideTranslations(locale, ['common'])),\n * },\n * });\n * ```\n */\nexport const serverSideTranslations = async (\n locale: string,\n namespacesRequired?: string[],\n configOverride?: Record<string, unknown>\n): Promise<{ _nextI18Next: Record<string, unknown> }> => {\n if (process.env.NODE_ENV === 'development') {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('serverSideTranslations', CYAN)} has no use case with intlayer. Dictionaries are compiled at build time and loaded automatically under the hood.`\n );\n }\n\n return {\n _nextI18Next: {\n initialLocale: locale,\n initialI18nStore: {},\n ns: namespacesRequired ?? ['common'],\n userConfig: configOverride ?? null,\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,yBAAyB,OACpC,QACA,oBACA,mBACuD;CAGrD,AADkB,aAAa,EAAE,IAAI,CAC7B,CAAC,CACP,GAAG,SAAS,0BAA0B,IAAI,EAAE,iHAC9C;CAGF,OAAO,EACL,cAAc;EACZ,eAAe;EACf,kBAAkB,CAAC;EACnB,IAAI,sBAAsB,CAAC,QAAQ;EACnC,YAAY,kBAAkB;CAChC,EACF;AACF"}
1
+ {"version":3,"file":"serverSideTranslations.mjs","names":[],"sources":["../../src/serverSideTranslations.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\n\n/**\n * Drop-in replacement for next-i18next's `serverSideTranslations`.\n *\n * In next-i18next this function loads translation JSON files and injects\n * them as `_nextI18Next` props so `useTranslation` can hydrate on the client.\n *\n * With Intlayer all dictionaries are compiled at build time so no runtime\n * loading is needed. This function returns the minimal shape expected by\n * `appWithTranslation` / `useTranslation` for drop-in compatibility.\n *\n * @deprecated serverSideTranslations has no use case with intlayer.\n * Dictionaries are compiled at build time and loaded automatically.\n *\n * @param locale - The active locale (e.g. from `getStaticProps` context).\n * @param namespacesRequired - Namespace list; recorded but not loaded.\n * @param configOverride - Config override; recorded but not applied.\n *\n * @example\n * ```ts\n * export const getStaticProps = async ({ locale }) => ({\n * props: {\n * ...(await serverSideTranslations(locale, ['common'])),\n * },\n * });\n * ```\n */\nexport const serverSideTranslations = async (\n locale: string,\n namespacesRequired?: string[],\n configOverride?: Record<string, unknown>\n): Promise<{ _nextI18Next: Record<string, unknown> }> => {\n if (process.env.NODE_ENV === 'development') {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('serverSideTranslations', CYAN)} has no use case with intlayer. Dictionaries are compiled at build time and loaded automatically under the hood.`\n );\n }\n\n return {\n _nextI18Next: {\n initialLocale: locale,\n initialI18nStore: {},\n ns: namespacesRequired ?? ['common'],\n userConfig: configOverride ?? null,\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,yBAAyB,OACpC,QACA,oBACA,mBACuD;CACvD,6BAA6B,eAE3B,AADkB,aAAa,EAAE,IAAI,CAC7B,CAAC,CACP,GAAG,SAAS,0BAA0B,IAAI,EAAE,iHAC9C;CAGF,OAAO,EACL,cAAc;EACZ,eAAe;EACf,kBAAkB,CAAC;EACnB,IAAI,sBAAsB,CAAC,QAAQ;EACnC,YAAY,kBAAkB;CAChC,EACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/next-i18next",
3
- "version": "9.5.11",
3
+ "version": "9.6.0",
4
4
  "private": false,
5
5
  "description": "next-i18next API adapter for intlayer — serverSideTranslations, appWithTranslation, useTranslation backed by next-intlayer",
6
6
  "keywords": [
@@ -80,14 +80,14 @@
80
80
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
81
81
  },
82
82
  "dependencies": {
83
- "@intlayer/config": "9.5.11",
84
- "@intlayer/core": "9.5.11",
85
- "@intlayer/engine": "9.5.11",
86
- "@intlayer/i18next": "9.5.11",
87
- "@intlayer/react-i18next": "9.5.11",
88
- "@intlayer/types": "9.5.11",
89
- "next-intlayer": "9.5.11",
90
- "react-intlayer": "9.5.11"
83
+ "@intlayer/config": "9.6.0",
84
+ "@intlayer/core": "9.6.0",
85
+ "@intlayer/engine": "9.6.0",
86
+ "@intlayer/i18next": "9.6.0",
87
+ "@intlayer/react-i18next": "9.6.0",
88
+ "@intlayer/types": "9.6.0",
89
+ "next-intlayer": "9.6.0",
90
+ "react-intlayer": "9.6.0"
91
91
  },
92
92
  "devDependencies": {
93
93
  "@types/node": "^22",
@@ -101,7 +101,7 @@
101
101
  "rimraf": "6.1.3",
102
102
  "tsdown": "0.23.0",
103
103
  "typescript": "7.0.2",
104
- "vitest": "5.0.2"
104
+ "vitest": "5.0.3"
105
105
  },
106
106
  "peerDependencies": {
107
107
  "i18next": ">=20.0.0",