@powerlines/plugin-env 0.15.140 → 0.15.142

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 (209) hide show
  1. package/dist/automd-generator-BNg74tyV.cjs +37 -0
  2. package/dist/automd-generator-DoKLIMuw.mjs +32 -0
  3. package/dist/automd-generator-DoKLIMuw.mjs.map +1 -0
  4. package/dist/babel/index.cjs +5 -2
  5. package/dist/babel/index.d.cts +14 -1
  6. package/dist/babel/index.d.mts +14 -1
  7. package/dist/babel/index.mjs +4 -1
  8. package/dist/babel/plugin.cjs +4 -140
  9. package/dist/babel/plugin.d.cts +14 -7
  10. package/dist/babel/plugin.d.mts +14 -7
  11. package/dist/babel/plugin.mjs +3 -138
  12. package/dist/babel-BZqmdVF4.cjs +0 -0
  13. package/dist/babel-DgietUY3.mjs +1 -0
  14. package/dist/chunk-CNVrAnJR.cjs +48 -0
  15. package/dist/{_virtual/rolldown_runtime.cjs → chunk-CsF2CmBJ.mjs} +6 -2
  16. package/dist/components/docs.cjs +13 -69
  17. package/dist/components/docs.d.cts +1 -21
  18. package/dist/components/docs.d.mts +1 -21
  19. package/dist/components/docs.mjs +12 -67
  20. package/dist/components/env.cjs +13 -588
  21. package/dist/components/env.d.cts +1 -19
  22. package/dist/components/env.d.mts +1 -19
  23. package/dist/components/env.mjs +11 -584
  24. package/dist/components/index.cjs +17 -5
  25. package/dist/components/index.d.cts +3 -2
  26. package/dist/components/index.d.mts +3 -2
  27. package/dist/components/index.mjs +14 -2
  28. package/dist/components-BUo6Koax.cjs +0 -0
  29. package/dist/components-DDFmImcI.mjs +1 -0
  30. package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs +23 -0
  31. package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs.map +1 -0
  32. package/dist/confbox.DA7CpUDY-r6FXRsI6.cjs +28 -0
  33. package/dist/confbox.DnMsyigM-C13n3X-S.cjs +415 -0
  34. package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs +405 -0
  35. package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs.map +1 -0
  36. package/dist/create-reflection-resource-B3friIs9.mjs +98 -0
  37. package/dist/create-reflection-resource-B3friIs9.mjs.map +1 -0
  38. package/dist/create-reflection-resource-BJj83ii4.cjs +103 -0
  39. package/dist/create-reflection-resource-DSLbLsX2.d.cts +16 -0
  40. package/dist/create-reflection-resource-DSLbLsX2.d.cts.map +1 -0
  41. package/dist/create-reflection-resource-DwWJAo-G.d.mts +16 -0
  42. package/dist/create-reflection-resource-DwWJAo-G.d.mts.map +1 -0
  43. package/dist/defu-CrqNIh1A.cjs +227 -0
  44. package/dist/defu-DV5Grr85.mjs +180 -0
  45. package/dist/defu-DV5Grr85.mjs.map +1 -0
  46. package/dist/dist-BQc8ZRwl.cjs +13 -0
  47. package/dist/dist-C_a6goTt.cjs +15282 -0
  48. package/dist/dist-CjWvISyq.mjs +15271 -0
  49. package/dist/dist-CjWvISyq.mjs.map +1 -0
  50. package/dist/dist-mV5Swt78.mjs +13 -0
  51. package/dist/dist-mV5Swt78.mjs.map +1 -0
  52. package/dist/docs-B-SDRHeg.cjs +75 -0
  53. package/dist/docs-B0d8pdIg.d.mts +23 -0
  54. package/dist/docs-B0d8pdIg.d.mts.map +1 -0
  55. package/dist/docs-DMfzQuvP.d.cts +23 -0
  56. package/dist/docs-DMfzQuvP.d.cts.map +1 -0
  57. package/dist/docs-DbRoWmL_.mjs +70 -0
  58. package/dist/docs-DbRoWmL_.mjs.map +1 -0
  59. package/dist/docs-helper-2fe7M3Th.mjs +24 -0
  60. package/dist/docs-helper-2fe7M3Th.mjs.map +1 -0
  61. package/dist/docs-helper-4MoQ5-R3.cjs +28 -0
  62. package/dist/env-BIyd8CTA.d.cts +21 -0
  63. package/dist/env-BIyd8CTA.d.cts.map +1 -0
  64. package/dist/env-BKmI7DyR.d.mts +21 -0
  65. package/dist/env-BKmI7DyR.d.mts.map +1 -0
  66. package/dist/env-D9oCn-AS.mjs +587 -0
  67. package/dist/env-D9oCn-AS.mjs.map +1 -0
  68. package/dist/env-R63eR4RP.cjs +598 -0
  69. package/dist/helpers/automd-generator.cjs +3 -31
  70. package/dist/helpers/automd-generator.d.cts +2 -1
  71. package/dist/helpers/automd-generator.d.cts.map +1 -0
  72. package/dist/helpers/automd-generator.d.mts +2 -1
  73. package/dist/helpers/automd-generator.d.mts.map +1 -0
  74. package/dist/helpers/automd-generator.mjs +2 -29
  75. package/dist/helpers/create-reflection-resource.cjs +11 -97
  76. package/dist/helpers/create-reflection-resource.d.cts +3 -14
  77. package/dist/helpers/create-reflection-resource.d.mts +3 -14
  78. package/dist/helpers/create-reflection-resource.mjs +10 -95
  79. package/dist/helpers/docs-helper.cjs +5 -23
  80. package/dist/helpers/docs-helper.d.cts +4 -2
  81. package/dist/helpers/docs-helper.d.cts.map +1 -0
  82. package/dist/helpers/docs-helper.d.mts +4 -2
  83. package/dist/helpers/docs-helper.d.mts.map +1 -0
  84. package/dist/helpers/docs-helper.mjs +4 -21
  85. package/dist/helpers/index.cjs +38 -32
  86. package/dist/helpers/index.d.cts +9 -6
  87. package/dist/helpers/index.d.mts +9 -6
  88. package/dist/helpers/index.mjs +12 -6
  89. package/dist/helpers/load.cjs +10 -134
  90. package/dist/helpers/load.d.cts +3 -34
  91. package/dist/helpers/load.d.mts +3 -34
  92. package/dist/helpers/load.mjs +8 -130
  93. package/dist/helpers/persistence.cjs +15 -321
  94. package/dist/helpers/persistence.d.cts +3 -83
  95. package/dist/helpers/persistence.d.mts +3 -83
  96. package/dist/helpers/persistence.mjs +4 -308
  97. package/dist/helpers/reflect.cjs +13 -262
  98. package/dist/helpers/reflect.d.cts +3 -45
  99. package/dist/helpers/reflect.d.mts +3 -45
  100. package/dist/helpers/reflect.mjs +4 -252
  101. package/dist/helpers/source-file-env.cjs +3 -57
  102. package/dist/helpers/source-file-env.d.cts +1 -7
  103. package/dist/helpers/source-file-env.d.mts +1 -7
  104. package/dist/helpers/source-file-env.mjs +1 -54
  105. package/dist/helpers/template-helpers.cjs +6 -69
  106. package/dist/helpers/template-helpers.d.cts +3 -14
  107. package/dist/helpers/template-helpers.d.mts +3 -14
  108. package/dist/helpers/template-helpers.mjs +5 -67
  109. package/dist/helpers-45e1bvAO.mjs +1 -0
  110. package/dist/helpers-DgYP3uej.cjs +0 -0
  111. package/dist/index-BNRXMhlr.d.mts +1 -0
  112. package/dist/index-Bdi8CvaN.d.cts +16 -0
  113. package/dist/index-Bdi8CvaN.d.cts.map +1 -0
  114. package/dist/index-CEDY7cmG.d.cts +1 -0
  115. package/dist/index-CREkvfw9.d.mts +1 -0
  116. package/dist/index-DSiHnMH2.d.cts +1 -0
  117. package/dist/index-Drhzdkqe.d.mts +16 -0
  118. package/dist/index-Drhzdkqe.d.mts.map +1 -0
  119. package/dist/index-dhjtMp5F.d.mts +1 -0
  120. package/dist/index-uTS5iDq_.d.cts +1 -0
  121. package/dist/index.cjs +257 -98
  122. package/dist/index.d.cts +14 -23
  123. package/dist/index.d.mts +14 -23
  124. package/dist/index.mjs +184 -23
  125. package/dist/index.mjs.map +1 -0
  126. package/dist/join-paths-BMg51Ddi.mjs +148 -0
  127. package/dist/join-paths-BMg51Ddi.mjs.map +1 -0
  128. package/dist/join-paths-Bc4rM2TX.cjs +159 -0
  129. package/dist/json5-DEV_07Nb.cjs +786 -0
  130. package/dist/json5-jq90mF9X.mjs +787 -0
  131. package/dist/json5-jq90mF9X.mjs.map +1 -0
  132. package/dist/jsonc-CBh70baJ.cjs +4 -0
  133. package/dist/jsonc-CDLU6bgi.mjs +4 -0
  134. package/dist/load-DPB0maqs.cjs +6594 -0
  135. package/dist/load-Dr5ybfL7.mjs +6579 -0
  136. package/dist/load-Dr5ybfL7.mjs.map +1 -0
  137. package/dist/load-GpP6cojj.d.mts +36 -0
  138. package/dist/load-GpP6cojj.d.mts.map +1 -0
  139. package/dist/load-PHGmxX_X.d.cts +36 -0
  140. package/dist/load-PHGmxX_X.d.cts.map +1 -0
  141. package/dist/multipart-parser-D65rtMfY.mjs +176 -0
  142. package/dist/multipart-parser-D65rtMfY.mjs.map +1 -0
  143. package/dist/multipart-parser-aEF5a4Xf.cjs +178 -0
  144. package/dist/node-Co8KdzkZ.cjs +3985 -0
  145. package/dist/node-D9MigVDD.mjs +3975 -0
  146. package/dist/node-D9MigVDD.mjs.map +1 -0
  147. package/dist/persistence-BR4cUaN6.d.cts +85 -0
  148. package/dist/persistence-BR4cUaN6.d.cts.map +1 -0
  149. package/dist/persistence-BsBxs9wt.mjs +586 -0
  150. package/dist/persistence-BsBxs9wt.mjs.map +1 -0
  151. package/dist/persistence-D_clXRxP.cjs +712 -0
  152. package/dist/persistence-DrKQZNCv.d.mts +85 -0
  153. package/dist/persistence-DrKQZNCv.d.mts.map +1 -0
  154. package/dist/plugin-CM1TSv1B.cjs +159 -0
  155. package/dist/plugin-CSVnrdpE.cjs +146 -0
  156. package/dist/plugin-CSe5f2cD.d.cts +155 -0
  157. package/dist/plugin-CSe5f2cD.d.cts.map +1 -0
  158. package/dist/plugin-DMbVjdcQ.d.mts +155 -0
  159. package/dist/plugin-DMbVjdcQ.d.mts.map +1 -0
  160. package/dist/plugin-Vyvy9w9Z.mjs +141 -0
  161. package/dist/plugin-Vyvy9w9Z.mjs.map +1 -0
  162. package/dist/plugin-eBjQJP6x.mjs +130 -0
  163. package/dist/plugin-eBjQJP6x.mjs.map +1 -0
  164. package/dist/reflect-Dm8a3c29.d.cts +47 -0
  165. package/dist/reflect-Dm8a3c29.d.cts.map +1 -0
  166. package/dist/reflect-Dpz8ifa0.d.mts +47 -0
  167. package/dist/reflect-Dpz8ifa0.d.mts.map +1 -0
  168. package/dist/runtime-BDzzR4wH.d.cts +792 -0
  169. package/dist/runtime-BDzzR4wH.d.cts.map +1 -0
  170. package/dist/runtime-C5ukCv3P.mjs +242 -0
  171. package/dist/runtime-C5ukCv3P.mjs.map +1 -0
  172. package/dist/runtime-g0TEIoZK.cjs +253 -0
  173. package/dist/runtime-lYSIZdMn.d.mts +792 -0
  174. package/dist/runtime-lYSIZdMn.d.mts.map +1 -0
  175. package/dist/source-file-env-4Vdtzc5-.cjs +68 -0
  176. package/dist/source-file-env-Brfopjyr.d.cts +9 -0
  177. package/dist/source-file-env-Brfopjyr.d.cts.map +1 -0
  178. package/dist/source-file-env-DWejSP2U.d.mts +9 -0
  179. package/dist/source-file-env-DWejSP2U.d.mts.map +1 -0
  180. package/dist/source-file-env-Tj-6qobx.mjs +57 -0
  181. package/dist/source-file-env-Tj-6qobx.mjs.map +1 -0
  182. package/dist/template-helpers-1SKodHKt.d.mts +16 -0
  183. package/dist/template-helpers-1SKodHKt.d.mts.map +1 -0
  184. package/dist/template-helpers-CCEjhw1B.mjs +70 -0
  185. package/dist/template-helpers-CCEjhw1B.mjs.map +1 -0
  186. package/dist/template-helpers-YVcwxmoF.cjs +75 -0
  187. package/dist/template-helpers-zyitPfMz.d.cts +16 -0
  188. package/dist/template-helpers-zyitPfMz.d.cts.map +1 -0
  189. package/dist/toml-DvrxV201.cjs +657 -0
  190. package/dist/toml-uuOYvEAO.mjs +658 -0
  191. package/dist/toml-uuOYvEAO.mjs.map +1 -0
  192. package/dist/types/index.cjs +10 -9
  193. package/dist/types/index.d.cts +3 -2
  194. package/dist/types/index.d.mts +3 -2
  195. package/dist/types/index.mjs +3 -2
  196. package/dist/types/plugin.cjs +7 -133
  197. package/dist/types/plugin.d.cts +2 -153
  198. package/dist/types/plugin.d.mts +2 -153
  199. package/dist/types/plugin.mjs +2 -127
  200. package/dist/types/runtime.cjs +3 -242
  201. package/dist/types/runtime.d.cts +1 -790
  202. package/dist/types/runtime.d.mts +1 -790
  203. package/dist/types/runtime.mjs +1 -239
  204. package/dist/types-DyPQho_C.mjs +1 -0
  205. package/dist/types-o3zWarRp.cjs +0 -0
  206. package/dist/yaml-CIn2Gddw.mjs +1055 -0
  207. package/dist/yaml-CIn2Gddw.mjs.map +1 -0
  208. package/dist/yaml-CQSFMRMS.cjs +1054 -0
  209. package/package.json +9 -9
