@bleedingdev/modern-js-i18n-runtime-extensions 3.9.0-ultramodern.9 → 3.9.3-ultramodern.10

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.
Files changed (104) hide show
  1. package/dist/cjs/index.js +10 -10
  2. package/dist/cjs/localeRedirectPolicy.js +6 -6
  3. package/dist/cjs/native.js +438 -0
  4. package/dist/cjs/paths.js +11 -3
  5. package/dist/cjs/requestLanguage.js +195 -0
  6. package/dist/cjs/router-navigation/adapter.js +93 -0
  7. package/dist/cjs/{localisedUrls/config.js → router-navigation/index.js} +5 -14
  8. package/dist/cjs/ssrLanguageHandoff.js +94 -0
  9. package/dist/cjs/urlRewrite.js +64 -0
  10. package/dist/esm/index.mjs +1 -1
  11. package/dist/esm/localeRedirectPolicy.mjs +1 -1
  12. package/dist/esm/native.mjs +378 -0
  13. package/dist/esm/paths.mjs +7 -2
  14. package/dist/esm/requestLanguage.mjs +148 -0
  15. package/dist/esm/router-navigation/adapter.mjs +55 -0
  16. package/dist/esm/router-navigation/index.mjs +1 -0
  17. package/dist/esm/ssrLanguageHandoff.mjs +44 -0
  18. package/dist/esm/urlRewrite.mjs +26 -0
  19. package/dist/esm-node/index.mjs +1 -1
  20. package/dist/esm-node/localeRedirectPolicy.mjs +1 -1
  21. package/dist/esm-node/native.mjs +379 -0
  22. package/dist/esm-node/paths.mjs +7 -2
  23. package/dist/esm-node/requestLanguage.mjs +149 -0
  24. package/dist/esm-node/router-navigation/adapter.mjs +56 -0
  25. package/dist/esm-node/router-navigation/index.mjs +2 -0
  26. package/dist/esm-node/ssrLanguageHandoff.mjs +45 -0
  27. package/dist/esm-node/urlRewrite.mjs +27 -0
  28. package/dist/types/index.d.ts +1 -1
  29. package/dist/types/localeRedirectPolicy.d.ts +1 -1
  30. package/dist/types/native.d.ts +34 -0
  31. package/dist/types/paths.d.ts +8 -1
  32. package/dist/types/requestLanguage.d.ts +60 -0
  33. package/dist/types/router-navigation/adapter.d.ts +23 -0
  34. package/dist/types/router-navigation/index.d.ts +1 -0
  35. package/dist/types/ssrLanguageHandoff.d.ts +60 -0
  36. package/dist/types/urlRewrite.d.ts +60 -0
  37. package/package.json +102 -15
  38. package/src/index.ts +1 -1
  39. package/src/localeRedirectPolicy.ts +2 -2
  40. package/src/native.ts +624 -0
  41. package/src/paths.ts +23 -2
  42. package/src/requestLanguage.ts +311 -0
  43. package/src/router-navigation/adapter.tsx +120 -0
  44. package/src/router-navigation/index.ts +6 -0
  45. package/src/ssrLanguageHandoff.ts +138 -0
  46. package/src/urlRewrite.ts +107 -0
  47. package/dist/cjs/localisedUrls/index.js +0 -98
  48. package/dist/cjs/localisedUrls/normalise.js +0 -87
  49. package/dist/cjs/localisedUrls/pathname.js +0 -68
  50. package/dist/cjs/localisedUrls/patterns.js +0 -214
  51. package/dist/cjs/localisedUrls/redirect.js +0 -100
  52. package/dist/cjs/localisedUrls/resolve.js +0 -78
  53. package/dist/cjs/localisedUrls/routeIdentity.js +0 -118
  54. package/dist/cjs/localisedUrls/routes.js +0 -210
  55. package/dist/cjs/localisedUrls/types.js +0 -18
  56. package/dist/esm/localisedUrls/config.mjs +0 -11
  57. package/dist/esm/localisedUrls/index.mjs +0 -8
  58. package/dist/esm/localisedUrls/normalise.mjs +0 -37
  59. package/dist/esm/localisedUrls/pathname.mjs +0 -24
  60. package/dist/esm/localisedUrls/patterns.mjs +0 -152
  61. package/dist/esm/localisedUrls/redirect.mjs +0 -53
  62. package/dist/esm/localisedUrls/resolve.mjs +0 -37
  63. package/dist/esm/localisedUrls/routeIdentity.mjs +0 -77
  64. package/dist/esm/localisedUrls/routes.mjs +0 -169
  65. package/dist/esm/localisedUrls/types.mjs +0 -0
  66. package/dist/esm-node/localisedUrls/config.mjs +0 -12
  67. package/dist/esm-node/localisedUrls/index.mjs +0 -9
  68. package/dist/esm-node/localisedUrls/normalise.mjs +0 -38
  69. package/dist/esm-node/localisedUrls/pathname.mjs +0 -25
  70. package/dist/esm-node/localisedUrls/patterns.mjs +0 -153
  71. package/dist/esm-node/localisedUrls/redirect.mjs +0 -54
  72. package/dist/esm-node/localisedUrls/resolve.mjs +0 -38
  73. package/dist/esm-node/localisedUrls/routeIdentity.mjs +0 -78
  74. package/dist/esm-node/localisedUrls/routes.mjs +0 -170
  75. package/dist/esm-node/localisedUrls/types.mjs +0 -1
  76. package/dist/types/localisedUrls/config.d.ts +0 -9
  77. package/dist/types/localisedUrls/index.d.ts +0 -10
  78. package/dist/types/localisedUrls/normalise.d.ts +0 -10
  79. package/dist/types/localisedUrls/pathname.d.ts +0 -4
  80. package/dist/types/localisedUrls/patterns.d.ts +0 -11
  81. package/dist/types/localisedUrls/redirect.d.ts +0 -19
  82. package/dist/types/localisedUrls/resolve.d.ts +0 -7
  83. package/dist/types/localisedUrls/routeIdentity.d.ts +0 -24
  84. package/dist/types/localisedUrls/routes.d.ts +0 -3
  85. package/dist/types/localisedUrls/types.d.ts +0 -14
  86. package/rslib.config.mts +0 -4
  87. package/rstest.config.mts +0 -36
  88. package/src/localisedUrls/config.ts +0 -18
  89. package/src/localisedUrls/index.ts +0 -28
  90. package/src/localisedUrls/normalise.ts +0 -62
  91. package/src/localisedUrls/pathname.ts +0 -60
  92. package/src/localisedUrls/patterns.ts +0 -283
  93. package/src/localisedUrls/redirect.ts +0 -107
  94. package/src/localisedUrls/resolve.ts +0 -106
  95. package/src/localisedUrls/routeIdentity.ts +0 -107
  96. package/src/localisedUrls/routes.ts +0 -432
  97. package/src/localisedUrls/types.ts +0 -18
  98. package/tests/languageSyncController.test.ts +0 -136
  99. package/tests/localeRedirectPolicy.test.ts +0 -173
  100. package/tests/localisedUrls.test.ts +0 -532
  101. package/tests/paths.test.ts +0 -24
  102. package/tests/reactLanguageSync.test.tsx +0 -136
  103. package/tests/tsconfig.json +0 -11
  104. package/tsconfig.json +0 -11
