@powerlines/plugin-env 0.16.291 → 0.16.292

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 (147) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +14 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  3. package/dist/babel/plugin.cjs +11 -3
  4. package/dist/babel/plugin.mjs +5 -3
  5. package/dist/babel/plugin.mjs.map +1 -1
  6. package/dist/babel/plugin.test.cjs +16 -0
  7. package/dist/babel/plugin.test.d.cts +1 -0
  8. package/dist/babel/plugin.test.d.mts +1 -0
  9. package/dist/babel/plugin.test.mjs +18 -0
  10. package/dist/babel/plugin.test.mjs.map +1 -0
  11. package/dist/components/docs.cjs +14 -3
  12. package/dist/components/docs.mjs +8 -3
  13. package/dist/components/docs.mjs.map +1 -1
  14. package/dist/components/docs.test.cjs +16 -0
  15. package/dist/components/docs.test.d.cts +1 -0
  16. package/dist/components/docs.test.d.mts +1 -0
  17. package/dist/components/docs.test.mjs +18 -0
  18. package/dist/components/docs.test.mjs.map +1 -0
  19. package/dist/components/env-builtin.cjs +15 -3
  20. package/dist/components/env-builtin.d.cts.map +1 -1
  21. package/dist/components/env-builtin.d.mts.map +1 -1
  22. package/dist/components/env-builtin.mjs +9 -3
  23. package/dist/components/env-builtin.mjs.map +1 -1
  24. package/dist/components/env-builtin.test.cjs +16 -0
  25. package/dist/components/env-builtin.test.d.cts +1 -0
  26. package/dist/components/env-builtin.test.d.mts +1 -0
  27. package/dist/components/env-builtin.test.mjs +18 -0
  28. package/dist/components/env-builtin.test.mjs.map +1 -0
  29. package/dist/helpers/automd-generator.cjs +9 -1
  30. package/dist/helpers/automd-generator.mjs +4 -2
  31. package/dist/helpers/automd-generator.mjs.map +1 -1
  32. package/dist/helpers/automd-generator.test.cjs +16 -0
  33. package/dist/helpers/automd-generator.test.d.cts +1 -0
  34. package/dist/helpers/automd-generator.test.d.mts +1 -0
  35. package/dist/helpers/automd-generator.test.mjs +18 -0
  36. package/dist/helpers/automd-generator.test.mjs.map +1 -0
  37. package/dist/helpers/index.cjs +1 -1
  38. package/dist/helpers/index.mjs +1 -1
  39. package/dist/helpers/load.cjs +13 -3
  40. package/dist/helpers/load.d.cts.map +1 -1
  41. package/dist/helpers/load.d.mts.map +1 -1
  42. package/dist/helpers/load.mjs +7 -2
  43. package/dist/helpers/load.mjs.map +1 -1
  44. package/dist/helpers/load.test.cjs +16 -0
  45. package/dist/helpers/load.test.d.cts +1 -0
  46. package/dist/helpers/load.test.d.mts +1 -0
  47. package/dist/helpers/load.test.mjs +18 -0
  48. package/dist/helpers/load.test.mjs.map +1 -0
  49. package/dist/helpers/schema.cjs +18 -2
  50. package/dist/helpers/schema.d.cts.map +1 -1
  51. package/dist/helpers/schema.d.mts.map +1 -1
  52. package/dist/helpers/schema.mjs +13 -3
  53. package/dist/helpers/schema.mjs.map +1 -1
  54. package/dist/helpers/schema.test.cjs +16 -0
  55. package/dist/helpers/schema.test.d.cts +1 -0
  56. package/dist/helpers/schema.test.d.mts +1 -0
  57. package/dist/helpers/schema.test.mjs +18 -0
  58. package/dist/helpers/schema.test.mjs.map +1 -0
  59. package/dist/helpers/source-file-env.cjs +12 -1
  60. package/dist/helpers/source-file-env.d.cts.map +1 -1
  61. package/dist/helpers/source-file-env.d.mts.map +1 -1
  62. package/dist/helpers/source-file-env.mjs +6 -1
  63. package/dist/helpers/source-file-env.mjs.map +1 -1
  64. package/dist/helpers/source-file-env.test.cjs +16 -0
  65. package/dist/helpers/source-file-env.test.d.cts +1 -0
  66. package/dist/helpers/source-file-env.test.d.mts +1 -0
  67. package/dist/helpers/source-file-env.test.mjs +18 -0
  68. package/dist/helpers/source-file-env.test.mjs.map +1 -0
  69. package/dist/index.cjs +9 -9
  70. package/dist/index.mjs +8 -8
  71. package/dist/index.test.cjs +30 -0
  72. package/dist/index.test.d.cts +1 -0
  73. package/dist/index.test.d.mts +1 -0
  74. package/dist/index.test.mjs +32 -0
  75. package/dist/index.test.mjs.map +1 -0
  76. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +78 -0
  77. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +78 -0
  78. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
  79. package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.cjs +1487 -0
  80. package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs +1473 -0
  81. package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs.map +1 -0
  82. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.cjs +889 -0
  83. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs +888 -0
  84. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs.map +1 -0
  85. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs +1614 -0
  86. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs +1594 -0
  87. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +1 -0
  88. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.cjs +1 -0
  89. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.mjs +3 -0
  90. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.cjs +1 -0
  91. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.mjs +3 -0
  92. package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.cjs +923 -0
  93. package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs +922 -0
  94. package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs.map +1 -0
  95. package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.cjs +391 -0
  96. package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs +386 -0
  97. package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs.map +1 -0
  98. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.cjs +82 -0
  99. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +82 -0
  100. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +1 -0
  101. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.cjs +1358 -0
  102. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs +1357 -0
  103. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs.map +1 -0
  104. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.cjs +561 -0
  105. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs +559 -0
  106. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs.map +1 -0
  107. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.cjs +37 -0
  108. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs +38 -0
  109. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs.map +1 -0
  110. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.cjs +197 -0
  111. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs +181 -0
  112. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs.map +1 -0
  113. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.cjs +29 -0
  114. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs +27 -0
  115. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs.map +1 -0
  116. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.cjs +77 -0
  117. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs +77 -0
  118. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs.map +1 -0
  119. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.cjs +374 -0
  120. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs +374 -0
  121. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs.map +1 -0
  122. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.cjs +38 -0
  123. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs +37 -0
  124. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs.map +1 -0
  125. package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.cjs +2978 -0
  126. package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs +2973 -0
  127. package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs.map +1 -0
  128. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +939 -0
  129. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +940 -0
  130. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
  131. package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.cjs +87 -0
  132. package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs +87 -0
  133. package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs.map +1 -0
  134. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.cjs +6 -0
  135. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +6 -0
  136. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +1 -0
  137. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.cjs +54 -0
  138. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +52 -0
  139. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +1 -0
  140. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs +2696 -0
  141. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +2697 -0
  142. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +1 -0
  143. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.cjs +47 -0
  144. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +45 -0
  145. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +1 -0
  146. package/dist/types/plugin.d.mts +1 -1
  147. package/package.json +145 -20
@@ -5,6 +5,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) {
11
+ __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ }
16
+ if (!no_symbols) {
17
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
18
+ }
19
+ return target;
20
+ };
8
21
  var __copyProps = (to, from, except, desc) => {
9
22
  if (from && typeof from === "object" || typeof from === "function") {
10
23
  for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
@@ -26,4 +39,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
39
 
27
40
  //#endregion
28
41
 
42
+ exports.__exportAll = __exportAll;
29
43
  exports.__toESM = __toESM;
@@ -0,0 +1,18 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) {
6
+ __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ }
11
+ if (!no_symbols) {
12
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ }
14
+ return target;
15
+ };
16
+
17
+ //#endregion
18
+ export { __exportAll };
@@ -1,12 +1,14 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_types_plugin = require('../types/plugin.cjs');
3
- let _powerlines_schema = require("@powerlines/schema");
4
- let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
5
4
  let _powerlines_plugin_babel_helpers_create_plugin = require("@powerlines/plugin-babel/helpers/create-plugin");
6
5
  let _powerlines_plugin_babel_helpers_module_helpers = require("@powerlines/plugin-babel/helpers/module-helpers");
6
+ let _powerlines_schema = require("@powerlines/schema");
7
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
7
8
  let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
8
9
 
9
10
  //#region src/babel/plugin.ts
11
+ var plugin_exports = /* @__PURE__ */ require_runtime.__exportAll({ envBabelPlugin: () => envBabelPlugin });
10
12
  function __assignType(fn, args) {
11
13
  fn.__type = args;
12
14
  return fn;
@@ -85,4 +87,10 @@ const envBabelPlugin = (_powerlines_plugin_babel_helpers_create_plugin.createBab
85
87
  ])));
86
88
 
87
89
  //#endregion
