@storm-stack/core
Version:
A build toolkit and runtime used by Storm Software in TypeScript applications
1 lines • 8.73 kB
Source Map (JSON)
{"version":3,"sources":["../../src/commands/clean/docs/index.ts","../../src/commands/clean/output/index.ts","../../src/commands/clean/index.ts"],"names":["cleanDocs","context","hooks","log","LogLevelLabel","TRACE","vfs","rm","joinPaths","options","workspaceRoot","output","outputPath","callHook","catch","error","ERROR","message","stack","Error","cause","cleanOutput","clean"],"mappings":";;;;;;AA6BA,eAAsBA,SAAAA,CAAUC,SAAkBC,KAAAA,EAAkB;AAClED,EAAAA,OAAAA,CAAQE,GAAAA,CACNC,mBAAAA,CAAcC,KAAAA,EACd,CAAA,yDAAA,CAA2D,CAAA;AAG7D,EAAA,MAAMJ,OAAAA,CAAQK,GAAAA,CAAIC,EAAAA,CAChBC,mBAAAA,CACEP,OAAAA,CAAQQ,OAAAA,CAAQC,aAAAA,EAChBT,OAAAA,CAAQQ,OAAAA,CAAQE,MAAAA,CAAOC,UAAAA,IAAc,WAAA,CAAA,CAAA;AAIzC,EAAA,MAAMV,MAAMW,QAAAA,CAAS,YAAA,EAAcZ,OAAAA,CAAAA,CAASa,KAAAA,CAAM,CAACC,KAAAA,KAAAA;AACjDd,IAAAA,OAAAA,CAAQE,GAAAA,CACNC,mBAAAA,CAAcY,KAAAA,EACd,CAAA,iFAAA,EAAoFD,MAAME,OAAO,CAAA;EAAMF,KAAAA,CAAMG,KAAAA,IAAS,EAAA,CAAA,CAAI,CAAA;AAG5H,IAAA,MAAM,IAAIC,MACR,iFAAA,EACA;MACEC,KAAAA,EAAOL;KACT,CAAA;EAEJ,CAAA,CAAA;AACF;AA1BsBf,wBAAAA,CAAAA,SAAAA,EAAAA,WAAAA,CAAAA;ACAtB,eAAsBqB,WAAAA,CAAYpB,SAAkBC,KAAAA,EAAkB;AACpED,EAAAA,OAAAA,CAAQE,GAAAA,CAAIC,mBAAAA,CAAcC,KAAAA,EAAO,CAAA,wCAAA,CAA0C,CAAA;AAE3E,EAAA,MAAMJ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AACC,KAAAA,KAAAA;AACrDd,IAAAA,OAAAA,CAAQE,GAAAA,CACNC,mBAAAA,CAAcY,KAAAA,EACd,CAAA,gFAAA,EAAmFD,MAAME,OAAO,CAAA;EAAMF,KAAAA,CAAMG,KAAAA,IAAS,EAAA,CAAA,CAAI,CAAA;AAG3H,IAAA,MAAM,IAAIC,MACR,gFAAA,EACA;MAAEC,KAAAA,EAAOL;KAAM,CAAA;EAEnB,CAAA,CAAA;AACF;AA3BsBO,wBAAAA,CAAAA,KAAAA,EAAAA,OAAAA,CAAAA","file":"chunk-UO7WZABO.cjs","sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Storm Stack\n\n This code was released as part of the Storm Stack project. Storm Stack\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/storm-stack.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/storm-stack\n Documentation: https://docs.stormsoftware.com/projects/storm-stack\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { EngineHooks } from \"../../../types/build\";\nimport { Context } from \"../../../types/context\";\n\n/**\n * Cleans the Storm Stack project generated documentation.\n *\n * @param context - The build context.\n * @param hooks - The engine hooks.\n */\nexport async function cleanDocs(context: Context, hooks: EngineHooks) {\n context.log(\n LogLevelLabel.TRACE,\n `Cleaning the Storm Stack project generated documentation.`\n );\n\n await context.vfs.rm(\n joinPaths(\n context.options.workspaceRoot,\n context.options.output.outputPath || \"dist/docs\"\n )\n );\n\n await hooks.callHook(\"clean:docs\", context).catch((error: Error) => {\n context.log(\n LogLevelLabel.ERROR,\n `An error occured while cleaning the Storm Stack project generated documentation: ${error.message} \\n${error.stack ?? \"\"}`\n );\n\n throw new Error(\n \"An error occured while cleaning the Storm Stack project generated documentation\",\n {\n cause: error\n }\n );\n });\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Storm Stack\n\n This code was released as part of the Storm Stack project. Storm Stack\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/projects/storm-stack/license.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/storm-stack\n Documentation: https://stormsoftware.com/projects/storm-stack/docs\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { Context } from \"@storm-stack/core/types/context\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { EngineHooks } from \"../../../types/build\";\n\n/**\n * Cleans the Storm Stack project output by removing generated files and directories.\n *\n * @param context - The build context.\n * @param hooks - The engine hooks.\n */\nexport async function cleanOutput(context: Context, hooks: EngineHooks) {\n context.log(LogLevelLabel.TRACE, `Cleaning the Storm Stack project output.`);\n\n await context.vfs.rm(\n joinPaths(context.options.workspaceRoot, context.options.output.outputPath)\n );\n\n await hooks.callHook(\"clean:output\", context).catch((error: Error) => {\n context.log(\n LogLevelLabel.ERROR,\n `An error occured while cleaning the Storm Stack project output: ${error.message} \\n${error.stack ?? \"\"}`\n );\n\n throw new Error(\n \"An error occured while cleaning the Storm Stack project output\",\n {\n cause: error\n }\n );\n });\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Storm Stack\n\n This code was released as part of the Storm Stack project. Storm Stack\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/storm-stack.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/storm-stack\n Documentation: https://docs.stormsoftware.com/projects/storm-stack\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport type { EngineHooks } from \"../../types/build\";\nimport { Context } from \"../../types/context\";\nimport { cleanDocs } from \"./docs\";\nimport { cleanOutput } from \"./output\";\n\n/**\n * Cleans the Storm Stack project by removing generated files and artifacts.\n *\n * @param context - The build context.\n * @param hooks - The engine hooks.\n */\nexport async function clean(context: Context, hooks: EngineHooks) {\n await hooks.callHook(\"clean:begin\", context).catch((error: Error) => {\n context.log(\n LogLevelLabel.ERROR,\n `An error occured while starting the clean process for the Storm Stack project: ${error.message} \\n${error.stack ?? \"\"}`\n );\n\n throw new Error(\n \"An error occured while starting the clean process for the Storm Stack project\",\n { cause: error }\n );\n });\n\n await cleanOutput(context, hooks);\n await cleanDocs(context, hooks);\n\n await hooks.callHook(\"clean:complete\", context).catch((error: Error) => {\n context.log(\n LogLevelLabel.ERROR,\n `An error occured while finishing the clean process for the Storm Stack project: ${error.message} \\n${error.stack ?? \"\"}`\n );\n\n throw new Error(\n \"An error occured while finishing the clean process for the Storm Stack project\",\n { cause: error }\n );\n });\n}\n"]}