@entifix/next-i18n 0.1.0-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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 r10c Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ export * from './with-locale.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './with-locale.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './with-locale.js';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB"}
@@ -0,0 +1,48 @@
1
+ import { type Locale } from '@entifix/core';
2
+ import type { Namespace } from 'i18next';
3
+ /**
4
+ * The locale the middleware resolved for this request.
5
+ *
6
+ * Read from a header rather than a route param — that is the trade the rewrite
7
+ * strategy makes, and it is why the back-office route trees have no
8
+ * `app/[locale]` segment. Falls back to the fleet default for paths the
9
+ * middleware matcher skips (`/api/health`, `/api/config`), which have no
10
+ * user-facing copy anyway.
11
+ *
12
+ * A header is a **dynamic** request input, so a page that calls this — or
13
+ * {@link getServerT}, which does — can never be prerendered. That is the right
14
+ * trade for an auth-gated app whose every response is personal anyway, and the
15
+ * wrong one for a public storefront: marketplace-app therefore carries a real
16
+ * `[locale]` segment and reads its locale from the route param, through
17
+ * {@link getServerTFor}.
18
+ */
19
+ export declare function getRequestLocale(): Promise<Locale>;
20
+ /**
21
+ * The request-free counterpart of {@link getServerT}, for a locale the caller
22
+ * already holds — a route param, typically.
23
+ *
24
+ * Re-exported rather than defined here so it sits next to `getServerT` at an
25
+ * app's call sites while still being reachable from packages that may not
26
+ * depend on this one: `layer:shell` forbids same-layer edges, and the
27
+ * storefront shell is precisely the caller that needs it. The implementation
28
+ * lives in `@entifix/i18n`.
29
+ */
30
+ export { getServerTFor } from '@entifix/i18n';
31
+ /**
32
+ * A translate function for a server component. A fresh instance per request,
33
+ * because a module-level singleton would let one visitor's locale leak into
34
+ * another's markup under concurrent rendering.
35
+ */
36
+ export declare function getServerT<N extends Namespace>(ns?: N): Promise<import("i18next").TFunction<"translation" | (N extends null ? "translation" : N), undefined>>;
37
+ export type TranslateKey = (key: string, params?: Record<string, unknown>) => string;
38
+ /**
39
+ * The server counterpart of the controls package's `useTranslateKey`: resolves
40
+ * keys that are only known at runtime — nav labels held in a route table, an
41
+ * entity's `labelKey`.
42
+ *
43
+ * Separate from {@link getServerT}, which stays strict. This is the one place
44
+ * the typed-key guarantee is traded away on the server, and authored copy must
45
+ * keep going through `getServerT` so a typo stays a compile error.
46
+ */
47
+ export declare function getServerTranslateKey<N extends Namespace>(ns?: N): Promise<TranslateKey>;
48
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,MAAM,EAEZ,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAGxD;AAED;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,yGAG3D;AAED,MAAM,MAAM,YAAY,GAAG,CACzB,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,MAAM,CAAC;AAEZ;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,CAAC,SAAS,SAAS,EAC7D,EAAE,CAAC,EAAE,CAAC,GACL,OAAO,CAAC,YAAY,CAAC,CAGvB"}
package/dist/server.js ADDED
@@ -0,0 +1,54 @@
1
+ import { DEFAULT_LOCALE, isLocale, LOCALE_HEADER } from '@entifix/core';
2
+ import { createI18n } from '@entifix/i18n';
3
+ import { headers } from 'next/headers';
4
+ /**
5
+ * The locale the middleware resolved for this request.
6
+ *
7
+ * Read from a header rather than a route param — that is the trade the rewrite
8
+ * strategy makes, and it is why the back-office route trees have no
9
+ * `app/[locale]` segment. Falls back to the fleet default for paths the
10
+ * middleware matcher skips (`/api/health`, `/api/config`), which have no
11
+ * user-facing copy anyway.
12
+ *
13
+ * A header is a **dynamic** request input, so a page that calls this — or
14
+ * {@link getServerT}, which does — can never be prerendered. That is the right
15
+ * trade for an auth-gated app whose every response is personal anyway, and the
16
+ * wrong one for a public storefront: marketplace-app therefore carries a real
17
+ * `[locale]` segment and reads its locale from the route param, through
18
+ * {@link getServerTFor}.
19
+ */ export async function getRequestLocale() {
20
+ const value = (await headers()).get(LOCALE_HEADER);
21
+ return isLocale(value) ? value : DEFAULT_LOCALE;
22
+ }
23
+ /**
24
+ * The request-free counterpart of {@link getServerT}, for a locale the caller
25
+ * already holds — a route param, typically.
26
+ *
27
+ * Re-exported rather than defined here so it sits next to `getServerT` at an
28
+ * app's call sites while still being reachable from packages that may not
29
+ * depend on this one: `layer:shell` forbids same-layer edges, and the
30
+ * storefront shell is precisely the caller that needs it. The implementation
31
+ * lives in `@entifix/i18n`.
32
+ */ export { getServerTFor } from '@entifix/i18n';
33
+ /**
34
+ * A translate function for a server component. A fresh instance per request,
35
+ * because a module-level singleton would let one visitor's locale leak into
36
+ * another's markup under concurrent rendering.
37
+ */ export async function getServerT(ns) {
38
+ const locale = await getRequestLocale();
39
+ return createI18n(locale).getFixedT(locale, ns != null ? ns : null);
40
+ }
41
+ /**
42
+ * The server counterpart of the controls package's `useTranslateKey`: resolves
43
+ * keys that are only known at runtime — nav labels held in a route table, an
44
+ * entity's `labelKey`.
45
+ *
46
+ * Separate from {@link getServerT}, which stays strict. This is the one place
47
+ * the typed-key guarantee is traded away on the server, and authored copy must
48
+ * keep going through `getServerT` so a typo stays a compile error.
49
+ */ export async function getServerTranslateKey(ns) {
50
+ const t = await getServerT(ns);
51
+ return t;
52
+ }
53
+
54
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/server.ts"],"sourcesContent":["import {\n DEFAULT_LOCALE,\n isLocale,\n type Locale,\n LOCALE_HEADER,\n} from '@entifix/core';\nimport { createI18n } from '@entifix/i18n';\nimport type { Namespace } from 'i18next';\nimport { headers } from 'next/headers';\n\n/**\n * The locale the middleware resolved for this request.\n *\n * Read from a header rather than a route param — that is the trade the rewrite\n * strategy makes, and it is why the back-office route trees have no\n * `app/[locale]` segment. Falls back to the fleet default for paths the\n * middleware matcher skips (`/api/health`, `/api/config`), which have no\n * user-facing copy anyway.\n *\n * A header is a **dynamic** request input, so a page that calls this — or\n * {@link getServerT}, which does — can never be prerendered. That is the right\n * trade for an auth-gated app whose every response is personal anyway, and the\n * wrong one for a public storefront: marketplace-app therefore carries a real\n * `[locale]` segment and reads its locale from the route param, through\n * {@link getServerTFor}.\n */\nexport async function getRequestLocale(): Promise<Locale> {\n const value = (await headers()).get(LOCALE_HEADER);\n return isLocale(value) ? value : DEFAULT_LOCALE;\n}\n\n/**\n * The request-free counterpart of {@link getServerT}, for a locale the caller\n * already holds — a route param, typically.\n *\n * Re-exported rather than defined here so it sits next to `getServerT` at an\n * app's call sites while still being reachable from packages that may not\n * depend on this one: `layer:shell` forbids same-layer edges, and the\n * storefront shell is precisely the caller that needs it. The implementation\n * lives in `@entifix/i18n`.\n */\nexport { getServerTFor } from '@entifix/i18n';\n\n/**\n * A translate function for a server component. A fresh instance per request,\n * because a module-level singleton would let one visitor's locale leak into\n * another's markup under concurrent rendering.\n */\nexport async function getServerT<N extends Namespace>(ns?: N) {\n const locale = await getRequestLocale();\n return createI18n(locale).getFixedT(locale, ns ?? null);\n}\n\nexport type TranslateKey = (\n key: string,\n params?: Record<string, unknown>,\n) => string;\n\n/**\n * The server counterpart of the controls package's `useTranslateKey`: resolves\n * keys that are only known at runtime — nav labels held in a route table, an\n * entity's `labelKey`.\n *\n * Separate from {@link getServerT}, which stays strict. This is the one place\n * the typed-key guarantee is traded away on the server, and authored copy must\n * keep going through `getServerT` so a typo stays a compile error.\n */\nexport async function getServerTranslateKey<N extends Namespace>(\n ns?: N,\n): Promise<TranslateKey> {\n const t = await getServerT(ns);\n return t as unknown as TranslateKey;\n}\n"],"names":["DEFAULT_LOCALE","isLocale","LOCALE_HEADER","createI18n","headers","getRequestLocale","value","get","getServerTFor","getServerT","ns","locale","getFixedT","getServerTranslateKey","t"],"mappings":"AAAA,SACEA,cAAc,EACdC,QAAQ,EAERC,aAAa,QACR,gBAAgB;AACvB,SAASC,UAAU,QAAQ,gBAAgB;AAE3C,SAASC,OAAO,QAAQ,eAAe;AAEvC;;;;;;;;;;;;;;;CAeC,GACD,OAAO,eAAeC;IACpB,MAAMC,QAAQ,AAAC,CAAA,MAAMF,SAAQ,EAAGG,GAAG,CAACL;IACpC,OAAOD,SAASK,SAASA,QAAQN;AACnC;AAEA;;;;;;;;;CASC,GACD,SAASQ,aAAa,QAAQ,gBAAgB;AAE9C;;;;CAIC,GACD,OAAO,eAAeC,WAAgCC,EAAM;IAC1D,MAAMC,SAAS,MAAMN;IACrB,OAAOF,WAAWQ,QAAQC,SAAS,CAACD,QAAQD,aAAAA,KAAM;AACpD;AAOA;;;;;;;;CAQC,GACD,OAAO,eAAeG,sBACpBH,EAAM;IAEN,MAAMI,IAAI,MAAML,WAAWC;IAC3B,OAAOI;AACT"}
@@ -0,0 +1,43 @@
1
+ import { type Locale } from '@entifix/core';
2
+ import { type NextRequest, NextResponse } from 'next/server';
3
+ export interface LocaleResolution {
4
+ readonly locale: Locale;
5
+ /** The path with its locale segment removed — what the route tree matches on. */
6
+ readonly pathname: string;
7
+ /**
8
+ * Set when the request must be bounced to a prefixed URL first. The caller
9
+ * returns it immediately and skips every other gate: there is nothing to
10
+ * authorize about a URL the visitor is not going to stay on.
11
+ */
12
+ readonly redirect?: NextResponse;
13
+ }
14
+ /**
15
+ * Resolves the locale for one request, and rewrites the path so the rest of the
16
+ * app never sees the prefix.
17
+ *
18
+ * Two cases:
19
+ * - **unprefixed** (`/catalog`) — negotiate from cookie then `Accept-Language`,
20
+ * and redirect to `/<locale>/catalog`. The locale is always visible in the
21
+ * URL, so a page can be shared or bookmarked in the language it was read in.
22
+ * - **prefixed** (`/es/catalog`) — take the locale from the segment and hand
23
+ * back `/catalog`, which the caller rewrites to.
24
+ *
25
+ * A rewrite rather than an `app/[locale]` segment: these apps are dynamic and
26
+ * auth-gated, so a real route segment would buy nothing and cost a `locale`
27
+ * param threaded through every page in three apps.
28
+ */
29
+ export declare function resolveLocale(request: NextRequest): LocaleResolution;
30
+ /**
31
+ * Carries the resolved locale to the app: a request header the server
32
+ * components read, and a cookie so the next unprefixed visit skips negotiation.
33
+ * Host-scoped, matching `entifix_at`/`entifix_sid`, so the choice follows the visitor
34
+ * across the fleet's ports in dev.
35
+ */
36
+ export declare function rememberLocale(response: NextResponse, locale: Locale): void;
37
+ /**
38
+ * Rewrites a prefixed request onto the unprefixed route tree, tagging it with
39
+ * the locale header. Callers that need to run their own gates first can build
40
+ * this themselves from {@link resolveLocale}.
41
+ */
42
+ export declare function rewriteToLocale(request: NextRequest, resolution: LocaleResolution): NextResponse;
43
+ //# sourceMappingURL=with-locale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-locale.d.ts","sourceRoot":"","sources":["../src/with-locale.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;CAClC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,gBAAgB,CAmBpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,gBAAgB,GAC3B,YAAY,CAWd"}
@@ -0,0 +1,70 @@
1
+ import { LOCALE_COOKIE, LOCALE_HEADER, localeHref, negotiateLocale, splitLocalePath } from '@entifix/core';
2
+ import { NextResponse } from 'next/server';
3
+ /**
4
+ * Resolves the locale for one request, and rewrites the path so the rest of the
5
+ * app never sees the prefix.
6
+ *
7
+ * Two cases:
8
+ * - **unprefixed** (`/catalog`) — negotiate from cookie then `Accept-Language`,
9
+ * and redirect to `/<locale>/catalog`. The locale is always visible in the
10
+ * URL, so a page can be shared or bookmarked in the language it was read in.
11
+ * - **prefixed** (`/es/catalog`) — take the locale from the segment and hand
12
+ * back `/catalog`, which the caller rewrites to.
13
+ *
14
+ * A rewrite rather than an `app/[locale]` segment: these apps are dynamic and
15
+ * auth-gated, so a real route segment would buy nothing and cost a `locale`
16
+ * param threaded through every page in three apps.
17
+ */ export function resolveLocale(request) {
18
+ var _ref;
19
+ var _request_cookies_get;
20
+ const { locale: fromPath, rest } = splitLocalePath(request.nextUrl.pathname);
21
+ if (fromPath !== undefined) {
22
+ return {
23
+ locale: fromPath,
24
+ pathname: rest
25
+ };
26
+ }
27
+ const locale = negotiateLocale({
28
+ cookie: (_ref = (_request_cookies_get = request.cookies.get(LOCALE_COOKIE)) == null ? void 0 : _request_cookies_get.value) != null ? _ref : null,
29
+ acceptLanguage: request.headers.get('accept-language')
30
+ });
31
+ const target = request.nextUrl.clone();
32
+ target.pathname = localeHref(locale, request.nextUrl.pathname);
33
+ const redirect = NextResponse.redirect(target);
34
+ rememberLocale(redirect, locale);
35
+ return {
36
+ locale,
37
+ pathname: request.nextUrl.pathname,
38
+ redirect
39
+ };
40
+ }
41
+ /**
42
+ * Carries the resolved locale to the app: a request header the server
43
+ * components read, and a cookie so the next unprefixed visit skips negotiation.
44
+ * Host-scoped, matching `entifix_at`/`entifix_sid`, so the choice follows the visitor
45
+ * across the fleet's ports in dev.
46
+ */ export function rememberLocale(response, locale) {
47
+ response.cookies.set(LOCALE_COOKIE, locale, {
48
+ path: '/',
49
+ sameSite: 'lax'
50
+ });
51
+ }
52
+ /**
53
+ * Rewrites a prefixed request onto the unprefixed route tree, tagging it with
54
+ * the locale header. Callers that need to run their own gates first can build
55
+ * this themselves from {@link resolveLocale}.
56
+ */ export function rewriteToLocale(request, resolution) {
57
+ const target = request.nextUrl.clone();
58
+ target.pathname = resolution.pathname;
59
+ const headers = new Headers(request.headers);
60
+ headers.set(LOCALE_HEADER, resolution.locale);
61
+ const response = NextResponse.rewrite(target, {
62
+ request: {
63
+ headers
64
+ }
65
+ });
66
+ rememberLocale(response, resolution.locale);
67
+ return response;
68
+ }
69
+
70
+ //# sourceMappingURL=with-locale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-locale.ts"],"sourcesContent":["import {\n type Locale,\n LOCALE_COOKIE,\n LOCALE_HEADER,\n localeHref,\n negotiateLocale,\n splitLocalePath,\n} from '@entifix/core';\nimport { type NextRequest, NextResponse } from 'next/server';\n\nexport interface LocaleResolution {\n readonly locale: Locale;\n /** The path with its locale segment removed — what the route tree matches on. */\n readonly pathname: string;\n /**\n * Set when the request must be bounced to a prefixed URL first. The caller\n * returns it immediately and skips every other gate: there is nothing to\n * authorize about a URL the visitor is not going to stay on.\n */\n readonly redirect?: NextResponse;\n}\n\n/**\n * Resolves the locale for one request, and rewrites the path so the rest of the\n * app never sees the prefix.\n *\n * Two cases:\n * - **unprefixed** (`/catalog`) — negotiate from cookie then `Accept-Language`,\n * and redirect to `/<locale>/catalog`. The locale is always visible in the\n * URL, so a page can be shared or bookmarked in the language it was read in.\n * - **prefixed** (`/es/catalog`) — take the locale from the segment and hand\n * back `/catalog`, which the caller rewrites to.\n *\n * A rewrite rather than an `app/[locale]` segment: these apps are dynamic and\n * auth-gated, so a real route segment would buy nothing and cost a `locale`\n * param threaded through every page in three apps.\n */\nexport function resolveLocale(request: NextRequest): LocaleResolution {\n const { locale: fromPath, rest } = splitLocalePath(request.nextUrl.pathname);\n\n if (fromPath !== undefined) {\n return { locale: fromPath, pathname: rest };\n }\n\n const locale = negotiateLocale({\n cookie: request.cookies.get(LOCALE_COOKIE)?.value ?? null,\n acceptLanguage: request.headers.get('accept-language'),\n });\n\n const target = request.nextUrl.clone();\n target.pathname = localeHref(locale, request.nextUrl.pathname);\n\n const redirect = NextResponse.redirect(target);\n rememberLocale(redirect, locale);\n\n return { locale, pathname: request.nextUrl.pathname, redirect };\n}\n\n/**\n * Carries the resolved locale to the app: a request header the server\n * components read, and a cookie so the next unprefixed visit skips negotiation.\n * Host-scoped, matching `entifix_at`/`entifix_sid`, so the choice follows the visitor\n * across the fleet's ports in dev.\n */\nexport function rememberLocale(response: NextResponse, locale: Locale): void {\n response.cookies.set(LOCALE_COOKIE, locale, { path: '/', sameSite: 'lax' });\n}\n\n/**\n * Rewrites a prefixed request onto the unprefixed route tree, tagging it with\n * the locale header. Callers that need to run their own gates first can build\n * this themselves from {@link resolveLocale}.\n */\nexport function rewriteToLocale(\n request: NextRequest,\n resolution: LocaleResolution,\n): NextResponse {\n const target = request.nextUrl.clone();\n target.pathname = resolution.pathname;\n\n const headers = new Headers(request.headers);\n headers.set(LOCALE_HEADER, resolution.locale);\n\n const response = NextResponse.rewrite(target, { request: { headers } });\n rememberLocale(response, resolution.locale);\n\n return response;\n}\n"],"names":["LOCALE_COOKIE","LOCALE_HEADER","localeHref","negotiateLocale","splitLocalePath","NextResponse","resolveLocale","request","locale","fromPath","rest","nextUrl","pathname","undefined","cookie","cookies","get","value","acceptLanguage","headers","target","clone","redirect","rememberLocale","response","set","path","sameSite","rewriteToLocale","resolution","Headers","rewrite"],"mappings":"AAAA,SAEEA,aAAa,EACbC,aAAa,EACbC,UAAU,EACVC,eAAe,EACfC,eAAe,QACV,gBAAgB;AACvB,SAA2BC,YAAY,QAAQ,cAAc;AAc7D;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,cAAcC,OAAoB;;QAQtCA;IAPV,MAAM,EAAEC,QAAQC,QAAQ,EAAEC,IAAI,EAAE,GAAGN,gBAAgBG,QAAQI,OAAO,CAACC,QAAQ;IAE3E,IAAIH,aAAaI,WAAW;QAC1B,OAAO;YAAEL,QAAQC;YAAUG,UAAUF;QAAK;IAC5C;IAEA,MAAMF,SAASL,gBAAgB;QAC7BW,MAAM,WAAEP,uBAAAA,QAAQQ,OAAO,CAACC,GAAG,CAAChB,mCAApBO,qBAAoCU,KAAK,mBAAI;QACrDC,gBAAgBX,QAAQY,OAAO,CAACH,GAAG,CAAC;IACtC;IAEA,MAAMI,SAASb,QAAQI,OAAO,CAACU,KAAK;IACpCD,OAAOR,QAAQ,GAAGV,WAAWM,QAAQD,QAAQI,OAAO,CAACC,QAAQ;IAE7D,MAAMU,WAAWjB,aAAaiB,QAAQ,CAACF;IACvCG,eAAeD,UAAUd;IAEzB,OAAO;QAAEA;QAAQI,UAAUL,QAAQI,OAAO,CAACC,QAAQ;QAAEU;IAAS;AAChE;AAEA;;;;;CAKC,GACD,OAAO,SAASC,eAAeC,QAAsB,EAAEhB,MAAc;IACnEgB,SAAST,OAAO,CAACU,GAAG,CAACzB,eAAeQ,QAAQ;QAAEkB,MAAM;QAAKC,UAAU;IAAM;AAC3E;AAEA;;;;CAIC,GACD,OAAO,SAASC,gBACdrB,OAAoB,EACpBsB,UAA4B;IAE5B,MAAMT,SAASb,QAAQI,OAAO,CAACU,KAAK;IACpCD,OAAOR,QAAQ,GAAGiB,WAAWjB,QAAQ;IAErC,MAAMO,UAAU,IAAIW,QAAQvB,QAAQY,OAAO;IAC3CA,QAAQM,GAAG,CAACxB,eAAe4B,WAAWrB,MAAM;IAE5C,MAAMgB,WAAWnB,aAAa0B,OAAO,CAACX,QAAQ;QAAEb,SAAS;YAAEY;QAAQ;IAAE;IACrEI,eAAeC,UAAUK,WAAWrB,MAAM;IAE1C,OAAOgB;AACT"}
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@entifix/next-i18n",
3
+ "version": "0.1.0-0",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/r10c-technologies/entifix.git",
8
+ "directory": "packages/next/i18n"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "type": "module",
14
+ "main": "./dist/index.js",
15
+ "module": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ "./package.json": "./package.json",
19
+ ".": {
20
+ "@entifix/source": "./src/index.ts",
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.js",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "./server": {
26
+ "@entifix/source": "./src/server.ts",
27
+ "types": "./dist/server.d.ts",
28
+ "import": "./dist/server.js",
29
+ "default": "./dist/server.js"
30
+ }
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "!**/*.tsbuildinfo",
35
+ "LICENSE"
36
+ ],
37
+ "nx": {
38
+ "tags": [
39
+ "layer:shell",
40
+ "scope:shared",
41
+ "shell:base",
42
+ "tier:4"
43
+ ],
44
+ "sourceRoot": "packages/next/i18n/src",
45
+ "targets": {
46
+ "build": {
47
+ "executor": "@nx/js:swc",
48
+ "outputs": [
49
+ "{options.outputPath}"
50
+ ],
51
+ "options": {
52
+ "outputPath": "packages/next/i18n/dist",
53
+ "main": "packages/next/i18n/src/index.ts",
54
+ "tsConfig": "packages/next/i18n/tsconfig.lib.json",
55
+ "skipTypeCheck": true,
56
+ "stripLeadingPaths": true
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "dependencies": {
62
+ "@swc/helpers": "0.5.23",
63
+ "@entifix/i18n": "0.1.0-0",
64
+ "@entifix/core": "0.1.0-0"
65
+ },
66
+ "peerDependencies": {
67
+ "next": ">=16",
68
+ "i18next": ">=26 <27"
69
+ },
70
+ "devDependencies": {
71
+ "next": "16.2.10",
72
+ "i18next": "26.3.6"
73
+ },
74
+ "peerDependenciesMeta": {
75
+ "i18next": {
76
+ "optional": true
77
+ }
78
+ }
79
+ }