@koine/i18n 2.0.0-beta.76 → 2.0.0-beta.78
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/README.md +1 -0
- package/api.cjs.js +2203 -0
- package/api.esm.js +2179 -0
- package/compiler-sync.cjs.d.ts +1 -0
- package/compiler-sync.cjs.default.js +1 -0
- package/compiler-sync.cjs.js +20 -0
- package/compiler-sync.cjs.mjs +2 -0
- package/compiler-sync.esm.js +16 -0
- package/compiler-worker.cjs.d.ts +1 -0
- package/compiler-worker.cjs.default.js +1 -0
- package/compiler-worker.cjs.js +18 -0
- package/compiler-worker.cjs.mjs +2 -0
- package/compiler-worker.esm.js +16 -0
- package/compiler.cjs.d.ts +1 -0
- package/compiler.cjs.default.js +1 -0
- package/compiler.cjs.js +21 -0
- package/compiler.cjs.mjs +2 -0
- package/compiler.esm.js +13 -0
- package/formatRoutePathname.cjs.js +12 -0
- package/formatRoutePathname.esm.js +10 -0
- package/index.cjs.d.ts +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +47 -0
- package/index.cjs.mjs +2 -0
- package/index.esm.js +42 -0
- package/next.cjs.d.ts +1 -0
- package/next.cjs.default.js +1 -0
- package/next.cjs.js +377 -0
- package/next.cjs.mjs +2 -0
- package/next.esm.js +353 -0
- package/package.json +22 -305
- package/actions/helpers-git.js +0 -45
- package/actions/helpers-i18n.js +0 -27
- package/actions/i18n.js +0 -17
- package/adapter-js/code/config.cjs.js +0 -14
- package/adapter-js/code/config.js +0 -14
- package/adapter-js/code/defaultLocale.js +0 -7
- package/adapter-js/code/deriveLocalisedPathnames.js +0 -78
- package/adapter-js/code/index.js +0 -123
- package/adapter-js/code/isLocale.js +0 -9
- package/adapter-js/code/locales.js +0 -8
- package/adapter-js/code/pathnameToRouteId.js +0 -20
- package/adapter-js/code/routes.js +0 -11
- package/adapter-js/code/routesSlim.js +0 -11
- package/adapter-js/code/routesSpa.js +0 -11
- package/adapter-js/code/tFns.js +0 -34
- package/adapter-js/code/tInterpolateParams.js +0 -18
- package/adapter-js/code/tPluralise.js +0 -10
- package/adapter-js/code/to.js +0 -32
- package/adapter-js/code/toFns.js +0 -25
- package/adapter-js/code/toFormat.js +0 -56
- package/adapter-js/code/toSpa.js +0 -42
- package/adapter-js/code/types.js +0 -327
- package/adapter-next/code/index.js +0 -54
- package/adapter-next/code/next-redirects.js +0 -5
- package/adapter-next/code/next-rewrites.js +0 -5
- package/adapter-next/code/useCurrentLocalisedPathnames.js +0 -20
- package/adapter-next/code/useLocale.js +0 -8
- package/adapter-next/code/useRouteId.js +0 -10
- package/adapter-next/code/useTo.js +0 -26
- package/adapter-next/code/useToSpa.js +0 -34
- package/adapter-next/plugin-async.js +0 -11
- package/adapter-next/plugin-legacy.js +0 -187
- package/adapter-next/plugin-shared.js +0 -39
- package/adapter-next/plugin.js +0 -13
- package/adapter-next/redirects.js +0 -51
- package/adapter-next/rewrites.js +0 -50
- package/adapter-next/transformPathname.js +0 -3
- package/adapter-next/webpackPluginI18n.js +0 -11
- package/adapter-next-translate/code/DynamicNamespaces.js +0 -9
- package/adapter-next-translate/code/T.js +0 -31
- package/adapter-next-translate/code/TransText.js +0 -9
- package/adapter-next-translate/code/getT.js +0 -15
- package/adapter-next-translate/code/index.js +0 -49
- package/adapter-next-translate/code/nextTranslateI18n.js +0 -19
- package/adapter-next-translate/code/useT.js +0 -43
- package/cjs/adapter-js/code/config.cjs.d.ts +0 -3
- package/cjs/adapter-js/code/config.d.ts +0 -3
- package/cjs/adapter-js/code/defaultLocale.d.ts +0 -3
- package/cjs/adapter-js/code/deriveLocalisedPathnames.d.ts +0 -2
- package/cjs/adapter-js/code/index.d.ts +0 -3
- package/cjs/adapter-js/code/isLocale.d.ts +0 -2
- package/cjs/adapter-js/code/locales.d.ts +0 -3
- package/cjs/adapter-js/code/pathnameToRouteId.d.ts +0 -3
- package/cjs/adapter-js/code/routes.d.ts +0 -3
- package/cjs/adapter-js/code/routesSlim.d.ts +0 -3
- package/cjs/adapter-js/code/routesSpa.d.ts +0 -3
- package/cjs/adapter-js/code/tFns.d.ts +0 -3
- package/cjs/adapter-js/code/tInterpolateParams.d.ts +0 -3
- package/cjs/adapter-js/code/tPluralise.d.ts +0 -2
- package/cjs/adapter-js/code/to.d.ts +0 -3
- package/cjs/adapter-js/code/toFns.d.ts +0 -3
- package/cjs/adapter-js/code/toFormat.d.ts +0 -3
- package/cjs/adapter-js/code/toSpa.d.ts +0 -3
- package/cjs/adapter-js/code/types.d.ts +0 -3
- package/cjs/adapter-next/code/index.d.ts +0 -3
- package/cjs/adapter-next/code/next-redirects.d.ts +0 -3
- package/cjs/adapter-next/code/next-rewrites.d.ts +0 -3
- package/cjs/adapter-next/code/useCurrentLocalisedPathnames.d.ts +0 -2
- package/cjs/adapter-next/code/useLocale.d.ts +0 -3
- package/cjs/adapter-next/code/useRouteId.d.ts +0 -2
- package/cjs/adapter-next/code/useTo.d.ts +0 -2
- package/cjs/adapter-next/code/useToSpa.d.ts +0 -2
- package/cjs/adapter-next/plugin-async.d.ts +0 -9
- package/cjs/adapter-next/plugin-legacy.d.ts +0 -22
- package/cjs/adapter-next/plugin-shared.d.ts +0 -13
- package/cjs/adapter-next/plugin.d.ts +0 -7
- package/cjs/adapter-next/redirects.d.ts +0 -4
- package/cjs/adapter-next/rewrites.d.ts +0 -4
- package/cjs/adapter-next/transformPathname.d.ts +0 -1
- package/cjs/adapter-next/webpackPluginI18n.d.ts +0 -7
- package/cjs/adapter-next-translate/code/DynamicNamespaces.d.ts +0 -2
- package/cjs/adapter-next-translate/code/T.d.ts +0 -2
- package/cjs/adapter-next-translate/code/TransText.d.ts +0 -2
- package/cjs/adapter-next-translate/code/getT.d.ts +0 -2
- package/cjs/adapter-next-translate/code/index.d.ts +0 -3
- package/cjs/adapter-next-translate/code/nextTranslateI18n.d.ts +0 -3
- package/cjs/adapter-next-translate/code/useT.d.ts +0 -2
- package/cjs/client/formatRoutePathname.d.ts +0 -4
- package/cjs/client/index.d.ts +0 -3
- package/cjs/client/interpolateTo.d.ts +0 -4
- package/cjs/client/routeHasDynamicPortion.d.ts +0 -2
- package/cjs/compiler/api.d.ts +0 -30
- package/cjs/compiler/code/data-routes.d.ts +0 -19
- package/cjs/compiler/code/data-translations.d.ts +0 -13
- package/cjs/compiler/code/data.d.ts +0 -33
- package/cjs/compiler/code/generate.d.ts +0 -14
- package/cjs/compiler/code/index.d.ts +0 -3
- package/cjs/compiler/code/tsCompile.d.ts +0 -2
- package/cjs/compiler/code/write.d.ts +0 -11
- package/cjs/compiler/config.d.ts +0 -12
- package/cjs/compiler/helpers.d.ts +0 -2
- package/cjs/compiler/input/data-local.d.ts +0 -4
- package/cjs/compiler/input/data-remote.d.ts +0 -7
- package/cjs/compiler/input/data.d.ts +0 -4
- package/cjs/compiler/input/index.d.ts +0 -4
- package/cjs/compiler/input/types.d.ts +0 -14
- package/cjs/compiler/input/write.d.ts +0 -8
- package/cjs/compiler/pluralisation.d.ts +0 -37
- package/cjs/compiler/summary/data.d.ts +0 -6
- package/cjs/compiler/summary/generate.d.ts +0 -4
- package/cjs/compiler/summary/index.d.ts +0 -3
- package/cjs/compiler/summary/write.d.ts +0 -10
- package/cjs/compiler/types.d.ts +0 -82
- package/cjs/compiler-sync.d.ts +0 -4
- package/cjs/compiler-worker.d.ts +0 -1
- package/cjs/compiler.d.ts +0 -2
- package/cjs/i18n/actions/helpers-git.js +0 -45
- package/cjs/i18n/actions/helpers-i18n.js +0 -27
- package/cjs/i18n/actions/i18n.js +0 -17
- package/cjs/i18n/adapter-js/code/config.cjs.js +0 -14
- package/cjs/i18n/adapter-js/code/config.js +0 -14
- package/cjs/i18n/adapter-js/code/defaultLocale.js +0 -7
- package/cjs/i18n/adapter-js/code/deriveLocalisedPathnames.js +0 -78
- package/cjs/i18n/adapter-js/code/index.js +0 -123
- package/cjs/i18n/adapter-js/code/isLocale.js +0 -9
- package/cjs/i18n/adapter-js/code/locales.js +0 -8
- package/cjs/i18n/adapter-js/code/pathnameToRouteId.js +0 -20
- package/cjs/i18n/adapter-js/code/routes.js +0 -11
- package/cjs/i18n/adapter-js/code/routesSlim.js +0 -11
- package/cjs/i18n/adapter-js/code/routesSpa.js +0 -11
- package/cjs/i18n/adapter-js/code/tFns.js +0 -34
- package/cjs/i18n/adapter-js/code/tInterpolateParams.js +0 -18
- package/cjs/i18n/adapter-js/code/tPluralise.js +0 -10
- package/cjs/i18n/adapter-js/code/to.js +0 -32
- package/cjs/i18n/adapter-js/code/toFns.js +0 -25
- package/cjs/i18n/adapter-js/code/toFormat.js +0 -56
- package/cjs/i18n/adapter-js/code/toSpa.js +0 -42
- package/cjs/i18n/adapter-js/code/types.js +0 -327
- package/cjs/i18n/adapter-next/code/index.js +0 -54
- package/cjs/i18n/adapter-next/code/next-redirects.js +0 -5
- package/cjs/i18n/adapter-next/code/next-rewrites.js +0 -5
- package/cjs/i18n/adapter-next/code/useCurrentLocalisedPathnames.js +0 -20
- package/cjs/i18n/adapter-next/code/useLocale.js +0 -8
- package/cjs/i18n/adapter-next/code/useRouteId.js +0 -10
- package/cjs/i18n/adapter-next/code/useTo.js +0 -26
- package/cjs/i18n/adapter-next/code/useToSpa.js +0 -34
- package/cjs/i18n/adapter-next/plugin-async.js +0 -11
- package/cjs/i18n/adapter-next/plugin-legacy.js +0 -187
- package/cjs/i18n/adapter-next/plugin-shared.js +0 -39
- package/cjs/i18n/adapter-next/plugin.js +0 -13
- package/cjs/i18n/adapter-next/redirects.js +0 -51
- package/cjs/i18n/adapter-next/rewrites.js +0 -50
- package/cjs/i18n/adapter-next/transformPathname.js +0 -3
- package/cjs/i18n/adapter-next/webpackPluginI18n.js +0 -11
- package/cjs/i18n/adapter-next-translate/code/DynamicNamespaces.js +0 -9
- package/cjs/i18n/adapter-next-translate/code/T.js +0 -31
- package/cjs/i18n/adapter-next-translate/code/TransText.js +0 -9
- package/cjs/i18n/adapter-next-translate/code/getT.js +0 -15
- package/cjs/i18n/adapter-next-translate/code/index.js +0 -49
- package/cjs/i18n/adapter-next-translate/code/nextTranslateI18n.js +0 -19
- package/cjs/i18n/adapter-next-translate/code/useT.js +0 -43
- package/cjs/i18n/client/formatRoutePathname.js +0 -5
- package/cjs/i18n/client/index.js +0 -3
- package/cjs/i18n/client/interpolateTo.js +0 -14
- package/cjs/i18n/client/routeHasDynamicPortion.js +0 -2
- package/cjs/i18n/compiler/api.js +0 -18
- package/cjs/i18n/compiler/code/data-routes.js +0 -99
- package/cjs/i18n/compiler/code/data-translations.js +0 -86
- package/cjs/i18n/compiler/code/data.js +0 -20
- package/cjs/i18n/compiler/code/generate.js +0 -46
- package/cjs/i18n/compiler/code/index.js +0 -2
- package/cjs/i18n/compiler/code/tsCompile.js +0 -27
- package/cjs/i18n/compiler/code/write.js +0 -39
- package/cjs/i18n/compiler/config.js +0 -13
- package/cjs/i18n/compiler/helpers.js +0 -14
- package/cjs/i18n/compiler/input/data-local.js +0 -60
- package/cjs/i18n/compiler/input/data-remote.js +0 -41
- package/cjs/i18n/compiler/input/data.js +0 -11
- package/cjs/i18n/compiler/input/index.js +0 -3
- package/cjs/i18n/compiler/input/types.js +0 -1
- package/cjs/i18n/compiler/input/write.js +0 -15
- package/cjs/i18n/compiler/pluralisation.js +0 -59
- package/cjs/i18n/compiler/summary/data.js +0 -28
- package/cjs/i18n/compiler/summary/generate.js +0 -27
- package/cjs/i18n/compiler/summary/index.js +0 -2
- package/cjs/i18n/compiler/summary/write.js +0 -18
- package/cjs/i18n/compiler/types.js +0 -1
- package/cjs/i18n/compiler-sync.js +0 -2
- package/cjs/i18n/compiler-worker.js +0 -3
- package/cjs/i18n/compiler.js +0 -1
- package/cjs/i18n/index.js +0 -2
- package/cjs/i18n/next.js +0 -3
- package/cjs/i18n/types.js +0 -1
- package/cjs/index.d.ts +0 -2
- package/cjs/next.d.ts +0 -3
- package/cjs/package.json +0 -34
- package/cjs/types.d.ts +0 -48
- package/client/formatRoutePathname.js +0 -5
- package/client/index.js +0 -3
- package/client/interpolateTo.js +0 -14
- package/client/routeHasDynamicPortion.js +0 -2
- package/compiler/api.js +0 -18
- package/compiler/code/data-routes.js +0 -99
- package/compiler/code/data-translations.js +0 -86
- package/compiler/code/data.js +0 -20
- package/compiler/code/generate.js +0 -46
- package/compiler/code/index.js +0 -2
- package/compiler/code/tsCompile.js +0 -27
- package/compiler/code/write.js +0 -39
- package/compiler/config.js +0 -13
- package/compiler/helpers.js +0 -14
- package/compiler/input/data-local.js +0 -60
- package/compiler/input/data-remote.js +0 -41
- package/compiler/input/data.js +0 -11
- package/compiler/input/index.js +0 -3
- package/compiler/input/types.js +0 -1
- package/compiler/input/write.js +0 -15
- package/compiler/pluralisation.js +0 -59
- package/compiler/summary/data.js +0 -28
- package/compiler/summary/generate.js +0 -27
- package/compiler/summary/index.js +0 -2
- package/compiler/summary/write.js +0 -18
- package/compiler/types.js +0 -1
- package/compiler-sync.js +0 -2
- package/compiler-worker.js +0 -3
- package/compiler.js +0 -1
- package/index.js +0 -2
- package/next.js +0 -3
- package/types.js +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { NextConfig } from "next";
|
|
2
|
-
import { type I18nCompilerOptions } from "../compiler";
|
|
3
|
-
import { type I18nCompilerNextOptions } from "./plugin-shared";
|
|
4
|
-
type NextConfigFn = (phase: string, context?: any) => Promise<NextConfig> | NextConfig;
|
|
5
|
-
export type WithI18nAsyncOptions = NextConfig & {
|
|
6
|
-
i18nCompiler?: I18nCompilerOptions & I18nCompilerNextOptions;
|
|
7
|
-
};
|
|
8
|
-
export declare let withI18nAsync: (config?: WithI18nAsyncOptions) => NextConfigFn;
|
|
9
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { NextConfig } from "next";
|
|
2
|
-
type Route = string | {
|
|
3
|
-
[key: string]: Route | string;
|
|
4
|
-
};
|
|
5
|
-
type RoutesByLocale = Record<string, Route>;
|
|
6
|
-
type Locale = string;
|
|
7
|
-
type Routes = Record<Locale, RoutesByLocale>;
|
|
8
|
-
type I18nRoutesOptions = {
|
|
9
|
-
routes: Routes;
|
|
10
|
-
permanent?: boolean;
|
|
11
|
-
locales: Locale[];
|
|
12
|
-
defaultLocale: Locale;
|
|
13
|
-
hideDefaultLocaleInUrl?: boolean;
|
|
14
|
-
localeParam?: string;
|
|
15
|
-
debug?: boolean;
|
|
16
|
-
};
|
|
17
|
-
type I18nRoutesNextOptions = Omit<I18nRoutesOptions, "locales" | "defaultLocale">;
|
|
18
|
-
export type WithI18nLegacyOptions = NextConfig & {
|
|
19
|
-
i18nRoutes?: I18nRoutesNextOptions;
|
|
20
|
-
};
|
|
21
|
-
export declare let withI18nLegacy: (config: WithI18nLegacyOptions) => NextConfig;
|
|
22
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { NextConfig } from "next";
|
|
2
|
-
import type { I18nCompilerOptions, I18nCompilerReturn } from "../compiler";
|
|
3
|
-
export type I18nCompilerNextOptions = {
|
|
4
|
-
appRouterLocaleParamName?: string;
|
|
5
|
-
permanentRedirects?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare let tweakNextConfig: (options: Required<Pick<I18nCompilerOptions, "defaultLocale" | "locales">> & I18nCompilerNextOptions, nextConfig: NextConfig) => NextConfig;
|
|
8
|
-
export declare let getRedirects: (prevRedirects: NextConfig["redirects"], { appRouterLocaleParamName, permanentRedirects }: I18nCompilerNextOptions, i18nResult: I18nCompilerReturn) => Promise<import("next/dist/lib/load-custom-routes").Redirect[]>;
|
|
9
|
-
export declare let getRewrites: (prevRewrites: NextConfig["rewrites"], { appRouterLocaleParamName }: I18nCompilerNextOptions, i18nResult: I18nCompilerReturn) => Promise<{
|
|
10
|
-
beforeFiles: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
11
|
-
afterFiles: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
12
|
-
fallback: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
13
|
-
}>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { NextConfig } from "next";
|
|
2
|
-
import { type I18nCompilerOptions } from "../compiler";
|
|
3
|
-
import { type I18nCompilerNextOptions } from "./plugin-shared";
|
|
4
|
-
export type WithI18nOptions = NextConfig & {
|
|
5
|
-
i18nCompiler?: I18nCompilerOptions & I18nCompilerNextOptions;
|
|
6
|
-
};
|
|
7
|
-
export declare let withI18n: (config?: WithI18nOptions) => NextConfig;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Redirect } from "next/dist/lib/load-custom-routes";
|
|
2
|
-
import type { CodeDataRoutesOptions } from "../compiler/code/data-routes";
|
|
3
|
-
import type { I18nCompiler } from "../compiler/types";
|
|
4
|
-
export declare let generateRedirects: (config: I18nCompiler.Config, routes: I18nCompiler.DataRoutes["byId"], options: CodeDataRoutesOptions, localeParam?: string, permanent?: boolean) => Redirect[];
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Rewrite } from "next/dist/lib/load-custom-routes";
|
|
2
|
-
import type { CodeDataRoutesOptions } from "../compiler/code/data-routes";
|
|
3
|
-
import type { I18nCompiler } from "../compiler/types";
|
|
4
|
-
export declare let generateRewrites: (config: I18nCompiler.Config, routes: I18nCompiler.DataRoutes["byId"], options: CodeDataRoutesOptions, localeParam?: string) => Rewrite[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function transformPathname(rawPathnameOrTemplate: string, wildcard?: boolean): string;
|
package/cjs/client/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { I18nUtils } from "../types";
|
|
2
|
-
export declare function interpolateTo<TRouteId extends string>(value: TRouteId): string;
|
|
3
|
-
export declare function interpolateTo<TRouteId extends string>(value: TRouteId, params: I18nUtils.DynamicParams<TRouteId>): string;
|
|
4
|
-
export default interpolateTo;
|
package/cjs/compiler/api.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type PartialDeep } from "@koine/utils";
|
|
2
|
-
import { type CodeDataOptions, type CodeGenerateOptions, type CodeWriteOptions } from "./code";
|
|
3
|
-
import { type InputDataOptions, type InputWriteOptions } from "./input";
|
|
4
|
-
import { type SummaryDataOptions, type SummaryGenerateOptions, type SummaryWriteOptions } from "./summary";
|
|
5
|
-
import type { I18nCompiler } from "./types";
|
|
6
|
-
type InputOptions = InputDataOptions & {
|
|
7
|
-
write?: InputWriteOptions;
|
|
8
|
-
};
|
|
9
|
-
type CodeOptions = PartialDeep<CodeDataOptions> & CodeGenerateOptions & {
|
|
10
|
-
write?: CodeWriteOptions;
|
|
11
|
-
};
|
|
12
|
-
type SummaryOptions = SummaryDataOptions & SummaryGenerateOptions & {
|
|
13
|
-
write?: SummaryWriteOptions;
|
|
14
|
-
};
|
|
15
|
-
export type I18nCompilerOptions = Partial<I18nCompiler.Config> & {
|
|
16
|
-
input: InputOptions;
|
|
17
|
-
code: CodeOptions;
|
|
18
|
-
summary?: SummaryOptions;
|
|
19
|
-
};
|
|
20
|
-
export type I18nCompilerReturn = Awaited<ReturnType<typeof i18nCompiler>>;
|
|
21
|
-
export declare let i18nCompiler: (options: I18nCompilerOptions) => Promise<{
|
|
22
|
-
config: {
|
|
23
|
-
locales: string[];
|
|
24
|
-
defaultLocale: string;
|
|
25
|
-
hideDefaultLocaleInUrl: boolean;
|
|
26
|
-
};
|
|
27
|
-
input: I18nCompiler.DataInput;
|
|
28
|
-
code: I18nCompiler.DataCode;
|
|
29
|
-
}>;
|
|
30
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
export declare const codeDataRoutesOptions: {
|
|
3
|
-
translationJsonFileName: string;
|
|
4
|
-
fnsPrefix: string;
|
|
5
|
-
tokens: {
|
|
6
|
-
parentReference: string;
|
|
7
|
-
idDelimiter: string;
|
|
8
|
-
catchAll: {
|
|
9
|
-
start: string;
|
|
10
|
-
end: string;
|
|
11
|
-
};
|
|
12
|
-
optionalCatchAll: {
|
|
13
|
-
start: string;
|
|
14
|
-
end: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type CodeDataRoutesOptions = typeof codeDataRoutesOptions;
|
|
19
|
-
export declare let getCodeDataRoutes: (config: I18nCompiler.Config, options: CodeDataRoutesOptions, { translationFiles }: I18nCompiler.DataInput) => I18nCompiler.DataRoutes;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
export declare const codeDataTranslationsOptions: {
|
|
3
|
-
ignorePaths: string[];
|
|
4
|
-
dynamicDelimiters: {
|
|
5
|
-
start: string;
|
|
6
|
-
end: string;
|
|
7
|
-
};
|
|
8
|
-
fnsAsDataCodes: boolean;
|
|
9
|
-
fnsPrefix: string;
|
|
10
|
-
createArrayIndexBasedFns: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type CodeDataTranslationsOptions = typeof codeDataTranslationsOptions;
|
|
13
|
-
export declare let getCodeDataTranslations: (_config: I18nCompiler.Config, options: CodeDataTranslationsOptions, { translationFiles }: I18nCompiler.DataInput) => I18nCompiler.DataTranslations;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type PartialDeep } from "@koine/utils";
|
|
2
|
-
import type { I18nCompiler } from "../types";
|
|
3
|
-
declare const codeDataOptions: {
|
|
4
|
-
routes: {
|
|
5
|
-
translationJsonFileName: string;
|
|
6
|
-
fnsPrefix: string;
|
|
7
|
-
tokens: {
|
|
8
|
-
parentReference: string;
|
|
9
|
-
idDelimiter: string;
|
|
10
|
-
catchAll: {
|
|
11
|
-
start: string;
|
|
12
|
-
end: string;
|
|
13
|
-
};
|
|
14
|
-
optionalCatchAll: {
|
|
15
|
-
start: string;
|
|
16
|
-
end: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
translations: {
|
|
21
|
-
ignorePaths: string[];
|
|
22
|
-
dynamicDelimiters: {
|
|
23
|
-
start: string;
|
|
24
|
-
end: string;
|
|
25
|
-
};
|
|
26
|
-
fnsAsDataCodes: boolean;
|
|
27
|
-
fnsPrefix: string;
|
|
28
|
-
createArrayIndexBasedFns: boolean;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export type CodeDataOptions = typeof codeDataOptions;
|
|
32
|
-
export declare let getCodeData: (config: I18nCompiler.Config, options: PartialDeep<CodeDataOptions>, input: I18nCompiler.DataInput) => I18nCompiler.DataCode;
|
|
33
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
export type CodeGenerateOptions = {
|
|
3
|
-
adapter: I18nCompiler.AdapterBuiltin;
|
|
4
|
-
outputFiles?: Partial<{}>;
|
|
5
|
-
};
|
|
6
|
-
export type CodeGenerateReturn = Awaited<ReturnType<typeof generateCode>> | ReturnType<typeof generateCodeSync>;
|
|
7
|
-
export declare let generateCode: (data: I18nCompiler.DataCode, options: CodeGenerateOptions) => Promise<{
|
|
8
|
-
files: I18nCompiler.AdpaterGeneratedFile[];
|
|
9
|
-
needsTranslationsFiles: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
export declare let generateCodeSync: (data: I18nCompiler.DataCode, options: CodeGenerateOptions) => {
|
|
12
|
-
files: I18nCompiler.AdpaterGeneratedFile[];
|
|
13
|
-
needsTranslationsFiles: boolean;
|
|
14
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
import { type CodeGenerateOptions } from "./generate";
|
|
3
|
-
export type CodeWriteOptions = {
|
|
4
|
-
cwd?: string;
|
|
5
|
-
output: string;
|
|
6
|
-
skipTsCompile?: boolean;
|
|
7
|
-
skipGitignore?: boolean;
|
|
8
|
-
skipTranslations?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare let writeCode: (options: CodeWriteOptions & CodeGenerateOptions, data: I18nCompiler.DataCode) => Promise<void>;
|
|
11
|
-
export declare let writeCodeSync: (options: CodeWriteOptions & CodeGenerateOptions, data: I18nCompiler.DataCode) => void;
|
package/cjs/compiler/config.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "./types";
|
|
2
|
-
export type I18nCompilerConfig = typeof configDefaults;
|
|
3
|
-
export declare const configDefaults: {
|
|
4
|
-
locales: string[];
|
|
5
|
-
defaultLocale: string;
|
|
6
|
-
hideDefaultLocaleInUrl: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare let getConfig: (dataInput: I18nCompiler.DataInput, options?: Partial<I18nCompilerConfig>) => {
|
|
9
|
-
locales: string[];
|
|
10
|
-
defaultLocale: string;
|
|
11
|
-
hideDefaultLocaleInUrl: boolean;
|
|
12
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
import type { InputDataLocalOptions, InputDataSharedOptions } from "./types";
|
|
3
|
-
export declare let getInputDataLocal: (options: InputDataSharedOptions & InputDataLocalOptions) => Promise<I18nCompiler.DataInput>;
|
|
4
|
-
export declare let getInputDataLocalSync: (options: InputDataSharedOptions & InputDataLocalOptions) => I18nCompiler.DataInput;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
import type { InputDataRemoteOptions, InputDataSharedOptions } from "./types";
|
|
3
|
-
export declare let getInputDataRemote: (options: InputDataSharedOptions & InputDataRemoteOptions) => Promise<I18nCompiler.DataInput>;
|
|
4
|
-
export declare let getInputDataRemoteSync: (options: InputDataSharedOptions & InputDataRemoteOptions) => {
|
|
5
|
-
localesFolders: string[];
|
|
6
|
-
translationFiles: I18nCompiler.DataInputTranslationFile[];
|
|
7
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
import type { InputDataOptions } from "./types";
|
|
3
|
-
export declare let getInputData: (options: InputDataOptions) => Promise<I18nCompiler.DataInput>;
|
|
4
|
-
export declare let getInputDataSync: (options: InputDataOptions) => I18nCompiler.DataInput;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { LiteralUnion } from "@koine/utils";
|
|
2
|
-
export type InputDataOptions = InputDataSharedOptions & InputDataLocalOptions & InputDataRemoteOptions;
|
|
3
|
-
export type InputDataSharedOptions = {
|
|
4
|
-
source: InputDataLocalSource | InputDataRemoteSource;
|
|
5
|
-
};
|
|
6
|
-
export type InputDataRemoteSource = LiteralUnion<`http${string}` | `https://raw.githubusercontent.com${string}`, string>;
|
|
7
|
-
export type InputDataRemoteOptions = {
|
|
8
|
-
ignore?: string[];
|
|
9
|
-
};
|
|
10
|
-
export type InputDataLocalSource = LiteralUnion<`.${string}` | `/${string}`, string>;
|
|
11
|
-
export type InputDataLocalOptions = {
|
|
12
|
-
cwd?: string;
|
|
13
|
-
ignore?: string[];
|
|
14
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
export type InputWriteOptions = {
|
|
3
|
-
cwd?: string;
|
|
4
|
-
output: string;
|
|
5
|
-
pretty?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare let writeInput: (options: InputWriteOptions, data: I18nCompiler.DataInput) => Promise<void>;
|
|
8
|
-
export declare let writeInputSync: (options: InputWriteOptions, data: I18nCompiler.DataInput) => void;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "./types";
|
|
2
|
-
export type PluralKey = `${string}_${PluralSuffix}`;
|
|
3
|
-
export type PluralSuffix = `${number}` | PluralSuffixNamed;
|
|
4
|
-
export type PluralSuffixNamed = (typeof pluralSuffixes)[number];
|
|
5
|
-
declare const pluralSuffixes: readonly ["zero", "one", "two", "few", "many", "other"];
|
|
6
|
-
export declare let isPluralSuffix: (suffix: string) => suffix is PluralSuffix;
|
|
7
|
-
export declare let removePluralSuffix: (key: PluralKey) => string;
|
|
8
|
-
export declare let getPluralSuffix: (key: PluralKey) => `${number}` | "zero" | "one" | "two" | "few" | "many" | "other";
|
|
9
|
-
export declare let isPluralKey: (key: string) => key is `${string}_${number}` | `${string}_zero` | `${string}_one` | `${string}_two` | `${string}_few` | `${string}_many` | `${string}_other`;
|
|
10
|
-
export declare let transformKeysForPlurals: (keys: string[]) => string[];
|
|
11
|
-
export declare let hasRequiredPluralSuffix: (key: string) => boolean;
|
|
12
|
-
export declare let hasPlurals: (value: {
|
|
13
|
-
[key: string]: I18nCompiler.DataTranslationValue;
|
|
14
|
-
}) => boolean;
|
|
15
|
-
export declare let hasOnlyPluralKeys: (value: {
|
|
16
|
-
[key: string]: I18nCompiler.DataTranslationValue;
|
|
17
|
-
}) => value is {
|
|
18
|
-
[key: string]: string;
|
|
19
|
-
};
|
|
20
|
-
export declare let pickNonPluralKeys: (value: {
|
|
21
|
-
[key: string]: I18nCompiler.DataTranslationValue;
|
|
22
|
-
}) => (string | number)[];
|
|
23
|
-
export declare let pickNonPluralValue: (value: {
|
|
24
|
-
[key: string]: I18nCompiler.DataTranslationValue;
|
|
25
|
-
}) => {
|
|
26
|
-
[key: string]: I18nCompiler.DataTranslationValue;
|
|
27
|
-
};
|
|
28
|
-
export declare let analyseObjectPlurals: (obj: {
|
|
29
|
-
[key: string]: I18nCompiler.DataTranslationValue;
|
|
30
|
-
}) => {
|
|
31
|
-
hasPlurals: boolean;
|
|
32
|
-
hasOnlyPluralKeys: boolean;
|
|
33
|
-
newValue: {
|
|
34
|
-
[key: string]: I18nCompiler.DataTranslationValue;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
export declare const summaryDataOptions: {};
|
|
3
|
-
export type SummaryDataOptions = typeof summaryDataOptions & {
|
|
4
|
-
sourceUrl: string;
|
|
5
|
-
};
|
|
6
|
-
export declare let getSummaryData: (config: Pick<I18nCompiler.Config, "locales" | "defaultLocale">, options: SummaryDataOptions, { translationFiles }: I18nCompiler.DataInput) => I18nCompiler.DataSummary;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { I18nCompiler } from "../types";
|
|
2
|
-
import { type SummaryGenerateOptions } from "./generate";
|
|
3
|
-
export type SummaryWriteOptions = {
|
|
4
|
-
cwd?: string;
|
|
5
|
-
outputJson?: string;
|
|
6
|
-
outputMarkdown?: string;
|
|
7
|
-
pretty?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare let writeSummary: (options: SummaryWriteOptions & SummaryGenerateOptions, data: I18nCompiler.DataSummary) => Promise<I18nCompiler.DataSummary>;
|
|
10
|
-
export declare let writeSummarySync: (options: SummaryWriteOptions & SummaryGenerateOptions, data: I18nCompiler.DataSummary) => I18nCompiler.DataSummary;
|
package/cjs/compiler/types.d.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { CodeDataOptions } from "./code";
|
|
2
|
-
import type { I18nCompilerConfig } from "./config";
|
|
3
|
-
import type { PluralSuffix } from "./pluralisation";
|
|
4
|
-
export declare namespace I18nCompiler {
|
|
5
|
-
type Config = I18nCompilerConfig;
|
|
6
|
-
type Locale = string;
|
|
7
|
-
type RouteId = string;
|
|
8
|
-
type RoutePathname = string;
|
|
9
|
-
type DataParams = Record<string, "string" | "number" | "stringOrNumber">;
|
|
10
|
-
type DataInput = {
|
|
11
|
-
translationFiles: DataInputTranslationFile[];
|
|
12
|
-
localesFolders: string[];
|
|
13
|
-
};
|
|
14
|
-
type DataInputTranslationFile = {
|
|
15
|
-
path: string;
|
|
16
|
-
locale: Locale;
|
|
17
|
-
data: {
|
|
18
|
-
[key: string]: I18nCompiler.DataTranslationValue;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
type DataCode = {
|
|
22
|
-
config: Config;
|
|
23
|
-
options: CodeDataOptions;
|
|
24
|
-
input: DataInput;
|
|
25
|
-
routes: DataRoutes;
|
|
26
|
-
translations: DataTranslations;
|
|
27
|
-
};
|
|
28
|
-
type DataRoutes = {
|
|
29
|
-
byId: Record<RouteId, DataRoute>;
|
|
30
|
-
wildcardIds: RouteId[];
|
|
31
|
-
};
|
|
32
|
-
type DataRoute = {
|
|
33
|
-
id: RouteId;
|
|
34
|
-
pathnames: Record<Locale, RoutePathname>;
|
|
35
|
-
pathnamesSlim?: string | Record<Locale, RoutePathname>;
|
|
36
|
-
pathnamesSpa?: Record<Locale, RoutePathname>;
|
|
37
|
-
params?: DataParams;
|
|
38
|
-
wildcard?: boolean;
|
|
39
|
-
inWildcard?: boolean;
|
|
40
|
-
};
|
|
41
|
-
type DataSummary = Record<Locale, {
|
|
42
|
-
words: number;
|
|
43
|
-
characters: number;
|
|
44
|
-
files: DataSummaryFile[];
|
|
45
|
-
}>;
|
|
46
|
-
type DataSummaryFile = {
|
|
47
|
-
locale: Locale;
|
|
48
|
-
path: string;
|
|
49
|
-
url: string;
|
|
50
|
-
words: number;
|
|
51
|
-
characters: number;
|
|
52
|
-
};
|
|
53
|
-
type DataTranslations = Record<string, DataTranslation>;
|
|
54
|
-
type DataTranslation = {
|
|
55
|
-
id: string;
|
|
56
|
-
typeValue: "Primitive" | "Array" | "Object";
|
|
57
|
-
values: Record<Locale, DataTranslationValue>;
|
|
58
|
-
pluralValues?: Record<Locale, Record<PluralSuffix, DataTranslationValue>>;
|
|
59
|
-
plural?: boolean;
|
|
60
|
-
params?: DataParams;
|
|
61
|
-
};
|
|
62
|
-
type DataTranslationValue = string | number | boolean | string[] | {
|
|
63
|
-
[key: string]: DataTranslationValue;
|
|
64
|
-
};
|
|
65
|
-
type AdapterBuiltin = "js" | "next" | "next-translate";
|
|
66
|
-
type AdpaterCreator = (arg: AdapterArg) => Adpater | Promise<Adpater>;
|
|
67
|
-
type Adpater = {
|
|
68
|
-
dependsOn?: AdapterBuiltin[];
|
|
69
|
-
files: AdpaterFile[];
|
|
70
|
-
needsTranslationsFiles?: boolean;
|
|
71
|
-
};
|
|
72
|
-
type AdapterArg = DataCode;
|
|
73
|
-
type AdpaterFile = {
|
|
74
|
-
name: string;
|
|
75
|
-
ext: "ts" | "tsx" | "mjs" | "js" | "json";
|
|
76
|
-
fn: (arg: AdapterArg) => string;
|
|
77
|
-
index?: boolean;
|
|
78
|
-
};
|
|
79
|
-
type AdpaterGeneratedFile = Omit<AdpaterFile, "fn"> & {
|
|
80
|
-
content: string;
|
|
81
|
-
};
|
|
82
|
-
}
|
package/cjs/compiler-sync.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { I18nCompilerOptions, I18nCompilerReturn } from "./compiler/api";
|
|
2
|
-
export declare let i18nCompilerSync: (options: I18nCompilerOptions) => I18nCompilerReturn;
|
|
3
|
-
export { type I18nCompilerOptions, type I18nCompilerReturn, } from "./compiler/api";
|
|
4
|
-
export type { I18nCompiler } from "./compiler/types";
|
package/cjs/compiler-worker.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/cjs/compiler.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import * as t from "@actions/core";
|
|
2
|
-
import { simpleGit as i } from "simple-git";
|
|
3
|
-
function e(i, e) {
|
|
4
|
-
e && console.log(e), i && t.error(i);
|
|
5
|
-
}
|
|
6
|
-
export class Git {
|
|
7
|
-
constructor(i, e){
|
|
8
|
-
this.errors = [], this.baseDir = i, this.afterFetch = e, this.outputs = {
|
|
9
|
-
committed: "false",
|
|
10
|
-
commit_sha: void 0,
|
|
11
|
-
pushed: "false"
|
|
12
|
-
}, Object.entries(this.outputs).forEach(([i, e])=>t.setOutput(i, e));
|
|
13
|
-
}
|
|
14
|
-
async run() {
|
|
15
|
-
let s = i({
|
|
16
|
-
baseDir: this.baseDir
|
|
17
|
-
}), o = process.env.GITHUB_REF?.substring(11) || "main";
|
|
18
|
-
t.info(`Running in folder ${this.baseDir}...`), t.info("> Pulling from remote..."), await s.fetch(void 0, e).pull(void 0, void 0, void 0, e), await this.afterFetch(), t.info("> Checking for uncommitted changes in the git working tree...");
|
|
19
|
-
let r = (await s.status()).files.length;
|
|
20
|
-
r ? (t.info(`> Found ${r} changed files.`), await s.fetch([
|
|
21
|
-
"--tags",
|
|
22
|
-
"--force"
|
|
23
|
-
], e), t.info("> Re-staging files..."), await s.add(".").catch((t)=>{
|
|
24
|
-
if (t.message.includes("fatal: pathspec") && t.message.includes("did not match any files")) this.errors.push(Error("Add command did not match any file"));
|
|
25
|
-
else throw t;
|
|
26
|
-
}), t.info("> Creating commit..."), await s.commit("chore(action): auto commit", void 0, {}, (t, i)=>(i && (this.setOutput("committed", "true"), this.setOutput("commit_sha", i.commit)), e(t, i))), t.info("> Pushing commit to repo..."), await s.push("origin", o, {
|
|
27
|
-
"--set-upstream": null
|
|
28
|
-
}, (t, i)=>(i && this.setOutput("pushed", "true"), e(t, i))), t.endGroup(), t.info("> Task completed!!!")) : (t.endGroup(), t.info("> Working tree clean. Nothing to commit."));
|
|
29
|
-
}
|
|
30
|
-
setOutput(i, e) {
|
|
31
|
-
this.outputs[i] = e, t.setOutput(i, e);
|
|
32
|
-
}
|
|
33
|
-
logOutputs() {
|
|
34
|
-
for(let i in t.startGroup("Outputs"), this.outputs)t.info(`${i}: ${this.outputs[i]}`);
|
|
35
|
-
t.endGroup();
|
|
36
|
-
}
|
|
37
|
-
success() {
|
|
38
|
-
if (1 === this.errors.length) throw this.errors[0];
|
|
39
|
-
if (this.errors.length > 1) throw this.errors.forEach((i)=>t.error(i)), "There have been multiple runtime errors.";
|
|
40
|
-
this.logOutputs();
|
|
41
|
-
}
|
|
42
|
-
error(i) {
|
|
43
|
-
t.endGroup(), this.logOutputs(), t.setFailed(i);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getConfig as o } from "../compiler/config";
|
|
2
|
-
import { getInputDataLocal as r } from "../compiler/input/data-local";
|
|
3
|
-
import { writeInput as t } from "../compiler/input/write";
|
|
4
|
-
import { getSummaryData as i } from "../compiler/summary/data";
|
|
5
|
-
import { writeSummary as m } from "../compiler/summary/write";
|
|
6
|
-
export let i18nAction = async (p)=>{
|
|
7
|
-
let { cwd: u, source: e = ".", url: a, output: { input: l, summaryJson: c, summaryMarkdown: n }, ...s } = p, f = await r({
|
|
8
|
-
cwd: u,
|
|
9
|
-
source: e,
|
|
10
|
-
...s
|
|
11
|
-
}), w = [];
|
|
12
|
-
if (l && w.push(t({
|
|
13
|
-
cwd: u,
|
|
14
|
-
output: l
|
|
15
|
-
}, f)), c || n) {
|
|
16
|
-
let r = i(o(f), {
|
|
17
|
-
sourceUrl: a
|
|
18
|
-
}, f);
|
|
19
|
-
w.push(m({
|
|
20
|
-
cwd: u,
|
|
21
|
-
outputJson: c,
|
|
22
|
-
outputMarkdown: n,
|
|
23
|
-
sourceUrl: a
|
|
24
|
-
}, r));
|
|
25
|
-
}
|
|
26
|
-
return await Promise.all(w), f;
|
|
27
|
-
};
|
package/cjs/i18n/actions/i18n.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { getInput as o, info as s } from "@actions/core";
|
|
2
|
-
import { Git as r } from "./helpers-git";
|
|
3
|
-
import { i18nAction as t } from "./helpers-i18n";
|
|
4
|
-
let e = async ()=>{
|
|
5
|
-
let r = process.env.GITHUB_REPOSITORY, e = process.env.GITHUB_REF.replace("refs/heads/", ""), u = `https://github.com/${r}/blob/${e}`, n = await t({
|
|
6
|
-
url: u,
|
|
7
|
-
output: {
|
|
8
|
-
input: o("output_input") || ".github/input.json",
|
|
9
|
-
summaryJson: o("output_summary_json") || ".github/summary.json",
|
|
10
|
-
summaryMarkdown: o("output_summary_md") || ".github/summary.md"
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
s(`Found locales: ${n.localesFolders.join(", ")}`), s(`Found ${n.translationFiles.length} JSON files`);
|
|
14
|
-
}, u = new r(process.cwd(), e);
|
|
15
|
-
u.run().then(()=>u.success()).catch((o)=>{
|
|
16
|
-
u.error(o), console.error(o);
|
|
17
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default (({ config: e })=>`
|
|
2
|
-
const { locales } = require("./locales");
|
|
3
|
-
const { defaultLocale } = require("./defaultLocale");
|
|
4
|
-
|
|
5
|
-
const config = {
|
|
6
|
-
locales,
|
|
7
|
-
defaultLocale,
|
|
8
|
-
hideDefaultLocaleInUrl: ${e.hideDefaultLocaleInUrl},
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
exports.config = config;
|
|
12
|
-
|
|
13
|
-
module.exports = config;
|
|
14
|
-
`);
|