@powerlines/plugin-env 0.16.69 → 0.16.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/babel/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { NodePath } from \"@babel/core\";\nimport * as t from \"@babel/types\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport { createBabelPlugin } from \"@powerlines/plugin-babel/helpers/create-plugin\";\nimport { addImport } from \"@powerlines/plugin-babel/helpers/module-helpers\";\nimport { BabelPluginPass } from \"@powerlines/plugin-babel/types/config\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/*\n * The Powerlines - Environment Configuration Babel Plugin\n *\n * @param babel - The Babel core module\n * @returns The Babel plugin object\n */\nexport const envBabelPlugin = createBabelPlugin<EnvPluginContext>(\n \"env\",\n ({ log, context }) => {\n function extractEnv(\n node: t.Identifier,\n pass: BabelPluginPass,\n isInjectable = false,\n isUsingBuiltin = false\n ) {\n const envTypesAliasProperties = context.env.types.env\n ?.getProperties()\n .filter(prop => prop.getAlias().length > 0);\n\n if (node.name) {\n const prefix = context.config.env.prefix.find(\n pre =>\n node.name &&\n node.name.startsWith(pre) &&\n (context.env.types.env?.hasProperty(\n node.name.replace(`${pre}_`, \"\")\n ) ||\n envTypesAliasProperties.some(prop =>\n prop.getAlias().includes(node.name.replace(`${pre}_`, \"\"))\n ))\n );\n\n let name = node.name;\n if (prefix) {\n name = node.name.replace(`${prefix}_`, \"\");\n }\n\n log(\n LogLevelLabel.TRACE,\n `Environment variable ${name} found in ${\n pass.filename || \"unknown file\"\n }.`\n );\n\n if (\n context.env.types.env?.hasProperty(name) ||\n envTypesAliasProperties.some(prop => prop.getAlias().includes(name))\n ) {\n const envProperty = context.env.types.env.hasProperty(name)\n ? context.env.types.env.getProperty(name)\n : envTypesAliasProperties.find(prop =>\n prop.getAlias().includes(name)\n );\n if (!envProperty || envProperty.isIgnored()) {\n return;\n }\n\n if (!context.env.used.env.hasProperty(name)) {\n log(\n LogLevelLabel.DEBUG,\n `Adding \"${name}\" environment variables found in \"${\n pass.filename || \"unknown file\"\n }\" to used environment configuration reflection object.`\n );\n\n context.env.used.env.addProperty(envProperty.property);\n }\n\n if (context.config.env.inject && isInjectable) {\n let value = context.env.parsed?.[name];\n if (value === undefined) {\n const prefix = context.config.env.prefix.find(pre => {\n return context.env.parsed[`${pre.replace(/_$/g, \"\")}_${name}`];\n });\n if (prefix) {\n value =\n context.env.parsed[`${prefix.replace(/_$/g, \"\")}_${name}`];\n }\n }\n\n value ??= envProperty.getDefaultValue();\n\n if (envProperty.isValueRequired() && value === undefined) {\n throw new Error(\n `Environment variable \\`${name}\\` is not defined in the .env configuration files`\n );\n }\n\n return stringifyDefaultValue(envProperty, value);\n }\n } else if (context.config.env.validate) {\n throw new Error(\n `The \"${name}\" environment variable is not defined in the \\`env\\` type definition, but is used in the source code file ${\n pass.filename ? pass.filename : \"unknown\"\n }.\n\n The following environment configuration names are defined in the \\`env\\` type definition: \\n${context.env.types.env\n ?.getPropertyNames()\n .sort((a, b) => String(a).localeCompare(String(b)))\n .map(\n typeDef =>\n ` - ${String(typeDef)} ${\n envTypesAliasProperties.some(\n prop =>\n prop.getNameAsString() === String(typeDef) &&\n prop.getAlias().length > 0\n )\n ? `(Alias: ${envTypesAliasProperties\n ?.find(\n prop => prop.getNameAsString() === String(typeDef)\n )\n ?.getAlias()\n .join(\", \")})`\n : \"\"\n }`\n )\n .join(\n \"\\n\"\n )} \\n\\nUsing the following env prefix: \\n${context.config.env.prefix\n .map(prefix => ` - ${prefix}`)\n .join(\n \"\\n\"\n )} \\n\\nPlease check your \\`env\\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \\n\\n`\n );\n } else if (pass.filename && isUsingBuiltin) {\n context.warn(\n `The \"${\n name\n }\" environment variable is used in the source code file ${\n pass.filename\n }, but is not defined in the \\`env\\` type definition. If this is intentional, you can ignore this warning. Otherwise, please check your \\`env\\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code.`\n );\n }\n }\n\n return undefined;\n }\n\n return {\n visitor: {\n MemberExpression(\n path: NodePath<t.MemberExpression>,\n pass: BabelPluginPass\n ) {\n if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path\n .get(\"object\")\n ?.get(\"object\")\n ?.isIdentifier({ name: \"process\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // process.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path.get(\"object\")?.get(\"object\")?.isMetaProperty() &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // import.meta.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path.get(\"object\")?.isIdentifier({ name: \"env\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false, true);\n }\n }\n }\n };\n }\n);\n"],"mappings":";;;;;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;AAC/B,IAAG,SAAU;AACb,QAAQ;;AA8BT,MAAa,kBAAU,kBAAA,IAAA,CAAA,OAAA,qBAAA,KAAA,CAAA,EAAA,kBAAA,OAAA,cAAA,EACrB,KACA,cACI;CACJ,SAAI,WAAgB,MAAC,MAAA,eAAA,OAAA,iBAAA,OAAA;EACnB,MAAE,0BAAA,QAAA,IAAA,MAAA,KAAA,eAAA,CAAA,OAAA,cAAA,SAAA,KAAA,UAAA,CAAA,SAAA,GAAA;GAAA;GAAA;GAAA;GAAA,CAAA,CAAA;AACF,MAAE,KAAM,MAAA;GACN,MAAI,SAAA,QAAc,OAAA,IAAA,OAAA,KAAA,cAAA,QAAA,KAAA,QAAA,KAAA,KAAA,WAAA,IAAA,KAAA,QAAA,IAAA,MAAA,KAAA,YAAA,KAAA,KAAA,QAAA,GAAA,IAAA,IAAA,GAAA,CAAA,IAAA,wBAAA,KAAA,cAAA,SAAA,KAAA,UAAA,CAAA,SAAA,KAAA,KAAA,QAAA,GAAA,IAAA,IAAA,GAAA,CAAA,EAAA;IAAA;IAAA;IAAA;IAAA,CAAA,CAAA,GAAA;IAAA;IAAA;IAAA;IAAA,CAAA,CAAA;GAClB,IAAG,OAAO,KAAM;cAEd,QAAO,KAAK,KAAC,QAAA,GAAA,OAAA,IAAA,GAAA;AAEf,OAAI,cAAK,OAAA,wBAAA,KAAA,YAAA,KAAA,YAAA,eAAA,GAAA;AACT,OAAI,QAAO,IAAK,MAAC,KAAA,YAAA,KAAA,IAAA,wBAAA,KAAA,cAAA,SAAA,KAAA,UAAA,CAAA,SAAA,KAAA,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A;AACvC,OAAI,CAAA,WAAU,KACZ;AAEF,cAAE,YAAA,MAAA,OAAA,MAAA;;AAEF,aAAS,MAAA;IACT,QAAA,GAAA,QAAA,OAAA,aAAA,aAAA;IACA,MAAQ;IACR,UAAU;IACT,CAAC;aACO,KAAA,IAAS,SAAO,EAAA,aAAY,EACrC,MAAG;GAGH,MAAI,aAAA,KAAiB,IAAA,WAAA,EAAA;AACrB,OAAG,CAAA,WAAa,KACd;AAEF,cAAW,YAAQ,MAAU,OAAC,KAAA;;IAE/B;QAAO;EAAU;QAAA;EAAA;EAAA;EAAA;EAAA,CAAA,EACrB,EACF;GACA;CAAC;CAAU;CAAI;CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/babel/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { NodePath } from \"@babel/core\";\nimport * as t from \"@babel/types\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport { createBabelPlugin } from \"@powerlines/plugin-babel/helpers/create-plugin\";\nimport { addImport } from \"@powerlines/plugin-babel/helpers/module-helpers\";\nimport { BabelPluginPass } from \"@powerlines/plugin-babel/types/config\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/*\n * The Powerlines - Environment Configuration Babel Plugin\n *\n * @param babel - The Babel core module\n * @returns The Babel plugin object\n */\nexport const envBabelPlugin = createBabelPlugin<EnvPluginContext>(\n \"env\",\n ({ log, context }) => {\n function extractEnv(\n node: t.Identifier,\n pass: BabelPluginPass,\n isInjectable = false,\n isUsingBuiltin = false\n ) {\n const envTypesAliasProperties = context.env.types.env\n ?.getProperties()\n .filter(prop => prop.getAlias().length > 0);\n\n if (node.name) {\n const prefix = context.config.env.prefix.find(\n pre =>\n node.name &&\n node.name.startsWith(pre) &&\n (context.env.types.env?.hasProperty(\n node.name.replace(`${pre}_`, \"\")\n ) ||\n envTypesAliasProperties.some(prop =>\n prop.getAlias().includes(node.name.replace(`${pre}_`, \"\"))\n ))\n );\n\n let name = node.name;\n if (prefix) {\n name = node.name.replace(`${prefix}_`, \"\");\n }\n\n log(\n LogLevelLabel.TRACE,\n `Environment variable ${name} found in ${\n pass.filename || \"unknown file\"\n }.`\n );\n\n if (\n context.env.types.env?.hasProperty(name) ||\n envTypesAliasProperties.some(prop => prop.getAlias().includes(name))\n ) {\n const envProperty = context.env.types.env.hasProperty(name)\n ? context.env.types.env.getProperty(name)\n : envTypesAliasProperties.find(prop =>\n prop.getAlias().includes(name)\n );\n if (!envProperty || envProperty.isIgnored()) {\n return;\n }\n\n if (!context.env.used.env.hasProperty(name)) {\n log(\n LogLevelLabel.DEBUG,\n `Adding \"${name}\" environment variables found in \"${\n pass.filename || \"unknown file\"\n }\" to used environment configuration reflection object.`\n );\n\n context.env.used.env.addProperty(envProperty.property);\n }\n\n if (context.config.env.inject && isInjectable) {\n let value = context.env.parsed?.[name];\n if (value === undefined) {\n const prefix = context.config.env.prefix.find(pre => {\n return context.env.parsed[`${pre.replace(/_$/g, \"\")}_${name}`];\n });\n if (prefix) {\n value =\n context.env.parsed[`${prefix.replace(/_$/g, \"\")}_${name}`];\n }\n }\n\n value ??= envProperty.getDefaultValue();\n\n if (envProperty.isValueRequired() && value === undefined) {\n throw new Error(\n `Environment variable \\`${name}\\` is not defined in the .env configuration files`\n );\n }\n\n return stringifyDefaultValue(envProperty, value);\n }\n } else if (context.config.env.validate) {\n throw new Error(\n `The \"${name}\" environment variable is not defined in the \\`env\\` type definition, but is used in the source code file ${\n pass.filename ? pass.filename : \"unknown\"\n }.\n\n The following environment configuration names are defined in the \\`env\\` type definition: \\n${context.env.types.env\n ?.getPropertyNames()\n .sort((a, b) => String(a).localeCompare(String(b)))\n .map(\n typeDef =>\n ` - ${String(typeDef)} ${\n envTypesAliasProperties.some(\n prop =>\n prop.getNameAsString() === String(typeDef) &&\n prop.getAlias().length > 0\n )\n ? `(Alias: ${envTypesAliasProperties\n ?.find(\n prop => prop.getNameAsString() === String(typeDef)\n )\n ?.getAlias()\n .join(\", \")})`\n : \"\"\n }`\n )\n .join(\n \"\\n\"\n )} \\n\\nUsing the following env prefix: \\n${context.config.env.prefix\n .map(prefix => ` - ${prefix}`)\n .join(\n \"\\n\"\n )} \\n\\nPlease check your \\`env\\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code. \\n\\n`\n );\n } else if (pass.filename && isUsingBuiltin) {\n context.warn(\n `The \"${\n name\n }\" environment variable is used in the source code file ${\n pass.filename\n }, but is not defined in the \\`env\\` type definition. If this is intentional, you can ignore this warning. Otherwise, please check your \\`env\\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code.`\n );\n }\n }\n\n return undefined;\n }\n\n return {\n visitor: {\n MemberExpression(\n path: NodePath<t.MemberExpression>,\n pass: BabelPluginPass\n ) {\n if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path\n .get(\"object\")\n ?.get(\"object\")\n ?.isIdentifier({ name: \"process\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // process.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path.get(\"object\")?.get(\"object\")?.isMetaProperty() &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // import.meta.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path.get(\"object\")?.isIdentifier({ name: \"env\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false, true);\n }\n }\n }\n };\n }\n);\n"],"mappings":";;;;;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;AAC5B,IAAA,SAAW;AACd,QAAS;;AA8BV,MAAa,kBAAU,kBAAA,IAAA,CAAA,OAAA,qBAAA,KAAA,CAAA,EAAA,kBAAA,OAAA,cAAA,EAAA,KAAA,cAAA;CACnB,SAAS,WAAW,MAAA,MAAA,eAAA,OAAA,iBAAA,OAAA;EAClB,MAAM,0BAAe,QAAA,IAAA,MAAA,KACrB,eAAoB,CACpB,OAAc,cAAG,SAAA,KAAA,UAAA,CAAA,SAAA,GAAA;GAAA;GAAA;GAAA;GAAA,CAAA,CAAA;AACjB,MAAA,KAAA,MAAA;GACM,MAAA,SAAA,QAAuB,OAAG,IAAQ,OAAI,KAAM,cAAA,QAAA,KAAA,QAC9C,KAAA,KAAc,WAAA,IAAA,KACR,QAAQ,IAAK,MAAA,KAAW,YAAW,KAAA,KAAA,QAAA,GAAA,IAAA,IAAA,GAAA,CAAA;;;;;;;;;GAEzC,IAAK,OAAM,KAAA;AACb,OAAM,OACC,QAAA,KAAA,KAAA,QAAA,GAAA,OAAA,IAAA,GAAA;AAEH,OAAI,cAAM,OAAe,wBAAE,KAA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AAA,CAAA,IACE,KAAI,IAAK,SAAI,EAAA,IAAA,SAAA,EAAA,gBAAA,IACb,KAAK,IAAC,WAAI,EAAA,cAAA,EAAA;GAEV,MAAI,aAAA,KAAA,IAAA,WAAA,EAAA;AACJ,OAAI,CAAC,WAAU,KACX;AAEP,cAAA,YAAA,MAAA,OAAA,MAAA;AACL,QAAA,wBAAA,OAAA,WAAA,OAAA;AACK,aAAA,MAAA;IACA,QAAA,GAAA,QAAA,OAAA,aAAA,aAAA;IACO,MAAK;IACL,UAAS;IAChB,CAAA;aAEQ,KAAC,IAAM,SAAW,EAAE,aAAa,EAAC,MAAO,OAAO,CAAC,IAC/D,KAAA,IAAA,WAAA,EAAA,cAAA,EAAA;GAEO,MAAI,aAAA,KAAA,IAAA,WAAA,EAAA;AACH,OAAA,CAAA,WAAA,KACL;AAEK,cAAA,YAAA,MAAA,OAAA,KAAA;;IAER;QAAA;EAAA;QAAA;EAAA;EAAA;EAAA;EAAA,CAAA,EACH,EACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"automd-generator.mjs","names":[],"sources":["../../src/helpers/automd-generator.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { defineGenerator } from \"automd\";\nimport { UnresolvedContext } from \"powerlines\";\n\n/**\n * AutoMD generator to generate environment variable documentation\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const env = (context: UnresolvedContext) =>\n defineGenerator({\n name: \"env\",\n async generate() {\n const envDocFile = joinPaths(\n context.config.root,\n \"docs\",\n \"generated\",\n \"env.md\"\n );\n\n if (!context.fs.existsSync(envDocFile)) {\n return {\n contents: \"\"\n };\n }\n\n const contents = await context.fs.read(envDocFile);\n\n return {\n contents: contents || \"\"\n };\n }\n });\n"],"mappings":";;;;;AAEA,SAAS,aAAY,IAAK,MAAC;;AAE1B,QAAK;;;;;;;;AA2BN,MAAU,MAAS,cAAE,YAAA,gBAAA;CACnB,MAAI;CACJ,UAAM,aAAe,eAAI,WAAA;EACvB,MAAK,aAAK,UAAA,QAAA,OAAA,MAAA,QAAA,aAAA,SAAA;AACV,MAAI,CAAC,QAAA,GAAU,WAAA,WAAA,CACb,QAAO,EACN,UAAA;AAIH,SAAM,EACJ,UAFS,MAAA,QAAA,GAAA,KAAA,WAAA,IAEN,IACJ;;CAEJ,CAAC,EAAE;OAAO;CAAkB;CAAe;CAAC;CAAW,CAAA"}
1
+ {"version":3,"file":"automd-generator.mjs","names":[],"sources":["../../src/helpers/automd-generator.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { defineGenerator } from \"automd\";\nimport { UnresolvedContext } from \"powerlines\";\n\n/**\n * AutoMD generator to generate environment variable documentation\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const env = (context: UnresolvedContext) =>\n defineGenerator({\n name: \"env\",\n async generate() {\n const envDocFile = joinPaths(\n context.config.root,\n \"docs\",\n \"generated\",\n \"env.md\"\n );\n\n if (!context.fs.existsSync(envDocFile)) {\n return {\n contents: \"\"\n };\n }\n\n const contents = await context.fs.read(envDocFile);\n\n return {\n contents: contents || \"\"\n };\n }\n });\n"],"mappings":";;;;;AAEA,SAAS,aAAY,IAAK,MAAC;;AAE1B,QAAU;;;;;;;;AA2BX,MAAU,MAAS,cAAE,YAAA,gBAAA;CACjB,MAAE;CACF,UAAI,aAAmB,eAAA,WAAA;EACnB,MAAM,aAAA,UAAA,QAAA,OAAA,MAAA,QAAA,aAAA,SAAA;AACN,MAAC,CAAA,QAAU,GAAA,WAAA,WAAA,CACP,QAAG,EACR,UAAA;AAIC,SAAE,EACD,UAFM,MAAA,QAAA,GAAA,KAAA,WAAA,IAEN,IACH;;CAEL,CAAC,EAAE;OAAO;CAAkB;CAAe;CAAC;CAAW,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-reflection-resource.mjs","names":[],"sources":["../../src/helpers/create-reflection-resource.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Creates a reflection resource for the environment configuration.\n *\n * @param _context - The environment plugin context.\n * @returns A resource that provides the reflection of the environment configuration.\n */\nexport function createReflection(_context: EnvPluginContext) {\n // const defaultValue = computed(\n // () => context && loadEnvFromContext(context, process.env)\n // );\n\n return {};\n\n // return computed(() => {\n // result.getProperties().forEach(prop => {\n // const aliases = prop.getAlias();\n // aliases.filter(Boolean).forEach(alias => {\n // result.addProperty({\n // name: alias,\n // optional: prop.isOptional() ? true : undefined,\n // readonly: prop.isReadonly() ? true : undefined,\n // description: prop.getDescription(),\n // visibility: prop.getVisibility(),\n // type: prop.getType(),\n // default: prop.getDefaultValue(),\n // tags: {\n // hidden: prop.isHidden(),\n // ignore: prop.isIgnored(),\n // internal: prop.isInternal(),\n // alias: prop\n // .getAlias()\n // .filter(a => a !== alias)\n // .concat(prop.name),\n // title: prop.getTitle() || titleCase(prop.name),\n // readonly: prop.isReadonly(),\n // permission: prop.getPermission(),\n // domain: prop.getDomain()\n // }\n // });\n // });\n // });\n\n // result.getProperties().forEach(prop => {\n // prop.setDefaultValue(\n // (defaultValue.value as Record<string, any>)?.[prop.getNameAsString()] ??\n // prop\n // .getAlias()\n // .reduce(\n // (ret, alias) =>\n // ret ?? (defaultValue.value as Record<string, any>)?.[alias],\n // undefined\n // ) ??\n // prop.getDefaultValue()\n // );\n // });\n // });\n}\n"],"mappings":";;;;;;;;;;AAYC,QAAQ,EAAE;;AA4CX,iBAAe,SAAQ;OAAK;CAAU;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"create-reflection-resource.mjs","names":[],"sources":["../../src/helpers/create-reflection-resource.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Creates a reflection resource for the environment configuration.\n *\n * @param _context - The environment plugin context.\n * @returns A resource that provides the reflection of the environment configuration.\n */\nexport function createReflection(_context: EnvPluginContext) {\n // const defaultValue = computed(\n // () => context && loadEnvFromContext(context, process.env)\n // );\n\n return {};\n\n // return computed(() => {\n // result.getProperties().forEach(prop => {\n // const aliases = prop.getAlias();\n // aliases.filter(Boolean).forEach(alias => {\n // result.addProperty({\n // name: alias,\n // optional: prop.isOptional() ? true : undefined,\n // readonly: prop.isReadonly() ? true : undefined,\n // description: prop.getDescription(),\n // visibility: prop.getVisibility(),\n // type: prop.getType(),\n // default: prop.getDefaultValue(),\n // tags: {\n // hidden: prop.isHidden(),\n // ignore: prop.isIgnored(),\n // internal: prop.isInternal(),\n // alias: prop\n // .getAlias()\n // .filter(a => a !== alias)\n // .concat(prop.name),\n // title: prop.getTitle() || titleCase(prop.name),\n // readonly: prop.isReadonly(),\n // permission: prop.getPermission(),\n // domain: prop.getDomain()\n // }\n // });\n // });\n // });\n\n // result.getProperties().forEach(prop => {\n // prop.setDefaultValue(\n // (defaultValue.value as Record<string, any>)?.[prop.getNameAsString()] ??\n // prop\n // .getAlias()\n // .reduce(\n // (ret, alias) =>\n // ret ?? (defaultValue.value as Record<string, any>)?.[alias],\n // undefined\n // ) ??\n // prop.getDefaultValue()\n // );\n // });\n // });\n}\n"],"mappings":";;;;;;;;;;AAYC,QAAU,EAAE;;AA4Cb,iBAAe,SAAQ;OAAK;CAAU;CAAA;CAAA;CAAA;CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"docs-helper.mjs","names":[],"sources":["../../src/helpers/docs-helper.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Gets the output path for the generated environment documentation.\n *\n * @param context - The environment plugin context.\n * @returns The output path for the generated environment documentation.\n */\nexport function getDocsOutputPath(context: EnvPluginContext): string {\n return joinPaths(context.config.root, \"docs\", \"generated\");\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAE,kBAAA,SAAA;AACF,QAAO,UAAS,QAAA,OAAkB,MAAA,QAAS,YAAiB;;AAE5D,kBAAA,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"docs-helper.mjs","names":[],"sources":["../../src/helpers/docs-helper.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Gets the output path for the generated environment documentation.\n *\n * @param context - The environment plugin context.\n * @returns The output path for the generated environment documentation.\n */\nexport function getDocsOutputPath(context: EnvPluginContext): string {\n return joinPaths(context.config.root, \"docs\", \"generated\");\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAE,kBAAA,SAAA;AACF,QAAO,UAAS,QAAA,OAAkB,MAAQ,QAAC,YAAmB;;AAE9D,kBAAA,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"load.mjs","names":[],"sources":["../../src/helpers/load.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n loadEnv as loadEnvBase,\n loadEnvFile as loadEnvFileBase\n} from \"@stryke/env/load-env\";\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { PackageJson } from \"@stryke/types/package-json\";\nimport { loadConfig } from \"c12\";\nimport defu from \"defu\";\nimport { WorkspaceConfig } from \"powerlines\";\nimport { DEFAULT_ENVIRONMENT } from \"powerlines/constants\";\nimport { EnvPluginContext, EnvPluginOptions } from \"../types/plugin\";\nimport { removeEnvPrefix } from \"./source-file-env\";\n\nasync function loadEnvFiles<TEnv extends DotenvParseOutput = DotenvParseOutput>(\n options: EnvPluginOptions,\n mode: string,\n cwd: string\n): Promise<TEnv> {\n let env = await loadEnvBase(cwd, mode);\n if (options.additionalFiles && options.additionalFiles?.length > 0) {\n const additionalEnvFiles = await Promise.all(\n options.additionalFiles.map(async additionalEnvFile =>\n loadEnvFileBase(additionalEnvFile, cwd)\n )\n );\n\n for (const additionalEnvFile of additionalEnvFiles) {\n env = defu(additionalEnvFile, env);\n }\n }\n\n return removeEnvPrefix(env) as TEnv;\n}\n\nasync function loadEnvDirectory<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(\n options: EnvPluginOptions,\n directory: string,\n mode: string,\n cacheDir: string,\n packageJson: PackageJson,\n workspaceConfig: WorkspaceConfig\n): Promise<TEnv> {\n const [envResult, c12Result] = await Promise.all([\n loadEnvFiles<TEnv>(options, mode, directory),\n loadConfig({\n cwd: directory,\n name: \"storm\",\n envName: mode,\n defaults: {\n NAME: packageJson.name?.replace(`@${workspaceConfig.namespace}/`, \"\"),\n MODE: mode,\n ORG: workspaceConfig.organization\n },\n globalRc: true,\n packageJson: true,\n dotenv: true,\n jitiOptions: {\n fsCache: joinPaths(cacheDir, \"jiti\"),\n moduleCache: true\n }\n })\n ]);\n\n return defu(envResult as any, c12Result.config, workspaceConfig) as TEnv;\n}\n\n/**\n * Retrieves various dotenv configuration parameters from the context.\n *\n * @param context - The context to retrieve the dotenv configuration from.\n * @param parsed - The parsed dotenv configuration.\n * @returns An object containing the dotenv configuration.\n */\nexport function loadEnvFromContext(\n context: EnvPluginContext,\n parsed: DotenvParseOutput\n) {\n return defu(\n {\n APP_NAME: kebabCase(\n context.config.name ||\n context.packageJson.name?.replace(\n `/${context.workspaceConfig.namespace}`,\n \"\"\n )\n ),\n APP_VERSION: context.packageJson.version,\n BUILD_ID: context.meta.buildId,\n BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),\n BUILD_CHECKSUM: context.meta.checksum,\n RELEASE_ID: context.meta.releaseId,\n RELEASE_TAG: `${kebabCase(context.config.name)}@${context.packageJson.version}`,\n DEFAULT_LOCALE: context.workspaceConfig.locale,\n DEFAULT_TIMEZONE: context.workspaceConfig.timezone,\n LOG_LEVEL:\n context.config.logLevel === \"trace\" ? \"debug\" : context.config.logLevel,\n ERROR_URL: context.workspaceConfig.error?.url,\n ORGANIZATION:\n context.config.organization ||\n (isSetObject(context.workspaceConfig.organization)\n ? context.workspaceConfig.organization.name\n : context.workspaceConfig.organization),\n PLATFORM: context.config.platform,\n MODE: context.config.mode,\n TEST: context.config.mode === \"test\",\n DEBUG: context.config.mode === \"development\",\n STACKTRACE: context.config.mode !== \"production\",\n ENVIRONMENT:\n !context.environment.name ||\n context.environment.name === DEFAULT_ENVIRONMENT\n ? context.config.mode\n : context.environment.name\n },\n isSetObject(context?.env?.types?.env)\n ? context.env.types.env?.getProperties().reduce(\n (ret, prop) => {\n ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();\n return ret;\n },\n {} as Record<string, any>\n )\n : {}\n );\n}\n\nexport async function loadEnv<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv> {\n const [project, workspace, config] = await Promise.all([\n loadEnvDirectory<TEnv>(\n options,\n context.config.root,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n options,\n context.workspaceConfig.workspaceRoot,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n options,\n context.envPaths.config,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n )\n ]);\n\n return defu(\n loadEnvFromContext(context, process.env),\n project,\n workspace,\n config\n ) as TEnv;\n}\n"],"mappings":";;;;;;;;;;;;AAMA,SAAS,aAAY,IAAI,MAAO;AAC/B,IAAI,SAAS;;;AA4Bd,eAAW,aAAgB,SAAA,MAAA,KAAA;CACzB,IAAI,MAAE,MAAM,UAAA,KAAA,KAAA;AACZ,KAAI,QAAC,mBAAA,QAAA,iBAAA,SAAA,GAAA;EACJ,MAAO,qBAAO,MAAA,QAAA,IAAA,QAAA,gBAAA,IAAA,aAAA,OAAA,sBAAA,YAAA,mBAAA,IAAA,EAAA;GAAA;GAAA;GAAA;GAAA,CAAA,CAAA,CAAA;AACf,OAAO,MAAG,qBAAuB,mBAC7B,OAAA,KAAQ,mBAAmB,IAAO;;AAGtC,QAAM,gBAAgB,IAAA;;AAExB,aAAK,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;CAEH,MAAM,CAAC,WAAM,aAAkB,MAAG,QAAA,IAAA,EAAA,aAAoB,IAAA,CAAA,CAAA,IAAA,CAAA,EAAA,aAAA,SAAA,MAAA,UAAA,GAAA,WAAA;EACpD,KAAK;EACL,MAAA;EACF,SAAA;;GAEA,MAAO,YAAe,MAAM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iBAAA;AACF,SAAO;IACL;EAAA;EAAS;EAAA;EAAA;EAAgB,CAAA,EAAA,EAAA,CAAA,GAAA,EAAA,CAAA;;AAE3B,mBAAE,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AACF,eAAa,QAAA,SAAA,SAAA;CACX,MAAE,CAAA,SAAA,WAAA,UAAA,MAAA,QAAA,IAAA;GAAA,iBAAA,IAAA,CAAA,CAAA,IAAA,CAAA,EAAA,iBAAA,SAAA,QAAA,OAAA,MAAA,QAAA,OAAA,MAAA,QAAA,WAAA,QAAA,aAAA,QAAA,gBAAA;GAAA,iBAAA,IAAA,CAAA,CAAA,IAAA,CAAA,EAAA,iBAAA,SAAA,QAAA,gBAAA,eAAA,QAAA,OAAA,MAAA,QAAA,WAAA,QAAA,aAAA,QAAA,gBAAA;GAAA,iBAAA,IAAA,CAAA,CAAA,IAAA,CAAA,EAAA,iBAAA,SAAA,QAAA,SAAA,QAAA,QAAA,OAAA,MAAA,QAAA,WAAA,QAAA,aAAA,QAAA,gBAAA;EAAA,CAAA;AACF,QAAI,KAAQ,mBAAW,SAAA,QAAA,IAAA,EAAA,SAAA,WAAA,OAAA;;AAEzB,QAAQ,SAAS;OAAC;CAAyB;OAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"load.mjs","names":[],"sources":["../../src/helpers/load.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n loadEnv as loadEnvBase,\n loadEnvFile as loadEnvFileBase\n} from \"@stryke/env/load-env\";\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { PackageJson } from \"@stryke/types/package-json\";\nimport { loadConfig } from \"c12\";\nimport defu from \"defu\";\nimport { WorkspaceConfig } from \"powerlines\";\nimport { DEFAULT_ENVIRONMENT } from \"powerlines/constants\";\nimport { EnvPluginContext, EnvPluginOptions } from \"../types/plugin\";\nimport { removeEnvPrefix } from \"./source-file-env\";\n\nasync function loadEnvFiles<TEnv extends DotenvParseOutput = DotenvParseOutput>(\n options: EnvPluginOptions,\n mode: string,\n cwd: string\n): Promise<TEnv> {\n let env = await loadEnvBase(cwd, mode);\n if (options.additionalFiles && options.additionalFiles?.length > 0) {\n const additionalEnvFiles = await Promise.all(\n options.additionalFiles.map(async additionalEnvFile =>\n loadEnvFileBase(additionalEnvFile, cwd)\n )\n );\n\n for (const additionalEnvFile of additionalEnvFiles) {\n env = defu(additionalEnvFile, env);\n }\n }\n\n return removeEnvPrefix(env) as TEnv;\n}\n\nasync function loadEnvDirectory<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(\n options: EnvPluginOptions,\n directory: string,\n mode: string,\n cacheDir: string,\n packageJson: PackageJson,\n workspaceConfig: WorkspaceConfig\n): Promise<TEnv> {\n const [envResult, c12Result] = await Promise.all([\n loadEnvFiles<TEnv>(options, mode, directory),\n loadConfig({\n cwd: directory,\n name: \"storm\",\n envName: mode,\n defaults: {\n NAME: packageJson.name?.replace(`@${workspaceConfig.namespace}/`, \"\"),\n MODE: mode,\n ORG: workspaceConfig.organization\n },\n globalRc: true,\n packageJson: true,\n dotenv: true,\n jitiOptions: {\n fsCache: joinPaths(cacheDir, \"jiti\"),\n moduleCache: true\n }\n })\n ]);\n\n return defu(envResult as any, c12Result.config, workspaceConfig) as TEnv;\n}\n\n/**\n * Retrieves various dotenv configuration parameters from the context.\n *\n * @param context - The context to retrieve the dotenv configuration from.\n * @param parsed - The parsed dotenv configuration.\n * @returns An object containing the dotenv configuration.\n */\nexport function loadEnvFromContext(\n context: EnvPluginContext,\n parsed: DotenvParseOutput\n) {\n return defu(\n {\n APP_NAME: kebabCase(\n context.config.name ||\n context.packageJson.name?.replace(\n `/${context.workspaceConfig.namespace}`,\n \"\"\n )\n ),\n APP_VERSION: context.packageJson.version,\n BUILD_ID: context.meta.buildId,\n BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),\n BUILD_CHECKSUM: context.meta.checksum,\n RELEASE_ID: context.meta.releaseId,\n RELEASE_TAG: `${kebabCase(context.config.name)}@${context.packageJson.version}`,\n DEFAULT_LOCALE: context.workspaceConfig.locale,\n DEFAULT_TIMEZONE: context.workspaceConfig.timezone,\n LOG_LEVEL:\n context.config.logLevel === \"trace\" ? \"debug\" : context.config.logLevel,\n ERROR_URL: context.workspaceConfig.error?.url,\n ORGANIZATION:\n context.config.organization ||\n (isSetObject(context.workspaceConfig.organization)\n ? context.workspaceConfig.organization.name\n : context.workspaceConfig.organization),\n PLATFORM: context.config.platform,\n MODE: context.config.mode,\n TEST: context.config.mode === \"test\",\n DEBUG: context.config.mode === \"development\",\n STACKTRACE: context.config.mode !== \"production\",\n ENVIRONMENT:\n !context.environment.name ||\n context.environment.name === DEFAULT_ENVIRONMENT\n ? context.config.mode\n : context.environment.name\n },\n isSetObject(context?.env?.types?.env)\n ? context.env.types.env?.getProperties().reduce(\n (ret, prop) => {\n ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();\n return ret;\n },\n {} as Record<string, any>\n )\n : {}\n );\n}\n\nexport async function loadEnv<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv> {\n const [project, workspace, config] = await Promise.all([\n loadEnvDirectory<TEnv>(\n options,\n context.config.root,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n options,\n context.workspaceConfig.workspaceRoot,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n options,\n context.envPaths.config,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n )\n ]);\n\n return defu(\n loadEnvFromContext(context, process.env),\n project,\n workspace,\n config\n ) as TEnv;\n}\n"],"mappings":";;;;;;;;;;;;AAMA,SAAS,aAAY,IAAI,MAAO;AAC5B,IAAC,SAAU;;;AA4Bf,eAAW,aAAgB,SAAA,MAAA,KAAA;CACzB,IAAM,MAAM,MAAA,UAAA,KAAA,KAAA;AACZ,KAAK,QAAA,mBAAA,QAAA,iBAAA,SAAA,GAAA;EACJ,MAAQ,qBAAM,MAAA,QAAA,IAAA,QAAA,gBAAA,IAAA,aAAA,OAAA,sBAAA,YAAA,mBAAA,IAAA,EAAA;GAAA;GAAA;GAAA;GAAA,CAAA,CAAA,CAAA;AACX,OAAM,MAAM,qBAAsB,mBAClC,OAAQ,KAAA,mBAA2B,IAAA;;AAGrC,QAAI,gBAAgB,IAAA;;AAExB,aAAK,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;CAED,MAAK,CAAA,WAAM,aAAoB,MAAC,QAAA,IAAA,EAC3B,aAAQ,IAAA,CAAA,CAAA,IAAA,CAAA,EAAkB,aAAK,SAAA,MAAA,UAAA,GACpC,WAAA;EACF,KAAA;;EAEO,SAAA;EACT,UAAA;;GAEe,MAAA;GACA,KAAA,gBAAoB;GAClC;EACU,UAAA;EACC,aAAO;EACX,QAAM;EACF,aAAM;GACH,SAAA,UAAW,UAAA,OAAA;GACxB,aAAiB;GACR;EACF,CAAA,CACL,CAAA;AACA,QAAA,KAAW,WAAA,UAAA,QAAA,gBAAA;;AAEf,iBAAa,SAAM;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;AAQnB,SAAM,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B,SAAQ,QAAA,OAAY,MAAS,QAAA,OAAA,MAAA,QAAA,WAAA,QAAA,aAAA,QAAA,gBAAA;GAC/E,iBAAgB,IAAQ,CAAA,CAAA,IAAA,CAAA,EAAA,iBAAsB,SAAA,QAAA,gBAAA,eAAA,QAAA,OAAA,MAAA,QAAA,WAAA,QAAA,aAAA,QAAA,gBAAA;GAC9C,iBAAkB,IAAA,CAAO,CAAC,IAAA,CAAA,EAAA,iBAAwB,SAAA,QAAA,SAAA,QAAA,QAAA,OAAA,MAAA,QAAA,WAAA,QAAA,aAAA,QAAA,gBAAA;EACnD,CAAC;AACF,QAAI,KAAQ,mBAAmB,SAAS,QAAQ,IAAI,EAAA,SAAQ,WAAO,OAAQ;;AAE/E,QAAM,SAAA;OAAY;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"persistence.mjs","names":[],"sources":["../../src/helpers/persistence.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { convertFromCapnp, convertToCapnp } from \"@powerlines/deepkit/capnp\";\nimport { getReflectionsPath } from \"@powerlines/deepkit/resolve-reflections\";\nimport { SerializedTypes } from \"@powerlines/deepkit/schemas/reflection\";\nimport { Reflection } from \"@powerlines/deepkit/types\";\nimport {\n deserializeType,\n ReflectionClass,\n ReflectionKind,\n resolveClassType\n} from \"@powerlines/deepkit/vendor/type\";\nimport * as capnp from \"@stryke/capnp\";\nimport {\n readFileBuffer,\n writeFileBuffer,\n writeFileBufferSync\n} from \"@stryke/fs/buffer\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isEmptyObject } from \"@stryke/type-checks/is-empty-object\";\nimport type { TypeDefinition } from \"@stryke/types/configuration\";\nimport { existsSync } from \"node:fs\";\nimport { Context, UnresolvedContext } from \"powerlines\";\nimport {\n EnvPluginContext,\n EnvPluginResolvedConfig,\n EnvType\n} from \"../types/plugin\";\nimport { createEnvReflection } from \"./reflect\";\n\n/**\n * Resolves the runtime type definition file for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The runtime type definition file for the environment variables.\n */\nexport async function resolveRuntimeTypeFile(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<string> {\n const resolved = await context.fs.resolve(\n \"@powerlines/plugin-env/types/runtime\"\n );\n if (!resolved) {\n throw new Error(\n `Failed to resolve the runtime type definition file for the environment variables. Please ensure that the \"@powerlines/plugin-env\" package is installed.`\n );\n }\n\n return resolved;\n}\n\n/**\n * Gets the default type definition for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment variables.\n */\nexport async function getEnvDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"EnvInterface\"\n };\n}\n\n/** Gets the default type definition for the environment secrets.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment secrets.\n */\nexport async function getSecretsDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"SecretsInterface\"\n };\n}\n\n/**\n * Gets the path to the environment type reflections.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The path to the environment type reflections.\n */\nexport function getEnvTypeReflectionsPath(\n context: Context<EnvPluginResolvedConfig>,\n name: EnvType = \"env\"\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}-types.bin`);\n}\n\n/**\n * Reads the environment type reflection from the file system.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The environment type reflection.\n */\nexport async function readEnvTypeReflection(\n context: EnvPluginContext,\n name: EnvType = \"env\"\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvTypeReflectionsPath(context, name);\n if (!existsSync(filePath)) {\n if (!context.env.types.env || isEmptyObject(context.env.types.env)) {\n const reflection = createEnvReflection(context) as Reflection;\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.types.env = reflection;\n await writeEnvTypeReflection(context, context.env.types.env, name);\n }\n\n return context.env.types.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.types[name] = reflection;\n context.env.types[name].messageRoot = messageRoot;\n context.env.types[name].dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment type reflection to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The environment type reflection to write.\n * @param name - The name of the type reflections.\n */\nexport async function writeEnvTypeReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvTypeReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\nexport function getEnvReflectionsPath(\n context: EnvPluginContext,\n name: EnvType\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}.bin`);\n}\n\n/**\n * Reads the environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readEnvReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"env\");\n if (!existsSync(filePath)) {\n if (!context.env.types.env) {\n context.env.types.env = await readEnvTypeReflection(context, \"env\");\n }\n\n if (!context.env.used.env || isEmptyObject(context.env.used.env)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.env\n }) as Reflection;\n reflection.name = \"Env\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.env = reflection;\n await writeEnvReflection(context, context.env.used.env, \"env\");\n }\n\n return context.env.used.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.env = reflection;\n context.env.used.env.messageRoot = messageRoot;\n context.env.used.env.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Reads the secret environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readSecretsReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"secrets\");\n if (!existsSync(filePath)) {\n if (!context.env.types.secrets) {\n context.env.types.secrets = await readEnvTypeReflection(\n context,\n \"secrets\"\n );\n }\n\n if (!context.env.used.secrets || isEmptyObject(context.env.used.secrets)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.secrets\n }) as Reflection;\n reflection.name = \"Secrets\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.secrets = reflection;\n await writeEnvReflection(context, context.env.used.secrets, \"secrets\");\n }\n\n return context.env.used.secrets;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.secrets = reflection;\n context.env.used.secrets.messageRoot = messageRoot;\n context.env.used.secrets.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport async function writeEnvReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport function writeEnvReflectionSync(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n writeFileBufferSync(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA,eAAiB,uBAAO,SAAA;CACxB,MAAQ,WAAC,MAAA,QAAsB,GAAK,QAAG,uCAAQ;eAE7C,OAAA,IAAA,MAAA,0JAAA;AAED,QAAA;;AAED,uBAAuB,SAAM;OAAU;OAA0B;CAAS;CAAA;CAAA;CAAA;CAAA;;;;;;;A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SAAA,gBAAA,CAC8B,WAAO,WAAA,OAAA,CAAA;AACpC,qBAAc,sBAA2B,SAAA,KAAA,EAAA,QAAA,eAAA,CAAA;;AAE3C,uBAAsB,SAAA;OAAA;CAAqB;OAAA;CAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"persistence.mjs","names":[],"sources":["../../src/helpers/persistence.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { convertFromCapnp, convertToCapnp } from \"@powerlines/deepkit/capnp\";\nimport { getReflectionsPath } from \"@powerlines/deepkit/resolve-reflections\";\nimport { SerializedTypes } from \"@powerlines/deepkit/schemas/reflection\";\nimport { Reflection } from \"@powerlines/deepkit/types\";\nimport {\n deserializeType,\n ReflectionClass,\n ReflectionKind,\n resolveClassType\n} from \"@powerlines/deepkit/vendor/type\";\nimport * as capnp from \"@stryke/capnp\";\nimport {\n readFileBuffer,\n writeFileBuffer,\n writeFileBufferSync\n} from \"@stryke/fs/buffer\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isEmptyObject } from \"@stryke/type-checks/is-empty-object\";\nimport type { TypeDefinition } from \"@stryke/types/configuration\";\nimport { existsSync } from \"node:fs\";\nimport { Context, UnresolvedContext } from \"powerlines\";\nimport {\n EnvPluginContext,\n EnvPluginResolvedConfig,\n EnvType\n} from \"../types/plugin\";\nimport { createEnvReflection } from \"./reflect\";\n\n/**\n * Resolves the runtime type definition file for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The runtime type definition file for the environment variables.\n */\nexport async function resolveRuntimeTypeFile(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<string> {\n const resolved = await context.fs.resolve(\n \"@powerlines/plugin-env/types/runtime\"\n );\n if (!resolved) {\n throw new Error(\n `Failed to resolve the runtime type definition file for the environment variables. Please ensure that the \"@powerlines/plugin-env\" package is installed.`\n );\n }\n\n return resolved;\n}\n\n/**\n * Gets the default type definition for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment variables.\n */\nexport async function getEnvDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"EnvInterface\"\n };\n}\n\n/** Gets the default type definition for the environment secrets.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment secrets.\n */\nexport async function getSecretsDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"SecretsInterface\"\n };\n}\n\n/**\n * Gets the path to the environment type reflections.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The path to the environment type reflections.\n */\nexport function getEnvTypeReflectionsPath(\n context: Context<EnvPluginResolvedConfig>,\n name: EnvType = \"env\"\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}-types.bin`);\n}\n\n/**\n * Reads the environment type reflection from the file system.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The environment type reflection.\n */\nexport async function readEnvTypeReflection(\n context: EnvPluginContext,\n name: EnvType = \"env\"\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvTypeReflectionsPath(context, name);\n if (!existsSync(filePath)) {\n if (!context.env.types.env || isEmptyObject(context.env.types.env)) {\n const reflection = createEnvReflection(context) as Reflection;\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.types.env = reflection;\n await writeEnvTypeReflection(context, context.env.types.env, name);\n }\n\n return context.env.types.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.types[name] = reflection;\n context.env.types[name].messageRoot = messageRoot;\n context.env.types[name].dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment type reflection to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The environment type reflection to write.\n * @param name - The name of the type reflections.\n */\nexport async function writeEnvTypeReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvTypeReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\nexport function getEnvReflectionsPath(\n context: EnvPluginContext,\n name: EnvType\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}.bin`);\n}\n\n/**\n * Reads the environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readEnvReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"env\");\n if (!existsSync(filePath)) {\n if (!context.env.types.env) {\n context.env.types.env = await readEnvTypeReflection(context, \"env\");\n }\n\n if (!context.env.used.env || isEmptyObject(context.env.used.env)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.env\n }) as Reflection;\n reflection.name = \"Env\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.env = reflection;\n await writeEnvReflection(context, context.env.used.env, \"env\");\n }\n\n return context.env.used.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.env = reflection;\n context.env.used.env.messageRoot = messageRoot;\n context.env.used.env.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Reads the secret environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readSecretsReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"secrets\");\n if (!existsSync(filePath)) {\n if (!context.env.types.secrets) {\n context.env.types.secrets = await readEnvTypeReflection(\n context,\n \"secrets\"\n );\n }\n\n if (!context.env.used.secrets || isEmptyObject(context.env.used.secrets)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.secrets\n }) as Reflection;\n reflection.name = \"Secrets\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.secrets = reflection;\n await writeEnvReflection(context, context.env.used.secrets, \"secrets\");\n }\n\n return context.env.used.secrets;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.secrets = reflection;\n context.env.used.secrets.messageRoot = messageRoot;\n context.env.used.secrets.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport async function writeEnvReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport function writeEnvReflectionSync(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n writeFileBufferSync(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA,eAAiB,uBAAO,SAAA;CACxB,MAAS,WAAA,MAAA,QAA0B,GAAG,QAAQ,uCAAC;eAE7C,OAAA,IAAA,MAAA,0JAAA;AAED,QAAA;;AAED,uBAAuB,SAAM;OAAU;OAA0B;CAAS;CAAA;CAAA;CAAA;CAAA;;;;;;;AAO1E,eAAG,4BAAA,SAAA;AACC,QAAG;EACH,MAAU,MAAK,uBAAA,QAAA;EACZ,MAAO;EACT;;;;;;;;;;;;;;;AAQL,eAAC,gCAAA,SAAA;AACG,QAAM;EACN,MAAQ,MAAI,uBAA2B,QAAK;EAC9C,MAAA;EACF;;AAEA,gCAA2B,SAAA;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;AAQ3B,SAAC,0BAAA,SAAA,OAAA,OAAA;AACG,QAAM,UAAU,mBAAkB,QAAA,EAAA,OAA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"reflect.mjs","names":[],"sources":["../../src/helpers/reflect.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { reflectType } from \"@powerlines/deepkit/reflect-type\";\nimport {\n merge,\n ReflectionClass,\n ReflectionKind,\n resolveClassType,\n TypeClass,\n TypeObjectLiteral\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext } from \"../types/plugin\";\nimport { EnvInterface, SecretsInterface } from \"../types/runtime\";\nimport {\n getEnvDefaultTypeDefinition,\n getSecretsDefaultTypeDefinition,\n readEnvTypeReflection,\n readSecretsReflection\n} from \"./persistence\";\n\nexport function mergeEnvReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createEnvReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport function mergeSecretsReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createSecretsReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport interface CreateEnvReflectionOptions {\n type?: TypeObjectLiteral | TypeClass;\n superReflection?: ReflectionClass<any>;\n}\n\nexport class BaseEnv implements EnvInterface {\n APP_NAME!: string;\n\n APP_VERSION!: string;\n\n BUILD_ID!: string;\n\n BUILD_TIMESTAMP!: string;\n\n BUILD_CHECKSUM!: string;\n\n RELEASE_ID!: string;\n\n RELEASE_TAG!: string;\n\n ORGANIZATION!: string;\n\n PLATFORM: \"node\" | \"browser\" | \"neutral\" = \"neutral\";\n\n MODE: \"development\" | \"test\" | \"production\" = \"production\";\n\n ENVIRONMENT!: string;\n\n DEBUG: boolean = false;\n\n TEST: boolean = false;\n\n MINIMAL: boolean = false;\n\n NO_COLOR: boolean = false;\n\n FORCE_COLOR: number | boolean = false;\n\n FORCE_HYPERLINK: number | boolean = false;\n\n STACKTRACE: boolean = false;\n\n INCLUDE_ERROR_DATA: boolean = false;\n\n ERROR_URL!: string;\n\n DEFAULT_TIMEZONE!: string;\n\n DEFAULT_LOCALE!: string;\n\n CI: boolean = false;\n}\n\nexport class BaseSecrets implements SecretsInterface {\n ENCRYPTION_KEY!: string;\n}\n\nexport function createEnvReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base environment configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseEnv,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"EnvInterface\",\n description: `The environment configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Env\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `A schema describing the list of available environment variables that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Env\";\n\n return result;\n}\n\nexport function createSecretsReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base secrets configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseSecrets,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"SecretsInterface\",\n description: `The secrets configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Secrets\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `A schema describing the list of available environment secrets that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Secrets\";\n\n return result;\n}\n\n/**\n * Reflects the environment configuration type definition from the provided file and name, and merges it with the default environment configuration reflection and the currently used environment configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the environment configuration type definition from\n * @param name - The name of the type definition to reflect the environment configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the environment configuration type definition, merged with the default environment configuration reflection and the currently used environment configuration reflection. The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n */\nexport async function reflectEnv(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await reflectType(context, {\n file: !isParentPath(file, context.workspaceConfig.workspaceRoot)\n ? joinPaths(context.workspaceConfig.workspaceRoot, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeEnvReflections(\n context,\n [\n await readEnvTypeReflection(context, \"env\"),\n config,\n resolveClassType(\n await reflectType(context, await getEnvDefaultTypeDefinition(context))\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n\n/**\n * Reflects the secrets configuration type definition from the provided file and name, and merges it with the default secrets configuration reflection and the currently used secrets configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the secrets configuration type definition from\n * @param name - The name of the type definition to reflect the secrets configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the secrets configuration type definition, merged with the default secrets configuration reflection and the currently used secrets configuration reflection. The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n */\nexport async function reflectSecrets(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await reflectType(context, {\n file: !isParentPath(file, context.workspaceConfig.workspaceRoot)\n ? joinPaths(context.workspaceConfig.workspaceRoot, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeSecretsReflections(\n context,\n [\n await readSecretsReflection(context),\n config,\n resolveClassType(\n await reflectType(\n context,\n await getSecretsDefaultTypeDefinition(context)\n )\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n"],"mappings":";;;;;;;;;;AAUA,SAAC,aAAqB,IAAI,MAAM;AAC/B,IAAA,SAAa;AACb,QAAQ;;AAyBT,SAAU,oBAAY,SAAA,aAAA;AAIpB,uCAFF,MAAO,MAAS,YAAA,IAAA,cAAmB,eAAA,WAAA,MAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,EACjC,CAAA;;AAGF,oBAAoB,SAAC;OAAA;CAA6B;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;AAClD,SAAgB,wBAAgB,SAAc,aAAgB;AAI9D,QAHI,wBAAA,SAAA;;;;OAEF,CAAA;;AAGF,wBAAgB,SAAA;OAAuB;CAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;AACvC,MAAE,gCAAyB;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAA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AAA,MAAA,YAAA,SAAA,MAAA,gCAAA,QAAA,CAAA,CAAA;EAAA,CAAA,OAAA,QAAA,CAAA;;AAET,eAAK,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"reflect.mjs","names":[],"sources":["../../src/helpers/reflect.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { reflectType } from \"@powerlines/deepkit/reflect-type\";\nimport {\n merge,\n ReflectionClass,\n ReflectionKind,\n resolveClassType,\n TypeClass,\n TypeObjectLiteral\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext } from \"../types/plugin\";\nimport { EnvInterface, SecretsInterface } from \"../types/runtime\";\nimport {\n getEnvDefaultTypeDefinition,\n getSecretsDefaultTypeDefinition,\n readEnvTypeReflection,\n readSecretsReflection\n} from \"./persistence\";\n\nexport function mergeEnvReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createEnvReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport function mergeSecretsReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createSecretsReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport interface CreateEnvReflectionOptions {\n type?: TypeObjectLiteral | TypeClass;\n superReflection?: ReflectionClass<any>;\n}\n\nexport class BaseEnv implements EnvInterface {\n APP_NAME!: string;\n\n APP_VERSION!: string;\n\n BUILD_ID!: string;\n\n BUILD_TIMESTAMP!: string;\n\n BUILD_CHECKSUM!: string;\n\n RELEASE_ID!: string;\n\n RELEASE_TAG!: string;\n\n ORGANIZATION!: string;\n\n PLATFORM: \"node\" | \"browser\" | \"neutral\" = \"neutral\";\n\n MODE: \"development\" | \"test\" | \"production\" = \"production\";\n\n ENVIRONMENT!: string;\n\n DEBUG: boolean = false;\n\n TEST: boolean = false;\n\n MINIMAL: boolean = false;\n\n NO_COLOR: boolean = false;\n\n FORCE_COLOR: number | boolean = false;\n\n FORCE_HYPERLINK: number | boolean = false;\n\n STACKTRACE: boolean = false;\n\n INCLUDE_ERROR_DATA: boolean = false;\n\n ERROR_URL!: string;\n\n DEFAULT_TIMEZONE!: string;\n\n DEFAULT_LOCALE!: string;\n\n CI: boolean = false;\n}\n\nexport class BaseSecrets implements SecretsInterface {\n ENCRYPTION_KEY!: string;\n}\n\nexport function createEnvReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base environment configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseEnv,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"EnvInterface\",\n description: `The environment configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Env\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `A schema describing the list of available environment variables that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Env\";\n\n return result;\n}\n\nexport function createSecretsReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base secrets configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseSecrets,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"SecretsInterface\",\n description: `The secrets configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Secrets\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `A schema describing the list of available environment secrets that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Secrets\";\n\n return result;\n}\n\n/**\n * Reflects the environment configuration type definition from the provided file and name, and merges it with the default environment configuration reflection and the currently used environment configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the environment configuration type definition from\n * @param name - The name of the type definition to reflect the environment configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the environment configuration type definition, merged with the default environment configuration reflection and the currently used environment configuration reflection. The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n */\nexport async function reflectEnv(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await reflectType(context, {\n file: !isParentPath(file, context.workspaceConfig.workspaceRoot)\n ? joinPaths(context.workspaceConfig.workspaceRoot, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeEnvReflections(\n context,\n [\n await readEnvTypeReflection(context, \"env\"),\n config,\n resolveClassType(\n await reflectType(context, await getEnvDefaultTypeDefinition(context))\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n\n/**\n * Reflects the secrets configuration type definition from the provided file and name, and merges it with the default secrets configuration reflection and the currently used secrets configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the secrets configuration type definition from\n * @param name - The name of the type definition to reflect the secrets configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the secrets configuration type definition, merged with the default secrets configuration reflection and the currently used secrets configuration reflection. The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n */\nexport async function reflectSecrets(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await reflectType(context, {\n file: !isParentPath(file, context.workspaceConfig.workspaceRoot)\n ? joinPaths(context.workspaceConfig.workspaceRoot, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeSecretsReflections(\n context,\n [\n await readSecretsReflection(context),\n config,\n resolveClassType(\n await reflectType(\n context,\n await getSecretsDefaultTypeDefinition(context)\n )\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n"],"mappings":";;;;;;;;;;AAUA,SAAC,aAAqB,IAAI,MAAM;AAC/B,IAAA,SAAe;AACf,QAAU;;AAyBX,SAAU,oBAAY,SAAA,aAAA;AAIpB,uCAFK,MAAA,MAAS,YAAA,IAAmB,cAAA,eAAA,WAAA,MAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,EACjC,CAAA;;AAGF,oBAAoB,SAAC;OAAA;CAA6B;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;AAClD,SAAgB,wBAAgB,SAAc,aAAgB;AAI9D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,gBAAA,cAAA,GACW,UAAQ,QAAA,gBAAA,eAAA,KAAA;EAEjB;EACJ,CAAA,CACoC;AAEpC,QAAE,wBAAuB,SAAe;EACpC,MAAA,sBAAe,QAAA;EACf;EACA,iBAAgB,MAAA,YAAA,SAAA,MAAA,gCAAA,QAAA,CAAA,CAAA;EACnB,CAAC,OAAG,QAAA,CAAA;;AAET,eAAK,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"source-file-env.mjs","names":[],"sources":["../../src/helpers/source-file-env.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { ENV_PREFIXES } from \"@stryke/env/types\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\n\ntype TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;\n\nexport function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(\n env: TEnv\n): TReturned<TEnv> {\n if (isString(env)) {\n let name: string = ENV_PREFIXES.reduce((ret, prefix) => {\n if (ret.startsWith(prefix)) {\n ret = ret.slice(prefix.length);\n }\n\n return ret;\n }, env.toUpperCase());\n\n while (name.startsWith(\"_\")) {\n name = name.slice(1);\n }\n\n return name as TReturned<TEnv>;\n }\n\n return Object.keys(env).reduce((ret, key) => {\n const name = removeEnvPrefix(key);\n if (name) {\n (ret as DotenvParseOutput)[name] = env[key];\n }\n\n return ret;\n }, {} as TReturned<TEnv>);\n}\n\nexport function formatEnvField(key: string): string {\n return camelCase(removeEnvPrefix(key));\n}\n"],"mappings":";;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE9B,QAAO;;AAKT,MAAK,eAAe;CAAE;CAAQ;CAAC;CAAoC;;AAElE,KAAA,SAAc,IAAI,EAAE;EACpB,IAAA,OAAc,aAAY,OAAQ,cAAW,KAAM,WAAS;AAC5D,OAAA,IAAa,WAAW,OAAO,CACxB,OAAM,IAAI,MAAM,OAAG,OAAQ;AAE7B,UAAO;;;;;;;AAET,SAAO,KAAK,WAAW,IAAI;AAG/B,SAAS;;AAET,QAAS,OAAA,KAAW,IAAK,CAAC,OAAO,cAAa,KAAG,QAAO;;AAEpD,MAAC;AAGH,SAAK;IACJ;EAAA;EAAU;EAAM;EAAA;EAAA,CAAA,EAAA,EAAA,CAAA;;AAEnB,gBAAc,SAAS;CAAA;OAAa;CAAa;CAAW;CAAA;AAC5D,SAAc,eAAiB,KAAG;AAChC,QAAM,UAAU,gBAAa,IAAO,CAAA"}
1
+ {"version":3,"file":"source-file-env.mjs","names":[],"sources":["../../src/helpers/source-file-env.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { ENV_PREFIXES } from \"@stryke/env/types\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\n\ntype TReturned<TEnv> = TEnv extends string ? string : DotenvParseOutput;\n\nexport function removeEnvPrefix<TEnv extends DotenvParseOutput | string>(\n env: TEnv\n): TReturned<TEnv> {\n if (isString(env)) {\n let name: string = ENV_PREFIXES.reduce((ret, prefix) => {\n if (ret.startsWith(prefix)) {\n ret = ret.slice(prefix.length);\n }\n\n return ret;\n }, env.toUpperCase());\n\n while (name.startsWith(\"_\")) {\n name = name.slice(1);\n }\n\n return name as TReturned<TEnv>;\n }\n\n return Object.keys(env).reduce((ret, key) => {\n const name = removeEnvPrefix(key);\n if (name) {\n (ret as DotenvParseOutput)[name] = env[key];\n }\n\n return ret;\n }, {} as TReturned<TEnv>);\n}\n\nexport function formatEnvField(key: string): string {\n return camelCase(removeEnvPrefix(key));\n}\n"],"mappings":";;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE5B,QAAO;;AAKX,MAAK,eAAe;CAAE;CAAQ;CAAC;CAAoC;;AAElE,KAAO,SAAS,IAAI,EAAE;EACtB,IAAW,OAAO,aAAa,OAAG,cAAiB,KAAA,WAAS;AAC5D,OAAe,IAAI,WAAO,OAAQ,CACnB,OAAM,IAAI,MAAM,OAAG,OAAA;AAE7B,UAAQ;;;;;;;AAEN,SAAO,KAAK,WAAW,IAAI;AAG3B,SAAC;;AAET,QAAS,OAAS,KAAE,IAAO,CAAA,OAAO,cAAe,KAAA,QAAO;;AAEnD,MAAA;AAGE,SAAA;IACJ;EAAA;EAAU;EAAM;EAAA;EAAA,CAAA,EAAA,EAAA,CAAA;;AAEnB,gBAAc,SAAS;CAAA;OAAa;CAAa;CAAW;CAAA;AAC5D,SAAc,eAAiB,KAAG;AAC9B,QAAO,UAAO,gBAAmB,IAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"template-helpers.mjs","names":[],"sources":["../../src/helpers/template-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext, EnvType } from \"../types/plugin\";\nimport { readEnvTypeReflection } from \"./persistence\";\n\n/**\n * Creates the reflection data used when generating runtime template files.\n *\n * @param context - The context for the configuration plugin.\n * @param name - The name of the configuration template.\n * @returns The reflection for the specified configuration template.\n */\nexport async function createTemplateReflection(\n context: EnvPluginContext,\n name?: EnvType\n): Promise<ReflectionClass<any>> {\n const reflection = await readEnvTypeReflection(context, name);\n\n reflection.getProperties().forEach(prop => {\n const aliases = prop.getAlias();\n aliases.filter(Boolean).forEach(alias => {\n reflection.addProperty({\n name: alias,\n optional: prop.isOptional() ? true : undefined,\n readonly: prop.isReadonly() ? true : undefined,\n description: prop.getDescription(),\n visibility: prop.getVisibility(),\n type: prop.getType(),\n default: prop.getDefaultValue(),\n tags: {\n hidden: prop.isHidden(),\n ignore: prop.isIgnored(),\n internal: prop.isInternal(),\n alias: prop\n .getAlias()\n .filter(a => a !== alias)\n .concat(prop.name),\n title: prop.getTitle() || titleCase(prop.name),\n readonly: prop.isReadonly(),\n permission: prop.getPermission(),\n domain: prop.getDomain()\n }\n });\n });\n });\n\n return reflection;\n}\n"],"mappings":";;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;AAC/B,IAAG,SAAU;AACb,QAAQ;;;;;;;;;;CA8BP,MAAA,aAAW,MAAc,sBAAkB,SAAA,KAAA;AAC3C,YAAQ,eAAe,CAAA,QAAU,cAAA,SAAA;AAE/B,EADe,KAAA,UAAgB,CAC7B,OAAW,QAAA,CAAW,QAAC,cAAA,UAAA;AACvB,cAAQ,YAAK;IACX,MAAA;IACA,UAAU,KAAK,YAAY,GAAG,OAAO;IACrC,UAAA,KAAa,YAAK,GAAA,OAAgB;IAClC,aAAY,KAAK,gBAAe;IAChC,YAAW,KAAA,eAAS;IACpB,MAAA,KAAS,SAAK;IACd,SAAM,KAAA,iBAAA;IACN,MAAE;KACA,QAAQ,KAAK,UAAU;KACvB,QAAQ,KAAE,WAAK;KACf,UAAO,KAAA,YAAA;KACP,OAAG,KAAS,UAAA,CAAA,OAAA,cAAA,MAAA,MAAA,OAAA;MAAA;MAAA;MAAA;MAAA,CAAA,CAAA,CAAA,OAAA,KAAA,KAAA;KACZ,OAAG,KAAS,UAAS,IAAK,UAAA,KAAA,KAAA;KAC1B,UAAU,KAAK,YAAK;KACpB,YAAY,KAAA,eAAc;KAC1B,QAAQ,KAAE,WAAK;KAChB;IACF,CAAC;KACD;GAAC;GAAA;GAAA;GAAA,CAAA,CAAA;IACH;EAAC;EAAE;EAAA;EAAA,CAAA,CAAA;AACN,QAAI"}
1
+ {"version":3,"file":"template-helpers.mjs","names":[],"sources":["../../src/helpers/template-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext, EnvType } from \"../types/plugin\";\nimport { readEnvTypeReflection } from \"./persistence\";\n\n/**\n * Creates the reflection data used when generating runtime template files.\n *\n * @param context - The context for the configuration plugin.\n * @param name - The name of the configuration template.\n * @returns The reflection for the specified configuration template.\n */\nexport async function createTemplateReflection(\n context: EnvPluginContext,\n name?: EnvType\n): Promise<ReflectionClass<any>> {\n const reflection = await readEnvTypeReflection(context, name);\n\n reflection.getProperties().forEach(prop => {\n const aliases = prop.getAlias();\n aliases.filter(Boolean).forEach(alias => {\n reflection.addProperty({\n name: alias,\n optional: prop.isOptional() ? true : undefined,\n readonly: prop.isReadonly() ? true : undefined,\n description: prop.getDescription(),\n visibility: prop.getVisibility(),\n type: prop.getType(),\n default: prop.getDefaultValue(),\n tags: {\n hidden: prop.isHidden(),\n ignore: prop.isIgnored(),\n internal: prop.isInternal(),\n alias: prop\n .getAlias()\n .filter(a => a !== alias)\n .concat(prop.name),\n title: prop.getTitle() || titleCase(prop.name),\n readonly: prop.isReadonly(),\n permission: prop.getPermission(),\n domain: prop.getDomain()\n }\n });\n });\n });\n\n return reflection;\n}\n"],"mappings":";;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;AAC5B,IAAA,SAAW;AACd,QAAS;;;;;;;;;;CA8BR,MAAA,aAAW,MAAgB,sBAAgB,SAAA,KAAA;AACzC,YAAM,eAAe,CAAA,QAAU,cAAA,SAAA;AAE7B,EADa,KAAS,UAAQ,CACpB,OAAC,QAAY,CAAA,QAAA,cAAA,UAAA;AACjB,cAAO,YAAA;IACH,MAAM;IACN,UAAO,KAAA,YAAoB,GAAE,OAAA;IACrC,UAAkB,KAAA,YAAgB,GAAA,OAAA;IAClC,aAAiB,KAAA,gBAAe;IAC1B,YAAc,KAAA,eAAA;IACZ,MAAM,KAAA,SAAA;IACR,SAAA,KAAA,iBAAA;IACE,MAAM;KACJ,QAAK,KAAU,UAAC;KACd,QAAK,KAAA,WAAY;KACpB,UAAA,KAAA,YAAA;KACJ,OAAS,KACG,UAAM,CACN,OAAK,cAAA,MAAA,MAAA,OAAA;MAAA;MAAA;MAAA;MAAA,CAAA,CAAA,CACR,OAAU,KAAI,KAAA;KAChB,OAAK,KAAA,UAAY,IAAA,UAAA,KAAA,KAAA;KACjB,UAAO,KAAA,YAAe;KACxB,YAAc,KAAC,eAAA;KACzB,QAAA,KAAA,WAAA;KACA;IACF,CAAA;KACF;GAAA;GAAA;GAAA;GAAA,CAAA,CAAA;;;;;;AAEF,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.mjs","names":[],"sources":["../../src/types/runtime.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * The base environment configuration used by Powerlines applications\n *\n * @remarks\n * This interface is used to define the environment variables, configuration options, and runtime settings used by applications. It is used to provide type safety, autocompletion, and default values for the environment variables. The comments of each variable are used to provide documentation descriptions when running the \\`powerlines docs\\` command.\n *\n * @categoryDescription Platform\n * The name of the platform the configuration parameter is intended for use in.\n *\n * @showCategories\n */\nexport interface EnvInterface {\n /**\n * The name of the application.\n *\n * @readonly\n * @category neutral\n */\n readonly APP_NAME: string;\n\n /**\n * The version of the application.\n *\n * @defaultValue \"1.0.0\"\n *\n * @readonly\n * @category neutral\n */\n readonly APP_VERSION: string;\n\n /**\n * The unique identifier for the build.\n *\n * @readonly\n * @category neutral\n */\n readonly BUILD_ID: string;\n\n /**\n * The timestamp the build was ran at.\n *\n * @readonly\n * @category neutral\n */\n readonly BUILD_TIMESTAMP: string;\n\n /**\n * A checksum hash created during the build.\n *\n * @readonly\n * @category neutral\n */\n readonly BUILD_CHECKSUM: string;\n\n /**\n * The unique identifier for the release.\n *\n * @readonly\n * @category neutral\n */\n readonly RELEASE_ID: string;\n\n /**\n * The tag for the release. This is generally in the format of \"\\<APP_NAME\\>\\@\\<APP_VERSION\\>\".\n *\n * @readonly\n * @category neutral\n */\n readonly RELEASE_TAG: string;\n\n /**\n * The name of the organization that maintains the application.\n *\n * @remarks\n * This variable is used to specify the name of the organization that maintains the application. If not provided in an environment, it will try to use the value in {@link @storm-software/config-tools/StormWorkspaceConfig#organization}.\n *\n * @alias ORG\n * @alias ORG_ID\n * @category neutral\n */\n ORGANIZATION: string;\n\n /**\n * The platform for which the application was built.\n *\n * @defaultValue \"neutral\"\n *\n * @category neutral\n */\n PLATFORM: \"node\" | \"neutral\" | \"browser\";\n\n /**\n * The mode in which the application is running.\n *\n * @defaultValue \"production\"\n *\n * @alias NODE_ENV\n * @alias ENV\n * @alias VERCEL_ENV\n *\n * @category neutral\n */\n MODE: \"development\" | \"test\" | \"production\";\n\n /**\n * The environment the application is running in. This value will be populated with the value of `MODE` if not provided.\n *\n * @defaultValue \"production\"\n *\n * @category neutral\n */\n ENVIRONMENT: string;\n\n /**\n * Indicates if the application is running in debug mode.\n *\n * @category neutral\n */\n DEBUG: boolean;\n\n /**\n * An indicator that specifies the current runtime is a test environment.\n *\n * @category neutral\n */\n TEST: boolean;\n\n /**\n * An indicator that specifies the current runtime is a minimal environment.\n *\n * @category node\n */\n MINIMAL: boolean;\n\n /**\n * An indicator that specifies the current runtime is a no color environment.\n *\n * @category node\n */\n NO_COLOR: boolean;\n\n /**\n * An indicator that specifies the current runtime is a force color environment.\n *\n * @category node\n */\n FORCE_COLOR: boolean | number;\n\n /**\n * An indicator that specifies the current runtime should force hyperlinks in terminal output.\n *\n * @remarks\n * This variable is used to force hyperlinks in terminal output, even if the terminal does not support them. This is useful for debugging and development purposes.\n\n * @category node\n */\n FORCE_HYPERLINK: boolean | number;\n\n /**\n * The name of the agent running the application. This variable is set by certain CI/CD systems.\n *\n * @readonly\n * @category neutral\n */\n readonly AGENT_NAME?: string;\n\n /**\n * The color terminal type. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly COLORTERM?: string;\n\n /**\n * The terminal type. This variable is set by certain CI/CD systems.\n *\n * @remarks\n * This variable is used to specify the terminal type that the application is running in. It can be used to determine how to format output for the terminal.\n *\n * @readonly\n * @category node\n */\n readonly TERM?: string;\n\n /**\n * The terminal program name. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly TERM_PROGRAM?: string;\n\n /**\n * The terminal program version. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly TERM_PROGRAM_VERSION?: string;\n\n /**\n * The terminal emulator name. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly TERMINAL_EMULATOR?: string;\n\n /**\n * The terminal emulator session ID. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly WT_SESSION?: string;\n\n /**\n * An indicator that specifies the current terminal is running Terminus Sublime. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly TERMINUS_SUBLIME?: boolean;\n\n /**\n * The ConEmu task name. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly ConEmuTask?: string;\n\n /**\n * The cursor trace ID. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly CURSOR_TRACE_ID?: string;\n\n /**\n * The VTE version. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly VTE_VERSION?: string;\n\n /**\n * Indicates if error stack traces should be captured.\n *\n * @category neutral\n */\n STACKTRACE: boolean;\n\n /**\n * Indicates if error data should be included.\n *\n * @category neutral\n */\n INCLUDE_ERROR_DATA: boolean;\n\n /**\n * A web page to lookup error messages and display additional information given an error code.\n *\n * @remarks\n * This variable is used to provide a URL to a page that can be used to look up error messages given an error code. This is used to provide a more user-friendly error message to the user.\n *\n * @title Error Details URL\n * @category neutral\n */\n ERROR_URL: string;\n\n /**\n * The default timezone for the application.\n *\n * @defaultValue \"America/New_York\"\n * @category neutral\n */\n DEFAULT_TIMEZONE: string;\n\n /**\n * The default locale to be used in the application.\n *\n * @defaultValue \"en_US\"\n * @category neutral\n */\n DEFAULT_LOCALE: string;\n\n /**\n * The default lowest log level to accept. If `null`, the logger will reject all records.\n *\n * @defaultValue \"info\"\n *\n * @category neutral\n */\n LOG_LEVEL?: \"error\" | \"warn\" | \"info\" | \"debug\" | null;\n\n /**\n * An indicator that specifies the current runtime is a continuous integration environment.\n *\n * @title Continuous Integration\n * @alias CONTINUOUS_INTEGRATION\n * @category neutral\n */\n CI: boolean;\n\n /**\n * The unique identifier for the current run. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly RUN_ID?: string;\n\n /**\n * The agola git reference. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly AGOLA_GIT_REF?: string;\n\n /**\n * The appcircle build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly AC_APPCIRCLE?: string;\n\n /**\n * The appveyor build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly APPVEYOR?: string;\n\n /**\n * The codebuild build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CODEBUILD?: string;\n\n /**\n * The task force build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly TF_BUILD?: string;\n\n /**\n * The bamboo plan key. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly bamboo_planKey?: string;\n\n /**\n * The bitbucket commit. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BITBUCKET_COMMIT?: string;\n\n /**\n * The bitrise build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BITRISE_IO?: string;\n\n /**\n * The buddy workspace ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BUDDY_WORKSPACE_ID?: string;\n\n /**\n * The buildkite build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BUILDKITE?: string;\n\n /**\n * The circleci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CIRCLECI?: string;\n\n /**\n * The cirrus-ci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CIRRUS_CI?: string;\n\n /**\n * The cf build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CF_BUILD_ID?: string;\n\n /**\n * The cm build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CM_BUILD_ID?: string;\n\n /**\n * The ci name. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CI_NAME?: string;\n\n /**\n * The drone build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly DRONE?: string;\n\n /**\n * The dsari build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly DSARI?: string;\n\n /**\n * The earthly build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly EARTHLY_CI?: string;\n\n /**\n * The eas build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly EAS_BUILD?: string;\n\n /**\n * The gerrit project. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GERRIT_PROJECT?: string;\n\n /**\n * The gitea actions build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GITEA_ACTIONS?: string;\n\n /**\n * The github actions build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GITHUB_ACTIONS?: string;\n\n /**\n * The gitlab ci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GITLAB_CI?: string;\n\n /**\n * The go cd build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GOCD?: string;\n\n /**\n * The builder output build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BUILDER_OUTPUT?: string;\n\n /**\n * The harness build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly HARNESS_BUILD_ID?: string;\n\n /**\n * The jenkins url. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly JENKINS_URL?: string;\n\n /**\n * The layerci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly LAYERCI?: string;\n\n /**\n * The magnum build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly MAGNUM?: string;\n\n /**\n * The netlify build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly NETLIFY?: string;\n\n /**\n * The nevercode build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly NEVERCODE?: string;\n\n /**\n * The prow job ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly PROW_JOB_ID?: string;\n\n /**\n * The release build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly RELEASE_BUILD_ID?: string;\n\n /**\n * The render build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly RENDER?: string;\n\n /**\n * The sailci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SAILCI?: string;\n\n /**\n * The hudson build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly HUDSON?: string;\n\n /**\n * The screwdriver build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SCREWDRIVER?: string;\n\n /**\n * The semaphore build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SEMAPHORE?: string;\n\n /**\n * The sourcehut build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SOURCEHUT?: string;\n /**\n * The spaceship build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SPACESHIP_CI?: string;\n\n /**\n * The strider build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly STRIDER?: string;\n\n /**\n * The task ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly TASK_ID?: string;\n\n /**\n * The teamcity version. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly TEAMCITY_VERSION?: string;\n\n /**\n * The travis build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly TRAVIS?: string;\n\n /**\n * The vela build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly VELA?: string;\n\n /**\n * The now builder build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly NOW_BUILDER?: string;\n\n /**\n * The appcenter build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly APPCENTER_BUILD_ID?: string;\n\n /**\n * The xcode project build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CI_XCODE_PROJECT?: string;\n\n /**\n * The xcode server build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly XCS?: string;\n\n /**\n * The application's runtime data directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local application data directory. This variable is used to set the \\`$storm.paths.data\\` property.\n *\n * @title Data Directory\n * @category node\n */\n DATA_DIR?: string;\n\n /**\n * The application's configuration data directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local application configuration directory. This variable is used to set the \\`$storm.paths.config\\` property.\n *\n * @title Configuration Directory\n * @category node\n */\n CONFIG_DIR?: string;\n\n /**\n * The application's cached data directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local cache data directory. This variable is used to set the \\`$storm.paths.cache\\` property.\n *\n * @title Cache Directory\n * @category node\n */\n CACHE_DIR?: string;\n\n /**\n * The application's logging directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local application log directory. This variable is used to set the \\`$storm.paths.log\\` property.\n *\n * @title Log Directory\n * @category node\n */\n LOG_DIR?: string;\n\n /**\n * The application's temporary data directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local temporary data directory. This variable is used to set the \\`$storm.paths.temp\\` property.\n *\n * @title Temporary Directory\n * @category node\n */\n TEMP_DIR?: string;\n\n /**\n * A variable that specifies the current user's local application data directory on Windows.\n *\n * @see https://www.advancedinstaller.com/appdata-localappdata-programdata.html\n *\n * @remarks\n * This variable is used to specify a path to application data that is specific to the current user. This variable can be used to set the \\`$storm.paths.data\\`, \\`$storm.paths.cache\\`, and \\`$storm.paths.log\\` properties.\n *\n * @readonly\n * @category node\n */\n readonly LOCALAPPDATA?: string;\n\n /**\n * A variable that specifies the application data directory on Windows.\n *\n * @see https://www.advancedinstaller.com/appdata-localappdata-programdata.html\n *\n * @remarks\n * This variable is used to specify a path to application data that is specific to the current user. This variable can be used to set the \\`$storm.paths.config\\` property.\n *\n * @readonly\n * @category node\n */\n readonly APPDATA?: string;\n\n /**\n * A variable that specifies the data path in the home directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to application data that is specific to the current user. This variable can be used to set the \\`$storm.paths.data\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_DATA_HOME?: string;\n\n /**\n * A variable that specifies the configuration path in the home directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to configuration data that is specific to the current user. This variable can be used to set the \\`$storm.paths.config\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_CONFIG_HOME?: string;\n\n /**\n * A variable that specifies the cache path in the home directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to cache data that is specific to the current user. This variable can be used to set the \\`$storm.paths.cache\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_CACHE_HOME?: string;\n\n /**\n * A variable that specifies the state directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to application state data that is specific to the current user. This variable can be used to set the \\`$storm.paths.state\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_STATE_HOME?: string;\n\n /**\n * A variable that specifies the runtime directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to runtime data that is specific to the current user. This variable can be used to set the \\`$storm.paths.temp\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_RUNTIME_DIR?: string;\n\n /**\n * A variable that specifies the [Devenv](https://devenv.sh/) runtime directory.\n *\n * @see https://devenv.sh/files-and-variables/#devenv_dotfile\n * @see https://nixos.org/\n *\n * @remarks\n * This variable is used to specify a path to application data that is specific to the current [Nix](https://nixos.org/) environment. This variable can be used to set the \\`$storm.paths.temp\\` property.\n *\n * @category node\n */\n DEVENV_RUNTIME?: string;\n}\n\n/**\n * The base secrets configuration used by Powerlines applications\n *\n * @remarks\n * This interface is used to define the secret configuration options used by Powerlines applications. It is used to provide type safety, autocompletion, and default values for the environment variables. The comments of each variable are used to provide documentation descriptions when running the \\`storm docs\\` command. Since these are secrets, no default values should be provided and the values should be kept confidential (excluded from the client).\n */\nexport interface SecretsInterface {\n /**\n * The secret key used for encryption and decryption.\n *\n * @remarks\n * This variable is used to provide a secret key for encryption and decryption of sensitive data. It is important that this value is kept confidential and not exposed in client-side code or public repositories.\n *\n * @title Encryption Key\n */\n ENCRYPTION_KEY: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;GAkBE,OAAA,CAAA,MAAA,EACD;CAAE;CAAQ;CAAC;CAAY;CAAqB;CAAW;CAAC;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA,EACxD,OAAA,CAA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AA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAE3B,MAAI,sBAAA;CAAA;CAAA;CAAA,EACF,OAAO,kBACR;CAAE;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"runtime.mjs","names":[],"sources":["../../src/types/runtime.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * The base environment configuration used by Powerlines applications\n *\n * @remarks\n * This interface is used to define the environment variables, configuration options, and runtime settings used by applications. It is used to provide type safety, autocompletion, and default values for the environment variables. The comments of each variable are used to provide documentation descriptions when running the \\`powerlines docs\\` command.\n *\n * @categoryDescription Platform\n * The name of the platform the configuration parameter is intended for use in.\n *\n * @showCategories\n */\nexport interface EnvInterface {\n /**\n * The name of the application.\n *\n * @readonly\n * @category neutral\n */\n readonly APP_NAME: string;\n\n /**\n * The version of the application.\n *\n * @defaultValue \"1.0.0\"\n *\n * @readonly\n * @category neutral\n */\n readonly APP_VERSION: string;\n\n /**\n * The unique identifier for the build.\n *\n * @readonly\n * @category neutral\n */\n readonly BUILD_ID: string;\n\n /**\n * The timestamp the build was ran at.\n *\n * @readonly\n * @category neutral\n */\n readonly BUILD_TIMESTAMP: string;\n\n /**\n * A checksum hash created during the build.\n *\n * @readonly\n * @category neutral\n */\n readonly BUILD_CHECKSUM: string;\n\n /**\n * The unique identifier for the release.\n *\n * @readonly\n * @category neutral\n */\n readonly RELEASE_ID: string;\n\n /**\n * The tag for the release. This is generally in the format of \"\\<APP_NAME\\>\\@\\<APP_VERSION\\>\".\n *\n * @readonly\n * @category neutral\n */\n readonly RELEASE_TAG: string;\n\n /**\n * The name of the organization that maintains the application.\n *\n * @remarks\n * This variable is used to specify the name of the organization that maintains the application. If not provided in an environment, it will try to use the value in {@link @storm-software/config-tools/StormWorkspaceConfig#organization}.\n *\n * @alias ORG\n * @alias ORG_ID\n * @category neutral\n */\n ORGANIZATION: string;\n\n /**\n * The platform for which the application was built.\n *\n * @defaultValue \"neutral\"\n *\n * @category neutral\n */\n PLATFORM: \"node\" | \"neutral\" | \"browser\";\n\n /**\n * The mode in which the application is running.\n *\n * @defaultValue \"production\"\n *\n * @alias NODE_ENV\n * @alias ENV\n * @alias VERCEL_ENV\n *\n * @category neutral\n */\n MODE: \"development\" | \"test\" | \"production\";\n\n /**\n * The environment the application is running in. This value will be populated with the value of `MODE` if not provided.\n *\n * @defaultValue \"production\"\n *\n * @category neutral\n */\n ENVIRONMENT: string;\n\n /**\n * Indicates if the application is running in debug mode.\n *\n * @category neutral\n */\n DEBUG: boolean;\n\n /**\n * An indicator that specifies the current runtime is a test environment.\n *\n * @category neutral\n */\n TEST: boolean;\n\n /**\n * An indicator that specifies the current runtime is a minimal environment.\n *\n * @category node\n */\n MINIMAL: boolean;\n\n /**\n * An indicator that specifies the current runtime is a no color environment.\n *\n * @category node\n */\n NO_COLOR: boolean;\n\n /**\n * An indicator that specifies the current runtime is a force color environment.\n *\n * @category node\n */\n FORCE_COLOR: boolean | number;\n\n /**\n * An indicator that specifies the current runtime should force hyperlinks in terminal output.\n *\n * @remarks\n * This variable is used to force hyperlinks in terminal output, even if the terminal does not support them. This is useful for debugging and development purposes.\n\n * @category node\n */\n FORCE_HYPERLINK: boolean | number;\n\n /**\n * The name of the agent running the application. This variable is set by certain CI/CD systems.\n *\n * @readonly\n * @category neutral\n */\n readonly AGENT_NAME?: string;\n\n /**\n * The color terminal type. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly COLORTERM?: string;\n\n /**\n * The terminal type. This variable is set by certain CI/CD systems.\n *\n * @remarks\n * This variable is used to specify the terminal type that the application is running in. It can be used to determine how to format output for the terminal.\n *\n * @readonly\n * @category node\n */\n readonly TERM?: string;\n\n /**\n * The terminal program name. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly TERM_PROGRAM?: string;\n\n /**\n * The terminal program version. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly TERM_PROGRAM_VERSION?: string;\n\n /**\n * The terminal emulator name. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly TERMINAL_EMULATOR?: string;\n\n /**\n * The terminal emulator session ID. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly WT_SESSION?: string;\n\n /**\n * An indicator that specifies the current terminal is running Terminus Sublime. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly TERMINUS_SUBLIME?: boolean;\n\n /**\n * The ConEmu task name. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly ConEmuTask?: string;\n\n /**\n * The cursor trace ID. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly CURSOR_TRACE_ID?: string;\n\n /**\n * The VTE version. This variable is set by certain terminal emulators.\n *\n * @readonly\n * @category node\n */\n readonly VTE_VERSION?: string;\n\n /**\n * Indicates if error stack traces should be captured.\n *\n * @category neutral\n */\n STACKTRACE: boolean;\n\n /**\n * Indicates if error data should be included.\n *\n * @category neutral\n */\n INCLUDE_ERROR_DATA: boolean;\n\n /**\n * A web page to lookup error messages and display additional information given an error code.\n *\n * @remarks\n * This variable is used to provide a URL to a page that can be used to look up error messages given an error code. This is used to provide a more user-friendly error message to the user.\n *\n * @title Error Details URL\n * @category neutral\n */\n ERROR_URL: string;\n\n /**\n * The default timezone for the application.\n *\n * @defaultValue \"America/New_York\"\n * @category neutral\n */\n DEFAULT_TIMEZONE: string;\n\n /**\n * The default locale to be used in the application.\n *\n * @defaultValue \"en_US\"\n * @category neutral\n */\n DEFAULT_LOCALE: string;\n\n /**\n * The default lowest log level to accept. If `null`, the logger will reject all records.\n *\n * @defaultValue \"info\"\n *\n * @category neutral\n */\n LOG_LEVEL?: \"error\" | \"warn\" | \"info\" | \"debug\" | null;\n\n /**\n * An indicator that specifies the current runtime is a continuous integration environment.\n *\n * @title Continuous Integration\n * @alias CONTINUOUS_INTEGRATION\n * @category neutral\n */\n CI: boolean;\n\n /**\n * The unique identifier for the current run. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly RUN_ID?: string;\n\n /**\n * The agola git reference. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly AGOLA_GIT_REF?: string;\n\n /**\n * The appcircle build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly AC_APPCIRCLE?: string;\n\n /**\n * The appveyor build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly APPVEYOR?: string;\n\n /**\n * The codebuild build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CODEBUILD?: string;\n\n /**\n * The task force build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly TF_BUILD?: string;\n\n /**\n * The bamboo plan key. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly bamboo_planKey?: string;\n\n /**\n * The bitbucket commit. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BITBUCKET_COMMIT?: string;\n\n /**\n * The bitrise build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BITRISE_IO?: string;\n\n /**\n * The buddy workspace ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BUDDY_WORKSPACE_ID?: string;\n\n /**\n * The buildkite build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BUILDKITE?: string;\n\n /**\n * The circleci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CIRCLECI?: string;\n\n /**\n * The cirrus-ci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CIRRUS_CI?: string;\n\n /**\n * The cf build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CF_BUILD_ID?: string;\n\n /**\n * The cm build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CM_BUILD_ID?: string;\n\n /**\n * The ci name. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CI_NAME?: string;\n\n /**\n * The drone build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly DRONE?: string;\n\n /**\n * The dsari build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly DSARI?: string;\n\n /**\n * The earthly build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly EARTHLY_CI?: string;\n\n /**\n * The eas build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly EAS_BUILD?: string;\n\n /**\n * The gerrit project. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GERRIT_PROJECT?: string;\n\n /**\n * The gitea actions build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GITEA_ACTIONS?: string;\n\n /**\n * The github actions build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GITHUB_ACTIONS?: string;\n\n /**\n * The gitlab ci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GITLAB_CI?: string;\n\n /**\n * The go cd build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly GOCD?: string;\n\n /**\n * The builder output build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly BUILDER_OUTPUT?: string;\n\n /**\n * The harness build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly HARNESS_BUILD_ID?: string;\n\n /**\n * The jenkins url. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly JENKINS_URL?: string;\n\n /**\n * The layerci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly LAYERCI?: string;\n\n /**\n * The magnum build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly MAGNUM?: string;\n\n /**\n * The netlify build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly NETLIFY?: string;\n\n /**\n * The nevercode build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly NEVERCODE?: string;\n\n /**\n * The prow job ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly PROW_JOB_ID?: string;\n\n /**\n * The release build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly RELEASE_BUILD_ID?: string;\n\n /**\n * The render build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly RENDER?: string;\n\n /**\n * The sailci build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SAILCI?: string;\n\n /**\n * The hudson build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly HUDSON?: string;\n\n /**\n * The screwdriver build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SCREWDRIVER?: string;\n\n /**\n * The semaphore build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SEMAPHORE?: string;\n\n /**\n * The sourcehut build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SOURCEHUT?: string;\n /**\n * The spaceship build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly SPACESHIP_CI?: string;\n\n /**\n * The strider build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly STRIDER?: string;\n\n /**\n * The task ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly TASK_ID?: string;\n\n /**\n * The teamcity version. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly TEAMCITY_VERSION?: string;\n\n /**\n * The travis build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly TRAVIS?: string;\n\n /**\n * The vela build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly VELA?: string;\n\n /**\n * The now builder build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly NOW_BUILDER?: string;\n\n /**\n * The appcenter build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly APPCENTER_BUILD_ID?: string;\n\n /**\n * The xcode project build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly CI_XCODE_PROJECT?: string;\n\n /**\n * The xcode server build ID. This value is set by certain CI/CD systems.\n *\n * @readonly\n * @category node\n */\n readonly XCS?: string;\n\n /**\n * The application's runtime data directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local application data directory. This variable is used to set the \\`$storm.paths.data\\` property.\n *\n * @title Data Directory\n * @category node\n */\n DATA_DIR?: string;\n\n /**\n * The application's configuration data directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local application configuration directory. This variable is used to set the \\`$storm.paths.config\\` property.\n *\n * @title Configuration Directory\n * @category node\n */\n CONFIG_DIR?: string;\n\n /**\n * The application's cached data directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local cache data directory. This variable is used to set the \\`$storm.paths.cache\\` property.\n *\n * @title Cache Directory\n * @category node\n */\n CACHE_DIR?: string;\n\n /**\n * The application's logging directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local application log directory. This variable is used to set the \\`$storm.paths.log\\` property.\n *\n * @title Log Directory\n * @category node\n */\n LOG_DIR?: string;\n\n /**\n * The application's temporary data directory.\n *\n * @remarks\n * This variable is used to override the base path of the system's local temporary data directory. This variable is used to set the \\`$storm.paths.temp\\` property.\n *\n * @title Temporary Directory\n * @category node\n */\n TEMP_DIR?: string;\n\n /**\n * A variable that specifies the current user's local application data directory on Windows.\n *\n * @see https://www.advancedinstaller.com/appdata-localappdata-programdata.html\n *\n * @remarks\n * This variable is used to specify a path to application data that is specific to the current user. This variable can be used to set the \\`$storm.paths.data\\`, \\`$storm.paths.cache\\`, and \\`$storm.paths.log\\` properties.\n *\n * @readonly\n * @category node\n */\n readonly LOCALAPPDATA?: string;\n\n /**\n * A variable that specifies the application data directory on Windows.\n *\n * @see https://www.advancedinstaller.com/appdata-localappdata-programdata.html\n *\n * @remarks\n * This variable is used to specify a path to application data that is specific to the current user. This variable can be used to set the \\`$storm.paths.config\\` property.\n *\n * @readonly\n * @category node\n */\n readonly APPDATA?: string;\n\n /**\n * A variable that specifies the data path in the home directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to application data that is specific to the current user. This variable can be used to set the \\`$storm.paths.data\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_DATA_HOME?: string;\n\n /**\n * A variable that specifies the configuration path in the home directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to configuration data that is specific to the current user. This variable can be used to set the \\`$storm.paths.config\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_CONFIG_HOME?: string;\n\n /**\n * A variable that specifies the cache path in the home directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to cache data that is specific to the current user. This variable can be used to set the \\`$storm.paths.cache\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_CACHE_HOME?: string;\n\n /**\n * A variable that specifies the state directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to application state data that is specific to the current user. This variable can be used to set the \\`$storm.paths.state\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_STATE_HOME?: string;\n\n /**\n * A variable that specifies the runtime directory on Linux systems using the XDG base directory specification.\n *\n * @see https://gist.github.com/roalcantara/107ba66dfa3b9d023ac9329e639bc58c\n *\n * @remarks\n * This variable is used to specify a path to runtime data that is specific to the current user. This variable can be used to set the \\`$storm.paths.temp\\` property.\n *\n * @readonly\n * @category node\n */\n readonly XDG_RUNTIME_DIR?: string;\n\n /**\n * A variable that specifies the [Devenv](https://devenv.sh/) runtime directory.\n *\n * @see https://devenv.sh/files-and-variables/#devenv_dotfile\n * @see https://nixos.org/\n *\n * @remarks\n * This variable is used to specify a path to application data that is specific to the current [Nix](https://nixos.org/) environment. This variable can be used to set the \\`$storm.paths.temp\\` property.\n *\n * @category node\n */\n DEVENV_RUNTIME?: string;\n}\n\n/**\n * The base secrets configuration used by Powerlines applications\n *\n * @remarks\n * This interface is used to define the secret configuration options used by Powerlines applications. It is used to provide type safety, autocompletion, and default values for the environment variables. The comments of each variable are used to provide documentation descriptions when running the \\`storm docs\\` command. Since these are secrets, no default values should be provided and the values should be kept confidential (excluded from the client).\n */\nexport interface SecretsInterface {\n /**\n * The secret key used for encryption and decryption.\n *\n * @remarks\n * This variable is used to provide a secret key for encryption and decryption of sensitive data. It is important that this value is kept confidential and not exposed in client-side code or public repositories.\n *\n * @title Encryption Key\n */\n ENCRYPTION_KEY: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,sBAAkB;CAAA;CAAsB;CAAW,EAAA,OAAA,kBAAA;CAAA;CAAA;CAAA;CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-env",
3
- "version": "0.16.69",
3
+ "version": "0.16.70",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
6
6
  "keywords": ["dotenv", "powerlines", "storm-software", "powerlines-plugin"],
@@ -306,7 +306,7 @@
306
306
  "@alloy-js/typescript": "0.23.0-dev.4",
307
307
  "@babel/core": "^7.29.0",
308
308
  "@babel/types": "^7.29.0",
309
- "@powerlines/plugin-alloy": "^0.25.34",
309
+ "@powerlines/plugin-alloy": "^0.25.35",
310
310
  "@powerlines/plugin-automd": "^0.1.349",
311
311
  "@powerlines/plugin-babel": "^0.12.352",
312
312
  "@powerlines/plugin-plugin": "^0.12.300",
@@ -332,5 +332,5 @@
332
332
  "vite": "^8.0.0"
333
333
  },
334
334
  "publishConfig": { "access": "public" },
335
- "gitHead": "369e884879e82b75feffe7cfd91c78584accb1d2"
335
+ "gitHead": "9a873b7c4bc2a376b58e2721aa6211ca162c1f61"
336
336
  }