@@ -11,10 +11,27 @@ import { componentize } from "@bytecodealliance/componentize-js";
1111
1212import { rolldown } from "rolldown" ;
1313
14+ /** Path to fixture app directory */
1415const FIXTURE_APPS_DIR = fileURLToPath ( new URL ( "../fixtures/apps" , import . meta. url ) ) ;
1516
17+ /** Path to jco-std directory */
1618const JCO_STD_DIR = fileURLToPath ( new URL ( "../../" , import . meta. url ) ) ;
1719
20+ /** Resolver configuration that can be used with rolldown when building test components */
21+ const TEST_RESOLVER_CONFIG = {
22+ alias : {
23+ '@bytecodealliance/jco-std/wasi/0.2.3/http/adapters/hono/server' : join ( JCO_STD_DIR , "dist/0.2.3/http/adapters/hono/server.js" ) ,
24+ '@bytecodealliance/jco-std/wasi/0.2.3/http/adapters/hono/middleware/env' : join ( JCO_STD_DIR , "dist/0.2.3/http/adapters/hono/middleware/env.js" ) ,
25+ '@bytecodealliance/jco-std/wasi/0.2.3/http/adapters/hono/middleware/config' : join ( JCO_STD_DIR , "dist/0.2.3/http/adapters/hono/middleware/config.js" ) ,
26+ '@bytecodealliance/jco-std/wasi/0.2.6/http/adapters/hono/server' : join ( JCO_STD_DIR , "dist/0.2.6/http/adapters/hono/server.js" ) ,
27+ '@bytecodealliance/jco-std/wasi/0.2.6/http/adapters/hono/middleware/env' : join ( JCO_STD_DIR , "dist/0.2.6/http/adapters/hono/middleware/env.js" ) ,
28+ '@bytecodealliance/jco-std/wasi/0.2.6/http/adapters/hono/middleware/config' : join ( JCO_STD_DIR , "dist/0.2.6/http/adapters/hono/middleware/config.js" ) ,
29+ '@bytecodealliance/jco-std/wasi/0.2.x/http/adapters/hono/server' : join ( JCO_STD_DIR , "dist/0.2.6/http/adapters/hono/server.js" ) ,
30+ '@bytecodealliance/jco-std/wasi/0.2.x/http/adapters/hono/middleware/env' : join ( JCO_STD_DIR , "dist/0.2.6/http/adapters/hono/middleware/env.js" ) ,
31+ '@bytecodealliance/jco-std/wasi/0.2.x/http/adapters/hono/middleware/config' : join ( JCO_STD_DIR , "dist/0.2.6/http/adapters/hono/middleware/config.js" ) ,
32+ } ,
33+ }
34+
1835/** Get the binary path to wasmtime if it doesn't exist */
1936async function getWasmtimeBin ( env ?: Record < string , string > ) : Promise < string > {
2037 try {
@@ -95,12 +112,7 @@ suite("hono apps", async () => {
95112 external : [
96113 / ^ w a s i : .* / ,
97114 ] ,
98- resolve : {
99- alias : {
100- '@bytecodealliance/jco-std/wasi/0.2.3/http/adapters/hono' : join ( JCO_STD_DIR , "dist/0.2.3/http/adapters/hono.js" ) ,
101- '@bytecodealliance/jco-std/wasi/0.2.6/http/adapters/hono' : join ( JCO_STD_DIR , "dist/0.2.6/http/adapters/hono.js" ) ,
102- } ,
103- } ,
115+ resolve : TEST_RESOLVER_CONFIG ,
104116 } ) ;
105117 await bundle . write ( {
106118 file : jsOutputPath ,
0 commit comments