@vitnode/core 2.0.0-canary.2 → 2.0.0-canary.3
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/src/config.js +1 -1
- package/dist/src/tanstack/start/locale-middleware.d.ts +0 -4
- package/dist/src/tanstack/start/locale-middleware.d.ts.map +1 -1
- package/dist/src/tanstack/start/locale-middleware.js +1 -1
- package/dist/src/tanstack/start/locale-request.d.ts +6 -0
- package/dist/src/tanstack/start/locale-request.d.ts.map +1 -0
- package/dist/src/tanstack/start/locale-request.js +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/src/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CONFIG_PLUGIN={pluginId:"@vitnode/core",version:"2.0.0-canary.
|
|
1
|
+
export const CONFIG_PLUGIN={pluginId:"@vitnode/core",version:"2.0.0-canary.3"};
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { RequestServerOptions } from "@tanstack/react-start";
|
|
2
1
|
import type { LocaleRouting } from "../../lib/i18n/locale-routing";
|
|
3
|
-
type LocaleRequestContext = Pick<RequestServerOptions<unknown, unknown>, "handlerType" | "next" | "request">;
|
|
4
|
-
export declare const runLocaleRequest: ({ handlerType, next, request }: LocaleRequestContext, localeRouting: LocaleRouting) => Promise<Response | import("@tanstack/react-start").RequestServerResult<unknown, unknown, undefined>>;
|
|
5
2
|
export declare const createLocaleRequestMiddleware: (localeRouting: LocaleRouting) => import("@tanstack/react-start").RequestMiddlewareAfterServer<{}, undefined, undefined>;
|
|
6
|
-
export {};
|
|
7
3
|
//# sourceMappingURL=locale-middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale-middleware.d.ts","sourceRoot":"","sources":["../../../../src/tanstack/start/locale-middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"locale-middleware.d.ts","sourceRoot":"","sources":["../../../../src/tanstack/start/locale-middleware.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI/D,eAAO,MAAM,6BAA6B,GAAI,eAAe,aAAa,2FAGvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createMiddleware}from"@tanstack/react-start";import{
|
|
1
|
+
import{createMiddleware}from"@tanstack/react-start";import{runLocaleRequest}from"./locale-request.js";export const createLocaleRequestMiddleware=localeRouting=>createMiddleware().server(async ctx=>await runLocaleRequest(ctx,localeRouting));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RequestServerOptions } from "@tanstack/react-start";
|
|
2
|
+
import type { LocaleRouting } from "../../lib/i18n/locale-routing";
|
|
3
|
+
type LocaleRequestContext = Pick<RequestServerOptions<unknown, unknown>, "handlerType" | "next" | "request">;
|
|
4
|
+
export declare const runLocaleRequest: ({ handlerType, next, request }: LocaleRequestContext, localeRouting: LocaleRouting) => Promise<Response | import("@tanstack/react-start").RequestServerResult<unknown, unknown, undefined>>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=locale-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-request.d.ts","sourceRoot":"","sources":["../../../../src/tanstack/start/locale-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAQ/D,KAAK,oBAAoB,GAAG,IAAI,CAC9B,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACtC,aAAa,GAAG,MAAM,GAAG,SAAS,CACnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,gCAAgC,oBAAoB,EACpD,eAAe,aAAa,yGAgB7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{handleLocaleRequest}from"../i18n/request.js";import{applyDocumentCacheControl,applyRedirectCacheControl}from"./document-headers.js";export const runLocaleRequest=async({handlerType,next,request},localeRouting)=>{if(handlerType!=="router")return await next();const{redirect,setCookie}=handleLocaleRequest(request,localeRouting);if(redirect){applyRedirectCacheControl(redirect);return redirect}const result=await next();if(setCookie)result.response.headers.append("set-cookie",setCookie);applyDocumentCacheControl(result.response);return result};
|