Files
webstudio/packages/cli/src/framework.ts
T
Bogdan Chadkin c14238ed5e experimental: override some tags with components (#5210)
Ref https://github.com/webstudio-is/webstudio/issues/3632

Remix client routing should still work even if we go full html. Here
added tag overrides to component generator so sdk could pass component
replacements for some tags like

- body -> Body
- a -> Link
- form -> RemixForm

See example here
https://github.com/webstudio-is/webstudio/pull/5210/files#diff-f2df0aea6543a33e57d770ff1791da886ab3dfd6dec37da4a41a611b9b13a19aR6
2025-05-19 13:20:15 +03:00

20 lines
676 B
TypeScript

import type { WsComponentMeta } from "@webstudio-is/sdk";
type FrameworkTemplateEntry = {
file: string;
template: string;
};
export type Framework = {
// instance.component: WsComponentMeta
metas: Record<string, WsComponentMeta>;
// instance.component: "importSource:importSpecifier"
components: Record<string, string>;
// instance.tag: "importSource:importSpecifier"
tags: Record<string, string>;
html: (params: { pagePath: string }) => FrameworkTemplateEntry[];
xml: (params: { pagePath: string }) => FrameworkTemplateEntry[];
redirect: (params: { pagePath: string }) => FrameworkTemplateEntry[];
defaultSitemap: () => FrameworkTemplateEntry[];
};