@powerlines/plugin-env 0.16.84 → 0.16.86

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 (117) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +3 -0
  3. package/dist/babel/index.cjs +4 -0
  4. package/dist/babel/index.d.cts +2 -0
  5. package/dist/babel/index.d.mts +2 -0
  6. package/dist/babel/index.mjs +3 -0
  7. package/dist/babel/plugin.cjs +144 -0
  8. package/dist/babel/plugin.d.cts +8 -0
  9. package/dist/babel/plugin.d.cts.map +1 -0
  10. package/dist/babel/plugin.d.mts +8 -0
  11. package/dist/babel/plugin.d.mts.map +1 -0
  12. package/dist/babel/plugin.mjs +143 -0
  13. package/dist/babel/plugin.mjs.map +1 -0
  14. package/dist/components/docs.cjs +70 -0
  15. package/dist/components/docs.d.cts +25 -0
  16. package/dist/components/docs.d.cts.map +1 -0
  17. package/dist/components/docs.d.mts +25 -0
  18. package/dist/components/docs.d.mts.map +1 -0
  19. package/dist/components/docs.mjs +69 -0
  20. package/dist/components/docs.mjs.map +1 -0
  21. package/dist/components/env-builtin.cjs +568 -0
  22. package/dist/components/env-builtin.d.cts +22 -0
  23. package/dist/components/env-builtin.d.cts.map +1 -0
  24. package/dist/components/env-builtin.d.mts +22 -0
  25. package/dist/components/env-builtin.d.mts.map +1 -0
  26. package/dist/components/env-builtin.mjs +565 -0
  27. package/dist/components/env-builtin.mjs.map +1 -0
  28. package/dist/components/index.cjs +7 -0
  29. package/dist/components/index.d.cts +3 -0
  30. package/dist/components/index.d.mts +3 -0
  31. package/dist/components/index.mjs +4 -0
  32. package/dist/helpers/automd-generator.cjs +33 -0
  33. package/dist/helpers/automd-generator.d.cts +14 -0
  34. package/dist/helpers/automd-generator.d.cts.map +1 -0
  35. package/dist/helpers/automd-generator.d.mts +14 -0
  36. package/dist/helpers/automd-generator.d.mts.map +1 -0
  37. package/dist/helpers/automd-generator.mjs +32 -0
  38. package/dist/helpers/automd-generator.mjs.map +1 -0
  39. package/dist/helpers/create-reflection-resource.cjs +23 -0
  40. package/dist/helpers/create-reflection-resource.d.cts +13 -0
  41. package/dist/helpers/create-reflection-resource.d.cts.map +1 -0
  42. package/dist/helpers/create-reflection-resource.d.mts +13 -0
  43. package/dist/helpers/create-reflection-resource.d.mts.map +1 -0
  44. package/dist/helpers/create-reflection-resource.mjs +23 -0
  45. package/dist/helpers/create-reflection-resource.mjs.map +1 -0
  46. package/dist/helpers/docs-helper.cjs +25 -0
  47. package/dist/helpers/docs-helper.d.cts +13 -0
  48. package/dist/helpers/docs-helper.d.cts.map +1 -0
  49. package/dist/helpers/docs-helper.d.mts +13 -0
  50. package/dist/helpers/docs-helper.d.mts.map +1 -0
  51. package/dist/helpers/docs-helper.mjs +24 -0
  52. package/dist/helpers/docs-helper.mjs.map +1 -0
  53. package/dist/helpers/index.cjs +34 -0
  54. package/dist/helpers/index.d.cts +7 -0
  55. package/dist/helpers/index.d.mts +7 -0
  56. package/dist/helpers/index.mjs +8 -0
  57. package/dist/helpers/load.cjs +136 -0
  58. package/dist/helpers/load.d.cts +35 -0
  59. package/dist/helpers/load.d.cts.map +1 -0
  60. package/dist/helpers/load.d.mts +35 -0
  61. package/dist/helpers/load.d.mts.map +1 -0
  62. package/dist/helpers/load.mjs +133 -0
  63. package/dist/helpers/load.mjs.map +1 -0
  64. package/dist/helpers/persistence.cjs +323 -0
  65. package/dist/helpers/persistence.d.cts +84 -0
  66. package/dist/helpers/persistence.d.cts.map +1 -0
  67. package/dist/helpers/persistence.d.mts +84 -0
  68. package/dist/helpers/persistence.d.mts.map +1 -0
  69. package/dist/helpers/persistence.mjs +311 -0
  70. package/dist/helpers/persistence.mjs.map +1 -0
  71. package/dist/helpers/reflect.cjs +299 -0
  72. package/dist/helpers/reflect.d.cts +69 -0
  73. package/dist/helpers/reflect.d.cts.map +1 -0
  74. package/dist/helpers/reflect.d.mts +69 -0
  75. package/dist/helpers/reflect.d.mts.map +1 -0
  76. package/dist/helpers/reflect.mjs +290 -0
  77. package/dist/helpers/reflect.mjs.map +1 -0
  78. package/dist/helpers/source-file-env.cjs +59 -0
  79. package/dist/helpers/source-file-env.d.cts +9 -0
  80. package/dist/helpers/source-file-env.d.cts.map +1 -0
  81. package/dist/helpers/source-file-env.d.mts +9 -0
  82. package/dist/helpers/source-file-env.d.mts.map +1 -0
  83. package/dist/helpers/source-file-env.mjs +57 -0
  84. package/dist/helpers/source-file-env.mjs.map +1 -0
  85. package/dist/helpers/template-helpers.cjs +71 -0
  86. package/dist/helpers/template-helpers.d.cts +15 -0
  87. package/dist/helpers/template-helpers.d.cts.map +1 -0
  88. package/dist/helpers/template-helpers.d.mts +15 -0
  89. package/dist/helpers/template-helpers.d.mts.map +1 -0
  90. package/dist/helpers/template-helpers.mjs +70 -0
  91. package/dist/helpers/template-helpers.mjs.map +1 -0
  92. package/dist/index.cjs +195 -0
  93. package/dist/index.d.cts +17 -0
  94. package/dist/index.d.cts.map +1 -0
  95. package/dist/index.d.mts +17 -0
  96. package/dist/index.d.mts.map +1 -0
  97. package/dist/index.mjs +189 -0
  98. package/dist/index.mjs.map +1 -0
  99. package/dist/types/index.cjs +11 -0
  100. package/dist/types/index.d.cts +3 -0
  101. package/dist/types/index.d.mts +3 -0
  102. package/dist/types/index.mjs +4 -0
  103. package/dist/types/plugin.cjs +137 -0
  104. package/dist/types/plugin.d.cts +168 -0
  105. package/dist/types/plugin.d.cts.map +1 -0
  106. package/dist/types/plugin.d.mts +168 -0
  107. package/dist/types/plugin.d.mts.map +1 -0
  108. package/dist/types/plugin.mjs +132 -0
  109. package/dist/types/plugin.mjs.map +1 -0
  110. package/dist/types/runtime.cjs +244 -0
  111. package/dist/types/runtime.d.cts +792 -0
  112. package/dist/types/runtime.d.cts.map +1 -0
  113. package/dist/types/runtime.d.mts +792 -0
  114. package/dist/types/runtime.d.mts.map +1 -0
  115. package/dist/types/runtime.mjs +242 -0
  116. package/dist/types/runtime.mjs.map +1 -0
  117. package/package.json +10 -10
