also looking at this
feat(reviews): the suggestions get an interface, priced as designed
#6
9 files
+741
-10
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -20,5 +20,8 @@ export type { RouteDefinition, RouteRegistry } from '@stacksjs/router' | ||
| 20 | 20 | export default { |
| 21 | 21 | api: 'api', |
| 22 | 22 | attachments: { path: 'attachments', prefix: '' }, |
| 23 | // Registers nothing; configures the renderer. See the file for why it must | |
| 24 | // load with the routes rather than in any one server's boot script. | |
| 25 | views: { path: 'views', prefix: '' }, | |
| 23 | 26 | git: { path: 'git', prefix: '' }, |
| 24 | 27 | } satisfies RouteRegistry |
| @@ -0,0 +1,25 @@ | ||
| 1 | import { route } from '@stacksjs/router' | |
| 2 | import ui from '../config/ui' | |
| 3 | ||
| 4 | /** | |
| 5 | * Not a route: where the file-based views find their components. | |
| 6 | * | |
| 7 | * Two servers render stx here and only one of them was told. The dev frontend | |
| 8 | * goes through bun-plugin-stx, which loads `config/ui.ts` itself and searches | |
| 9 | * `resources/components`. Everything that boots through `route.serve()` - the | |
| 10 | * API server behind `./buddy dev`, the e2e suite, a production boot - renders | |
| 11 | * through bun-router's file-based routing instead, which never reads that | |
| 12 | * config: it falls back to `<viewsDir>/components`, a directory this project | |
| 13 | * does not have, and every `<Component />` tag on those boots renders as an | |
| 14 | * "[Error loading component]" line in the page. `<CsrfField />` is one of | |
| 15 | * them, so any form served that way loses its token and submits into a 403. | |
| 16 | * | |
| 17 | * This file runs with the other route files, which both boot paths import | |
| 18 | * before serving, so the render config is set wherever rendering happens. | |
| 19 | * | |
| 20 | * `componentsDir` only, deliberately. `config/ui.ts` also names a layoutsDir | |
| 21 | * of `resources/layouts`, which does not exist - layouts live under | |
| 22 | * `resources/views/layouts`, exactly where bun-router's fallback looks, so | |
| 23 | * forwarding the config value would break every page while fixing nothing. | |
| 24 | */ | |
| 25 | route.bunRouter.views({ componentsDir: ui.componentsDir }) | |