UNPKG

@storm-stack/core

Version:

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

53 lines (50 loc) 2.42 kB
import { __name } from './chunk-43IZMM3W.js'; import { LogLevelLabel } from '@storm-software/config-tools/types'; import { joinPaths } from '@stryke/path/join-paths'; async function cleanDocs(context, hooks) { context.log(LogLevelLabel.TRACE, `Cleaning the Storm Stack project generated documentation.`); await context.vfs.rm(joinPaths(context.options.workspaceRoot, context.options.output.outputPath || "dist/docs")); await hooks.callHook("clean:docs", context).catch((error) => { context.log(LogLevelLabel.ERROR, `An error occured while cleaning the Storm Stack project generated documentation: ${error.message} ${error.stack ?? ""}`); throw new Error("An error occured while cleaning the Storm Stack project generated documentation", { cause: error }); }); } __name(cleanDocs, "cleanDocs"); async function cleanOutput(context, hooks) { context.log(LogLevelLabel.TRACE, `Cleaning the Storm Stack project output.`); await context.vfs.rm(joinPaths(context.options.workspaceRoot, context.options.output.outputPath)); await hooks.callHook("clean:output", context).catch((error) => { context.log(LogLevelLabel.ERROR, `An error occured while cleaning the Storm Stack project output: ${error.message} ${error.stack ?? ""}`); throw new Error("An error occured while cleaning the Storm Stack project output", { cause: error }); }); } __name(cleanOutput, "cleanOutput"); // src/commands/clean/index.ts async function clean(context, hooks) { await hooks.callHook("clean:begin", context).catch((error) => { context.log(LogLevelLabel.ERROR, `An error occured while starting the clean process for the Storm Stack project: ${error.message} ${error.stack ?? ""}`); throw new Error("An error occured while starting the clean process for the Storm Stack project", { cause: error }); }); await cleanOutput(context, hooks); await cleanDocs(context, hooks); await hooks.callHook("clean:complete", context).catch((error) => { context.log(LogLevelLabel.ERROR, `An error occured while finishing the clean process for the Storm Stack project: ${error.message} ${error.stack ?? ""}`); throw new Error("An error occured while finishing the clean process for the Storm Stack project", { cause: error }); }); } __name(clean, "clean"); export { clean }; //# sourceMappingURL=chunk-NSHO7RIH.js.map //# sourceMappingURL=chunk-NSHO7RIH.js.map