@powerlines/plugin-env 0.16.66 → 0.16.68

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 (142) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +0 -2
  2. package/dist/_virtual/_rolldown/runtime.mjs +2 -31
  3. package/dist/babel/plugin.cjs +83 -11
  4. package/dist/babel/plugin.mjs +83 -11
  5. package/dist/babel/plugin.mjs.map +1 -1
  6. package/dist/components/env-builtin.cjs +1 -1
  7. package/dist/components/env-builtin.mjs +1 -1
  8. package/dist/helpers/automd-generator.cjs +14 -4
  9. package/dist/helpers/automd-generator.d.mts +1 -1
  10. package/dist/helpers/automd-generator.mjs +14 -4
  11. package/dist/helpers/automd-generator.mjs.map +1 -1
  12. package/dist/helpers/create-reflection-resource.cjs +8 -0
  13. package/dist/helpers/create-reflection-resource.mjs +9 -0
  14. package/dist/helpers/create-reflection-resource.mjs.map +1 -1
  15. package/dist/helpers/docs-helper.cjs +8 -0
  16. package/dist/helpers/docs-helper.mjs +8 -0
  17. package/dist/helpers/docs-helper.mjs.map +1 -1
  18. package/dist/helpers/index.cjs +1 -0
  19. package/dist/helpers/index.mjs +2 -2
  20. package/dist/helpers/load.cjs +61 -10
  21. package/dist/helpers/load.mjs +60 -9
  22. package/dist/helpers/load.mjs.map +1 -1
  23. package/dist/helpers/persistence.cjs +108 -1
  24. package/dist/helpers/persistence.mjs +108 -1
  25. package/dist/helpers/persistence.mjs.map +1 -1
  26. package/dist/helpers/reflect.cjs +156 -3
  27. package/dist/helpers/reflect.mjs +156 -4
  28. package/dist/helpers/reflect.mjs.map +1 -1
  29. package/dist/helpers/source-file-env.cjs +34 -4
  30. package/dist/helpers/source-file-env.mjs +34 -4
  31. package/dist/helpers/source-file-env.mjs.map +1 -1
  32. package/dist/helpers/template-helpers.cjs +33 -5
  33. package/dist/helpers/template-helpers.mjs +33 -5
  34. package/dist/helpers/template-helpers.mjs.map +1 -1
  35. package/dist/types/index.cjs +11 -0
  36. package/dist/types/index.mjs +4 -1
  37. package/dist/types/plugin.cjs +137 -0
  38. package/dist/types/plugin.d.mts +4 -4
  39. package/dist/types/plugin.mjs +132 -1
  40. package/dist/types/plugin.mjs.map +1 -0
  41. package/dist/types/runtime.cjs +244 -0
  42. package/dist/types/runtime.mjs +242 -1
  43. package/dist/types/runtime.mjs.map +1 -0
  44. package/package.json +11 -26
  45. package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.cjs +0 -346
  46. package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs +0 -347
  47. package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs.map +0 -1
  48. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.cjs +0 -23
  49. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs +0 -23
  50. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map +0 -1
  51. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.cjs +0 -10
  52. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs +0 -11
  53. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map +0 -1
  54. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.cjs +0 -1060
  55. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs +0 -1060
  56. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs.map +0 -1
  57. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.cjs +0 -761
  58. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs +0 -761
  59. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs.map +0 -1
  60. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.cjs +0 -388
  61. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs +0 -388
  62. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs.map +0 -1
  63. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.cjs +0 -639
  64. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs +0 -639
  65. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs.map +0 -1
  66. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.cjs +0 -17
  67. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs +0 -15
  68. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.cjs +0 -13
  70. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs +0 -14
  71. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs.map +0 -1
  72. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.cjs +0 -11
  73. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs +0 -12
  74. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs.map +0 -1
  75. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/toml.cjs +0 -11
  76. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/toml.mjs +0 -12
  77. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/toml.mjs.map +0 -1
  78. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.cjs +0 -11
  79. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs +0 -12
  80. package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs.map +0 -1
  81. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +0 -46
  82. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +0 -46
  83. package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +0 -1
  84. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.cjs +0 -285
  85. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs +0 -283
  86. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs.map +0 -1
  87. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.cjs +0 -71
  88. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs +0 -69
  89. package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs.map +0 -1
  90. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +0 -1013
  91. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +0 -1008
  92. package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +0 -1
  93. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +0 -23
  94. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +0 -10
  95. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs.map +0 -1
  96. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +0 -2695
  97. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -2682
  98. package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs.map +0 -1
  99. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs +0 -4457
  100. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs +0 -4455
  101. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs.map +0 -1
  102. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +0 -29
  103. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +0 -30
  104. package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs.map +0 -1
  105. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -181
  106. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -177
  107. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +0 -1
  108. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +0 -22
  109. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +0 -18
  110. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +0 -1
  111. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +0 -3967
  112. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +0 -3963
  113. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +0 -1
  114. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +0 -11766
  115. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +0 -11762
  116. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs.map +0 -1
  117. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -25
  118. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +0 -21
  119. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs.map +0 -1
  120. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +0 -20
  121. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +0 -18
  122. package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs.map +0 -1
  123. package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.cjs +0 -178
  124. package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs +0 -176
  125. package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs.map +0 -1
  126. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs +0 -13
  127. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs +0 -13
  128. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs.map +0 -1
  129. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.cjs +0 -3
  130. package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs +0 -3
  131. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +0 -145
  132. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -139
  133. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +0 -1
  134. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +0 -128
  135. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +0 -127
  136. package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +0 -1
  137. package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +0 -138
  138. package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +0 -137
  139. package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs.map +0 -1
  140. package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +0 -629
  141. package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +0 -628
  142. package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
