MCPcopy Index your code
hub / github.com/browserless/browserless / build

Function build

bin/browserless.js:145–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143 * and validation. Doesn't start the HTTP server.
144 */
145const 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
172const isConstructor = (reference) => typeof reference === 'function';
173

Callers 4

build-function.jsFile · 0.85
startFunction · 0.85
buildDockerFunction · 0.85
browserless.jsFile · 0.85

Calls 5

buildTypeScriptFunction · 0.85
getSourceFilesFunction · 0.85
buildSchemasFunction · 0.85
importDefaultFunction · 0.85
buildOpenAPIFunction · 0.85

Tested by

no test coverage detected