@lingo.dev/react-next 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/chunk.cjs ADDED
@@ -0,0 +1,28 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ Object.defineProperty(exports, "__toESM", {
24
+ enumerable: true,
25
+ get: function() {
26
+ return __toESM;
27
+ }
28
+ });
@@ -0,0 +1,84 @@
1
+ const require_chunk = require("./chunk.cjs");
2
+ let _lingo_dev_react = require("@lingo.dev/react");
3
+ let next_router = require("next/router");
4
+ let react = require("react");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ let next_head = require("next/head");
7
+ next_head = require_chunk.__toESM(next_head);
8
+ //#region src/pages/with-lingo-app.tsx
9
+ /**
10
+ * HOC for _app.tsx. Wraps the app in LingoProvider and handles RTL direction.
11
+ *
12
+ * - SSR: injects a blocking <script> to set dir="rtl" before hydration (no flash)
13
+ * - CSR: useEffect keeps dir in sync on locale change
14
+ * - Dev mode: warns when a page is missing withLingoProps
15
+ */
16
+ function withLingoApp(App) {
17
+ function LingoApp(props) {
18
+ const { locale, defaultLocale } = (0, next_router.useRouter)();
19
+ const resolvedLocale = locale ?? defaultLocale ?? "en";
20
+ const messages = props.pageProps?.__lingoMessages ?? {};
21
+ const { direction } = (0, _lingo_dev_react.createLingo)(resolvedLocale);
22
+ (0, react.useEffect)(() => {
23
+ document.documentElement.dir = direction;
24
+ }, [direction]);
25
+ if (process.env.NODE_ENV === "development" && !props.pageProps?.__lingoMessages) console.warn("[@lingo.dev/react-next] No __lingoMessages in pageProps. Add withLingoProps({ route: '...' }) to this page.");
26
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [direction === "rtl" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", { dangerouslySetInnerHTML: { __html: `document.documentElement.dir="rtl"` } }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_lingo_dev_react.LingoProvider, {
27
+ locale: resolvedLocale,
28
+ messages,
29
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(App, { ...props })
30
+ })] });
31
+ }
32
+ LingoApp.displayName = `withLingoApp(${App.displayName || App.name || "App"})`;
33
+ return LingoApp;
34
+ }
35
+ //#endregion
36
+ //#region src/pages/use-locale-switch.ts
37
+ /**
38
+ * Hook for locale switching. Sets NEXT_LOCALE cookie + navigates via router.
39
+ */
40
+ function useLocaleSwitch() {
41
+ const router = (0, next_router.useRouter)();
42
+ return (0, react.useCallback)((locale) => {
43
+ document.cookie = `NEXT_LOCALE=${locale}; path=/; max-age=31536000; SameSite=Lax`;
44
+ router.push(router.asPath, router.asPath, { locale });
45
+ }, [router]);
46
+ }
47
+ //#endregion
48
+ //#region src/pages/lingo-head.tsx
49
+ /**
50
+ * Generates <link rel="alternate" hreflang="..."> tags for SEO.
51
+ * Auto-derives all locale variants from Next.js router config.
52
+ */
53
+ function LingoHead({ baseUrl = "" }) {
54
+ const { locales, defaultLocale, asPath } = (0, next_router.useRouter)();
55
+ if (!locales) return null;
56
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(next_head.default, { children: [locales.map((l) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("link", {
57
+ rel: "alternate",
58
+ hrefLang: l,
59
+ href: `${baseUrl}${l === defaultLocale ? "" : `/${l}`}${asPath}`
60
+ }, l)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("link", {
61
+ rel: "alternate",
62
+ hrefLang: "x-default",
63
+ href: `${baseUrl}${asPath}`
64
+ })] });
65
+ }
66
+ //#endregion
67
+ Object.defineProperty(exports, "LingoHead", {
68
+ enumerable: true,
69
+ get: function() {
70
+ return LingoHead;
71
+ }
72
+ });
73
+ Object.defineProperty(exports, "useLocaleSwitch", {
74
+ enumerable: true,
75
+ get: function() {
76
+ return useLocaleSwitch;
77
+ }
78
+ });
79
+ Object.defineProperty(exports, "withLingoApp", {
80
+ enumerable: true,
81
+ get: function() {
82
+ return withLingoApp;
83
+ }
84
+ });
@@ -0,0 +1,34 @@
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import { ComponentType } from "react";
3
+ import { AppProps } from "next/app";
4
+
5
+ //#region src/pages/with-lingo-app.d.ts
6
+
7
+ declare function withLingoApp<P extends AppProps>(App: ComponentType<P>): {
8
+ (props: P): react_jsx_runtime0.JSX.Element;
9
+ displayName: string;
10
+ };
11
+ //# sourceMappingURL=with-lingo-app.d.ts.map
12
+ //#endregion
13
+ //#region src/pages/use-locale-switch.d.ts
14
+ /**
15
+ * Hook for locale switching. Sets NEXT_LOCALE cookie + navigates via router.
16
+ */
17
+ declare function useLocaleSwitch(): (locale: string) => void;
18
+ //# sourceMappingURL=use-locale-switch.d.ts.map
19
+ //#endregion
20
+ //#region src/pages/lingo-head.d.ts
21
+ /**
22
+ * Generates <link rel="alternate" hreflang="..."> tags for SEO.
23
+ * Auto-derives all locale variants from Next.js router config.
24
+ */
25
+ type LingoHeadProps = {
26
+ /** Base URL for absolute hreflang hrefs (e.g., "https://example.com"). Recommended for production. */
27
+ baseUrl?: string;
28
+ };
29
+ declare function LingoHead({
30
+ baseUrl
31
+ }: LingoHeadProps): react_jsx_runtime0.JSX.Element | null;
32
+ //#endregion
33
+ export { useLocaleSwitch as n, withLingoApp as r, LingoHead as t };
34
+ //# sourceMappingURL=lingo-head.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lingo-head.d.cts","names":[],"sources":["../src/pages/with-lingo-app.tsx","../src/pages/use-locale-switch.ts","../src/pages/lingo-head.tsx"],"sourcesContent":[],"mappings":";;;;;;AAasD,iBAAtC,YAAsC,CAAA,UAAf,QAAe,CAAA,CAAA,GAAA,EAAA,aAAA,CAAc,CAAd,CAAA,CAAA,EAAA;QAC3B,EAAA,CAAA,CAAA,EAAC,kBAAA,CAAA,GAAA,CAAA,OAAD;aAAC,EAAA,MAAA;CAAA;;;;;;;iBCPZ,eAAA,CAAA;;;;;;;;KCCX,cAAA;EFKW;EAAY,OAAA,CAAA,EAAA,MAAA;;AAAwC,iBEApD,SAAA,CFAoD;EAAA;AAAA,CAAA,EEAxB,cFAwB,CAAA,EEAV,kBAAA,CAAA,GAAA,CAAA,OAAA,GFAU,IAAA"}
@@ -0,0 +1,34 @@
1
+ import { ComponentType } from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { AppProps } from "next/app";
4
+
5
+ //#region src/pages/with-lingo-app.d.ts
6
+
7
+ declare function withLingoApp<P extends AppProps>(App: ComponentType<P>): {
8
+ (props: P): react_jsx_runtime0.JSX.Element;
9
+ displayName: string;
10
+ };
11
+ //# sourceMappingURL=with-lingo-app.d.ts.map
12
+ //#endregion
13
+ //#region src/pages/use-locale-switch.d.ts
14
+ /**
15
+ * Hook for locale switching. Sets NEXT_LOCALE cookie + navigates via router.
16
+ */
17
+ declare function useLocaleSwitch(): (locale: string) => void;
18
+ //# sourceMappingURL=use-locale-switch.d.ts.map
19
+ //#endregion
20
+ //#region src/pages/lingo-head.d.ts
21
+ /**
22
+ * Generates <link rel="alternate" hreflang="..."> tags for SEO.
23
+ * Auto-derives all locale variants from Next.js router config.
24
+ */
25
+ type LingoHeadProps = {
26
+ /** Base URL for absolute hreflang hrefs (e.g., "https://example.com"). Recommended for production. */
27
+ baseUrl?: string;
28
+ };
29
+ declare function LingoHead({
30
+ baseUrl
31
+ }: LingoHeadProps): react_jsx_runtime0.JSX.Element | null;
32
+ //#endregion
33
+ export { useLocaleSwitch as n, withLingoApp as r, LingoHead as t };
34
+ //# sourceMappingURL=lingo-head.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lingo-head.d.ts","names":[],"sources":["../src/pages/with-lingo-app.tsx","../src/pages/use-locale-switch.ts","../src/pages/lingo-head.tsx"],"sourcesContent":[],"mappings":";;;;;;AAasD,iBAAtC,YAAsC,CAAA,UAAf,QAAe,CAAA,CAAA,GAAA,EAAA,aAAA,CAAc,CAAd,CAAA,CAAA,EAAA;QAC3B,EAAA,CAAA,CAAA,EAAC,kBAAA,CAAA,GAAA,CAAA,OAAD;aAAC,EAAA,MAAA;CAAA;;;;;;;iBCPZ,eAAA,CAAA;;;;;;;;KCCX,cAAA;EFKW;EAAY,OAAA,CAAA,EAAA,MAAA;;AAAwC,iBEApD,SAAA,CFAoD;EAAA;AAAA,CAAA,EEAxB,cFAwB,CAAA,EEAV,kBAAA,CAAA,GAAA,CAAA,OAAA,GFAU,IAAA"}
@@ -0,0 +1,67 @@
1
+ import { LingoProvider, createLingo } from "@lingo.dev/react";
2
+ import { useRouter } from "next/router";
3
+ import { useCallback, useEffect } from "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import Head from "next/head";
6
+ //#region src/pages/with-lingo-app.tsx
7
+ /**
8
+ * HOC for _app.tsx. Wraps the app in LingoProvider and handles RTL direction.
9
+ *
10
+ * - SSR: injects a blocking <script> to set dir="rtl" before hydration (no flash)
11
+ * - CSR: useEffect keeps dir in sync on locale change
12
+ * - Dev mode: warns when a page is missing withLingoProps
13
+ */
14
+ function withLingoApp(App) {
15
+ function LingoApp(props) {
16
+ const { locale, defaultLocale } = useRouter();
17
+ const resolvedLocale = locale ?? defaultLocale ?? "en";
18
+ const messages = props.pageProps?.__lingoMessages ?? {};
19
+ const { direction } = createLingo(resolvedLocale);
20
+ useEffect(() => {
21
+ document.documentElement.dir = direction;
22
+ }, [direction]);
23
+ if (process.env.NODE_ENV === "development" && !props.pageProps?.__lingoMessages) console.warn("[@lingo.dev/react-next] No __lingoMessages in pageProps. Add withLingoProps({ route: '...' }) to this page.");
24
+ return /* @__PURE__ */ jsxs(Fragment, { children: [direction === "rtl" && /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: `document.documentElement.dir="rtl"` } }), /* @__PURE__ */ jsx(LingoProvider, {
25
+ locale: resolvedLocale,
26
+ messages,
27
+ children: /* @__PURE__ */ jsx(App, { ...props })
28
+ })] });
29
+ }
30
+ LingoApp.displayName = `withLingoApp(${App.displayName || App.name || "App"})`;
31
+ return LingoApp;
32
+ }
33
+ //#endregion
34
+ //#region src/pages/use-locale-switch.ts
35
+ /**
36
+ * Hook for locale switching. Sets NEXT_LOCALE cookie + navigates via router.
37
+ */
38
+ function useLocaleSwitch() {
39
+ const router = useRouter();
40
+ return useCallback((locale) => {
41
+ document.cookie = `NEXT_LOCALE=${locale}; path=/; max-age=31536000; SameSite=Lax`;
42
+ router.push(router.asPath, router.asPath, { locale });
43
+ }, [router]);
44
+ }
45
+ //#endregion
46
+ //#region src/pages/lingo-head.tsx
47
+ /**
48
+ * Generates <link rel="alternate" hreflang="..."> tags for SEO.
49
+ * Auto-derives all locale variants from Next.js router config.
50
+ */
51
+ function LingoHead({ baseUrl = "" }) {
52
+ const { locales, defaultLocale, asPath } = useRouter();
53
+ if (!locales) return null;
54
+ return /* @__PURE__ */ jsxs(Head, { children: [locales.map((l) => /* @__PURE__ */ jsx("link", {
55
+ rel: "alternate",
56
+ hrefLang: l,
57
+ href: `${baseUrl}${l === defaultLocale ? "" : `/${l}`}${asPath}`
58
+ }, l)), /* @__PURE__ */ jsx("link", {
59
+ rel: "alternate",
60
+ hrefLang: "x-default",
61
+ href: `${baseUrl}${asPath}`
62
+ })] });
63
+ }
64
+ //#endregion
65
+ export { useLocaleSwitch as n, withLingoApp as r, LingoHead as t };
66
+
67
+ //# sourceMappingURL=lingo-head.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lingo-head.js","names":[],"sources":["../src/pages/with-lingo-app.tsx","../src/pages/use-locale-switch.ts","../src/pages/lingo-head.tsx"],"sourcesContent":["/**\n * HOC for _app.tsx. Wraps the app in LingoProvider and handles RTL direction.\n *\n * - SSR: injects a blocking <script> to set dir=\"rtl\" before hydration (no flash)\n * - CSR: useEffect keeps dir in sync on locale change\n * - Dev mode: warns when a page is missing withLingoProps\n */\n\nimport { LingoProvider, createLingo } from \"@lingo.dev/react\";\nimport { useRouter } from \"next/router\";\nimport { useEffect, type ComponentType } from \"react\";\nimport type { AppProps } from \"next/app\";\n\nexport function withLingoApp<P extends AppProps>(App: ComponentType<P>) {\n function LingoApp(props: P) {\n const { locale, defaultLocale } = useRouter();\n const resolvedLocale = locale ?? defaultLocale ?? \"en\";\n const messages = props.pageProps?.__lingoMessages ?? {};\n const { direction } = createLingo(resolvedLocale);\n\n useEffect(() => {\n document.documentElement.dir = direction;\n }, [direction]);\n\n if (process.env.NODE_ENV === \"development\" && !props.pageProps?.__lingoMessages) {\n console.warn(\n \"[@lingo.dev/react-next] No __lingoMessages in pageProps. Add withLingoProps({ route: '...' }) to this page.\",\n );\n }\n\n return (\n <>\n {direction === \"rtl\" && <script dangerouslySetInnerHTML={{ __html: `document.documentElement.dir=\"rtl\"` }} />}\n <LingoProvider locale={resolvedLocale} messages={messages}>\n <App {...props} />\n </LingoProvider>\n </>\n );\n }\n\n LingoApp.displayName = `withLingoApp(${App.displayName || App.name || \"App\"})`;\n return LingoApp;\n}\n","/**\n * Hook for locale switching. Sets NEXT_LOCALE cookie + navigates via router.\n */\n\nimport { useRouter } from \"next/router\";\nimport { useCallback } from \"react\";\n\nexport function useLocaleSwitch() {\n const router = useRouter();\n return useCallback(\n (locale: string) => {\n document.cookie = `NEXT_LOCALE=${locale}; path=/; max-age=31536000; SameSite=Lax`;\n router.push(router.asPath, router.asPath, { locale });\n },\n [router],\n );\n}\n","/**\n * Generates <link rel=\"alternate\" hreflang=\"...\"> tags for SEO.\n * Auto-derives all locale variants from Next.js router config.\n */\n\nimport Head from \"next/head\";\nimport { useRouter } from \"next/router\";\n\ntype LingoHeadProps = {\n /** Base URL for absolute hreflang hrefs (e.g., \"https://example.com\"). Recommended for production. */\n baseUrl?: string;\n};\n\nexport function LingoHead({ baseUrl = \"\" }: LingoHeadProps) {\n const { locales, defaultLocale, asPath } = useRouter();\n\n if (!locales) return null;\n\n return (\n <Head>\n {locales.map((l) => (\n <link key={l} rel=\"alternate\" hrefLang={l} href={`${baseUrl}${l === defaultLocale ? \"\" : `/${l}`}${asPath}`} />\n ))}\n <link rel=\"alternate\" hrefLang=\"x-default\" href={`${baseUrl}${asPath}`} />\n </Head>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,SAAgB,aAAiC,KAAuB;CACtE,SAAS,SAAS,OAAU;EAC1B,MAAM,EAAE,QAAQ,kBAAkB,WAAW;EAC7C,MAAM,iBAAiB,UAAU,iBAAiB;EAClD,MAAM,WAAW,MAAM,WAAW,mBAAmB,EAAE;EACvD,MAAM,EAAE,cAAc,YAAY,eAAe;AAEjD,kBAAgB;AACd,YAAS,gBAAgB,MAAM;KAC9B,CAAC,UAAU,CAAC;AAEf,MAAI,QAAQ,IAAI,aAAa,iBAAiB,CAAC,MAAM,WAAW,gBAC9D,SAAQ,KACN,8GACD;AAGH,SACE,qBAAA,UAAA,EAAA,UAAA,CACG,cAAc,SAAS,oBAAC,UAAD,EAAQ,yBAAyB,EAAE,QAAQ,sCAAsC,EAAI,CAAA,EAC7G,oBAAC,eAAD;GAAe,QAAQ;GAA0B;aAC/C,oBAAC,KAAD,EAAK,GAAI,OAAS,CAAA;GACJ,CAAA,CACf,EAAA,CAAA;;AAIP,UAAS,cAAc,gBAAgB,IAAI,eAAe,IAAI,QAAQ,MAAM;AAC5E,QAAO;;;;;;;AClCT,SAAgB,kBAAkB;CAChC,MAAM,SAAS,WAAW;AAC1B,QAAO,aACJ,WAAmB;AAClB,WAAS,SAAS,eAAe,OAAO;AACxC,SAAO,KAAK,OAAO,QAAQ,OAAO,QAAQ,EAAE,QAAQ,CAAC;IAEvD,CAAC,OAAO,CACT;;;;;;;;ACFH,SAAgB,UAAU,EAAE,UAAU,MAAsB;CAC1D,MAAM,EAAE,SAAS,eAAe,WAAW,WAAW;AAEtD,KAAI,CAAC,QAAS,QAAO;AAErB,QACE,qBAAC,MAAD,EAAA,UAAA,CACG,QAAQ,KAAK,MACZ,oBAAC,QAAD;EAAc,KAAI;EAAY,UAAU;EAAG,MAAM,GAAG,UAAU,MAAM,gBAAgB,KAAK,IAAI,MAAM;EAAY,EAApG,EAAoG,CAC/G,EACF,oBAAC,QAAD;EAAM,KAAI;EAAY,UAAS;EAAY,MAAM,GAAG,UAAU;EAAY,CAAA,CACrE,EAAA,CAAA"}
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_lingo_head = require("../lingo-head.cjs");
3
+ exports.LingoHead = require_lingo_head.LingoHead;
4
+ exports.useLocaleSwitch = require_lingo_head.useLocaleSwitch;
5
+ exports.withLingoApp = require_lingo_head.withLingoApp;
@@ -0,0 +1,2 @@
1
+ import { n as useLocaleSwitch, r as withLingoApp, t as LingoHead } from "../lingo-head.cjs";
2
+ export { LingoHead, useLocaleSwitch, withLingoApp };
@@ -0,0 +1,2 @@
1
+ import { n as useLocaleSwitch, r as withLingoApp, t as LingoHead } from "../lingo-head.js";
2
+ export { LingoHead, useLocaleSwitch, withLingoApp };
@@ -0,0 +1,2 @@
1
+ import { n as useLocaleSwitch, r as withLingoApp, t as LingoHead } from "../lingo-head.js";
2
+ export { LingoHead, useLocaleSwitch, withLingoApp };
@@ -0,0 +1,8 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_with_lingo_paths = require("../with-lingo-paths.cjs");
3
+ const require_lingo_head = require("../lingo-head.cjs");
4
+ exports.LingoHead = require_lingo_head.LingoHead;
5
+ exports.useLocaleSwitch = require_lingo_head.useLocaleSwitch;
6
+ exports.withLingoApp = require_lingo_head.withLingoApp;
7
+ exports.withLingoPaths = require_with_lingo_paths.withLingoPaths;
8
+ exports.withLingoProps = require_with_lingo_paths.withLingoProps;
@@ -0,0 +1,3 @@
1
+ import { n as useLocaleSwitch, r as withLingoApp, t as LingoHead } from "../lingo-head.cjs";
2
+ import { n as withLingoProps, t as withLingoPaths } from "../with-lingo-paths.cjs";
3
+ export { LingoHead, useLocaleSwitch, withLingoApp, withLingoPaths, withLingoProps };
@@ -0,0 +1,3 @@
1
+ import { n as useLocaleSwitch, r as withLingoApp, t as LingoHead } from "../lingo-head.js";
2
+ import { n as withLingoProps, t as withLingoPaths } from "../with-lingo-paths.js";
3
+ export { LingoHead, useLocaleSwitch, withLingoApp, withLingoPaths, withLingoProps };
@@ -0,0 +1,3 @@
1
+ import { n as withLingoProps, t as withLingoPaths } from "../with-lingo-paths.js";
2
+ import { n as useLocaleSwitch, r as withLingoApp, t as LingoHead } from "../lingo-head.js";
3
+ export { LingoHead, useLocaleSwitch, withLingoApp, withLingoPaths, withLingoProps };
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_with_lingo_paths = require("../with-lingo-paths.cjs");
3
+ exports.withLingoPaths = require_with_lingo_paths.withLingoPaths;
4
+ exports.withLingoProps = require_with_lingo_paths.withLingoProps;
@@ -0,0 +1,2 @@
1
+ import { n as withLingoProps, t as withLingoPaths } from "../with-lingo-paths.cjs";
2
+ export { withLingoPaths, withLingoProps };
@@ -0,0 +1,2 @@
1
+ import { n as withLingoProps, t as withLingoPaths } from "../with-lingo-paths.js";
2
+ export { withLingoPaths, withLingoProps };
@@ -0,0 +1,2 @@
1
+ import { n as withLingoProps, t as withLingoPaths } from "../with-lingo-paths.js";
2
+ export { withLingoPaths, withLingoProps };
@@ -0,0 +1,80 @@
1
+ const require_chunk = require("./chunk.cjs");
2
+ let _lingo_dev_spec = require("@lingo.dev/spec");
3
+ let node_fs = require("node:fs");
4
+ node_fs = require_chunk.__toESM(node_fs);
5
+ let node_path = require("node:path");
6
+ node_path = require_chunk.__toESM(node_path);
7
+ //#region src/pages/load-messages.ts
8
+ /**
9
+ * Loads translated messages from JSONC locale files.
10
+ * Internal module - used by withLingoProps, not exported publicly.
11
+ *
12
+ * Reads JSONC directly (no build step). Filters orphaned entries.
13
+ * Splits messages by route using @src metadata from extraction.
14
+ */
15
+ const MESSAGES_DIR = "locales";
16
+ /**
17
+ * Loads messages for a specific locale and route.
18
+ * Returns page-specific messages + shared messages (components, lib, etc.).
19
+ */
20
+ function loadMessages(locale, route) {
21
+ const filePath = node_path.default.resolve(process.cwd(), MESSAGES_DIR, `${locale}.jsonc`);
22
+ if (!node_fs.default.existsSync(filePath)) {
23
+ if (process.env.NODE_ENV === "development") console.warn(`[@lingo.dev/react-next] No locale file for "${locale}". Run "lingo extract && lingo localize".`);
24
+ return {};
25
+ }
26
+ return (0, _lingo_dev_spec.getActiveEntries)((0, _lingo_dev_spec.readLocaleFile)(node_fs.default.readFileSync(filePath, "utf8")).entries).filter((entry) => {
27
+ if (!entry.metadata.src) return true;
28
+ const srcRoute = entry.metadata.src.replace(/\.\w+:\d+$/, "");
29
+ if (srcRoute === route) return true;
30
+ return !srcRoute.startsWith("pages/") && !srcRoute.startsWith("src/pages/");
31
+ }).reduce((acc, entry) => {
32
+ acc[entry.key] = entry.value;
33
+ return acc;
34
+ }, {});
35
+ }
36
+ //#endregion
37
+ //#region src/pages/with-lingo-props.ts
38
+ function withLingoProps(config) {
39
+ return async (ctx) => {
40
+ const messages = loadMessages(ctx.locale ?? ctx.defaultLocale ?? "en", config.route);
41
+ if (!config.handler) return { props: { __lingoMessages: messages } };
42
+ const result = await config.handler(ctx);
43
+ if ("redirect" in result) return result;
44
+ if ("notFound" in result) return result;
45
+ return {
46
+ ...result,
47
+ props: {
48
+ ...result.props,
49
+ __lingoMessages: messages
50
+ }
51
+ };
52
+ };
53
+ }
54
+ //#endregion
55
+ //#region src/pages/with-lingo-paths.ts
56
+ function withLingoPaths(handler, options) {
57
+ return async (ctx) => {
58
+ const paths = await handler();
59
+ return {
60
+ paths: (ctx.locales ?? ["en"]).flatMap((locale) => paths.map((entry) => ({
61
+ ...entry,
62
+ locale
63
+ }))),
64
+ fallback: options?.fallback ?? "blocking"
65
+ };
66
+ };
67
+ }
68
+ //#endregion
69
+ Object.defineProperty(exports, "withLingoPaths", {
70
+ enumerable: true,
71
+ get: function() {
72
+ return withLingoPaths;
73
+ }
74
+ });
75
+ Object.defineProperty(exports, "withLingoProps", {
76
+ enumerable: true,
77
+ get: function() {
78
+ return withLingoProps;
79
+ }
80
+ });
@@ -0,0 +1,35 @@
1
+ import * as next0 from "next";
2
+ import { GetStaticPathsContext, GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult } from "next";
3
+ import { ParsedUrlQuery } from "node:querystring";
4
+
5
+ //#region src/pages/with-lingo-props.d.ts
6
+ type WithLingoPropsConfig<P extends Record<string, any>> = {
7
+ /** Page route for per-route message splitting (e.g., "pages/about"). */
8
+ route: string;
9
+ /** Optional handler for additional page data (custom props, revalidate, redirect, notFound). */
10
+ handler?: (ctx: GetStaticPropsContext) => Promise<GetStaticPropsResult<P>>;
11
+ };
12
+ type LingoPageProps = {
13
+ __lingoMessages: Record<string, string>;
14
+ };
15
+ declare function withLingoProps<P extends Record<string, any> = {}>(config: WithLingoPropsConfig<P>): (ctx: GetStaticPropsContext) => Promise<{
16
+ redirect: next0.Redirect;
17
+ revalidate?: number | boolean;
18
+ } | {
19
+ notFound: true;
20
+ revalidate?: number | boolean;
21
+ } | {
22
+ props: P & LingoPageProps;
23
+ revalidate?: number | boolean;
24
+ }>;
25
+ //#endregion
26
+ //#region src/pages/with-lingo-paths.d.ts
27
+ type PathEntry<P extends ParsedUrlQuery> = {
28
+ params: P;
29
+ };
30
+ declare function withLingoPaths<P extends ParsedUrlQuery>(handler: () => Promise<PathEntry<P>[]>, options?: {
31
+ fallback?: false | "blocking" | true;
32
+ }): (ctx: GetStaticPathsContext) => Promise<GetStaticPathsResult<P>>;
33
+ //#endregion
34
+ export { withLingoProps as n, withLingoPaths as t };
35
+ //# sourceMappingURL=with-lingo-paths.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-lingo-paths.d.cts","names":[],"sources":["../src/pages/with-lingo-props.ts","../src/pages/with-lingo-paths.ts"],"sourcesContent":[],"mappings":";;;;;AAKwE,KAGnE,oBAAA,CAAA,UAA+B,MAAX,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,GAAA;EAAA;OAAW,EAAA,MAAA;;SAIqC,CAAA,EAAA,CAAA,GAAA,EAAvD,qBAAuD,EAAA,GAA7B,OAA6B,CAArB,oBAAqB,CAAA,CAAA,CAAA,CAAA;;KAGpE,cAAA,GAHuC;EAAO,eAAA,EAGV,MAHU,CAAA,MAAA,EAAA,MAAA,CAAA;AAAA,CAAA;AAKnC,iBAAA,cAAc,CAAA,UAAW,MAAX,CAAA,MAAA,EAAA,GAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,MAAA,EAA6C,oBAA7C,CAAkE,CAAlE,CAAA,CAAA,EAAA,CAAA,GAAA,EACT,qBADS,EAAA,GACY,OADZ,CAAA;EAAA,QAAA,EACY,KAAA,CAAA,QADZ;YAAW,CAAA,EAAA,MAAA,GAAA,OAAA;;UAAkC,EAAA,IAAA;YACtD,CAAA,EAAA,MAAA,GAAA,OAAA;;OAe0C,EAAA,CAAA,GAAI,cAAJ;YAAI,CAAA,EAAA,MAAA,GAAA,OAAA;;;;KCzB9D,SDAoB,CAAA,UCAA,cDAA,CAAA,GAAA;QAAW,ECAiB,CDAjB;;AAIqC,iBCFzD,cDEyD,CAAA,UCFhC,cDEgC,CAAA,CAAA,OAAA,EAAA,GAAA,GCDxD,ODCwD,CCDhD,SDCgD,CCDtC,CDCsC,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA;UAArB,CAAA,EAAA,KAAA,GAAA,UAAA,GAAA,IAAA;QAAR,ECEvB,qBDFuB,EAAA,GCEC,ODFD,CCES,oBDFT,CCE8B,CDF9B,CAAA,CAAA"}
@@ -0,0 +1,35 @@
1
+ import * as next0 from "next";
2
+ import { GetStaticPathsContext, GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult } from "next";
3
+ import { ParsedUrlQuery } from "node:querystring";
4
+
5
+ //#region src/pages/with-lingo-props.d.ts
6
+ type WithLingoPropsConfig<P extends Record<string, any>> = {
7
+ /** Page route for per-route message splitting (e.g., "pages/about"). */
8
+ route: string;
9
+ /** Optional handler for additional page data (custom props, revalidate, redirect, notFound). */
10
+ handler?: (ctx: GetStaticPropsContext) => Promise<GetStaticPropsResult<P>>;
11
+ };
12
+ type LingoPageProps = {
13
+ __lingoMessages: Record<string, string>;
14
+ };
15
+ declare function withLingoProps<P extends Record<string, any> = {}>(config: WithLingoPropsConfig<P>): (ctx: GetStaticPropsContext) => Promise<{
16
+ redirect: next0.Redirect;
17
+ revalidate?: number | boolean;
18
+ } | {
19
+ notFound: true;
20
+ revalidate?: number | boolean;
21
+ } | {
22
+ props: P & LingoPageProps;
23
+ revalidate?: number | boolean;
24
+ }>;
25
+ //#endregion
26
+ //#region src/pages/with-lingo-paths.d.ts
27
+ type PathEntry<P extends ParsedUrlQuery> = {
28
+ params: P;
29
+ };
30
+ declare function withLingoPaths<P extends ParsedUrlQuery>(handler: () => Promise<PathEntry<P>[]>, options?: {
31
+ fallback?: false | "blocking" | true;
32
+ }): (ctx: GetStaticPathsContext) => Promise<GetStaticPathsResult<P>>;
33
+ //#endregion
34
+ export { withLingoProps as n, withLingoPaths as t };
35
+ //# sourceMappingURL=with-lingo-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-lingo-paths.d.ts","names":[],"sources":["../src/pages/with-lingo-props.ts","../src/pages/with-lingo-paths.ts"],"sourcesContent":[],"mappings":";;;;;AAKwE,KAGnE,oBAAA,CAAA,UAA+B,MAAX,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,GAAA;EAAA;OAAW,EAAA,MAAA;;SAIqC,CAAA,EAAA,CAAA,GAAA,EAAvD,qBAAuD,EAAA,GAA7B,OAA6B,CAArB,oBAAqB,CAAA,CAAA,CAAA,CAAA;;KAGpE,cAAA,GAHuC;EAAO,eAAA,EAGV,MAHU,CAAA,MAAA,EAAA,MAAA,CAAA;AAAA,CAAA;AAKnC,iBAAA,cAAc,CAAA,UAAW,MAAX,CAAA,MAAA,EAAA,GAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,MAAA,EAA6C,oBAA7C,CAAkE,CAAlE,CAAA,CAAA,EAAA,CAAA,GAAA,EACT,qBADS,EAAA,GACY,OADZ,CAAA;EAAA,QAAA,EACY,KAAA,CAAA,QADZ;YAAW,CAAA,EAAA,MAAA,GAAA,OAAA;;UAAkC,EAAA,IAAA;YACtD,CAAA,EAAA,MAAA,GAAA,OAAA;;OAe0C,EAAA,CAAA,GAAI,cAAJ;YAAI,CAAA,EAAA,MAAA,GAAA,OAAA;;;;KCzB9D,SDAoB,CAAA,UCAA,cDAA,CAAA,GAAA;QAAW,ECAiB,CDAjB;;AAIqC,iBCFzD,cDEyD,CAAA,UCFhC,cDEgC,CAAA,CAAA,OAAA,EAAA,GAAA,GCDxD,ODCwD,CCDhD,SDCgD,CCDtC,CDCsC,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA;UAArB,CAAA,EAAA,KAAA,GAAA,UAAA,GAAA,IAAA;QAAR,ECEvB,qBDFuB,EAAA,GCEC,ODFD,CCES,oBDFT,CCE8B,CDF9B,CAAA,CAAA"}
@@ -0,0 +1,68 @@
1
+ import { getActiveEntries, readLocaleFile } from "@lingo.dev/spec";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ //#region src/pages/load-messages.ts
5
+ /**
6
+ * Loads translated messages from JSONC locale files.
7
+ * Internal module - used by withLingoProps, not exported publicly.
8
+ *
9
+ * Reads JSONC directly (no build step). Filters orphaned entries.
10
+ * Splits messages by route using @src metadata from extraction.
11
+ */
12
+ const MESSAGES_DIR = "locales";
13
+ /**
14
+ * Loads messages for a specific locale and route.
15
+ * Returns page-specific messages + shared messages (components, lib, etc.).
16
+ */
17
+ function loadMessages(locale, route) {
18
+ const filePath = path.resolve(process.cwd(), MESSAGES_DIR, `${locale}.jsonc`);
19
+ if (!fs.existsSync(filePath)) {
20
+ if (process.env.NODE_ENV === "development") console.warn(`[@lingo.dev/react-next] No locale file for "${locale}". Run "lingo extract && lingo localize".`);
21
+ return {};
22
+ }
23
+ return getActiveEntries(readLocaleFile(fs.readFileSync(filePath, "utf8")).entries).filter((entry) => {
24
+ if (!entry.metadata.src) return true;
25
+ const srcRoute = entry.metadata.src.replace(/\.\w+:\d+$/, "");
26
+ if (srcRoute === route) return true;
27
+ return !srcRoute.startsWith("pages/") && !srcRoute.startsWith("src/pages/");
28
+ }).reduce((acc, entry) => {
29
+ acc[entry.key] = entry.value;
30
+ return acc;
31
+ }, {});
32
+ }
33
+ //#endregion
34
+ //#region src/pages/with-lingo-props.ts
35
+ function withLingoProps(config) {
36
+ return async (ctx) => {
37
+ const messages = loadMessages(ctx.locale ?? ctx.defaultLocale ?? "en", config.route);
38
+ if (!config.handler) return { props: { __lingoMessages: messages } };
39
+ const result = await config.handler(ctx);
40
+ if ("redirect" in result) return result;
41
+ if ("notFound" in result) return result;
42
+ return {
43
+ ...result,
44
+ props: {
45
+ ...result.props,
46
+ __lingoMessages: messages
47
+ }
48
+ };
49
+ };
50
+ }
51
+ //#endregion
52
+ //#region src/pages/with-lingo-paths.ts
53
+ function withLingoPaths(handler, options) {
54
+ return async (ctx) => {
55
+ const paths = await handler();
56
+ return {
57
+ paths: (ctx.locales ?? ["en"]).flatMap((locale) => paths.map((entry) => ({
58
+ ...entry,
59
+ locale
60
+ }))),
61
+ fallback: options?.fallback ?? "blocking"
62
+ };
63
+ };
64
+ }
65
+ //#endregion
66
+ export { withLingoProps as n, withLingoPaths as t };
67
+
68
+ //# sourceMappingURL=with-lingo-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-lingo-paths.js","names":[],"sources":["../src/pages/load-messages.ts","../src/pages/with-lingo-props.ts","../src/pages/with-lingo-paths.ts"],"sourcesContent":["/**\n * Loads translated messages from JSONC locale files.\n * Internal module - used by withLingoProps, not exported publicly.\n *\n * Reads JSONC directly (no build step). Filters orphaned entries.\n * Splits messages by route using @src metadata from extraction.\n */\n\nimport { readLocaleFile, getActiveEntries } from \"@lingo.dev/spec\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nconst MESSAGES_DIR = \"locales\";\n\n/**\n * Loads messages for a specific locale and route.\n * Returns page-specific messages + shared messages (components, lib, etc.).\n */\nexport function loadMessages(locale: string, route: string): Record<string, string> {\n const filePath = path.resolve(process.cwd(), MESSAGES_DIR, `${locale}.jsonc`);\n\n if (!fs.existsSync(filePath)) {\n if (process.env.NODE_ENV === \"development\") {\n console.warn(`[@lingo.dev/react-next] No locale file for \"${locale}\". Run \"lingo extract && lingo localize\".`);\n }\n return {};\n }\n\n const content = fs.readFileSync(filePath, \"utf8\");\n const file = readLocaleFile(content);\n const active = getActiveEntries(file.entries);\n\n return active\n .filter((entry) => {\n if (!entry.metadata.src) return true; // no @src = shared\n const srcRoute = entry.metadata.src.replace(/\\.\\w+:\\d+$/, \"\"); // strip \".tsx:42\"\n if (srcRoute === route) return true; // exact page match\n // Non-page files (components, lib, hooks, etc.) are shared across all pages\n return !srcRoute.startsWith(\"pages/\") && !srcRoute.startsWith(\"src/pages/\");\n })\n .reduce(\n (acc, entry) => {\n acc[entry.key] = entry.value;\n return acc;\n },\n {} as Record<string, string>,\n );\n}\n","/**\n * Wraps getStaticProps/getServerSideProps to load route-specific messages.\n * Every page must use this - route is required for per-route splitting.\n */\n\nimport type { GetStaticPropsContext, GetStaticPropsResult } from \"next\";\nimport { loadMessages } from \"./load-messages\";\n\ntype WithLingoPropsConfig<P extends Record<string, any>> = {\n /** Page route for per-route message splitting (e.g., \"pages/about\"). */\n route: string;\n /** Optional handler for additional page data (custom props, revalidate, redirect, notFound). */\n handler?: (ctx: GetStaticPropsContext) => Promise<GetStaticPropsResult<P>>;\n};\n\ntype LingoPageProps = { __lingoMessages: Record<string, string> };\n\nexport function withLingoProps<P extends Record<string, any> = {}>(config: WithLingoPropsConfig<P>) {\n return async (ctx: GetStaticPropsContext) => {\n const locale = ctx.locale ?? ctx.defaultLocale ?? \"en\";\n const messages = loadMessages(locale, config.route);\n\n if (!config.handler) {\n return { props: { __lingoMessages: messages } as P & LingoPageProps };\n }\n\n const result = await config.handler(ctx);\n\n if (\"redirect\" in result) return result;\n if (\"notFound\" in result) return result;\n\n return {\n ...result,\n props: { ...result.props, __lingoMessages: messages } as P & LingoPageProps,\n };\n };\n}\n","/**\n * Wraps getStaticPaths to auto-expand paths across all configured locales.\n * Defaults to fallback: \"blocking\" for large locale x path combinations.\n */\n\nimport type { GetStaticPathsContext, GetStaticPathsResult } from \"next\";\nimport type { ParsedUrlQuery } from \"node:querystring\";\n\ntype PathEntry<P extends ParsedUrlQuery> = { params: P };\n\nexport function withLingoPaths<P extends ParsedUrlQuery>(\n handler: () => Promise<PathEntry<P>[]>,\n options?: { fallback?: false | \"blocking\" | true },\n) {\n return async (ctx: GetStaticPathsContext): Promise<GetStaticPathsResult<P>> => {\n const paths = await handler();\n const locales = ctx.locales ?? [\"en\"];\n return {\n paths: locales.flatMap((locale) => paths.map((entry) => ({ ...entry, locale }))),\n fallback: options?.fallback ?? \"blocking\",\n };\n };\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,eAAe;;;;;AAMrB,SAAgB,aAAa,QAAgB,OAAuC;CAClF,MAAM,WAAW,KAAK,QAAQ,QAAQ,KAAK,EAAE,cAAc,GAAG,OAAO,QAAQ;AAE7E,KAAI,CAAC,GAAG,WAAW,SAAS,EAAE;AAC5B,MAAI,QAAQ,IAAI,aAAa,cAC3B,SAAQ,KAAK,+CAA+C,OAAO,2CAA2C;AAEhH,SAAO,EAAE;;AAOX,QAFe,iBADF,eADG,GAAG,aAAa,UAAU,OAAO,CACb,CACC,QAAQ,CAG1C,QAAQ,UAAU;AACjB,MAAI,CAAC,MAAM,SAAS,IAAK,QAAO;EAChC,MAAM,WAAW,MAAM,SAAS,IAAI,QAAQ,cAAc,GAAG;AAC7D,MAAI,aAAa,MAAO,QAAO;AAE/B,SAAO,CAAC,SAAS,WAAW,SAAS,IAAI,CAAC,SAAS,WAAW,aAAa;GAC3E,CACD,QACE,KAAK,UAAU;AACd,MAAI,MAAM,OAAO,MAAM;AACvB,SAAO;IAET,EAAE,CACH;;;;AC7BL,SAAgB,eAAmD,QAAiC;AAClG,QAAO,OAAO,QAA+B;EAE3C,MAAM,WAAW,aADF,IAAI,UAAU,IAAI,iBAAiB,MACZ,OAAO,MAAM;AAEnD,MAAI,CAAC,OAAO,QACV,QAAO,EAAE,OAAO,EAAE,iBAAiB,UAAU,EAAwB;EAGvE,MAAM,SAAS,MAAM,OAAO,QAAQ,IAAI;AAExC,MAAI,cAAc,OAAQ,QAAO;AACjC,MAAI,cAAc,OAAQ,QAAO;AAEjC,SAAO;GACL,GAAG;GACH,OAAO;IAAE,GAAG,OAAO;IAAO,iBAAiB;IAAU;GACtD;;;;;ACxBL,SAAgB,eACd,SACA,SACA;AACA,QAAO,OAAO,QAAiE;EAC7E,MAAM,QAAQ,MAAM,SAAS;AAE7B,SAAO;GACL,QAFc,IAAI,WAAW,CAAC,KAAK,EAEpB,SAAS,WAAW,MAAM,KAAK,WAAW;IAAE,GAAG;IAAO;IAAQ,EAAE,CAAC;GAChF,UAAU,SAAS,YAAY;GAChC"}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@lingo.dev/react-next",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ "./pages": {
7
+ "import": {
8
+ "types": "./dist/pages/index.d.ts",
9
+ "default": "./dist/pages/index.js"
10
+ },
11
+ "require": {
12
+ "types": "./dist/pages/index.d.cts",
13
+ "default": "./dist/pages/index.cjs"
14
+ }
15
+ },
16
+ "./pages/client": {
17
+ "import": {
18
+ "types": "./dist/pages/client.d.ts",
19
+ "default": "./dist/pages/client.js"
20
+ },
21
+ "require": {
22
+ "types": "./dist/pages/client.d.cts",
23
+ "default": "./dist/pages/client.cjs"
24
+ }
25
+ },
26
+ "./pages/server": {
27
+ "import": {
28
+ "types": "./dist/pages/server.d.ts",
29
+ "default": "./dist/pages/server.js"
30
+ },
31
+ "require": {
32
+ "types": "./dist/pages/server.d.cts",
33
+ "default": "./dist/pages/server.cjs"
34
+ }
35
+ }
36
+ },
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "sideEffects": false,
41
+ "peerDependencies": {
42
+ "next": ">=13",
43
+ "react": "^18.0.0 || ^19.0.0",
44
+ "@lingo.dev/react": "1.0.0"
45
+ },
46
+ "dependencies": {
47
+ "@lingo.dev/spec": "1.0.0"
48
+ },
49
+ "devDependencies": {
50
+ "@testing-library/jest-dom": "^6.9.1",
51
+ "@testing-library/react": "^16.3.2",
52
+ "@types/node": "^25.5.0",
53
+ "@types/react": "^19.0.0",
54
+ "@types/react-dom": "^19.0.0",
55
+ "jsdom": "^27.4.0",
56
+ "next": "^16.0.0",
57
+ "react": "^19.0.0",
58
+ "react-dom": "^19.0.0",
59
+ "tsdown": "^0.12.5",
60
+ "typescript": "^5.8.2",
61
+ "vitest": "^4.0.18",
62
+ "@lingo.dev/react": "1.0.0"
63
+ },
64
+ "scripts": {
65
+ "build": "tsdown",
66
+ "typecheck": "tsc --noEmit",
67
+ "test": "vitest run"
68
+ }
69
+ }