88
- exports.envBabelPlugin = envBabelPlugin;
90
+ exports.envBabelPlugin = envBabelPlugin;
91
+ Object.defineProperty(exports, 'plugin_exports', {
92
+ enumerable: true,
93
+ get: function () {
94
+ return plugin_exports;
95
+ }
96
+ });
@@ -1,11 +1,13 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
1
2
  import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
- import { getProperties, stringifyValue } from "@powerlines/schema";
3
- import { isSetObject } from "@stryke/type-checks/is-set-object";
4
3
  import { createBabelPlugin } from "@powerlines/plugin-babel/helpers/create-plugin";
5
4
  import { addImport } from "@powerlines/plugin-babel/helpers/module-helpers";
5
+ import { getProperties, stringifyValue } from "@powerlines/schema";
6
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
6
7
  import { isUndefined } from "@stryke/type-checks/is-undefined";
7
8
 
8
9
  //#region src/babel/plugin.ts
10
+ var plugin_exports = /* @__PURE__ */ __exportAll({ envBabelPlugin: () => envBabelPlugin });
9
11
  function __assignType(fn, args) {
10
12
  fn.__type = args;
11
13
  return fn;
@@ -84,5 +86,5 @@ const envBabelPlugin = (createBabelPlugin.Ω = [[() => __ΩEnvPluginContext, "n!
84
86
  ])));
85
87
 
86
88
  //#endregion
87
- export { envBabelPlugin };
89
+ export { envBabelPlugin, plugin_exports };
88
90
  //# sourceMappingURL=plugin.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/babel/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { NodePath } from \"@babel/core\";\nimport * as t from \"@babel/types\";\nimport { createBabelPlugin } from \"@powerlines/plugin-babel/helpers/create-plugin\";\nimport { addImport } from \"@powerlines/plugin-babel/helpers/module-helpers\";\nimport { BabelPluginPass } from \"@powerlines/plugin-babel/types/config\";\nimport {\n getProperties,\n JsonSchemaProperty,\n stringifyValue\n} from \"@powerlines/schema\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/*\n * The Powerlines - Environment Configuration Babel Plugin\n *\n * @param babel - The Babel core module\n * @returns The Babel plugin object\n */\nexport const envBabelPlugin = createBabelPlugin<EnvPluginContext>(\n \"env\",\n ({ logger, context }) => {\n const config = getProperties(context.env.config);\n function extractEnv(\n node: t.Identifier,\n pass: BabelPluginPass,\n isInjectable = false\n ) {\n if (node.name) {\n const name = node.name.replace(\n new RegExp(`^(${context.config.env.prefix.join(\"|\")})_`),\n \"\"\n );\n\n logger.trace({\n meta: {\n category: \"env\"\n },\n message: `Environment variable ${name} found in ${\n pass.filename || \"unknown file\"\n }.`\n });\n\n if (\n name in config &&\n isSetObject(config[name]) &&\n !config[name]?.isIgnored\n ) {\n config[name] ??= {} as JsonSchemaProperty<Record<string, any>>;\n\n logger.debug({\n meta: {\n category: \"env\"\n },\n message: `The \"${name}\" environment variable is used in the source code file \"${\n pass.filename || \"unknown file\"\n }\" and will be added to the environment schema's active variables list.`\n });\n\n context.env.config.active.push(name);\n if (\n !config[name].runtime &&\n ((context.config.env.inject && isInjectable) ||\n context.config.env.validate)\n ) {\n if (\n context.config.env.validate &&\n !config[name].required &&\n isUndefined(config[name].default)\n ) {\n throw new Error(\n `Environment variable \\`${\n name\n }\\` is missing a default value, but is active in the source code${\n pass.filename ? ` file \\`${pass.filename}\\`` : \"\"\n }.\\n\\nPlease add a default value to the schema, or if this variable is optional, please mark it as optional in the type definition.`\n );\n }\n\n return stringifyValue(config[name].default);\n }\n } else if (context.config.env.validate) {\n throw new Error(\n `Environment variable \\`${name}\\` is active in the source code${\n pass.filename ? ` file \\`${pass.filename}\\`` : \"\"\n }, but is not defined in the \\`config\\` schema. Please check the \\`env.config\\` configuration option. If you are using a custom env schema, please make sure that the configuration variable names match the ones used in the source code.`\n );\n } else {\n logger.warn({\n meta: {\n category: \"env\"\n },\n message: `Environment variable \\`${name}\\` is active in the source code${\n pass.filename ? ` file \\`${pass.filename}\\`` : \"\"\n }, but is not defined in the \\`config\\` schema. If this is intentional, you can ignore this warning. Otherwise, please check the \\`env.config\\` configuration option. If you are using a custom env schema, please make sure that the configuration variable names match the ones used in the source code.`\n });\n }\n }\n\n return undefined;\n }\n\n return {\n visitor: {\n MemberExpression(\n path: NodePath<t.MemberExpression>,\n pass: BabelPluginPass\n ) {\n if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path\n .get(\"object\")\n ?.get(\"object\")\n ?.isIdentifier({ name: \"process\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // process.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework?.name || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path.get(\"object\")?.get(\"object\")?.isMetaProperty() &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // import.meta.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework?.name || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path.get(\"object\")?.isIdentifier({ name: \"env\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false);\n }\n }\n }\n };\n }\n);\n"],"mappings":";;;;;;;;AAEA,SAAS,aAAY,IAAK,MAAC;;CAE1B,OAAK;AACN;4HAaA,QACA,cACM;CACN,MAAQ,SAAC,cAAmB,QAAW,IAAA,MAAO;CAC9C,SAAS,WAAA,MAAkB,MAAO,eAAW,OAAO;EACpD,IAAO,KAAA,MAAA;GACL,MAAA,OAAa,KAAA,KAAA,QAAA,IAAA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B;GAE1C,MAAM,aAAO,KAAA,IAAA,UAAA,GAAA;GACb,IAAE,CAAA,WAAM,MACN;GAEF,WAAW,YAAY,MAAG,KAAA;GAC1B,KAAI,wBAAyB,OAAK,WAAA,MAAA;GAClC,UAAS,MAAO;IACd,QAAA,GAAA,QAAA,OAAA,WAAA,QAAA,aAAA;;IAEF,UAAY;GACZ,CAAA;EACF,OAAK,IAAM,KAAK,IAAE,QAAS,GAAA,IAAA,UAAA,GAAA,aAAA,EACzB,MAAI,MACN,CAAC,KAAK,KAAA,IAAQ,QAAO,GAAI,IAAA,QAAQ,GAAA,eAAA,KAAA,KAAA,IAAA,UAAA,GAAA,aAAA,GAAA;GAE/B,MAAK,aAAA,KAAA,IAAA,UAAA,GAAA;GACL,IAAI,CAAA,WAAQ,MACV;GAEF,WAAI,YAAA,MAAA,KAAA;GACJ,KAAI,wBAAe,OAAA,WAAA,MAAA;GACnB,UAAO,MAAA;IACL,QAAM,GAAA,QAAA,OAAA,WAAA,QAAA,aAAA;IACN,MAAM;IACN,UAAU;GACZ,CAAC;EACH,OAAO,IAAA,KAAA,IAAA,QAAA,GAAA,aAAA,EACL,MAAE;GAGF,MAAA,aAAA,KAAA,IAAA,UAAA,GAAA;GACA,IAAI,CAAC,WAAW,MAChB;GAEA,WAAS,YAAa,MAAO,KAAE;EACjC;CACF,GAAG;EAAC;EAAC;EAAA;EAAA;EAAA;CAAA,CAAA,EACP,EACF;AACF,GAAG;CAAC;CAAQ;CAAM;AAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/babel/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { NodePath } from \"@babel/core\";\nimport * as t from \"@babel/types\";\nimport { createBabelPlugin } from \"@powerlines/plugin-babel/helpers/create-plugin\";\nimport { addImport } from \"@powerlines/plugin-babel/helpers/module-helpers\";\nimport { BabelPluginPass } from \"@powerlines/plugin-babel/types/config\";\nimport {\n getProperties,\n JsonSchemaProperty,\n stringifyValue\n} from \"@powerlines/schema\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\n/*\n * The Powerlines - Environment Configuration Babel Plugin\n *\n * @param babel - The Babel core module\n * @returns The Babel plugin object\n */\nexport const envBabelPlugin = createBabelPlugin<EnvPluginContext>(\n \"env\",\n ({ logger, context }) => {\n const config = getProperties(context.env.config);\n function extractEnv(\n node: t.Identifier,\n pass: BabelPluginPass,\n isInjectable = false\n ) {\n if (node.name) {\n const name = node.name.replace(\n new RegExp(`^(${context.config.env.prefix.join(\"|\")})_`),\n \"\"\n );\n\n logger.trace({\n meta: {\n category: \"env\"\n },\n message: `Environment variable ${name} found in ${\n pass.filename || \"unknown file\"\n }.`\n });\n\n if (\n name in config &&\n isSetObject(config[name]) &&\n !config[name]?.isIgnored\n ) {\n config[name] ??= {} as JsonSchemaProperty<Record<string, any>>;\n\n logger.debug({\n meta: {\n category: \"env\"\n },\n message: `The \"${name}\" environment variable is used in the source code file \"${\n pass.filename || \"unknown file\"\n }\" and will be added to the environment schema's active variables list.`\n });\n\n context.env.config.active.push(name);\n if (\n !config[name].runtime &&\n ((context.config.env.inject && isInjectable) ||\n context.config.env.validate)\n ) {\n if (\n context.config.env.validate &&\n !config[name].required &&\n isUndefined(config[name].default)\n ) {\n throw new Error(\n `Environment variable \\`${\n name\n }\\` is missing a default value, but is active in the source code${\n pass.filename ? ` file \\`${pass.filename}\\`` : \"\"\n }.\\n\\nPlease add a default value to the schema, or if this variable is optional, please mark it as optional in the type definition.`\n );\n }\n\n return stringifyValue(config[name].default);\n }\n } else if (context.config.env.validate) {\n throw new Error(\n `Environment variable \\`${name}\\` is active in the source code${\n pass.filename ? ` file \\`${pass.filename}\\`` : \"\"\n }, but is not defined in the \\`config\\` schema. Please check the \\`env.config\\` configuration option. If you are using a custom env schema, please make sure that the configuration variable names match the ones used in the source code.`\n );\n } else {\n logger.warn({\n meta: {\n category: \"env\"\n },\n message: `Environment variable \\`${name}\\` is active in the source code${\n pass.filename ? ` file \\`${pass.filename}\\`` : \"\"\n }, but is not defined in the \\`config\\` schema. If this is intentional, you can ignore this warning. Otherwise, please check the \\`env.config\\` configuration option. If you are using a custom env schema, please make sure that the configuration variable names match the ones used in the source code.`\n });\n }\n }\n\n return undefined;\n }\n\n return {\n visitor: {\n MemberExpression(\n path: NodePath<t.MemberExpression>,\n pass: BabelPluginPass\n ) {\n if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path\n .get(\"object\")\n ?.get(\"object\")\n ?.isIdentifier({ name: \"process\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // process.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework?.name || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path\n .get(\"object\")\n ?.get(\"property\")\n ?.isIdentifier({ name: \"env\" }) &&\n path.get(\"object\")?.get(\"object\")?.isMetaProperty() &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // import.meta.env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false);\n\n path.replaceWithSourceString(`env.${identifier.name}`);\n addImport(path, {\n module: `${context.config.framework?.name || \"powerlines\"}:env`,\n name: \"env\",\n imported: \"env\"\n });\n } else if (\n path.get(\"object\")?.isIdentifier({ name: \"env\" }) &&\n path.get(\"property\")?.isIdentifier()\n ) {\n // env.CONFIG_NAME\n\n const identifier = path.get(\"property\")?.node as t.Identifier;\n if (!identifier.name) {\n return;\n }\n\n extractEnv(identifier, pass, false);\n }\n }\n }\n };\n }\n);\n"],"mappings":";;;;;;;;;;AAEA,SAAS,aAAY,IAAK,MAAC;;CAE1B,OAAK;AACN;4HAaA,QACA,cACM;CACN,MAAQ,SAAC,cAAmB,QAAW,IAAA,MAAO;CAC9C,SAAS,WAAA,MAAkB,MAAO,eAAW,OAAO;EACpD,IAAO,KAAA,MAAA;GACL,MAAA,OAAa,KAAA,KAAA,QAAA,IAAA,OAAA,KAAA,QAAA,OAAA,IAAA,OAAA,KAAA,GAAA,EAAA,GAAA,GAAA,EAAA;GACb,OAAA,MAAA;IACA,MAAA,EACO,UAAW,MACZ;IACA,SAAC,wBAAgC,KAAC,YAAU,KAAU,YAAA,eAAA;GACxD,CAAC;;IAEN,OAAA,UAAA,CAAA;IACM,OAAA,MAAa;KACnB,MAAA,EACS,UAAY,MAClB;KACF,SAAA,QAAA,KAAA,0DAAA,KAAA,YAAA,eAAA;IACK,CAAA;IACA,QAAA,IAAA,OAAA,OAAA,KAAA,IAAA;IACF,IAAO,CAAC,OAAO,MAAM,YAAC,QAAA,OAAA,IAAA,UAAA,gBAAA,QAAA,OAAA,IAAA,WAAA;KACjB,IAAA,QAAS,OAAA,IAAc,YAAY,CAAA,OAAO,MAAA,YAAA,YAAA,OAAA,MAAA,OAAA,GACxC,MAAC,IAAA,MAAU,0BAAA,KAAA,iEAAA,KAAA,WAAA,WAAA,KAAA,SAAA,MAAA,GAAA,mIAAA;KAEb,OAAE,eAAe,OAAA,MAAA,OAAA;IACrB;GACA,OAAA,IAAA,QAAA,OAAA,IAAA,UACE,MAAM,IAAC,MAAM,0BAAA,K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,aAAA,KAAA,IAAA,UAAA,GAAA;GACA,IAAI,CAAC,WAAW,MAChB;GAEA,WAAS,YAAa,MAAO,KAAE;EACjC;CACF,GAAG;EAAC;EAAC;EAAA;EAAA;EAAA;CAAA,CAAA,EACP,EACF;AACF,GAAG;CAAC;CAAQ;CAAM;AAAA,CAAA,CAAA"}