@@ -0,0 +1,27 @@
1
+ import "node:module";
2
+ import { canonicalTargetPathname, localiseTargetPathname } from "@modern-js/runtime-extensions/localised-urls";
3
+ import { languageFromPathname } from "./requestLanguage.mjs";
4
+ const createI18nUrlRewrite = (options)=>{
5
+ const { languages, getLanguage, localisedUrls, onLanguageDetected } = options;
6
+ const languageList = [
7
+ ...languages
8
+ ];
9
+ return {
10
+ input: ({ url })=>{
11
+ const pathname = url.pathname;
12
+ if (onLanguageDetected) {
13
+ const segments = pathname.split('/').filter(Boolean);
14
+ const firstSegment = segments[0];
15
+ const detected = firstSegment ? languageList.find((language)=>language.toLowerCase() === firstSegment.toLowerCase()) : void 0;
16
+ if (detected) onLanguageDetected(detected);
17
+ }
18
+ url.pathname = canonicalTargetPathname(pathname, languageList, localisedUrls);
19
+ return url;
20
+ },
21
+ output: ({ url })=>{
22
+ url.pathname = localiseTargetPathname(url.pathname, languageFromPathname(url.pathname, languageList) ?? getLanguage(), languageList, localisedUrls);
23
+ return url;
24
+ }
25
+ };
26
+ };
27
+ export { createI18nUrlRewrite };
@@ -1,4 +1,4 @@
1
+ export * from '@modern-js/runtime-extensions/localised-urls';
1
2
  export * from './language-sync/controller.js';