@@ -1,135 +1,11 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_types_plugin = require('../types/plugin.cjs');
3
- const require_helpers_source_file_env = require('./source-file-env.cjs');
4
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
5
- let powerlines_types_config = require("powerlines/types/config");
6
- let __stryke_env_load_env = require("@stryke/env/load-env");
7
- let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
8
- let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
9
- let c12 = require("c12");
10
- let defu = require("defu");
11
- defu = require_rolldown_runtime.__toESM(defu);
12
- let powerlines_lib_constants_environments = require("powerlines/lib/constants/environments");
1
+ require('../runtime-g0TEIoZK.cjs');
2
+ require('../plugin-CM1TSv1B.cjs');
3
+ require('../join-paths-Bc4rM2TX.cjs');
4
+ require('../source-file-env-4Vdtzc5-.cjs');
5
+ require('../defu-CrqNIh1A.cjs');
6
+ const require_load = require('../load-DPB0maqs.cjs');
7
+ require('../confbox.DA7CpUDY-r6FXRsI6.cjs');
8
+ require('../confbox.DnMsyigM-C13n3X-S.cjs');
13
9
 
14
- //#region src/helpers/load.ts
15
- function __assignType(fn, args) {
16
- fn.__type = args;
17
- return fn;
18
- }
19
- async function loadEnvFiles(options, mode, cwd) {
20
- let env = await (0, __stryke_env_load_env.loadEnv)(cwd, mode);
21
- if (options.additionalFiles && options.additionalFiles?.length > 0) {
22
- const additionalEnvFiles = await Promise.all(options.additionalFiles.map(__assignType(async (additionalEnvFile) => (0, __stryke_env_load_env.loadEnvFile)(additionalEnvFile, cwd), [
23
- "additionalEnvFile",
24
- "",
25
- "P\"2!\"/\""
26
- ])));
27
- for (const additionalEnvFile of additionalEnvFiles) env = (0, defu.default)(additionalEnvFile, env);
28
- }
29
- return require_helpers_source_file_env.removeEnvPrefix(env);
30
- }
31
- loadEnvFiles.__type = [
32
- () => require_types_plugin.__ΩEnvPluginOptions,
33
- "options",
34
- "mode",
35
- "cwd",
36
- "loadEnvFiles",
37
- "Pn!2\"&2#&2$\"`/%"
38
- ];
39
- async function loadEnvDirectory(options, directory, mode, cacheDir, packageJson, workspaceConfig) {
40
- const [envResult, c12Result] = await Promise.all([(loadEnvFiles.Ω = [["!"]], loadEnvFiles(options, mode, directory)), (0, c12.loadConfig)({
41
- cwd: directory,
42
- name: "storm",
43
- envName: mode,
44
- defaults: {
45
- NAME: packageJson.name?.replace(`@${workspaceConfig.namespace}/`, ""),
46
- MODE: mode,
47
- ORG: workspaceConfig.organization
48
- },
49
- globalRc: true,
50
- packageJson: true,
51
- dotenv: true,
52
- jitiOptions: {
53
- fsCache: (0, __stryke_path_join_paths.joinPaths)(cacheDir, "jiti"),
54
- moduleCache: true
55
- }
56
- })]);
57
- return (0, defu.default)(envResult, c12Result.config, workspaceConfig);
58
- }
59
- loadEnvDirectory.__type = [
60
- () => require_types_plugin.__ΩEnvPluginOptions,
61
- "options",
62
- "directory",
63
- "mode",
64
- "cacheDir",
65
- "packageJson",
66
- () => powerlines_types_config.__ΩWorkspaceConfig,
67
- "workspaceConfig",
68
- "loadEnvDirectory",
69
- "Pn!2\"&2#&2$&2%!2&n'2(\"`/)"
70
- ];
71
- /**
72
- * Retrieves various dotenv configuration parameters from the context.
73
- *
74
- * @param context - The context to retrieve the dotenv configuration from.
75
- * @param parsed - The parsed dotenv configuration.
76
- * @returns An object containing the dotenv configuration.
77
- */
78
- function loadEnvFromContext(context, parsed) {
79
- return (0, defu.default)({
80
- APP_NAME: (0, __stryke_string_format_kebab_case.kebabCase)(context.config.name || context.packageJson.name?.replace(`/${context.workspaceConfig.namespace}`, "")),
81
- APP_VERSION: context.packageJson.version,
82
- BUILD_ID: context.meta.buildId,
83
- BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),
84
- BUILD_CHECKSUM: context.meta.checksum,
85
- RELEASE_ID: context.meta.releaseId,
86
- RELEASE_TAG: `${(0, __stryke_string_format_kebab_case.kebabCase)(context.config.name)}@${context.packageJson.version}`,
87
- DEFAULT_LOCALE: context.workspaceConfig.locale,
88
- DEFAULT_TIMEZONE: context.workspaceConfig.timezone,
89
- LOG_LEVEL: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
90
- ERROR_URL: context.workspaceConfig.error?.url,
91
- ORGANIZATION: context.config.organization || ((0, __stryke_type_checks_is_set_object.isSetObject)(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization),
92
- PLATFORM: context.config.build.platform,
93
- MODE: context.config.mode,
94
- TEST: context.config.mode === "test",
95
- DEBUG: context.config.mode === "development",
96
- STACKTRACE: context.config.mode !== "production",
97
- ENVIRONMENT: !context.environment.name || context.environment.name === powerlines_lib_constants_environments.DEFAULT_ENVIRONMENT ? context.config.mode : context.environment.name
98
- }, (0, __stryke_type_checks_is_set_object.isSetObject)(context?.env?.types?.env) ? context.env.types.env?.getProperties().reduce(__assignType((ret, prop) => {
99
- ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();
100
- return ret;
101
- }, [
102
- "ret",
103
- "prop",
104
- "",
105
- "P\"2!\"2\"\"/#"
106
- ]), {}) : {});
107
- }
108
- loadEnvFromContext.__type = [
109
- () => require_types_plugin.__ΩEnvPluginContext,
110
- "context",
111
- "parsed",
112
- "loadEnvFromContext",
113
- "Retrieves various dotenv configuration parameters from the context.",
114
- "Pn!2\"!2#\"/$?%"
115
- ];
116
- async function loadEnv(context, options) {
117
- const [project, workspace, config] = await Promise.all([
118
- (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.config.projectRoot, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)),
119
- (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.workspaceConfig.workspaceRoot, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)),
120
- (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.envPaths.config, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig))
121
- ]);
122
- return (0, defu.default)(loadEnvFromContext(context, process.env), project, workspace, config);
123
- }
124
- loadEnv.__type = [
125
- () => require_types_plugin.__ΩEnvPluginContext,
126
- "context",
127
- () => require_types_plugin.__ΩEnvPluginOptions,
128
- "options",
129
- "loadEnv",
130
- "Pn!2\"n#2$\"`/%"
131
- ];
132
-
133
- //#endregion
134
- exports.loadEnv = loadEnv;
135
- exports.loadEnvFromContext = loadEnvFromContext;
10
+ exports.loadEnv = require_load.loadEnv;
11
+ exports.loadEnvFromContext = require_load.loadEnvFromContext;
@@ -1,35 +1,4 @@
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
- /**
7
- * Retrieves various dotenv configuration parameters from the context.
8
- *
9
- * @param context - The context to retrieve the dotenv configuration from.
10
- * @param parsed - The parsed dotenv configuration.
11
- * @returns An object containing the dotenv configuration.
12
- */
13
- declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput): {
14
- APP_NAME: string | undefined;
15
- APP_VERSION: string | undefined;
16
- BUILD_ID: string;
17
- BUILD_TIMESTAMP: string;
18
- BUILD_CHECKSUM: string;
19
- RELEASE_ID: string;
20
- RELEASE_TAG: string;
21
- DEFAULT_LOCALE: string | undefined;
22
- DEFAULT_TIMEZONE: string | undefined;
23
- LOG_LEVEL: "error" | "warn" | "info" | "debug" | null;
24
- ERROR_URL: string | undefined;
25
- ORGANIZATION: string | undefined;
26
- PLATFORM: "node" | "browser" | "neutral" | undefined;
27
- MODE: "test" | "development" | "production";
28
- TEST: boolean;
29
- DEBUG: boolean;
30
- STACKTRACE: boolean;
31
- ENVIRONMENT: string;
32
- };
33
- declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
34
- //#endregion
1
+ import "../runtime-BDzzR4wH.cjs";
2
+ import "../plugin-CSe5f2cD.cjs";
3
+ import { n as loadEnvFromContext, t as loadEnv } from "../load-PHGmxX_X.cjs";
35
4
  export { loadEnv, loadEnvFromContext };
