diff --git a/biome.json b/biome.json index 2521f53..7da6114 100644 --- a/biome.json +++ b/biome.json @@ -1,7 +1,7 @@ { "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", "files": { - "ignore": ["dist/", ".vercel/", "package.json"] + "ignore": ["dist/", ".vercel/", "package.json", "test/vike-node/build"] }, "formatter": { "indentWidth": 2, diff --git a/packages/vike-node/src/runtime/adapters/connectToWeb.ts b/packages/vike-node/src/runtime/adapters/connectToWeb.ts index 55bb050..d0fb25c 100644 --- a/packages/vike-node/src/runtime/adapters/connectToWeb.ts +++ b/packages/vike-node/src/runtime/adapters/connectToWeb.ts @@ -81,14 +81,14 @@ function connectToWebFallback(handler: ConnectMiddlewareBoolean): WebHandler { } try { - const handled = await handler(req, res, next); + const handled = await handler(req, res, next) if (!handled) { - res.destroy(); - resolve(undefined); + res.destroy() + resolve(undefined) } } catch (e) { - next(e); + next(e) } }) } diff --git a/packages/vike-node/src/vike.handler.ts b/packages/vike-node/src/vike.handler.ts index 957a9e6..0fed8f5 100644 --- a/packages/vike-node/src/vike.handler.ts +++ b/packages/vike-node/src/vike.handler.ts @@ -1,3 +1,3 @@ import { renderPageUniversal } from './runtime/vike-handler.js' -export default renderPageUniversal; +export default renderPageUniversal diff --git a/packages/vike-node/tsup.config.js b/packages/vike-node/tsup.config.js index 3fc0c22..ace9e21 100644 --- a/packages/vike-node/tsup.config.js +++ b/packages/vike-node/tsup.config.js @@ -1,38 +1,40 @@ -import { defineConfig } from "tsup"; -import universalMiddleware from "universal-middleware/esbuild"; +import { defineConfig } from 'tsup' +import universalMiddleware from 'universal-middleware/esbuild' export default defineConfig([ { entry: { - "handler": "./src/vike.handler.ts", + handler: './src/vike.handler.ts' }, - format: ["esm"], - platform: "neutral", - target: "es2022", - esbuildPlugins: [universalMiddleware({ - serversExportNames: './[dir]/[server]', - entryExportNames: './[dir]/[name]', - })], + format: ['esm'], + platform: 'neutral', + target: 'es2022', + esbuildPlugins: [ + universalMiddleware({ + serversExportNames: './[dir]/[server]', + entryExportNames: './[dir]/[name]' + }) + ], esbuildOptions(opts) { - opts.outbase = "src"; + opts.outbase = 'src' }, - external: ["stream", "http", "node:stream", "node:http", "path", "url", "node:zlib"], + external: ['stream', 'http', 'node:stream', 'node:http', 'path', 'url', 'node:zlib'], dts: true, outDir: 'dist', bundle: true }, { entry: { - "plugin/index": "./src/plugin/index.ts", - "index": "./src/index.ts", + 'plugin/index': './src/plugin/index.ts', + index: './src/index.ts' }, - format: ["esm"], - platform: "node", - target: "es2022", + format: ['esm'], + platform: 'node', + target: 'es2022', esbuildOptions(opts) { - opts.outbase = "src"; + opts.outbase = 'src' }, dts: true, outDir: 'dist' - }, -]); + } +]) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 28a31c4..e0e46c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -169,9 +169,6 @@ importers: '@brillout/picocolors': specifier: ^1.0.14 version: 1.0.15 - '@major-tanya/itty-compression': - specifier: ^0.2.2 - version: 0.2.2 '@nitedani/shrink-ray-current': specifier: ^4.3.0 version: 4.3.0 @@ -219,6 +216,9 @@ importers: '@brillout/release-me': specifier: ^0.4.0 version: 0.4.0 + '@major-tanya/itty-compression': + specifier: ^0.2.2 + version: 0.2.2 '@types/node': specifier: ^20.14.15 version: 20.14.15 diff --git a/test/vike-node/server/index-elysia.ts b/test/vike-node/server/index-elysia.ts index 716f998..fa9adcc 100644 --- a/test/vike-node/server/index-elysia.ts +++ b/test/vike-node/server/index-elysia.ts @@ -26,6 +26,6 @@ async function startServer() { ctx.set.headers['x-test'] = 'test' }) - app.get("/*", vike()) + app.get('/*', vike()) app.listen(+port, () => console.log(`Server running at http://localhost:${port}`)) } diff --git a/test/vike-node/server/index-fastify.ts b/test/vike-node/server/index-fastify.ts index d06f30f..dc9f862 100644 --- a/test/vike-node/server/index-fastify.ts +++ b/test/vike-node/server/index-fastify.ts @@ -27,7 +27,7 @@ async function startServer() { done() }) - app.all("/*", vike()) + app.all('/*', vike()) const port = process.env.PORT || 3000 app.listen({ port: +port }) console.log(`Server running at http://localhost:${port}`)