@@ -0,0 +1,16 @@
1
+ const require_chunk_artifact = require('../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
2
+ const require_test_DNmyFkvJ = require('../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
3
+ const require_babel_plugin = require('./plugin.cjs');
4
+
5
+ //#region src/babel/plugin.test.ts
6
+ require_chunk_artifact.describe("plugins/plugin-env/src/babel/plugin.ts", () => {
7
+ require_chunk_artifact.it("loads module exports", () => {
8
+ require_test_DNmyFkvJ.globalExpect(require_babel_plugin.plugin_exports).toBeDefined();
9
+ require_test_DNmyFkvJ.globalExpect(typeof require_babel_plugin.plugin_exports).toBe("object");
10
+ });
11
+ require_chunk_artifact.it("has at least one runtime export", () => {
12
+ require_test_DNmyFkvJ.globalExpect(Object.keys(require_babel_plugin.plugin_exports).length).toBeGreaterThan(0);
13
+ });
14
+ });
15
+
16
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,18 @@
1
+ import { describe, it } from "../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs";
2
+ import { globalExpect } from "../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs";
3
+ import { plugin_exports } from "./plugin.mjs";
4
+
5
+ //#region src/babel/plugin.test.ts
6
+ describe("plugins/plugin-env/src/babel/plugin.ts", () => {
7
+ it("loads module exports", () => {
8
+ globalExpect(plugin_exports).toBeDefined();
9
+ globalExpect(typeof plugin_exports).toBe("object");
10
+ });
11
+ it("has at least one runtime export", () => {
12
+ globalExpect(Object.keys(plugin_exports).length).toBeGreaterThan(0);
13
+ });
14
+ });
15
+
16
+ //#endregion
17
+ export { };
18
+ //# sourceMappingURL=plugin.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.test.mjs","names":[],"sources":["../../src/babel/plugin.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./plugin\";\n\ndescribe(\"plugins/plugin-env/src/babel/plugin.ts\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;CAGA,GAAA,8BAAiC;EAC7B,aAAO,cAAQ,EAAO,YAAS;EAC/B,aAAO,OAAA,cAAe,EAAA,KAAY,QAAC;CACrC,CAAC;CACD,GAAE,yCAAA;;CAEF,CAAA;AACF,CAAC"}
@@ -1,9 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_types_plugin = require('../types/plugin.cjs');
3
- let _powerlines_schema = require("@powerlines/schema");
4
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
5
  let _stryke_path_join = require("@stryke/path/join");
5
6
  let powerlines_plugin_utils = require("powerlines/plugin-utils");
6
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let _powerlines_schema = require("@powerlines/schema");
7
8
  let _alloy_js_core = require("@alloy-js/core");
8
9
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
9
10
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
@@ -12,6 +13,10 @@ let _powerlines_plugin_alloy_markdown_components_markdown_file = require("@power
12
13
  let _powerlines_plugin_alloy_markdown_components_markdown_table = require("@powerlines/plugin-alloy/markdown/components/markdown-table");
13
14
 
14
15
  //#region src/components/docs.tsx
16
+ var docs_exports = /* @__PURE__ */ require_runtime.__exportAll({
17
+ EnvDocsFile: () => EnvDocsFile,
18
+ __ΩEnvDocsFileProps: () => __ΩEnvDocsFileProps
19
+ });
15
20
  const __ΩPartial = [
16
21
  "T",
17
22
  "Partial",
@@ -93,4 +98,10 @@ EnvDocsFile.__type = [
93
98
 
94
99
  //#endregion
95
100
  exports.EnvDocsFile = EnvDocsFile;
96
- exports.__ΩEnvDocsFileProps = __ΩEnvDocsFileProps;
101
+ exports.__ΩEnvDocsFileProps = __ΩEnvDocsFileProps;
102
+ Object.defineProperty(exports, 'docs_exports', {
103
+ enumerable: true,
104
+ get: function () {
105
+ return docs_exports;
106
+ }
107
+ });
@@ -1,8 +1,9 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
1
2
  import { __ΩEnvPluginContext } from "../types/plugin.mjs";
2
- import { getPropertiesList, stringifyType } from "@powerlines/schema";
3
+ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
3
4
  import { joinPaths } from "@stryke/path/join";
4
5
  import { getDocsOutputPath } from "powerlines/plugin-utils";
5
- import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
6
+ import { getPropertiesList, stringifyType } from "@powerlines/schema";
6
7
  import { code } from "@alloy-js/core";
7
8
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
8
9
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
@@ -11,6 +12,10 @@ import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markd
11
12
  import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
12
13
 
13
14
  //#region src/components/docs.tsx
15
+ var docs_exports = /* @__PURE__ */ __exportAll({
16
+ EnvDocsFile: () => EnvDocsFile,
17
+ __ΩEnvDocsFileProps: () => __ΩEnvDocsFileProps
18
+ });
14
19
  const __ΩPartial = [
15
20
  "T",
16
21
  "Partial",
@@ -91,5 +96,5 @@ EnvDocsFile.__type = [
91
96
  ];
92
97
 
93
98
  //#endregion
94
- export { EnvDocsFile, __ΩEnvDocsFileProps };
99
+ export { EnvDocsFile, __ΩEnvDocsFileProps, docs_exports };
95
100
  //# sourceMappingURL=docs.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs.mjs","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { Heading } from \"@powerlines/plugin-alloy/markdown/components/heading\";\nimport {\n MarkdownFile,\n MarkdownFileProps\n} from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { getPropertiesList, stringifyType } from \"@powerlines/schema\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { getDocsOutputPath } from \"powerlines/plugin-utils\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\nexport interface EnvDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n}\n\n/**\n * Generates the environment configuration markdown documentation for the Powerlines project.\n */\nexport function EnvDocsFile(props: EnvDocsFileProps) {\n const { levelOffset = 0, ...rest } = props;\n\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context.config.root), \"env.md\")}\n {...rest}>\n <Heading level={1 + levelOffset}>Environment</Heading>\n {code`The ${\n context.config.name\n } package uses various configuration parameters to control the behavior of the application. These parameters can be provided as environment variables when the application is run, or they can be defined in a \\`config.json\\` file in the application configuration directory.`}\n <Spacing />\n <Heading level={2 + levelOffset}>Configuration</Heading>\n <Spacing />\n {code`The below list of configuration parameters are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text locally.`}\n <Spacing />\n <MarkdownTable\n data={\n getPropertiesList(context.env.config)\n .filter(\n property =>\n getPropertiesList(context.env.config).some(\n p =>\n p.name === property.name &&\n context.env.config.active.includes(property.name)\n ) &&\n !property?.hidden &&\n !property?.ignore &&\n !property?.readOnly &&\n !property?.internal\n )\n .sort((a, b) =>\n !a?.name && !b?.name\n ? 0\n : !a?.name\n ? 1\n : !b?.name\n ? -1\n : a.name.localeCompare(b.name)\n )\n .map(property => {\n return {\n name: property.name?.trim(),\n description: (property.description ?? \"\").trim(),\n type: stringifyType(property)\n .trim()\n .replaceAll(/\\s*(?:\\||&)\\s*/g, \", or \"),\n defaultValue: property.default\n ? stringifyType(property.default)\n : \"\",\n required: property.required ? \"\" : \"✔\"\n };\n }) ?? []\n }\n />\n </MarkdownFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;CAC/B,GAAG,SAAU;CACb,OAAQ;AACT;AA2BA,MAAK,sBAAkB;OAAU;CAAa;CAAU;CAAA;C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AAI,cAAc,QAAA,EAAc,KAAA,EAAA,WAAiB,mBAAiB,OAAU;MAC1E,cAAE,SAAA,UAAA,cAAA,SAAA,OAAA,IAAA;MACT,UAAA,SAAA,WAAA,KAAA;KACK;IACF,GAAA;KAAA;KAAA;KAAkB;IAAW,CAAC,CAAA,KAAM,CAAA;GACtC,EACF,CAAC;EAAC;CACJ,EACF,CAAC,CAAC;AACJ;AACA,YAAY,SAAQ;OAAQ;CAAkB;CAAS;CAAa;CAAA;AAAA"}
1
+ {"version":3,"file":"docs.mjs","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { Heading } from \"@powerlines/plugin-alloy/markdown/components/heading\";\nimport {\n MarkdownFile,\n MarkdownFileProps\n} from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { getPropertiesList, stringifyType } from \"@powerlines/schema\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { getDocsOutputPath } from \"powerlines/plugin-utils\";\nimport { EnvPluginContext } from \"../types/plugin\";\n\nexport interface EnvDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n}\n\n/**\n * Generates the environment configuration markdown documentation for the Powerlines project.\n */\nexport function EnvDocsFile(props: EnvDocsFileProps) {\n const { levelOffset = 0, ...rest } = props;\n\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context.config.root), \"env.md\")}\n {...rest}>\n <Heading level={1 + levelOffset}>Environment</Heading>\n {code`The ${\n context.config.name\n } package uses various configuration parameters to control the behavior of the application. These parameters can be provided as environment variables when the application is run, or they can be defined in a \\`config.json\\` file in the application configuration directory.`}\n <Spacing />\n <Heading level={2 + levelOffset}>Configuration</Heading>\n <Spacing />\n {code`The below list of configuration parameters are **not** considered sensitive or confidential. Any values provided in these variables will be available in plain text locally.`}\n <Spacing />\n <MarkdownTable\n data={\n getPropertiesList(context.env.config)\n .filter(\n property =>\n getPropertiesList(context.env.config).some(\n p =>\n p.name === property.name &&\n context.env.config.active.includes(property.name)\n ) &&\n !property?.hidden &&\n !property?.ignore &&\n !property?.readOnly &&\n !property?.internal\n )\n .sort((a, b) =>\n !a?.name && !b?.name\n ? 0\n : !a?.name\n ? 1\n : !b?.name\n ? -1\n : a.name.localeCompare(b.name)\n )\n .map(property => {\n return {\n name: property.name?.trim(),\n description: (property.description ?? \"\").trim(),\n type: stringifyType(property)\n .trim()\n .replaceAll(/\\s*(?:\\||&)\\s*/g, \", or \"),\n defaultValue: property.default\n ? stringifyType(property.default)\n : \"\",\n required: property.required ? \"\" : \"✔\"\n };\n }) ?? []\n }\n />\n </MarkdownFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIA,SAAM,aAAS,IAAW,MAAM;CAC/B,GAAG,SAAU;CACb,OAAQ;AACT;AA2BA,MAAK,sBAAkB;OAAU;CAAa;CAAU;CAAA;CAAa;CAAA;AAAA;;;;AAKrE,SAAM,YAAa,OAAA;CACjB,MAAE,EACF,cAAc,GAChB,GAAA;CAEE,MAAA,WAAA,cAAA,IAAA,CAAA,O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AAA,WAAA,KAAA;KACK;IACF,GAAA;KAAA;KAAA;KAAkB;IAAW,CAAC,CAAA,KAAM,CAAA;GACtC,EACF,CAAC;EAAC;CACJ,EACF,CAAC,CAAC;AACJ;AACA,YAAY,SAAQ;OAAQ;CAAkB;CAAS;CAAa;CAAA;AAAA"}
@@ -0,0 +1,16 @@
1
+ const require_chunk_artifact = require('../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
2
+ const require_test_DNmyFkvJ = require('../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
3
+ const require_components_docs = require('./docs.cjs');
4
+
5
+ //#region src/components/docs.test.ts
6
+ require_chunk_artifact.describe("plugins/plugin-env/src/components/docs.tsx", () => {
7
+ require_chunk_artifact.it("loads module exports", () => {
8
+ require_test_DNmyFkvJ.globalExpect(require_components_docs.docs_exports).toBeDefined();
9
+ require_test_DNmyFkvJ.globalExpect(typeof require_components_docs.docs_exports).toBe("object");
10
+ });
11
+ require_chunk_artifact.it("has at least one runtime export", () => {
12
+ require_test_DNmyFkvJ.globalExpect(Object.keys(require_components_docs.docs_exports).length).toBeGreaterThan(0);
13
+ });
14
+ });
15
+
16
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,18 @@
1
+ import { describe, it } from "../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs";
2
+ import { globalExpect } from "../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs";
3
+ import { docs_exports } from "./docs.mjs";
4
+
5
+ //#region src/components/docs.test.ts
6
+ describe("plugins/plugin-env/src/components/docs.tsx", () => {
7
+ it("loads module exports", () => {
8
+ globalExpect(docs_exports).toBeDefined();
9
+ globalExpect(typeof docs_exports).toBe("object");
10
+ });
11
+ it("has at least one runtime export", () => {
12
+ globalExpect(Object.keys(docs_exports).length).toBeGreaterThan(0);
13
+ });
14
+ });
15
+
16
+ //#endregion
17
+ export { };
18
+ //# sourceMappingURL=docs.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.test.mjs","names":[],"sources":["../../src/components/docs.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./docs\";\n\ndescribe(\"plugins/plugin-env/src/components/docs.tsx\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;CAGA,GAAA,8BAAiC;EAC7B,aAAO,YAAQ,EAAO,YAAS;EAC/B,aAAO,OAAA,YAAe,EAAA,KAAY,QAAC;CACrC,CAAC;CACD,GAAE,yCAAA;;CAEF,CAAA;AACF,CAAC"}
@@ -1,7 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_helpers_load = require('../helpers/load.cjs');
3
- let _powerlines_schema = require("@powerlines/schema");
4
4
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
+ let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
6
+ let _powerlines_schema = require("@powerlines/schema");
5
7
  let _alloy_js_core = require("@alloy-js/core");
6
8
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
7
9
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
@@ -9,9 +11,13 @@ let _alloy_js_typescript = require("@alloy-js/typescript");
9
11
  let _powerlines_plugin_alloy_helpers_refkey = require("@powerlines/plugin-alloy/helpers/refkey");
10
12
  let _powerlines_plugin_alloy_typescript_components = require("@powerlines/plugin-alloy/typescript/components");
11
13
  let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
12
- let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
13
14
 
14
15
  //#region src/components/env-builtin.tsx
16
+ var env_builtin_exports = /* @__PURE__ */ require_runtime.__exportAll({
17
+ EnvBuiltin: () => EnvBuiltin,
18
+ EnvTypeDefinition: () => EnvTypeDefinition,
19
+ __ΩEnvBuiltinProps: () => __ΩEnvBuiltinProps
20
+ });
15
21
  const __ΩOmit = [
16
22
  "T",
17
23
  "K",
@@ -621,4 +627,10 @@ EnvBuiltin.__type = [
621
627
  //#endregion
622
628
  exports.EnvBuiltin = EnvBuiltin;
623
629
  exports.EnvTypeDefinition = EnvTypeDefinition;
624
- exports.__ΩEnvBuiltinProps = __ΩEnvBuiltinProps;
630
+ exports.__ΩEnvBuiltinProps = __ΩEnvBuiltinProps;
631
+ Object.defineProperty(exports, 'env_builtin_exports', {
632
+ enumerable: true,
633
+ get: function () {
634
+ return env_builtin_exports;
635
+ }
636
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"env-builtin.d.cts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;;;AA+DA;iBAAgB,iBAAA,CAAA,GAAiB,QAAA;AAAA,UAwLhB,eAAA,SAAwB,IAAA,CAAK,gBAAA;EAC5C,aAAA,GAAgB,QAAA;AAAA;AADlB;;;AAAA,iBAUgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA"}
1
+ {"version":3,"file":"env-builtin.d.cts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;;;AA+DA;iBAAgB,iBAAA,IAAiB,QAAA;AAAA,UAwLhB,eAAA,SAAwB,IAAA,CAAK,gBAAA;EAC5C,aAAA,GAAgB,QAAA;AAAA;AADlB;;;AAAA,iBAUgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"env-builtin.d.mts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;;;AA+DA;iBAAgB,iBAAA,CAAA,GAAiB,QAAA;AAAA,UAwLhB,eAAA,SAAwB,IAAA,CAAK,gBAAA;EAC5C,aAAA,GAAgB,QAAA;AAAA;AADlB;;;AAAA,iBAUgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA"}
1
+ {"version":3,"file":"env-builtin.d.mts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;;;AA+DA;iBAAgB,iBAAA,IAAiB,QAAA;AAAA,UAwLhB,eAAA,SAAwB,IAAA,CAAK,gBAAA;EAC5C,aAAA,GAAgB,QAAA;AAAA;AADlB;;;AAAA,iBAUgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,QAAA"}
@@ -1,6 +1,8 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
1
2
  import { loadEnvFromContext } from "../helpers/load.mjs";
2
- import { getPropertiesList } from "@powerlines/schema";
3
3
  import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
4
+ import { getUnique } from "@stryke/helpers/get-unique";
5
+ import { getPropertiesList } from "@powerlines/schema";
4
6
  import { For, Show, code, computed, splitProps } from "@alloy-js/core";
5
7
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
6
8
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
@@ -8,9 +10,13 @@ import { ElseIfClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, V
8
10
  import { refkey } from "@powerlines/plugin-alloy/helpers/refkey";
9
11
  import { BuiltinFile, InterfaceDeclaration as InterfaceDeclaration$1, InterfaceMember, ObjectDeclaration, TSDocSchemaProperty } from "@powerlines/plugin-alloy/typescript/components";
10
12
  import { TSDoc, TSDocParam, TSDocRemarks, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
11
- import { getUnique } from "@stryke/helpers/get-unique";
12
13
 
13
14
  //#region src/components/env-builtin.tsx
15
+ var env_builtin_exports = /* @__PURE__ */ __exportAll({
16
+ EnvBuiltin: () => EnvBuiltin,
17
+ EnvTypeDefinition: () => EnvTypeDefinition,
18
+ __ΩEnvBuiltinProps: () => __ΩEnvBuiltinProps
19
+ });
14
20
  const __ΩOmit = [
15
21
  "T",
16
22
  "K",
@@ -618,5 +624,5 @@ EnvBuiltin.__type = [
618
624
  ];
619
625
 
620
626
  //#endregion
621
- export { EnvBuiltin, EnvTypeDefinition, __ΩEnvBuiltinProps };
627
+ export { EnvBuiltin, EnvTypeDefinition, __ΩEnvBuiltinProps, env_builtin_exports };
622
628
  //# sourceMappingURL=env-builtin.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"env-builtin.mjs","names":[],"sources":["../../src/components/env-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n code,\n computed,\n For,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n InterfaceDeclaration as BaseInterfaceDeclaration,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { refkey } from \"@powerlines/plugin-alloy/helpers/refkey\";\nimport type { ComponentProps } from \"@powerlines/plugin-alloy/types/components\";\nimport {\n BuiltinFile,\n BuiltinFileProps,\n InterfaceDeclaration,\n InterfaceMember,\n ObjectDeclaration,\n TSDocSchemaProperty\n} from \"@powerlines/plugin-alloy/typescript/components\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport {\n getPropertiesList,\n GetPropertiesResult,\n JsonSchema\n} from \"@powerlines/schema\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { loadEnvFromContext } from \"../helpers/load\";\nimport type { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Generates the environment configuration typescript definition for the Powerlines project.\n */\nexport function EnvTypeDefinition() {\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n name=\"UnprefixedEnv\"\n schema={context.env.config.schema}\n export\n />\n <Spacing />\n <TSDoc heading=\"The environment configuration object with prefixed keys.\">\n <TSDocRemarks>\n {`The \\`Env\\` type extends the \\`UnprefixedEnv\\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.`}\n </TSDocRemarks>\n </TSDoc>\n <BaseInterfaceDeclaration name=\"Env\" export extends=\"UnprefixedEnv\">\n <For\n each={getUnique(context.config.env.prefix).map(prefix =>\n prefix.replace(/_$/, \"\")\n )}\n doubleHardline>\n {prefix => (\n <For\n each={\n getPropertiesList(context.env.config.schema).filter(\n property => !property.ignore\n ) ?? []\n }\n doubleHardline>\n {property => (\n <>\n <TSDocSchemaProperty\n schema={property}\n defaultValue={property?.default}\n />\n <InterfaceMember\n name={`${prefix}_${property.name}`}\n type={`UnprefixedEnv[\"${property.name}\"]`}\n schema={property}\n required={property.required}\n readOnly={property.readOnly}\n />\n </>\n )}\n </For>\n )}\n </For>\n </BaseInterfaceDeclaration>\n <Spacing />\n </>\n );\n}\n\ninterface ConfigPropertyConditionalProps extends ComponentProps {\n context: EnvPluginContext;\n name: string;\n}\n\nfunction ConfigPropertyConditional(props: ConfigPropertyConditionalProps) {\n const [{ context, name }] = splitProps(props, [\"context\", \"name\"]);\n\n return code`propertyName === \"${name}\" || propertyName.replace(/^(${getUnique(\n context.config.env.prefix\n .sort((a, b) =>\n a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b)\n )\n .map(prefix => `${prefix.replace(/_$/, \"\")}_`)\n ).join(\"|\")})/g, \"\").toLowerCase().replace(/[\\\\s\\\\-_]+/g, \"\") === \"${name\n .toLowerCase()\n .replace(/[\\s\\-_]+/g, \"\")}\"`;\n}\n\ninterface ConfigPropertyProps extends ComponentProps {\n index: number;\n context: EnvPluginContext;\n name: string;\n property: JsonSchema;\n}\n\nfunction ConfigPropertyGet(props: ConfigPropertyProps) {\n const [{ context, name, property, index }] = splitProps(props, [\n \"context\",\n \"name\",\n \"property\",\n \"index\"\n ]);\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show when={property?.alias && property?.alias.length > 0}>\n {code` || `}\n <For each={property?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${name}\"];`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show when={property?.alias && property?.alias.length > 0}>\n {code` || `}\n <For each={property?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${name}\"];`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nfunction ConfigPropertySet(props: ConfigPropertyProps) {\n const [{ context, name, property, index }] = splitProps(props, [\n \"context\",\n \"name\",\n \"property\",\n \"index\"\n ]);\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show when={property?.alias && property?.alias.length > 0}>\n {code` || `}\n <For each={property?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${name}\"] = newValue;\n return true;\n`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show when={property?.alias && property?.alias.length > 0}>\n {code` || `}\n <For each={property?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${name}\"] = newValue;\n return true;\n`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nexport interface EnvBuiltinProps extends Omit<BuiltinFileProps, \"id\"> {\n defaultConfig?: Children;\n}\n\nconst createEnvRefkey = refkey(\"createEnv\");\nconst envRefkey = refkey(\"env\");\n\n/**\n * Generates the environment configuration module for the Powerlines project.\n */\nexport function EnvBuiltin(props: EnvBuiltinProps) {\n const [{ defaultConfig, children }, rest] = splitProps(props, [\n \"defaultConfig\",\n \"children\"\n ]);\n\n const context = usePowerlines<EnvPluginContext>();\n const defaultValue = computed(\n () => context && loadEnvFromContext(context, process.env)\n );\n\n const schemaGetProperties = computed(\n () =>\n (getPropertiesList(context.env.config)\n .filter(property => !property?.ignore && !property?.writeOnly)\n .sort((a, b) =>\n !a?.name && !b?.name\n ? 0\n : !a?.name\n ? 1\n : !b?.name\n ? -1\n : a?.name.localeCompare(b?.name)\n ) ?? []) as GetPropertiesResult[]\n );\n const schemaSetProperties = computed(\n () =>\n (getPropertiesList(context.env.config)\n .filter(property => !property?.ignore && !property?.readOnly)\n .sort((a, b) =>\n !a?.name && !b?.name\n ? 0\n : !a?.name\n ? 1\n : !b?.name\n ? -1\n : a?.name.localeCompare(b?.name)\n ) ?? []) as GetPropertiesResult[]\n );\n\n return (\n <BuiltinFile\n id=\"env\"\n description=\"The environment configuration module provides an interface to define environment configuration parameters.\"\n {...rest}>\n <Show when={Boolean(context.env.config.schema)}>\n <EnvTypeDefinition defaultValue={defaultValue} />\n <Spacing />\n </Show>\n <ObjectDeclaration\n name=\"initialEnv\"\n type=\"Partial<Env>\"\n schema={context.env.config.schema}\n export\n const\n doc=\"The initial environment configuration object values for the runtime.\"\n />\n <Spacing />\n <TSDoc heading=\"Initializes the Powerlines environment configuration module.\">\n <TSDocRemarks>\n {`This function initializes the Powerlines environment configuration object.`}\n </TSDocRemarks>\n <TSDocParam name=\"environmentConfig\">\n {`The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`}\n </TSDocParam>\n <TSDocReturns>\n {`The initialized Powerlines configuration object.`}\n </TSDocReturns>\n </TSDoc>\n <Show when={Boolean(context?.entryPath)}>\n <FunctionDeclaration\n refkey={createEnvRefkey}\n async={false}\n export\n name=\"createEnv\"\n parameters={[\n {\n name: \"environmentConfig\",\n type: `Partial<Env>`,\n optional: false,\n default: \"{}\"\n }\n ]}\n returnType=\"Env\">\n {code`\n return new Proxy<Env>(\n deserializeEnv({\n ...initialEnv,\n ...environmentConfig\n } as Env),\n {\n get: (target: UnprefixedEnv, propertyName: string) => { `}\n <hbr />\n <For each={schemaGetProperties.value}>\n {(property: GetPropertiesResult, index: number) => (\n <ConfigPropertyGet\n index={index}\n context={context}\n name={property.name}\n property={property}\n />\n )}\n </For>\n {code`\n return undefined;\n }, `}\n\n <Spacing />\n {code` set: (target: UnprefixedEnv, propertyName: string, newValue: any) => { `}\n <hbr />\n <For each={schemaSetProperties.value} ender={code` else `}>\n {(property: GetPropertiesResult, index: number) => (\n <ConfigPropertySet\n index={index}\n context={context}\n name={property.name}\n property={property}\n />\n )}\n </For>\n\n <hbr />\n {code`return false;\n }\n }\n );\n`}\n </FunctionDeclaration>\n </Show>\n <Spacing />\n <TSDoc heading=\"The environment configuration object.\">\n <TSDocRemarks>\n {`This object provides access to the environment configuration parameters in the application runtime.`}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n refkey={envRefkey}\n name=\"env\"\n type=\"Env\"\n export\n const\n initializer={\n <>{code`createEnv(${defaultConfig || \"{}\"} as Partial<Env>);`}</>\n }\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isCI\"\n doc=\"Detect if the application is running in a continuous integration (CI) environment.\"\n initializer={code`Boolean(\n env.CI ||\n env.RUN_ID ||\n env.AGOLA_GIT_REF ||\n env.AC_APPCIRCLE ||\n env.APPVEYOR ||\n env.CODEBUILD ||\n env.TF_BUILD ||\n env.bamboo_planKey ||\n env.BITBUCKET_COMMIT ||\n env.BITRISE_IO ||\n env.BUDDY_WORKSPACE_ID ||\n env.BUILDKITE ||\n env.CIRCLECI ||\n env.CIRRUS_CI ||\n env.CF_BUILD_ID ||\n env.CM_BUILD_ID ||\n env.CI_NAME ||\n env.DRONE ||\n env.DSARI ||\n env.EARTHLY_CI ||\n env.EAS_BUILD ||\n env.GERRIT_PROJECT ||\n env.GITEA_ACTIONS ||\n env.GITHUB_ACTIONS ||\n env.GITLAB_CI ||\n env.GOCD ||\n env.BUILDER_OUTPUT ||\n env.HARNESS_BUILD_ID ||\n env.JENKINS_URL ||\n env.LAYERCI ||\n env.MAGNUM ||\n env.NETLIFY ||\n env.NEVERCODE ||\n env.PROW_JOB_ID ||\n env.RELEASE_BUILD_ID ||\n env.RENDER ||\n env.SAILCI ||\n env.HUDSON ||\n env.SCREWDRIVER ||\n env.SEMAPHORE ||\n env.SOURCEHUT ||\n env.STRIDER ||\n env.TASK_ID ||\n env.RUN_ID ||\n env.TEAMCITY_VERSION ||\n env.TRAVIS ||\n env.VELA ||\n env.NOW_BUILDER ||\n env.APPCENTER_BUILD_ID ||\n env.CI_XCODE_PROJECT ||\n env.XCS || false\n ); `}\n />\n <Spacing />\n\n <TSDoc heading=\"Detect the \\`mode\\` of the current runtime environment.\">\n <TSDocRemarks>\n {code`The \\`mode\\` is determined by the \\`MODE\\` environment variable, or falls back to the \\`NEXT_PUBLIC_VERCEL_ENV\\`, \\`NODE_ENV\\`, or defaults to \\`production\\`. While the value can potentially be any string, it is generally recommended to only allow a value in the following list:\n - \\`production\\`\n - \\`test\\`\n - \\`development\\`\n `}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n export\n const\n name=\"mode\"\n initializer={code`String(env.MODE) || \"production\"; `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isProduction\"\n doc='Detect if the application is running in `\"production\"` mode'\n initializer={code`[\"prd\", \"prod\", \"production\"].includes(mode.toLowerCase()); `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isTest\"\n doc='Detect if the application is running in `\"test\"` mode'\n initializer={code`[\"tst\", \"test\", \"testing\", \"stg\", \"stage\", \"staging\"].includes(mode.toLowerCase()) || env.TEST; `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isDevelopment\"\n doc='Detect if the application is running in `\"development\"` mode'\n initializer={code`[\"dev\", \"development\"].includes(mode.toLowerCase()); `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isDebug\"\n doc=\"Detect if the application is currently being debugged\"\n initializer={code`Boolean(isDevelopment && env.DEBUG); `}\n />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,UAAU;CAAC;CAAI;CAAM;CAAQ;AAAG;;;;;;;AAEtC,SAAM,aAAS,IAAW,MAAM;CAC/B,GAAG,SAAU;CACb,OAAQ;AACT;;;;AA+BA,SAAa,oBAAA;CACX,MAAA,WAAgB,cAAA,IAAA,CAAA,CAAA,oBAAA,MAAA,CAAA,GAAA,cAAA;CAChB,OAAA;EAAA,gBAAoB,wBAAA;GACpB,MAAA;GACA,IAAA,SAAA;IACA,OAAA,QAAA,IAAA,OAAA;GACA;GACF,UAAO;EACL,CAAA;EAAA,gBAAK,SA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B,CAAC;GAAG,gBAAe,SAAA,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACjB,UAAM;IACN,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAM,IAAA;GACR,CAAC;GAAG,gBAAY,SAAA,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACd,UAAU;IACV,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAa,IAAA;GACf,CAAC;GAAG,gBAAE,SAAA,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACL,UAAA;IACA,SAAS;;IAET,KAAM;IACL,aAAa,IAAA;GACf,CAAC;GAAG,gBAAkB,SAAI,CAAA,CAAA;GAAU,gBAAiB,MAAA;IACnD,IAAI,OAAE;KACJ,OAAI,QAAK,QAAA;IACX;IACG;GACL,CAAC;EAAC;CACJ,EACF,CAAC,CAAC;AACJ;AACA,WAAQ,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;AAAA"}
1
+ {"version":3,"file":"env-builtin.mjs","names":[],"sources":["../../src/components/env-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n code,\n computed,\n For,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n InterfaceDeclaration as BaseInterfaceDeclaration,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { refkey } from \"@powerlines/plugin-alloy/helpers/refkey\";\nimport type { ComponentProps } from \"@powerlines/plugin-alloy/types/components\";\nimport {\n BuiltinFile,\n BuiltinFileProps,\n InterfaceDeclaration,\n InterfaceMember,\n ObjectDeclaration,\n TSDocSchemaProperty\n} from \"@powerlines/plugin-alloy/typescript/components\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport {\n getPropertiesList,\n GetPropertiesResult,\n JsonSchema\n} from \"@powerlines/schema\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { loadEnvFromContext } from \"../helpers/load\";\nimport type { EnvPluginContext } from \"../types/plugin\";\n\n/**\n * Generates the environment configuration typescript definition for the Powerlines project.\n */\nexport function EnvTypeDefinition() {\n const context = usePowerlines<EnvPluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n name=\"UnprefixedEnv\"\n schema={context.env.config.schema}\n export\n />\n <Spacing />\n <TSDoc heading=\"The environment configuration object with prefixed keys.\">\n <TSDocRemarks>\n {`The \\`Env\\` type extends the \\`UnprefixedEnv\\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.`}\n </TSDocRemarks>\n </TSDoc>\n <BaseInterfaceDeclaration name=\"Env\" export extends=\"UnprefixedEnv\">\n <For\n each={getUnique(context.config.env.prefix).map(prefix =>\n prefix.replace(/_$/, \"\")\n )}\n doubleHardline>\n {prefix => (\n <For\n each={\n getPropertiesList(context.env.config.schema).filter(\n property => !property.ignore\n ) ?? []\n }\n doubleHardline>\n {property => (\n <>\n <TSDocSchemaProperty\n schema={property}\n defaultValue={property?.default}\n />\n <InterfaceMember\n name={`${prefix}_${property.name}`}\n type={`UnprefixedEnv[\"${property.name}\"]`}\n schema={property}\n required={property.required}\n readOnly={property.readOnly}\n />\n </>\n )}\n </For>\n )}\n </For>\n </BaseInterfaceDeclaration>\n <Spacing />\n </>\n );\n}\n\ninterface ConfigPropertyConditionalProps extends ComponentProps {\n context: EnvPluginContext;\n name: string;\n}\n\nfunction ConfigPropertyConditional(props: ConfigPropertyConditionalProps) {\n const [{ context, name }] = splitProps(props, [\"context\", \"name\"]);\n\n return code`propertyName === \"${name}\" || propertyName.replace(/^(${getUnique(\n context.config.env.prefix\n .sort((a, b) =>\n a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b)\n )\n .map(prefix => `${prefix.replace(/_$/, \"\")}_`)\n ).join(\"|\")})/g, \"\").toLowerCase().replace(/[\\\\s\\\\-_]+/g, \"\") === \"${name\n .toLowerCase()\n .replace(/[\\s\\-_]+/g, \"\")}\"`;\n}\n\ninterface ConfigPropertyProps extends ComponentProps {\n index: number;\n context: EnvPluginContext;\n name: string;\n property: JsonSchema;\n}\n\nfunction ConfigPropertyGet(props: ConfigPropertyProps) {\n const [{ context, name, property, index }] = splitProps(props, [\n \"context\",\n \"name\",\n \"property\",\n \"index\"\n ]);\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show when={property?.alias && property?.alias.length > 0}>\n {code` || `}\n <For each={property?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${name}\"];`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show when={property?.alias && property?.alias.length > 0}>\n {code` || `}\n <For each={property?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`return target[\"${name}\"];`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nfunction ConfigPropertySet(props: ConfigPropertyProps) {\n const [{ context, name, property, index }] = splitProps(props, [\n \"context\",\n \"name\",\n \"property\",\n \"index\"\n ]);\n\n return (\n <>\n {index === 0 ? (\n <IfStatement\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show when={property?.alias && property?.alias.length > 0}>\n {code` || `}\n <For each={property?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${name}\"] = newValue;\n return true;\n`}\n </IfStatement>\n ) : (\n <ElseIfClause\n condition={\n <>\n <ConfigPropertyConditional name={name} context={context} />\n <Show when={property?.alias && property?.alias.length > 0}>\n {code` || `}\n <For each={property?.alias ?? []} joiner={code` || `}>\n {alias => (\n <ConfigPropertyConditional name={alias} context={context} />\n )}\n </For>\n </Show>\n </>\n }>\n {code`\n target[\"${name}\"] = newValue;\n return true;\n`}\n </ElseIfClause>\n )}\n </>\n );\n}\n\nexport interface EnvBuiltinProps extends Omit<BuiltinFileProps, \"id\"> {\n defaultConfig?: Children;\n}\n\nconst createEnvRefkey = refkey(\"createEnv\");\nconst envRefkey = refkey(\"env\");\n\n/**\n * Generates the environment configuration module for the Powerlines project.\n */\nexport function EnvBuiltin(props: EnvBuiltinProps) {\n const [{ defaultConfig, children }, rest] = splitProps(props, [\n \"defaultConfig\",\n \"children\"\n ]);\n\n const context = usePowerlines<EnvPluginContext>();\n const defaultValue = computed(\n () => context && loadEnvFromContext(context, process.env)\n );\n\n const schemaGetProperties = computed(\n () =>\n (getPropertiesList(context.env.config)\n .filter(property => !property?.ignore && !property?.writeOnly)\n .sort((a, b) =>\n !a?.name && !b?.name\n ? 0\n : !a?.name\n ? 1\n : !b?.name\n ? -1\n : a?.name.localeCompare(b?.name)\n ) ?? []) as GetPropertiesResult[]\n );\n const schemaSetProperties = computed(\n () =>\n (getPropertiesList(context.env.config)\n .filter(property => !property?.ignore && !property?.readOnly)\n .sort((a, b) =>\n !a?.name && !b?.name\n ? 0\n : !a?.name\n ? 1\n : !b?.name\n ? -1\n : a?.name.localeCompare(b?.name)\n ) ?? []) as GetPropertiesResult[]\n );\n\n return (\n <BuiltinFile\n id=\"env\"\n description=\"The environment configuration module provides an interface to define environment configuration parameters.\"\n {...rest}>\n <Show when={Boolean(context.env.config.schema)}>\n <EnvTypeDefinition defaultValue={defaultValue} />\n <Spacing />\n </Show>\n <ObjectDeclaration\n name=\"initialEnv\"\n type=\"Partial<Env>\"\n schema={context.env.config.schema}\n export\n const\n doc=\"The initial environment configuration object values for the runtime.\"\n />\n <Spacing />\n <TSDoc heading=\"Initializes the Powerlines environment configuration module.\">\n <TSDocRemarks>\n {`This function initializes the Powerlines environment configuration object.`}\n </TSDocRemarks>\n <TSDocParam name=\"environmentConfig\">\n {`The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`}\n </TSDocParam>\n <TSDocReturns>\n {`The initialized Powerlines configuration object.`}\n </TSDocReturns>\n </TSDoc>\n <Show when={Boolean(context?.entryPath)}>\n <FunctionDeclaration\n refkey={createEnvRefkey}\n async={false}\n export\n name=\"createEnv\"\n parameters={[\n {\n name: \"environmentConfig\",\n type: `Partial<Env>`,\n optional: false,\n default: \"{}\"\n }\n ]}\n returnType=\"Env\">\n {code`\n return new Proxy<Env>(\n deserializeEnv({\n ...initialEnv,\n ...environmentConfig\n } as Env),\n {\n get: (target: UnprefixedEnv, propertyName: string) => { `}\n <hbr />\n <For each={schemaGetProperties.value}>\n {(property: GetPropertiesResult, index: number) => (\n <ConfigPropertyGet\n index={index}\n context={context}\n name={property.name}\n property={property}\n />\n )}\n </For>\n {code`\n return undefined;\n }, `}\n\n <Spacing />\n {code` set: (target: UnprefixedEnv, propertyName: string, newValue: any) => { `}\n <hbr />\n <For each={schemaSetProperties.value} ender={code` else `}>\n {(property: GetPropertiesResult, index: number) => (\n <ConfigPropertySet\n index={index}\n context={context}\n name={property.name}\n property={property}\n />\n )}\n </For>\n\n <hbr />\n {code`return false;\n }\n }\n );\n`}\n </FunctionDeclaration>\n </Show>\n <Spacing />\n <TSDoc heading=\"The environment configuration object.\">\n <TSDocRemarks>\n {`This object provides access to the environment configuration parameters in the application runtime.`}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n refkey={envRefkey}\n name=\"env\"\n type=\"Env\"\n export\n const\n initializer={\n <>{code`createEnv(${defaultConfig || \"{}\"} as Partial<Env>);`}</>\n }\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isCI\"\n doc=\"Detect if the application is running in a continuous integration (CI) environment.\"\n initializer={code`Boolean(\n env.CI ||\n env.RUN_ID ||\n env.AGOLA_GIT_REF ||\n env.AC_APPCIRCLE ||\n env.APPVEYOR ||\n env.CODEBUILD ||\n env.TF_BUILD ||\n env.bamboo_planKey ||\n env.BITBUCKET_COMMIT ||\n env.BITRISE_IO ||\n env.BUDDY_WORKSPACE_ID ||\n env.BUILDKITE ||\n env.CIRCLECI ||\n env.CIRRUS_CI ||\n env.CF_BUILD_ID ||\n env.CM_BUILD_ID ||\n env.CI_NAME ||\n env.DRONE ||\n env.DSARI ||\n env.EARTHLY_CI ||\n env.EAS_BUILD ||\n env.GERRIT_PROJECT ||\n env.GITEA_ACTIONS ||\n env.GITHUB_ACTIONS ||\n env.GITLAB_CI ||\n env.GOCD ||\n env.BUILDER_OUTPUT ||\n env.HARNESS_BUILD_ID ||\n env.JENKINS_URL ||\n env.LAYERCI ||\n env.MAGNUM ||\n env.NETLIFY ||\n env.NEVERCODE ||\n env.PROW_JOB_ID ||\n env.RELEASE_BUILD_ID ||\n env.RENDER ||\n env.SAILCI ||\n env.HUDSON ||\n env.SCREWDRIVER ||\n env.SEMAPHORE ||\n env.SOURCEHUT ||\n env.STRIDER ||\n env.TASK_ID ||\n env.RUN_ID ||\n env.TEAMCITY_VERSION ||\n env.TRAVIS ||\n env.VELA ||\n env.NOW_BUILDER ||\n env.APPCENTER_BUILD_ID ||\n env.CI_XCODE_PROJECT ||\n env.XCS || false\n ); `}\n />\n <Spacing />\n\n <TSDoc heading=\"Detect the \\`mode\\` of the current runtime environment.\">\n <TSDocRemarks>\n {code`The \\`mode\\` is determined by the \\`MODE\\` environment variable, or falls back to the \\`NEXT_PUBLIC_VERCEL_ENV\\`, \\`NODE_ENV\\`, or defaults to \\`production\\`. While the value can potentially be any string, it is generally recommended to only allow a value in the following list:\n - \\`production\\`\n - \\`test\\`\n - \\`development\\`\n `}\n </TSDocRemarks>\n </TSDoc>\n <VarDeclaration\n export\n const\n name=\"mode\"\n initializer={code`String(env.MODE) || \"production\"; `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isProduction\"\n doc='Detect if the application is running in `\"production\"` mode'\n initializer={code`[\"prd\", \"prod\", \"production\"].includes(mode.toLowerCase()); `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isTest\"\n doc='Detect if the application is running in `\"test\"` mode'\n initializer={code`[\"tst\", \"test\", \"testing\", \"stg\", \"stage\", \"staging\"].includes(mode.toLowerCase()) || env.TEST; `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isDevelopment\"\n doc='Detect if the application is running in `\"development\"` mode'\n initializer={code`[\"dev\", \"development\"].includes(mode.toLowerCase()); `}\n />\n <Spacing />\n\n <VarDeclaration\n export\n const\n name=\"isDebug\"\n doc=\"Detect if the application is currently being debugged\"\n initializer={code`Boolean(isDevelopment && env.DEBUG); `}\n />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,UAAU;CAAC;CAAI;CAAM;CAAQ;AAAG;;;;;;;AAEtC,SAAM,aAAS,IAAW,MAAM;CAC/B,GAAG,SAAU;CACb,OAAQ;AACT;;;;AA+BA,SAAa,oBAAA;CACX,MAAA,WAAgB,cAAA,IAAA,CAAA,CAAA,oBAAA,MAAA,CAAA,GAAA,cAAA;CAChB,OAAA;EAAA,gBAAoB,wBAAA;GACpB,MAAA;GACA,IAAA,SAAA;IACA,OAAA,QAAA,IAAA,OAAA;GACA;GACF,UAAO;EACL,CAAA;EAAA,gBAAK,SAAA,CAAA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GAAG,gBAAe,SAAA,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACjB,UAAM;IACN,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAM,IAAA;GACR,CAAC;GAAG,gBAAY,SAAA,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACd,UAAU;IACV,SAAM;IACN,MAAM;IACN,KAAK;IACL,aAAa,IAAA;GACf,CAAC;GAAG,gBAAE,SAAA,CAAA,CAAA;GAAA,gBAAA,gBAAA;IACL,UAAA;IACA,SAAS;;IAET,KAAM;IACL,aAAa,IAAA;GACf,CAAC;GAAG,gBAAkB,SAAI,CAAA,CAAA;GAAU,gBAAiB,MAAA;IACnD,IAAI,OAAE;KACJ,OAAI,QAAK,QAAA;IACX;IACG;GACL,CAAC;EAAC;CACJ,EACF,CAAC,CAAC;AACJ;AACA,WAAQ,SAAA;OAAA;CAAA;CAAA;CAAA;CAAA;AAAA"}
@@ -0,0 +1,16 @@
1
+ const require_chunk_artifact = require('../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
2
+ const require_test_DNmyFkvJ = require('../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
3
+ const require_components_env_builtin = require('./env-builtin.cjs');
4
+
5
+ //#region src/components/env-builtin.test.ts
6
+ require_chunk_artifact.describe("plugins/plugin-env/src/components/env-builtin.tsx", () => {
7
+ require_chunk_artifact.it("loads module exports", () => {
8
+ require_test_DNmyFkvJ.globalExpect(require_components_env_builtin.env_builtin_exports).toBeDefined();
9
+ require_test_DNmyFkvJ.globalExpect(typeof require_components_env_builtin.env_builtin_exports).toBe("object");
10
+ });
11
+ require_chunk_artifact.it("has at least one runtime export", () => {
12
+ require_test_DNmyFkvJ.globalExpect(Object.keys(require_components_env_builtin.env_builtin_exports).length).toBeGreaterThan(0);
13
+ });
14
+ });
15
+
16
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,18 @@
1
+ import { describe, it } from "../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs";
2
+ import { globalExpect } from "../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs";
3
+ import { env_builtin_exports } from "./env-builtin.mjs";
4
+
5
+ //#region src/components/env-builtin.test.ts
6
+ describe("plugins/plugin-env/src/components/env-builtin.tsx", () => {
7
+ it("loads module exports", () => {
8
+ globalExpect(env_builtin_exports).toBeDefined();
9
+ globalExpect(typeof env_builtin_exports).toBe("object");
10
+ });
11
+ it("has at least one runtime export", () => {
12
+ globalExpect(Object.keys(env_builtin_exports).length).toBeGreaterThan(0);
13
+ });
14
+ });
15
+
16
+ //#endregion
17
+ export { };
18
+ //# sourceMappingURL=env-builtin.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-builtin.test.mjs","names":[],"sources":["../../src/components/env-builtin.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./env-builtin\";\n\ndescribe(\"plugins/plugin-env/src/components/env-builtin.tsx\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;CAGA,GAAA,8BAAiC;EAC7B,aAAO,mBAAQ,EAAO,YAAS;EAC/B,aAAO,OAAA,mBAAe,EAAA,KAAY,QAAC;CACrC,CAAC;CACD,GAAE,yCAAA;;CAEF,CAAA;AACF,CAAC"}