@@ -1,35 +1,4 @@
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
- /**
7
- * Retrieves various dotenv configuration parameters from the context.
8
- *
9
- * @param context - The context to retrieve the dotenv configuration from.
10
- * @param parsed - The parsed dotenv configuration.
11
- * @returns An object containing the dotenv configuration.
12
- */
13
- declare function loadEnvFromContext(context: EnvPluginContext, parsed: DotenvParseOutput): {
14
- APP_NAME: string | undefined;
15
- APP_VERSION: string | undefined;
16
- BUILD_ID: string;
17
- BUILD_TIMESTAMP: string;
18
- BUILD_CHECKSUM: string;
19
- RELEASE_ID: string;
20
- RELEASE_TAG: string;
21
- DEFAULT_LOCALE: string | undefined;
22
- DEFAULT_TIMEZONE: string | undefined;
23
- LOG_LEVEL: "error" | "warn" | "info" | "debug" | null;
24
- ERROR_URL: string | undefined;
25
- ORGANIZATION: string | undefined;
26
- PLATFORM: "node" | "browser" | "neutral" | undefined;
27
- MODE: "test" | "development" | "production";
28
- TEST: boolean;
29
- DEBUG: boolean;
30
- STACKTRACE: boolean;
31
- ENVIRONMENT: string;
32
- };
33
- declare function loadEnv<TEnv extends DotenvParseOutput = DotenvParseOutput>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv>;
34
- //#endregion
1
+ import "../runtime-lYSIZdMn.mjs";
2
+ import "../plugin-DMbVjdcQ.mjs";
3
+ import { n as loadEnvFromContext, t as loadEnv } from "../load-GpP6cojj.mjs";
35
4
  export { loadEnv, loadEnvFromContext };
