@intlayer/engine 9.5.9 → 9.5.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.
- package/dist/cjs/cli.cjs +7 -0
- package/dist/cjs/docReview/reviewReport.cjs.map +1 -1
- package/dist/cjs/init/cms.cjs +35 -0
- package/dist/cjs/init/cms.cjs.map +1 -1
- package/dist/cjs/init/documentationRouter.cjs +141 -0
- package/dist/cjs/init/documentationRouter.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/backend/index.cjs +138 -0
- package/dist/cjs/init/frameworkSetup/backend/index.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/backend/transforms.cjs +223 -0
- package/dist/cjs/init/frameworkSetup/backend/transforms.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/index.cjs +9 -3
- package/dist/cjs/init/frameworkSetup/index.cjs.map +1 -1
- package/dist/cjs/init/frameworkSetup/localeRouting.cjs +13 -0
- package/dist/cjs/init/frameworkSetup/localeRouting.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/index.cjs +34 -7
- package/dist/cjs/init/frameworkSetup/nextAppRouter/index.cjs.map +1 -1
- package/dist/cjs/init/frameworkSetup/nextAppRouter/templates.cjs +56 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/templates.cjs.map +1 -1
- package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs +2 -2
- package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs.map +1 -1
- package/dist/cjs/init/frameworkSetup/tanstackStart/index.cjs +32 -3
- package/dist/cjs/init/frameworkSetup/tanstackStart/index.cjs.map +1 -1
- package/dist/cjs/init/frameworkSetup/tanstackStart/templates.cjs +58 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/templates.cjs.map +1 -1
- package/dist/cjs/init/frameworkSetup/tanstackStart/transforms.cjs +94 -14
- package/dist/cjs/init/frameworkSetup/tanstackStart/transforms.cjs.map +1 -1
- package/dist/cjs/init/index.cjs +46 -159
- package/dist/cjs/init/index.cjs.map +1 -1
- package/dist/cjs/init/utils/configManipulation.cjs +39 -0
- package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
- package/dist/cjs/init/utils/index.cjs +10 -0
- package/dist/cjs/init/utils/lintConfig.cjs +52 -0
- package/dist/cjs/init/utils/lintConfig.cjs.map +1 -0
- package/dist/cjs/init/utils/packageManager.cjs +62 -13
- package/dist/cjs/init/utils/packageManager.cjs.map +1 -1
- package/dist/cjs/init/utils/urlRoutingFramework.cjs +41 -0
- package/dist/cjs/init/utils/urlRoutingFramework.cjs.map +1 -0
- package/dist/cjs/initConfig/index.cjs +4 -1
- package/dist/cjs/initConfig/index.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs +104 -43
- package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs.map +1 -1
- package/dist/esm/cli.mjs +5 -3
- package/dist/esm/docReview/reviewReport.mjs.map +1 -1
- package/dist/esm/init/cms.mjs +35 -2
- package/dist/esm/init/cms.mjs.map +1 -1
- package/dist/esm/init/documentationRouter.mjs +139 -0
- package/dist/esm/init/documentationRouter.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/backend/index.mjs +130 -0
- package/dist/esm/init/frameworkSetup/backend/index.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/backend/transforms.mjs +216 -0
- package/dist/esm/init/frameworkSetup/backend/transforms.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/index.mjs +9 -3
- package/dist/esm/init/frameworkSetup/index.mjs.map +1 -1
- package/dist/esm/init/frameworkSetup/localeRouting.mjs +12 -0
- package/dist/esm/init/frameworkSetup/localeRouting.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/index.mjs +36 -9
- package/dist/esm/init/frameworkSetup/nextAppRouter/index.mjs.map +1 -1
- package/dist/esm/init/frameworkSetup/nextAppRouter/templates.mjs +54 -1
- package/dist/esm/init/frameworkSetup/nextAppRouter/templates.mjs.map +1 -1
- package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs +2 -2
- package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs.map +1 -1
- package/dist/esm/init/frameworkSetup/tanstackStart/index.mjs +35 -6
- package/dist/esm/init/frameworkSetup/tanstackStart/index.mjs.map +1 -1
- package/dist/esm/init/frameworkSetup/tanstackStart/templates.mjs +56 -1
- package/dist/esm/init/frameworkSetup/tanstackStart/templates.mjs.map +1 -1
- package/dist/esm/init/frameworkSetup/tanstackStart/transforms.mjs +94 -15
- package/dist/esm/init/frameworkSetup/tanstackStart/transforms.mjs.map +1 -1
- package/dist/esm/init/index.mjs +42 -158
- package/dist/esm/init/index.mjs.map +1 -1
- package/dist/esm/init/utils/configManipulation.mjs +38 -1
- package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
- package/dist/esm/init/utils/index.mjs +5 -3
- package/dist/esm/init/utils/lintConfig.mjs +50 -0
- package/dist/esm/init/utils/lintConfig.mjs.map +1 -0
- package/dist/esm/init/utils/packageManager.mjs +60 -14
- package/dist/esm/init/utils/packageManager.mjs.map +1 -1
- package/dist/esm/init/utils/urlRoutingFramework.mjs +40 -0
- package/dist/esm/init/utils/urlRoutingFramework.mjs.map +1 -0
- package/dist/esm/initConfig/index.mjs +4 -1
- package/dist/esm/initConfig/index.mjs.map +1 -1
- package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs +105 -44
- package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs.map +1 -1
- package/dist/types/cli.d.ts +5 -3
- package/dist/types/docReview/reviewReport.d.ts.map +1 -1
- package/dist/types/formatDictionary.d.ts +2 -2
- package/dist/types/init/cms.d.ts +11 -0
- package/dist/types/init/cms.d.ts.map +1 -1
- package/dist/types/init/documentationRouter.d.ts +64 -0
- package/dist/types/init/documentationRouter.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/backend/index.d.ts +16 -0
- package/dist/types/init/frameworkSetup/backend/index.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/backend/transforms.d.ts +37 -0
- package/dist/types/init/frameworkSetup/backend/transforms.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/index.d.ts.map +1 -1
- package/dist/types/init/frameworkSetup/localeRouting.d.ts +11 -0
- package/dist/types/init/frameworkSetup/localeRouting.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/index.d.ts +5 -5
- package/dist/types/init/frameworkSetup/nextAppRouter/index.d.ts.map +1 -1
- package/dist/types/init/frameworkSetup/nextAppRouter/templates.d.ts +12 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/templates.d.ts.map +1 -1
- package/dist/types/init/frameworkSetup/nextAppRouter/transforms.d.ts +10 -1
- package/dist/types/init/frameworkSetup/nextAppRouter/transforms.d.ts.map +1 -1
- package/dist/types/init/frameworkSetup/tanstackStart/index.d.ts +3 -2
- package/dist/types/init/frameworkSetup/tanstackStart/index.d.ts.map +1 -1
- package/dist/types/init/frameworkSetup/tanstackStart/templates.d.ts +10 -0
- package/dist/types/init/frameworkSetup/tanstackStart/templates.d.ts.map +1 -1
- package/dist/types/init/frameworkSetup/tanstackStart/transforms.d.ts +12 -0
- package/dist/types/init/frameworkSetup/tanstackStart/transforms.d.ts.map +1 -1
- package/dist/types/init/frameworkSetup/types.d.ts +6 -0
- package/dist/types/init/frameworkSetup/types.d.ts.map +1 -1
- package/dist/types/init/index.d.ts +15 -1
- package/dist/types/init/index.d.ts.map +1 -1
- package/dist/types/init/utils/configManipulation.d.ts +14 -0
- package/dist/types/init/utils/configManipulation.d.ts.map +1 -1
- package/dist/types/init/utils/index.d.ts +5 -3
- package/dist/types/init/utils/lintConfig.d.ts +28 -0
- package/dist/types/init/utils/lintConfig.d.ts.map +1 -0
- package/dist/types/init/utils/packageManager.d.ts +29 -6
- package/dist/types/init/utils/packageManager.d.ts.map +1 -1
- package/dist/types/init/utils/urlRoutingFramework.d.ts +9 -0
- package/dist/types/init/utils/urlRoutingFramework.d.ts.map +1 -0
- package/dist/types/initConfig/index.d.ts +3 -1
- package/dist/types/initConfig/index.d.ts.map +1 -1
- package/dist/types/loadDictionaries/logTypeScriptErrors.d.ts +4 -0
- package/dist/types/loadDictionaries/logTypeScriptErrors.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//#region src/init/documentationRouter.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Documentation URL Constants
|
|
4
|
+
*/
|
|
5
|
+
export declare const DocumentationRouter: {
|
|
6
|
+
NextJS: string;
|
|
7
|
+
NextJS_16: string;
|
|
8
|
+
NextJS_15: string;
|
|
9
|
+
NextJS_14: string;
|
|
10
|
+
NextJS_PageRouter: string;
|
|
11
|
+
CRA: string;
|
|
12
|
+
Astro: string;
|
|
13
|
+
Astro_Lit: string;
|
|
14
|
+
Astro_Preact: string;
|
|
15
|
+
Astro_React: string;
|
|
16
|
+
Astro_Solid: string;
|
|
17
|
+
Astro_Svelte: string;
|
|
18
|
+
Astro_Vue: string;
|
|
19
|
+
ViteAndReact: string;
|
|
20
|
+
ViteAndReact_ReactRouterV7: string;
|
|
21
|
+
ViteAndVue: string;
|
|
22
|
+
ViteAndSolid: string;
|
|
23
|
+
ViteAndSvelte: string;
|
|
24
|
+
ViteAndPreact: string;
|
|
25
|
+
ViteAndLit: string;
|
|
26
|
+
ViteAndVanilla: string;
|
|
27
|
+
Vanilla: string;
|
|
28
|
+
TanStackRouter: string;
|
|
29
|
+
TanStackRouterAndSolid: string;
|
|
30
|
+
SolidStart: string;
|
|
31
|
+
Analog: string;
|
|
32
|
+
Remix: string;
|
|
33
|
+
NuxtAndVue: string;
|
|
34
|
+
Angular: string;
|
|
35
|
+
Angular_19: string;
|
|
36
|
+
SvelteKit: string;
|
|
37
|
+
ReactNativeAndExpo: string;
|
|
38
|
+
Lynx: string;
|
|
39
|
+
HTMX: string;
|
|
40
|
+
Storybook: string;
|
|
41
|
+
Express: string;
|
|
42
|
+
NestJS: string;
|
|
43
|
+
Fastify: string;
|
|
44
|
+
Hono: string;
|
|
45
|
+
AdonisJS: string;
|
|
46
|
+
Elysia: string;
|
|
47
|
+
Default: string;
|
|
48
|
+
LSP: string;
|
|
49
|
+
ESLint: string;
|
|
50
|
+
NextIntl: string;
|
|
51
|
+
NextI18Next: string;
|
|
52
|
+
ReactI18Next: string;
|
|
53
|
+
ReactIntl: string;
|
|
54
|
+
VueI18n: string;
|
|
55
|
+
NuxtI18n: string;
|
|
56
|
+
I18next: string;
|
|
57
|
+
};
|
|
58
|
+
export type DocumentationRouterType = typeof DocumentationRouter;
|
|
59
|
+
/**
|
|
60
|
+
* Helper: Detects the environment and returns the doc URL
|
|
61
|
+
*/
|
|
62
|
+
export declare const getDocumentationUrl: (packageJson: any) => string;
|
|
63
|
+
//#endregion
|
|
64
|
+
//# sourceMappingURL=documentationRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentationRouter.d.ts","names":[],"sources":["../../../src/init/documentationRouter.ts"],"mappings":";;;;qBAGa;EACX;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EAGA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;;YAGU,iCAAiC;;;;qBAKhC,sBAAmB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FrameworkAdapter } from "../types.js";
|
|
2
|
+
//#region src/init/frameworkSetup/backend/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* NestJS on the Express platform. Checked before Express: a Nest app is
|
|
5
|
+
* created by `NestFactory`, not `express()`. Nest on Fastify is left to the
|
|
6
|
+
* guide (its adapter is registered through the Fastify instance).
|
|
7
|
+
*/
|
|
8
|
+
export declare const nestJsAdapter: FrameworkAdapter;
|
|
9
|
+
export declare const expressAdapter: FrameworkAdapter;
|
|
10
|
+
export declare const fastifyAdapter: FrameworkAdapter;
|
|
11
|
+
export declare const honoAdapter: FrameworkAdapter;
|
|
12
|
+
export declare const elysiaAdapter: FrameworkAdapter;
|
|
13
|
+
/** Backend adapters, in detection order. */
|
|
14
|
+
export declare const backendAdapters: FrameworkAdapter[];
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/backend/index.ts"],"mappings":";;;;;;;qBAiJa,eAAa;qBAUb,gBAAc;qBASd,gBAAc;qBASd,aAAW;qBASX,eAAa;;qBAUb,iBAAiB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/init/frameworkSetup/backend/transforms.d.ts
|
|
2
|
+
/** Result of a backend transform. `code` is unchanged for any non-`registered` status. */
|
|
3
|
+
export type BackendTransformResult = {
|
|
4
|
+
code: string;
|
|
5
|
+
status: 'registered' | 'already' | 'skipped';
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Registers `express-intlayer` right after `const app = express()`:
|
|
9
|
+
* `app.use(intlayer());`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const registerExpressMiddleware: (code: string) => BackendTransformResult;
|
|
12
|
+
/**
|
|
13
|
+
* Registers `fastify-intlayer` right after `const app = Fastify()`:
|
|
14
|
+
* `app.register(intlayer);`. Not awaited, so it also works in CommonJS and
|
|
15
|
+
* non-async scopes — Fastify queues plugins until `ready`/`listen`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const registerFastifyPlugin: (code: string) => BackendTransformResult;
|
|
18
|
+
/**
|
|
19
|
+
* Registers `hono-intlayer` right after `const app = new Hono()`:
|
|
20
|
+
* `app.use("*", intlayer());`. A chained declaration
|
|
21
|
+
* (`new Hono().get(…)`) is skipped: its routes would be registered before the
|
|
22
|
+
* middleware, which Hono runs in registration order.
|
|
23
|
+
*/
|
|
24
|
+
export declare const registerHonoMiddleware: (code: string) => BackendTransformResult;
|
|
25
|
+
/**
|
|
26
|
+
* Registers `express-intlayer` on a NestJS (Express platform) app right after
|
|
27
|
+
* `const app = await NestFactory.create(…)`: `app.use(intlayer());`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const registerNestJsMiddleware: (code: string) => BackendTransformResult;
|
|
30
|
+
/**
|
|
31
|
+
* Registers `elysia-intlayer` directly on the app constructor:
|
|
32
|
+
* `new Elysia()` → `new Elysia().use(intlayer())`. Works for chained
|
|
33
|
+
* declarations too, and keeps the plugin ahead of every route.
|
|
34
|
+
*/
|
|
35
|
+
export declare const registerElysiaPlugin: (code: string) => BackendTransformResult;
|
|
36
|
+
//#endregion
|
|
37
|
+
//# sourceMappingURL=transforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transforms.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/backend/transforms.ts"],"mappings":";;YAoBY;EACV;EACA;;;;;;qBAoMW,4BAAyB,iBAEnC;;;;;;qBAoBU,wBAAqB,iBAAmB;;;;;;;qBAsBxC,yBAAsB,iBAAmB;;;;;qBAmBzC,2BAAwB,iBAElC;;;;;;qBAqBU,uBAAoB,iBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/init/frameworkSetup/index.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/init/frameworkSetup/index.ts"],"mappings":";;;;;;;;qBAyBa,iBAAc,SAChB,0BACR"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FrameworkSetupContext } from "./types.js";
|
|
2
|
+
//#region src/init/frameworkSetup/localeRouting.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Whether the locale is carried by a URL path segment (`/fr/about`), which the
|
|
5
|
+
* framework router must declare (`[locale]`, `{-$locale}`, `$locale`…). Only the
|
|
6
|
+
* prefix routing modes do, and only while the proxy is enabled: `no-prefix` and
|
|
7
|
+
* `search-params` resolve the locale from storage/headers/query instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare const usesLocalePathSegment: ({ routingMode, enableProxy }: Pick<FrameworkSetupContext, 'routingMode' | 'enableProxy'>) => boolean;
|
|
10
|
+
//#endregion
|
|
11
|
+
//# sourceMappingURL=localeRouting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localeRouting.d.ts","names":[],"sources":["../../../../src/init/frameworkSetup/localeRouting.ts"],"mappings":";;;;;;;;qBAQa,0BAAqB,aAAA,eAG/B,KAAK"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FrameworkAdapter } from "../types.js";
|
|
2
2
|
//#region src/init/frameworkSetup/nextAppRouter/index.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* Next.js App Router adapter. Scaffolds the locale proxy/middleware
|
|
5
|
-
* the app into a `[locale]` segment
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* covers them.
|
|
4
|
+
* Next.js App Router adapter. Scaffolds the locale proxy/middleware (when the
|
|
5
|
+
* proxy is enabled), restructures the app into a `[locale]` segment (prefix
|
|
6
|
+
* routing modes only), and wraps the layout with the unified Intlayer provider
|
|
7
|
+
* — all idempotently and without overwriting recognizable user code. Pages are
|
|
8
|
+
* never wrapped: `IntlayerProvider` in the layout covers them.
|
|
9
9
|
*/
|
|
10
10
|
export declare const nextAppRouterAdapter: FrameworkAdapter;
|
|
11
11
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/nextAppRouter/index.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/nextAppRouter/index.ts"],"mappings":";;;;;;;;;qBAiLa,sBAAsB"}
|
|
@@ -26,5 +26,17 @@ export declare const LOCALE_LAYOUT_TEMPLATE_JS = "import { IntlayerProvider } fr
|
|
|
26
26
|
*/
|
|
27
27
|
export declare const LOCALE_PAGE_TEMPLATE_TS = "import { type NextPageIntlayer } from \"next-intlayer\";\n\nconst Page: NextPageIntlayer = async ({ params }) => {\n const { locale } = await params;\n\n return (\n <main>\n <h1>{locale}</h1>\n <p>Get started by editing this page.</p>\n </main>\n );\n};\n\nexport default Page;\n";
|
|
28
28
|
export declare const LOCALE_PAGE_TEMPLATE_JS = "const Page = async ({ params }) => {\n const { locale } = await params;\n\n return (\n <main>\n <h1>{locale}</h1>\n <p>Get started by editing this page.</p>\n </main>\n );\n};\n\nexport default Page;\n";
|
|
29
|
+
/**
|
|
30
|
+
* Root layout (`app/layout.tsx`) for routing modes without a locale path
|
|
31
|
+
* segment (`no-prefix`, `search-params`, or no proxy at all). Owns `<html>` and
|
|
32
|
+
* resolves the locale from the request (cookie / header) via `getLocale()`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const UNPREFIXED_ROOT_LAYOUT_TEMPLATE_TS = "import type { PropsWithChildren } from \"react\";\nimport { getHTMLTextDir } from \"intlayer\";\nimport { getLocale, IntlayerProvider } from \"next-intlayer/server\";\n\nconst RootLayout = async ({ children }: PropsWithChildren) => {\n const locale = await getLocale();\n\n return (\n <html lang={locale} dir={getHTMLTextDir(locale)}>\n <body>\n <IntlayerProvider locale={locale}>{children}</IntlayerProvider>\n </body>\n </html>\n );\n};\n\nexport default RootLayout;\n";
|
|
35
|
+
export declare const UNPREFIXED_ROOT_LAYOUT_TEMPLATE_JS = "import { getHTMLTextDir } from \"intlayer\";\nimport { getLocale, IntlayerProvider } from \"next-intlayer/server\";\n\nconst RootLayout = async ({ children }) => {\n const locale = await getLocale();\n\n return (\n <html lang={locale} dir={getHTMLTextDir(locale)}>\n <body>\n <IntlayerProvider locale={locale}>{children}</IntlayerProvider>\n </body>\n </html>\n );\n};\n\nexport default RootLayout;\n";
|
|
36
|
+
/**
|
|
37
|
+
* Home page (`app/page.tsx`) for routing modes without a locale path segment.
|
|
38
|
+
* Identical for TypeScript and JavaScript projects.
|
|
39
|
+
*/
|
|
40
|
+
export declare const UNPREFIXED_PAGE_TEMPLATE = "const Page = () => (\n <main>\n <h1>Hello</h1>\n <p>Get started by editing this page.</p>\n </main>\n);\n\nexport default Page;\n";
|
|
29
41
|
//#endregion
|
|
30
42
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/nextAppRouter/templates.ts"],"mappings":";;;;;;;qBAOa;;qBASA;;qBASA;qBAOA;;;;;;;qBAWA;qBAqBA;;;;;;qBAyBA;qBAgBA"}
|
|
1
|
+
{"version":3,"file":"templates.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/nextAppRouter/templates.ts"],"mappings":";;;;;;;qBAOa;;qBASA;;qBASA;qBAOA;;;;;;;qBAWA;qBAqBA;;;;;;qBAyBA;qBAgBA;;;;;;qBAmBA;qBAmBA;;;;;qBAsBA"}
|
|
@@ -4,6 +4,15 @@ export type TransformResult = {
|
|
|
4
4
|
code: string;
|
|
5
5
|
status: 'wrapped' | 'already' | 'skipped-client' | 'skipped';
|
|
6
6
|
};
|
|
7
|
+
/** Options of {@link wrapLayoutWithProvider}. */
|
|
8
|
+
export type WrapLayoutOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* Re-export `generateStaticParams` from `next-intlayer`. Only meaningful for a
|
|
11
|
+
* layout under a `[locale]` segment; a root layout of an unprefixed app has
|
|
12
|
+
* no locale param to pre-render. Default: `true`.
|
|
13
|
+
*/
|
|
14
|
+
exportStaticParams?: boolean;
|
|
15
|
+
};
|
|
7
16
|
/**
|
|
8
17
|
* Wraps the `{children}` of a Next.js App Router **layout** with the unified
|
|
9
18
|
* `IntlayerProvider`, deriving the locale via `getLocale()`. Safe and
|
|
@@ -15,6 +24,6 @@ export type TransformResult = {
|
|
|
15
24
|
* pages below the locale layout read locale/variant from it without wrapping
|
|
16
25
|
* themselves individually (see the removed `wrapPageWithProvider`).
|
|
17
26
|
*/
|
|
18
|
-
export declare const wrapLayoutWithProvider: (code: string) => TransformResult;
|
|
27
|
+
export declare const wrapLayoutWithProvider: (code: string, { exportStaticParams }?: WrapLayoutOptions) => TransformResult;
|
|
19
28
|
//#endregion
|
|
20
29
|
//# sourceMappingURL=transforms.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transforms.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/nextAppRouter/transforms.ts"],"mappings":";;YAWY;EACV;EACA;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"transforms.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/nextAppRouter/transforms.ts"],"mappings":";;YAWY;EACV;EACA;;;YA4KU;;;;;;EAMV;;;;;;;;;;;;;qBAcW,yBAAsB,gBACrB,uBACmB,sBAC9B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FrameworkAdapter } from "../types.js";
|
|
2
2
|
//#region src/init/frameworkSetup/tanstackStart/index.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* TanStack Start adapter.
|
|
5
|
-
*
|
|
4
|
+
* TanStack Start adapter. For prefix routing modes, restructures the file-based
|
|
5
|
+
* routes under a `{-$locale}` / `$locale` segment and scaffolds the locale
|
|
6
|
+
* segment route; for the others, keeps routes in place. Wraps the root document with
|
|
6
7
|
* the Intlayer provider — all idempotently and without overwriting user code it
|
|
7
8
|
* cannot confidently transform.
|
|
8
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/tanstackStart/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/tanstackStart/index.ts"],"mappings":";;;;;;;;;qBAgIa,sBAAsB"}
|
|
@@ -22,5 +22,15 @@ export declare const buildLocaleRouteTemplate: (localeSegment: string) => string
|
|
|
22
22
|
export declare const buildRootTemplateTs: (localeSegment: string) => string;
|
|
23
23
|
/** JavaScript counterpart of {@link buildRootTemplateTs}. */
|
|
24
24
|
export declare const buildRootTemplateJs: (localeSegment: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Module-scope server function resolving the request locale from the locale
|
|
27
|
+
* cookie / headers (`Accept-Language` fallback). Shared by the unprefixed root
|
|
28
|
+
* template and the root transform.
|
|
29
|
+
*/
|
|
30
|
+
export declare const REQUEST_LOCALE_SERVER_FUNCTION = "const getRequestLocale = createServerFn().handler(() =>\n getLocale({\n getCookie: (name) => getCookie(name, getRequestHeader(\"cookie\")),\n getHeader: (name) => getRequestHeader(name),\n })\n);";
|
|
31
|
+
/** {@link buildUnprefixedRootTemplate} for TypeScript projects. */
|
|
32
|
+
export declare const UNPREFIXED_ROOT_TEMPLATE_TS: string;
|
|
33
|
+
/** {@link buildUnprefixedRootTemplate} for JavaScript projects. */
|
|
34
|
+
export declare const UNPREFIXED_ROOT_TEMPLATE_JS: string;
|
|
25
35
|
//#endregion
|
|
26
36
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/tanstackStart/templates.ts"],"mappings":";;;;;;;;;;;;qBAYa,2BAAwB;;;;;;;;;qBAgCxB,sBAAmB;;qBAkCnB,sBAAmB"}
|
|
1
|
+
{"version":3,"file":"templates.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/tanstackStart/templates.ts"],"mappings":";;;;;;;;;;;;qBAYa,2BAAwB;;;;;;;;;qBAgCxB,sBAAmB;;qBAkCnB,sBAAmB;;;;;;qBAqCnB;;qBAmDA;;qBAKA"}
|
|
@@ -4,6 +4,18 @@ export type TransformResult = {
|
|
|
4
4
|
code: string;
|
|
5
5
|
status: 'wrapped' | 'already' | 'skipped';
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Wraps the `{children}` of a TanStack Start root document with
|
|
9
|
+
* `IntlayerProvider` for routing modes without a locale path segment. The
|
|
10
|
+
* locale is resolved per request by a server function exposed through the root
|
|
11
|
+
* `loader`, and read with `Route.useLoaderData()`. Safe and idempotent: bails
|
|
12
|
+
* when the provider is already present, when no `<html>` document or
|
|
13
|
+
* `{children}` is found, or when the root route cannot safely take a loader
|
|
14
|
+
* (no `Route` binding, no options object, or an existing `loader`).
|
|
15
|
+
*
|
|
16
|
+
* @param code Source of the project's `__root` document.
|
|
17
|
+
*/
|
|
18
|
+
export declare const wrapRootWithRequestLocaleProvider: (code: string) => TransformResult;
|
|
7
19
|
/**
|
|
8
20
|
* Wraps the `{children}` of a TanStack Start root document with
|
|
9
21
|
* `IntlayerProvider`, deriving the locale from the locale segment route params.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transforms.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/tanstackStart/transforms.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"transforms.d.ts","names":[],"sources":["../../../../../src/init/frameworkSetup/tanstackStart/transforms.ts"],"mappings":";;YAmBY;EACV;EACA;;;;;;;;;;;;;qBA6QW,oCAAiC,iBAE3C;;;;;;;;;;;;qBAsFU,uBAAoB,cACnB,0BAEX"}
|
|
@@ -21,6 +21,12 @@ export type FrameworkSetupContext = {
|
|
|
21
21
|
* (`prefix-no-default` → `{-$locale}`).
|
|
22
22
|
*/
|
|
23
23
|
routingMode: RoutingMode;
|
|
24
|
+
/**
|
|
25
|
+
* Whether locale routing goes through the Intlayer proxy (middleware), i.e.
|
|
26
|
+
* the effective `routing.enableProxy`. When `false`, adapters scaffold no
|
|
27
|
+
* proxy file and no locale route segment.
|
|
28
|
+
*/
|
|
29
|
+
enableProxy: boolean;
|
|
24
30
|
};
|
|
25
31
|
/**
|
|
26
32
|
* A framework integration adapter. Each adapter knows how to recognize a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/init/frameworkSetup/types.ts"],"mappings":";;;;;;;YAOY;;EAEV;;EAEA,SAAS;;EAET,gBAAgB;;EAEhB;;;;;;;EAOA,aAAa;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/init/frameworkSetup/types.ts"],"mappings":";;;;;;;YAOY;;EAEV;;EAEA,SAAS;;EAET,gBAAgB;;EAEhB;;;;;;;EAOA,aAAa;;;;;;EAMb;;;;;;;YAQU;;EAEV;;;;;EAKA,SAAS,SAAS,oCAAoC;;;;;;EAMtD,QAAQ,SAAS,0BAA0B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RoutingMode } from "./utils/configManipulation.js";
|
|
2
|
+
import { DocumentationRouter, DocumentationRouterType, getDocumentationUrl } from "./documentationRouter.js";
|
|
2
3
|
import "./utils/index.js";
|
|
3
4
|
//#region src/init/index.d.ts
|
|
4
5
|
/**
|
|
@@ -43,6 +44,8 @@ export type InitOptions = {
|
|
|
43
44
|
* enabled.
|
|
44
45
|
*/
|
|
45
46
|
noFrameworkSetup?: boolean;
|
|
47
|
+
/** Skip logging the final success message and documentation link. */
|
|
48
|
+
skipFinalMessage?: boolean;
|
|
46
49
|
/**
|
|
47
50
|
* Version to install the missing Intlayer packages at (typically the running
|
|
48
51
|
* CLI version). Already declared Intlayer packages are upgraded to the latest
|
|
@@ -55,6 +58,13 @@ export type InitOptions = {
|
|
|
55
58
|
* (`prefix-no-default`) is kept.
|
|
56
59
|
*/
|
|
57
60
|
routingMode?: RoutingMode;
|
|
61
|
+
/**
|
|
62
|
+
* Whether the app routes by locale through the Intlayer proxy (middleware).
|
|
63
|
+
* Written to `routing.enableProxy` in the configuration file and drives the
|
|
64
|
+
* framework scaffolding: `false` skips the proxy file and any locale route
|
|
65
|
+
* segment. When omitted, the configured value is kept (unset means enabled).
|
|
66
|
+
*/
|
|
67
|
+
enableProxy?: boolean;
|
|
58
68
|
/**
|
|
59
69
|
* Content organization strategy chosen by the interactive init prompt. Drives
|
|
60
70
|
* the `compiler.output` template (`centralized`) or the injection of the
|
|
@@ -66,6 +76,10 @@ export type InitOptions = {
|
|
|
66
76
|
/**
|
|
67
77
|
* MAIN LOGIC
|
|
68
78
|
*/
|
|
69
|
-
export declare const initIntlayer: (rootDir: string, options?: InitOptions) => Promise<
|
|
79
|
+
export declare const initIntlayer: (rootDir: string, options?: InitOptions) => Promise<{
|
|
80
|
+
guideUrl: string;
|
|
81
|
+
}>;
|
|
82
|
+
export declare const logInitSuccessMessage: (guideUrl: string) => void;
|
|
70
83
|
//#endregion
|
|
84
|
+
export { DocumentationRouter, type DocumentationRouterType, getDocumentationUrl };
|
|
71
85
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/init/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/init/index.ts"],"mappings":";;;;;;;;;;qBA6Ea,2BAAwB,cACrB;;;;;;;;;;YAsBJ;;;;YAQA;EACV;;EAEA;;;;;EAKA;;EAEA;;EAEA;;EAEA;;;;;;;EAOA;;EAEA;;;;;;EAMA;;;;;;EAMA,cAAc;;;;;;;EAOd;;;;;;;EAOA,kBAAkB;;;;;qBAMP,eAAY,iBAAyB,UAAY,gBAAW;;;qBA6kC5D,wBAAqB"}
|
|
@@ -11,6 +11,20 @@ export type RoutingMode = RoutingConfig['mode'];
|
|
|
11
11
|
* TypeScript recast parser.
|
|
12
12
|
*/
|
|
13
13
|
export declare const setIntlayerConfigRoutingMode: (content: string, extension: string, mode: RoutingMode) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Sets `routing.enableProxy` in an Intlayer configuration file. Idempotent and
|
|
16
|
+
* comment-preserving: an existing property only has its value swapped. Supports
|
|
17
|
+
* `.ts`, `.mjs`, `.js`, `.cjs` and `.json` configs.
|
|
18
|
+
*/
|
|
19
|
+
export declare const setIntlayerConfigEnableProxy: (content: string, extension: string, enableProxy: boolean) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Reduces `routing` in an Intlayer configuration file to its `storage` entry,
|
|
22
|
+
* for projects without URL routing (backend-only, React Native…) where the
|
|
23
|
+
* routing mode and the locale proxy have no effect. An existing `storage`
|
|
24
|
+
* value is kept; otherwise `['cookie', 'header']` is written. JSON configs are
|
|
25
|
+
* returned unchanged.
|
|
26
|
+
*/
|
|
27
|
+
export declare const setIntlayerConfigRoutingStorageOnly: (content: string, extension: string) => string;
|
|
14
28
|
/**
|
|
15
29
|
* Sets `compiler.output` in an Intlayer configuration file to the given path
|
|
16
30
|
* template (the `{{variable}}` string form, e.g.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configManipulation.d.ts","names":[],"sources":["../../../../src/init/utils/configManipulation.ts"],"mappings":";;;;YAYY,cAAc;;;;;;;;qBA0Fb,+BAA4B,iBACxB,mBACE,MACX;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"configManipulation.d.ts","names":[],"sources":["../../../../src/init/utils/configManipulation.ts"],"mappings":";;;;YAYY,cAAc;;;;;;;;qBA0Fb,+BAA4B,iBACxB,mBACE,MACX;;;;;;qBAuCK,+BAA4B,iBACxB,mBACE;;;;;;;;qBA+CN,sCAAmC,iBAC/B;;;;;;;;;qBAgDJ,kCAA+B,iBAC3B,mBACE;;;;;;;;;qBA0CN,6BAA0B;;;;;;;;qBA+Q1B,wBAAqB;qBAIrB,mBAAgB,iBACZ;qBAoBJ,oBAAiB,iBACb;qBAoBJ,mBAAgB,iBACZ;;;;;;;;;;;;;qBA2EJ,oBAAiB,iBACb;;;;;;;qBA2EJ,yBAAsB;qBAgBtB,mBAAgB;;;;;qBA6DhB,6BAA0B,iBACtB;;;;;;qBA8BJ,kCAA+B,iBAC3B,mBACE,cACH;;;;;;;;;;qBAiCH,sCAAmC,iBAC/B,oBACG,2BACO;;;;;qBAqGd,mCAAgC,iBAC5B;;;;;qBAcJ,gCAA6B;;;;;qBA+D7B,iCAA8B,iBAC1B;;;;;;;qBAgBJ,8BAA2B,iBACvB;;;;;;qBAgQJ,qCAAkC,iBAC9B,mBACE,YACL"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { COMPAT_I18N_LIBRARIES, COMPAT_PACKAGE_REPLACEMENTS, CompatI18nLibrary, CompatSyncConfig, CompatVitePluginConfig, DetectMissingPackagesOptions, IntlayerPackageAnalysis, PackageManager, detectCompatI18nLibraries, detectMissingIntlayerPackages, detectPackageManager, findLockFileDir, hasLintTooling, installPackages, isIntlayerPackageName, moveCompatPackagesToDevDependencies, normalizeVersion, runPackageInstall } from "./packageManager.js";
|
|
2
|
-
import { RoutingMode, enableIntlayerEditorConfig, getMetroConfigTemplate, hasIntlayerVitePlugin, replaceViteConfigPluginImportSource, setIntlayerConfigCompilerOutput, setIntlayerConfigRoutingMode, updateAstroConfig, updateIntlayerConfigWithSyncPlugin, updateMetroConfig, updateNextConfig, updateNextConfigForNextI18next, updateNextConfigForNextIntl, updateNextConfigForNextTranslate, updateNuxtConfig, updateNuxtConfigForNuxtjsI18n, updateViteConfig, updateViteConfigForCompatPlugin, updateViteConfigForVueI18n } from "./configManipulation.js";
|
|
1
|
+
import { COMPAT_I18N_LIBRARIES, COMPAT_PACKAGE_REPLACEMENTS, CompatI18nLibrary, CompatSyncConfig, CompatVitePluginConfig, DetectMissingPackagesOptions, IntlayerPackageAnalysis, MINIMUM_ESLINT_MAJOR, PENDING_COMPAT_ADAPTERS, PackageManager, detectCompatI18nLibraries, detectMissingIntlayerPackages, detectPackageManager, findLockFileDir, hasLegacyEslint, hasLintTooling, installPackages, isIntlayerPackageName, moveCompatPackagesToDevDependencies, normalizeVersion, runPackageInstall } from "./packageManager.js";
|
|
2
|
+
import { RoutingMode, enableIntlayerEditorConfig, getMetroConfigTemplate, hasIntlayerVitePlugin, replaceViteConfigPluginImportSource, setIntlayerConfigCompilerOutput, setIntlayerConfigEnableProxy, setIntlayerConfigRoutingMode, setIntlayerConfigRoutingStorageOnly, updateAstroConfig, updateIntlayerConfigWithSyncPlugin, updateMetroConfig, updateNextConfig, updateNextConfigForNextI18next, updateNextConfigForNextIntl, updateNextConfigForNextTranslate, updateNuxtConfig, updateNuxtConfigForNuxtjsI18n, updateViteConfig, updateViteConfigForCompatPlugin, updateViteConfigForVueI18n } from "./configManipulation.js";
|
|
3
3
|
import { ensureNamedImport, firstInsertIndex, isModuleScopeBinding } from "./astImports.js";
|
|
4
4
|
import { BACKEND_INTLAYER_PACKAGES, ResolveDevScriptParams, resolveDevScript } from "./devScript.js";
|
|
5
5
|
import { JsonLocalePattern, JsonLocalePatternType, LinguiCatalogPattern, NextIntlMessagesPattern, detectJsonLocalePattern, detectLinguiCatalogPattern, detectNextIntlMessagesPattern, ensureDirectory, exists, readFileFromRoot, writeFileToRoot } from "./fileSystem.js";
|
|
6
6
|
import { GITHUB_FILL_WORKFLOW_PATH, GITHUB_TEST_WORKFLOW_PATH, GithubWorkflowFile, GithubWorkflowsContext, GithubWorkflowsOptions, getGithubWorkflows, resolveGithubWorkflowsContext } from "./githubActions.js";
|
|
7
7
|
import { IntlayerDependency, IntlayerDependencyUpgrade, PackageJsonIntlayerDependencies, fetchLatestPackageVersion, findPackageJsonFiles, getIntlayerDependencies, getIntlayerDependencyUpgrades, listIntlayerDependencies, toRange, writeIntlayerDependencyUpgrades } from "./intlayerDependencies.js";
|
|
8
8
|
import { parseJSONWithComments } from "./jsonParser.js";
|
|
9
|
+
import { LINT_PLUGIN_PACKAGE_NAME, OxlintConfig, addIntlayerRulesToOxlintConfig } from "./lintConfig.js";
|
|
9
10
|
import { NEXT_INTLAYER_BABEL_CONFIG_CONTENT, setupNextCompilerBabelConfig } from "./nextCompilerBabel.js";
|
|
10
11
|
import { findTsConfigFiles } from "./tsConfig.js";
|
|
12
|
+
import { hasUrlRoutingFramework } from "./urlRoutingFramework.js";
|
|
11
13
|
import { isVersionAtLeast } from "./version.js";
|
|
12
|
-
export { BACKEND_INTLAYER_PACKAGES, COMPAT_I18N_LIBRARIES, COMPAT_PACKAGE_REPLACEMENTS, CompatI18nLibrary, CompatSyncConfig, CompatVitePluginConfig, DetectMissingPackagesOptions, GITHUB_FILL_WORKFLOW_PATH, GITHUB_TEST_WORKFLOW_PATH, GithubWorkflowFile, GithubWorkflowsContext, GithubWorkflowsOptions, IntlayerDependency, IntlayerDependencyUpgrade, IntlayerPackageAnalysis, JsonLocalePattern, JsonLocalePatternType, LinguiCatalogPattern, NEXT_INTLAYER_BABEL_CONFIG_CONTENT, NextIntlMessagesPattern, PackageJsonIntlayerDependencies, PackageManager, ResolveDevScriptParams, RoutingMode, detectCompatI18nLibraries, detectJsonLocalePattern, detectLinguiCatalogPattern, detectMissingIntlayerPackages, detectNextIntlMessagesPattern, detectPackageManager, enableIntlayerEditorConfig, ensureDirectory, ensureNamedImport, exists, fetchLatestPackageVersion, findLockFileDir, findPackageJsonFiles, findTsConfigFiles, firstInsertIndex, getGithubWorkflows, getIntlayerDependencies, getIntlayerDependencyUpgrades, getMetroConfigTemplate, hasIntlayerVitePlugin, hasLintTooling, installPackages, isIntlayerPackageName, isModuleScopeBinding, isVersionAtLeast, listIntlayerDependencies, moveCompatPackagesToDevDependencies, normalizeVersion, parseJSONWithComments, readFileFromRoot, replaceViteConfigPluginImportSource, resolveDevScript, resolveGithubWorkflowsContext, runPackageInstall, setIntlayerConfigCompilerOutput, setIntlayerConfigRoutingMode, setupNextCompilerBabelConfig, toRange, updateAstroConfig, updateIntlayerConfigWithSyncPlugin, updateMetroConfig, updateNextConfig, updateNextConfigForNextI18next, updateNextConfigForNextIntl, updateNextConfigForNextTranslate, updateNuxtConfig, updateNuxtConfigForNuxtjsI18n, updateViteConfig, updateViteConfigForCompatPlugin, updateViteConfigForVueI18n, writeFileToRoot, writeIntlayerDependencyUpgrades };
|
|
14
|
+
export { BACKEND_INTLAYER_PACKAGES, COMPAT_I18N_LIBRARIES, COMPAT_PACKAGE_REPLACEMENTS, CompatI18nLibrary, CompatSyncConfig, CompatVitePluginConfig, DetectMissingPackagesOptions, GITHUB_FILL_WORKFLOW_PATH, GITHUB_TEST_WORKFLOW_PATH, GithubWorkflowFile, GithubWorkflowsContext, GithubWorkflowsOptions, IntlayerDependency, IntlayerDependencyUpgrade, IntlayerPackageAnalysis, JsonLocalePattern, JsonLocalePatternType, LINT_PLUGIN_PACKAGE_NAME, LinguiCatalogPattern, MINIMUM_ESLINT_MAJOR, NEXT_INTLAYER_BABEL_CONFIG_CONTENT, NextIntlMessagesPattern, OxlintConfig, PENDING_COMPAT_ADAPTERS, PackageJsonIntlayerDependencies, PackageManager, ResolveDevScriptParams, RoutingMode, addIntlayerRulesToOxlintConfig, detectCompatI18nLibraries, detectJsonLocalePattern, detectLinguiCatalogPattern, detectMissingIntlayerPackages, detectNextIntlMessagesPattern, detectPackageManager, enableIntlayerEditorConfig, ensureDirectory, ensureNamedImport, exists, fetchLatestPackageVersion, findLockFileDir, findPackageJsonFiles, findTsConfigFiles, firstInsertIndex, getGithubWorkflows, getIntlayerDependencies, getIntlayerDependencyUpgrades, getMetroConfigTemplate, hasIntlayerVitePlugin, hasLegacyEslint, hasLintTooling, hasUrlRoutingFramework, installPackages, isIntlayerPackageName, isModuleScopeBinding, isVersionAtLeast, listIntlayerDependencies, moveCompatPackagesToDevDependencies, normalizeVersion, parseJSONWithComments, readFileFromRoot, replaceViteConfigPluginImportSource, resolveDevScript, resolveGithubWorkflowsContext, runPackageInstall, setIntlayerConfigCompilerOutput, setIntlayerConfigEnableProxy, setIntlayerConfigRoutingMode, setIntlayerConfigRoutingStorageOnly, setupNextCompilerBabelConfig, toRange, updateAstroConfig, updateIntlayerConfigWithSyncPlugin, updateMetroConfig, updateNextConfig, updateNextConfigForNextI18next, updateNextConfigForNextIntl, updateNextConfigForNextTranslate, updateNuxtConfig, updateNuxtConfigForNuxtjsI18n, updateViteConfig, updateViteConfigForCompatPlugin, updateViteConfigForVueI18n, writeFileToRoot, writeIntlayerDependencyUpgrades };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/init/utils/lintConfig.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The Intlayer lint setup, as `intlayer init` writes it into `.oxlintrc.json`.
|
|
4
|
+
*
|
|
5
|
+
* Declared locally on purpose: `@intlayer/engine` is installed by every Intlayer
|
|
6
|
+
* user, so it must not depend on a lint plugin to write a handful of strings
|
|
7
|
+
* into a JSON file. oxlint resolves a plugin's *rules* but not its shipped
|
|
8
|
+
* *configs*, so the preset cannot be referenced by name there either.
|
|
9
|
+
*
|
|
10
|
+
* Mirrors the `recommended` preset of `eslint-plugin-intlayer`; keep in sync
|
|
11
|
+
* when a rule is enabled by default there.
|
|
12
|
+
*/
|
|
13
|
+
export declare const LINT_PLUGIN_PACKAGE_NAME = "eslint-plugin-intlayer";
|
|
14
|
+
/** The `.oxlintrc.json` fields init reads and writes. */
|
|
15
|
+
export type OxlintConfig = {
|
|
16
|
+
jsPlugins?: string[];
|
|
17
|
+
rules?: Record<string, unknown>;
|
|
18
|
+
ignorePatterns?: string[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Adds the Intlayer plugin, the `recommended` rules and the generated-output
|
|
22
|
+
* ignore to an oxlint config, in place. Rules the user already set are kept.
|
|
23
|
+
*
|
|
24
|
+
* @returns Whether anything was added.
|
|
25
|
+
*/
|
|
26
|
+
export declare const addIntlayerRulesToOxlintConfig: (oxlintConfig: OxlintConfig) => boolean;
|
|
27
|
+
//#endregion
|
|
28
|
+
//# sourceMappingURL=lintConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lintConfig.d.ts","names":[],"sources":["../../../../src/init/utils/lintConfig.ts"],"mappings":";;;;;;;;;;;;qBAWa;;YAaD;EACV;EACA,QAAQ;EACR;;;;;;;;qBASW,iCAA8B,cAC3B"}
|
|
@@ -83,7 +83,20 @@ export type IntlayerPackageAnalysis = {
|
|
|
83
83
|
* library requires alias injection.
|
|
84
84
|
*/
|
|
85
85
|
compatVitePluginConfig: CompatVitePluginConfig | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Compat adapters the project would need but that are not published yet
|
|
88
|
+
* (see {@link PENDING_COMPAT_ADAPTERS}). The original library is kept as is;
|
|
89
|
+
* only its catalogs are synced.
|
|
90
|
+
*/
|
|
91
|
+
pendingCompatAdapters: string[];
|
|
86
92
|
};
|
|
93
|
+
/**
|
|
94
|
+
* Compat adapters that live in `compat-comming/` and are not published to npm
|
|
95
|
+
* yet. Installing one fails the whole install command, so init keeps the
|
|
96
|
+
* original library, skips the adapter and its bundler / framework wiring, and
|
|
97
|
+
* only syncs the catalogs. Remove an entry once its package is released.
|
|
98
|
+
*/
|
|
99
|
+
export declare const PENDING_COMPAT_ADAPTERS: ReadonlySet<string>;
|
|
87
100
|
/**
|
|
88
101
|
* Detects the package manager in use by checking for lock files in the
|
|
89
102
|
* project root, then the `packageManager` field of its `package.json`. Falls
|
|
@@ -166,14 +179,24 @@ export declare const moveCompatPackagesToDevDependencies: (packageJson: Record<s
|
|
|
166
179
|
* @param dependencies - Merged dependencies of the target project.
|
|
167
180
|
*/
|
|
168
181
|
export declare const detectCompatI18nLibraries: (dependencies: Record<string, string>) => string[];
|
|
182
|
+
/** Lowest ESLint major `eslint-plugin-intlayer` supports (flat config). */
|
|
183
|
+
export declare const MINIMUM_ESLINT_MAJOR = 9;
|
|
184
|
+
/**
|
|
185
|
+
* True when the project pins ESLint below {@link MINIMUM_ESLINT_MAJOR}.
|
|
186
|
+
* Installing the plugin there fails on its `eslint` peer range (and takes the
|
|
187
|
+
* whole install command down with it). Ranges without a version number
|
|
188
|
+
* (`latest`, `*`, `catalog:`) are assumed current.
|
|
189
|
+
*
|
|
190
|
+
* @param dependencies - Merged dependencies of the target project.
|
|
191
|
+
*/
|
|
192
|
+
export declare const hasLegacyEslint: (dependencies: Record<string, string>) => boolean;
|
|
169
193
|
/**
|
|
170
|
-
* True when the project already lints
|
|
171
|
-
*
|
|
194
|
+
* True when the project already lints with a linter the Intlayer rules can
|
|
195
|
+
* plug into: oxlint, or ESLint 9+.
|
|
172
196
|
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* does not lint is left alone entirely.
|
|
197
|
+
* Shared with the init flow so that installing the plugin and wiring up its
|
|
198
|
+
* configuration are gated on exactly the same condition — a project that does
|
|
199
|
+
* not lint, or lints with ESLint 8, is left alone.
|
|
177
200
|
*
|
|
178
201
|
* @param dependencies - Merged dependencies of the target project.
|
|
179
202
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageManager.d.ts","names":[],"sources":["../../../../src/init/utils/packageManager.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"packageManager.d.ts","names":[],"sources":["../../../../src/init/utils/packageManager.ts"],"mappings":";;YAMY;;;;;YAMA;;;;;;;EAOV;;;;;EAKA;;;;;EAKA;;;;;;;;;;;;;;;EAeA;;;;;;;YAQU;;EAEV;;EAEA;;;;;;;;EAQA;;IAEE;;IAEA;;;;YAKQ;;EAEV;;EAEA;;EAEA;;;;;;EAMA,kBAAkB;;;;;;EAMlB,wBAAwB;;;;;;EAMxB;;;;;;;;qBASW,yBAAyB;;;;;;qBAiDzB,uBAAoB,oBAAsB;;;;;;qBAY1C,kBAAe;;;;;;;YA2ChB;;;;;;EAMV;;;;;;EAMA,eAAe;;;;EAIf,kBAAkB;;;YAIR;;EAEV;;;;;;EAMA;;;;;EAKA,cAAc;;;;;;;;qBASH,gCAAgC;;;;;qBA+GhC,6BAA6B;;;;;;;;qBAc7B,sCAAmC,aACjC;;;;;;;;;;qBA8BF,4BAAyB,cACtB;;qBAOH;;;;;;;;;qBAUA,kBAAe,cACZ;;;;;;;;;;;qBAiBH,iBAAc,cAAkB;qBAIhC,gCAA6B,iBACvB,wBAAsB,UAC9B,iCACR;;;;;qBAyZU,kBAAe,iBACX,oBACG,gBACF,gBAAc;;;;;;;;;;qBAgBnB,wBAAqB;;;;;;;;qBAarB,mBAAgB;;;;;;qBAahB,oBAAiB,iBACb,gBACC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/init/utils/urlRoutingFramework.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns true when the project is a web frontend for which locale routing is
|
|
4
|
+
* meaningful. React Native / Expo apps are excluded (no URL routing), as are
|
|
5
|
+
* backend-only and plain Node projects.
|
|
6
|
+
*/
|
|
7
|
+
export declare const hasUrlRoutingFramework: (dependencies: Record<string, string>) => boolean;
|
|
8
|
+
//#endregion
|
|
9
|
+
//# sourceMappingURL=urlRoutingFramework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlRoutingFramework.d.ts","names":[],"sources":["../../../../src/init/utils/urlRoutingFramework.ts"],"mappings":";;;;;;qBAgCa,yBAAsB,cACnB"}
|
|
@@ -13,7 +13,9 @@ export type InitConfigOptions = {
|
|
|
13
13
|
/**
|
|
14
14
|
* Initialize the Intlayer configuration file. No-ops when a configuration file
|
|
15
15
|
* already exists at `baseDir`.
|
|
16
|
+
*
|
|
17
|
+
* @returns `true` when the file was created, `false` when one already existed.
|
|
16
18
|
*/
|
|
17
|
-
export declare const initConfig: (format: (typeof configurationFilesCandidates)[number], baseDir: string, options?: InitConfigOptions) => Promise<
|
|
19
|
+
export declare const initConfig: (format: (typeof configurationFilesCandidates)[number], baseDir: string, options?: InitConfigOptions) => Promise<boolean>;
|
|
18
20
|
//#endregion
|
|
19
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/initConfig/index.ts"],"mappings":";;;YA6BY;;EAEV;;;;;EAKA
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/initConfig/index.ts"],"mappings":";;;YA6BY;;EAEV;;;;;EAKA;;;;;;;;qBASW,aAAU,gBACL,uCAAqC,iBACtC,UACL,sBACT"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
2
|
//#region src/loadDictionaries/logTypeScriptErrors.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Type-checks content declaration files and logs errors as warnings.
|
|
5
|
+
* Supports both the classic (`typescript` <= 6) and native (>= 7) compilers.
|
|
6
|
+
*/
|
|
3
7
|
export declare const logTypeScriptErrors: (filePaths: string[], configuration: IntlayerConfig) => Promise<void>;
|
|
4
8
|
//#endregion
|
|
5
9
|
//# sourceMappingURL=logTypeScriptErrors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logTypeScriptErrors.d.ts","names":[],"sources":["../../../src/loadDictionaries/logTypeScriptErrors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"logTypeScriptErrors.d.ts","names":[],"sources":["../../../src/loadDictionaries/logTypeScriptErrors.ts"],"mappings":";;;;;;qBAoQa,sBAAmB,qBACX,eACJ,mBACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/engine",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Scans and builds Intlayer declaration files into dictionaries based on Intlayer configuration.",
|
|
6
6
|
"keywords": [
|
|
@@ -142,11 +142,11 @@
|
|
|
142
142
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
143
143
|
},
|
|
144
144
|
"dependencies": {
|
|
145
|
-
"@intlayer/api": "9.5.
|
|
146
|
-
"@intlayer/config": "9.5.
|
|
147
|
-
"@intlayer/core": "9.5.
|
|
148
|
-
"@intlayer/dictionaries-entry": "9.5.
|
|
149
|
-
"@intlayer/types": "9.5.
|
|
145
|
+
"@intlayer/api": "9.5.10",
|
|
146
|
+
"@intlayer/config": "9.5.10",
|
|
147
|
+
"@intlayer/core": "9.5.10",
|
|
148
|
+
"@intlayer/dictionaries-entry": "9.5.10",
|
|
149
|
+
"@intlayer/types": "9.5.10",
|
|
150
150
|
"@parcel/watcher": "2.6.0",
|
|
151
151
|
"defu": "6.1.7",
|
|
152
152
|
"fast-glob": "3.3.3",
|
|
@@ -162,11 +162,11 @@
|
|
|
162
162
|
"rimraf": "6.1.3",
|
|
163
163
|
"tsdown": "0.23.0",
|
|
164
164
|
"typescript": "7.0.2",
|
|
165
|
-
"vitest": "5.0.
|
|
165
|
+
"vitest": "5.0.2",
|
|
166
166
|
"zod": "4.6.5"
|
|
167
167
|
},
|
|
168
168
|
"peerDependencies": {
|
|
169
|
-
"@intlayer/babel": "9.5.
|
|
169
|
+
"@intlayer/babel": "9.5.10"
|
|
170
170
|
},
|
|
171
171
|
"peerDependenciesMeta": {
|
|
172
172
|
"@intlayer/babel": {
|