/** * Styles CSS Handler * * Serves Tailwind CSS compiled from user's stylesheet + all project source files. * Extracts candidates from ALL source files to ensure HMR includes new classes. */ import { BaseHandler } from "../response/base.js"; import type { HandlerContext, HandlerMetadata, HandlerResult } from "../types.js"; /** * Render a stylesheet that both explains the failure in the source and shows * it in the page. Every error path serves this: a stylesheet that failed to * build must never be mistaken for a project that simply has no styles. * * Exported for direct testing. The escaping contract cannot be fully driven * through the handler: a `"` inside `@plugin "..."` closes the CSS string * before it ever reaches a diagnostic, so the string-literal escape path has * no end-to-end route and must be exercised here. */ export declare function renderCSSDiagnostic(heading: string, detail: { title: string; message: string; suggestion: string; }): string; export declare class StylesCSSHandler extends BaseHandler { metadata: HandlerMetadata; /** * Serve a generated stylesheet with a validator. * * The route is `Cache-Control: no-cache`, so the browser revalidates before * every use. Without an ETag that revalidation is a full download; with one it * is a 304. This is the only place a CSS body becomes a response, so the * validator is attached here rather than at each call site. */ private respondCSS; handle(req: Request, ctx: HandlerContext): Promise; /** * Resolve the project stylesheet the same way the production pipeline does. * * Production calls `findStylesheetFromFiles` over the loaded source files, * which accepts `globals.css`, `global.css`, `styles/globals.css` and * `app/globals.css`. This route used to read a single hardcoded * `/globals.css` through the filesystem adapter, so a project * whose stylesheet sits anywhere else silently fell back to the provider * default and lost its `@theme` tokens -- every `bg-` utility the * theme defines then fails to generate, and the preview renders unstyled * while production is fine. * * Resolving from the same file list also removes the dependency on a * path-shaped filesystem read, which is not how sources arrive when they are * served from the control plane rather than local disk. */ private loadStylesheet; private getSourceFiles; private generateStylesheet; private getContentContext; private getVeryfrontApiClient; private createPreparedCSSContext; private resolveStyleArtifactSelector; private tryResolveRemotePreparedCSS; private getPreparedCSSByHash; private registerPreparedCSSArtifact; private resolveRemoteStyleArtifactSelector; private shouldEnsureRemoteStyleArtifactBuild; private ensureRemotePreparedCSSBuild; } //# sourceMappingURL=styles-css.handler.d.ts.map