@@ -1,132 +1,10 @@
1
- import { __ΩEnvPluginContext, __ΩEnvPluginOptions } from "../types/plugin.mjs";
2
- import { removeEnvPrefix } from "./source-file-env.mjs";
3
- import { joinPaths } from "@stryke/path/join-paths";
4
- import { __ΩWorkspaceConfig } from "powerlines/types/config";
5
- import { loadEnv as loadEnv$1, loadEnvFile } from "@stryke/env/load-env";
6
- import { kebabCase } from "@stryke/string-format/kebab-case";
7
- import { isSetObject } from "@stryke/type-checks/is-set-object";
8
- import { loadConfig } from "c12";
9
- import defu from "defu";
10
- import { DEFAULT_ENVIRONMENT } from "powerlines/lib/constants/environments";
1
+ import "../runtime-C5ukCv3P.mjs";
2
+ import "../plugin-eBjQJP6x.mjs";
3
+ import "../join-paths-BMg51Ddi.mjs";
4
+ import "../source-file-env-Tj-6qobx.mjs";
5
+ import "../defu-DV5Grr85.mjs";
6
+ import { n as loadEnvFromContext, t as loadEnv } from "../load-Dr5ybfL7.mjs";
7
+ import "../confbox.DA7CpUDY-DShUZ_rW.mjs";
8
+ import "../confbox.DnMsyigM-V6Wj0LPC.mjs";
11
9
 
