Skip to content

Commit 6276ec1

Browse files
committed
feat(web-host): implement plugin-api/host-state-plugin#get-repl-var
1 parent f6e1a77 commit 6276ec1

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/** @module Interface repl:api/host-state-plugin **/
2+
export function getReplVar(key: string): string | undefined;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// world repl:api/plugin-api
2+
export type * as ReplApiHostStatePlugin from "./interfaces/repl-api-host-state-plugin.js"; // import repl:api/host-state-plugin
23
export type * as ReplApiHttpClient from "./interfaces/repl-api-http-client.js"; // import repl:api/http-client
34
export type * as ReplApiTransport from "./interfaces/repl-api-transport.js"; // import repl:api/transport
45
export * as plugin from "./interfaces/repl-api-plugin.js"; // export repl:api/plugin
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { getReplVars } from "./host-state";
2+
3+
export function getReplVar(key: string): string | undefined {
4+
return getReplVars().find((replVar) => replVar.key === key)?.value;
5+
}

packages/web-host/tsconfig.app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"noUncheckedSideEffectImports": true,
2525
"paths": {
2626
"repl:api/host-state": ["./src/wasm/host/host-state.ts"],
27-
"repl:api/http-client": ["./src/wasm/host/http-client.ts"]
27+
"repl:api/http-client": ["./src/wasm/host/http-client.ts"],
28+
"repl:api/host-state-plugin": ["./src/wasm/host/host-state-plugin.ts"]
2829
}
2930
},
3031
"include": ["src", "clis"]

packages/web-host/vite.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import path from "node:path";
12
import tailwindcss from "@tailwindcss/vite";
23
import react from "@vitejs/plugin-react";
3-
import path from "path";
44
import { defineConfig } from "vite";
55

66
// https://vite.dev/config/
@@ -16,6 +16,10 @@ export default defineConfig({
1616
__dirname,
1717
"./src/wasm/host/host-state.ts",
1818
),
19+
"repl:api/host-state-plugin": path.resolve(
20+
__dirname,
21+
"./src/wasm/host/host-state-plugin.ts",
22+
),
1923
},
2024
},
2125
base: "/webassembly-component-model-experiments/",

0 commit comments

Comments
 (0)