UNPKG

@storm-stack/core

Version:

A build toolkit and runtime used by Storm Software in TypeScript applications

55 lines (51 loc) 2.33 kB
'use strict'; var chunk3ONWID2V_cjs = require('./chunk-3ONWID2V.cjs'); var types = require('@storm-software/config-tools/types'); async function buildApplication(context, hooks) { context.log(types.LogLevelLabel.TRACE, "Executing build process for the Storm Stack application."); await hooks.callHook("build:application", context).catch((error) => { context.log(types.LogLevelLabel.ERROR, `An error occured while building the Storm Stack application: ${error.message} ${error.stack ?? ""}`); throw new Error("An error occured while building the Storm Stack application", { cause: error }); }); } chunk3ONWID2V_cjs.__name(buildApplication, "buildApplication"); async function buildLibrary(context, hooks) { context.log(types.LogLevelLabel.TRACE, "Executing build process for the Storm Stack library."); await hooks.callHook("build:library", context).catch((error) => { context.log(types.LogLevelLabel.ERROR, `An error occured while building the Storm Stack library: ${error.message} ${error.stack ?? ""}`); throw new Error("An error occured while building the Storm Stack library", { cause: error }); }); } chunk3ONWID2V_cjs.__name(buildLibrary, "buildLibrary"); // src/commands/build/index.ts async function build(context, hooks) { await hooks.callHook("build:begin", context).catch((error) => { context.log(types.LogLevelLabel.ERROR, `An error occured while starting the build process for the Storm Stack project: ${error.message} ${error.stack ?? ""}`); throw new Error("An error occured while starting the build process for the Storm Stack project", { cause: error }); }); if (context.options.projectType === "application") { await buildApplication(context, hooks); } else { await buildLibrary(context, hooks); } await hooks.callHook("build:complete", context).catch((error) => { context.log(types.LogLevelLabel.ERROR, `An error occured while finishing the build process for the Storm Stack project: ${error.message} ${error.stack ?? ""}`); throw new Error("An error occured while finishing the build process for the Storm Stack project", { cause: error }); }); } chunk3ONWID2V_cjs.__name(build, "build"); exports.build = build; //# sourceMappingURL=chunk-BSS5D7NX.cjs.map //# sourceMappingURL=chunk-BSS5D7NX.cjs.map