@@ -0,0 +1,33 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let powerlines = require("powerlines");
4
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
5
+ let automd = require("automd");
6
+
7
+ //#region src/helpers/automd-generator.ts
8
+ function __assignType(fn, args) {
9
+ fn.__type = args;
10
+ return fn;
11
+ }
12
+ /**
13
+ * AutoMD generator to generate environment variable documentation
14
+ *
15
+ * @param context - The generator context.
16
+ * @returns The generated documentation content.
17
+ */
18
+ const env = __assignType((context) => (0, automd.defineGenerator)({
19
+ name: "env",
20
+ generate: __assignType(async function generate() {
21
+ const envDocFile = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "docs", "generated", "env.md");
22
+ if (!context.fs.existsSync(envDocFile)) return { contents: "" };
23
+ return { contents: await context.fs.read(envDocFile) || "" };
24
+ }, ["generate", "P\"/!"])
25
+ }), [
26
+ () => powerlines.__ΩUnresolvedContext,
27
+ "context",
28
+ "",
29
+ "Pn!2\"\"/#"
30
+ ]);
31
+
32
+ //#endregion
33
+ exports.env = env;
@@ -0,0 +1,14 @@
1
+ import { UnresolvedContext } from "powerlines";
2
+ import * as automd from "automd";
3
+
4
+ //#region src/helpers/automd-generator.d.ts
5
+ /**
6
+ * AutoMD generator to generate environment variable documentation
7
+ *
8
+ * @param context - The generator context.
9
+ * @returns The generated documentation content.
10
+ */
11
+ declare const env: (context: UnresolvedContext) => automd.Generator;
12
+ //#endregion
13
+ export { env };
14
+ //# sourceMappingURL=automd-generator.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automd-generator.d.cts","names":[],"sources":["../../src/helpers/automd-generator.ts"],"mappings":";;;;;;;AA4BA;;;cAAa,GAAA,GAAO,OAAA,EAAS,iBAAA,KAAiB,MAAA,CAAA,SAAA"}
@@ -0,0 +1,14 @@
1
+ import { UnresolvedContext } from "powerlines";
2
+ import * as automd from "automd";
3
+
4
+ //#region src/helpers/automd-generator.d.ts
5
+ /**
6
+ * AutoMD generator to generate environment variable documentation
7
+ *
8
+ * @param context - The generator context.
9
+ * @returns The generated documentation content.
10
+ */
11
+ declare const env: (context: UnresolvedContext) => automd.Generator;
12
+ //#endregion
13
+ export { env };
14
+ //# sourceMappingURL=automd-generator.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automd-generator.d.mts","names":[],"sources":["../../src/helpers/automd-generator.ts"],"mappings":";;;;;;;AA4BA;;;cAAa,GAAA,GAAO,OAAA,EAAS,iBAAA,KAAiB,MAAA,CAAA,SAAA"}
@@ -0,0 +1,32 @@
1
+ import { __ΩUnresolvedContext } from "powerlines";
2
+ import { joinPaths } from "@stryke/path/join-paths";
3
+ import { defineGenerator } from "automd";
4
+
5
+ //#region src/helpers/automd-generator.ts
6
+ function __assignType(fn, args) {
7
+ fn.__type = args;
8
+ return fn;
9
+ }
10
+ /**
11
+ * AutoMD generator to generate environment variable documentation
12
+ *
13
+ * @param context - The generator context.
14
+ * @returns The generated documentation content.
15
+ */
16
+ const env = __assignType((context) => defineGenerator({
17
+ name: "env",
18
+ generate: __assignType(async function generate() {
19
+ const envDocFile = joinPaths(context.config.root, "docs", "generated", "env.md");
20
+ if (!context.fs.existsSync(envDocFile)) return { contents: "" };
21
+ return { contents: await context.fs.read(envDocFile) || "" };
22
+ }, ["generate", "P\"/!"])
23
+ }), [
24
+ () => __ΩUnresolvedContext,
25
+ "context",
26
+ "",
27
+ "Pn!2\"\"/#"
28
+ ]);
29
+
30
+ //#endregion
31
+ export { env };
32
+ //# sourceMappingURL=automd-generator.mjs.map
@@ -0,0 +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"}
@@ -0,0 +1,23 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_types_plugin = require('../types/plugin.cjs');
3
+
4
+ //#region src/helpers/create-reflection-resource.ts
5
+ /**
6
+ * Creates a reflection resource for the environment configuration.
7
+ *
8
+ * @param _context - The environment plugin context.
9
+ * @returns A resource that provides the reflection of the environment configuration.
10
+ */
11
+ function createReflection(_context) {
12
+ return {};
13
+ }
14
+ createReflection.__type = [
15
+ () => require_types_plugin.__ΩEnvPluginContext,
16
+ "_context",
17
+ "createReflection",
18
+ "Creates a reflection resource for the environment configuration.",
19
+ "Pn!2\"\"/#?$"
20
+ ];
21
+
22
+ //#endregion
23
+ exports.createReflection = createReflection;
@@ -0,0 +1,13 @@
1
+ import { EnvPluginContext } from "../types/plugin.cjs";
2
+
3
+ //#region src/helpers/create-reflection-resource.d.ts
4
+ /**
5
+ * Creates a reflection resource for the environment configuration.
6
+ *
7
+ * @param _context - The environment plugin context.
8
+ * @returns A resource that provides the reflection of the environment configuration.
9
+ */
10
+ declare function createReflection(_context: EnvPluginContext): {};
11
+ //#endregion
12
+ export { createReflection };
13
+ //# sourceMappingURL=create-reflection-resource.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-reflection-resource.d.cts","names":[],"sources":["../../src/helpers/create-reflection-resource.ts"],"mappings":";;;;;AA0BA;;;;iBAAgB,gBAAA,CAAiB,QAAA,EAAU,gBAAA"}
@@ -0,0 +1,13 @@
1
+ import { EnvPluginContext } from "../types/plugin.mjs";
2
+
3
+ //#region src/helpers/create-reflection-resource.d.ts
4
+ /**
5
+ * Creates a reflection resource for the environment configuration.
6
+ *
7
+ * @param _context - The environment plugin context.
8
+ * @returns A resource that provides the reflection of the environment configuration.
9
+ */
10
+ declare function createReflection(_context: EnvPluginContext): {};
11
+ //#endregion
12
+ export { createReflection };
13
+ //# sourceMappingURL=create-reflection-resource.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-reflection-resource.d.mts","names":[],"sources":["../../src/helpers/create-reflection-resource.ts"],"mappings":";;;;;AA0BA;;;;iBAAgB,gBAAA,CAAiB,QAAA,EAAU,gBAAA"}
@@ -0,0 +1,23 @@
1
+ import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
+
3
+ //#region src/helpers/create-reflection-resource.ts
4
+ /**
5
+ * Creates a reflection resource for the environment configuration.
6
+ *
7
+ * @param _context - The environment plugin context.
8
+ * @returns A resource that provides the reflection of the environment configuration.
9
+ */
10
+ function createReflection(_context) {
11
+ return {};
12
+ }
13
+ createReflection.__type = [
14
+ () => __ΩEnvPluginContext,
15
+ "_context",
16
+ "createReflection",
17
+ "Creates a reflection resource for the environment configuration.",
18
+ "Pn!2\"\"/#?$"
19
+ ];
20
+
21
+ //#endregion
22
+ export { createReflection };
23
+ //# sourceMappingURL=create-reflection-resource.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-reflection-resource.mjs","names":[],"sources":["../../src/helpers/create-reflection-resource.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Creates a reflection resource for the environment configuration.\n *\n * @param _context - The environment plugin context.\n * @returns A resource that provides the reflection of the environment configuration.\n */\nexport function createReflection(_context: EnvPluginContext) {\n // const defaultValue = computed(\n // () => context && loadEnvFromContext(context, process.env)\n // );\n\n return {};\n\n // return computed(() => {\n // result.getProperties().forEach(prop => {\n // const aliases = prop.getAlias();\n // aliases.filter(Boolean).forEach(alias => {\n // result.addProperty({\n // name: alias,\n // optional: prop.isOptional() ? true : undefined,\n // readonly: prop.isReadonly() ? true : undefined,\n // description: prop.getDescription(),\n // visibility: prop.getVisibility(),\n // type: prop.getType(),\n // default: prop.getDefaultValue(),\n // tags: {\n // hidden: prop.isHidden(),\n // ignore: prop.isIgnored(),\n // internal: prop.isInternal(),\n // alias: prop\n // .getAlias()\n // .filter(a => a !== alias)\n // .concat(prop.name),\n // title: prop.getTitle() || titleCase(prop.name),\n // readonly: prop.isReadonly(),\n // permission: prop.getPermission(),\n // domain: prop.getDomain()\n // }\n // });\n // });\n // });\n\n // result.getProperties().forEach(prop => {\n // prop.setDefaultValue(\n // (defaultValue.value as Record<string, any>)?.[prop.getNameAsString()] ??\n // prop\n // .getAlias()\n // .reduce(\n // (ret, alias) =>\n // ret ?? (defaultValue.value as Record<string, any>)?.[alias],\n // undefined\n // ) ??\n // prop.getDefaultValue()\n // );\n // });\n // });\n}\n"],"mappings":";;;;;;;;;;AAYC,QAAU,EAAE;;AA4Cb,iBAAe,SAAQ;OAAK;CAAU;CAAA;CAAA;CAAA;CAAA"}
@@ -0,0 +1,25 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_types_plugin = require('../types/plugin.cjs');
4
+ let _stryke_path_join = require("@stryke/path/join");
5
+
6
+ //#region src/helpers/docs-helper.ts
7
+ /**
8
+ * Gets the output path for the generated environment documentation.
9
+ *
10
+ * @param context - The environment plugin context.
11
+ * @returns The output path for the generated environment documentation.
12
+ */
13
+ function getDocsOutputPath(context) {
14
+ return (0, _stryke_path_join.joinPaths)(context.config.root, "docs", "generated");
15
+ }
16
+ getDocsOutputPath.__type = [
17
+ () => require_types_plugin.__ΩEnvPluginContext,
18
+ "context",
19
+ "getDocsOutputPath",
20
+ "Gets the output path for the generated environment documentation.",
21
+ "Pn!2\"&/#?$"
22
+ ];
23
+
24
+ //#endregion
25
+ exports.getDocsOutputPath = getDocsOutputPath;
@@ -0,0 +1,13 @@
1
+ import { EnvPluginContext } from "../types/plugin.cjs";
2
+
3
+ //#region src/helpers/docs-helper.d.ts
4
+ /**
5
+ * Gets the output path for the generated environment documentation.
6
+ *
7
+ * @param context - The environment plugin context.
8
+ * @returns The output path for the generated environment documentation.
9
+ */
10
+ declare function getDocsOutputPath(context: EnvPluginContext): string;
11
+ //#endregion
12
+ export { getDocsOutputPath };
13
+ //# sourceMappingURL=docs-helper.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-helper.d.cts","names":[],"sources":["../../src/helpers/docs-helper.ts"],"mappings":";;;;;AA2BA;;;;iBAAgB,iBAAA,CAAkB,OAAA,EAAS,gBAAA"}
@@ -0,0 +1,13 @@
1
+ import { EnvPluginContext } from "../types/plugin.mjs";
2
+
3
+ //#region src/helpers/docs-helper.d.ts
4
+ /**
5
+ * Gets the output path for the generated environment documentation.
6
+ *
7
+ * @param context - The environment plugin context.
8
+ * @returns The output path for the generated environment documentation.
9
+ */
10
+ declare function getDocsOutputPath(context: EnvPluginContext): string;
11
+ //#endregion
12
+ export { getDocsOutputPath };
13
+ //# sourceMappingURL=docs-helper.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-helper.d.mts","names":[],"sources":["../../src/helpers/docs-helper.ts"],"mappings":";;;;;AA2BA;;;;iBAAgB,iBAAA,CAAkB,OAAA,EAAS,gBAAA"}
@@ -0,0 +1,24 @@
1
+ import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
+ import { joinPaths } from "@stryke/path/join";
3
+
4
+ //#region src/helpers/docs-helper.ts
5
+ /**
6
+ * Gets the output path for the generated environment documentation.
7
+ *
8
+ * @param context - The environment plugin context.
9
+ * @returns The output path for the generated environment documentation.
10
+ */
11
+ function getDocsOutputPath(context) {
12
+ return joinPaths(context.config.root, "docs", "generated");
13
+ }
14
+ getDocsOutputPath.__type = [
15
+ () => __ΩEnvPluginContext,
16
+ "context",
17
+ "getDocsOutputPath",
18
+ "Gets the output path for the generated environment documentation.",
19
+ "Pn!2\"&/#?$"
20
+ ];
21
+
22
+ //#endregion
23
+ export { getDocsOutputPath };
24
+ //# sourceMappingURL=docs-helper.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-helper.mjs","names":[],"sources":["../../src/helpers/docs-helper.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Gets the output path for the generated environment documentation.\n *\n * @param context - The environment plugin context.\n * @returns The output path for the generated environment documentation.\n */\nexport function getDocsOutputPath(context: EnvPluginContext): string {\n return joinPaths(context.config.root, \"docs\", \"generated\");\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAE,kBAAA,SAAA;AACF,QAAO,UAAS,QAAA,OAAkB,MAAQ,QAAC,YAAmB;;AAE9D,kBAAA,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
@@ -0,0 +1,34 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_helpers_reflect = require('./reflect.cjs');
3
+ const require_helpers_persistence = require('./persistence.cjs');
4
+ const require_helpers_template_helpers = require('./template-helpers.cjs');
5
+ const require_helpers_source_file_env = require('./source-file-env.cjs');
6
+ const require_helpers_load = require('./load.cjs');
7
+ const require_helpers_create_reflection_resource = require('./create-reflection-resource.cjs');
8
+
9
+ exports.BaseEnv = require_helpers_reflect.BaseEnv;
10
+ exports.BaseSecrets = require_helpers_reflect.BaseSecrets;
11
+ exports.__ΩCreateEnvReflectionOptions = require_helpers_reflect.__ΩCreateEnvReflectionOptions;
12
+ exports.createEnvReflection = require_helpers_reflect.createEnvReflection;
13
+ exports.createReflection = require_helpers_create_reflection_resource.createReflection;
14
+ exports.createSecretsReflection = require_helpers_reflect.createSecretsReflection;
15
+ exports.createTemplateReflection = require_helpers_template_helpers.createTemplateReflection;
16
+ exports.formatEnvField = require_helpers_source_file_env.formatEnvField;
17
+ exports.getEnvDefaultTypeDefinition = require_helpers_persistence.getEnvDefaultTypeDefinition;
18
+ exports.getEnvReflectionsPath = require_helpers_persistence.getEnvReflectionsPath;
19
+ exports.getEnvTypeReflectionsPath = require_helpers_persistence.getEnvTypeReflectionsPath;
20
+ exports.getSecretsDefaultTypeDefinition = require_helpers_persistence.getSecretsDefaultTypeDefinition;
21
+ exports.loadEnv = require_helpers_load.loadEnv;
22
+ exports.loadEnvFromContext = require_helpers_load.loadEnvFromContext;
23
+ exports.mergeEnvReflections = require_helpers_reflect.mergeEnvReflections;
24
+ exports.mergeSecretsReflections = require_helpers_reflect.mergeSecretsReflections;
25
+ exports.readEnvReflection = require_helpers_persistence.readEnvReflection;
26
+ exports.readEnvTypeReflection = require_helpers_persistence.readEnvTypeReflection;
27
+ exports.readSecretsReflection = require_helpers_persistence.readSecretsReflection;
28
+ exports.reflectEnv = require_helpers_reflect.reflectEnv;
29
+ exports.reflectSecrets = require_helpers_reflect.reflectSecrets;
30
+ exports.removeEnvPrefix = require_helpers_source_file_env.removeEnvPrefix;
31
+ exports.resolveRuntimeTypeFile = require_helpers_persistence.resolveRuntimeTypeFile;
32
+ exports.writeEnvReflection = require_helpers_persistence.writeEnvReflection;
33
+ exports.writeEnvReflectionSync = require_helpers_persistence.writeEnvReflectionSync;
34
+ exports.writeEnvTypeReflection = require_helpers_persistence.writeEnvTypeReflection;
@@ -0,0 +1,7 @@
1
+ import { createReflection } from "./create-reflection-resource.cjs";
2
+ import { loadEnv, loadEnvFromContext } from "./load.cjs";
3
+ import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./persistence.cjs";
4
+ import { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./reflect.cjs";
5
+ import { formatEnvField, removeEnvPrefix } from "./source-file-env.cjs";
6
+ import { createTemplateReflection } from "./template-helpers.cjs";
7
+ export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createReflection, createSecretsReflection, createTemplateReflection, formatEnvField, getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, loadEnv, loadEnvFromContext, mergeEnvReflections, mergeSecretsReflections, readEnvReflection, readEnvTypeReflection, readSecretsReflection, reflectEnv, reflectSecrets, removeEnvPrefix, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
@@ -0,0 +1,7 @@
1
+ import { createReflection } from "./create-reflection-resource.mjs";
2
+ import { loadEnv, loadEnvFromContext } from "./load.mjs";
3
+ import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./persistence.mjs";
4
+ import { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./reflect.mjs";
5
+ import { formatEnvField, removeEnvPrefix } from "./source-file-env.mjs";
6
+ import { createTemplateReflection } from "./template-helpers.mjs";
7
+ export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createReflection, createSecretsReflection, createTemplateReflection, formatEnvField, getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, loadEnv, loadEnvFromContext, mergeEnvReflections, mergeSecretsReflections, readEnvReflection, readEnvTypeReflection, readSecretsReflection, reflectEnv, reflectSecrets, removeEnvPrefix, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
@@ -0,0 +1,8 @@
1
+ import { BaseEnv, BaseSecrets, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./reflect.mjs";
2
+ import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./persistence.mjs";
3
+ import { createTemplateReflection } from "./template-helpers.mjs";
4
+ import { formatEnvField, removeEnvPrefix } from "./source-file-env.mjs";
5
+ import { loadEnv, loadEnvFromContext } from "./load.mjs";
6
+ import { createReflection } from "./create-reflection-resource.mjs";
7
+
8
+ export { BaseEnv, BaseSecrets, __ΩCreateEnvReflectionOptions, createEnvReflection, createReflection, createSecretsReflection, createTemplateReflection, formatEnvField, getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, loadEnv, loadEnvFromContext, mergeEnvReflections, mergeSecretsReflections, readEnvReflection, readEnvTypeReflection, readSecretsReflection, reflectEnv, reflectSecrets, removeEnvPrefix, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
@@ -0,0 +1,136 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_types_plugin = require('../types/plugin.cjs');
4
+ const require_helpers_source_file_env = require('./source-file-env.cjs');
5
+ let powerlines = require("powerlines");
6
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
7
+ let _stryke_env_load_env = require("@stryke/env/load-env");
8
+ let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
9
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
10
+ let c12 = require("c12");
11
+ let defu = require("defu");
12
+ defu = require_runtime.__toESM(defu);
13
+ let powerlines_constants = require("powerlines/constants");
14
+
15
+ //#region src/helpers/load.ts
16
+ function __assignType(fn, args) {
17
+ fn.__type = args;
18
+ return fn;
19
+ }
20
+ async function loadEnvFiles(options, mode, cwd) {
21
+ let env = await (0, _stryke_env_load_env.loadEnv)(cwd, mode);
22
+ if (options.additionalFiles && options.additionalFiles?.length > 0) {
23
+ const additionalEnvFiles = await Promise.all(options.additionalFiles.map(__assignType(async (additionalEnvFile) => (0, _stryke_env_load_env.loadEnvFile)(additionalEnvFile, cwd), [
24
+ "additionalEnvFile",
25
+ "",
26
+ "P\"2!\"/\""
27
+ ])));
28
+ for (const additionalEnvFile of additionalEnvFiles) env = (0, defu.default)(additionalEnvFile, env);
29
+ }
30
+ return require_helpers_source_file_env.removeEnvPrefix(env);
31
+ }
32
+ loadEnvFiles.__type = [
33
+ () => require_types_plugin.__ΩEnvPluginOptions,
34
+ "options",
35
+ "mode",
36
+ "cwd",
37
+ "loadEnvFiles",
38
+ "Pn!2\"&2#&2$\"`/%"
39
+ ];
40
+ async function loadEnvDirectory(options, directory, mode, cacheDir, packageJson, workspaceConfig) {
41
+ const [envResult, c12Result] = await Promise.all([(loadEnvFiles.Ω = [["!"]], loadEnvFiles(options, mode, directory)), (0, c12.loadConfig)({
42
+ cwd: directory,
43
+ name: "storm",
44
+ envName: mode,
45
+ defaults: {
46
+ NAME: packageJson.name?.replace(`@${workspaceConfig.namespace}/`, ""),
47
+ MODE: mode,
48
+ ORG: workspaceConfig.organization
49
+ },
50
+ globalRc: true,
51
+ packageJson: true,
52
+ dotenv: true,
53
+ jitiOptions: {
54
+ fsCache: (0, _stryke_path_join_paths.joinPaths)(cacheDir, "jiti"),
55
+ moduleCache: true
56
+ }
57
+ })]);
58
+ return (0, defu.default)(envResult, c12Result.config, workspaceConfig);
59
+ }
60
+ loadEnvDirectory.__type = [
61
+ () => require_types_plugin.__ΩEnvPluginOptions,
62
+ "options",
63
+ "directory",
64
+ "mode",
65
+ "cacheDir",
66
+ "packageJson",
67
+ () => powerlines.__ΩWorkspaceConfig,
68
+ "workspaceConfig",
69
+ "loadEnvDirectory",
70
+ "Pn!2\"&2#&2$&2%!2&n'2(\"`/)"
71
+ ];
72
+ /**
73
+ * Retrieves various dotenv configuration parameters from the context.
74
+ *
75
+ * @param context - The context to retrieve the dotenv configuration from.
76
+ * @param parsed - The parsed dotenv configuration.
77
+ * @returns An object containing the dotenv configuration.
78
+ */
79
+ function loadEnvFromContext(context, parsed) {
80
+ return (0, defu.default)({
81
+ APP_NAME: (0, _stryke_string_format_kebab_case.kebabCase)(context.config.name || context.packageJson.name?.replace(`/${context.workspaceConfig.namespace}`, "")),
82
+ APP_VERSION: context.packageJson.version,
83
+ BUILD_ID: context.meta.buildId,
84
+ BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),
85
+ BUILD_CHECKSUM: context.meta.checksum,
86
+ RELEASE_ID: context.meta.releaseId,
87
+ RELEASE_TAG: `${(0, _stryke_string_format_kebab_case.kebabCase)(context.config.name)}@${context.packageJson.version}`,
88
+ DEFAULT_LOCALE: context.workspaceConfig.locale,
89
+ DEFAULT_TIMEZONE: context.workspaceConfig.timezone,
90
+ LOG_LEVEL: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
91
+ ERROR_URL: context.workspaceConfig.error?.url,
92
+ ORGANIZATION: context.config.organization || ((0, _stryke_type_checks_is_set_object.isSetObject)(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization),
93
+ PLATFORM: context.config.platform,
94
+ MODE: context.config.mode,
95
+ TEST: context.config.mode === "test",
96
+ DEBUG: context.config.mode === "development",
97
+ STACKTRACE: context.config.mode !== "production",
98
+ ENVIRONMENT: !context.environment.name || context.environment.name === powerlines_constants.DEFAULT_ENVIRONMENT ? context.config.mode : context.environment.name
99
+ }, (0, _stryke_type_checks_is_set_object.isSetObject)(context?.env?.types?.env) ? context.env.types.env?.getProperties().reduce(__assignType((ret, prop) => {
100
+ ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();
101
+ return ret;
102
+ }, [
103
+ "ret",
104
+ "prop",
105
+ "",
106
+ "P\"2!\"2\"\"/#"
107
+ ]), {}) : {});
108
+ }
109
+ loadEnvFromContext.__type = [
110
+ () => require_types_plugin.__ΩEnvPluginContext,
111
+ "context",
112
+ "parsed",
113
+ "loadEnvFromContext",
114
+ "Retrieves various dotenv configuration parameters from the context.",
115
+ "Pn!2\"!2#\"/$?%"
116
+ ];
117
+ async function loadEnv(context, options) {
118
+ const [project, workspace, config] = await Promise.all([
119
+ (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.config.root, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)),
120
+ (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.workspaceConfig.workspaceRoot, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)),
121
+ (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.envPaths.config, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig))
122
+ ]);
123
+ return (0, defu.default)(loadEnvFromContext(context, process.env), project, workspace, config);
124
+ }
125
+ loadEnv.__type = [
126
+ () => require_types_plugin.__ΩEnvPluginContext,
127
+ "context",
128
+ () => require_types_plugin.__ΩEnvPluginOptions,
129
+ "options",
130
+ "loadEnv",
131
+ "Pn!2\"n#2$\"`/%"
132
+ ];
133
+
134
+ //#endregion
135
+ exports.loadEnv = loadEnv;
136
+ exports.loadEnvFromContext = loadEnvFromContext;
@@ -0,0 +1,35 @@
1
+ import { EnvPluginContext, EnvPluginOptions } from "../types/plugin.cjs";
2
+ import { DotenvParseOutput } from "@stryke/env/types";
3
+
4
+ //#region src/helpers/load.d.ts
5
+ /**
6
+ * Retrieves various dotenv configuration parameters from the context.
7
+ *
8
+ * @param context - The context to retrieve the dotenv configuration from.
9
+ * @param parsed - The parsed dotenv configuration.
10
+ * @returns An object containing the dotenv configuration.
11
+ */
12
+ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput): {
13
+ APP_NAME: string | undefined;
14
+ APP_VERSION: string | undefined;
15
+ BUILD_ID: string;
16
+ BUILD_TIMESTAMP: string;
17
+ BUILD_CHECKSUM: string;
18
+ RELEASE_ID: string;
19
+ RELEASE_TAG: string;
20
+ DEFAULT_LOCALE: string | undefined;
21
+ DEFAULT_TIMEZONE: string | undefined;
22
+ LOG_LEVEL: "error" | "warn" | "info" | "debug" | null;
23
+ ERROR_URL: string | undefined;
24
+ ORGANIZATION: string | undefined;
25
+ PLATFORM: "node" | "browser" | "neutral";
26
+ MODE: "development" | "test" | "production";
27
+ TEST: boolean;
28
+ DEBUG: boolean;
29
+ STACKTRACE: boolean;
30
+ ENVIRONMENT: string;
31
+ };
32
+ declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
33
+ //#endregion
34
+ export { loadEnv, loadEnvFromContext };
35
+ //# sourceMappingURL=load.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.d.cts","names":[],"sources":["../../src/helpers/load.ts"],"mappings":";;;;;;AAgGA;;;;;iBAAgB,kBAAA,CACd,OAAA,EAAS,gBAAA,EACT,MAAA,EAAQ,iBAAA;;;;;;;;;;;;;;;;;;;;iBAkDY,OAAA,cACP,iBAAA,GAAoB,iBAAA,CAAA,CACjC,OAAA,EAAS,gBAAA,EAAkB,OAAA,EAAS,gBAAA,GAAmB,OAAA,CAAQ,IAAA"}
@@ -0,0 +1,35 @@
1
+ import { EnvPluginContext, EnvPluginOptions } from "../types/plugin.mjs";
2
+ import { DotenvParseOutput } from "@stryke/env/types";
3
+
4
+ //#region src/helpers/load.d.ts
5
+ /**
6
+ * Retrieves various dotenv configuration parameters from the context.
7
+ *
8
+ * @param context - The context to retrieve the dotenv configuration from.
9
+ * @param parsed - The parsed dotenv configuration.
10
+ * @returns An object containing the dotenv configuration.
11
+ */
12
+ declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput): {
13
+ APP_NAME: string | undefined;
14
+ APP_VERSION: string | undefined;
15
+ BUILD_ID: string;
16
+ BUILD_TIMESTAMP: string;
17
+ BUILD_CHECKSUM: string;
18
+ RELEASE_ID: string;
19
+ RELEASE_TAG: string;
20
+ DEFAULT_LOCALE: string | undefined;
21
+ DEFAULT_TIMEZONE: string | undefined;
22
+ LOG_LEVEL: "error" | "warn" | "info" | "debug" | null;
23
+ ERROR_URL: string | undefined;
24
+ ORGANIZATION: string | undefined;
25
+ PLATFORM: "node" | "browser" | "neutral";
26
+ MODE: "development" | "test" | "production";
27
+ TEST: boolean;
28
+ DEBUG: boolean;
29
+ STACKTRACE: boolean;
30
+ ENVIRONMENT: string;
31
+ };
32
+ declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
33
+ //#endregion
34
+ export { loadEnv, loadEnvFromContext };
35
+ //# sourceMappingURL=load.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.d.mts","names":[],"sources":["../../src/helpers/load.ts"],"mappings":";;;;;;AAgGA;;;;;iBAAgB,kBAAA,CACd,OAAA,EAAS,gBAAA,EACT,MAAA,EAAQ,iBAAA;;;;;;;;;;;;;;;;;;;;iBAkDY,OAAA,cACP,iBAAA,GAAoB,iBAAA,CAAA,CACjC,OAAA,EAAS,gBAAA,EAAkB,OAAA,EAAS,gBAAA,GAAmB,OAAA,CAAQ,IAAA"}