12
- //#region src/helpers/load.ts
13
- function __assignType(fn, args) {
14
- fn.__type = args;
15
- return fn;
16
- }
17
- async function loadEnvFiles(options, mode, cwd) {
18
- let env = await loadEnv$1(cwd, mode);
19
- if (options.additionalFiles && options.additionalFiles?.length > 0) {
20
- const additionalEnvFiles = await Promise.all(options.additionalFiles.map(__assignType(async (additionalEnvFile) => loadEnvFile(additionalEnvFile, cwd), [
21
- "additionalEnvFile",
22
- "",
23
- "P\"2!\"/\""
24
- ])));
25
- for (const additionalEnvFile of additionalEnvFiles) env = defu(additionalEnvFile, env);
26
- }
27
- return removeEnvPrefix(env);
28
- }
29
- loadEnvFiles.__type = [
30
- () => __ΩEnvPluginOptions,
31
- "options",
32
- "mode",
33
- "cwd",
34
- "loadEnvFiles",
35
- "Pn!2\"&2#&2$\"`/%"
36
- ];
37
- async function loadEnvDirectory(options, directory, mode, cacheDir, packageJson, workspaceConfig) {
38
- const [envResult, c12Result] = await Promise.all([(loadEnvFiles.Ω = [["!"]], loadEnvFiles(options, mode, directory)), loadConfig({
39
- cwd: directory,
40
- name: "storm",
41
- envName: mode,
42
- defaults: {
43
- NAME: packageJson.name?.replace(`@${workspaceConfig.namespace}/`, ""),
44
- MODE: mode,
45
- ORG: workspaceConfig.organization
46
- },
47
- globalRc: true,
48
- packageJson: true,
49
- dotenv: true,
50
- jitiOptions: {
51
- fsCache: joinPaths(cacheDir, "jiti"),
52
- moduleCache: true
53
- }
54
- })]);
55
- return defu(envResult, c12Result.config, workspaceConfig);
56
- }
57
- loadEnvDirectory.__type = [
58
- () => __ΩEnvPluginOptions,
59
- "options",
60
- "directory",
61
- "mode",
62
- "cacheDir",
63
- "packageJson",
64
- () => __ΩWorkspaceConfig,
65
- "workspaceConfig",
66
- "loadEnvDirectory",
67
- "Pn!2\"&2#&2$&2%!2&n'2(\"`/)"
68
- ];
69
- /**
70
- * Retrieves various dotenv configuration parameters from the context.
71
- *
72
- * @param context - The context to retrieve the dotenv configuration from.
73
- * @param parsed - The parsed dotenv configuration.
74
- * @returns An object containing the dotenv configuration.
75
- */
76
- function loadEnvFromContext(context, parsed) {
77
- return defu({
78
- APP_NAME: kebabCase(context.config.name || context.packageJson.name?.replace(`/${context.workspaceConfig.namespace}`, "")),
79
- APP_VERSION: context.packageJson.version,
80
- BUILD_ID: context.meta.buildId,
81
- BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),
82
- BUILD_CHECKSUM: context.meta.checksum,
83
- RELEASE_ID: context.meta.releaseId,
84
- RELEASE_TAG: `${kebabCase(context.config.name)}@${context.packageJson.version}`,
85
- DEFAULT_LOCALE: context.workspaceConfig.locale,
86
- DEFAULT_TIMEZONE: context.workspaceConfig.timezone,
87
- LOG_LEVEL: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
88
- ERROR_URL: context.workspaceConfig.error?.url,
89
- ORGANIZATION: context.config.organization || (isSetObject(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization),
90
- PLATFORM: context.config.build.platform,
91
- MODE: context.config.mode,
92
- TEST: context.config.mode === "test",
93
- DEBUG: context.config.mode === "development",
94
- STACKTRACE: context.config.mode !== "production",
95
- ENVIRONMENT: !context.environment.name || context.environment.name === DEFAULT_ENVIRONMENT ? context.config.mode : context.environment.name
96
- }, isSetObject(context?.env?.types?.env) ? context.env.types.env?.getProperties().reduce(__assignType((ret, prop) => {
97
- ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();
98
- return ret;
99
- }, [
100
- "ret",
101
- "prop",
102
- "",
103
- "P\"2!\"2\"\"/#"
104
- ]), {}) : {});
105
- }
106
- loadEnvFromContext.__type = [
107
- () => __ΩEnvPluginContext,
108
- "context",
109
- "parsed",
110
- "loadEnvFromContext",
111
- "Retrieves various dotenv configuration parameters from the context.",
112
- "Pn!2\"!2#\"/$?%"
113
- ];
114
- async function loadEnv(context, options) {
115
- const [project, workspace, config] = await Promise.all([
116
- (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.config.projectRoot, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)),
117
- (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.workspaceConfig.workspaceRoot, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)),
118
- (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.envPaths.config, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig))
119
- ]);
120
- return defu(loadEnvFromContext(context, process.env), project, workspace, config);
121
- }
122
- loadEnv.__type = [
123
- () => __ΩEnvPluginContext,
124
- "context",
125
- () => __ΩEnvPluginOptions,
126
- "options",
127
- "loadEnv",
128
- "Pn!2\"n#2$\"`/%"
129
- ];
130
-
131
- //#endregion
132
10
  export { loadEnv, loadEnvFromContext };