@intlayer/next-intl 9.5.1 → 9.5.2

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.
@@ -20,7 +20,7 @@ const NextIntlClientProvider = ({ locale, children, messages: _messages, timeZon
20
20
  const pathname = (0, next_navigation.usePathname)();
21
21
  const mode = _intlayer_config_built.routing?.mode ?? "prefix-no-default";
22
22
  const resolvedLocale = locale ?? (mode === "prefix-all" || mode === "prefix-no-default" ? (0, _intlayer_core_localization.getLocaleFromPath)(pathname) : void 0);
23
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(next_intlayer.IntlayerClientProvider, {
23
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(next_intlayer.IntlayerProvider, {
24
24
  locale: resolvedLocale,
25
25
  ...rest,
26
26
  children
@@ -1 +1 @@
1
- {"version":3,"file":"NextIntlClientProvider.cjs","names":["getAppLogger","colorize","CYAN","usePathname","routing","getLocaleFromPath","IntlayerClientProvider"],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport { log, routing } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getLocaleFromPath } from '@intlayer/core/localization';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { usePathname } from 'next/navigation';\nimport type { NextIntlClientProvider as _NextIntlClientProvider } from 'next-intl';\nimport { IntlayerClientProvider } from 'next-intlayer';\nimport type { ComponentProps } from 'react';\n\n/**\n * Drop-in for next-intl's `NextIntlClientProvider`.\n * `messages`, `timeZone`, and `now` are accepted for API compatibility\n * but have no effect — Intlayer uses its own compiled dictionaries.\n */\nexport const NextIntlClientProvider: typeof _NextIntlClientProvider = ({\n locale,\n children,\n messages: _messages,\n timeZone: _timeZone,\n now: _now,\n ...rest\n}) => {\n if (\n process.env.NODE_ENV === 'development' &&\n typeof _messages !== 'undefined'\n ) {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('NextIntlClientProvider', CYAN)} do not pass the messages prop with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`\n );\n }\n\n // next-intl drives the locale from the request: apps render\n // `<NextIntlClientProvider>` without a `locale` prop and the server resolves it\n // from the `[locale]` route segment. As a client component we cannot read the\n // server request here, so when no explicit `locale` is given we derive it from\n // the URL (the same `[locale]` segment) using Intlayer's routing config. This\n // keeps `useLocale`, `Link` and the locale switcher in sync with the URL\n // instead of falling back to the stored cookie / default locale.\n //\n // Only prefix-based routing carries the locale in the path. For `no-prefix` /\n // `search-params` the path has no locale segment, so we leave `locale`\n // undefined and let the provider resolve it from storage (cookie) — deriving\n // from the path there would wrongly clobber the cookie with the default locale.\n const pathname = usePathname();\n const mode = routing?.mode ?? 'prefix-no-default';\n const isPrefixMode = mode === 'prefix-all' || mode === 'prefix-no-default';\n const resolvedLocale =\n locale ?? (isPrefixMode ? getLocaleFromPath(pathname) : undefined);\n\n // `key={resolvedLocale}` remounts the provider when the locale changes via\n // navigation (next-intl switches locale by routing to a locale-prefixed path).\n // This re-seeds the client locale context so client components re-render in\n // the new language instead of keeping the previous one.\n return (\n <IntlayerClientProvider\n key={String(resolvedLocale)}\n locale={resolvedLocale}\n {...rest}\n >\n {children}\n </IntlayerClientProvider>\n );\n};\n\n/**\n *\n */\nexport type NextIntlClientProviderProps = Omit<\n ComponentProps<typeof _NextIntlClientProvider>,\n 'messages'\n> & {\n /**\n * @deprecated\n * has no use case with intlayer. Messages are loaded automatically under the hood for bundle optimization reason\n */\n messages?: never;\n /**\n * locale\n */\n locale: LocalesValues;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAa,0BAA0D,EACrE,QACA,UACA,UAAU,WACV,UAAU,WACV,KAAK,MACL,GAAG,WACC;CACJ,IACE,QAAQ,IAAI,aAAa,iBACzB,OAAO,cAAc,aAGrB,IADkBA,sCAAa,EAAE,gCAAI,CAC7B,CAAC,CACP,OAAGC,kCAAS,0BAA0BC,4BAAI,EAAE,8HAC9C;CAeF,MAAM,eAAWC,6BAAY;CAC7B,MAAM,OAAOC,gCAAS,QAAQ;CAE9B,MAAM,iBACJ,WAFmB,SAAS,gBAAgB,SAAS,0BAE3BC,+CAAkB,QAAQ,IAAI;CAM1D,OACE,2CAACC,sCAAD;EAEE,QAAQ;EACR,GAAI;EAEH;CACqB,GALjB,OAAO,cAAc,CAKJ;AAE5B"}
1
+ {"version":3,"file":"NextIntlClientProvider.cjs","names":["getAppLogger","colorize","CYAN","usePathname","routing","getLocaleFromPath","IntlayerProvider"],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport { log, routing } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getLocaleFromPath } from '@intlayer/core/localization';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { usePathname } from 'next/navigation';\nimport type { NextIntlClientProvider as _NextIntlClientProvider } from 'next-intl';\nimport { IntlayerProvider } from 'next-intlayer';\nimport type { ComponentProps } from 'react';\n\n/**\n * Drop-in for next-intl's `NextIntlClientProvider`.\n * `messages`, `timeZone`, and `now` are accepted for API compatibility\n * but have no effect — Intlayer uses its own compiled dictionaries.\n */\nexport const NextIntlClientProvider: typeof _NextIntlClientProvider = ({\n locale,\n children,\n messages: _messages,\n timeZone: _timeZone,\n now: _now,\n ...rest\n}) => {\n if (\n process.env.NODE_ENV === 'development' &&\n typeof _messages !== 'undefined'\n ) {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('NextIntlClientProvider', CYAN)} do not pass the messages prop with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`\n );\n }\n\n // next-intl drives the locale from the request: apps render\n // `<NextIntlClientProvider>` without a `locale` prop and the server resolves it\n // from the `[locale]` route segment. As a client component we cannot read the\n // server request here, so when no explicit `locale` is given we derive it from\n // the URL (the same `[locale]` segment) using Intlayer's routing config. This\n // keeps `useLocale`, `Link` and the locale switcher in sync with the URL\n // instead of falling back to the stored cookie / default locale.\n //\n // Only prefix-based routing carries the locale in the path. For `no-prefix` /\n // `search-params` the path has no locale segment, so we leave `locale`\n // undefined and let the provider resolve it from storage (cookie) — deriving\n // from the path there would wrongly clobber the cookie with the default locale.\n const pathname = usePathname();\n const mode = routing?.mode ?? 'prefix-no-default';\n const isPrefixMode = mode === 'prefix-all' || mode === 'prefix-no-default';\n const resolvedLocale =\n locale ?? (isPrefixMode ? getLocaleFromPath(pathname) : undefined);\n\n // `key={resolvedLocale}` remounts the provider when the locale changes via\n // navigation (next-intl switches locale by routing to a locale-prefixed path).\n // This re-seeds the client locale context so client components re-render in\n // the new language instead of keeping the previous one.\n return (\n <IntlayerProvider\n key={String(resolvedLocale)}\n locale={resolvedLocale}\n {...rest}\n >\n {children}\n </IntlayerProvider>\n );\n};\n\n/**\n *\n */\nexport type NextIntlClientProviderProps = Omit<\n ComponentProps<typeof _NextIntlClientProvider>,\n 'messages'\n> & {\n /**\n * @deprecated\n * has no use case with intlayer. Messages are loaded automatically under the hood for bundle optimization reason\n */\n messages?: never;\n /**\n * locale\n */\n locale: LocalesValues;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAa,0BAA0D,EACrE,QACA,UACA,UAAU,WACV,UAAU,WACV,KAAK,MACL,GAAG,WACC;CACJ,IACE,QAAQ,IAAI,aAAa,iBACzB,OAAO,cAAc,aAGrB,IADkBA,sCAAa,EAAE,gCAAI,CAC7B,CAAC,CACP,OAAGC,kCAAS,0BAA0BC,4BAAI,EAAE,8HAC9C;CAeF,MAAM,eAAWC,6BAAY;CAC7B,MAAM,OAAOC,gCAAS,QAAQ;CAE9B,MAAM,iBACJ,WAFmB,SAAS,gBAAgB,SAAS,0BAE3BC,+CAAkB,QAAQ,IAAI;CAM1D,OACE,2CAACC,gCAAD;EAEE,QAAQ;EACR,GAAI;EAEH;CACe,GALX,OAAO,cAAc,CAKV;AAEtB"}
@@ -0,0 +1,28 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _intlayer_config_built = require("@intlayer/config/built");
3
+ let _intlayer_config_colors = require("@intlayer/config/colors");
4
+ let _intlayer_config_logger = require("@intlayer/config/logger");
5
+
6
+ //#region src/warnUnsupported.ts
7
+ /**
8
+ * Warns, in development only, that a `next-intl` API is a no-op under the
9
+ * intlayer adapter.
10
+ *
11
+ * The `NODE_ENV` check is what keeps `@intlayer/config`'s logger and its ANSI
12
+ * colour table — around 6 KB — out of production bundles: with the branch
13
+ * folded away nothing references the imports any more and they are shaken out.
14
+ * That only works while `process.env.NODE_ENV` survives this package's own
15
+ * build and reaches the consuming app's bundler, which is why `tsdown.config.ts`
16
+ * pins `platform: 'neutral'`.
17
+ *
18
+ * @param api - Name of the shimmed `next-intl` export, e.g. `getMessages`.
19
+ * @param reason - What the developer should do instead.
20
+ */
21
+ const warnUnsupported = (api, reason) => {
22
+ if (process.env.NODE_ENV !== "development") return;
23
+ (0, _intlayer_config_logger.getAppLogger)({ log: _intlayer_config_built.log })(`${(0, _intlayer_config_logger.colorize)(api, _intlayer_config_colors.CYAN)} ${reason}`);
24
+ };
25
+
26
+ //#endregion
27
+ exports.warnUnsupported = warnUnsupported;
28
+ //# sourceMappingURL=warnUnsupported.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warnUnsupported.cjs","names":["colorize","CYAN"],"sources":["../../src/warnUnsupported.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\n\n/**\n * Warns, in development only, that a `next-intl` API is a no-op under the\n * intlayer adapter.\n *\n * The `NODE_ENV` check is what keeps `@intlayer/config`'s logger and its ANSI\n * colour table — around 6 KB — out of production bundles: with the branch\n * folded away nothing references the imports any more and they are shaken out.\n * That only works while `process.env.NODE_ENV` survives this package's own\n * build and reaches the consuming app's bundler, which is why `tsdown.config.ts`\n * pins `platform: 'neutral'`.\n *\n * @param api - Name of the shimmed `next-intl` export, e.g. `getMessages`.\n * @param reason - What the developer should do instead.\n */\nexport const warnUnsupported = (api: string, reason: string): void => {\n if (process.env.NODE_ENV !== 'development') return;\n\n getAppLogger({ log })(`${colorize(api, CYAN)} ${reason}`);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,mBAAmB,KAAa,WAAyB;CACpE,IAAI,QAAQ,IAAI,aAAa,eAAe;CAE5C,0CAAa,EAAE,gCAAI,CAAC,CAAC,CAAC,OAAGA,kCAAS,KAAKC,4BAAI,EAAE,GAAG,QAAQ;AAC1D"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { log, routing } from "@intlayer/config/built";
4
- import { IntlayerClientProvider } from "next-intlayer";
4
+ import { IntlayerProvider } from "next-intlayer";
5
5
  import { CYAN } from "@intlayer/config/colors";
6
6
  import { colorize, getAppLogger } from "@intlayer/config/logger";
7
7
  import { getLocaleFromPath } from "@intlayer/core/localization";
@@ -19,7 +19,7 @@ const NextIntlClientProvider = ({ locale, children, messages: _messages, timeZon
19
19
  const pathname = usePathname();
20
20
  const mode = routing?.mode ?? "prefix-no-default";
21
21
  const resolvedLocale = locale ?? (mode === "prefix-all" || mode === "prefix-no-default" ? getLocaleFromPath(pathname) : void 0);
22
- return /* @__PURE__ */ jsx(IntlayerClientProvider, {
22
+ return /* @__PURE__ */ jsx(IntlayerProvider, {
23
23
  locale: resolvedLocale,
24
24
  ...rest,
25
25
  children
@@ -1 +1 @@
1
- {"version":3,"file":"NextIntlClientProvider.mjs","names":[],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport { log, routing } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getLocaleFromPath } from '@intlayer/core/localization';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { usePathname } from 'next/navigation';\nimport type { NextIntlClientProvider as _NextIntlClientProvider } from 'next-intl';\nimport { IntlayerClientProvider } from 'next-intlayer';\nimport type { ComponentProps } from 'react';\n\n/**\n * Drop-in for next-intl's `NextIntlClientProvider`.\n * `messages`, `timeZone`, and `now` are accepted for API compatibility\n * but have no effect — Intlayer uses its own compiled dictionaries.\n */\nexport const NextIntlClientProvider: typeof _NextIntlClientProvider = ({\n locale,\n children,\n messages: _messages,\n timeZone: _timeZone,\n now: _now,\n ...rest\n}) => {\n if (\n process.env.NODE_ENV === 'development' &&\n typeof _messages !== 'undefined'\n ) {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('NextIntlClientProvider', CYAN)} do not pass the messages prop with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`\n );\n }\n\n // next-intl drives the locale from the request: apps render\n // `<NextIntlClientProvider>` without a `locale` prop and the server resolves it\n // from the `[locale]` route segment. As a client component we cannot read the\n // server request here, so when no explicit `locale` is given we derive it from\n // the URL (the same `[locale]` segment) using Intlayer's routing config. This\n // keeps `useLocale`, `Link` and the locale switcher in sync with the URL\n // instead of falling back to the stored cookie / default locale.\n //\n // Only prefix-based routing carries the locale in the path. For `no-prefix` /\n // `search-params` the path has no locale segment, so we leave `locale`\n // undefined and let the provider resolve it from storage (cookie) — deriving\n // from the path there would wrongly clobber the cookie with the default locale.\n const pathname = usePathname();\n const mode = routing?.mode ?? 'prefix-no-default';\n const isPrefixMode = mode === 'prefix-all' || mode === 'prefix-no-default';\n const resolvedLocale =\n locale ?? (isPrefixMode ? getLocaleFromPath(pathname) : undefined);\n\n // `key={resolvedLocale}` remounts the provider when the locale changes via\n // navigation (next-intl switches locale by routing to a locale-prefixed path).\n // This re-seeds the client locale context so client components re-render in\n // the new language instead of keeping the previous one.\n return (\n <IntlayerClientProvider\n key={String(resolvedLocale)}\n locale={resolvedLocale}\n {...rest}\n >\n {children}\n </IntlayerClientProvider>\n );\n};\n\n/**\n *\n */\nexport type NextIntlClientProviderProps = Omit<\n ComponentProps<typeof _NextIntlClientProvider>,\n 'messages'\n> & {\n /**\n * @deprecated\n * has no use case with intlayer. Messages are loaded automatically under the hood for bundle optimization reason\n */\n messages?: never;\n /**\n * locale\n */\n locale: LocalesValues;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAa,0BAA0D,EACrE,QACA,UACA,UAAU,WACV,UAAU,WACV,KAAK,MACL,GAAG,WACC;CACJ,IAEE,OAAO,cAAc,aAGrB,AADkB,aAAa,EAAE,IAAI,CAC7B,CAAC,CACP,GAAG,SAAS,0BAA0B,IAAI,EAAE,8HAC9C;CAeF,MAAM,WAAW,YAAY;CAC7B,MAAM,OAAO,SAAS,QAAQ;CAE9B,MAAM,iBACJ,WAFmB,SAAS,gBAAgB,SAAS,sBAE3B,kBAAkB,QAAQ,IAAI;CAM1D,OACE,oBAAC,wBAAD;EAEE,QAAQ;EACR,GAAI;EAEH;CACqB,GALjB,OAAO,cAAc,CAKJ;AAE5B"}
1
+ {"version":3,"file":"NextIntlClientProvider.mjs","names":[],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport { log, routing } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { getLocaleFromPath } from '@intlayer/core/localization';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { usePathname } from 'next/navigation';\nimport type { NextIntlClientProvider as _NextIntlClientProvider } from 'next-intl';\nimport { IntlayerProvider } from 'next-intlayer';\nimport type { ComponentProps } from 'react';\n\n/**\n * Drop-in for next-intl's `NextIntlClientProvider`.\n * `messages`, `timeZone`, and `now` are accepted for API compatibility\n * but have no effect — Intlayer uses its own compiled dictionaries.\n */\nexport const NextIntlClientProvider: typeof _NextIntlClientProvider = ({\n locale,\n children,\n messages: _messages,\n timeZone: _timeZone,\n now: _now,\n ...rest\n}) => {\n if (\n process.env.NODE_ENV === 'development' &&\n typeof _messages !== 'undefined'\n ) {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('NextIntlClientProvider', CYAN)} do not pass the messages prop with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`\n );\n }\n\n // next-intl drives the locale from the request: apps render\n // `<NextIntlClientProvider>` without a `locale` prop and the server resolves it\n // from the `[locale]` route segment. As a client component we cannot read the\n // server request here, so when no explicit `locale` is given we derive it from\n // the URL (the same `[locale]` segment) using Intlayer's routing config. This\n // keeps `useLocale`, `Link` and the locale switcher in sync with the URL\n // instead of falling back to the stored cookie / default locale.\n //\n // Only prefix-based routing carries the locale in the path. For `no-prefix` /\n // `search-params` the path has no locale segment, so we leave `locale`\n // undefined and let the provider resolve it from storage (cookie) — deriving\n // from the path there would wrongly clobber the cookie with the default locale.\n const pathname = usePathname();\n const mode = routing?.mode ?? 'prefix-no-default';\n const isPrefixMode = mode === 'prefix-all' || mode === 'prefix-no-default';\n const resolvedLocale =\n locale ?? (isPrefixMode ? getLocaleFromPath(pathname) : undefined);\n\n // `key={resolvedLocale}` remounts the provider when the locale changes via\n // navigation (next-intl switches locale by routing to a locale-prefixed path).\n // This re-seeds the client locale context so client components re-render in\n // the new language instead of keeping the previous one.\n return (\n <IntlayerProvider\n key={String(resolvedLocale)}\n locale={resolvedLocale}\n {...rest}\n >\n {children}\n </IntlayerProvider>\n );\n};\n\n/**\n *\n */\nexport type NextIntlClientProviderProps = Omit<\n ComponentProps<typeof _NextIntlClientProvider>,\n 'messages'\n> & {\n /**\n * @deprecated\n * has no use case with intlayer. Messages are loaded automatically under the hood for bundle optimization reason\n */\n messages?: never;\n /**\n * locale\n */\n locale: LocalesValues;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAa,0BAA0D,EACrE,QACA,UACA,UAAU,WACV,UAAU,WACV,KAAK,MACL,GAAG,WACC;CACJ,IAEE,OAAO,cAAc,aAGrB,AADkB,aAAa,EAAE,IAAI,CAC7B,CAAC,CACP,GAAG,SAAS,0BAA0B,IAAI,EAAE,8HAC9C;CAeF,MAAM,WAAW,YAAY;CAC7B,MAAM,OAAO,SAAS,QAAQ;CAE9B,MAAM,iBACJ,WAFmB,SAAS,gBAAgB,SAAS,sBAE3B,kBAAkB,QAAQ,IAAI;CAM1D,OACE,oBAAC,kBAAD;EAEE,QAAQ;EACR,GAAI;EAEH;CACe,GALX,OAAO,cAAc,CAKV;AAEtB"}
@@ -0,0 +1,27 @@
1
+ import { log } from "@intlayer/config/built";
2
+ import { CYAN } from "@intlayer/config/colors";
3
+ import { colorize, getAppLogger } from "@intlayer/config/logger";
4
+
5
+ //#region src/warnUnsupported.ts
6
+ /**
7
+ * Warns, in development only, that a `next-intl` API is a no-op under the
8
+ * intlayer adapter.
9
+ *
10
+ * The `NODE_ENV` check is what keeps `@intlayer/config`'s logger and its ANSI
11
+ * colour table — around 6 KB — out of production bundles: with the branch
12
+ * folded away nothing references the imports any more and they are shaken out.
13
+ * That only works while `process.env.NODE_ENV` survives this package's own
14
+ * build and reaches the consuming app's bundler, which is why `tsdown.config.ts`
15
+ * pins `platform: 'neutral'`.
16
+ *
17
+ * @param api - Name of the shimmed `next-intl` export, e.g. `getMessages`.
18
+ * @param reason - What the developer should do instead.
19
+ */
20
+ const warnUnsupported = (api, reason) => {
21
+ if (process.env.NODE_ENV !== "development") return;
22
+ getAppLogger({ log })(`${colorize(api, CYAN)} ${reason}`);
23
+ };
24
+
25
+ //#endregion
26
+ export { warnUnsupported };
27
+ //# sourceMappingURL=warnUnsupported.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warnUnsupported.mjs","names":[],"sources":["../../src/warnUnsupported.ts"],"sourcesContent":["import { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\n\n/**\n * Warns, in development only, that a `next-intl` API is a no-op under the\n * intlayer adapter.\n *\n * The `NODE_ENV` check is what keeps `@intlayer/config`'s logger and its ANSI\n * colour table — around 6 KB — out of production bundles: with the branch\n * folded away nothing references the imports any more and they are shaken out.\n * That only works while `process.env.NODE_ENV` survives this package's own\n * build and reaches the consuming app's bundler, which is why `tsdown.config.ts`\n * pins `platform: 'neutral'`.\n *\n * @param api - Name of the shimmed `next-intl` export, e.g. `getMessages`.\n * @param reason - What the developer should do instead.\n */\nexport const warnUnsupported = (api: string, reason: string): void => {\n if (process.env.NODE_ENV !== 'development') return;\n\n getAppLogger({ log })(`${colorize(api, CYAN)} ${reason}`);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,MAAa,mBAAmB,KAAa,WAAyB;CACpE,IAAI,QAAQ,IAAI,aAAa,eAAe;CAE5C,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS,KAAK,IAAI,EAAE,GAAG,QAAQ;AAC1D"}
@@ -0,0 +1,18 @@
1
+ //#region src/warnUnsupported.d.ts
2
+ /**
3
+ * Warns, in development only, that a `next-intl` API is a no-op under the
4
+ * intlayer adapter.
5
+ *
6
+ * The `NODE_ENV` check is what keeps `@intlayer/config`'s logger and its ANSI
7
+ * colour table — around 6 KB — out of production bundles: with the branch
8
+ * folded away nothing references the imports any more and they are shaken out.
9
+ * That only works while `process.env.NODE_ENV` survives this package's own
10
+ * build and reaches the consuming app's bundler, which is why `tsdown.config.ts`
11
+ * pins `platform: 'neutral'`.
12
+ *
13
+ * @param api - Name of the shimmed `next-intl` export, e.g. `getMessages`.
14
+ * @param reason - What the developer should do instead.
15
+ */
16
+ export declare const warnUnsupported: (api: string, reason: string) => void;
17
+ //#endregion
18
+ //# sourceMappingURL=warnUnsupported.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warnUnsupported.d.ts","names":[],"sources":["../../src/warnUnsupported.ts"],"mappings":";;;;;;;;;;;;;;;qBAkBa,kBAAe,aAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/next-intl",
3
- "version": "9.5.1",
3
+ "version": "9.5.2",
4
4
  "private": false,
5
5
  "description": "next-intl API adapter for intlayer — useTranslations, useLocale, getTranslations, getLocale, NextIntlClientProvider backed by next-intlayer",
6
6
  "keywords": [
@@ -111,18 +111,18 @@
111
111
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
112
112
  },
113
113
  "dependencies": {
114
- "@intlayer/config": "9.5.1",
115
- "@intlayer/core": "9.5.1",
116
- "@intlayer/dictionaries-entry": "9.5.1",
117
- "@intlayer/engine": "9.5.1",
118
- "@intlayer/types": "9.5.1",
119
- "@intlayer/use-intl": "9.5.1",
120
- "next-intlayer": "9.5.1",
121
- "react-intlayer": "9.5.1"
114
+ "@intlayer/config": "9.5.2",
115
+ "@intlayer/core": "9.5.2",
116
+ "@intlayer/dictionaries-entry": "9.5.2",
117
+ "@intlayer/engine": "9.5.2",
118
+ "@intlayer/types": "9.5.2",
119
+ "@intlayer/use-intl": "9.5.2",
120
+ "next-intlayer": "9.5.2",
121
+ "react-intlayer": "9.5.2"
122
122
  },
123
123
  "devDependencies": {
124
- "@types/node": "26.5.0",
125
- "@types/react": "19.2.18",
124
+ "@types/node": "^22",
125
+ "@types/react": "19.3.0",
126
126
  "@utils/ts-config": "1.0.4",
127
127
  "@utils/ts-config-types": "1.0.4",
128
128
  "@utils/tsdown-config": "1.0.4",