(root: string)
| 105 | } |
| 106 | |
| 107 | function 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 | |
| 127 | function writeRoutesDefaultModule(root: string): string { |
| 128 | mkdirSync(root, { recursive: true }); |
no outgoing calls
no test coverage detected