Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
magne4000 committed Oct 10, 2024
1 parent b7de3c5 commit 7505294
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 4 additions & 4 deletions packages/vike-node/src/runtime/adapters/connectToWeb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vike-node/src/vike.handler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { renderPageUniversal } from './runtime/vike-handler.js'

export default renderPageUniversal;
export default renderPageUniversal
42 changes: 22 additions & 20 deletions packages/vike-node/tsup.config.js
Original file line number Diff line number Diff line change
@@ -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'
},
]);
}
])
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/vike-node/server/index-elysia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`))
}
2 changes: 1 addition & 1 deletion test/vike-node/server/index-fastify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down

0 comments on commit 7505294

Please sign in to comment.