()
| 143 | * and validation. Doesn't start the HTTP server. |
| 144 | */ |
| 145 | const build = async () => { |
| 146 | log(`Compiling TypeScript`); |
| 147 | await buildTypeScript(buildDir, projectDir); |
| 148 | |
| 149 | log(`Building custom routes`); |
| 150 | const { files, httpRoutes, webSocketRoutes } = |
| 151 | await getSourceFiles(projectDir); |
| 152 | |
| 153 | log(`Building route runtime schema validation`); |
| 154 | await buildSchemas( |
| 155 | httpRoutes.map((f) => f.replace('.js', '.d.ts')), |
| 156 | webSocketRoutes.map((f) => f.replace('.js', '.d.ts')), |
| 157 | ); |
| 158 | |
| 159 | log(`Generating OpenAPI JSON file`); |
| 160 | const disabledRoutes = await importDefault(files, 'disabled-routes'); |
| 161 | await buildOpenAPI(httpRoutes, webSocketRoutes, disabledRoutes); |
| 162 | |
| 163 | log(`All built assets complete`); |
| 164 | |
| 165 | return { |
| 166 | files, |
| 167 | httpRoutes, |
| 168 | webSocketRoutes, |
| 169 | }; |
| 170 | }; |
| 171 | |
| 172 | const isConstructor = (reference) => typeof reference === 'function'; |
| 173 |
no test coverage detected