feat(rpc): add the caller-side example and close remaining coverage gaps
Adds examples/auth-showcase/app/services/greeter-client.ts so the showcase demonstrates both halves - the review noted the example was callee-only, so a developer had no working reference for making a call. Raises integration coverage to the planned 3 tests and adds the missing rpc-endpoint cases. Also wires the prod build path for services. 304 tests pass across rpc/router/dev-server/cli; typecheck, lint, format and check:public-api all clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,8 @@ export interface ProdManifest {
|
||||
components: { name: string; mod: RouteModule }[];
|
||||
/** Named page layouts (from app/layouts/*.wrn). */
|
||||
layouts: { name: string; mod: RouteModule }[];
|
||||
/** RPC service implementations (from app/services/*.ts). */
|
||||
services?: { name: string; mod: RouteModule }[];
|
||||
}
|
||||
|
||||
export interface ProductionPluginAsset {
|
||||
@@ -277,6 +279,8 @@ function buildProdRouter(manifest: ProdManifest): {
|
||||
for (const c of manifest.components) modules.set(c.name, c.mod);
|
||||
// Layouts share the module map under a `layout:` prefix (no name collisions).
|
||||
for (const l of manifest.layouts) modules.set(`layout:${l.name}`, l.mod);
|
||||
for (const service of manifest.services ?? [])
|
||||
modules.set(`service:${service.name}`, service.mod);
|
||||
|
||||
const router: Router = {
|
||||
pages,
|
||||
@@ -288,7 +292,10 @@ function buildProdRouter(manifest: ProdManifest): {
|
||||
stores: [],
|
||||
schemas: [], // descriptors are pre-baked into schemasJs; not needed at runtime
|
||||
authz: [], // authz declarations are not needed at runtime in production
|
||||
services: [], // RPC service modules are not yet emitted in production manifests
|
||||
services: (manifest.services ?? []).map((service) => ({
|
||||
name: service.name,
|
||||
file: `service:${service.name}`,
|
||||
})),
|
||||
matchPage: optimizedMatcher(pages),
|
||||
matchApi: optimizedMatcher(api),
|
||||
matchRealtime: optimizedMatcher(realtime),
|
||||
|
||||
Reference in New Issue
Block a user