@powerlines/plugin-env 0.16.116 → 0.16.117

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,7 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
3
  const require_types_plugin = require('../types/plugin.cjs');
4
- let _powerlines_plugin_babel_types_config = require("@powerlines/plugin-babel/types/config");
5
4
  let _babel_core = require("@babel/core");
6
5
  let _powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
7
6
  let _powerlines_plugin_babel_helpers_create_plugin = require("@powerlines/plugin-babel/helpers/create-plugin");
@@ -93,12 +92,11 @@ const envBabelPlugin = (_powerlines_plugin_babel_helpers_create_plugin.createBab
93
92
  }
94
93
  extractEnv.__type = [
95
94
  "node",
96
- () => _powerlines_plugin_babel_types_config.__ΩBabelPluginPass,
97
95
  "pass",
98
96
  "isInjectable",
99
97
  "isUsingBuiltin",
100
98
  "extractEnv",
101
- "P!2!n\"2#\"2$\"2%\"/&"
99
+ "P!2!!2\"\"2#\"2$\"/%"
102
100
  ];
103
101
  return { visitor: { MemberExpression: __assignType(function MemberExpression(path, pass) {
104
102
  if (path.get("object")?.get("property")?.isIdentifier({ name: "env" }) && path.get("object")?.get("object")?.isIdentifier({ name: "process" }) && path.get("property")?.isIdentifier()) {
@@ -129,10 +127,9 @@ const envBabelPlugin = (_powerlines_plugin_babel_helpers_create_plugin.createBab
129
127
  }, [
130
128
  () => _babel_core.NodePath,
131
129
  "path",
132
- () => _powerlines_plugin_babel_types_config.__ΩBabelPluginPass,
133
130
  "pass",
134
131
  "MemberExpression",
135
- "PP!7!2\"n#2$\"/%"
132
+ "PP!7!2\"!2#\"/$"
136
133
  ]) } };
137
134
  }, [
138
135
  "param0",
@@ -1,5 +1,4 @@
1
1
  import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
- import { __ΩBabelPluginPass } from "@powerlines/plugin-babel/types/config";
3
2
  import { NodePath } from "@babel/core";
4
3
  import { stringifyDefaultValue } from "@powerlines/deepkit/utilities";
5
4
  import { createBabelPlugin } from "@powerlines/plugin-babel/helpers/create-plugin";
@@ -91,12 +90,11 @@ const envBabelPlugin = (createBabelPlugin.Ω = [[() => __ΩEnvPluginContext, "n!
91
90
  }
92
91
  extractEnv.__type = [
93
92
  "node",
94
- () => __ΩBabelPluginPass,
95
93
  "pass",
96
94
  "isInjectable",
97
95
  "isUsingBuiltin",
98
96
  "extractEnv",
99
- "P!2!n\"2#\"2$\"2%\"/&"
97
+ "P!2!!2\"\"2#\"2$\"/%"
100
98
  ];
101
99
  return { visitor: { MemberExpression: __assignType(function MemberExpression(path, pass) {
102
100
  if (path.get("object")?.get("property")?.isIdentifier({ name: "env" }) && path.get("object")?.get("object")?.isIdentifier({ name: "process" }) && path.get("property")?.isIdentifier()) {
@@ -127,10 +125,9 @@ const envBabelPlugin = (createBabelPlugin.Ω = [[() => __ΩEnvPluginContext, "n!
127
125
  }, [
128
126
  () => NodePath,
129
127
  "path",
130
- () => __ΩBabelPluginPass,
131
128
  "pass",
132
129
  "MemberExpression",
133
- "PP!7!2\"n#2$\"/%"
130
+ "PP!7!2\"!2#\"/$"
134
131
  ]) } };
135
132
  }, [
136
133
  "param0",
@@ -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;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,UA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,MAAK,OAAQ,CAAA,IACnC,KACH,IAAA,SAAA,iBAEO,aAAA,EAAsB,MAAA,WAAa,CAAK,IACjD,KAAA,IAAA,WAAA,EAAA,cAAA,EAAA;GAEU,MAAK,aAAA,KAAA,IAAA,WAAA,EAAA;AACL,OAAI,CAAC,WAAE,KACR;;AAGL,QAAU,wBAAyB,OAAO,WAAW,OAAO;AAC5D,aAAgB,MAAC;IACP,QAAI,GAAO,QAAG,OAAA,aAAwB,aAAA;IAC9C,MAAA;IACO,UAAA;IACF,CAAC;aAEG,KACJ,IAAC,SAAK,EACL,IAAI,WAAW,EACnB,aAAA,EAAA,MAAA,OAAA,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
+ {"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":";;;;;;;;AAEA,SAAS,aAAY,IAAK,MAAC;;AAE1B,QAAU;;AA8BX,MAAO,kBAAA,kBAAA,IAAA,CAAA,OAAA,qBAAA,KAAA,CAAA,EAAA,kBAA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EACJ;GACF;CAAC;CAAI;CAAA;CAAA,CAAA,CAAA"}
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
3
  const require_helpers_load = require('../helpers/load.cjs');
4
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
5
4
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
5
+ let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
6
6
  let defu = require("defu");
7
7
  defu = require_runtime.__toESM(defu);
8
8
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
@@ -1,6 +1,6 @@
1
1
  import { loadEnvFromContext } from "../helpers/load.mjs";
2
- import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type";
3
2
  import { titleCase } from "@stryke/string-format/title-case";
3
+ import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type";
4
4
  import defu from "defu";
5
5
  import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
6
6
  import { For, Show, code, computed, splitProps } from "@alloy-js/core";
@@ -1,6 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- let powerlines = require("powerlines");
4
3
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
5
4
  let automd = require("automd");
6
5
 
@@ -23,10 +22,9 @@ const env = __assignType((context) => (0, automd.defineGenerator)({
23
22
  return { contents: await context.fs.read(envDocFile) || "" };
24
23
  }, ["generate", "P\"/!"])
25
24
  }), [
26
- () => powerlines.__ΩUnresolvedContext,
27
25
  "context",
28
26
  "",
29
- "Pn!2\"\"/#"
27
+ "P!2!\"/\""
30
28
  ]);
31
29
 
32
30
  //#endregion
@@ -1,5 +1,5 @@
1
- import { UnresolvedContext } from "powerlines";
2
1
  import * as _$automd from "automd";
2
+ import { UnresolvedContext } from "powerlines";
3
3
 
4
4
  //#region src/helpers/automd-generator.d.ts
5
5
  /**
@@ -1,4 +1,3 @@
1
- import { __ΩUnresolvedContext } from "powerlines";
2
1
  import { joinPaths } from "@stryke/path/join-paths";
3
2
  import { defineGenerator } from "automd";
4
3
 
@@ -21,10 +20,9 @@ const env = __assignType((context) => defineGenerator({
21
20
  return { contents: await context.fs.read(envDocFile) || "" };
22
21
  }, ["generate", "P\"/!"])
23
22
  }), [
24
- () => __ΩUnresolvedContext,
25
23
  "context",
26
24
  "",
27
- "Pn!2\"\"/#"
25
+ "P!2!\"/\""
28
26
  ]);
29
27
 
30
28
  //#endregion
@@ -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,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
+ {"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":";;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE5B,QAAO;;;;;;;;AA2BX,MAAE,MAAgB,cAAA,YAAA,gBAAA;CACd,MAAM;CACN,UAAM,aAAW,eAAA,WAAA;EACf,MAAM,aAAa,UAAS,QAAA,OAAA,MAAA,QAAA,aAAA,SAAA;AAC1B,MAAA,CAAA,QAAQ,GAAO,WAAI,WAAA,CAClB,QAAK,EACL,UAAU,IACN;AAGL,SAAG,EACH,+CAAO,IACN;IACF,CAAC,YAAC,QAAA,CAAA;CACR,CAAC,EAAE;CAAC;CAAC;CAAA;CAAA,CAAA"}
@@ -2,7 +2,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
3
  const require_types_plugin = require('../types/plugin.cjs');
4
4
  const require_helpers_source_file_env = require('./source-file-env.cjs');
5
- let powerlines = require("powerlines");
6
5
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
7
6
  let _stryke_env_load_env = require("@stryke/env/load-env");
8
7
  let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
@@ -64,10 +63,9 @@ loadEnvDirectory.__type = [
64
63
  "mode",
65
64
  "cacheDir",
66
65
  "packageJson",
67
- () => powerlines.__ΩWorkspaceConfig,
68
66
  "workspaceConfig",
69
67
  "loadEnvDirectory",
70
- "Pn!2\"&2#&2$&2%!2&n'2(\"`/)"
68
+ "Pn!2\"&2#&2$&2%!2&!2'\"`/("
71
69
  ];
72
70
  /**
73
71
  * Retrieves various dotenv configuration parameters from the context.
@@ -1,6 +1,5 @@
1
1
  import { __ΩEnvPluginContext, __ΩEnvPluginOptions } from "../types/plugin.mjs";
2
2
  import { removeEnvPrefix } from "./source-file-env.mjs";
3
- import { __ΩWorkspaceConfig } from "powerlines";
4
3
  import { joinPaths } from "@stryke/path/join-paths";
5
4
  import { loadEnv as loadEnv$1, loadEnvFile } from "@stryke/env/load-env";
6
5
  import { kebabCase } from "@stryke/string-format/kebab-case";
@@ -61,10 +60,9 @@ loadEnvDirectory.__type = [
61
60
  "mode",
62
61
  "cacheDir",
63
62
  "packageJson",
64
- () => __ΩWorkspaceConfig,
65
63
  "workspaceConfig",
66
64
  "loadEnvDirectory",
67
- "Pn!2\"&2#&2$&2%!2&n'2(\"`/)"
65
+ "Pn!2\"&2#&2$&2%!2&!2'\"`/("
68
66
  ];
69
67
  /**
70
68
  * Retrieves various dotenv configuration parameters from the context.
@@ -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;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;GA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------------------------------\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":";;;;;;;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;AAC5B,IAAA,SAAW;AACd,QAAS;;;CA4BV,IAAM,MAAQ,MAAC,UAAiB,KAAC,KAAQ;AACvC,KAAA,QAAS,mBAAgB,QAAA,iBAAA,SAAA,GAAA;EACnB,MAAM,qBAAA,MAAA,QAAA,IAAA,QAAA,gBAAA,IAAA,aAAA,OAAA,sBAAA,YAAA,mBAAA,IAAA,EAAA;GAAA;GAAA;GAAA;GAAA,CAAA,CAAA,CAAA;AACP,OAAA,MAAA,qBAAA,mBACI,OAAM,KAAA,mBAAA,IAAA;;AAGb,QAAM,gBAAA,IAAqB;;AAE/B,aAAQ,SAAA;OAAgB;CAAsB;CAAA;CAAA;CAAA;CAAA;CAAA;AAC9C,eAAM,iBAAA,SAAA,WAAA,MAAA,UAAA,aAAA,iBAAA;CACF,MAAC,CAAA,WAAA,aAAA,MAAA,QAAA,IAAA,qEAEG,WAAO;EACH,KAAK;EACb,MAAA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AAA,KAAQ,QAAW,OAAO,KAAA,SAAO,KAAA,iBAAA;AAC/B,SAAI;IACL;EAAC;EAAC;EAAA;EAAA;EAAA,CAAA,EAAA,EAAA,CAAA,GACH,EAAA,CAAA;;AAEV,mBAAmB,SAAQ;OAAA;CAAmB;CAAA;CAAA;CAAA;CAAA;CAAA;AAC9C,eAAgB,QAAa,SAAO,SAAA;CAChC,MAAE,CAAA,SAAA,WAAyB,UAAS,MAAK,QAAU,IAAC;GAClD,iBAAgB,IAAQ,CAAA,CAAA,IAAK,CAAA,EAAA,iBAAQ,SAAA,QAAA,OAAA,MAAA,QAAA,OAAA,MAAA,QAAA,WAAA,QAAA,aAAA,QAAA,gBAAA;GACrC,iBAAoB,IAAI,CAAC,CAAA,IAAA,CAAA,EAAA,iBAAS,SAAA,QAAA,gBAAA,eAAA,QAAA,OAAA,MAAA,QAAA,WAAA,QAAA,aAAA,QAAA,gBAAA;GAClC,iBAAgB,IAAA,CAAS,CAAC,IAAA,CAAA,EAAO,iBAAiB,SAAQ,QAAA,SAAY,QAAS,QAAA,OAAA,MAAA,QAAA,WAAA,QAAA,aAAA,QAAA,gBAAA;EAChF,CAAC;AACF,QAAE,KAAA,mBAA0B,SAAA,QAAgB,IAAQ,EAAA,SAAA,WAAA,OAAA;;AAExD,QAAQ,SAAQ;OAAO;CAAsB;OAAW;CAAuB;CAAA;CAAA;CAAA"}
@@ -2,11 +2,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
3
  const require_types_plugin = require('../types/plugin.cjs');
4
4
  const require_helpers_reflect = require('./reflect.cjs');
5
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
6
- let powerlines = require("powerlines");
7
5
  let _powerlines_deepkit_capnp = require("@powerlines/deepkit/capnp");
8
6
  let _powerlines_deepkit_resolve_reflections = require("@powerlines/deepkit/resolve-reflections");
9
7
  let _powerlines_deepkit_schemas_reflection = require("@powerlines/deepkit/schemas/reflection");
8
+ let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
10
9
  let _stryke_capnp = require("@stryke/capnp");
11
10
  _stryke_capnp = require_runtime.__toESM(_stryke_capnp);
12
11
  let _stryke_fs_buffer = require("@stryke/fs/buffer");
@@ -27,12 +26,10 @@ async function resolveRuntimeTypeFile(context) {
27
26
  return resolved;
28
27
  }
29
28
  resolveRuntimeTypeFile.__type = [
30
- () => powerlines.__ΩUnresolvedContext,
31
- () => require_types_plugin.__ΩEnvPluginResolvedConfig,
32
29
  "context",
33
30
  "resolveRuntimeTypeFile",
34
31
  "Resolves the runtime type definition file for the environment variables.",
35
- "Pn\"o!\"2#&`/$?%"
32
+ "P!2!&`/\"?#"
36
33
  ];
37
34
  /**
38
35
  * Gets the default type definition for the environment variables.
@@ -47,12 +44,10 @@ async function getEnvDefaultTypeDefinition(context) {
47
44
  };
48
45
  }
49
46
  getEnvDefaultTypeDefinition.__type = [
50
- () => powerlines.__ΩUnresolvedContext,
51
- () => require_types_plugin.__ΩEnvPluginResolvedConfig,
52
47
  "context",
53
48
  "getEnvDefaultTypeDefinition",
54
49
  "Gets the default type definition for the environment variables.",
55
- "Pn\"o!\"2#!`/$?%"
50
+ "P!2!!`/\"?#"
56
51
  ];
57
52
  /** Gets the default type definition for the environment secrets.
58
53
  *
@@ -66,11 +61,9 @@ async function getSecretsDefaultTypeDefinition(context) {
66
61
  };
67
62
  }
68
63
  getSecretsDefaultTypeDefinition.__type = [
69
- () => powerlines.__ΩUnresolvedContext,
70
- () => require_types_plugin.__ΩEnvPluginResolvedConfig,
71
64
  "context",
72
65
  "getSecretsDefaultTypeDefinition",
73
- "Pn\"o!\"2#!`/$"
66
+ "P!2!!`/\""
74
67
  ];
75
68
  /**
76
69
  * Gets the path to the environment type reflections.
@@ -83,15 +76,13 @@ function getEnvTypeReflectionsPath(context, name = "env") {
83
76
  return (0, _stryke_path_join_paths.joinPaths)((0, _powerlines_deepkit_resolve_reflections.getReflectionsPath)(context), "env", `${name}-types.bin`);
84
77
  }
85
78
  getEnvTypeReflectionsPath.__type = [
86
- () => powerlines.__ΩContext,
87
- () => require_types_plugin.__ΩEnvPluginResolvedConfig,
88
79
  "context",
89
80
  () => require_types_plugin.__ΩEnvType,
90
81
  "name",
91
82
  () => "env",
92
83
  "getEnvTypeReflectionsPath",
93
84
  "Gets the path to the environment type reflections.",
94
- "Pn\"o!\"2#n$2%>&&/'?("
85
+ "P!2!n\"2#>$&/%?&"
95
86
  ];
96
87
  /**
97
88
  * Reads the environment type reflection from the file system.
@@ -127,10 +118,9 @@ readEnvTypeReflection.__type = [
127
118
  () => require_types_plugin.__ΩEnvType,
128
119
  "name",
129
120
  () => "env",
130
- () => _powerlines_deepkit_vendor_type.ReflectionClass,
131
121
  "readEnvTypeReflection",
132
122
  "Reads the environment type reflection from the file system.",
133
- "Pn!2\"n#2$>%P\"7&`/'?("
123
+ "Pn!2\"n#2$>%!`/&?'"
134
124
  ];
135
125
  /**
136
126
  * Writes the environment type reflection to the file system.
@@ -148,14 +138,13 @@ async function writeEnvTypeReflection(context, reflection, name = "env") {
148
138
  writeEnvTypeReflection.__type = [
149
139
  () => require_types_plugin.__ΩEnvPluginContext,
150
140
  "context",
151
- () => _powerlines_deepkit_vendor_type.ReflectionClass,
152
141
  "reflection",
153
142
  () => require_types_plugin.__ΩEnvType,
154
143
  "name",
155
144
  () => "env",
156
145
  "writeEnvTypeReflection",
157
146
  "Writes the environment type reflection to the file system.",
158
- "Pn!2\"P\"7#2$n%2&>'\"/(?)"
147
+ "Pn!2\"!2#n$2%>&\"/'?("
159
148
  ];
160
149
  function getEnvReflectionsPath(context, name) {
161
150
  return (0, _stryke_path_join_paths.joinPaths)((0, _powerlines_deepkit_resolve_reflections.getReflectionsPath)(context), "env", `${name}.bin`);
@@ -208,10 +197,9 @@ async function readEnvReflection(context) {
208
197
  readEnvReflection.__type = [
209
198
  () => require_types_plugin.__ΩEnvPluginContext,
210
199
  "context",
211
- () => _powerlines_deepkit_vendor_type.ReflectionClass,
212
200
  "readEnvReflection",
213
201
  "Reads the environment reflection data from the file system.",
214
- "Pn!2\"P\"7#`/$?%"
202
+ "Pn!2\"!`/#?$"
215
203
  ];
216
204
  /**
217
205
  * Reads the secret environment reflection data from the file system.
@@ -253,10 +241,9 @@ async function readSecretsReflection(context) {
253
241
  readSecretsReflection.__type = [
254
242
  () => require_types_plugin.__ΩEnvPluginContext,
255
243
  "context",
256
- () => _powerlines_deepkit_vendor_type.ReflectionClass,
257
244
  "readSecretsReflection",
258
245
  "Reads the secret environment reflection data from the file system.",
259
- "Pn!2\"P\"7#`/$?%"
246
+ "Pn!2\"!`/#?$"
260
247
  ];
261
248
  /**
262
249
  * Writes the environment reflection data to the file system.
@@ -274,14 +261,13 @@ async function writeEnvReflection(context, reflection, name = "env") {
274
261
  writeEnvReflection.__type = [
275
262
  () => require_types_plugin.__ΩEnvPluginContext,
276
263
  "context",
277
- () => _powerlines_deepkit_vendor_type.ReflectionClass,
278
264
  "reflection",
279
265
  () => require_types_plugin.__ΩEnvType,
280
266
  "name",
281
267
  () => "env",
282
268
  "writeEnvReflection",
283
269
  "Writes the environment reflection data to the file system.",
284
- "Pn!2\"P\"7#2$n%2&>'\"/(?)"
270
+ "Pn!2\"!2#n$2%>&\"/'?("
285
271
  ];
286
272
  /**
287
273
  * Writes the environment reflection data to the file system.
@@ -299,14 +285,13 @@ function writeEnvReflectionSync(context, reflection, name = "env") {
299
285
  writeEnvReflectionSync.__type = [
300
286
  () => require_types_plugin.__ΩEnvPluginContext,
301
287
  "context",
302
- () => _powerlines_deepkit_vendor_type.ReflectionClass,
303
288
  "reflection",
304
289
  () => require_types_plugin.__ΩEnvType,
305
290
  "name",
306
291
  () => "env",
307
292
  "writeEnvReflectionSync",
308
293
  "Writes the environment reflection data to the file system.",
309
- "Pn!2\"P\"7#2$n%2&>'\"/(?)"
294
+ "Pn!2\"!2#n$2%>&\"/'?("
310
295
  ];
311
296
 
312
297
  //#endregion
@@ -1,10 +1,9 @@
1
- import { __ΩEnvPluginContext, __ΩEnvPluginResolvedConfig, __ΩEnvType } from "../types/plugin.mjs";
1
+ import { __ΩEnvPluginContext, __ΩEnvType } from "../types/plugin.mjs";
2
2
  import { createEnvReflection } from "./reflect.mjs";
3
- import { ReflectionClass, ReflectionKind, deserializeType, resolveClassType } from "@powerlines/deepkit/vendor/type";
4
- import { __ΩContext, __ΩUnresolvedContext } from "powerlines";
5
3
  import { convertFromCapnp, convertToCapnp } from "@powerlines/deepkit/capnp";
6
4
  import { getReflectionsPath } from "@powerlines/deepkit/resolve-reflections";
7
5
  import { SerializedTypes } from "@powerlines/deepkit/schemas/reflection";
6
+ import { ReflectionKind, deserializeType, resolveClassType } from "@powerlines/deepkit/vendor/type";
8
7
  import * as capnp from "@stryke/capnp";
9
8
  import { readFileBuffer, writeFileBuffer, writeFileBufferSync } from "@stryke/fs/buffer";
10
9
  import { joinPaths } from "@stryke/path/join-paths";
@@ -24,12 +23,10 @@ async function resolveRuntimeTypeFile(context) {
24
23
  return resolved;
25
24
  }
26
25
  resolveRuntimeTypeFile.__type = [
27
- () => __ΩUnresolvedContext,
28
- () => __ΩEnvPluginResolvedConfig,
29
26
  "context",
30
27
  "resolveRuntimeTypeFile",
31
28
  "Resolves the runtime type definition file for the environment variables.",
32
- "Pn\"o!\"2#&`/$?%"
29
+ "P!2!&`/\"?#"
33
30
  ];
34
31
  /**
35
32
  * Gets the default type definition for the environment variables.
@@ -44,12 +41,10 @@ async function getEnvDefaultTypeDefinition(context) {
44
41
  };
45
42
  }
46
43
  getEnvDefaultTypeDefinition.__type = [
47
- () => __ΩUnresolvedContext,
48
- () => __ΩEnvPluginResolvedConfig,
49
44
  "context",
50
45
  "getEnvDefaultTypeDefinition",
51
46
  "Gets the default type definition for the environment variables.",
52
- "Pn\"o!\"2#!`/$?%"
47
+ "P!2!!`/\"?#"
53
48
  ];
54
49
  /** Gets the default type definition for the environment secrets.
55
50
  *
@@ -63,11 +58,9 @@ async function getSecretsDefaultTypeDefinition(context) {
63
58
  };
64
59
  }
65
60
  getSecretsDefaultTypeDefinition.__type = [
66
- () => __ΩUnresolvedContext,
67
- () => __ΩEnvPluginResolvedConfig,
68
61
  "context",
69
62
  "getSecretsDefaultTypeDefinition",
70
- "Pn\"o!\"2#!`/$"
63
+ "P!2!!`/\""
71
64
  ];
72
65
  /**
73
66
  * Gets the path to the environment type reflections.
@@ -80,15 +73,13 @@ function getEnvTypeReflectionsPath(context, name = "env") {
80
73
  return joinPaths(getReflectionsPath(context), "env", `${name}-types.bin`);
81
74
  }
82
75
  getEnvTypeReflectionsPath.__type = [
83
- () => __ΩContext,
84
- () => __ΩEnvPluginResolvedConfig,
85
76
  "context",
86
77
  () => __ΩEnvType,
87
78
  "name",
88
79
  () => "env",
89
80
  "getEnvTypeReflectionsPath",
90
81
  "Gets the path to the environment type reflections.",
91
- "Pn\"o!\"2#n$2%>&&/'?("
82
+ "P!2!n\"2#>$&/%?&"
92
83
  ];
93
84
  /**
94
85
  * Reads the environment type reflection from the file system.
@@ -124,10 +115,9 @@ readEnvTypeReflection.__type = [
124
115
  () => __ΩEnvType,
125
116
  "name",
126
117
  () => "env",
127
- () => ReflectionClass,
128
118
  "readEnvTypeReflection",
129
119
  "Reads the environment type reflection from the file system.",
130
- "Pn!2\"n#2$>%P\"7&`/'?("
120
+ "Pn!2\"n#2$>%!`/&?'"
131
121
  ];
132
122
  /**
133
123
  * Writes the environment type reflection to the file system.
@@ -145,14 +135,13 @@ async function writeEnvTypeReflection(context, reflection, name = "env") {
145
135
  writeEnvTypeReflection.__type = [
146
136
  () => __ΩEnvPluginContext,
147
137
  "context",
148
- () => ReflectionClass,
149
138
  "reflection",
150
139
  () => __ΩEnvType,
151
140
  "name",
152
141
  () => "env",
153
142
  "writeEnvTypeReflection",
154
143
  "Writes the environment type reflection to the file system.",
155
- "Pn!2\"P\"7#2$n%2&>'\"/(?)"
144
+ "Pn!2\"!2#n$2%>&\"/'?("
156
145
  ];
157
146
  function getEnvReflectionsPath(context, name) {
158
147
  return joinPaths(getReflectionsPath(context), "env", `${name}.bin`);
@@ -205,10 +194,9 @@ async function readEnvReflection(context) {
205
194
  readEnvReflection.__type = [
206
195
  () => __ΩEnvPluginContext,
207
196
  "context",
208
- () => ReflectionClass,
209
197
  "readEnvReflection",
210
198
  "Reads the environment reflection data from the file system.",
211
- "Pn!2\"P\"7#`/$?%"
199
+ "Pn!2\"!`/#?$"
212
200
  ];
213
201
  /**
214
202
  * Reads the secret environment reflection data from the file system.
@@ -250,10 +238,9 @@ async function readSecretsReflection(context) {
250
238
  readSecretsReflection.__type = [
251
239
  () => __ΩEnvPluginContext,
252
240
  "context",
253
- () => ReflectionClass,
254
241
  "readSecretsReflection",
255
242
  "Reads the secret environment reflection data from the file system.",
256
- "Pn!2\"P\"7#`/$?%"
243
+ "Pn!2\"!`/#?$"
257
244
  ];
258
245
  /**
259
246
  * Writes the environment reflection data to the file system.
@@ -271,14 +258,13 @@ async function writeEnvReflection(context, reflection, name = "env") {
271
258
  writeEnvReflection.__type = [
272
259
  () => __ΩEnvPluginContext,
273
260
  "context",
274
- () => ReflectionClass,
275
261
  "reflection",
276
262
  () => __ΩEnvType,
277
263
  "name",
278
264
  () => "env",
279
265
  "writeEnvReflection",
280
266
  "Writes the environment reflection data to the file system.",
281
- "Pn!2\"P\"7#2$n%2&>'\"/(?)"
267
+ "Pn!2\"!2#n$2%>&\"/'?("
282
268
  ];
283
269
  /**
284
270
  * Writes the environment reflection data to the file system.
@@ -296,14 +282,13 @@ function writeEnvReflectionSync(context, reflection, name = "env") {
296
282
  writeEnvReflectionSync.__type = [
297
283
  () => __ΩEnvPluginContext,
298
284
  "context",
299
- () => ReflectionClass,
300
285
  "reflection",
301
286
  () => __ΩEnvType,
302
287
  "name",
303
288
  () => "env",
304
289
  "writeEnvReflectionSync",
305
290
  "Writes the environment reflection data to the file system.",
306
- "Pn!2\"P\"7#2$n%2&>'\"/(?)"
291
+ "Pn!2\"!2#n$2%>&\"/'?("
307
292
  ];
308
293
 
309
294
  //#endregion