- import { BaseEnv, BaseSecrets, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./reflect.mjs";
1
+ import { BaseEnv, BaseSecrets, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets } from "./reflect.mjs";
2
2
  import { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection } from "./persistence.mjs";
3
3
  import { createTemplateReflection } from "./template-helpers.mjs";
4
4
  import { formatEnvField, removeEnvPrefix } from "./source-file-env.mjs";
5
5
  import { loadEnv, loadEnvFromContext } from "./load.mjs";
6
6
  import { createReflection } from "./create-reflection-resource.mjs";
7
7
 
8
- export { BaseEnv, BaseSecrets, createEnvReflection, createReflection, createSecretsReflection, createTemplateReflection, formatEnvField, getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, loadEnv, loadEnvFromContext, mergeEnvReflections, mergeSecretsReflections, readEnvReflection, readEnvTypeReflection, readSecretsReflection, reflectEnv, reflectSecrets, removeEnvPrefix, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
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 };
@@ -1,26 +1,44 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_types_plugin = require('../types/plugin.cjs');
3
4
  const require_helpers_source_file_env = require('./source-file-env.cjs');
4
- const require_index = require('../node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.cjs');
5
+ let powerlines = require("powerlines");
5
6
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
6
7
  let _stryke_env_load_env = require("@stryke/env/load-env");
7
8
  let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
8
9
  let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
10
+ let c12 = require("c12");
9
11
  let defu = require("defu");
10
12
  defu = require_runtime.__toESM(defu);
11
- let powerlines_utils = require("powerlines/utils");
13
+ let powerlines_constants = require("powerlines/constants");
12
14
 
13
15
  //#region src/helpers/load.ts
16
+ function __assignType(fn, args) {
17
+ fn.__type = args;
18
+ return fn;
19
+ }
14
20
  async function loadEnvFiles(options, mode, cwd) {
15
21
  let env = await (0, _stryke_env_load_env.loadEnv)(cwd, mode);
16
22
  if (options.additionalFiles && options.additionalFiles?.length > 0) {
17
- const additionalEnvFiles = await Promise.all(options.additionalFiles.map(async (additionalEnvFile) => (0, _stryke_env_load_env.loadEnvFile)(additionalEnvFile, cwd)));
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
+ ])));
18
28
  for (const additionalEnvFile of additionalEnvFiles) env = (0, defu.default)(additionalEnvFile, env);
19
29
  }
20
30
  return require_helpers_source_file_env.removeEnvPrefix(env);
21
31
  }
