Skip to content

Mount routes and apiRoutes at config root#46

Merged
wolfy-j merged 6 commits intofeature/v4from
feature/mount-routes
Apr 20, 2026
Merged

Mount routes and apiRoutes at config root#46
wolfy-j merged 6 commits intofeature/v4from
feature/mount-routes

Conversation

@AndrewKirkovski
Copy link
Copy Markdown
Contributor

@AndrewKirkovski AndrewKirkovski commented Apr 20, 2026

Summary

Part of the 1.0.22 / 0.0.22 three-repo release (gen-2-chat → @wippy-fe npm → wippy-framework facade).

Mount routes registry

New Lua module src/views/page_registry.lua builds the pageId ↔ mountRoute map for pages that claim a top-level URL (e.g. /foo served by a registered page). Comes with full unit coverage in page_registry_test.lua.

New HTTP endpoint GET /pages/routes (src/views/api/list_routes.lua) exposes that map to the frontend so the Host can resolve mount routes at runtime. Wired into _index.yaml alongside the existing list_pages / public_url endpoints.

list_pages.lua tweaked to return the mount route alongside existing page metadata.

apiRoutes promoted to config root

Facade config now emits apiRoutes as a top-level field (was nested under hostConfig). Matches the Host's AppConfig layout where feature.apiRoutes is a first-class override, and lets the Host pick it up without reaching into a nested object.

  • src/facade/config_handler.lua: drop the host_config.apiRoutes assignment, surface as apiRoutes at the response root
  • src/facade/public/index.html: pass cfg.apiRoutes through to the child AppConfig

Vendored loading.js refreshed

Pulled fresh loading.js from web-host.wippy.ai/webcomponents-1.0.22 including the new source map — matches the source-maps-everywhere change from gen-2-chat 1.0.22.

Version bump (1.0.21 → 1.0.22)

  • src/facade/MakefileWEB_HOST_CDN default
  • src/facade/_index.yamlfe_facade_url requirement default
  • src/facade/README.md — documented default URL
  • src/facade/config_handler_test.lua — test fixture URL

Related releases

  • gen-2-chat 1.0.22 — tagged on webcomponents, published to web-host.wippy.ai/webcomponents-1.0.22 (source maps on every proxy/CDN bundle, subscription cleanup, console-noise fixes)
  • @wippy-fe/* 0.0.22 — 9 npm packages published (loading, log, pinia-persist, proxy, router, theme, types-global-proxy, webcomponent-core, webcomponent-vue)

Test plan

  • Facade boots with bumped fe_facade_url default and serves index.html against 1.0.22 CDN
  • GET /pages/routes returns { mountRoute: pageId } map for pages with top-level URLs
  • Child AppConfig receives apiRoutes at root when the facade config provides it
  • page_registry_test.lua passes

Add page_registry mount_route support with validation, /pages/routes
API endpoint, mountRoute in page list response.

Move apiRoutes from hostConfig to config root in facade
config_handler and index.html to match gen-2-chat schema change.
Refresh loading.js from gen-2-chat build output.
Add loading.js.map for debugging facade error overlays.
@AndrewKirkovski AndrewKirkovski requested a review from wolfy-j April 20, 2026 08:37
Tracks gen-2-chat 1.0.22 / @wippy-fe/* 0.0.22 release.
AndrewKirkovski and others added 3 commits April 20, 2026 13:19
- views/api/render.lua: rename emitted JSON field `customVariabled` ->
  `customVariables` (the snake_case YAML `custom_variables` was already
  correct; only the camelCase wire field had the extra `d`). Paired with
  gen-2-chat 1.0.23 rename.

- facade: default `fe_facade_url` bumped to webcomponents-1.0.23 across
  `_index.yaml`, `README.md`, `Makefile`, and `config_handler_test.lua`.
Use type cast consistent with configOverrides pattern instead of
ternary (which inferred as any and broke PageResponse type check).
- llm: cast json.decode(response.body or "") for nullable body handling
- llm: google stream:read(4096) to satisfy required buffer arg
- llm: cast google mapper_test map_tools results for index access
- embeddings: cast results for embedding_repo_test index access
- views: cast page.data_func and page.template_name at narrow-safe sites
@wolfy-j wolfy-j merged commit cce393e into feature/v4 Apr 20, 2026
18 checks passed
@wolfy-j wolfy-j deleted the feature/mount-routes branch April 20, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants