From 738fb958c3befa2a473198410021067a38758b8b Mon Sep 17 00:00:00 2001 From: matthewp Date: Fri, 22 Apr 2022 14:04:54 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/build/vite-plugin-ssr.ts | 12 +++++++----- .../netlify/src/netlify-edge-functions.ts | 2 +- .../netlify/test/edge-functions/root-dynamic.test.ts | 4 +++- packages/integrations/netlify/tsconfig.json | 5 +---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/astro/src/core/build/vite-plugin-ssr.ts b/packages/astro/src/core/build/vite-plugin-ssr.ts index 656d01d81..0bf1682f4 100644 --- a/packages/astro/src/core/build/vite-plugin-ssr.ts +++ b/packages/astro/src/core/build/vite-plugin-ssr.ts @@ -74,12 +74,10 @@ if(_start in adapter) { const manifest = buildManifest(buildOpts, internals, staticFiles); - - for (const [_chunkName, chunk] of Object.entries(bundle)) { if (chunk.type === 'asset') { continue; - }; + } if (chunk.modules[resolvedVirtualModuleId]) { const code = chunk.code; chunk.code = code.replace(replaceExp, () => { @@ -91,7 +89,11 @@ if(_start in adapter) { }; } -function buildManifest(opts: StaticBuildOptions, internals: BuildInternals, staticFiles: string[]): SerializedSSRManifest { +function buildManifest( + opts: StaticBuildOptions, + internals: BuildInternals, + staticFiles: string[] +): SerializedSSRManifest { const { astroConfig } = opts; const routes: SerializedRouteInfo[] = []; @@ -122,7 +124,7 @@ function buildManifest(opts: StaticBuildOptions, internals: BuildInternals, stat pageMap: null as any, renderers: [], entryModules, - assets: staticFiles.map(s => '/' + s) + assets: staticFiles.map((s) => '/' + s), }; return ssrManifest; diff --git a/packages/integrations/netlify/src/netlify-edge-functions.ts b/packages/integrations/netlify/src/netlify-edge-functions.ts index 040228241..35f9714a4 100644 --- a/packages/integrations/netlify/src/netlify-edge-functions.ts +++ b/packages/integrations/netlify/src/netlify-edge-functions.ts @@ -10,7 +10,7 @@ export function createExports(manifest: SSRManifest) { // If this matches a static asset, just return and Netlify will forward it // to its static asset handler. - if(manifest.assets.has(url.pathname)) { + if (manifest.assets.has(url.pathname)) { return; } if (app.match(request)) { diff --git a/packages/integrations/netlify/test/edge-functions/root-dynamic.test.ts b/packages/integrations/netlify/test/edge-functions/root-dynamic.test.ts index c6504e188..34276362e 100644 --- a/packages/integrations/netlify/test/edge-functions/root-dynamic.test.ts +++ b/packages/integrations/netlify/test/edge-functions/root-dynamic.test.ts @@ -8,7 +8,9 @@ Deno.test({ name: 'Assets are preferred over HTML routes', async fn() { let close = await runBuild('./fixtures/root-dynamic/'); - const { default: handler } = await import('./fixtures/root-dynamic/dist/edge-functions/entry.js'); + const { default: handler } = await import( + './fixtures/root-dynamic/dist/edge-functions/entry.js' + ); const response = await handler(new Request('http://example.com/styles.css')); assertEquals(response, undefined, 'No response because this is an asset'); await close(); diff --git a/packages/integrations/netlify/tsconfig.json b/packages/integrations/netlify/tsconfig.json index b057b6880..372a414e6 100644 --- a/packages/integrations/netlify/tsconfig.json +++ b/packages/integrations/netlify/tsconfig.json @@ -6,9 +6,6 @@ "module": "ES2020", "outDir": "./dist", "target": "ES2020", - "typeRoots": [ - "node_modules/@types", - "node_modules/@netlify" - ] + "typeRoots": ["node_modules/@types", "node_modules/@netlify"] } }