32
+ loadEnvFiles.__type = [
33
+ () => require_types_plugin.__ΩEnvPluginOptions,
34
+ "options",
35
+ "mode",
36
+ "cwd",
37
+ "loadEnvFiles",
38
+ "Pn!2\"&2#&2$\"`/%"
39
+ ];
22
40
  async function loadEnvDirectory(options, directory, mode, cacheDir, packageJson, workspaceConfig) {
23
- const [envResult, c12Result] = await Promise.all([loadEnvFiles(options, mode, directory), require_index.loadConfig({
41
+ const [envResult, c12Result] = await Promise.all([(loadEnvFiles.Ω = [["!"]], loadEnvFiles(options, mode, directory)), (0, c12.loadConfig)({
24
42
  cwd: directory,
25
43
  name: "storm",
26
44
  envName: mode,
@@ -39,6 +57,18 @@ async function loadEnvDirectory(options, directory, mode, cacheDir, packageJson,
39
57
  })]);
40
58
  return (0, defu.default)(envResult, c12Result.config, workspaceConfig);
41
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
+ ];
42
72
  /**
43
73
  * Retrieves various dotenv configuration parameters from the context.
44
74
  *
@@ -65,20 +95,41 @@ function loadEnvFromContext(context, parsed) {
65
95
  TEST: context.config.mode === "test",
66
96
  DEBUG: context.config.mode === "development",
67
97
  STACKTRACE: context.config.mode !== "production",
68
- ENVIRONMENT: !context.environment.name || context.environment.name === powerlines_utils.DEFAULT_ENVIRONMENT ? context.config.mode : context.environment.name
69
- }, (0, _stryke_type_checks_is_set_object.isSetObject)(context?.env?.types?.env) ? context.env.types.env?.getProperties().reduce((ret, prop) => {
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) => {
70
100
  ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();
71
101
  return ret;
72
- }, {}) : {});
102
+ }, [
103
+ "ret",
104
+ "prop",
105
+ "",
106
+ "P\"2!\"2\"\"/#"
107
+ ]), {}) : {});
73
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
+ ];
74
117
  async function loadEnv(context, options) {
75
118
  const [project, workspace, config] = await Promise.all([
76
- loadEnvDirectory(options, context.config.root, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig),
77
- loadEnvDirectory(options, context.workspaceConfig.workspaceRoot, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig),
78
- loadEnvDirectory(options, context.envPaths.config, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)
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))
79
122
  ]);
80
123
  return (0, defu.default)(loadEnvFromContext(context, process.env), project, workspace, config);
81
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
+ ];
82
133
 
83
134
  //#endregion
84
135
  exports.loadEnv = loadEnv;
@@ -1,23 +1,41 @@
1
+ import { __ΩEnvPluginContext, __ΩEnvPluginOptions } from "../types/plugin.mjs";
1
2
  import { removeEnvPrefix } from "./source-file-env.mjs";
2
- import { loadConfig } from "../node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs";
3
+ import { __ΩWorkspaceConfig } from "powerlines";
3
4
  import { joinPaths } from "@stryke/path/join-paths";
4
5
  import { loadEnv as loadEnv$1, loadEnvFile } from "@stryke/env/load-env";
5
6
  import { kebabCase } from "@stryke/string-format/kebab-case";
6
7
  import { isSetObject } from "@stryke/type-checks/is-set-object";
8
+ import { loadConfig } from "c12";
7
9
  import defu from "defu";
8
- import { DEFAULT_ENVIRONMENT } from "powerlines/utils";
10
+ import { DEFAULT_ENVIRONMENT } from "powerlines/constants";
9
11
 
10
12
  //#region src/helpers/load.ts
13
+ function __assignType(fn, args) {
14
+ fn.__type = args;
15
+ return fn;
16
+ }
11
17
  async function loadEnvFiles(options, mode, cwd) {
12
18
  let env = await loadEnv$1(cwd, mode);
13
19
  if (options.additionalFiles && options.additionalFiles?.length > 0) {
14
- const additionalEnvFiles = await Promise.all(options.additionalFiles.map(async (additionalEnvFile) => loadEnvFile(additionalEnvFile, cwd)));
20
+ const additionalEnvFiles = await Promise.all(options.additionalFiles.map(__assignType(async (additionalEnvFile) => loadEnvFile(additionalEnvFile, cwd), [
21
+ "additionalEnvFile",
22
+ "",
23
+ "P\"2!\"/\""
24
+ ])));
15
25
  for (const additionalEnvFile of additionalEnvFiles) env = defu(additionalEnvFile, env);
16
26
  }
17
27
  return removeEnvPrefix(env);
18
28
  }
29
+ loadEnvFiles.__type = [
30
+ () => __ΩEnvPluginOptions,
31
+ "options",
32
+ "mode",
33
+ "cwd",
34
+ "loadEnvFiles",
35
+ "Pn!2\"&2#&2$\"`/%"
36
+ ];
19
37
  async function loadEnvDirectory(options, directory, mode, cacheDir, packageJson, workspaceConfig) {
20
- const [envResult, c12Result] = await Promise.all([loadEnvFiles(options, mode, directory), loadConfig({
38
+ const [envResult, c12Result] = await Promise.all([(loadEnvFiles.Ω = [["!"]], loadEnvFiles(options, mode, directory)), loadConfig({
21
39
  cwd: directory,
22
40
  name: "storm",
23
41
  envName: mode,
@@ -36,6 +54,18 @@ async function loadEnvDirectory(options, directory, mode, cacheDir, packageJson,
36
54
  })]);
37
55
  return defu(envResult, c12Result.config, workspaceConfig);
38
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
+ ];
39
69
  /**
40
70
  * Retrieves various dotenv configuration parameters from the context.
41
71
  *
@@ -63,19 +93,40 @@ function loadEnvFromContext(context, parsed) {
63
93
  DEBUG: context.config.mode === "development",
64
94
  STACKTRACE: context.config.mode !== "production",
65
95
  ENVIRONMENT: !context.environment.name || context.environment.name === DEFAULT_ENVIRONMENT ? context.config.mode : context.environment.name
66
- }, isSetObject(context?.env?.types?.env) ? context.env.types.env?.getProperties().reduce((ret, prop) => {
96
+ }, isSetObject(context?.env?.types?.env) ? context.env.types.env?.getProperties().reduce(__assignType((ret, prop) => {
67
97
  ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();
68
98
  return ret;
69
- }, {}) : {});
99
+ }, [
100
+ "ret",
101
+ "prop",
102
+ "",
103
+ "P\"2!\"2\"\"/#"
104
+ ]), {}) : {});
70
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
+ ];
71
114
  async function loadEnv(context, options) {
72
115
  const [project, workspace, config] = await Promise.all([
73
- loadEnvDirectory(options, context.config.root, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig),
74
- loadEnvDirectory(options, context.workspaceConfig.workspaceRoot, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig),
75
- loadEnvDirectory(options, context.envPaths.config, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)
116
+ (loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.config.root, 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))
76
119
  ]);
77
120
  return defu(loadEnvFromContext(context, process.env), project, workspace, config);
78
121
  }
122
+ loadEnv.__type = [
123
+ () => __ΩEnvPluginContext,
124
+ "context",
125
+ () => __ΩEnvPluginOptions,
126
+ "options",
127
+ "loadEnv",
128
+ "Pn!2\"n#2$\"`/%"
129
+ ];
79
130
 
80
131
  //#endregion
81
132
  export { loadEnv, loadEnvFromContext };
@@ -1 +1 @@
1
- {"version":3,"file":"load.mjs","names":["loadEnvBase","loadEnvFileBase"],"sources":["../../src/helpers/load.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n loadEnv as loadEnvBase,\n loadEnvFile as loadEnvFileBase\n} from \"@stryke/env/load-env\";\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { PackageJson } from \"@stryke/types/package-json\";\nimport { loadConfig } from \"c12\";\nimport defu from \"defu\";\nimport { WorkspaceConfig } from \"powerlines\";\nimport { DEFAULT_ENVIRONMENT } from \"powerlines/utils\";\nimport { EnvPluginContext, EnvPluginOptions } from \"../types/plugin\";\nimport { removeEnvPrefix } from \"./source-file-env\";\n\nasync function loadEnvFiles<TEnv extends DotenvParseOutput = DotenvParseOutput>(\n options: EnvPluginOptions,\n mode: string,\n cwd: string\n): Promise<TEnv> {\n let env = await loadEnvBase(cwd, mode);\n if (options.additionalFiles && options.additionalFiles?.length > 0) {\n const additionalEnvFiles = await Promise.all(\n options.additionalFiles.map(async additionalEnvFile =>\n loadEnvFileBase(additionalEnvFile, cwd)\n )\n );\n\n for (const additionalEnvFile of additionalEnvFiles) {\n env = defu(additionalEnvFile, env);\n }\n }\n\n return removeEnvPrefix(env) as TEnv;\n}\n\nasync function loadEnvDirectory<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(\n options: EnvPluginOptions,\n directory: string,\n mode: string,\n cacheDir: string,\n packageJson: PackageJson,\n workspaceConfig: WorkspaceConfig\n): Promise<TEnv> {\n const [envResult, c12Result] = await Promise.all([\n loadEnvFiles<TEnv>(options, mode, directory),\n loadConfig({\n cwd: directory,\n name: \"storm\",\n envName: mode,\n defaults: {\n NAME: packageJson.name?.replace(`@${workspaceConfig.namespace}/`, \"\"),\n MODE: mode,\n ORG: workspaceConfig.organization\n },\n globalRc: true,\n packageJson: true,\n dotenv: true,\n jitiOptions: {\n fsCache: joinPaths(cacheDir, \"jiti\"),\n moduleCache: true\n }\n })\n ]);\n\n return defu(envResult as any, c12Result.config, workspaceConfig) as TEnv;\n}\n\n/**\n * Retrieves various dotenv configuration parameters from the context.\n *\n * @param context - The context to retrieve the dotenv configuration from.\n * @param parsed - The parsed dotenv configuration.\n * @returns An object containing the dotenv configuration.\n */\nexport function loadEnvFromContext(\n context: EnvPluginContext,\n parsed: DotenvParseOutput\n) {\n return defu(\n {\n APP_NAME: kebabCase(\n context.config.name ||\n context.packageJson.name?.replace(\n `/${context.workspaceConfig.namespace}`,\n \"\"\n )\n ),\n APP_VERSION: context.packageJson.version,\n BUILD_ID: context.meta.buildId,\n BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),\n BUILD_CHECKSUM: context.meta.checksum,\n RELEASE_ID: context.meta.releaseId,\n RELEASE_TAG: `${kebabCase(context.config.name)}@${context.packageJson.version}`,\n DEFAULT_LOCALE: context.workspaceConfig.locale,\n DEFAULT_TIMEZONE: context.workspaceConfig.timezone,\n LOG_LEVEL:\n context.config.logLevel === \"trace\" ? \"debug\" : context.config.logLevel,\n ERROR_URL: context.workspaceConfig.error?.url,\n ORGANIZATION:\n context.config.organization ||\n (isSetObject(context.workspaceConfig.organization)\n ? context.workspaceConfig.organization.name\n : context.workspaceConfig.organization),\n PLATFORM: context.config.platform,\n MODE: context.config.mode,\n TEST: context.config.mode === \"test\",\n DEBUG: context.config.mode === \"development\",\n STACKTRACE: context.config.mode !== \"production\",\n ENVIRONMENT:\n !context.environment.name ||\n context.environment.name === DEFAULT_ENVIRONMENT\n ? context.config.mode\n : context.environment.name\n },\n isSetObject(context?.env?.types?.env)\n ? context.env.types.env?.getProperties().reduce(\n (ret, prop) => {\n ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();\n return ret;\n },\n {} as Record<string, any>\n )\n : {}\n );\n}\n\nexport async function loadEnv<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv> {\n const [project, workspace, config] = await Promise.all([\n loadEnvDirectory<TEnv>(\n options,\n context.config.root,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n options,\n context.workspaceConfig.workspaceRoot,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n options,\n context.envPaths.config,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n )\n ]);\n\n return defu(\n loadEnvFromContext(context, process.env),\n project,\n workspace,\n config\n ) as TEnv;\n}\n"],"mappings":";;;;;;;;;;AAkCA,eAAe,aACb,SACA,MACA,KACe;CACf,IAAI,MAAM,MAAMA,UAAY,KAAK,KAAK;AACtC,KAAI,QAAQ,mBAAmB,QAAQ,iBAAiB,SAAS,GAAG;EAClE,MAAM,qBAAqB,MAAM,QAAQ,IACvC,QAAQ,gBAAgB,IAAI,OAAM,sBAChCC,YAAgB,mBAAmB,IAAI,CACxC,CACF;AAED,OAAK,MAAM,qBAAqB,mBAC9B,OAAM,KAAK,mBAAmB,IAAI;;AAItC,QAAO,gBAAgB,IAAI;;AAG7B,eAAe,iBAGb,SACA,WACA,MACA,UACA,aACA,iBACe;CACf,MAAM,CAAC,WAAW,aAAa,MAAM,QAAQ,IAAI,CAC/C,aAAmB,SAAS,MAAM,UAAU,EAC5C,WAAW;EACT,KAAK;EACL,MAAM;EACN,SAAS;EACT,UAAU;GACR,MAAM,YAAY,MAAM,QAAQ,IAAI,gBAAgB,UAAU,IAAI,GAAG;GACrE,MAAM;GACN,KAAK,gBAAgB;GACtB;EACD,UAAU;EACV,aAAa;EACb,QAAQ;EACR,aAAa;GACX,SAAS,UAAU,UAAU,OAAO;GACpC,aAAa;GACd;EACF,CAAC,CACH,CAAC;AAEF,QAAO,KAAK,WAAkB,UAAU,QAAQ,gBAAgB;;;;;;;;;AAUlE,SAAgB,mBACd,SACA,QACA;AACA,QAAO,KACL;EACE,UAAU,UACR,QAAQ,OAAO,QACb,QAAQ,YAAY,MAAM,QACxB,IAAI,QAAQ,gBAAgB,aAC5B,GACD,CACJ;EACD,aAAa,QAAQ,YAAY;EACjC,UAAU,QAAQ,KAAK;EACvB,iBAAiB,IAAI,KAAK,QAAQ,KAAK,UAAU,CAAC,aAAa;EAC/D,gBAAgB,QAAQ,KAAK;EAC7B,YAAY,QAAQ,KAAK;EACzB,aAAa,GAAG,UAAU,QAAQ,OAAO,KAAK,CAAC,GAAG,QAAQ,YAAY;EACtE,gBAAgB,QAAQ,gBAAgB;EACxC,kBAAkB,QAAQ,gBAAgB;EAC1C,WACE,QAAQ,OAAO,aAAa,UAAU,UAAU,QAAQ,OAAO;EACjE,WAAW,QAAQ,gBAAgB,OAAO;EAC1C,cACE,QAAQ,OAAO,iBACd,YAAY,QAAQ,gBAAgB,aAAa,GAC9C,QAAQ,gBAAgB,aAAa,OACrC,QAAQ,gBAAgB;EAC9B,UAAU,QAAQ,OAAO;EACzB,MAAM,QAAQ,OAAO;EACrB,MAAM,QAAQ,OAAO,SAAS;EAC9B,OAAO,QAAQ,OAAO,SAAS;EAC/B,YAAY,QAAQ,OAAO,SAAS;EACpC,aACE,CAAC,QAAQ,YAAY,QACrB,QAAQ,YAAY,SAAS,sBACzB,QAAQ,OAAO,OACf,QAAQ,YAAY;EAC3B,EACD,YAAY,SAAS,KAAK,OAAO,IAAI,GACjC,QAAQ,IAAI,MAAM,KAAK,eAAe,CAAC,QACpC,KAAK,SAAS;AACb,MAAI,KAAK,QAAQ,OAAO,KAAK,SAAS,KAAK,iBAAiB;AAC5D,SAAO;IAET,EAAE,CACH,GACD,EAAE,CACP;;AAGH,eAAsB,QAEpB,SAA2B,SAA0C;CACrE,MAAM,CAAC,SAAS,WAAW,UAAU,MAAM,QAAQ,IAAI;EACrD,iBACE,SACA,QAAQ,OAAO,MACf,QAAQ,OAAO,MACf,QAAQ,WACR,QAAQ,aACR,QAAQ,gBACT;EACD,iBACE,SACA,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,QAAQ,WACR,QAAQ,aACR,QAAQ,gBACT;EACD,iBACE,SACA,QAAQ,SAAS,QACjB,QAAQ,OAAO,MACf,QAAQ,WACR,QAAQ,aACR,QAAQ,gBACT;EACF,CAAC;AAEF,QAAO,KACL,mBAAmB,SAAS,QAAQ,IAAI,EACxC,SACA,WACA,OACD"}
1
+ {"version":3,"file":"load.mjs","names":[],"sources":["../../src/helpers/load.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n loadEnv as loadEnvBase,\n loadEnvFile as loadEnvFileBase\n} from \"@stryke/env/load-env\";\nimport type { DotenvParseOutput } from \"@stryke/env/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { PackageJson } from \"@stryke/types/package-json\";\nimport { loadConfig } from \"c12\";\nimport defu from \"defu\";\nimport { WorkspaceConfig } from \"powerlines\";\nimport { DEFAULT_ENVIRONMENT } from \"powerlines/constants\";\nimport { EnvPluginContext, EnvPluginOptions } from \"../types/plugin\";\nimport { removeEnvPrefix } from \"./source-file-env\";\n\nasync function loadEnvFiles<TEnv extends DotenvParseOutput = DotenvParseOutput>(\n options: EnvPluginOptions,\n mode: string,\n cwd: string\n): Promise<TEnv> {\n let env = await loadEnvBase(cwd, mode);\n if (options.additionalFiles && options.additionalFiles?.length > 0) {\n const additionalEnvFiles = await Promise.all(\n options.additionalFiles.map(async additionalEnvFile =>\n loadEnvFileBase(additionalEnvFile, cwd)\n )\n );\n\n for (const additionalEnvFile of additionalEnvFiles) {\n env = defu(additionalEnvFile, env);\n }\n }\n\n return removeEnvPrefix(env) as TEnv;\n}\n\nasync function loadEnvDirectory<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(\n options: EnvPluginOptions,\n directory: string,\n mode: string,\n cacheDir: string,\n packageJson: PackageJson,\n workspaceConfig: WorkspaceConfig\n): Promise<TEnv> {\n const [envResult, c12Result] = await Promise.all([\n loadEnvFiles<TEnv>(options, mode, directory),\n loadConfig({\n cwd: directory,\n name: \"storm\",\n envName: mode,\n defaults: {\n NAME: packageJson.name?.replace(`@${workspaceConfig.namespace}/`, \"\"),\n MODE: mode,\n ORG: workspaceConfig.organization\n },\n globalRc: true,\n packageJson: true,\n dotenv: true,\n jitiOptions: {\n fsCache: joinPaths(cacheDir, \"jiti\"),\n moduleCache: true\n }\n })\n ]);\n\n return defu(envResult as any, c12Result.config, workspaceConfig) as TEnv;\n}\n\n/**\n * Retrieves various dotenv configuration parameters from the context.\n *\n * @param context - The context to retrieve the dotenv configuration from.\n * @param parsed - The parsed dotenv configuration.\n * @returns An object containing the dotenv configuration.\n */\nexport function loadEnvFromContext(\n context: EnvPluginContext,\n parsed: DotenvParseOutput\n) {\n return defu(\n {\n APP_NAME: kebabCase(\n context.config.name ||\n context.packageJson.name?.replace(\n `/${context.workspaceConfig.namespace}`,\n \"\"\n )\n ),\n APP_VERSION: context.packageJson.version,\n BUILD_ID: context.meta.buildId,\n BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),\n BUILD_CHECKSUM: context.meta.checksum,\n RELEASE_ID: context.meta.releaseId,\n RELEASE_TAG: `${kebabCase(context.config.name)}@${context.packageJson.version}`,\n DEFAULT_LOCALE: context.workspaceConfig.locale,\n DEFAULT_TIMEZONE: context.workspaceConfig.timezone,\n LOG_LEVEL:\n context.config.logLevel === \"trace\" ? \"debug\" : context.config.logLevel,\n ERROR_URL: context.workspaceConfig.error?.url,\n ORGANIZATION:\n context.config.organization ||\n (isSetObject(context.workspaceConfig.organization)\n ? context.workspaceConfig.organization.name\n : context.workspaceConfig.organization),\n PLATFORM: context.config.platform,\n MODE: context.config.mode,\n TEST: context.config.mode === \"test\",\n DEBUG: context.config.mode === \"development\",\n STACKTRACE: context.config.mode !== \"production\",\n ENVIRONMENT:\n !context.environment.name ||\n context.environment.name === DEFAULT_ENVIRONMENT\n ? context.config.mode\n : context.environment.name\n },\n isSetObject(context?.env?.types?.env)\n ? context.env.types.env?.getProperties().reduce(\n (ret, prop) => {\n ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();\n return ret;\n },\n {} as Record<string, any>\n )\n : {}\n );\n}\n\nexport async function loadEnv<\n TEnv extends DotenvParseOutput = DotenvParseOutput\n>(context: EnvPluginContext, options: EnvPluginOptions): Promise<TEnv> {\n const [project, workspace, config] = await Promise.all([\n loadEnvDirectory<TEnv>(\n options,\n context.config.root,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n options,\n context.workspaceConfig.workspaceRoot,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n ),\n loadEnvDirectory<TEnv>(\n options,\n context.envPaths.config,\n context.config.mode,\n context.cachePath,\n context.packageJson,\n context.workspaceConfig\n )\n ]);\n\n return defu(\n loadEnvFromContext(context, process.env),\n project,\n workspace,\n config\n ) as TEnv;\n}\n"],"mappings":"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"}
@@ -1,10 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_types_plugin = require('../types/plugin.cjs');
3
4
  const require_helpers_reflect = require('./reflect.cjs');
5
+ let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
6
+ let powerlines = require("powerlines");
4
7
  let _powerlines_deepkit_capnp = require("@powerlines/deepkit/capnp");
5
8
  let _powerlines_deepkit_resolve_reflections = require("@powerlines/deepkit/resolve-reflections");
6
9
  let _powerlines_deepkit_schemas_reflection = require("@powerlines/deepkit/schemas/reflection");
7
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
8
10
  let _stryke_capnp = require("@stryke/capnp");
9
11
  _stryke_capnp = require_runtime.__toESM(_stryke_capnp);
10
12
  let _stryke_fs_buffer = require("@stryke/fs/buffer");
@@ -24,6 +26,14 @@ async function resolveRuntimeTypeFile(context) {
24
26
  if (!resolved) throw new Error(`Failed to resolve the runtime type definition file for the environment variables. Please ensure that the "@powerlines/plugin-env" package is installed.`);
25
27
  return resolved;
26
28
  }
29
+ resolveRuntimeTypeFile.__type = [
30
+ () => powerlines.__ΩUnresolvedContext,
31
+ () => require_types_plugin.__ΩEnvPluginResolvedConfig,
32
+ "context",
33
+ "resolveRuntimeTypeFile",
34
+ "Resolves the runtime type definition file for the environment variables.",
35
+ "Pn\"o!\"2#&`/$?%"
36
+ ];
27
37
  /**
28
38
  * Gets the default type definition for the environment variables.
29
39
  *
@@ -36,6 +46,14 @@ async function getEnvDefaultTypeDefinition(context) {
36
46
  name: "EnvInterface"
37
47
  };
38
48
  }
49
+ getEnvDefaultTypeDefinition.__type = [
50
+ () => powerlines.__ΩUnresolvedContext,
51
+ () => require_types_plugin.__ΩEnvPluginResolvedConfig,
52
+ "context",
53
+ "getEnvDefaultTypeDefinition",
54
+ "Gets the default type definition for the environment variables.",
55
+ "Pn\"o!\"2#!`/$?%"
56
+ ];
39
57
  /** Gets the default type definition for the environment secrets.
40
58
  *
41
59
  * @param context - The plugin context.
@@ -47,6 +65,13 @@ async function getSecretsDefaultTypeDefinition(context) {
47
65
  name: "SecretsInterface"
48
66
  };
49
67
  }
68
+ getSecretsDefaultTypeDefinition.__type = [
69
+ () => powerlines.__ΩUnresolvedContext,
70
+ () => require_types_plugin.__ΩEnvPluginResolvedConfig,
71
+ "context",
72
+ "getSecretsDefaultTypeDefinition",
73
+ "Pn\"o!\"2#!`/$"
74
+ ];
50
75
  /**
51
76
  * Gets the path to the environment type reflections.
52
77
  *
@@ -57,6 +82,17 @@ async function getSecretsDefaultTypeDefinition(context) {
57
82
  function getEnvTypeReflectionsPath(context, name = "env") {
58
83
  return (0, _stryke_path_join_paths.joinPaths)((0, _powerlines_deepkit_resolve_reflections.getReflectionsPath)(context), "env", `${name}-types.bin`);
59
84
  }
85
+ getEnvTypeReflectionsPath.__type = [
86
+ () => powerlines.__ΩContext,
87
+ () => require_types_plugin.__ΩEnvPluginResolvedConfig,
88
+ "context",
89
+ () => require_types_plugin.__ΩEnvType,
90
+ "name",
91
+ () => "env",
92
+ "getEnvTypeReflectionsPath",
93
+ "Gets the path to the environment type reflections.",
94
+ "Pn\"o!\"2#n$2%>&&/'?("
95
+ ];
60
96
  /**
61
97
  * Reads the environment type reflection from the file system.
62
98
  *
@@ -85,6 +121,17 @@ async function readEnvTypeReflection(context, name = "env") {
85
121
  context.env.types[name].dataBuffer = buffer;
86
122
  return reflection;
87
123
  }
124
+ readEnvTypeReflection.__type = [
125
+ () => require_types_plugin.__ΩEnvPluginContext,
126
+ "context",
127
+ () => require_types_plugin.__ΩEnvType,
128
+ "name",
129
+ () => "env",
130
+ () => _powerlines_deepkit_vendor_type.ReflectionClass,
131
+ "readEnvTypeReflection",
132
+ "Reads the environment type reflection from the file system.",
133
+ "Pn!2\"n#2$>%P\"7&`/'?("
134
+ ];
88
135
  /**
89
136
  * Writes the environment type reflection to the file system.
90
137
  *
@@ -98,9 +145,29 @@ async function writeEnvTypeReflection(context, reflection, name = "env") {
98
145
  (0, _powerlines_deepkit_capnp.convertToCapnp)(serialized, message.initRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes)._initTypes(serialized.length));
99
146
  await (0, _stryke_fs_buffer.writeFileBuffer)(getEnvTypeReflectionsPath(context, name), message.toArrayBuffer());
100
147
  }
148
+ writeEnvTypeReflection.__type = [
149
+ () => require_types_plugin.__ΩEnvPluginContext,
150
+ "context",
151
+ () => _powerlines_deepkit_vendor_type.ReflectionClass,
152
+ "reflection",
153
+ () => require_types_plugin.__ΩEnvType,
154
+ "name",
155
+ () => "env",
156
+ "writeEnvTypeReflection",
157
+ "Writes the environment type reflection to the file system.",
158
+ "Pn!2\"P\"7#2$n%2&>'\"/(?)"
159
+ ];
101
160
  function getEnvReflectionsPath(context, name) {
102
161
  return (0, _stryke_path_join_paths.joinPaths)((0, _powerlines_deepkit_resolve_reflections.getReflectionsPath)(context), "env", `${name}.bin`);
103
162
  }
163
+ getEnvReflectionsPath.__type = [
164
+ () => require_types_plugin.__ΩEnvPluginContext,
165
+ "context",
166
+ () => require_types_plugin.__ΩEnvType,
167
+ "name",
168
+ "getEnvReflectionsPath",
169
+ "Pn!2\"n#2$&/%"
170
+ ];
104
171
  /**
105
172
  * Reads the environment reflection data from the file system.
106
173
  *
@@ -138,6 +205,14 @@ async function readEnvReflection(context) {
138
205
  context.env.used.env.dataBuffer = buffer;
139
206
  return reflection;
140
207
  }
208
+ readEnvReflection.__type = [
209
+ () => require_types_plugin.__ΩEnvPluginContext,
210
+ "context",
211
+ () => _powerlines_deepkit_vendor_type.ReflectionClass,
212
+ "readEnvReflection",
213
+ "Reads the environment reflection data from the file system.",
214
+ "Pn!2\"P\"7#`/$?%"
215
+ ];
141
216
  /**
142
217
  * Reads the secret environment reflection data from the file system.
143
218
  *
@@ -175,6 +250,14 @@ async function readSecretsReflection(context) {
175
250
  context.env.used.secrets.dataBuffer = buffer;
176
251
  return reflection;
177
252
  }
253
+ readSecretsReflection.__type = [
254
+ () => require_types_plugin.__ΩEnvPluginContext,
255
+ "context",
256
+ () => _powerlines_deepkit_vendor_type.ReflectionClass,
257
+ "readSecretsReflection",
258
+ "Reads the secret environment reflection data from the file system.",
259
+ "Pn!2\"P\"7#`/$?%"
260
+ ];
178
261
  /**
179
262
  * Writes the environment reflection data to the file system.
180
263
  *
@@ -188,6 +271,18 @@ async function writeEnvReflection(context, reflection, name = "env") {
188
271
  (0, _powerlines_deepkit_capnp.convertToCapnp)(serialized, message.initRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes)._initTypes(serialized.length));
189
272
  await (0, _stryke_fs_buffer.writeFileBuffer)(getEnvReflectionsPath(context, name), message.toArrayBuffer());
190
273
  }
274
+ writeEnvReflection.__type = [
275
+ () => require_types_plugin.__ΩEnvPluginContext,
276
+ "context",
277
+ () => _powerlines_deepkit_vendor_type.ReflectionClass,
278
+ "reflection",
279
+ () => require_types_plugin.__ΩEnvType,
280
+ "name",
281
+ () => "env",
282
+ "writeEnvReflection",
283
+ "Writes the environment reflection data to the file system.",
284
+ "Pn!2\"P\"7#2$n%2&>'\"/(?)"
285
+ ];
191
286
  /**
192
287
  * Writes the environment reflection data to the file system.
193
288
  *
@@ -201,6 +296,18 @@ function writeEnvReflectionSync(context, reflection, name = "env") {
201
296
  (0, _powerlines_deepkit_capnp.convertToCapnp)(serialized, message.initRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes)._initTypes(serialized.length));
202
297
  (0, _stryke_fs_buffer.writeFileBufferSync)(getEnvReflectionsPath(context, name), message.toArrayBuffer());
203
298
  }
299
+ writeEnvReflectionSync.__type = [
300
+ () => require_types_plugin.__ΩEnvPluginContext,
301
+ "context",
302
+ () => _powerlines_deepkit_vendor_type.ReflectionClass,
303
+ "reflection",
304
+ () => require_types_plugin.__ΩEnvType,
305
+ "name",
306
+ () => "env",
307
+ "writeEnvReflectionSync",
308
+ "Writes the environment reflection data to the file system.",
309
+ "Pn!2\"P\"7#2$n%2&>'\"/(?)"
310
+ ];
204
311
 
205
312
  //#endregion
206
313
  exports.getEnvDefaultTypeDefinition = getEnvDefaultTypeDefinition;