2
3
  export * from './language-sync/react.js';
3
4
  export * from './localeRedirectPolicy.js';
4
- export * from './localisedUrls/index.js';
@@ -1,4 +1,4 @@
1
- import type { LocalisedUrlsOption } from './localisedUrls/index.js';
1
+ import type { LocalisedUrlsOption } from '@modern-js/runtime-extensions/localised-urls';
2
2
  interface LocaleRedirectRequest {
3
3
  url: string;
4
4
  header: () => {
@@ -0,0 +1,34 @@
1
+ import type { NativeEntryI18n } from '@modern-js/renderer-core/entry-server';
2
+ import type { LocalisedUrlsOption } from '@modern-js/runtime-extensions/localised-urls';
3
+ import { type i18n as I18nInstance, type InitOptions } from 'i18next';
4
+ import { type ResolveRequestLanguageOptions } from './requestLanguage.js';
5
+ export type { I18nInstance };
6
+ /** Retire the native proof when its owning request or plugin contract ends. */
7
+ export declare function invalidateNativeI18nSnapshot(instance: unknown): void;
8
+ export interface NativeI18nRewriteSnapshot {
9
+ language: string;
10
+ languages: readonly string[];
11
+ localisedUrls?: LocalisedUrlsOption;
12
+ }
13
+ /** Only rewrites created by the native entry have a portable routing profile. */
14
+ export declare function getNativeI18nRewriteSnapshot(rewrite: unknown): NativeI18nRewriteSnapshot | undefined;
15
+ /** A real fully bundled instance for request-local synchronous providers. */
16
+ export declare function createNativeI18nInstance(initOptions: InitOptions): I18nInstance;
17
+ /** The original effective seed, only while the initialized native proof holds. */
18
+ export declare function getNativeI18nSnapshotSeed(instance: unknown): InitOptions;
19
+ export interface NativeI18nOptions extends ResolveRequestLanguageOptions {
20
+ /**
21
+ * JSON-serializable i18next `init` options. `lng`, `fallbackLng`,
22
+ * `supportedLngs`, `resources` and `ns` are owned by the native entry.
23
+ */
24
+ initOptions?: InitOptions;
25
+ }
26
+ /** language -> namespace -> lazily imported translation bundle. */
27
+ export type NativeI18nLoaders = Readonly<Record<string, Readonly<Record<string, () => Promise<unknown>>>>>;
28
+ export type NativeI18n = NativeEntryI18n<I18nInstance, LocalisedUrlsOption>;
29
+ /**
30
+ * The localized routing and per-request i18next instances of a native
31
+ * Solid or Octane entry. Each language's bundles load on demand; an instance
32
+ * is never a module singleton.
33
+ */
34
+ export declare function createNativeI18n(options: NativeI18nOptions, loaders: NativeI18nLoaders): NativeI18n;
@@ -1,8 +1,15 @@
1
- import { type LocalisedUrlsOption } from './localisedUrls/index.js';
1
+ import { type LocalisedUrlsOption } from '@modern-js/runtime-extensions/localised-urls';
2
+ export type { LocalisedUrlsOption };
2
3
  export interface LocalizedPathsConfig {
3
4
  languages: string[];
4
5
  localisedUrls?: LocalisedUrlsOption;
5
6
  }
7
+ /**
8
+ * The configured spelling of a requested language, matched case-insensitively.
9
+ * Only a configured language has a locale prefix, so anything else throws
10
+ * rather than becoming an unknown path segment.
11
+ */
12
+ export declare const configuredLanguage: (requested: string, languages: readonly string[]) => string;
6
13
  /** Synchronous mapped URL construction, independent of React/plugin setup. */
7
14
  export declare const buildLocalizedUrl: (target: string, language: string, languages: string[], localisedUrls?: LocalisedUrlsOption) => string;
8
15
  export declare const localizePath: (target: string, language: string, config: LocalizedPathsConfig) => string;
@@ -0,0 +1,60 @@
1
+ import { type LocalisedUrlsOption } from '@modern-js/runtime-extensions/localised-urls';
2
+ /**
3
+ * Renderer-neutral request language resolution for path-prefixed locales.
4
+ * It is the Fetch-native counterpart of `@modern-js/plugin-i18n`'s Hono
5
+ * language-detector + redirect middleware pair: a native renderer's request
6
+ * handler calls it with the standard `Request`, so it needs neither Hono nor
7
+ * React and runs unchanged on Node and in workers.
8
+ */
9
+ export type RequestLanguageDetector = 'querystring' | 'cookie' | 'header';
10
+ export interface RequestLanguageDetection {
11
+ /** @default ['querystring', 'cookie', 'header'] */
12
+ order?: readonly RequestLanguageDetector[];
13
+ /** @default 'lng' */
14
+ lookupQuerystring?: string;
15
+ /** @default 'i18next' */
16
+ lookupCookie?: string;
17
+ /** @default 'accept-language' */
18
+ lookupHeader?: string;
19
+ }
20
+ export interface ResolveRequestLanguageOptions {
21
+ languages: readonly string[];
22
+ fallbackLanguage: string;
23
+ /** Public path the entry is mounted under. @default '/' */
24
+ basePath?: string;
25
+ localisedUrls?: LocalisedUrlsOption;
26
+ /**
27
+ * Detect the language of an unprefixed URL from the query string, cookie
28
+ * and `Accept-Language`. When false the fallback language is used.
29
+ * @default true
30
+ */
31
+ detect?: boolean;
32
+ detection?: RequestLanguageDetection;
33
+ /** Canonical paths that are served without a language prefix. */
34
+ ignoreRedirectRoutes?: readonly string[] | ((pathname: string) => boolean);
35
+ }
36
+ export type ResolvedRequestLanguage = {
37
+ kind: 'language';
38
+ language: string;
39
+ vary?: readonly string[];
40
+ } | {
41
+ kind: 'redirect';
42
+ language: string;
43
+ location: string;
44
+ };
45
+ /** The supported language carried by a public pathname's first segment. */
46
+ export declare function languageFromPathname(pathname: string, languages: readonly string[], basePath?: string): string | undefined;
47
+ /**
48
+ * Detect a supported language from the request alone (no path), in the
49
+ * configured detector order. Returns `undefined` when nothing matches.
50
+ */
51
+ export declare function detectRequestLanguage(request: Request, languages: readonly string[], detection?: RequestLanguageDetection): string | undefined;
52
+ /**
53
+ * Resolve the language a request renders in. A URL that already carries a
54
+ * supported language prefix renders in it; an unprefixed page URL is
55
+ * redirected to the detected (or fallback) language's localized URL, keeping
56
+ * search and the base path, unless it is an ignored or framework-owned path.
57
+ */
58
+ export declare function resolveRequestLanguage(request: Request, options: ResolveRequestLanguageOptions): ResolvedRequestLanguage;
59
+ /** The same uncacheable 302 the React server middleware answers with. */
60
+ export declare function createRequestLanguageRedirect(location: string): Response;
@@ -0,0 +1,23 @@
1
+ import { type RouterLinkTarget, type RouterNavigationCapability, type RouterNavigationSnapshot } from '@modern-js/runtime-extensions/router-state';
2
+ import type React from 'react';
3
+ export interface I18nRouterNavigationDependencies<Adapter extends I18nRouterAdapterShape> {
4
+ I18nNavigationProvider: React.ComponentType<React.PropsWithChildren<{
5
+ value: Adapter;
6
+ }>>;
7
+ useNativeI18nRouterAdapter: () => Adapter;
8
+ }
9
+ export type I18nRouterLinkTarget = RouterLinkTarget;
10
+ export interface I18nRouterAdapterShape {
11
+ framework?: string;
12
+ hasRouter: boolean;
13
+ location: RouterNavigationSnapshot['location'] | null;
14
+ navigate: RouterNavigationCapability['navigate'] | null;
15
+ Link: RouterNavigationCapability['Link'] | null;
16
+ params: Record<string, string>;
17
+ createLinkProps?: RouterNavigationCapability['createLinkProps'];
18
+ }
19
+ /** The router provider owns navigation; this seam only observes its capability. */
20
+ export declare const createI18nRouterNavigation: <Adapter extends I18nRouterAdapterShape>({ I18nNavigationProvider, useNativeI18nRouterAdapter, }: I18nRouterNavigationDependencies<Adapter>) => {
21
+ useIntegratedRouterAdapter: () => Adapter;
22
+ I18nRouterNavigationProvider: ({ children, }: React.PropsWithChildren) => React.JSX.Element;
23
+ };
@@ -0,0 +1 @@
1
+ export { createI18nRouterNavigation, type I18nRouterAdapterShape, type I18nRouterLinkTarget, type I18nRouterNavigationDependencies, } from './adapter.js';
@@ -0,0 +1,60 @@
1
+ import { serializePublicData } from '@modern-js/renderer-core/data';
2
+ /**
3
+ * Renderer-neutral replacement for React's `window._SSR_DATA.data.i18nData`
4
+ * handoff (see `plugin-i18n/src/runtime/i18n/detection/ssr.ts` and
5
+ * `pluginSetup.ts`'s `exportServerLngToWindow`). That path only exists
6
+ * because the React renderer serializes its own `_SSR_DATA` global; native
7
+ * renderers have no equivalent global, so the language (and an optional
8
+ * resource subset, for first-paint translation without a network round
9
+ * trip) travels in its own inline `<script type="application/json">`
10
+ * element instead, using renderer-core's public-data codec — the same
11
+ * XSS-safe escaping and size/depth limits used for loader/action data.
12
+ */
13
+ export declare const I18N_SSR_HANDOFF_ELEMENT_ID = "__modernjs_i18n_ssr__";
14
+ /** `{ [namespace]: { [key]: value } }`, scoped to a single language. */
15
+ export type I18nSsrHandoffResources = Record<string, Record<string, unknown>>;
16
+ export interface I18nSsrHandoffPayload {
17
+ /** The language the server resolved for this request. */
18
+ language: string;
19
+ /** Optional subset of resources for `language`, keyed by namespace. */
20
+ resources?: I18nSsrHandoffResources;
21
+ }
22
+ export interface SerializeI18nSsrHandoffOptions {
23
+ /** @default I18N_SSR_HANDOFF_ELEMENT_ID */
24
+ id?: string;
25
+ nonce?: string;
26
+ }
27
+ /** An inline data element a native document serializes with its own nonce. */
28
+ export interface I18nSsrHandoffInlineData {
29
+ readonly id: string;
30
+ readonly payload: ReturnType<typeof serializePublicData>;
31
+ }
32
+ /**
33
+ * Encode the handoff as `{ id, payload }` for a native document's
34
+ * `inlineData` option, which places it before the client modules and stamps
35
+ * it with the document's CSP nonce.
36
+ */
37
+ export declare function createI18nSsrHandoffInlineData(payload: I18nSsrHandoffPayload, options?: Pick<SerializeI18nSsrHandoffOptions, 'id'>): I18nSsrHandoffInlineData;
38
+ /**
39
+ * Serialize the language/resources handoff into a complete, inert
40
+ * `<script type="application/json">` element string. The native renderer's
41
+ * document composition decides where to place it (before any module that
42
+ * reads it on the client).
43
+ */
44
+ export declare function serializeI18nSsrHandoff(payload: I18nSsrHandoffPayload, options?: SerializeI18nSsrHandoffOptions): string;
45
+ /**
46
+ * Decode a handoff payload from the raw text content of the element
47
+ * `serializeI18nSsrHandoff` produced. Pure — no DOM access — so it can be
48
+ * unit tested or used from a non-browser client runtime directly.
49
+ * Returns `undefined` for missing, malformed or oversized input rather than
50
+ * throwing, since a corrupted handoff should fall back to client detection.
51
+ */
52
+ export declare function readI18nSsrHandoffFromText(text: string | null | undefined): I18nSsrHandoffPayload | undefined;
53
+ /**
54
+ * Browser convenience wrapper: reads the handoff element from `document` (or
55
+ * a supplied document-like object) by id and decodes it.
56
+ */
57
+ export declare function readI18nSsrHandoff(options?: {
58
+ id?: string;
59
+ doc?: Pick<Document, 'getElementById'>;
60
+ }): I18nSsrHandoffPayload | undefined;
@@ -0,0 +1,60 @@
1
+ import { type LocalisedUrlsOption } from '@modern-js/runtime-extensions/localised-urls';
2
+ /**
3
+ * Structurally identical to `@tanstack/router-core`'s `LocationRewriteFunction`.
4
+ * Defined locally so this module has no runtime dependency on router-core —
5
+ * any router built on that contract (TanStack Router, `@octanejs/tanstack-router`,
6
+ * which re-exports it verbatim) can consume the rewrite this module builds.
7
+ */
8
+ export type I18nLocationRewriteFunction = (args: {
9
+ url: URL;
10
+ }) => undefined | string | URL;
11
+ /** Structurally identical to `@tanstack/router-core`'s `LocationRewrite`. */
12
+ export interface I18nLocationRewrite {
13
+ input?: I18nLocationRewriteFunction;
14
+ output?: I18nLocationRewriteFunction;
15
+ }
16
+ export interface CreateI18nUrlRewriteOptions {
17
+ /** Supported language codes, e.g. `['en', 'cs']`. */
18
+ languages: readonly string[];
19
+ /**
20
+ * The language an outgoing (internal -> public) location is localized to
21
+ * when its pathname does not already start with a supported language.
22
+ */
23
+ getLanguage: () => string;
24
+ /**
25
+ * Canonical-path -> per-language path map; mirrors
26
+ * `localeDetection.localisedUrls`. Omit for the plain language-prefix policy.
27
+ */
28
+ localisedUrls?: LocalisedUrlsOption;
29
+ /**
30
+ * Called with the language segment found in an incoming public pathname,
31
+ * before it is stripped to its canonical form. Not called when the
32
+ * pathname carries no recognizable language segment.
33
+ */
34
+ onLanguageDetected?: (language: string) => void;
35
+ }
36
+ /**
37
+ * Build a TanStack router-core `LocationRewrite` from the fork's localized-URL
38
+ * pathname helpers: the router matches against canonical (language-agnostic)
39
+ * paths internally, while every public href it produces carries the current
40
+ * language prefix (and any mapped locale slug). An outgoing pathname that
41
+ * already starts with a supported language keeps that language, which is how
42
+ * a route mask such as `LocalizedLink`'s publishes another language's URL.
43
+ *
44
+ * Pass the result directly as a router's `rewrite` option:
45
+ *
46
+ * ```ts
47
+ * createRouter({ routeTree, rewrite: createI18nUrlRewrite({ languages, getLanguage }) })
48
+ * ```
49
+ *
50
+ * If the router also configures a `basepath`, router-core composes the two
51
+ * for you — its constructor internally does
52
+ * `this.rewrite = rewriteBasepath(basepath, caseSensitive, options.rewrite)`
53
+ * (that helper is an internal, not part of router-core's public exports; the
54
+ * composition happens automatically, nothing extra to call here). It strips
55
+ * the basepath before this rewrite's `input` runs, and applies this
56
+ * rewrite's `output` before the basepath is re-added, so the public URL
57
+ * shape is `${basepath}${languagePrefix}${canonicalPath}` — e.g.
58
+ * `/app/en/dashboard` while the router itself only ever sees `/dashboard`.
59
+ */
60
+ export declare const createI18nUrlRewrite: (options: CreateI18nUrlRewriteOptions) => I18nLocationRewrite;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@bleedingdev/modern-js-i18n-runtime-extensions",
3
3
  "description": "Fork-owned UltraModern.js i18n runtime coordination and localized-route extensions.",
4
- "homepage": "https://github.com/BleedingDev/ultramodern.js#readme",
4
+ "homepage": "https://github.com/ultramodernjs/ultramodern.js#readme",
5
5
  "bugs": {
6
- "url": "https://github.com/BleedingDev/ultramodern.js/issues"
6
+ "url": "https://github.com/ultramodernjs/ultramodern.js/issues"
7
7
  },
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/BleedingDev/ultramodern.js.git",
10
+ "url": "git+https://github.com/ultramodernjs/ultramodern.js.git",
11
11
  "directory": "packages/runtime/i18n-extensions"
12
12
  },
13
13
  "license": "MIT",
@@ -17,7 +17,7 @@
17
17
  "modern.js",
18
18
  "i18n"
19
19
  ],
