0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

[ci] format

This commit is contained in:
Arsh 2024-03-20 14:34:39 +00:00 committed by astrobot-houston
parent cfbaa8a767
commit 4adcda0e25
3 changed files with 10 additions and 6 deletions

View file

@ -17,7 +17,9 @@
"bugs": "https://github.com/withastro/astro/issues",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/vercel/",
"exports": {
".": { "types": "./types.d.ts" },
".": {
"types": "./types.d.ts"
},
"./serverless": "./dist/serverless/adapter.js",
"./serverless/entrypoint": "./dist/serverless/entrypoint.js",
"./static": "./dist/static/adapter.js",

View file

@ -1,13 +1,13 @@
import { existsSync } from 'node:fs';
import { builtinModules } from 'node:module';
import { fileURLToPath, pathToFileURL } from 'node:url';
import type { AstroIntegrationLogger } from 'astro';
import {
ASTRO_LOCALS_HEADER,
ASTRO_MIDDLEWARE_SECRET_HEADER,
ASTRO_PATH_HEADER,
NODE_PATH,
} from './adapter.js';
import type { AstroIntegrationLogger } from 'astro';
/**
* It generates the Vercel Edge Middleware file.
@ -77,7 +77,9 @@ function edgeMiddlewareTemplate(
let handlerTemplateImport = '';
let handlerTemplateCall = '{}';
if (existsSync(filePathEdgeMiddleware + '.js') || existsSync(filePathEdgeMiddleware + '.ts')) {
logger.warn('Usage of `vercel-edge-middleware.js` is deprecated. You can now use the `waitUntil(promise)` function directly as `ctx.locals.waitUntil(promise)`.')
logger.warn(
'Usage of `vercel-edge-middleware.js` is deprecated. You can now use the `waitUntil(promise)` function directly as `ctx.locals.waitUntil(promise)`.'
);
const stringified = JSON.stringify(filePathEdgeMiddleware.replace(/\\/g, '/'));
handlerTemplateImport = `import handler from ${stringified}`;
handlerTemplateCall = `await handler({ request, context })`;

View file

@ -1,5 +1,5 @@
export interface EdgeLocals {
vercel: {
edge: import("@vercel/edge").RequestContext;
}
vercel: {
edge: import('@vercel/edge').RequestContext;
};
}