@storm-stack/core
Version:
A build toolkit and runtime used by Storm Software in TypeScript applications
1 lines • 7.97 kB
Source Map (JSON)
{"version":3,"sources":["../../src/commands/build/application/index.ts","../../src/commands/build/library/index.ts","../../src/commands/build/index.ts"],"names":["buildApplication","context","hooks","log","LogLevelLabel","TRACE","callHook","catch","error","ERROR","message","stack","Error","cause","buildLibrary","build","options","projectType"],"mappings":";;;;;AA4BA,eAAsBA,gBAAAA,CAAiBC,SAAkBC,KAAAA,EAAkB;AACzED,EAAAA,OAAAA,CAAQE,GAAAA,CACNC,mBAAAA,CAAcC,KAAAA,EACd,0DAAA,CAAA;AAGF,EAAA,MAAMH,MAAMI,QAAAA,CAAS,mBAAA,EAAqBL,OAAAA,CAAAA,CAASM,KAAAA,CAAM,CAACC,KAAAA,KAAAA;AACxDP,IAAAA,OAAAA,CAAQE,GAAAA,CACNC,mBAAAA,CAAcK,KAAAA,EACd,CAAA,6DAAA,EAAgED,MAAME,OAAO,CAAA;EAAMF,KAAAA,CAAMG,KAAAA,IAAS,EAAA,CAAA,CAAI,CAAA;AAGxG,IAAA,MAAM,IAAIC,MACR,6DAAA,EACA;MACEC,KAAAA,EAAOL;KACT,CAAA;EAEJ,CAAA,CAAA;AACF;AAnBsBR,wBAAAA,CAAAA,gBAAAA,EAAAA,kBAAAA,CAAAA;ACAtB,eAAsBc,YAAAA,CAAab,SAAkBC,KAAAA,EAAkB;AACrED,EAAAA,OAAAA,CAAQE,GAAAA,CACNC,mBAAAA,CAAcC,KAAAA,EACd,sDAAA,CAAA;AAGF,EAAA,MAAMH,MAAMI,QAAAA,CAAS,eAAA,EAAiBL,OAAAA,CAAAA,CAASM,KAAAA,CAAM,CAACC,KAAAA,KAAAA;AACpDP,IAAAA,OAAAA,CAAQE,GAAAA,CACNC,mBAAAA,CAAcK,KAAAA,EACd,CAAA,yDAAA,EAA4DD,MAAME,OAAO,CAAA;EAAMF,KAAAA,CAAMG,KAAAA,IAAS,EAAA,CAAA,CAAI,CAAA;AAGpG,I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BSS5D7NX.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 type { EngineHooks } from \"../../../types/build\";\nimport type { Context } from \"../../../types/context\";\n\n/**\n * Builds the Storm Stack application based on the provided context and hooks.\n *\n * @param context - The build context.\n * @param hooks - The engine hooks.\n */\nexport async function buildApplication(context: Context, hooks: EngineHooks) {\n context.log(\n LogLevelLabel.TRACE,\n \"Executing build process for the Storm Stack application.\"\n );\n\n await hooks.callHook(\"build:application\", context).catch((error: Error) => {\n context.log(\n LogLevelLabel.ERROR,\n `An error occured while building the Storm Stack application: ${error.message} \\n${error.stack ?? \"\"}`\n );\n\n throw new Error(\n \"An error occured while building the Storm Stack application\",\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 { EngineHooks } from \"../../../types/build\";\nimport { Context } from \"../../../types/context\";\n\n/**\n * Builds the Storm Stack library based on the provided context and hooks.\n *\n * @param context - The build context.\n * @param hooks - The engine hooks.\n */\nexport async function buildLibrary(context: Context, hooks: EngineHooks) {\n context.log(\n LogLevelLabel.TRACE,\n \"Executing build process for the Storm Stack library.\"\n );\n\n await hooks.callHook(\"build:library\", context).catch((error: Error) => {\n context.log(\n LogLevelLabel.ERROR,\n `An error occured while building the Storm Stack library: ${error.message} \\n${error.stack ?? \"\"}`\n );\n\n throw new Error(\"An error occured while building the Storm Stack library\", {\n cause: error\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 { buildApplication } from \"./application\";\nimport { buildLibrary } from \"./library\";\n\nexport async function build(context: Context, hooks: EngineHooks) {\n await hooks.callHook(\"build:begin\", context).catch((error: Error) => {\n context.log(\n LogLevelLabel.ERROR,\n `An error occured while starting the build process for the Storm Stack project: ${error.message} \\n${error.stack ?? \"\"}`\n );\n\n throw new Error(\n \"An error occured while starting the build process for the Storm Stack project\",\n { cause: error }\n );\n });\n\n if (context.options.projectType === \"application\") {\n await buildApplication(context, hooks);\n } else {\n await buildLibrary(context, hooks);\n }\n\n await hooks.callHook(\"build:complete\", context).catch((error: Error) => {\n context.log(\n LogLevelLabel.ERROR,\n `An error occured while finishing the build process for the Storm Stack project: ${error.message} \\n${error.stack ?? \"\"}`\n );\n\n throw new Error(\n \"An error occured while finishing the build process for the Storm Stack project\",\n { cause: error }\n );\n });\n}\n"]}