@intlayer/next-intl 9.0.0-canary.3 → 9.0.0-canary.4
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/cjs/client/NextIntlClientProvider.cjs +6 -2
- package/dist/cjs/client/NextIntlClientProvider.cjs.map +1 -1
- package/dist/cjs/navigation/Link.cjs +1 -1
- package/dist/cjs/server/getLocale.cjs +15 -1
- package/dist/cjs/server/getLocale.cjs.map +1 -1
- package/dist/cjs/server/requestLocaleCache.cjs +36 -0
- package/dist/cjs/server/requestLocaleCache.cjs.map +1 -0
- package/dist/cjs/server/setRequestLocale.cjs +16 -13
- package/dist/cjs/server/setRequestLocale.cjs.map +1 -1
- package/dist/esm/client/NextIntlClientProvider.mjs +8 -3
- package/dist/esm/client/NextIntlClientProvider.mjs.map +1 -1
- package/dist/esm/navigation/Link.mjs +1 -1
- package/dist/esm/server/getLocale.mjs +15 -1
- package/dist/esm/server/getLocale.mjs.map +1 -1
- package/dist/esm/server/requestLocaleCache.mjs +33 -0
- package/dist/esm/server/requestLocaleCache.mjs.map +1 -0
- package/dist/esm/server/setRequestLocale.mjs +16 -12
- package/dist/esm/server/setRequestLocale.mjs.map +1 -1
- package/dist/types/client/NextIntlClientProvider.d.ts.map +1 -1
- package/dist/types/server/getLocale.d.ts +9 -0
- package/dist/types/server/getLocale.d.ts.map +1 -1
- package/dist/types/server/requestLocaleCache.d.ts +17 -0
- package/dist/types/server/requestLocaleCache.d.ts.map +1 -0
- package/dist/types/server/setRequestLocale.d.ts +13 -7
- package/dist/types/server/setRequestLocale.d.ts.map +1 -1
- package/package.json +11 -17
|
@@ -6,6 +6,8 @@ let _intlayer_config_built = require("@intlayer/config/built");
|
|
|
6
6
|
let next_intlayer = require("next-intlayer");
|
|
7
7
|
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
8
8
|
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
9
|
+
let _intlayer_core_localization = require("@intlayer/core/localization");
|
|
10
|
+
let next_navigation = require("next/navigation");
|
|
9
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
12
|
|
|
11
13
|
//#region src/client/NextIntlClientProvider.tsx
|
|
@@ -16,11 +18,13 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
16
18
|
*/
|
|
17
19
|
const NextIntlClientProvider = ({ locale, children, messages: _messages, timeZone: _timeZone, now: _now, ...rest }) => {
|
|
18
20
|
if (process.env.NODE_ENV === "development" && typeof _messages !== "undefined") (0, _intlayer_config_logger.getAppLogger)({ log: _intlayer_config_built.log })(`${(0, _intlayer_config_logger.colorize)("NextIntlClientProvider", _intlayer_config_colors.CYAN)} do not pass the messages prop with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`);
|
|
21
|
+
const pathname = (0, next_navigation.usePathname)();
|
|
22
|
+
const resolvedLocale = locale ?? (0, _intlayer_core_localization.getLocaleFromPath)(pathname);
|
|
19
23
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(next_intlayer.IntlayerClientProvider, {
|
|
20
|
-
locale,
|
|
24
|
+
locale: resolvedLocale,
|
|
21
25
|
...rest,
|
|
22
26
|
children
|
|
23
|
-
}, String(
|
|
27
|
+
}, String(resolvedLocale));
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextIntlClientProvider.cjs","names":["CYAN","IntlayerClientProvider"],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\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 // `key={
|
|
1
|
+
{"version":3,"file":"NextIntlClientProvider.cjs","names":["CYAN","IntlayerClientProvider"],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport { log } 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 const pathname = usePathname();\n const resolvedLocale = locale ?? getLocaleFromPath(pathname);\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;AACJ,KACE,QAAQ,IAAI,aAAa,iBACzB,OAAO,cAAc,YAGrB,2CAD+B,EAAE,iCAAK,CAC7B,CACP,yCAAY,0BAA0BA,6BAAK,CAAC,+HAC7C;CAUH,MAAM,6CAAwB;CAC9B,MAAM,iBAAiB,6DAA4B,SAAS;AAM5D,QACE,2CAACC,sCAAD;EAEE,QAAQ;EACR,GAAI;EAEH;EACsB,EALlB,OAAO,eAAe,CAKJ"}
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
5
5
|
const require_navigation_localizeHref = require('./localizeHref.cjs');
|
|
6
6
|
let next_intlayer = require("next-intlayer");
|
|
7
|
+
let react = require("react");
|
|
7
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
9
|
let next_link = require("next/link");
|
|
9
10
|
next_link = require_runtime.__toESM(next_link);
|
|
10
|
-
let react = require("react");
|
|
11
11
|
|
|
12
12
|
//#region src/navigation/Link.tsx
|
|
13
13
|
/**
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_server_requestLocaleCache = require('./requestLocaleCache.cjs');
|
|
3
4
|
let next_intlayer_server = require("next-intlayer/server");
|
|
4
5
|
|
|
5
6
|
//#region src/server/getLocale.ts
|
|
6
7
|
/**
|
|
7
8
|
* Drop-in for next-intl's `getLocale()` server function.
|
|
9
|
+
*
|
|
10
|
+
* Resolution order mirrors next-intl's per-request model:
|
|
11
|
+
*
|
|
12
|
+
* 1. The locale forwarded through `setRequestLocale(locale)` (the `[locale]`
|
|
13
|
+
* route segment) — the source of truth for URL-driven routing. This is what
|
|
14
|
+
* keeps server-rendered content and the locale switcher in sync with the URL
|
|
15
|
+
* instead of a stale cookie.
|
|
16
|
+
* 2. Otherwise Intlayer's own resolution (cookie / header / Accept-Language),
|
|
17
|
+
* for apps that drive the locale from storage rather than the route.
|
|
8
18
|
*/
|
|
9
|
-
const getLocale = async () =>
|
|
19
|
+
const getLocale = async () => {
|
|
20
|
+
const requestLocale = require_server_requestLocaleCache.getCachedRequestLocale();
|
|
21
|
+
if (requestLocale) return requestLocale;
|
|
22
|
+
return await (0, next_intlayer_server.getLocale)();
|
|
23
|
+
};
|
|
10
24
|
|
|
11
25
|
//#endregion
|
|
12
26
|
exports.getLocale = getLocale;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocale.cjs","names":[],"sources":["../../../src/server/getLocale.ts"],"sourcesContent":["import type { getLocale as _getLocale } from 'next-intl/server';\nimport { getLocale as getLocaleIntlayer } from 'next-intlayer/server';\n\n/**\n * Drop-in for next-intl's `getLocale()` server function.\n */\nexport const getLocale: typeof _getLocale = async (): Promise<string>
|
|
1
|
+
{"version":3,"file":"getLocale.cjs","names":["getCachedRequestLocale"],"sources":["../../../src/server/getLocale.ts"],"sourcesContent":["import type { getLocale as _getLocale } from 'next-intl/server';\nimport { getLocale as getLocaleIntlayer } from 'next-intlayer/server';\nimport { getCachedRequestLocale } from './requestLocaleCache';\n\n/**\n * Drop-in for next-intl's `getLocale()` server function.\n *\n * Resolution order mirrors next-intl's per-request model:\n *\n * 1. The locale forwarded through `setRequestLocale(locale)` (the `[locale]`\n * route segment) — the source of truth for URL-driven routing. This is what\n * keeps server-rendered content and the locale switcher in sync with the URL\n * instead of a stale cookie.\n * 2. Otherwise Intlayer's own resolution (cookie / header / Accept-Language),\n * for apps that drive the locale from storage rather than the route.\n */\nexport const getLocale: typeof _getLocale = async (): Promise<string> => {\n const requestLocale = getCachedRequestLocale();\n if (requestLocale) return requestLocale as string;\n\n return (await getLocaleIntlayer()) as string;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,MAAa,YAA+B,YAA6B;CACvE,MAAM,gBAAgBA,0DAAwB;AAC9C,KAAI,cAAe,QAAO;AAE1B,QAAQ,2CAAyB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let react = require("react");
|
|
4
|
+
|
|
5
|
+
//#region src/server/requestLocaleCache.ts
|
|
6
|
+
/**
|
|
7
|
+
* Request-scoped holder for the locale provided through {@link setRequestLocale}.
|
|
8
|
+
*
|
|
9
|
+
* next-intl resolves the active locale per request from the `[locale]` route
|
|
10
|
+
* segment, which the app forwards via `setRequestLocale(locale)`. React's
|
|
11
|
+
* `cache()` gives a per-request singleton (the same trick next-intl uses in its
|
|
12
|
+
* own `RequestLocaleCache`), so the value set in the layout/page is readable by
|
|
13
|
+
* the other server APIs (`getLocale`, `getTranslations`, …) during the same
|
|
14
|
+
* render.
|
|
15
|
+
*
|
|
16
|
+
* @see https://github.com/vercel/next.js/discussions/58862
|
|
17
|
+
*/
|
|
18
|
+
const getRequestLocaleHolder = (0, react.cache)(() => ({ locale: void 0 }));
|
|
19
|
+
/**
|
|
20
|
+
* Read the locale stored for the current request, or `undefined` when
|
|
21
|
+
* `setRequestLocale` has not been called.
|
|
22
|
+
*/
|
|
23
|
+
const getCachedRequestLocale = () => getRequestLocaleHolder().locale;
|
|
24
|
+
/**
|
|
25
|
+
* Store the locale for the current request. Called by `setRequestLocale`.
|
|
26
|
+
*
|
|
27
|
+
* @param locale - The locale resolved from the `[locale]` route segment.
|
|
28
|
+
*/
|
|
29
|
+
const setCachedRequestLocale = (locale) => {
|
|
30
|
+
getRequestLocaleHolder().locale = locale;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.getCachedRequestLocale = getCachedRequestLocale;
|
|
35
|
+
exports.setCachedRequestLocale = setCachedRequestLocale;
|
|
36
|
+
//# sourceMappingURL=requestLocaleCache.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestLocaleCache.cjs","names":[],"sources":["../../../src/server/requestLocaleCache.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { cache } from 'react';\n\n/**\n * Request-scoped holder for the locale provided through {@link setRequestLocale}.\n *\n * next-intl resolves the active locale per request from the `[locale]` route\n * segment, which the app forwards via `setRequestLocale(locale)`. React's\n * `cache()` gives a per-request singleton (the same trick next-intl uses in its\n * own `RequestLocaleCache`), so the value set in the layout/page is readable by\n * the other server APIs (`getLocale`, `getTranslations`, …) during the same\n * render.\n *\n * @see https://github.com/vercel/next.js/discussions/58862\n */\nconst getRequestLocaleHolder = cache((): { locale?: LocalesValues } => ({\n locale: undefined,\n}));\n\n/**\n * Read the locale stored for the current request, or `undefined` when\n * `setRequestLocale` has not been called.\n */\nexport const getCachedRequestLocale = (): LocalesValues | undefined =>\n getRequestLocaleHolder().locale;\n\n/**\n * Store the locale for the current request. Called by `setRequestLocale`.\n *\n * @param locale - The locale resolved from the `[locale]` route segment.\n */\nexport const setCachedRequestLocale = (locale: LocalesValues): void => {\n getRequestLocaleHolder().locale = locale;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAM,iDAAkE,EACtE,QAAQ,QACT,EAAE;;;;;AAMH,MAAa,+BACX,wBAAwB,CAAC;;;;;;AAO3B,MAAa,0BAA0B,WAAgC;AACrE,yBAAwB,CAAC,SAAS"}
|
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
4
|
-
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
5
|
-
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
2
|
+
const require_server_requestLocaleCache = require('./requestLocaleCache.cjs');
|
|
6
3
|
|
|
7
4
|
//#region src/server/setRequestLocale.ts
|
|
8
5
|
/**
|
|
9
6
|
* Drop-in for next-intl's `setRequestLocale`.
|
|
10
7
|
*
|
|
11
|
-
* In next-intl this stores the locale
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
8
|
+
* In next-intl this stores the locale (typically the `[locale]` route segment)
|
|
9
|
+
* in a request-scoped cache so the rest of the request can render in that
|
|
10
|
+
* locale and opt into static rendering. The compat keeps the same contract:
|
|
11
|
+
* the locale is stored per-request and read back by `getLocale()` (and, through
|
|
12
|
+
* it, `getTranslations` / `getDictionary` / metadata). This is what makes the
|
|
13
|
+
* per-request locale — and therefore the locale switcher — work without relying
|
|
14
|
+
* on a cookie.
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
17
|
-
* resolved automatically from routing / storage.
|
|
16
|
+
* @param locale - The locale resolved from the `[locale]` route segment.
|
|
18
17
|
*
|
|
19
18
|
* @example
|
|
20
19
|
* ```ts
|
|
21
|
-
*
|
|
20
|
+
* export default async function LocaleLayout({ params }) {
|
|
21
|
+
* const { locale } = await params;
|
|
22
|
+
* setRequestLocale(locale);
|
|
23
|
+
* // …
|
|
24
|
+
* }
|
|
22
25
|
* ```
|
|
23
26
|
*/
|
|
24
|
-
const setRequestLocale = (
|
|
25
|
-
|
|
27
|
+
const setRequestLocale = (locale) => {
|
|
28
|
+
require_server_requestLocaleCache.setCachedRequestLocale(locale);
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setRequestLocale.cjs","names":[
|
|
1
|
+
{"version":3,"file":"setRequestLocale.cjs","names":[],"sources":["../../../src/server/setRequestLocale.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { setRequestLocale as _setRequestLocale } from 'next-intl/server';\nimport { setCachedRequestLocale } from './requestLocaleCache';\n\n/**\n * Drop-in for next-intl's `setRequestLocale`.\n *\n * In next-intl this stores the locale (typically the `[locale]` route segment)\n * in a request-scoped cache so the rest of the request can render in that\n * locale and opt into static rendering. The compat keeps the same contract:\n * the locale is stored per-request and read back by `getLocale()` (and, through\n * it, `getTranslations` / `getDictionary` / metadata). This is what makes the\n * per-request locale — and therefore the locale switcher — work without relying\n * on a cookie.\n *\n * @param locale - The locale resolved from the `[locale]` route segment.\n *\n * @example\n * ```ts\n * export default async function LocaleLayout({ params }) {\n * const { locale } = await params;\n * setRequestLocale(locale);\n * // …\n * }\n * ```\n */\nexport const setRequestLocale: typeof _setRequestLocale = (locale): void => {\n setCachedRequestLocale(locale as LocalesValues);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,oBAA8C,WAAiB;AAC1E,0DAAuB,OAAwB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { log } from "@intlayer/config/built";
|
|
3
|
+
import { log, routing } from "@intlayer/config/built";
|
|
4
4
|
import { IntlayerClientProvider } from "next-intlayer";
|
|
5
5
|
import { CYAN } from "@intlayer/config/colors";
|
|
6
6
|
import { colorize, getAppLogger } from "@intlayer/config/logger";
|
|
7
|
+
import { getLocaleFromPath } from "@intlayer/core/localization";
|
|
8
|
+
import { usePathname } from "next/navigation";
|
|
7
9
|
import { jsx } from "react/jsx-runtime";
|
|
8
10
|
|
|
9
11
|
//#region src/client/NextIntlClientProvider.tsx
|
|
@@ -14,11 +16,14 @@ import { jsx } from "react/jsx-runtime";
|
|
|
14
16
|
*/
|
|
15
17
|
const NextIntlClientProvider = ({ locale, children, messages: _messages, timeZone: _timeZone, now: _now, ...rest }) => {
|
|
16
18
|
if (typeof _messages !== "undefined") getAppLogger({ log })(`${colorize("NextIntlClientProvider", CYAN)} do not pass the messages prop with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`);
|
|
19
|
+
const pathname = usePathname();
|
|
20
|
+
const mode = routing?.mode ?? "prefix-no-default";
|
|
21
|
+
const resolvedLocale = locale ?? (mode === "prefix-all" || mode === "prefix-no-default" ? getLocaleFromPath(pathname) : void 0);
|
|
17
22
|
return /* @__PURE__ */ jsx(IntlayerClientProvider, {
|
|
18
|
-
locale,
|
|
23
|
+
locale: resolvedLocale,
|
|
19
24
|
...rest,
|
|
20
25
|
children
|
|
21
|
-
}, String(
|
|
26
|
+
}, String(resolvedLocale));
|
|
22
27
|
};
|
|
23
28
|
|
|
24
29
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextIntlClientProvider.mjs","names":[],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\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 // `key={
|
|
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;AACJ,KAEE,OAAO,cAAc,YAGrB,CADkB,aAAa,EAAE,KAAK,CAC7B,CACP,GAAG,SAAS,0BAA0B,KAAK,CAAC,+HAC7C;CAeH,MAAM,WAAW,aAAa;CAC9B,MAAM,OAAO,SAAS,QAAQ;CAE9B,MAAM,iBACJ,WAFmB,SAAS,gBAAgB,SAAS,sBAE3B,kBAAkB,SAAS,GAAG;AAM1D,QACE,oBAAC,wBAAD;EAEE,QAAQ;EACR,GAAI;EAEH;EACsB,EALlB,OAAO,eAAe,CAKJ"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { localizeHref } from "./localizeHref.mjs";
|
|
4
4
|
import { useLocale } from "next-intlayer";
|
|
5
|
+
import { forwardRef } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
import NextLink from "next/link";
|
|
7
|
-
import { forwardRef } from "react";
|
|
8
8
|
|
|
9
9
|
//#region src/navigation/Link.tsx
|
|
10
10
|
/**
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
import { getCachedRequestLocale } from "./requestLocaleCache.mjs";
|
|
1
2
|
import { getLocale as getLocale$1 } from "next-intlayer/server";
|
|
2
3
|
|
|
3
4
|
//#region src/server/getLocale.ts
|
|
4
5
|
/**
|
|
5
6
|
* Drop-in for next-intl's `getLocale()` server function.
|
|
7
|
+
*
|
|
8
|
+
* Resolution order mirrors next-intl's per-request model:
|
|
9
|
+
*
|
|
10
|
+
* 1. The locale forwarded through `setRequestLocale(locale)` (the `[locale]`
|
|
11
|
+
* route segment) — the source of truth for URL-driven routing. This is what
|
|
12
|
+
* keeps server-rendered content and the locale switcher in sync with the URL
|
|
13
|
+
* instead of a stale cookie.
|
|
14
|
+
* 2. Otherwise Intlayer's own resolution (cookie / header / Accept-Language),
|
|
15
|
+
* for apps that drive the locale from storage rather than the route.
|
|
6
16
|
*/
|
|
7
|
-
const getLocale = async () =>
|
|
17
|
+
const getLocale = async () => {
|
|
18
|
+
const requestLocale = getCachedRequestLocale();
|
|
19
|
+
if (requestLocale) return requestLocale;
|
|
20
|
+
return await getLocale$1();
|
|
21
|
+
};
|
|
8
22
|
|
|
9
23
|
//#endregion
|
|
10
24
|
export { getLocale };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocale.mjs","names":["getLocaleIntlayer"],"sources":["../../../src/server/getLocale.ts"],"sourcesContent":["import type { getLocale as _getLocale } from 'next-intl/server';\nimport { getLocale as getLocaleIntlayer } from 'next-intlayer/server';\n\n/**\n * Drop-in for next-intl's `getLocale()` server function.\n */\nexport const getLocale: typeof _getLocale = async (): Promise<string>
|
|
1
|
+
{"version":3,"file":"getLocale.mjs","names":["getLocaleIntlayer"],"sources":["../../../src/server/getLocale.ts"],"sourcesContent":["import type { getLocale as _getLocale } from 'next-intl/server';\nimport { getLocale as getLocaleIntlayer } from 'next-intlayer/server';\nimport { getCachedRequestLocale } from './requestLocaleCache';\n\n/**\n * Drop-in for next-intl's `getLocale()` server function.\n *\n * Resolution order mirrors next-intl's per-request model:\n *\n * 1. The locale forwarded through `setRequestLocale(locale)` (the `[locale]`\n * route segment) — the source of truth for URL-driven routing. This is what\n * keeps server-rendered content and the locale switcher in sync with the URL\n * instead of a stale cookie.\n * 2. Otherwise Intlayer's own resolution (cookie / header / Accept-Language),\n * for apps that drive the locale from storage rather than the route.\n */\nexport const getLocale: typeof _getLocale = async (): Promise<string> => {\n const requestLocale = getCachedRequestLocale();\n if (requestLocale) return requestLocale as string;\n\n return (await getLocaleIntlayer()) as string;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAa,YAA+B,YAA6B;CACvE,MAAM,gBAAgB,wBAAwB;AAC9C,KAAI,cAAe,QAAO;AAE1B,QAAQ,MAAMA,aAAmB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cache } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/server/requestLocaleCache.ts
|
|
4
|
+
/**
|
|
5
|
+
* Request-scoped holder for the locale provided through {@link setRequestLocale}.
|
|
6
|
+
*
|
|
7
|
+
* next-intl resolves the active locale per request from the `[locale]` route
|
|
8
|
+
* segment, which the app forwards via `setRequestLocale(locale)`. React's
|
|
9
|
+
* `cache()` gives a per-request singleton (the same trick next-intl uses in its
|
|
10
|
+
* own `RequestLocaleCache`), so the value set in the layout/page is readable by
|
|
11
|
+
* the other server APIs (`getLocale`, `getTranslations`, …) during the same
|
|
12
|
+
* render.
|
|
13
|
+
*
|
|
14
|
+
* @see https://github.com/vercel/next.js/discussions/58862
|
|
15
|
+
*/
|
|
16
|
+
const getRequestLocaleHolder = cache(() => ({ locale: void 0 }));
|
|
17
|
+
/**
|
|
18
|
+
* Read the locale stored for the current request, or `undefined` when
|
|
19
|
+
* `setRequestLocale` has not been called.
|
|
20
|
+
*/
|
|
21
|
+
const getCachedRequestLocale = () => getRequestLocaleHolder().locale;
|
|
22
|
+
/**
|
|
23
|
+
* Store the locale for the current request. Called by `setRequestLocale`.
|
|
24
|
+
*
|
|
25
|
+
* @param locale - The locale resolved from the `[locale]` route segment.
|
|
26
|
+
*/
|
|
27
|
+
const setCachedRequestLocale = (locale) => {
|
|
28
|
+
getRequestLocaleHolder().locale = locale;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { getCachedRequestLocale, setCachedRequestLocale };
|
|
33
|
+
//# sourceMappingURL=requestLocaleCache.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestLocaleCache.mjs","names":[],"sources":["../../../src/server/requestLocaleCache.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { cache } from 'react';\n\n/**\n * Request-scoped holder for the locale provided through {@link setRequestLocale}.\n *\n * next-intl resolves the active locale per request from the `[locale]` route\n * segment, which the app forwards via `setRequestLocale(locale)`. React's\n * `cache()` gives a per-request singleton (the same trick next-intl uses in its\n * own `RequestLocaleCache`), so the value set in the layout/page is readable by\n * the other server APIs (`getLocale`, `getTranslations`, …) during the same\n * render.\n *\n * @see https://github.com/vercel/next.js/discussions/58862\n */\nconst getRequestLocaleHolder = cache((): { locale?: LocalesValues } => ({\n locale: undefined,\n}));\n\n/**\n * Read the locale stored for the current request, or `undefined` when\n * `setRequestLocale` has not been called.\n */\nexport const getCachedRequestLocale = (): LocalesValues | undefined =>\n getRequestLocaleHolder().locale;\n\n/**\n * Store the locale for the current request. Called by `setRequestLocale`.\n *\n * @param locale - The locale resolved from the `[locale]` route segment.\n */\nexport const setCachedRequestLocale = (locale: LocalesValues): void => {\n getRequestLocaleHolder().locale = locale;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,yBAAyB,aAAyC,EACtE,QAAQ,QACT,EAAE;;;;;AAMH,MAAa,+BACX,wBAAwB,CAAC;;;;;;AAO3B,MAAa,0BAA0B,WAAgC;AACrE,yBAAwB,CAAC,SAAS"}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CYAN } from "@intlayer/config/colors";
|
|
3
|
-
import { colorize, getAppLogger } from "@intlayer/config/logger";
|
|
1
|
+
import { setCachedRequestLocale } from "./requestLocaleCache.mjs";
|
|
4
2
|
|
|
5
3
|
//#region src/server/setRequestLocale.ts
|
|
6
4
|
/**
|
|
7
5
|
* Drop-in for next-intl's `setRequestLocale`.
|
|
8
6
|
*
|
|
9
|
-
* In next-intl this stores the locale
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* In next-intl this stores the locale (typically the `[locale]` route segment)
|
|
8
|
+
* in a request-scoped cache so the rest of the request can render in that
|
|
9
|
+
* locale and opt into static rendering. The compat keeps the same contract:
|
|
10
|
+
* the locale is stored per-request and read back by `getLocale()` (and, through
|
|
11
|
+
* it, `getTranslations` / `getDictionary` / metadata). This is what makes the
|
|
12
|
+
* per-request locale — and therefore the locale switcher — work without relying
|
|
13
|
+
* on a cookie.
|
|
13
14
|
*
|
|
14
|
-
* @
|
|
15
|
-
* resolved automatically from routing / storage.
|
|
15
|
+
* @param locale - The locale resolved from the `[locale]` route segment.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```ts
|
|
19
|
-
*
|
|
19
|
+
* export default async function LocaleLayout({ params }) {
|
|
20
|
+
* const { locale } = await params;
|
|
21
|
+
* setRequestLocale(locale);
|
|
22
|
+
* // …
|
|
23
|
+
* }
|
|
20
24
|
* ```
|
|
21
25
|
*/
|
|
22
|
-
const setRequestLocale = (
|
|
23
|
-
|
|
26
|
+
const setRequestLocale = (locale) => {
|
|
27
|
+
setCachedRequestLocale(locale);
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setRequestLocale.mjs","names":[],"sources":["../../../src/server/setRequestLocale.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"setRequestLocale.mjs","names":[],"sources":["../../../src/server/setRequestLocale.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { setRequestLocale as _setRequestLocale } from 'next-intl/server';\nimport { setCachedRequestLocale } from './requestLocaleCache';\n\n/**\n * Drop-in for next-intl's `setRequestLocale`.\n *\n * In next-intl this stores the locale (typically the `[locale]` route segment)\n * in a request-scoped cache so the rest of the request can render in that\n * locale and opt into static rendering. The compat keeps the same contract:\n * the locale is stored per-request and read back by `getLocale()` (and, through\n * it, `getTranslations` / `getDictionary` / metadata). This is what makes the\n * per-request locale — and therefore the locale switcher — work without relying\n * on a cookie.\n *\n * @param locale - The locale resolved from the `[locale]` route segment.\n *\n * @example\n * ```ts\n * export default async function LocaleLayout({ params }) {\n * const { locale } = await params;\n * setRequestLocale(locale);\n * // …\n * }\n * ```\n */\nexport const setRequestLocale: typeof _setRequestLocale = (locale): void => {\n setCachedRequestLocale(locale as LocalesValues);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,oBAA8C,WAAiB;AAC1E,wBAAuB,OAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextIntlClientProvider.d.ts","names":[],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"NextIntlClientProvider.d.ts","names":[],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"mappings":";;;;;;;AAiBA;;;cAAa,sBAAA,SAA+B,wBAAA;;AAsD5C;;KAAY,2BAAA,GAA8B,IAAA,CACxC,cAAA,QAAsB,wBAAA;EAAA;;;;EAOtB,QAAA;EAIqB;;;EAArB,MAAA,EAAQ,aAAA;AAAA"}
|
|
@@ -3,6 +3,15 @@ import { getLocale as getLocale$1 } from "next-intl/server";
|
|
|
3
3
|
//#region src/server/getLocale.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Drop-in for next-intl's `getLocale()` server function.
|
|
6
|
+
*
|
|
7
|
+
* Resolution order mirrors next-intl's per-request model:
|
|
8
|
+
*
|
|
9
|
+
* 1. The locale forwarded through `setRequestLocale(locale)` (the `[locale]`
|
|
10
|
+
* route segment) — the source of truth for URL-driven routing. This is what
|
|
11
|
+
* keeps server-rendered content and the locale switcher in sync with the URL
|
|
12
|
+
* instead of a stale cookie.
|
|
13
|
+
* 2. Otherwise Intlayer's own resolution (cookie / header / Accept-Language),
|
|
14
|
+
* for apps that drive the locale from storage rather than the route.
|
|
6
15
|
*/
|
|
7
16
|
declare const getLocale: typeof getLocale$1;
|
|
8
17
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocale.d.ts","names":[],"sources":["../../../src/server/getLocale.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"getLocale.d.ts","names":[],"sources":["../../../src/server/getLocale.ts"],"mappings":";;;;;AAgBA;;;;;;;;;;cAAa,SAAA,SAAkB,WAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
|
+
|
|
3
|
+
//#region src/server/requestLocaleCache.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Read the locale stored for the current request, or `undefined` when
|
|
6
|
+
* `setRequestLocale` has not been called.
|
|
7
|
+
*/
|
|
8
|
+
declare const getCachedRequestLocale: () => LocalesValues | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Store the locale for the current request. Called by `setRequestLocale`.
|
|
11
|
+
*
|
|
12
|
+
* @param locale - The locale resolved from the `[locale]` route segment.
|
|
13
|
+
*/
|
|
14
|
+
declare const setCachedRequestLocale: (locale: LocalesValues) => void;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { getCachedRequestLocale, setCachedRequestLocale };
|
|
17
|
+
//# sourceMappingURL=requestLocaleCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestLocaleCache.d.ts","names":[],"sources":["../../../src/server/requestLocaleCache.ts"],"mappings":";;;;;AAuBA;;cAAa,sBAAA,QAA6B,aAAA;;;AAQ1C;;;cAAa,sBAAA,GAA0B,MAAA,EAAQ,aAAA"}
|
|
@@ -4,17 +4,23 @@ import { setRequestLocale as setRequestLocale$1 } from "next-intl/server";
|
|
|
4
4
|
/**
|
|
5
5
|
* Drop-in for next-intl's `setRequestLocale`.
|
|
6
6
|
*
|
|
7
|
-
* In next-intl this stores the locale
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* In next-intl this stores the locale (typically the `[locale]` route segment)
|
|
8
|
+
* in a request-scoped cache so the rest of the request can render in that
|
|
9
|
+
* locale and opt into static rendering. The compat keeps the same contract:
|
|
10
|
+
* the locale is stored per-request and read back by `getLocale()` (and, through
|
|
11
|
+
* it, `getTranslations` / `getDictionary` / metadata). This is what makes the
|
|
12
|
+
* per-request locale — and therefore the locale switcher — work without relying
|
|
13
|
+
* on a cookie.
|
|
11
14
|
*
|
|
12
|
-
* @
|
|
13
|
-
* resolved automatically from routing / storage.
|
|
15
|
+
* @param locale - The locale resolved from the `[locale]` route segment.
|
|
14
16
|
*
|
|
15
17
|
* @example
|
|
16
18
|
* ```ts
|
|
17
|
-
*
|
|
19
|
+
* export default async function LocaleLayout({ params }) {
|
|
20
|
+
* const { locale } = await params;
|
|
21
|
+
* setRequestLocale(locale);
|
|
22
|
+
* // …
|
|
23
|
+
* }
|
|
18
24
|
* ```
|
|
19
25
|
*/
|
|
20
26
|
declare const setRequestLocale: typeof setRequestLocale$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setRequestLocale.d.ts","names":[],"sources":["../../../src/server/setRequestLocale.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"setRequestLocale.d.ts","names":[],"sources":["../../../src/server/setRequestLocale.ts"],"mappings":";;;;;AA0BA;;;;;;;;;;;;;;;;;;;;cAAa,gBAAA,SAAyB,kBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/next-intl",
|
|
3
|
-
"version": "9.0.0-canary.
|
|
3
|
+
"version": "9.0.0-canary.4",
|
|
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": [
|
|
@@ -36,37 +36,31 @@
|
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
38
|
"types": "./dist/types/index.d.ts",
|
|
39
|
-
"require": "./dist/cjs/index.cjs",
|
|
40
39
|
"import": "./dist/esm/index.mjs"
|
|
41
40
|
},
|
|
42
41
|
"./server": {
|
|
43
42
|
"types": "./dist/types/server/index.d.ts",
|
|
44
|
-
"require": "./dist/cjs/server/index.cjs",
|
|
45
43
|
"import": "./dist/esm/server/index.mjs"
|
|
46
44
|
},
|
|
47
45
|
"./routing": {
|
|
48
46
|
"types": "./dist/types/routing.d.ts",
|
|
49
|
-
"require": "./dist/cjs/routing.cjs",
|
|
50
47
|
"import": "./dist/esm/routing.mjs"
|
|
51
48
|
},
|
|
52
49
|
"./navigation": {
|
|
53
50
|
"types": "./dist/types/navigation/index.d.ts",
|
|
54
|
-
"require": "./dist/cjs/navigation/index.cjs",
|
|
55
51
|
"import": "./dist/esm/navigation/index.mjs"
|
|
56
52
|
},
|
|
57
53
|
"./middleware": {
|
|
58
54
|
"types": "./dist/types/middleware.d.ts",
|
|
59
|
-
"require": "./dist/cjs/middleware.cjs",
|
|
60
55
|
"import": "./dist/esm/middleware.mjs"
|
|
61
56
|
},
|
|
62
57
|
"./plugin": {
|
|
63
58
|
"types": "./dist/types/plugin/index.d.ts",
|
|
64
|
-
"require": "./dist/cjs/plugin/index.cjs",
|
|
65
59
|
"import": "./dist/esm/plugin/index.mjs"
|
|
66
60
|
},
|
|
67
61
|
"./package.json": "./package.json"
|
|
68
62
|
},
|
|
69
|
-
"main": "dist/
|
|
63
|
+
"main": "dist/esm/index.mjs",
|
|
70
64
|
"module": "dist/esm/index.mjs",
|
|
71
65
|
"types": "dist/types/index.d.ts",
|
|
72
66
|
"typesVersions": {
|
|
@@ -110,17 +104,17 @@
|
|
|
110
104
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
111
105
|
},
|
|
112
106
|
"dependencies": {
|
|
113
|
-
"@intlayer/chokidar": "9.0.0-canary.
|
|
114
|
-
"@intlayer/config": "9.0.0-canary.
|
|
115
|
-
"@intlayer/core": "9.0.0-canary.
|
|
116
|
-
"@intlayer/dictionaries-entry": "9.0.0-canary.
|
|
117
|
-
"@intlayer/types": "9.0.0-canary.
|
|
118
|
-
"@intlayer/use-intl": "9.0.0-canary.
|
|
119
|
-
"next-intlayer": "9.0.0-canary.
|
|
120
|
-
"react-intlayer": "9.0.0-canary.
|
|
107
|
+
"@intlayer/chokidar": "9.0.0-canary.4",
|
|
108
|
+
"@intlayer/config": "9.0.0-canary.4",
|
|
109
|
+
"@intlayer/core": "9.0.0-canary.4",
|
|
110
|
+
"@intlayer/dictionaries-entry": "9.0.0-canary.4",
|
|
111
|
+
"@intlayer/types": "9.0.0-canary.4",
|
|
112
|
+
"@intlayer/use-intl": "9.0.0-canary.4",
|
|
113
|
+
"next-intlayer": "9.0.0-canary.4",
|
|
114
|
+
"react-intlayer": "9.0.0-canary.4"
|
|
121
115
|
},
|
|
122
116
|
"devDependencies": {
|
|
123
|
-
"@types/node": "25.9.
|
|
117
|
+
"@types/node": "25.9.4",
|
|
124
118
|
"@types/react": "19.2.17",
|
|
125
119
|
"@utils/ts-config": "1.0.4",
|
|
126
120
|
"@utils/ts-config-types": "1.0.4",
|