20
- "version": "3.9.0-ultramodern.9",
20
+ "version": "3.9.3-ultramodern.10",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "module": "./dist/esm/index.mjs",
@@ -30,6 +30,14 @@
30
30
  },
31
31
  "default": "./dist/esm/index.mjs"
32
32
  },
33
+ "./router-navigation": {
34
+ "types": "./dist/types/router-navigation/index.d.ts",
35
+ "node": {
36
+ "import": "./dist/esm-node/router-navigation/index.mjs",
37
+ "require": "./dist/cjs/router-navigation/index.js"
38
+ },
39
+ "default": "./dist/esm/router-navigation/index.mjs"
40
+ },
33
41
  "./package.json": "./package.json",
34
42
  "./paths": {
35
43
  "types": "./dist/types/paths.d.ts",
@@ -38,6 +46,46 @@
38
46
  "require": "./dist/cjs/paths.js"
39
47
  },
40
48
  "default": "./dist/esm/paths.mjs"
49
+ },
50
+ "./urlRewrite": {
51
+ "types": "./dist/types/urlRewrite.d.ts",
52
+ "node": {
53
+ "import": "./dist/esm-node/urlRewrite.mjs",
54
+ "require": "./dist/cjs/urlRewrite.js"
55
+ },
56
+ "default": "./dist/esm/urlRewrite.mjs"
57
+ },
58
+ "./ssrLanguageHandoff": {
59
+ "types": "./dist/types/ssrLanguageHandoff.d.ts",
60
+ "node": {
61
+ "import": "./dist/esm-node/ssrLanguageHandoff.mjs",
62
+ "require": "./dist/cjs/ssrLanguageHandoff.js"
63
+ },
64
+ "default": "./dist/esm/ssrLanguageHandoff.mjs"
65
+ },
66
+ "./language-sync/controller": {
67
+ "types": "./dist/types/language-sync/controller.d.ts",
68
+ "node": {
69
+ "import": "./dist/esm-node/language-sync/controller.mjs",
70
+ "require": "./dist/cjs/language-sync/controller.js"
71
+ },
72
+ "default": "./dist/esm/language-sync/controller.mjs"
73
+ },
74
+ "./request-language": {
75
+ "types": "./dist/types/requestLanguage.d.ts",
76
+ "node": {
77
+ "import": "./dist/esm-node/requestLanguage.mjs",
78
+ "require": "./dist/cjs/requestLanguage.js"
79
+ },
80
+ "default": "./dist/esm/requestLanguage.mjs"
81
+ },
82
+ "./native": {
83
+ "types": "./dist/types/native.d.ts",
84
+ "node": {
85
+ "import": "./dist/esm-node/native.mjs",
86
+ "require": "./dist/cjs/native.js"
87
+ },
88
+ "default": "./dist/esm/native.mjs"
41
89
  }
