MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / writeRoutesModule

Function writeRoutesModule

packages/node/src/__tests__/hotStateReload.test.ts:107–125  ·  view source on GitHub ↗
(root: string)

Source from the content-addressed store, hash-verified

105}
106
107function writeRoutesModule(root: string): string {
108 mkdirSync(root, { recursive: true });
109 const routesFile = join(root, "routes.mjs");
110 writeFileSync(
111 routesFile,
112 [
113 'import { routeLabel } from "./route-label.mjs";',
114 "export const routes = Object.freeze([",
115 " {",
116 ' id: "home",',
117 ' screen: () => ({ kind: "text", text: routeLabel(), props: {} }),',
118 " },",
119 "]);",
120 "",
121 ].join("\n"),
122 "utf8",
123 );
124 return routesFile;
125}
126
127function writeRoutesDefaultModule(root: string): string {
128 mkdirSync(root, { recursive: true });

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected