next-intl 3.14.1 → 3.15.0-custom-prefixes.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/dist/development/config.js +1 -1
- package/dist/development/middleware/config.js +17 -0
- package/dist/development/middleware/getAlternateLinksHeaderValue.js +8 -7
- package/dist/development/middleware/middleware.js +56 -61
- package/dist/development/middleware/resolveLocale.js +5 -6
- package/dist/development/middleware/utils.js +58 -30
- package/dist/development/navigation/react-client/ClientLink.js +7 -2
- package/dist/development/navigation/react-client/createLocalizedPathnamesNavigation.js +18 -16
- package/dist/development/navigation/react-client/createSharedPathnamesNavigation.js +17 -12
- package/dist/development/navigation/react-client/redirects.js +32 -0
- package/dist/development/navigation/react-client/useBasePathname.js +12 -4
- package/dist/development/navigation/react-client/useBaseRouter.js +8 -3
- package/dist/development/navigation/react-server/ServerLink.js +7 -1
- package/dist/development/navigation/react-server/createLocalizedPathnamesNavigation.js +15 -19
- package/dist/development/navigation/react-server/createSharedPathnamesNavigation.js +11 -10
- package/dist/development/navigation/react-server/redirects.js +24 -0
- package/dist/development/navigation/shared/BaseLink.js +6 -5
- package/dist/development/navigation/shared/config.js +30 -0
- package/dist/development/navigation/shared/redirects.js +22 -0
- package/dist/development/navigation/shared/utils.js +2 -4
- package/dist/development/routing/config.js +18 -0
- package/dist/development/routing.js +2 -0
- package/dist/development/server/react-server/RequestLocale.js +1 -1
- package/dist/development/shared/utils.js +26 -14
- package/dist/esm/config.js +1 -1
- package/dist/esm/middleware/config.js +1 -0
- package/dist/esm/middleware/getAlternateLinksHeaderValue.js +1 -1
- package/dist/esm/middleware/middleware.js +1 -1
- package/dist/esm/middleware/resolveLocale.js +1 -1
- package/dist/esm/middleware/utils.js +1 -1
- package/dist/esm/navigation/react-client/ClientLink.js +1 -1
- package/dist/esm/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-client/redirects.js +1 -0
- package/dist/esm/navigation/react-client/useBasePathname.js +1 -1
- package/dist/esm/navigation/react-client/useBaseRouter.js +1 -1
- package/dist/esm/navigation/react-server/ServerLink.js +1 -1
- package/dist/esm/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-server/redirects.js +1 -0
- package/dist/esm/navigation/shared/BaseLink.js +1 -1
- package/dist/esm/navigation/shared/config.js +1 -0
- package/dist/esm/navigation/shared/redirects.js +1 -0
- package/dist/esm/navigation/shared/utils.js +1 -1
- package/dist/esm/routing/config.js +1 -0
- package/dist/esm/routing.js +1 -0
- package/dist/esm/server/react-server/RequestLocale.js +1 -1
- package/dist/esm/shared/utils.js +1 -1
- package/dist/production/config.js +1 -1
- package/dist/production/middleware/config.js +1 -0
- package/dist/production/middleware/getAlternateLinksHeaderValue.js +1 -1
- package/dist/production/middleware/middleware.js +1 -1
- package/dist/production/middleware/resolveLocale.js +1 -1
- package/dist/production/middleware/utils.js +1 -1
- package/dist/production/navigation/react-client/ClientLink.js +1 -1
- package/dist/production/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-client/redirects.js +1 -0
- package/dist/production/navigation/react-client/useBasePathname.js +1 -1
- package/dist/production/navigation/react-client/useBaseRouter.js +1 -1
- package/dist/production/navigation/react-server/ServerLink.js +1 -1
- package/dist/production/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-server/redirects.js +1 -0
- package/dist/production/navigation/shared/BaseLink.js +1 -1
- package/dist/production/navigation/shared/config.js +1 -0
- package/dist/production/navigation/shared/redirects.js +1 -0
- package/dist/production/navigation/shared/utils.js +1 -1
- package/dist/production/routing/config.js +1 -0
- package/dist/production/routing.js +1 -0
- package/dist/production/server/react-server/RequestLocale.js +1 -1
- package/dist/production/shared/utils.js +1 -1
- package/dist/routing.js +7 -0
- package/dist/types/src/middleware/config.d.ts +18 -0
- package/dist/types/src/middleware/getAlternateLinksHeaderValue.d.ts +6 -6
- package/dist/types/src/middleware/middleware.d.ts +3 -3
- package/dist/types/src/middleware/resolveLocale.d.ts +6 -6
- package/dist/types/src/middleware/utils.d.ts +19 -12
- package/dist/types/src/navigation/react-client/ClientLink.d.ts +10 -7
- package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +21 -22
- package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +22 -10
- package/dist/types/src/navigation/react-client/index.d.ts +3 -1
- package/dist/types/src/navigation/react-client/redirects.d.ts +10 -0
- package/dist/types/src/navigation/react-client/useBasePathname.d.ts +2 -1
- package/dist/types/src/navigation/react-client/useBaseRouter.d.ts +7 -7
- package/dist/types/src/navigation/react-server/ServerLink.d.ts +5 -4
- package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +14 -15
- package/dist/types/src/navigation/react-server/createSharedPathnamesNavigation.d.ts +4 -6
- package/dist/types/src/navigation/react-server/index.d.ts +1 -1
- package/dist/types/src/navigation/react-server/redirects.d.ts +10 -0
- package/dist/types/src/navigation/shared/BaseLink.d.ts +3 -2
- package/dist/types/src/navigation/shared/config.d.ts +24 -0
- package/dist/types/src/navigation/shared/redirects.d.ts +11 -0
- package/dist/types/src/navigation/shared/utils.d.ts +10 -10
- package/dist/types/src/routing/config.d.ts +14 -0
- package/dist/types/src/routing/index.d.ts +2 -0
- package/dist/types/src/routing/types.d.ts +23 -0
- package/dist/types/src/routing.d.ts +1 -0
- package/dist/types/src/shared/types.d.ts +0 -5
- package/dist/types/src/shared/utils.d.ts +10 -7
- package/package.json +23 -16
- package/routing.d.ts +1 -0
- package/dist/development/navigation/react-client/clientPermanentRedirect.js +0 -25
- package/dist/development/navigation/react-client/clientRedirect.js +0 -25
- package/dist/development/navigation/react-server/serverPermanentRedirect.js +0 -19
- package/dist/development/navigation/react-server/serverRedirect.js +0 -19
- package/dist/development/navigation/shared/basePermanentRedirect.js +0 -16
- package/dist/development/navigation/shared/baseRedirect.js +0 -16
- package/dist/esm/navigation/react-client/clientPermanentRedirect.js +0 -1
- package/dist/esm/navigation/react-client/clientRedirect.js +0 -1
- package/dist/esm/navigation/react-server/serverPermanentRedirect.js +0 -1
- package/dist/esm/navigation/react-server/serverRedirect.js +0 -1
- package/dist/esm/navigation/shared/basePermanentRedirect.js +0 -1
- package/dist/esm/navigation/shared/baseRedirect.js +0 -1
- package/dist/production/navigation/react-client/clientPermanentRedirect.js +0 -1
- package/dist/production/navigation/react-client/clientRedirect.js +0 -1
- package/dist/production/navigation/react-server/serverPermanentRedirect.js +0 -1
- package/dist/production/navigation/react-server/serverRedirect.js +0 -1
- package/dist/production/navigation/shared/basePermanentRedirect.js +0 -1
- package/dist/production/navigation/shared/baseRedirect.js +0 -1
- package/dist/types/src/middleware/NextIntlMiddlewareConfig.d.ts +0 -31
- package/dist/types/src/navigation/react-client/clientPermanentRedirect.d.ts +0 -6
- package/dist/types/src/navigation/react-client/clientRedirect.d.ts +0 -6
- package/dist/types/src/navigation/react-server/serverPermanentRedirect.d.ts +0 -6
- package/dist/types/src/navigation/react-server/serverRedirect.d.ts +0 -6
- package/dist/types/src/navigation/shared/basePermanentRedirect.d.ts +0 -7
- package/dist/types/src/navigation/shared/baseRedirect.d.ts +0 -7
- /package/dist/types/test/navigation/shared/{basePermanentRedirect.test.d.ts → redirects.test.d.ts} +0 -0
- /package/dist/types/test/{navigation/shared/baseRedirect.test.d.ts → routing/types.test.d.ts} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import React, { ComponentProps, ReactElement } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Locales, LocalePrefixConfigVerbose } from '../../routing/types';
|
|
4
4
|
import BaseLink from '../shared/BaseLink';
|
|
5
|
-
type Props<
|
|
6
|
-
locale?:
|
|
5
|
+
type Props<AppLocales extends Locales> = Omit<ComponentProps<typeof BaseLink>, 'locale' | 'prefix' | 'localePrefixMode'> & {
|
|
6
|
+
locale?: AppLocales[number];
|
|
7
|
+
localePrefix: LocalePrefixConfigVerbose<AppLocales>;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* Wraps `next/link` and prefixes the `href` with the current locale if
|
|
@@ -25,7 +26,7 @@ type Props<Locales extends AllLocales> = Omit<ComponentProps<typeof BaseLink>, '
|
|
|
25
26
|
* the `set-cookie` response header would cause the locale cookie on the current
|
|
26
27
|
* page to be overwritten before the user even decides to change the locale.
|
|
27
28
|
*/
|
|
28
|
-
declare const ClientLinkWithRef: <
|
|
29
|
+
declare const ClientLinkWithRef: <AppLocales extends Locales>(props: Omit<Omit<Omit<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
|
|
29
30
|
href: string | import("url").UrlObject;
|
|
30
31
|
as?: (string | import("url").UrlObject) | undefined;
|
|
31
32
|
replace?: boolean | undefined;
|
|
@@ -55,9 +56,11 @@ declare const ClientLinkWithRef: <Locales extends AllLocales>(props: Omit<Omit<O
|
|
|
55
56
|
children?: React.ReactNode;
|
|
56
57
|
} & React.RefAttributes<HTMLAnchorElement>, "locale"> & {
|
|
57
58
|
locale: string;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
prefix: string;
|
|
60
|
+
localePrefixMode: import("../../routing/types").LocalePrefixMode;
|
|
61
|
+
}, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale" | "prefix" | "localePrefixMode"> & {
|
|
62
|
+
locale?: AppLocales[number] | undefined;
|
|
63
|
+
localePrefix: LocalePrefixConfigVerbose<AppLocales>;
|
|
61
64
|
} & {
|
|
62
65
|
ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
|
|
63
66
|
}) => ReactElement;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import React, { ComponentProps, ReactElement } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Locales, Pathnames } from '../../routing/types';
|
|
4
|
+
import { LocalizedNavigationRoutingConfigInput } from '../shared/config';
|
|
4
5
|
import { HrefOrHrefWithParams } from '../shared/utils';
|
|
5
6
|
import ClientLink from './ClientLink';
|
|
6
|
-
export default function createLocalizedPathnamesNavigation<
|
|
7
|
-
|
|
8
|
-
pathnames: PathnamesConfig;
|
|
9
|
-
localePrefix?: LocalePrefix;
|
|
10
|
-
}): {
|
|
11
|
-
Link: <Pathname extends keyof PathnamesConfig>(props: Omit<Omit<Omit<Omit<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
|
|
7
|
+
export default function createLocalizedPathnamesNavigation<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>>(input: LocalizedNavigationRoutingConfigInput<AppLocales, AppPathnames>): {
|
|
8
|
+
Link: <Pathname extends keyof AppPathnames>(props: Omit<Omit<Omit<Omit<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
|
|
12
9
|
href: string | import("url").UrlObject;
|
|
13
10
|
as?: (string | import("url").UrlObject) | undefined;
|
|
14
11
|
replace?: boolean | undefined;
|
|
@@ -38,12 +35,14 @@ export default function createLocalizedPathnamesNavigation<Locales extends AllLo
|
|
|
38
35
|
children?: React.ReactNode;
|
|
39
36
|
} & React.RefAttributes<HTMLAnchorElement>, "locale"> & {
|
|
40
37
|
locale: string;
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
prefix: string;
|
|
39
|
+
localePrefixMode: import("../../routing/types").LocalePrefixMode;
|
|
40
|
+
}, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale" | "prefix" | "localePrefixMode"> & {
|
|
43
41
|
locale?: string | undefined;
|
|
42
|
+
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<Locales>;
|
|
44
43
|
} & {
|
|
45
44
|
ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
|
|
46
|
-
}, "href" | "name"> & {
|
|
45
|
+
}, "href" | "localePrefix" | "name"> & {
|
|
47
46
|
href: Pathname extends `${string}[[...${string}` ? Pathname | ({
|
|
48
47
|
pathname: Pathname;
|
|
49
48
|
params?: import("../shared/StrictParams").default<Pathname> | undefined;
|
|
@@ -53,29 +52,29 @@ export default function createLocalizedPathnamesNavigation<Locales extends AllLo
|
|
|
53
52
|
} & Omit<import("url").UrlObject, "pathname"> : Pathname | ({
|
|
54
53
|
pathname: Pathname;
|
|
55
54
|
} & Omit<import("url").UrlObject, "pathname">);
|
|
56
|
-
locale?:
|
|
55
|
+
locale?: AppLocales[number] | undefined;
|
|
57
56
|
} & {
|
|
58
57
|
ref?: ComponentProps<typeof ClientLink>['ref'];
|
|
59
58
|
}) => ReactElement;
|
|
60
|
-
redirect: <Pathname_1 extends keyof
|
|
61
|
-
permanentRedirect: <Pathname_2 extends keyof
|
|
62
|
-
usePathname: () => keyof
|
|
59
|
+
redirect: <Pathname_1 extends keyof AppPathnames>(href: HrefOrHrefWithParams<Pathname_1>, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
60
|
+
permanentRedirect: <Pathname_2 extends keyof AppPathnames>(href: HrefOrHrefWithParams<Pathname_2>, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
61
|
+
usePathname: () => keyof AppPathnames;
|
|
63
62
|
useRouter: () => {
|
|
64
|
-
push<Pathname_3 extends keyof
|
|
65
|
-
locale?:
|
|
63
|
+
push<Pathname_3 extends keyof AppPathnames>(href: HrefOrHrefWithParams<Pathname_3>, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & {
|
|
64
|
+
locale?: AppLocales[number] | undefined;
|
|
66
65
|
}) | undefined): void;
|
|
67
|
-
replace<Pathname_4 extends keyof
|
|
68
|
-
locale?:
|
|
66
|
+
replace<Pathname_4 extends keyof AppPathnames>(href: HrefOrHrefWithParams<Pathname_4>, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & {
|
|
67
|
+
locale?: AppLocales[number] | undefined;
|
|
69
68
|
}) | undefined): void;
|
|
70
|
-
prefetch<Pathname_5 extends keyof
|
|
71
|
-
locale?:
|
|
69
|
+
prefetch<Pathname_5 extends keyof AppPathnames>(href: HrefOrHrefWithParams<Pathname_5>, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions & {
|
|
70
|
+
locale?: AppLocales[number] | undefined;
|
|
72
71
|
}) | undefined): void;
|
|
73
72
|
back(): void;
|
|
74
73
|
forward(): void;
|
|
75
74
|
refresh(): void;
|
|
76
75
|
};
|
|
77
76
|
getPathname: ({ href, locale }: {
|
|
78
|
-
locale:
|
|
79
|
-
href: HrefOrHrefWithParams<keyof
|
|
77
|
+
locale: AppLocales[number];
|
|
78
|
+
href: HrefOrHrefWithParams<keyof AppPathnames>;
|
|
80
79
|
}) => string;
|
|
81
80
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import React, { ReactElement } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
export default function createSharedPathnamesNavigation<
|
|
6
|
-
locales?: Locales;
|
|
7
|
-
localePrefix?: LocalePrefix;
|
|
8
|
-
}): {
|
|
3
|
+
import { Locales } from '../../routing/types';
|
|
4
|
+
import { SharedNavigationRoutingConfigInput } from '../shared/config';
|
|
5
|
+
export default function createSharedPathnamesNavigation<const AppLocales extends Locales>(input?: SharedNavigationRoutingConfigInput<AppLocales>): {
|
|
9
6
|
Link: (props: Omit<Omit<Omit<Omit<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
|
|
10
7
|
href: string | import("url").UrlObject;
|
|
11
8
|
as?: (string | import("url").UrlObject) | undefined;
|
|
@@ -36,9 +33,11 @@ export default function createSharedPathnamesNavigation<Locales extends AllLocal
|
|
|
36
33
|
children?: React.ReactNode;
|
|
37
34
|
} & React.RefAttributes<HTMLAnchorElement>, "locale"> & {
|
|
38
35
|
locale: string;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
prefix: string;
|
|
37
|
+
localePrefixMode: import("../../routing/types").LocalePrefixMode;
|
|
38
|
+
}, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale" | "prefix" | "localePrefixMode"> & {
|
|
39
|
+
locale?: AppLocales[number] | undefined;
|
|
40
|
+
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<AppLocales>;
|
|
42
41
|
} & {
|
|
43
42
|
ref?: React.LegacyRef<HTMLAnchorElement> | undefined;
|
|
44
43
|
}, "localePrefix"> & {
|
|
@@ -47,5 +46,18 @@ export default function createSharedPathnamesNavigation<Locales extends AllLocal
|
|
|
47
46
|
redirect: (pathname: string, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
48
47
|
permanentRedirect: (pathname: string, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
49
48
|
usePathname: () => string;
|
|
50
|
-
useRouter:
|
|
49
|
+
useRouter: () => {
|
|
50
|
+
push: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & {
|
|
51
|
+
locale?: AppLocales[number] | undefined;
|
|
52
|
+
}) | undefined) => void;
|
|
53
|
+
replace: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & {
|
|
54
|
+
locale?: AppLocales[number] | undefined;
|
|
55
|
+
}) | undefined) => void;
|
|
56
|
+
prefetch: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions & {
|
|
57
|
+
locale?: AppLocales[number] | undefined;
|
|
58
|
+
}) | undefined) => void;
|
|
59
|
+
back(): void;
|
|
60
|
+
forward(): void;
|
|
61
|
+
refresh(): void;
|
|
62
|
+
};
|
|
51
63
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { default as createSharedPathnamesNavigation } from './createSharedPathnamesNavigation';
|
|
2
2
|
export { default as createLocalizedPathnamesNavigation } from './createLocalizedPathnamesNavigation';
|
|
3
|
-
|
|
3
|
+
import type { Pathnames as PathnamesDeprecatedExport, Locales } from '../../routing/types';
|
|
4
|
+
/** @deprecated Please import from `next-intl/routing` instead. */
|
|
5
|
+
export type Pathnames<AppLocales extends Locales> = PathnamesDeprecatedExport<AppLocales>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const clientRedirect: (params: Omit<{
|
|
2
|
+
pathname: string;
|
|
3
|
+
locale: string;
|
|
4
|
+
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<import("../../routing/types").Locales>;
|
|
5
|
+
}, "locale">, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
6
|
+
export declare const clientPermanentRedirect: (params: Omit<{
|
|
7
|
+
pathname: string;
|
|
8
|
+
locale: string;
|
|
9
|
+
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<import("../../routing/types").Locales>;
|
|
10
|
+
}, "locale">, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Locales, LocalePrefixConfigVerbose } from '../../routing/types';
|
|
1
2
|
/**
|
|
2
3
|
* Returns the pathname without a potential locale prefix.
|
|
3
4
|
*
|
|
@@ -11,4 +12,4 @@
|
|
|
11
12
|
* const pathname = usePathname();
|
|
12
13
|
* ```
|
|
13
14
|
*/
|
|
14
|
-
export default function useBasePathname(): string | null;
|
|
15
|
+
export default function useBasePathname<AppLocales extends Locales>(localePrefix: LocalePrefixConfigVerbose<AppLocales>): string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type IntlNavigateOptions<
|
|
3
|
-
locale?:
|
|
1
|
+
import { Locales, LocalePrefixConfigVerbose } from '../../routing/types';
|
|
2
|
+
type IntlNavigateOptions<AppLocales extends Locales> = {
|
|
3
|
+
locale?: AppLocales[number];
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* Returns a wrapped instance of `useRouter` from `next/navigation` that
|
|
@@ -21,10 +21,10 @@ type IntlNavigateOptions<Locales extends AllLocales> = {
|
|
|
21
21
|
* router.push('/about', {locale: 'de'});
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
export default function useBaseRouter<
|
|
25
|
-
push: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions<
|
|
26
|
-
replace: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions<
|
|
27
|
-
prefetch: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions & IntlNavigateOptions<
|
|
24
|
+
export default function useBaseRouter<AppLocales extends Locales>(localePrefix: LocalePrefixConfigVerbose<AppLocales>): {
|
|
25
|
+
push: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions<AppLocales>) | undefined) => void;
|
|
26
|
+
replace: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & IntlNavigateOptions<AppLocales>) | undefined) => void;
|
|
27
|
+
prefetch: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions & IntlNavigateOptions<AppLocales>) | undefined) => void;
|
|
28
28
|
back(): void;
|
|
29
29
|
forward(): void;
|
|
30
30
|
refresh(): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ComponentProps } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Locales, LocalePrefixConfigVerbose } from '../../routing/types';
|
|
3
3
|
import BaseLink from '../shared/BaseLink';
|
|
4
|
-
type Props<
|
|
5
|
-
locale?:
|
|
4
|
+
type Props<AppLocales extends Locales> = Omit<ComponentProps<typeof BaseLink>, 'locale' | 'prefix' | 'localePrefixMode'> & {
|
|
5
|
+
locale?: AppLocales[number];
|
|
6
|
+
localePrefix: LocalePrefixConfigVerbose<AppLocales>;
|
|
6
7
|
};
|
|
7
|
-
export default function ServerLink<
|
|
8
|
+
export default function ServerLink<AppLocales extends Locales>({ locale, localePrefix, ...rest }: Props<AppLocales>): Promise<React.JSX.Element>;
|
|
8
9
|
export {};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Locales, Pathnames } from '../../routing/types';
|
|
4
|
+
import { LocalizedNavigationRoutingConfigInput } from '../shared/config';
|
|
4
5
|
import { HrefOrHrefWithParams } from '../shared/utils';
|
|
5
|
-
export default function createLocalizedPathnamesNavigation<
|
|
6
|
-
|
|
7
|
-
pathnames: Pathnames<Locales>;
|
|
8
|
-
localePrefix?: LocalePrefix;
|
|
9
|
-
}): {
|
|
10
|
-
Link: <Pathname extends keyof PathnamesConfig>({ href, locale, ...rest }: Omit<Omit<Omit<Omit<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
|
|
6
|
+
export default function createLocalizedPathnamesNavigation<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>>(input: LocalizedNavigationRoutingConfigInput<AppLocales, AppPathnames>): {
|
|
7
|
+
Link: <Pathname extends keyof AppPathnames>({ href, locale, ...rest }: Omit<Omit<Omit<Omit<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
|
|
11
8
|
href: string | import("url").UrlObject;
|
|
12
9
|
as?: (string | import("url").UrlObject) | undefined;
|
|
13
10
|
replace?: boolean | undefined;
|
|
@@ -37,10 +34,12 @@ export default function createLocalizedPathnamesNavigation<Locales extends AllLo
|
|
|
37
34
|
children?: React.ReactNode;
|
|
38
35
|
} & React.RefAttributes<HTMLAnchorElement>, "locale"> & {
|
|
39
36
|
locale: string;
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
prefix: string;
|
|
38
|
+
localePrefixMode: import("../../routing/types").LocalePrefixMode;
|
|
39
|
+
}, "ref"> & React.RefAttributes<HTMLAnchorElement>, "locale" | "prefix" | "localePrefixMode"> & {
|
|
42
40
|
locale?: string | undefined;
|
|
43
|
-
|
|
41
|
+
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<Locales>;
|
|
42
|
+
}, "href" | "localePrefix" | "name"> & {
|
|
44
43
|
href: Pathname extends `${string}[[...${string}` ? Pathname | ({
|
|
45
44
|
pathname: Pathname;
|
|
46
45
|
params?: import("../shared/StrictParams").default<Pathname> | undefined;
|
|
@@ -50,13 +49,13 @@ export default function createLocalizedPathnamesNavigation<Locales extends AllLo
|
|
|
50
49
|
} & Omit<import("url").UrlObject, "pathname"> : Pathname | ({
|
|
51
50
|
pathname: Pathname;
|
|
52
51
|
} & Omit<import("url").UrlObject, "pathname">);
|
|
53
|
-
locale?:
|
|
52
|
+
locale?: AppLocales[number] | undefined;
|
|
54
53
|
}) => React.JSX.Element;
|
|
55
|
-
redirect: <Pathname_1 extends keyof
|
|
56
|
-
permanentRedirect: <Pathname_2 extends keyof
|
|
54
|
+
redirect: <Pathname_1 extends keyof AppPathnames>(href: HrefOrHrefWithParams<Pathname_1>, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
55
|
+
permanentRedirect: <Pathname_2 extends keyof AppPathnames>(href: HrefOrHrefWithParams<Pathname_2>, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
57
56
|
getPathname: ({ href, locale }: {
|
|
58
|
-
locale:
|
|
59
|
-
href: HrefOrHrefWithParams<keyof
|
|
57
|
+
locale: AppLocales[number];
|
|
58
|
+
href: HrefOrHrefWithParams<keyof AppPathnames>;
|
|
60
59
|
}) => string;
|
|
61
60
|
usePathname: () => never;
|
|
62
61
|
useRouter: () => never;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { ComponentProps } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Locales } from '../../routing/types';
|
|
3
|
+
import { SharedNavigationRoutingConfigInput } from '../shared/config';
|
|
3
4
|
import ServerLink from './ServerLink';
|
|
4
|
-
export default function createSharedPathnamesNavigation<
|
|
5
|
-
locales
|
|
6
|
-
localePrefix?: LocalePrefix;
|
|
7
|
-
}): {
|
|
8
|
-
Link: (props: ComponentProps<typeof ServerLink<Locales>>) => React.JSX.Element;
|
|
5
|
+
export default function createSharedPathnamesNavigation<AppLocales extends Locales>(input?: SharedNavigationRoutingConfigInput<AppLocales>): {
|
|
6
|
+
Link: (props: Omit<ComponentProps<typeof ServerLink<AppLocales>>, 'localePrefix' | 'locales'>) => React.JSX.Element;
|
|
9
7
|
redirect: (pathname: string, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
10
8
|
permanentRedirect: (pathname: string, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
11
9
|
usePathname: () => never;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as createSharedPathnamesNavigation } from './createSharedPathnamesNavigation';
|
|
2
2
|
export { default as createLocalizedPathnamesNavigation } from './createLocalizedPathnamesNavigation';
|
|
3
|
-
export type { Pathnames } from '../../
|
|
3
|
+
export type { Pathnames } from '../../routing/types';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const serverRedirect: (params: Omit<{
|
|
2
|
+
pathname: string;
|
|
3
|
+
locale: string;
|
|
4
|
+
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<import("../../routing/types").Locales>;
|
|
5
|
+
}, "locale">, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
6
|
+
export declare const serverPermanentRedirect: (params: Omit<{
|
|
7
|
+
pathname: string;
|
|
8
|
+
locale: string;
|
|
9
|
+
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<import("../../routing/types").Locales>;
|
|
10
|
+
}, "locale">, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import NextLink from 'next/link';
|
|
2
2
|
import React, { ComponentProps } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { LocalePrefixMode } from '../../routing/types';
|
|
4
4
|
type Props = Omit<ComponentProps<typeof NextLink>, 'locale'> & {
|
|
5
5
|
locale: string;
|
|
6
|
-
|
|
6
|
+
prefix: string;
|
|
7
|
+
localePrefixMode: LocalePrefixMode;
|
|
7
8
|
};
|
|
8
9
|
declare const BaseLinkWithRef: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
9
10
|
export default BaseLinkWithRef;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RoutingBaseConfigInput } from '../../routing/config';
|
|
2
|
+
import { Locales, LocalePrefixConfigVerbose, Pathnames } from '../../routing/types';
|
|
3
|
+
/**
|
|
4
|
+
* Shared pathnames
|
|
5
|
+
*/
|
|
6
|
+
export type SharedNavigationRoutingConfigInput<AppLocales extends Locales> = RoutingBaseConfigInput<AppLocales> & {
|
|
7
|
+
locales?: AppLocales;
|
|
8
|
+
};
|
|
9
|
+
export type SharedNavigationRoutingConfig<AppLocales extends Locales> = SharedNavigationRoutingConfigInput<AppLocales> & {
|
|
10
|
+
localePrefix: LocalePrefixConfigVerbose<AppLocales>;
|
|
11
|
+
};
|
|
12
|
+
export declare function receiveSharedNavigationRoutingConfig<AppLocales extends Locales>(input?: SharedNavigationRoutingConfigInput<AppLocales>): SharedNavigationRoutingConfig<AppLocales>;
|
|
13
|
+
/**
|
|
14
|
+
* Localized pathnames
|
|
15
|
+
*/
|
|
16
|
+
export type LocalizedNavigationRoutingConfigInput<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>> = RoutingBaseConfigInput<AppLocales> & {
|
|
17
|
+
locales: AppLocales;
|
|
18
|
+
/** Maps internal pathnames to external ones which can be localized per locale. */
|
|
19
|
+
pathnames: AppPathnames;
|
|
20
|
+
};
|
|
21
|
+
export type LocalizedNavigationRoutingConfig<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>> = LocalizedNavigationRoutingConfigInput<AppLocales, AppPathnames> & {
|
|
22
|
+
localePrefix: LocalePrefixConfigVerbose<AppLocales>;
|
|
23
|
+
};
|
|
24
|
+
export declare function receiveLocalizedNavigationRoutingConfig<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>>(input: LocalizedNavigationRoutingConfigInput<AppLocales, AppPathnames>): LocalizedNavigationRoutingConfig<AppLocales, AppPathnames>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Locales, LocalePrefixConfigVerbose } from '../../routing/types';
|
|
2
|
+
export declare const baseRedirect: <AppLocales extends Locales>(params: {
|
|
3
|
+
pathname: string;
|
|
4
|
+
locale: Locales[number];
|
|
5
|
+
localePrefix: LocalePrefixConfigVerbose<AppLocales>;
|
|
6
|
+
}, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
7
|
+
export declare const basePermanentRedirect: <AppLocales extends Locales>(params: {
|
|
8
|
+
pathname: string;
|
|
9
|
+
locale: Locales[number];
|
|
10
|
+
localePrefix: LocalePrefixConfigVerbose<AppLocales>;
|
|
11
|
+
}, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import type { ParsedUrlQueryInput } from 'node:querystring';
|
|
4
4
|
import type { UrlObject } from 'url';
|
|
5
|
-
import {
|
|
5
|
+
import { Locales, Pathnames } from '../../routing/types';
|
|
6
6
|
import StrictParams from './StrictParams';
|
|
7
7
|
type SearchParamValue = ParsedUrlQueryInput[keyof ParsedUrlQueryInput];
|
|
8
8
|
type HrefOrHrefWithParamsImpl<Pathname, Other> = Pathname extends `${string}[[...${string}` ? // Optional catch-all
|
|
@@ -29,24 +29,24 @@ export declare function serializeSearchParams(searchParams: Record<string, Searc
|
|
|
29
29
|
type StrictUrlObject<Pathname> = Omit<UrlObject, 'pathname'> & {
|
|
30
30
|
pathname: Pathname;
|
|
31
31
|
};
|
|
32
|
-
export declare function compileLocalizedPathname<
|
|
33
|
-
locale:
|
|
32
|
+
export declare function compileLocalizedPathname<AppLocales extends Locales, Pathname>(opts: {
|
|
33
|
+
locale: AppLocales[number];
|
|
34
34
|
pathname: Pathname;
|
|
35
35
|
params?: StrictParams<Pathname>;
|
|
36
|
-
pathnames: Pathnames<
|
|
36
|
+
pathnames: Pathnames<AppLocales>;
|
|
37
37
|
query?: Record<string, SearchParamValue>;
|
|
38
38
|
}): string;
|
|
39
|
-
export declare function compileLocalizedPathname<
|
|
40
|
-
locale:
|
|
39
|
+
export declare function compileLocalizedPathname<AppLocales extends Locales, Pathname>(opts: {
|
|
40
|
+
locale: AppLocales[number];
|
|
41
41
|
pathname: StrictUrlObject<Pathname>;
|
|
42
42
|
params?: StrictParams<Pathname>;
|
|
43
|
-
pathnames: Pathnames<
|
|
43
|
+
pathnames: Pathnames<AppLocales>;
|
|
44
44
|
query?: Record<string, SearchParamValue>;
|
|
45
45
|
}): UrlObject;
|
|
46
|
-
export declare function getRoute<
|
|
47
|
-
locale:
|
|
46
|
+
export declare function getRoute<AppLocales extends Locales>({ locale, pathname, pathnames }: {
|
|
47
|
+
locale: AppLocales[number];
|
|
48
48
|
pathname: string;
|
|
49
|
-
pathnames: Pathnames<
|
|
49
|
+
pathnames: Pathnames<AppLocales>;
|
|
50
50
|
}): string;
|
|
51
51
|
export declare function getBasePath(pathname: string, windowPathname?: string): string;
|
|
52
52
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Locales, DomainConfig, LocalePrefix, LocalePrefixConfigVerbose } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Maintainer note: The config that is accepted by the middleware, the shared
|
|
4
|
+
* and the localized pathnames navigation factory function is slightly
|
|
5
|
+
* different. This type declares the shared base config that is accepted by all
|
|
6
|
+
* of them. Properties that are different are declared in consuming types.
|
|
7
|
+
*/
|
|
8
|
+
export type RoutingBaseConfigInput<AppLocales extends Locales> = {
|
|
9
|
+
/** @see https://next-intl-docs.vercel.app/docs/routing#locale-prefix */
|
|
10
|
+
localePrefix?: LocalePrefix<AppLocales>;
|
|
11
|
+
/** Can be used to change the locale handling per domain. */
|
|
12
|
+
domains?: Array<DomainConfig<AppLocales>>;
|
|
13
|
+
};
|
|
14
|
+
export declare function receiveLocalePrefixConfig<AppLocales extends Locales>(localePrefix?: LocalePrefix<AppLocales>): LocalePrefixConfigVerbose<AppLocales>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type Locales = ReadonlyArray<string>;
|
|
2
|
+
export type LocalePrefixMode = 'always' | 'as-needed' | 'never';
|
|
3
|
+
type Pathname = string;
|
|
4
|
+
export type LocalePrefixes<AppLocales extends Locales> = Partial<Record<AppLocales[number], Pathname>>;
|
|
5
|
+
export type LocalePrefixConfigVerbose<AppLocales extends Locales> = {
|
|
6
|
+
mode: 'always';
|
|
7
|
+
prefixes?: LocalePrefixes<AppLocales>;
|
|
8
|
+
} | {
|
|
9
|
+
mode: 'as-needed';
|
|
10
|
+
prefixes?: LocalePrefixes<AppLocales>;
|
|
11
|
+
} | {
|
|
12
|
+
mode: 'never';
|
|
13
|
+
};
|
|
14
|
+
export type LocalePrefix<AppLocales extends Locales = never> = LocalePrefixMode | LocalePrefixConfigVerbose<AppLocales>;
|
|
15
|
+
export type Pathnames<AppLocales extends Locales> = Record<Pathname, Record<AppLocales[number], Pathname> | Pathname>;
|
|
16
|
+
export type DomainConfig<AppLocales extends Locales> = {
|
|
17
|
+
defaultLocale: AppLocales[number];
|
|
18
|
+
/** The domain name (e.g. "example.com", "www.example.com" or "fr.example.com"). Note that the `x-forwarded-host` or alternatively the `host` header will be used to determine the requested domain. */
|
|
19
|
+
domain: string;
|
|
20
|
+
/** Optionally restrict which locales are available on this domain. */
|
|
21
|
+
locales?: AppLocales;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './routing/index';
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export type AllLocales = ReadonlyArray<string>;
|
|
2
|
-
export type LocalePrefix = 'as-needed' | 'always' | 'never';
|
|
3
|
-
export type Pathnames<Locales extends AllLocales> = Record<string, {
|
|
4
|
-
[Key in Locales[number]]: string;
|
|
5
|
-
} | string>;
|
|
6
1
|
export type ParametersExceptFirst<Fn> = Fn extends (arg0: any, ...rest: infer R) => any ? R : never;
|
|
7
2
|
export type ParametersExceptFirstTwo<Fn> = Fn extends (arg0: any, arg1: any, ...rest: infer R) => any ? R : never;
|
|
@@ -2,20 +2,23 @@
|
|
|
2
2
|
import { UrlObject } from 'url';
|
|
3
3
|
import NextLink from 'next/link';
|
|
4
4
|
import { ComponentProps } from 'react';
|
|
5
|
+
import { Locales, LocalePrefixConfigVerbose } from '../routing/types';
|
|
5
6
|
type Href = ComponentProps<typeof NextLink>['href'];
|
|
6
7
|
export declare function isRelativeHref(href: Href): boolean;
|
|
7
8
|
export declare function isLocalHref(href: Href): boolean;
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function localizeHref(href:
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function prefixHref(href:
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function
|
|
14
|
-
export declare function
|
|
9
|
+
export declare function isLocalizableHref(href: Href): boolean;
|
|
10
|
+
export declare function localizeHref(href: string, locale: string, curLocale: string, curPathname: string, prefix: string): string;
|
|
11
|
+
export declare function localizeHref(href: UrlObject | string, locale: string, curLocale: string, curPathname: string, prefix: string): UrlObject | string;
|
|
12
|
+
export declare function prefixHref(href: string, prefix: string): string;
|
|
13
|
+
export declare function prefixHref(href: UrlObject | string, prefix: string): UrlObject | string;
|
|
14
|
+
export declare function unprefixPathname(pathname: string, prefix: string): string;
|
|
15
|
+
export declare function prefixPathname(prefix: string, pathname: string): string;
|
|
16
|
+
export declare function hasPathnamePrefixed(prefix: string, pathname: string): boolean;
|
|
15
17
|
export declare function matchesPathname(
|
|
16
18
|
/** E.g. `/users/[userId]-[userName]` */
|
|
17
19
|
template: string,
|
|
18
20
|
/** E.g. `/users/23-jane` */
|
|
19
21
|
pathname: string): boolean;
|
|
22
|
+
export declare function getLocalePrefix<AppLocales extends Locales>(locale: AppLocales[number], localePrefix: LocalePrefixConfigVerbose<AppLocales>): string;
|
|
20
23
|
export declare function templateToRegex(template: string): RegExp;
|
|
21
24
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0-custom-prefixes.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"funding": [
|
|
@@ -16,16 +16,6 @@
|
|
|
16
16
|
"type": "git",
|
|
17
17
|
"url": "https://github.com/amannn/next-intl"
|
|
18
18
|
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "rm -rf dist && rollup -c",
|
|
21
|
-
"test": "TZ=Europe/Berlin vitest",
|
|
22
|
-
"lint": "pnpm run lint:source && pnpm run lint:package",
|
|
23
|
-
"lint:source": "eslint src test && tsc --noEmit",
|
|
24
|
-
"lint:package": "publint && attw --pack",
|
|
25
|
-
"prepublishOnly": "CI=true turbo test && turbo lint && turbo build && cp ../../README.md .",
|
|
26
|
-
"postpublish": "git checkout . && rm ./README.md",
|
|
27
|
-
"size": "size-limit"
|
|
28
|
-
},
|
|
29
19
|
"main": "./dist/index.react-client.js",
|
|
30
20
|
"module": "./dist/esm/index.react-client.js",
|
|
31
21
|
"typings": "./dist/types/src/index.react-client.d.ts",
|
|
@@ -53,6 +43,10 @@
|
|
|
53
43
|
"react-server": "./dist/esm/navigation.react-server.js",
|
|
54
44
|
"default": "./dist/navigation.react-client.js"
|
|
55
45
|
},
|
|
46
|
+
"./routing": {
|
|
47
|
+
"types": "./routing.d.ts",
|
|
48
|
+
"default": "./dist/routing.js"
|
|
49
|
+
},
|
|
56
50
|
"./plugin": {
|
|
57
51
|
"types": "./plugin.d.ts",
|
|
58
52
|
"default": "./dist/plugin.js"
|
|
@@ -64,6 +58,7 @@
|
|
|
64
58
|
"navigation.d.ts",
|
|
65
59
|
"middleware.d.ts",
|
|
66
60
|
"plugin.d.ts",
|
|
61
|
+
"routing.d.ts",
|
|
67
62
|
"config.d.ts"
|
|
68
63
|
],
|
|
69
64
|
"keywords": [
|
|
@@ -111,6 +106,7 @@
|
|
|
111
106
|
"typescript": "^5.2.2",
|
|
112
107
|
"vitest": "^1.0.1"
|
|
113
108
|
},
|
|
109
|
+
"prettier": "../../.prettierrc.json",
|
|
114
110
|
"size-limit": [
|
|
115
111
|
{
|
|
116
112
|
"path": "dist/production/index.react-client.js",
|
|
@@ -122,11 +118,11 @@
|
|
|
122
118
|
},
|
|
123
119
|
{
|
|
124
120
|
"path": "dist/production/navigation.react-client.js",
|
|
125
|
-
"limit": "
|
|
121
|
+
"limit": "3.235 KB"
|
|
126
122
|
},
|
|
127
123
|
{
|
|
128
124
|
"path": "dist/production/navigation.react-server.js",
|
|
129
|
-
"limit": "17.
|
|
125
|
+
"limit": "17.815 KB"
|
|
130
126
|
},
|
|
131
127
|
{
|
|
132
128
|
"path": "dist/production/server.react-client.js",
|
|
@@ -138,8 +134,19 @@
|
|
|
138
134
|
},
|
|
139
135
|
{
|
|
140
136
|
"path": "dist/production/middleware.js",
|
|
141
|
-
"limit": "6.
|
|
137
|
+
"limit": "6.42 KB"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"path": "dist/production/routing.js",
|
|
141
|
+
"limit": "0 KB"
|
|
142
142
|
}
|
|
143
143
|
],
|
|
144
|
-
"
|
|
145
|
-
|
|
144
|
+
"scripts": {
|
|
145
|
+
"build": "rm -rf dist && rollup -c",
|
|
146
|
+
"test": "TZ=Europe/Berlin vitest",
|
|
147
|
+
"lint": "pnpm run lint:source && pnpm run lint:package",
|
|
148
|
+
"lint:source": "eslint src test && tsc --noEmit",
|
|
149
|
+
"lint:package": "publint && attw --pack",
|
|
150
|
+
"size": "size-limit"
|
|
151
|
+
}
|
|
152
|
+
}
|
package/routing.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/types/src/routing';
|