@storm-stack/core
Version:
A build toolkit and runtime used by Storm Software in TypeScript applications
55 lines (51 loc) • 2.55 kB
JavaScript
;
var chunk3ONWID2V_cjs = require('./chunk-3ONWID2V.cjs');
var types = require('@storm-software/config-tools/types');
var joinPaths = require('@stryke/path/join-paths');
async function cleanDocs(context, hooks) {
context.log(types.LogLevelLabel.TRACE, `Cleaning the Storm Stack project generated documentation.`);
await context.vfs.rm(joinPaths.joinPaths(context.options.workspaceRoot, context.options.output.outputPath || "dist/docs"));
await hooks.callHook("clean:docs", context).catch((error) => {
context.log(types.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
});
});
}
chunk3ONWID2V_cjs.__name(cleanDocs, "cleanDocs");
async function cleanOutput(context, hooks) {
context.log(types.LogLevelLabel.TRACE, `Cleaning the Storm Stack project output.`);
await context.vfs.rm(joinPaths.joinPaths(context.options.workspaceRoot, context.options.output.outputPath));
await hooks.callHook("clean:output", context).catch((error) => {
context.log(types.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
});
});
}
chunk3ONWID2V_cjs.__name(cleanOutput, "cleanOutput");
// src/commands/clean/index.ts
async function clean(context, hooks) {
await hooks.callHook("clean:begin", context).catch((error) => {
context.log(types.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(types.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
});
});
}
chunk3ONWID2V_cjs.__name(clean, "clean");
exports.clean = clean;
//# sourceMappingURL=chunk-UO7WZABO.cjs.map
//# sourceMappingURL=chunk-UO7WZABO.cjs.map