Keep fetch calls in the client
Keep every call a web app makes to its server in client/, where one module owns each endpoint.
Name fetch as the app's bridge.
import { defineConfig } from '@kurvball/ashlar';
export default defineConfig({ include: ['apps'], apps: [{ root: 'apps/web', stack: 'web', bridge: { global: 'fetch' } }],});A feature that calls fetch itself now breaks client-only.
export const loadCart = () => fetch('/api/cart');$ pnpm exec ashlar checkAshlar checked 3 files in 0.2 s: 1 count rose.
client-only in apps/web/client/features/cart/load.ts: 1, up from 0 apps/web/client/features/cart/load.ts:1:31 Only `client/` talks to the services.The same call in apps/web/client/client/cart.ts passes.
See Rules for where client-only applies.