Parcourir la source

workflow: improve the benchmark scripts

Rizumu Ayaka il y a 1 an
Parent
commit
abd685d7f4
2 fichiers modifiés avec 13 ajouts et 1 suppressions
  1. 12 1
      benchmark/index.js
  2. 1 0
      benchmark/package.json

+ 12 - 1
benchmark/index.js

@@ -177,7 +177,7 @@ async function buildApp(isVapor) {
 
 function startServer() {
   const server = connect().use(sirv('./client/dist')).listen(port)
-  console.info(`\n\nServer started at`, colors.blue(`http://localhost:${port}`))
+  printPort(port)
   process.on('SIGTERM', () => server.close())
   return server
 }
@@ -338,3 +338,14 @@ function compute(array) {
 function round(n) {
   return +n.toFixed(2)
 }
+
+/** @param {number} port */
+function printPort(port) {
+  const vaporLink = !noVapor
+    ? `\nVapor: ${colors.blue(`http://localhost:${port}/vapor`)}`
+    : ''
+  const vdomLink = vdom
+    ? `\nvDom:  ${colors.blue(`http://localhost:${port}/vdom`)}`
+    : ''
+  console.info(`\n\nServer started at`, vaporLink, vdomLink)
+}

+ 1 - 0
benchmark/package.json

@@ -5,6 +5,7 @@
   "license": "MIT",
   "type": "module",
   "scripts": {
+    "dev": "pnpm start --noHeadless --skipBench --vdom",
     "start": "node index.js"
   },
   "dependencies": {