docs: correct the dead-output component count from 11 to 9
Counted from source: the 22 remaining outputs sit in 9 components, not 11. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -90,7 +90,7 @@ import {
|
||||
} from "@wrnexus/i18n";
|
||||
import { runMiddleware } from "./pipeline.ts";
|
||||
import { handleRpcRequest, isRpcPath } from "./rpc-dispatch.ts";
|
||||
import type { ServiceImplementation } from "@wrnexus/rpc";
|
||||
import type { ServiceImplementation, StreamImplementation } from "@wrnexus/rpc";
|
||||
import type { HmrHub } from "./hmr.ts";
|
||||
import type {
|
||||
DevToolbarConfig,
|
||||
@@ -888,16 +888,24 @@ export function createHandlers(deps: RuntimeDeps): Handlers {
|
||||
// co-located helper with no default export) must not permanently break
|
||||
// every route in the app. Only a SUCCESSFUL load is cached; a failed
|
||||
// attempt logs loudly and is retried on the next RPC request.
|
||||
let servicesPromise: Promise<Map<string, ServiceImplementation>> | undefined;
|
||||
const loadServices = (): Promise<Map<string, ServiceImplementation>> => {
|
||||
let servicesPromise:
|
||||
Promise<Map<string, ServiceImplementation | StreamImplementation>> | undefined;
|
||||
const loadServices = (): Promise<Map<string, ServiceImplementation | StreamImplementation>> => {
|
||||
if (!servicesPromise) {
|
||||
servicesPromise = (async () => {
|
||||
const services = new Map<string, ServiceImplementation>();
|
||||
const services = new Map<string, ServiceImplementation | StreamImplementation>();
|
||||
for (const entry of router.services) {
|
||||
const imported = await loadModule(entry.file);
|
||||
const implementation = imported.default as ServiceImplementation | undefined;
|
||||
if (!implementation || typeof implementation.invoke !== "function") {
|
||||
throw new Error(`RPC service ${entry.file} must default-export implement(...)`);
|
||||
const implementation = imported.default as
|
||||
(ServiceImplementation | StreamImplementation) | undefined;
|
||||
if (
|
||||
!implementation ||
|
||||
(typeof (implementation as ServiceImplementation).invoke !== "function" &&
|
||||
typeof (implementation as StreamImplementation).stream !== "function")
|
||||
) {
|
||||
throw new Error(
|
||||
`RPC service ${entry.file} must default-export implement(...) or implementStream(...)`,
|
||||
);
|
||||
}
|
||||
if (implementation.contract.name !== entry.name) {
|
||||
throw new Error(
|
||||
@@ -988,7 +996,7 @@ export function createHandlers(deps: RuntimeDeps): Handlers {
|
||||
withSecurityHeaders(req, res, mode, runtimeSecurity, nonce);
|
||||
|
||||
if (isRpcPath(url.pathname)) {
|
||||
let services: Map<string, ServiceImplementation>;
|
||||
let services: Map<string, ServiceImplementation | StreamImplementation>;
|
||||
try {
|
||||
services = await loadServices();
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user