42
90
  },
43
91
  "typesVersions": {
@@ -48,36 +96,75 @@
48
96
  ],
49
97
  "paths": [
50
98
  "./dist/types/paths.d.ts"
99
+ ],
100
+ "router-navigation": [
101
+ "./dist/types/router-navigation/index.d.ts"
102
+ ],
103
+ "urlRewrite": [
104
+ "./dist/types/urlRewrite.d.ts"
105
+ ],
106
+ "ssrLanguageHandoff": [
107
+ "./dist/types/ssrLanguageHandoff.d.ts"
108
+ ],
109
+ "language-sync/controller": [
110
+ "./dist/types/language-sync/controller.d.ts"
111
+ ],
112
+ "request-language": [
113
+ "./dist/types/requestLanguage.d.ts"
114
+ ],
115
+ "native": [
116
+ "./dist/types/native.d.ts"
51
117
  ]
52
118
  }
53
119
  },
54
120
  "engines": {
55
- "node": ">=26.7.0"
121
+ "node": ">=26.12.0"
56
122
  },
57
123
  "dependencies": {
58
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.9",
124
+ "@modern-js/renderer-core": "npm:@bleedingdev/modern-js-renderer-core@3.9.3-ultramodern.10",
125
+ "@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.3-ultramodern.10",
126
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.10",
59
127
  "i18next-browser-languagedetector": "^8.2.1"
60
128
  },
