@powerlines/plugin-env 0.16.237 → 0.16.240

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.
Files changed (40) hide show
  1. package/dist/babel/plugin.cjs +1 -1
  2. package/dist/babel/plugin.mjs +1 -1
  3. package/dist/components/docs.cjs +2 -2
  4. package/dist/components/docs.mjs +3 -3
  5. package/dist/components/docs.mjs.map +1 -1
  6. package/dist/components/env-builtin.cjs +14 -18
  7. package/dist/components/env-builtin.d.cts +1 -1
  8. package/dist/components/env-builtin.d.mts +1 -1
  9. package/dist/components/env-builtin.mjs +12 -16
  10. package/dist/components/env-builtin.mjs.map +1 -1
  11. package/dist/helpers/index.cjs +3 -1
  12. package/dist/helpers/index.d.cts +2 -2
  13. package/dist/helpers/index.d.mts +2 -2
  14. package/dist/helpers/index.mjs +2 -2
  15. package/dist/helpers/load.d.cts +2 -2
  16. package/dist/helpers/load.d.mts +2 -2
  17. package/dist/helpers/schema.cjs +48 -9
  18. package/dist/helpers/schema.d.cts +17 -4
  19. package/dist/helpers/schema.d.cts.map +1 -1
  20. package/dist/helpers/schema.d.mts +17 -4
  21. package/dist/helpers/schema.d.mts.map +1 -1
  22. package/dist/helpers/schema.mjs +48 -11
  23. package/dist/helpers/schema.mjs.map +1 -1
  24. package/dist/index.cjs +3 -3
  25. package/dist/index.d.cts +2 -2
  26. package/dist/index.d.mts +2 -2
  27. package/dist/index.mjs +4 -4
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/types/index.cjs +1 -1
  30. package/dist/types/index.d.cts +2 -2
  31. package/dist/types/index.d.mts +2 -2
  32. package/dist/types/index.mjs +2 -2
  33. package/dist/types/plugin.cjs +15 -5
  34. package/dist/types/plugin.d.cts +7 -4
  35. package/dist/types/plugin.d.cts.map +1 -1
  36. package/dist/types/plugin.d.mts +8 -5
  37. package/dist/types/plugin.d.mts.map +1 -1
  38. package/dist/types/plugin.mjs +15 -5
  39. package/dist/types/plugin.mjs.map +1 -1
  40. package/package.json +9 -9
@@ -1,10 +1,10 @@
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_schema = require("@powerlines/schema");
4
5
  let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
5
6
  let _powerlines_plugin_babel_helpers_create_plugin = require("@powerlines/plugin-babel/helpers/create-plugin");
6
7
  let _powerlines_plugin_babel_helpers_module_helpers = require("@powerlines/plugin-babel/helpers/module-helpers");
7
- let _powerlines_schema = require("@powerlines/schema");
8
8
  let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
9
9
 
10
10
  //#region src/babel/plugin.ts
@@ -1,8 +1,8 @@
1
1
  import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
+ import { getProperties, stringifyValue } from "@powerlines/schema";
2
3
  import { isSetObject } from "@stryke/type-checks/is-set-object";
3
4
  import { createBabelPlugin } from "@powerlines/plugin-babel/helpers/create-plugin";
4
5
  import { addImport } from "@powerlines/plugin-babel/helpers/module-helpers";
5
- import { getProperties, stringifyValue } from "@powerlines/schema";
6
6
  import { isUndefined } from "@stryke/type-checks/is-undefined";
7
7
 
8
8
  //#region src/babel/plugin.ts
@@ -2,6 +2,7 @@ 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
  let _powerlines_schema_helpers = require("@powerlines/schema/helpers");
5
+ let _stryke_path_join = require("@stryke/path/join");
5
6
  let powerlines_plugin_utils = require("powerlines/plugin-utils");
6
7
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
8
  let _alloy_js_core = require("@alloy-js/core");
