Problem
packages/adapter-vite/src/cli/start.ts:93 uses Deno.serve() directly:
Deno.serve({ port, hostname }, async (request) => { ... });
The project's stated constraint is "跨运行时(支持Deno/Node/Bun/边缘运行时)" and published packages are "pure ESM and runtime-agnostic." However, the start CLI is Deno-only — Node/Bun users cannot run deno task start or npx @openelement/adapter-vite/cli/start.
Evidence
packages/adapter-vite/src/cli/start.ts:93 — Deno.serve hardcoded
packages/adapter-vite/src/cli/start.ts:131 — import.meta.main (Deno-only)
CONTRIBUTING.md:29 — "consumers can run them under Deno, Node, Bun, or edge runtimes"
- The generated
dist/server/index.js uses createOpenElementNitroHandler which is runtime-agnostic, but the CLI wrapper is not.
Fix options
Option A (preferred): Use Node's node:http + Web-standard Request/Response conversion (works in Node 18+, Deno, Bun):
import { createServer } from 'node:http';
// Convert IncomingMessage → Request, handle, write Response back
Option B: Document start as Deno-only and provide a separate start:node script.
Option C: Delegate to Nitro's own output runner (node .output/server/index.mjs).
Acceptance
Problem
packages/adapter-vite/src/cli/start.ts:93usesDeno.serve()directly:The project's stated constraint is "跨运行时(支持Deno/Node/Bun/边缘运行时)" and published packages are "pure ESM and runtime-agnostic." However, the
startCLI is Deno-only — Node/Bun users cannot rundeno task startornpx @openelement/adapter-vite/cli/start.Evidence
packages/adapter-vite/src/cli/start.ts:93—Deno.servehardcodedpackages/adapter-vite/src/cli/start.ts:131—import.meta.main(Deno-only)CONTRIBUTING.md:29— "consumers can run them under Deno, Node, Bun, or edge runtimes"dist/server/index.jsusescreateOpenElementNitroHandlerwhich is runtime-agnostic, but the CLI wrapper is not.Fix options
Option A (preferred): Use Node's
node:http+ Web-standardRequest/Responseconversion (works in Node 18+, Deno, Bun):Option B: Document
startas Deno-only and provide a separatestart:nodescript.Option C: Delegate to Nitro's own output runner (
node .output/server/index.mjs).Acceptance
startCLI works in at least Deno + Node 18+