61
129
  "peerDependencies": {
62
- "@modern-js/runtime": "3.9.0-ultramodern.9",
63
- "react": "^19.2.8"
130
+ "@modern-js/runtime": "3.9.3-ultramodern.10",
131
+ "i18next": ">=25.7.4",
132
+ "react": "^19.3.1"
133
+ },
134
+ "peerDependenciesMeta": {
135
+ "@modern-js/runtime": {
136
+ "optional": true
137
+ },
138
+ "i18next": {
139
+ "optional": true
140
+ },
141
+ "react": {
142
+ "optional": true
143
+ }
64
144
  },
65
145
  "devDependencies": {
66
- "@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.9.0-ultramodern.9",
67
- "@rslib/core": "1.0.0",
146
+ "@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.9.3-ultramodern.10",
147
+ "@rslib/core": "1.0.3",
68
148
  "@scripts/rstest-config": "2.66.0",
69
- "@types/node": "^26.4.1",
70
- "@typescript/native-preview": "7.0.0-dev.20260707.2",
71
- "react": "^19.2.8",
72
- "react-dom": "^19.2.8"
149
+ "@types/node": "^26.6.5",
150
+ "i18next": "26.4.6",
151
+ "react": "^19.3.1",
152
+ "react-dom": "^19.3.1"
73
153
  },