@@ -12,7 +13,6 @@ let _powerlines_plugin_alloy_markdown_components_heading = require("@powerlines/
12
13
  let _powerlines_plugin_alloy_markdown_components_markdown_file = require("@powerlines/plugin-alloy/markdown/components/markdown-file");
13
14
  let _powerlines_plugin_alloy_markdown_components_markdown_table = require("@powerlines/plugin-alloy/markdown/components/markdown-table");
14
15
  let _powerlines_schema_codegen = require("@powerlines/schema/codegen");
15
- let _stryke_path_join = require("@stryke/path/join");
16
16
 
17
17
  //#region src/components/docs.tsx
18
18
  const __ΩPartial = [
@@ -72,7 +72,7 @@ function EnvDocsFile(props) {
72
72
  _alloy_js_core.code`The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text.`,
73
73
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
74
74
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_markdown_components_markdown_table.MarkdownTable, { get data() {
75
- return Object.values((0, _powerlines_schema_helpers.getProperties)(context.env.vars)).filter(__assignType((property) => !property?.metadata?.isHidden && !property?.metadata?.isIgnored && !property?.metadata?.isReadonly && !property?.metadata?.isInternal, [
75
+ return (0, _powerlines_schema_helpers.getPropertiesList)(context.env.vars).filter(__assignType((property) => context.env.vars.active?.includes(property.name) && !property?.metadata?.isHidden && !property?.metadata?.isIgnored && !property?.metadata?.isReadonly && !property?.metadata?.isInternal, [
76
76
  "property",
77
77
  "",
78
78
  "P\"2!\"/\""
@@ -1,5 +1,6 @@
1
1
  import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
- import { getProperties } from "@powerlines/schema/helpers";
2
+ import { getPropertiesList } from "@powerlines/schema/helpers";
3
+ import { joinPaths } from "@stryke/path/join";
3
4
  import { getDocsOutputPath } from "powerlines/plugin-utils";
4
5
  import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
5
6
  import { Show, code } from "@alloy-js/core";
@@ -10,7 +11,6 @@ import { Heading } from "@powerlines/plugin-alloy/markdown/components/heading";
10
11
  import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
11
12
  import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
12
13
  import { stringifyType } from "@powerlines/schema/codegen";
13
- import { joinPaths } from "@stryke/path/join";
14
14
 
15
15
  //#region src/components/docs.tsx
16
16
  const __ΩPartial = [
@@ -70,7 +70,7 @@ function EnvDocsFile(props) {
70
70
  code`The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text.`,
71
71
  createComponent(Spacing, {}),
72
72
  createComponent(MarkdownTable, { get data() {
73
- return Object.values(getProperties(context.env.vars)).filter(__assignType((property) => !property?.metadata?.isHidden && !property?.metadata?.isIgnored && !property?.metadata?.isReadonly && !property?.metadata?.isInternal, [
73
+ return getPropertiesList(context.env.vars).filter(__assignType((property) => context.env.vars.active?.includes(property.name) && !property?.metadata?.isHidden && !property?.metadata?.isIgnored && !property?.metadata?.isReadonly && !property?.metadata?.isInternal, [
74
74
  "property",
75
75
  "",
76
76
  "P\"2!\"/\""
@@ -1 +1 @@
1
- {"version":3,"file":"docs.mjs","names":[],"sources":["../../src/components/docs.tsx"],"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 { code, Show } from \"@alloy-js/core\";\nimport { Link } from \"@alloy-js/markdown\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { Heading } from \"@powerlines/plugin-alloy/markdown/components/heading\";\nimport {\n MarkdownFile,\n MarkdownFileProps\n} from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { stringifyType } from \"@powerlines/schema/codegen\";\nimport { getProperties } from \"@powerlines/schema/helpers\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { getDocsOutputPath } from \"powerlines/plugin-utils\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\nexport interface EnvDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n}\n\n/**\n * Generates the environment configuration markdown documentation for the Powerlines project.\n */\nexport function EnvDocsFile(props: EnvDocsFileProps) {\n const { levelOffset = 0, ...rest } = props;\n\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context.config.root), \"env.md\")}\n {...rest}>\n <Heading level={1 + levelOffset}>Environment Configuration</Heading>\n {code`Below is a list of environment variables used by the`}\n <Show when={!!context.packageJson.name}>\n <Link\n href={`https://www.npmjs.com/package/${context.packageJson.name}`}\n title={context.packageJson.name!}\n />\n </Show>\n {code`package. These values can be updated in the \\`.env\\` file in the root of the project.`}\n <Spacing />\n <Heading level={2 + levelOffset}>Environment Variables</Heading>\n <Spacing />\n {code`The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text.`}\n <Spacing />\n <MarkdownTable\n data={\n Object.values(getProperties(context.env.vars))\n .filter(\n property =>\n !property?.metadata?.isHidden &&\n !property?.metadata?.isIgnored &&\n !property?.metadata?.isReadonly &&\n !property?.metadata?.isInternal\n )\n .sort((a, b) =>\n !a.metadata?.name && !b.metadata?.name\n ? 0\n : !a.metadata?.name\n ? 1\n : !b.metadata?.name\n ? -1\n : a.metadata?.name.localeCompare(b.metadata?.name)\n )\n .map(property => {\n return {\n name: property.metadata?.name?.trim(),\n description: (property.metadata?.description ?? \"\").trim(),\n type: stringifyType(property)\n .trim()\n .replaceAll(/\\s*(?:\\||&)\\s*/g, \", or \"),\n defaultValue: property.metadata?.defaultValue\n ? stringifyType(property.metadata.defaultValue)\n : \"\",\n required: property.optional ? \"\" : \"✔\"\n };\n }) ?? []\n }\n />\n </MarkdownFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;CAC/B,GAAG,SAAU;CACb,OAAQ;AACT;AA6BA,MAAK,sBAAkB;OAAU;CAAa;CAAU;CAAA;CAAa;CAAA;AAAA;;;;AAKrE,SAAM,YAAa,OAAA;CACjB,MAAE,EACF,cAAc,GAChB,GAAA;CAEE,MAAA,WAAA,cAAA,IAAA,CAAA,OAAA,qBAAA,IAAA,CAAA,GAAA,cAAA;CACA,OAAC,gBAAc,cAAY,WAAuB,EAClD,IAAA,OAAA;EACI,OAAC,UAAS,kBAAmB,QAAA,OAAkB,IAAA,GAAA,QAAA;CACnD,aAEA,IAAM,WAAU;;;IAEV,OAAC,IAAA;IACJ,UAAA;GACC,CAAA;GAAI,IAAE;GAA0D,gBAAC,MAAA;IAC/D,IAAE,OAAK;KACR,OAAQ,CAAA,CAAA,QAAW,YAAa;IAChC;IACA,IAAK,WAAQ;KACX,OAAA,gBAAA,MAAA;MACC,IAAM,OAAO;OACb,OAAO,iCAAyB,QAAA,YAAA;MACjC;MACG,IAAA,QAAA;OACA,OAAS,QAAM,YAAc;MAClC;KACA,CAAA;IACA;GACD,CAAC;GAAA,IAAK;GAA0F,gBAAkB,SAAA,CAAW,CAAC;GAAC,gBAAmB,SAAS;IAC1J,OAAQ,IAAC;IACT,UAAA;GACD,CAAC;GAAC,gBAAK,SAAA,CAAA,CAAA;GAAA,IAAA;GAAA,gBAAA,SAAA,CAAA,CAAA;GAAA,gBAAA,eAAA,EACL,IAAE,OAAO;IACP,OAAG,OAAM,OAAA,cAAA,QAAA,IAAA,IAAA,CAAA,EAAA,OAAA,cAAA,aAAA,CAAA,UAAA,UAAA,YAAA,CAAA,UAAA,UAAA,aAAA,CAAA,UAAA,UAAA,cAAA,CAAA,UAAA,UAAA,YAAA;KAAA;KAAA;KAAA;IAAA,CAAA,CAAA,EAAA,KAAA,cAAA,GAAA,MAAA,CAAA,EAAA,UAAA,QAAA,CAAA,EAAA,UAAA,OAAA,IAAA,CAAA,EAAA,UAAA,OAAA,IAAA,CAAA,EAAA,UAAA,OAAA,KAAA,EAAA,UAAA,KAAA,cAAA,EAAA,UAAA,IAAA,GAAA;KAAA;KAAA;KAAA;KAAA;IAAA,CAAA,CAAA,EAAA,IAAA,cAAA,aAAA;KACP,OAAE;MACA,MAAG,SAAU,UAAU,MAAQ,KAAE;MACjC,cAAa,SAAU,UAAU,eAAC,IAAA,KAAA;MAClC,MAAG,cAAU,QAAU,EAAA,KAAY,EAAA,WAAA,mBAAA,OAAA;MACnC,cAAa,SAAU,UAAA,eAAA,cAAA,SAAA,SAAA,YAAA,IAAA;MACzB,UAAA,SAAA,WAAA,KAAA;KACA;IACF,GAAG;KAAC;KAAY;KAAC;IAAW,CAAA,CAAA,KAAQ,CAAC;GACvC,EACF,CAAC;EAAC;CACJ,EACF,CAAC,CAAC;AACJ;AACA,YAAY,SAAS;OAAG;CAAe;CAAgB;CAAc;CAAA;AAAA"}
1
+ {"version":3,"file":"docs.mjs","names":[],"sources":["../../src/components/docs.tsx"],"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 { code, Show } from \"@alloy-js/core\";\nimport { Link } from \"@alloy-js/markdown\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { Heading } from \"@powerlines/plugin-alloy/markdown/components/heading\";\nimport {\n MarkdownFile,\n MarkdownFileProps\n} from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { stringifyType } from \"@powerlines/schema/codegen\";\nimport { getPropertiesList } from \"@powerlines/schema/helpers\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { getDocsOutputPath } from \"powerlines/plugin-utils\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\nexport interface EnvDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n}\n\n/**\n * Generates the environment configuration markdown documentation for the Powerlines project.\n */\nexport function EnvDocsFile(props: EnvDocsFileProps) {\n const { levelOffset = 0, ...rest } = props;\n\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context.config.root), \"env.md\")}\n {...rest}>\n <Heading level={1 + levelOffset}>Environment Configuration</Heading>\n {code`Below is a list of environment variables used by the`}\n <Show when={!!context.packageJson.name}>\n <Link\n href={`https://www.npmjs.com/package/${context.packageJson.name}`}\n title={context.packageJson.name!}\n />\n </Show>\n {code`package. These values can be updated in the \\`.env\\` file in the root of the project.`}\n <Spacing />\n <Heading level={2 + levelOffset}>Environment Variables</Heading>\n <Spacing />\n {code`The below list of environment variables are used as configuration parameters to drive the processing of the application. The data contained in these variables are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text.`}\n <Spacing />\n <MarkdownTable\n data={\n getPropertiesList(context.env.vars)\n .filter(\n property =>\n context.env.vars.active?.includes(property.name) &&\n !property?.metadata?.isHidden &&\n !property?.metadata?.isIgnored &&\n !property?.metadata?.isReadonly &&\n !property?.metadata?.isInternal\n )\n .sort((a, b) =>\n !a.metadata?.name && !b.metadata?.name\n ? 0\n : !a.metadata?.name\n ? 1\n : !b.metadata?.name\n ? -1\n : a.metadata?.name.localeCompare(b.metadata?.name)\n )\n .map(property => {\n return {\n name: property.metadata?.name?.trim(),\n description: (property.metadata?.description ?? \"\").trim(),\n type: stringifyType(property)\n .trim()\n .replaceAll(/\\s*(?:\\||&)\\s*/g, \", or \"),\n defaultValue: property.metadata?.defaultValue\n ? stringifyType(property.metadata.defaultValue)\n : \"\",\n required: property.optional ? \"\" : \"✔\"\n };\n }) ?? []\n }\n />\n </MarkdownFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;CAC/B,GAAG,SAAU;CACb,OAAQ;AACT;AA6BA,MAAK,sBAAkB;OAAU;CAAa;CAAU;CAAA;CAAa;CAAA;AAAA;;;;AAKrE,SAAM,YAAa,OAAA;CACjB,MAAE,EACF,cAAc,GAChB,GAAA;CAEE,MAAA,WAAA,cAAA,IAAA,CAAA,OAAA,qBAAA,IAAA,CAAA,GAAA,cAAA;CACA,OAAC,gBAAc,cAAY,WAAuB,EAClD,IAAA,OAAA;EACI,OAAC,UAAS,kBAAmB,QAAA,OAAkB,IAAA,GAAA,QAAA;CACnD,aAEA,IAAM,WAAU;;;IAEV,OAAC,IAAA;IACJ,UAAA;GACC,CAAA;GAAI,IAAE;GAA0D,gBAAC,MAAA;IAC/D,IAAE,OAAK;KACR,OAAQ,CAAA,CAAA,QAAW,YAAa;IAChC;IACA,IAAK,WAAQ;KACX,OAAA,gBAAA,MAAA;MACC,IAAM,OAAO;OACb,OAAO,iCAAyB,QAAA,YAAA;MACjC;MACG,IAAA,QAAA;OACA,OAAS,QAAM,YAAc;MAClC;KACA,CAAA;IACA;GACD,CAAC;GAAA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3
- const require_types_plugin = require('../types/plugin.cjs');
4
3
  const require_helpers_load = require('../helpers/load.cjs');
5
4
  let _powerlines_schema_helpers = require("@powerlines/schema/helpers");
6
5
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
@@ -9,11 +8,8 @@ let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plug
9
8
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
10
9
  let _alloy_js_typescript = require("@alloy-js/typescript");
11
10
  let _powerlines_plugin_alloy_helpers_refkey = require("@powerlines/plugin-alloy/helpers/refkey");
12
- let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
13
- let _powerlines_plugin_alloy_typescript_components_interface_declaration = require("@powerlines/plugin-alloy/typescript/components/interface-declaration");
14
- let _powerlines_plugin_alloy_typescript_components_object_declaration = require("@powerlines/plugin-alloy/typescript/components/object-declaration");
11
+ let _powerlines_plugin_alloy_typescript_components = require("@powerlines/plugin-alloy/typescript/components");
15
12
  let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
16
- let _powerlines_plugin_alloy_typescript_components_tsdoc_schema = require("@powerlines/plugin-alloy/typescript/components/tsdoc-schema");
17
13
  let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
18
14
 
19
15
  //#region src/components/env-builtin.tsx
@@ -45,9 +41,9 @@ function __assignType(fn, args) {
45
41
  * Generates the environment configuration typescript definition for the Powerlines project.
46
42
  */
47
43
  function EnvTypeDefinition() {
48
- const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [[() => require_types_plugin.__ΩEnvPluginContext, "n!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
44
+ const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["EnvPluginContext", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
49
45
  return [
50
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceDeclaration, {
46
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components.InterfaceDeclaration, {
51
47
  name: "UnprefixedEnv",
52
48
  get schema() {
53
49
  return context.env.vars.schema;
@@ -78,7 +74,7 @@ function EnvTypeDefinition() {
78
74
  get children() {
79
75
  return __assignType((prefix) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
80
76
  get each() {
81
- return Object.values((0, _powerlines_schema_helpers.getProperties)(context.env.vars.schema)).filter(__assignType((property) => !property.metadata?.isIgnored, [
77
+ return (0, _powerlines_schema_helpers.getPropertiesList)(context.env.vars.schema).filter(__assignType((property) => !property.metadata?.isIgnored, [
82
78
  "property",
83
79
  "",
84
80
  "P\"2!\"/\""
@@ -86,7 +82,7 @@ function EnvTypeDefinition() {
86
82
  },
87
83
  doubleHardline: true,
88
84
  get children() {
89
- return __assignType((property) => [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc_schema.TSDocSchemaProperty, { schema: property }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
85
+ return __assignType((property) => [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components.TSDocSchemaProperty, { schema: property }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components.InterfaceMember, {
90
86
  get name() {
91
87
  return `${prefix}_${property.metadata?.name}`;
92
88
  },
@@ -120,11 +116,11 @@ EnvTypeDefinition.__type = [
120
116
  "P\"/!?\""
121
117
  ];
122
118
  const __ΩConfigPropertyConditionalProps = [
123
- () => require_types_plugin.__ΩEnvPluginContext,
119
+ "EnvPluginContext",
124
120
  "context",
125
121
  "name",
126
122
  "ConfigPropertyConditionalProps",
127
- "P!n!4\"&4#Mw$y"
123
+ "P!\"w!4\"&4#Mw$y"
128
124
  ];
129
125
  function ConfigPropertyConditional(props) {
130
126
  const [{ context, name }] = (0, _alloy_js_core.splitProps)(props, ["context", "name"]);
@@ -147,12 +143,12 @@ ConfigPropertyConditional.__type = [
147
143
  ];
148
144
  const __ΩConfigPropertyProps = [
149
145
  "index",
150
- () => require_types_plugin.__ΩEnvPluginContext,
146
+ "EnvPluginContext",
151
147
  "context",
152
148
  "name",
153
149
  "property",
154
150
  "ConfigPropertyProps",
155
- "P!'4!n\"4#&4$!4%Mw&y"
151
+ "P!'4!\"w\"4#&4$!4%Mw&y"
156
152
  ];
157
153
  function ConfigPropertyGet(props) {
158
154
  const [{ context, name, property, index }] = (0, _alloy_js_core.splitProps)(props, [
@@ -325,9 +321,9 @@ const envRefkey = (0, _powerlines_plugin_alloy_helpers_refkey.refkey)("env");
325
321
  */
326
322
  function EnvBuiltin(props) {
327
323
  const [{ defaultConfig, children }, rest] = (0, _alloy_js_core.splitProps)(props, ["defaultConfig", "children"]);
328
- const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [[() => require_types_plugin.__ΩEnvPluginContext, "n!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
324
+ const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["EnvPluginContext", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
329
325
  const defaultValue = (0, _alloy_js_core.computed)(() => context && require_helpers_load.loadEnvFromContext(context, process.env));
330
- const reflectionGetProperties = (0, _alloy_js_core.computed)(() => Object.values((0, _powerlines_schema_helpers.getProperties)(context.env.vars.schema)).filter(__assignType((property) => !property.metadata?.isIgnored, [
326
+ const reflectionGetProperties = (0, _alloy_js_core.computed)(() => (0, _powerlines_schema_helpers.getPropertiesList)(context.env.vars.schema).filter(__assignType((property) => !property.metadata?.isIgnored, [
331
327
  "property",
332
328
  "",
333
329
  "P\"2!\"/\""
@@ -337,7 +333,7 @@ function EnvBuiltin(props) {
337
333
  "",
338
334
  "P\"2!\"2\"\"/#"
339
335
  ])) ?? []);
340
- const reflectionSetProperties = (0, _alloy_js_core.computed)(() => Object.values((0, _powerlines_schema_helpers.getProperties)(context.env.vars.schema)).filter(__assignType((property) => !property.metadata?.isIgnored && !property.metadata?.isReadonly, [
336
+ const reflectionSetProperties = (0, _alloy_js_core.computed)(() => (0, _powerlines_schema_helpers.getPropertiesList)(context.env.vars.schema).filter(__assignType((property) => !property.metadata?.isIgnored && !property.metadata?.isReadonly, [
341
337
  "property",
342
338
  "",
343
339
  "P\"2!\"/\""
@@ -347,7 +343,7 @@ function EnvBuiltin(props) {
347
343
  "",
348
344
  "P\"2!\"2\"\"/#"
349
345
  ])) ?? []);
350
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
346
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
351
347
  id: "env",
352
348
  description: "The environment configuration module provides an interface to define environment configuration parameters."
353
349
  }, rest, { get children() {
@@ -360,7 +356,7 @@ function EnvBuiltin(props) {
360
356
  return [(0, _alloy_js_core_jsx_runtime.createComponent)(EnvTypeDefinition, { defaultValue }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})];
361
357
  }
362
358
  }),
363
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_object_declaration.ObjectDeclaration, {
359
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components.ObjectDeclaration, {
364
360
  name: "initialEnv",
365
361
  type: "Partial<Env>",
366
362
  get schema() {
@@ -1,5 +1,5 @@
1
1
  import { Children } from "@alloy-js/core";
2
- import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
2
+ import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components";
3
3
 
4
4
  //#region src/components/env-builtin.d.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Children } from "@alloy-js/core";
2
- import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
2
+ import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components";
3
3
 
4
4
  //#region src/components/env-builtin.d.ts
5
5
  /**
@@ -1,17 +1,13 @@
1
- import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
1
  import { loadEnvFromContext } from "../helpers/load.mjs";
3
- import { getProperties } from "@powerlines/schema/helpers";
2
+ import { getPropertiesList } from "@powerlines/schema/helpers";
4
3
  import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
5
4
  import { For, Show, code, computed, splitProps } from "@alloy-js/core";
6
5
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
7
6
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
- import { ElseIfClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, InterfaceMember, VarDeclaration } from "@alloy-js/typescript";
7
+ import { ElseIfClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, VarDeclaration } from "@alloy-js/typescript";
9
8
  import { refkey } from "@powerlines/plugin-alloy/helpers/refkey";
10
- import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
11
- import { InterfaceDeclaration as InterfaceDeclaration$1 } from "@powerlines/plugin-alloy/typescript/components/interface-declaration";
12
- import { ObjectDeclaration } from "@powerlines/plugin-alloy/typescript/components/object-declaration";
9
+ import { BuiltinFile, InterfaceDeclaration as InterfaceDeclaration$1, InterfaceMember, ObjectDeclaration, TSDocSchemaProperty } from "@powerlines/plugin-alloy/typescript/components";
13
10
  import { TSDoc, TSDocParam, TSDocRemarks, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
14
- import { TSDocSchemaProperty } from "@powerlines/plugin-alloy/typescript/components/tsdoc-schema";
15
11
  import { getUnique } from "@stryke/helpers/get-unique";
16
12
 
17
13
  //#region src/components/env-builtin.tsx
@@ -43,7 +39,7 @@ function __assignType(fn, args) {
43
39
  * Generates the environment configuration typescript definition for the Powerlines project.
44
40
  */
45
41
  function EnvTypeDefinition() {
46
- const context = (usePowerlines.Ω = [[() => __ΩEnvPluginContext, "n!"]], usePowerlines());
42
+ const context = (usePowerlines.Ω = [["EnvPluginContext", "\"w!"]], usePowerlines());
47
43
  return [
48
44
  createComponent(InterfaceDeclaration$1, {
49
45
  name: "UnprefixedEnv",
@@ -76,7 +72,7 @@ function EnvTypeDefinition() {
76
72
  get children() {
77
73
  return __assignType((prefix) => createComponent(For, {
78
74
  get each() {
79
- return Object.values(getProperties(context.env.vars.schema)).filter(__assignType((property) => !property.metadata?.isIgnored, [
75
+ return getPropertiesList(context.env.vars.schema).filter(__assignType((property) => !property.metadata?.isIgnored, [
80
76
  "property",
81
77
  "",
82
78
  "P\"2!\"/\""
@@ -118,11 +114,11 @@ EnvTypeDefinition.__type = [
118
114
  "P\"/!?\""
119
115
  ];
120
116
  const __ΩConfigPropertyConditionalProps = [
121
- () => __ΩEnvPluginContext,
117
+ "EnvPluginContext",
122
118
  "context",
123
119
  "name",
124
120
  "ConfigPropertyConditionalProps",
125
- "P!n!4\"&4#Mw$y"
121
+ "P!\"w!4\"&4#Mw$y"
126
122
  ];
127
123
  function ConfigPropertyConditional(props) {
128
124
  const [{ context, name }] = splitProps(props, ["context", "name"]);
@@ -145,12 +141,12 @@ ConfigPropertyConditional.__type = [
145
141
  ];
146
142
  const __ΩConfigPropertyProps = [
147
143
  "index",
148
- () => __ΩEnvPluginContext,
144
+ "EnvPluginContext",
149
145
  "context",
150
146
  "name",
151
147
  "property",
152
148
  "ConfigPropertyProps",
153
- "P!'4!n\"4#&4$!4%Mw&y"
149
+ "P!'4!\"w\"4#&4$!4%Mw&y"
154
150
  ];
155
151
  function ConfigPropertyGet(props) {
156
152
  const [{ context, name, property, index }] = splitProps(props, [
@@ -323,9 +319,9 @@ const envRefkey = refkey("env");
323
319
  */
324
320
  function EnvBuiltin(props) {
325
321
  const [{ defaultConfig, children }, rest] = splitProps(props, ["defaultConfig", "children"]);
326
- const context = (usePowerlines.Ω = [[() => __ΩEnvPluginContext, "n!"]], usePowerlines());
322
+ const context = (usePowerlines.Ω = [["EnvPluginContext", "\"w!"]], usePowerlines());
327
323
  const defaultValue = computed(() => context && loadEnvFromContext(context, process.env));
328
- const reflectionGetProperties = computed(() => Object.values(getProperties(context.env.vars.schema)).filter(__assignType((property) => !property.metadata?.isIgnored, [
324
+ const reflectionGetProperties = computed(() => getPropertiesList(context.env.vars.schema).filter(__assignType((property) => !property.metadata?.isIgnored, [
329
325
  "property",
330
326
  "",
331
327
  "P\"2!\"/\""
@@ -335,7 +331,7 @@ function EnvBuiltin(props) {
335
331
  "",
336
332
  "P\"2!\"2\"\"/#"
337
333
  ])) ?? []);
338
- const reflectionSetProperties = computed(() => Object.values(getProperties(context.env.vars.schema)).filter(__assignType((property) => !property.metadata?.isIgnored && !property.metadata?.isReadonly, [
334
+ const reflectionSetProperties = computed(() => getPropertiesList(context.env.vars.schema).filter(__assignType((property) => !property.metadata?.isIgnored && !property.metadata?.isReadonly, [
339
335
  "property",
340
336
  "",
341
337
  "P\"2!\"/\""
@@ -1 +1 @@
1
- {"version":3,"file":"env-builtin.mjs","names":[],"sources":["../../src/components/env-builtin.tsx"],"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 Children,\n code,\n computed,\n For,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n InterfaceDeclaration as BaseInterfaceDeclaration,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceMember,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { refkey } from \"@powerlines/plugin-alloy/helpers/refkey\";\nimport { ComponentProps } from \"@powerlines/plugin-alloy/types/components\";\nimport {\n BuiltinFile,\n BuiltinFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { InterfaceDeclaration } from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport { ObjectDeclaration } from \"@powerlines/plugin-alloy/typescript/components/object-declaration\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TSDocSchemaProperty } from \"@powerlines/plugin-alloy/typescript/components/tsdoc-schema\";\nimport { JTDSchemaType } from \"@powerlines/schema\";\nimport { getProperties } from \"@powerlines/schema/helpers\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { loadEnvFromContext } from \"../helpers/load\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Generates the environment configuration typescript definition for the Powerlines project.\n */\nexport function EnvTypeDefinition() {\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n name=\"UnprefixedEnv\"\n schema={context.env.vars.schema}\n export\n />\n <Spacing />\n <TSDoc heading=\"The environment configuration object with prefixed keys.\">\n <TSDocRemarks>\n {`The \\`Env\\` type extends the \\`UnprefixedEnv\\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.`}\n </TSDocRemarks>\n </TSDoc>\n <BaseInterfaceDeclaration name=\"Env\" export extends=\"UnprefixedEnv\">\n <For\n each={getUnique(context.config.env.prefix).map(prefix =>\n prefix.replace(/_$/, \"\")\n )}\n doubleHardline>\n {prefix => (\n <For\n each={\n Object.values(getProperties(context.env.vars.schema)).filter(\n property => !property.metadata?.isIgnored\n ) ?? []\n }\n doubleHardline>\n {property => (\n <>\n <TSDocSchemaProperty schema={property} />\n <InterfaceMember\n name={`${prefix}_${property.metadata?.name}`}\n type={`UnprefixedEnv[\"${property.metadata?.name}\"]`}\n isReadonly={property.metadata?.isReadonly}\n />\n </>\n )}\n </For>\n )}\n </For>\n </BaseInterfaceDeclaration>\n <Spacing />\n </>\n );\n}\n\ninterface ConfigPropertyConditionalProps extends ComponentProps {\n context: EnvPluginContext;\n name: string;\n}\n\nfunction ConfigPropertyConditional(props: ConfigPropertyConditionalProps) {\n const [{ context, name }] = splitProps(props, [\"context\", \"name\"]);\n\n return code`propertyName === \"${name}\" || propertyName.replace(/^(${getUnique(\n context.config.env.prefix\n .sort((a, b) =>\n a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b)\n )\n .map(prefix => `${prefix.replace(/_$/, \"\")}_`)\n ).join(\"|\")})/g, \"\").toLowerCase().replace(/[\\\\s\\\\-_]+/g, \"\") === \"${name\n .toLowerCase()\n .replace(/[\\s\\-_]+/g, \"\")}\"`;\n}\n\ninterface ConfigPropertyProps extends ComponentProps {\n index: number;\n context: EnvPluginContext;\n name: string;\n property: JTDSchemaType;\n}\n\nfunction ConfigPropertyGet(props: ConfigPropertyProps) {\n const [{ context, name, property, index }] = splitProps(props, [\n \"context\",\n \"name\",\n \"property\",\n \"index\"\n ]);\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show\n when={\n property.metadata?.alias &&\n property.metadata?.alias.length > 0\n }>\n {code` || `}\n <For each={property.metadata?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${name}\"];`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show\n when={\n property.metadata?.alias &&\n property.metadata?.alias.length > 0\n }>\n {code` || `}\n <For each={property.metadata?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${name}\"];`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nfunction ConfigPropertySet(props: ConfigPropertyProps) {\n const [{ context, name, property, index }] = splitProps(props, [\n \"context\",\n \"name\",\n \"property\",\n \"index\"\n ]);\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show\n when={\n property.metadata?.alias &&\n property.metadata?.alias.length > 0\n }>\n {code` || `}\n <For each={property.metadata?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${name}\"] = newValue;\n return true;\n`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show\n when={\n property.metadata?.alias &&\n property.metadata?.alias.length > 0\n }>\n {code` || `}\n <For each={property.metadata?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${name}\"] = newValue;\n return true;\n`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nexport interface EnvBuiltinProps extends Omit<BuiltinFileProps, \"id\"> {\n defaultConfig?: Children;\n}\n\nconst createEnvRefkey = refkey(\"createEnv\");\nconst envRefkey = refkey(\"env\");\n\n/**\n * Generates the environment configuration module for the Powerlines project.\n */\nexport function EnvBuiltin(props: EnvBuiltinProps) {\n const [{ defaultConfig, children }, rest] = splitProps(props, [\n \"defaultConfig\",\n \"children\"\n ]);\n\n const context = usePowerlines<EnvPluginContext>();\n const defaultValue = computed(\n () => context && loadEnvFromContext(context, process.env)\n );\n\n const reflectionGetProperties = computed(\n () =>\n Object.values(getProperties(context.env.vars.schema))\n .filter(property => !property.metadata?.isIgnored)\n .sort((a, b) =>\n !a.metadata?.name && !b.metadata?.name\n ? 0\n : !a.metadata?.name\n ? 1\n : !b.metadata?.name\n ? -1\n : a.metadata?.name.localeCompare(b.metadata?.name)\n ) ?? []\n );\n const reflectionSetProperties = computed(\n () =>\n Object.values(getProperties(context.env.vars.schema))\n .filter(\n property =>\n !property.metadata?.isIgnored && !property.metadata?.isReadonly\n )\n .sort((a, b) =>\n !a.metadata?.name && !b.metadata?.name\n ? 0\n : !a.metadata?.name\n ? 1\n : !b.metadata?.name\n ? -1\n : a.metadata?.name.localeCompare(b.metadata?.name)\n ) ?? []\n );\n\n return (\n <BuiltinFile\n id=\"env\"\n description=\"The environment configuration module provides an interface to define environment configuration parameters.\"\n {...rest}>\n <Show when={Boolean(context.env.vars.schema)}>\n <EnvTypeDefinition defaultValue={defaultValue} />\n <Spacing />\n </Show>\n <ObjectDeclaration\n name=\"initialEnv\"\n type=\"Partial<Env>\"\n schema={context.env.vars.schema}\n export\n const\n doc=\"The initial environment configuration object values for the runtime.\"\n />\n <Spacing />\n <TSDoc heading=\"Initializes the Powerlines environment configuration module.\">\n <TSDocRemarks>\n {`This function initializes the Powerlines environment configuration object.`}\n </TSDocRemarks>\n <TSDocParam name=\"environmentConfig\">\n {`The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`}\n </TSDocParam>\n <TSDocReturns>\n {`The initialized Powerlines configuration object.`}\n </TSDocReturns>\n </TSDoc>\n <Show when={Boolean(context?.entryPath)}>\n <FunctionDeclaration\n refkey={createEnvRefkey}\n async={false}\n export\n name=\"createEnv\"\n parameters={[\n {\n name: \"environmentConfig\",\n type: `Partial<Env>`,\n optional: false,\n default: \"{}\"\n }\n ]}\n returnType=\"Env\">\n {code`\n return new Proxy<Env>(\n deserializeEnv({\n ...initialEnv,\n ...environmentConfig\n } as Env),\n {\n get: (target: UnprefixedEnv, propertyName: string) => { `}\n <hbr />\n <For each={reflectionGetProperties.value}>\n {(property: JTDSchemaType & { name: string }, index: number) => (\n <ConfigPropertyGet\n index={index}\n context={context}\n name={property.name}\n property={property}\n />\n )}\n </For>\n {code`\n return undefined;\n }, `}\n\n <Spacing />\n {code` set: (target: UnprefixedEnv, propertyName: string, newValue: any) => { `}\n <hbr />\n <For each={reflectionSetProperties.value} ender={code` else `}>\n {(property: JTDSchemaType & { name: string }, index: number) => (\n <ConfigPropertySet\n index={index}\n context={context}\n name={property.name}\n property={property}\n />\n )}\n </For>\n\n <hbr />\n {code`return false;\n }\n }\n );\n`}\n </FunctionDeclaration>\n </Show>\n <Spacing />\n <TSDoc heading=\"The environment configuration object.\">\n <TSDocRemarks>\n {`This object provides access to the environment configuration parameters in the application runtime.`}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n refkey={envRefkey}\n name=\"env\"\n type=\"Env\"\n export\n const\n initializer={\n <>{code`createEnv(${defaultConfig || \"{}\"} as Partial<Env>);`}</>\n }\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isCI\"\n doc=\"Detect if the application is running in a continuous integration (CI) environment.\"\n initializer={code`Boolean(\n env.CI ||\n env.RUN_ID ||\n env.AGOLA_GIT_REF ||\n env.AC_APPCIRCLE ||\n env.APPVEYOR ||\n env.CODEBUILD ||\n env.TF_BUILD ||\n env.bamboo_planKey ||\n env.BITBUCKET_COMMIT ||\n env.BITRISE_IO ||\n env.BUDDY_WORKSPACE_ID ||\n env.BUILDKITE ||\n env.CIRCLECI ||\n env.CIRRUS_CI ||\n env.CF_BUILD_ID ||\n env.CM_BUILD_ID ||\n env.CI_NAME ||\n env.DRONE ||\n env.DSARI ||\n env.EARTHLY_CI ||\n env.EAS_BUILD ||\n env.GERRIT_PROJECT ||\n env.GITEA_ACTIONS ||\n env.GITHUB_ACTIONS ||\n env.GITLAB_CI ||\n env.GOCD ||\n env.BUILDER_OUTPUT ||\n env.HARNESS_BUILD_ID ||\n env.JENKINS_URL ||\n env.LAYERCI ||\n env.MAGNUM ||\n env.NETLIFY ||\n env.NEVERCODE ||\n env.PROW_JOB_ID ||\n env.RELEASE_BUILD_ID ||\n env.RENDER ||\n env.SAILCI ||\n env.HUDSON ||\n env.SCREWDRIVER ||\n env.SEMAPHORE ||\n env.SOURCEHUT ||\n env.STRIDER ||\n env.TASK_ID ||\n env.RUN_ID ||\n env.TEAMCITY_VERSION ||\n env.TRAVIS ||\n env.VELA ||\n env.NOW_BUILDER ||\n env.APPCENTER_BUILD_ID ||\n env.CI_XCODE_PROJECT ||\n env.XCS || false\n ); `}\n />\n <Spacing />\n\n <TSDoc heading=\"Detect the \\`mode\\` of the current runtime environment.\">\n <TSDocRemarks>\n {code`The \\`mode\\` is determined by the \\`MODE\\` environment variable, or falls back to the \\`NEXT_PUBLIC_VERCEL_ENV\\`, \\`NODE_ENV\\`, or defaults to \\`production\\`. While the value can potentially be any string, it is generally recommended to only allow a value in the following list:\n - \\`production\\`\n - \\`test\\`\n - \\`development\\`\n `}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n export\n const\n name=\"mode\"\n initializer={code`String(env.MODE) || \"production\"; `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isProduction\"\n doc='Detect if the application is running in `\"production\"` mode'\n initializer={code`[\"prd\", \"prod\", \"production\"].includes(mode.toLowerCase()); `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isTest\"\n doc='Detect if the application is running in `\"test\"` mode'\n initializer={code`[\"tst\", \"test\", \"testing\", \"stg\", \"stage\", \"staging\"].includes(mode.toLowerCase()) || env.TEST; `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isDevelopment\"\n doc='Detect if the application is running in `\"development\"` mode'\n initializer={code`[\"dev\", \"development\"].includes(mode.toLowerCase()); `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isDebug\"\n doc=\"Detect if the application is currently being debugged\"\n initializer={code`Boolean(isDevelopment && env.DEBUG); `}\n />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,UAAU;CAAC;CAAI;CAAM;CAAQ;AAAG;;;;;;;AAItC,SAAS,aAAY,IAAI,MAAO;CAC/B,GAAI,SAAS;;AAEd;;;;AAkCA,SAAS,oBAA2B;CACpC,MAAO,WAAA,cAAA,IAAA,CAAA,OAAA,qBAAA,IAAA,CAAA,GAAA,cAAA;CACL,OAAK;EAAA,gBAAA,wBAAA;GACL,MAAA;GACA,IAAA,SAAY;IACZ,OAAA,QAAA,IAAA,KAAA;GACA;GACF,UAAS;EACT,CAAA;EAAM,gBAAkB,SAAQ,CAAA,CAAA;EAAA,gBAAkB,OAAA;GAClD,SAAS;GACT,IAAQ,WAAW;IACb,OAAG,gBAAqB,cAAS,EAC/B,UAAC;GAEP;EACA,CAAC;EAAA,gBAAc,sBAA0B;GACzC,MAAA;GACF,UAAO;GACL,WAAa;;IAEb,OAAO,gBAAA,KAAA;KACJ,IAAA,OAAA;MACE,OAAA,UAAA,QAAA,OAAA,IAAA,MAAA,EAAA,IAAA,cAAA,WAAA,OAAA,QAAA,MAAA,EAAA,GAAA;OAAA;OAAA;OAAA;MAAA,CAAA,CAAA;KACC;KACA,gBAAgB;KAChB,IAAA,WAAA;MACD,OAAA,cAAA,WAAA,gBAAA,KAAA;OACA,IAAS,OAAA;QACH,OAAQ,OAAK,OAAA,cAAY,QAAc,IAAO,KAAK,MAAQ,CAAC,EAAA,OAAM,cAAA,aAAA,CAAA,SAAA,UAAA,WAAA;SAAA;SAAA;SAAA;QAAA,CAAA,CAAA,KAAA,CAAA;OACtE;OACG,gBAAgB;OAClB,IAAA,WAAY;QACT,OAAA,cAAA,aAAA,CAAA,gBAAA,qBAAA,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B,UAAM;IACN,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAa,IAAC;GAChB,CAAC;GAAG,gBAAiB,SAAA,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACnB,UAAM;IACN,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAa,IAAC;GAChB,CAAC;GAAG,gBAAI,SAAkB,CAAA,CAAA;GAAA,gBAAA,MAAA;IACxB,IAAE,OAAI;KACJ,OAAI,QAAM,QAAA;IACZ;IACM;GACR,CAAC;EAAC;CACJ,EACF,CAAC,CAAC;AACJ;AACA,WAAO,SAAS;OAAA;CAAA;CAAA;CAAA;CAAA;AAAA"}
1
+ {"version":3,"file":"env-builtin.mjs","names":[],"sources":["../../src/components/env-builtin.tsx"],"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 Children,\n code,\n computed,\n For,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n InterfaceDeclaration as BaseInterfaceDeclaration,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { refkey } from \"@powerlines/plugin-alloy/helpers/refkey\";\nimport type { ComponentProps } from \"@powerlines/plugin-alloy/types/components\";\nimport {\n BuiltinFile,\n BuiltinFileProps,\n InterfaceDeclaration,\n InterfaceMember,\n ObjectDeclaration,\n TSDocSchemaProperty\n} from \"@powerlines/plugin-alloy/typescript/components\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport type { JTDSchemaType } from \"@powerlines/schema\";\nimport { getPropertiesList } from \"@powerlines/schema/helpers\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { loadEnvFromContext } from \"../helpers/load\";\nimport type { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Generates the environment configuration typescript definition for the Powerlines project.\n */\nexport function EnvTypeDefinition() {\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n name=\"UnprefixedEnv\"\n schema={context.env.vars.schema}\n export\n />\n <Spacing />\n <TSDoc heading=\"The environment configuration object with prefixed keys.\">\n <TSDocRemarks>\n {`The \\`Env\\` type extends the \\`UnprefixedEnv\\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.`}\n </TSDocRemarks>\n </TSDoc>\n <BaseInterfaceDeclaration name=\"Env\" export extends=\"UnprefixedEnv\">\n <For\n each={getUnique(context.config.env.prefix).map(prefix =>\n prefix.replace(/_$/, \"\")\n )}\n doubleHardline>\n {prefix => (\n <For\n each={\n getPropertiesList(context.env.vars.schema).filter(\n property => !property.metadata?.isIgnored\n ) ?? []\n }\n doubleHardline>\n {property => (\n <>\n <TSDocSchemaProperty schema={property} />\n <InterfaceMember\n name={`${prefix}_${property.metadata?.name}`}\n type={`UnprefixedEnv[\"${property.metadata?.name}\"]`}\n isReadonly={property.metadata?.isReadonly}\n />\n </>\n )}\n </For>\n )}\n </For>\n </BaseInterfaceDeclaration>\n <Spacing />\n </>\n );\n}\n\ninterface ConfigPropertyConditionalProps extends ComponentProps {\n context: EnvPluginContext;\n name: string;\n}\n\nfunction ConfigPropertyConditional(props: ConfigPropertyConditionalProps) {\n const [{ context, name }] = splitProps(props, [\"context\", \"name\"]);\n\n return code`propertyName === \"${name}\" || propertyName.replace(/^(${getUnique(\n context.config.env.prefix\n .sort((a, b) =>\n a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b)\n )\n .map(prefix => `${prefix.replace(/_$/, \"\")}_`)\n ).join(\"|\")})/g, \"\").toLowerCase().replace(/[\\\\s\\\\-_]+/g, \"\") === \"${name\n .toLowerCase()\n .replace(/[\\s\\-_]+/g, \"\")}\"`;\n}\n\ninterface ConfigPropertyProps extends ComponentProps {\n index: number;\n context: EnvPluginContext;\n name: string;\n property: JTDSchemaType;\n}\n\nfunction ConfigPropertyGet(props: ConfigPropertyProps) {\n const [{ context, name, property, index }] = splitProps(props, [\n \"context\",\n \"name\",\n \"property\",\n \"index\"\n ]);\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show\n when={\n property.metadata?.alias &&\n property.metadata?.alias.length > 0\n }>\n {code` || `}\n <For each={property.metadata?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${name}\"];`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show\n when={\n property.metadata?.alias &&\n property.metadata?.alias.length > 0\n }>\n {code` || `}\n <For each={property.metadata?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${name}\"];`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nfunction ConfigPropertySet(props: ConfigPropertyProps) {\n const [{ context, name, property, index }] = splitProps(props, [\n \"context\",\n \"name\",\n \"property\",\n \"index\"\n ]);\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show\n when={\n property.metadata?.alias &&\n property.metadata?.alias.length > 0\n }>\n {code` || `}\n <For each={property.metadata?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${name}\"] = newValue;\n return true;\n`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show\n when={\n property.metadata?.alias &&\n property.metadata?.alias.length > 0\n }>\n {code` || `}\n <For each={property.metadata?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${name}\"] = newValue;\n return true;\n`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nexport interface EnvBuiltinProps extends Omit<BuiltinFileProps, \"id\"> {\n defaultConfig?: Children;\n}\n\nconst createEnvRefkey = refkey(\"createEnv\");\nconst envRefkey = refkey(\"env\");\n\n/**\n * Generates the environment configuration module for the Powerlines project.\n */\nexport function EnvBuiltin(props: EnvBuiltinProps) {\n const [{ defaultConfig, children }, rest] = splitProps(props, [\n \"defaultConfig\",\n \"children\"\n ]);\n\n const context = usePowerlines<EnvPluginContext>();\n const defaultValue = computed(\n () => context && loadEnvFromContext(context, process.env)\n );\n\n const reflectionGetProperties = computed(\n () =>\n getPropertiesList(context.env.vars.schema)\n .filter(property => !property.metadata?.isIgnored)\n .sort((a, b) =>\n !a.metadata?.name && !b.metadata?.name\n ? 0\n : !a.metadata?.name\n ? 1\n : !b.metadata?.name\n ? -1\n : a.metadata?.name.localeCompare(b.metadata?.name)\n ) ?? []\n );\n const reflectionSetProperties = computed(\n () =>\n getPropertiesList(context.env.vars.schema)\n .filter(\n property =>\n !property.metadata?.isIgnored && !property.metadata?.isReadonly\n )\n .sort((a, b) =>\n !a.metadata?.name && !b.metadata?.name\n ? 0\n : !a.metadata?.name\n ? 1\n : !b.metadata?.name\n ? -1\n : a.metadata?.name.localeCompare(b.metadata?.name)\n ) ?? []\n );\n\n return (\n <BuiltinFile\n id=\"env\"\n description=\"The environment configuration module provides an interface to define environment configuration parameters.\"\n {...rest}>\n <Show when={Boolean(context.env.vars.schema)}>\n <EnvTypeDefinition defaultValue={defaultValue} />\n <Spacing />\n </Show>\n <ObjectDeclaration\n name=\"initialEnv\"\n type=\"Partial<Env>\"\n schema={context.env.vars.schema}\n export\n const\n doc=\"The initial environment configuration object values for the runtime.\"\n />\n <Spacing />\n <TSDoc heading=\"Initializes the Powerlines environment configuration module.\">\n <TSDocRemarks>\n {`This function initializes the Powerlines environment configuration object.`}\n </TSDocRemarks>\n <TSDocParam name=\"environmentConfig\">\n {`The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`}\n </TSDocParam>\n <TSDocReturns>\n {`The initialized Powerlines configuration object.`}\n </TSDocReturns>\n </TSDoc>\n <Show when={Boolean(context?.entryPath)}>\n <FunctionDeclaration\n refkey={createEnvRefkey}\n async={false}\n export\n name=\"createEnv\"\n parameters={[\n {\n name: \"environmentConfig\",\n type: `Partial<Env>`,\n optional: false,\n default: \"{}\"\n }\n ]}\n returnType=\"Env\">\n {code`\n return new Proxy<Env>(\n deserializeEnv({\n ...initialEnv,\n ...environmentConfig\n } as Env),\n {\n get: (target: UnprefixedEnv, propertyName: string) => { `}\n <hbr />\n <For each={reflectionGetProperties.value}>\n {(property: JTDSchemaType & { name: string }, index: number) => (\n <ConfigPropertyGet\n index={index}\n context={context}\n name={property.name}\n property={property}\n />\n )}\n </For>\n {code`\n return undefined;\n }, `}\n\n <Spacing />\n {code` set: (target: UnprefixedEnv, propertyName: string, newValue: any) => { `}\n <hbr />\n <For each={reflectionSetProperties.value} ender={code` else `}>\n {(property: JTDSchemaType & { name: string }, index: number) => (\n <ConfigPropertySet\n index={index}\n context={context}\n name={property.name}\n property={property}\n />\n )}\n </For>\n\n <hbr />\n {code`return false;\n }\n }\n );\n`}\n </FunctionDeclaration>\n </Show>\n <Spacing />\n <TSDoc heading=\"The environment configuration object.\">\n <TSDocRemarks>\n {`This object provides access to the environment configuration parameters in the application runtime.`}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n refkey={envRefkey}\n name=\"env\"\n type=\"Env\"\n export\n const\n initializer={\n <>{code`createEnv(${defaultConfig || \"{}\"} as Partial<Env>);`}</>\n }\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isCI\"\n doc=\"Detect if the application is running in a continuous integration (CI) environment.\"\n initializer={code`Boolean(\n env.CI ||\n env.RUN_ID ||\n env.AGOLA_GIT_REF ||\n env.AC_APPCIRCLE ||\n env.APPVEYOR ||\n env.CODEBUILD ||\n env.TF_BUILD ||\n env.bamboo_planKey ||\n env.BITBUCKET_COMMIT ||\n env.BITRISE_IO ||\n env.BUDDY_WORKSPACE_ID ||\n env.BUILDKITE ||\n env.CIRCLECI ||\n env.CIRRUS_CI ||\n env.CF_BUILD_ID ||\n env.CM_BUILD_ID ||\n env.CI_NAME ||\n env.DRONE ||\n env.DSARI ||\n env.EARTHLY_CI ||\n env.EAS_BUILD ||\n env.GERRIT_PROJECT ||\n env.GITEA_ACTIONS ||\n env.GITHUB_ACTIONS ||\n env.GITLAB_CI ||\n env.GOCD ||\n env.BUILDER_OUTPUT ||\n env.HARNESS_BUILD_ID ||\n env.JENKINS_URL ||\n env.LAYERCI ||\n env.MAGNUM ||\n env.NETLIFY ||\n env.NEVERCODE ||\n env.PROW_JOB_ID ||\n env.RELEASE_BUILD_ID ||\n env.RENDER ||\n env.SAILCI ||\n env.HUDSON ||\n env.SCREWDRIVER ||\n env.SEMAPHORE ||\n env.SOURCEHUT ||\n env.STRIDER ||\n env.TASK_ID ||\n env.RUN_ID ||\n env.TEAMCITY_VERSION ||\n env.TRAVIS ||\n env.VELA ||\n env.NOW_BUILDER ||\n env.APPCENTER_BUILD_ID ||\n env.CI_XCODE_PROJECT ||\n env.XCS || false\n ); `}\n />\n <Spacing />\n\n <TSDoc heading=\"Detect the \\`mode\\` of the current runtime environment.\">\n <TSDocRemarks>\n {code`The \\`mode\\` is determined by the \\`MODE\\` environment variable, or falls back to the \\`NEXT_PUBLIC_VERCEL_ENV\\`, \\`NODE_ENV\\`, or defaults to \\`production\\`. While the value can potentially be any string, it is generally recommended to only allow a value in the following list:\n - \\`production\\`\n - \\`test\\`\n - \\`development\\`\n `}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n export\n const\n name=\"mode\"\n initializer={code`String(env.MODE) || \"production\"; `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isProduction\"\n doc='Detect if the application is running in `\"production\"` mode'\n initializer={code`[\"prd\", \"prod\", \"production\"].includes(mode.toLowerCase()); `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isTest\"\n doc='Detect if the application is running in `\"test\"` mode'\n initializer={code`[\"tst\", \"test\", \"testing\", \"stg\", \"stage\", \"staging\"].includes(mode.toLowerCase()) || env.TEST; `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isDevelopment\"\n doc='Detect if the application is running in `\"development\"` mode'\n initializer={code`[\"dev\", \"development\"].includes(mode.toLowerCase()); `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isDebug\"\n doc=\"Detect if the application is currently being debugged\"\n initializer={code`Boolean(isDevelopment && env.DEBUG); `}\n />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,UAAU;CAAC;CAAI;CAAM;CAAQ;AAAG;;;;;;;AAEtC,SAAM,aAAS,IAAW,MAAM;CAC/B,GAAG,SAAU;CACb,OAAQ;AACT;;;;AA+BA,SAAa,oBAAA;CACX,MAAA,WAAgB,cAAA,IAAA,CAAA,CAAA,oBAAA,MAAA,CAAA,GAAA,cAAA;CAChB,OAAA;EAAA,gBAAoB,wBAAA;GACpB,MAAA;GACA,IAAA,SAAA;IACA,OAAA,QAAA,IAAA,KAAA;GACA;GACF,UAAO;EACL,CAAA;EAAA,gBAAK,SAAA,CAAA,CAAA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AAA,EACnB,UAAI,IAAY;;;;YAKhB,CAAA;IACF;GACF,CAAC;GAAG,gBAAI,gBAAoB;IAC1B,UAAM;IACN,SAAM;IACN,MAAM;IACN,aAAM,IAAW;GACnB,CAAC;GAAG,gBAAiB,SAAA,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACnB,UAAM;IACN,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAM,IAAW;GACnB,CAAC;GAAG,gBAAkB,SAAE,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACtB,UAAM;IACN,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAM,IAAA;GACR,CAAC;GAAG,gBAAI,SAAkB,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACxB,UAAM;IACN,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAM,IAAW;GACnB,CAAC;GAAG,gBAAiB,SAAA,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACnB,UAAM;IACN,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAM,IAAW;GACnB,CAAC;GAAG,gBAAe,SAAA,CAAA,CAAA;GAAA,gBAAA,MAAA;IACjB,IAAE,OAAI;KACJ,OAAI,QAAS,QAAA;IACf;IACM;GACR,CAAC;EAAC;CACJ,EACF,CAAC,CAAC;AACJ;AACA,WAAU,SAAI;OAAA;CAAoB;CAAA;CAAA;CAAA;AAAA"}
@@ -11,5 +11,7 @@ exports.getDefaultSecretsTypeDefinition = require_helpers_schema.getDefaultSecre
11
11
  exports.getDefaultVarsTypeDefinition = require_helpers_schema.getDefaultVarsTypeDefinition;
12
12
  exports.loadEnv = require_helpers_load.loadEnv;
13
13
  exports.loadEnvFromContext = require_helpers_load.loadEnvFromContext;
14
+ exports.readActiveEnv = require_helpers_schema.readActiveEnv;
14
15
  exports.removeEnvPrefix = require_helpers_source_file_env.removeEnvPrefix;
15
- exports.resolveRuntimeTypeFile = require_helpers_schema.resolveRuntimeTypeFile;
16
+ exports.resolveRuntimeTypeFile = require_helpers_schema.resolveRuntimeTypeFile;
17
+ exports.writeActiveEnv = require_helpers_schema.writeActiveEnv;
@@ -1,5 +1,5 @@
1
1
  import { env } from "./automd-generator.cjs";
2
2
  import { loadEnv, loadEnvFromContext } from "./load.cjs";
3
- import { extractEnvSchema, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, resolveRuntimeTypeFile } from "./schema.cjs";
3
+ import { extractEnvSchema, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, readActiveEnv, resolveRuntimeTypeFile, writeActiveEnv } from "./schema.cjs";
4
4
  import { formatEnvField, removeEnvPrefix } from "./source-file-env.cjs";
5
- export { env, extractEnvSchema, formatEnvField, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, loadEnv, loadEnvFromContext, removeEnvPrefix, resolveRuntimeTypeFile };
5
+ export { env, extractEnvSchema, formatEnvField, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, loadEnv, loadEnvFromContext, readActiveEnv, removeEnvPrefix, resolveRuntimeTypeFile, writeActiveEnv };
@@ -1,5 +1,5 @@
1
1
  import { env } from "./automd-generator.mjs";
2
2
  import { loadEnv, loadEnvFromContext } from "./load.mjs";
3
- import { extractEnvSchema, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, resolveRuntimeTypeFile } from "./schema.mjs";
3
+ import { extractEnvSchema, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, readActiveEnv, resolveRuntimeTypeFile, writeActiveEnv } from "./schema.mjs";
4
4
  import { formatEnvField, removeEnvPrefix } from "./source-file-env.mjs";
5
- export { env, extractEnvSchema, formatEnvField, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, loadEnv, loadEnvFromContext, removeEnvPrefix, resolveRuntimeTypeFile };
5
+ export { env, extractEnvSchema, formatEnvField, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, loadEnv, loadEnvFromContext, readActiveEnv, removeEnvPrefix, resolveRuntimeTypeFile, writeActiveEnv };
@@ -1,6 +1,6 @@
1
1
  import { formatEnvField, removeEnvPrefix } from "./source-file-env.mjs";
2
2
  import { loadEnv, loadEnvFromContext } from "./load.mjs";
3
- import { extractEnvSchema, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, resolveRuntimeTypeFile } from "./schema.mjs";
3
+ import { extractEnvSchema, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, readActiveEnv, resolveRuntimeTypeFile, writeActiveEnv } from "./schema.mjs";
4
4
  import { env } from "./automd-generator.mjs";
5
5
 
6
- export { env, extractEnvSchema, formatEnvField, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, loadEnv, loadEnvFromContext, removeEnvPrefix, resolveRuntimeTypeFile };
6
+ export { env, extractEnvSchema, formatEnvField, getDefaultSecretsTypeDefinition, getDefaultVarsTypeDefinition, loadEnv, loadEnvFromContext, readActiveEnv, removeEnvPrefix, resolveRuntimeTypeFile, writeActiveEnv };
@@ -24,11 +24,11 @@ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvPar
24
24
  ERROR_URL: string | undefined;
25
25
  ORGANIZATION: string | undefined;
26
26
  PLATFORM: "node" | "browser" | "neutral";
27
- MODE: "development" | "test" | "production";
27
+ MODE: "test" | "development" | "production";
28
28
  TEST: boolean;
29
29
  DEBUG: boolean;
30
30
  STACKTRACE: boolean;
31
- RUNTIME: "browser" | "nodejs" | "workerd" | "edge" | undefined;
31
+ RUNTIME: "edge" | "browser" | "nodejs" | "workerd" | undefined;
32
32
  ENVIRONMENT: string;
33
33
  };
34
34
  declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
@@ -24,11 +24,11 @@ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvPar
24
24
  ERROR_URL: string | undefined;
25
25
  ORGANIZATION: string | undefined;
26
26
  PLATFORM: "node" | "browser" | "neutral";
27
- MODE: "development" | "test" | "production";
27
+ MODE: "test" | "development" | "production";
28
28
  TEST: boolean;
29
29
  DEBUG: boolean;
30
30
  STACKTRACE: boolean;
31
- RUNTIME: "browser" | "nodejs" | "workerd" | "edge" | undefined;
31
+ RUNTIME: "edge" | "browser" | "nodejs" | "workerd" | undefined;
32
32
  ENVIRONMENT: string;
33
33
  };
34
34
  declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;