74
154
  "sideEffects": false,
75
155
  "publishConfig": {
76
156
  "access": "public"
77
157
  },
158
+ "files": [
159
+ "dist",
160
+ "src"
161
+ ],
78
162
  "scripts": {
79
163
  "dev": "rslib build --watch",
80
164
  "build": "rslib build",
81
- "test": "rstest --passWithNoTests"
165
+ "test": "rstest"
166
+ },
167
+ "ultramodern": {
168
+ "sourceName": "@modern-js/i18n-runtime-extensions"
82
169
  }
83
170
  }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
+ export * from '@modern-js/runtime-extensions/localised-urls';
1
2
  export * from './language-sync/controller';
2
3
  export * from './language-sync/react';
3
4
  export * from './localeRedirectPolicy';
4
- export * from './localisedUrls/index';
@@ -1,11 +1,11 @@
1
- import type { LocalisedUrlsOption } from './localisedUrls/index';
1
+ import type { LocalisedUrlsOption } from '@modern-js/runtime-extensions/localised-urls';
2
2
  import {
3
3
  isDefaultLocaleRedirectSkipPath,
4
4
  localiseTargetPathname,
5
5
  matchesPathPrefix,
6
6
  shouldSkipLocaleRedirect,
7
7
  stripLanguagePrefix,
8
- } from './localisedUrls/index';
8
+ } from '@modern-js/runtime-extensions/localised-urls';
9
9
 
10
10
  interface LocaleRedirectRequest {
11
11
  url: string;