@powerlines/plugin-env 0.13.53 → 0.13.55

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 (199) hide show
  1. package/README.md +8 -2
  2. package/dist/babel/index.cjs +1 -1
  3. package/dist/babel/index.d.cts +17 -31
  4. package/dist/babel/index.d.mts +17 -0
  5. package/dist/babel/index.mjs +1 -0
  6. package/dist/babel/plugin.cjs +1 -19
  7. package/dist/babel/plugin.d.cts +17 -34
  8. package/dist/babel/plugin.d.mts +17 -0
  9. package/dist/babel/plugin.mjs +1 -0
  10. package/dist/babel-CE47sTzg.mjs +1 -0
  11. package/dist/chunk-CbqXBSoN.mjs +1 -0
  12. package/dist/chunk-DT2f8AgL.cjs +1 -0
  13. package/dist/components/docs.cjs +1 -0
  14. package/dist/components/docs.d.cts +2 -0
  15. package/dist/components/docs.d.mts +2 -0
  16. package/dist/components/docs.mjs +1 -0
  17. package/dist/components/env.cjs +1 -40
  18. package/dist/components/env.d.cts +4 -105
  19. package/dist/components/env.d.mts +4 -0
  20. package/dist/components/env.mjs +1 -0
  21. package/dist/components/index.cjs +1 -1
  22. package/dist/components/index.d.cts +6 -8
  23. package/dist/components/index.d.mts +6 -0
  24. package/dist/components/index.mjs +1 -0
  25. package/dist/components-LyHNrcZE.mjs +1 -0
  26. package/dist/config-BgxhYOhP.d.mts +1682 -0
  27. package/dist/config-BgxhYOhP.d.mts.map +1 -0
  28. package/dist/config-DO3dqNWo.d.cts +1680 -0
  29. package/dist/config-DO3dqNWo.d.cts.map +1 -0
  30. package/dist/create-reflection-resource-BQ5mItFl.d.mts +16 -0
  31. package/dist/create-reflection-resource-BQ5mItFl.d.mts.map +1 -0
  32. package/dist/create-reflection-resource-CQHJrkQi.cjs +1 -0
  33. package/dist/create-reflection-resource-Cwclmcyo.d.cts +16 -0
  34. package/dist/create-reflection-resource-Cwclmcyo.d.cts.map +1 -0
  35. package/dist/create-reflection-resource-UtOwX4Ml.mjs +2 -0
  36. package/dist/create-reflection-resource-UtOwX4Ml.mjs.map +1 -0
  37. package/dist/docs-BDiEhcDa.mjs +2 -0
  38. package/dist/docs-BDiEhcDa.mjs.map +1 -0
  39. package/dist/docs-Bhi9smBO.cjs +1 -0
  40. package/dist/docs-BoZkRBO4.d.cts +10 -0
  41. package/dist/docs-BoZkRBO4.d.cts.map +1 -0
  42. package/dist/docs-BwK6pC_c.d.mts +10 -0
  43. package/dist/docs-BwK6pC_c.d.mts.map +1 -0
  44. package/dist/env-0C9Vc_CF.cjs +34 -0
  45. package/dist/env-BpSAx122.d.mts +113 -0
  46. package/dist/env-BpSAx122.d.mts.map +1 -0
  47. package/dist/env-D4MK9BWK.mjs +32 -0
  48. package/dist/env-D4MK9BWK.mjs.map +1 -0
  49. package/dist/env-Mgv4u8VY.d.cts +113 -0
  50. package/dist/env-Mgv4u8VY.d.cts.map +1 -0
  51. package/dist/helpers/create-reflection-resource.cjs +1 -0
  52. package/dist/helpers/create-reflection-resource.d.cts +6 -0
  53. package/dist/helpers/create-reflection-resource.d.mts +6 -0
  54. package/dist/helpers/create-reflection-resource.mjs +1 -0
  55. package/dist/helpers/index.cjs +1 -1
  56. package/dist/helpers/index.d.cts +12 -35
  57. package/dist/helpers/index.d.mts +12 -0
  58. package/dist/helpers/index.mjs +1 -0
  59. package/dist/helpers/load.cjs +1 -7
  60. package/dist/helpers/load.d.cts +6 -60
  61. package/dist/helpers/load.d.mts +6 -0
  62. package/dist/helpers/load.mjs +1 -0
  63. package/dist/helpers/persistence.cjs +1 -7
  64. package/dist/helpers/persistence.d.cts +6 -108
  65. package/dist/helpers/persistence.d.mts +6 -0
  66. package/dist/helpers/persistence.mjs +1 -0
  67. package/dist/helpers/reflect.cjs +1 -7
  68. package/dist/helpers/reflect.d.cts +6 -72
  69. package/dist/helpers/reflect.d.mts +6 -0
  70. package/dist/helpers/reflect.mjs +1 -0
  71. package/dist/helpers/source-file-env.cjs +1 -7
  72. package/dist/helpers/source-file-env.d.cts +2 -7
  73. package/dist/helpers/source-file-env.d.mts +2 -0
  74. package/dist/helpers/source-file-env.mjs +1 -0
  75. package/dist/helpers/template-helpers.cjs +1 -7
  76. package/dist/helpers/template-helpers.d.cts +6 -41
  77. package/dist/helpers/template-helpers.d.mts +6 -0
  78. package/dist/helpers/template-helpers.mjs +1 -0
  79. package/dist/helpers-DfMThUgD.mjs +1 -0
  80. package/dist/helpers-YGhXHw5G.cjs +0 -0
  81. package/dist/index-BRBK9zG-.d.cts +1 -0
  82. package/dist/index-Bt4QNofW.d.mts +1 -0
  83. package/dist/index-CRo77wc3.d.mts +1 -0
  84. package/dist/index-CspKFJM1.d.cts +1 -0
  85. package/dist/index-DPDDjaRF.d.cts +42 -0
  86. package/dist/index-DPDDjaRF.d.cts.map +1 -0
  87. package/dist/index-DZnZEdDI.d.mts +42 -0
  88. package/dist/index-DZnZEdDI.d.mts.map +1 -0
  89. package/dist/index-Dpmi5zcN.d.cts +1 -0
  90. package/dist/index-Wc1llEvP.d.mts +1 -0
  91. package/dist/index.cjs +5 -10
  92. package/dist/index.d.cts +17 -71
  93. package/dist/index.d.mts +17 -0
  94. package/dist/index.mjs +18 -0
  95. package/dist/index.mjs.map +1 -0
  96. package/dist/load-BZTlThWg.mjs +2 -0
  97. package/dist/load-BZTlThWg.mjs.map +1 -0
  98. package/dist/load-C4lA54bJ.d.mts +39 -0
  99. package/dist/load-C4lA54bJ.d.mts.map +1 -0
  100. package/dist/load-CN-Mm8-g.d.cts +36 -0
  101. package/dist/load-CN-Mm8-g.d.cts.map +1 -0
  102. package/dist/load-nUlit5lR.cjs +1 -0
  103. package/dist/persistence-Br-YMVb1.mjs +15 -0
  104. package/dist/persistence-Br-YMVb1.mjs.map +1 -0
  105. package/dist/{helpers/persistence.d.ts → persistence-CeAmYbDK.d.cts} +15 -38
  106. package/dist/persistence-CeAmYbDK.d.cts.map +1 -0
  107. package/dist/persistence-DSKai3M7.d.mts +85 -0
  108. package/dist/persistence-DSKai3M7.d.mts.map +1 -0
  109. package/dist/persistence-KaP3-ka1.cjs +14 -0
  110. package/dist/plugin-CRYQ682C.cjs +0 -0
  111. package/dist/plugin-CYiqhftf.d.cts +1716 -0
  112. package/dist/plugin-CYiqhftf.d.cts.map +1 -0
  113. package/dist/plugin-CdupbOcS.d.mts +1716 -0
  114. package/dist/plugin-CdupbOcS.d.mts.map +1 -0
  115. package/dist/plugin-Cx61c9gw.mjs +6 -0
  116. package/dist/plugin-Cx61c9gw.mjs.map +1 -0
  117. package/dist/plugin-DrnPbdzR.mjs +1 -0
  118. package/dist/plugin-v-FJGggy.cjs +5 -0
  119. package/dist/reflect-biXSZqcW.d.mts +47 -0
  120. package/dist/reflect-biXSZqcW.d.mts.map +1 -0
  121. package/dist/reflect-gaw4hJ9H.d.cts +47 -0
  122. package/dist/reflect-gaw4hJ9H.d.cts.map +1 -0
  123. package/dist/runtime-BWa_ko5I.d.mts +795 -0
  124. package/dist/runtime-BWa_ko5I.d.mts.map +1 -0
  125. package/dist/runtime-BYdaCpVq.d.cts +795 -0
  126. package/dist/runtime-BYdaCpVq.d.cts.map +1 -0
  127. package/dist/runtime-BaZivi6m.cjs +0 -0
  128. package/dist/runtime-DqCYc37d.mjs +1 -0
  129. package/dist/source-file-CLCTB4C7.cjs +1 -0
  130. package/dist/source-file-CjFSCK1w.mjs +2 -0
  131. package/dist/source-file-CjFSCK1w.mjs.map +1 -0
  132. package/dist/source-file-env-BDFTs5WJ.mjs +2 -0
  133. package/dist/source-file-env-BDFTs5WJ.mjs.map +1 -0
  134. package/dist/source-file-env-C6uYyxww.cjs +1 -0
  135. package/dist/{helpers/source-file-env.d.ts → source-file-env-DonDJDV1.d.cts} +5 -3
  136. package/dist/source-file-env-DonDJDV1.d.cts.map +1 -0
  137. package/dist/source-file-env-DzpWKluw.d.mts +9 -0
  138. package/dist/source-file-env-DzpWKluw.d.mts.map +1 -0
  139. package/dist/template-helpers-BSbamu0U.cjs +1 -0
  140. package/dist/template-helpers-BaMJZc5X.d.cts +16 -0
  141. package/dist/template-helpers-BaMJZc5X.d.cts.map +1 -0
  142. package/dist/template-helpers-CLrM_TtO.mjs +2 -0
  143. package/dist/template-helpers-CLrM_TtO.mjs.map +1 -0
  144. package/dist/template-helpers-LJwCi0e-.d.mts +16 -0
  145. package/dist/template-helpers-LJwCi0e-.d.mts.map +1 -0
  146. package/dist/type-CnPIyotQ.d.mts +4 -0
  147. package/dist/type-CnPIyotQ.d.mts.map +1 -0
  148. package/dist/type-D6dRgWJT.d.cts +4 -0
  149. package/dist/type-D6dRgWJT.d.cts.map +1 -0
  150. package/dist/types/index.cjs +1 -1
  151. package/dist/types/index.d.cts +6 -30
  152. package/dist/types/index.d.mts +6 -0
  153. package/dist/types/index.mjs +1 -0
  154. package/dist/types/plugin.cjs +1 -1
  155. package/dist/types/plugin.d.cts +5 -1733
  156. package/dist/types/plugin.d.mts +5 -0
  157. package/dist/types/plugin.mjs +1 -0
  158. package/dist/types/runtime.cjs +1 -1
  159. package/dist/types/runtime.d.cts +3 -25
  160. package/dist/types/runtime.d.mts +3 -0
  161. package/dist/types/runtime.mjs +1 -0
  162. package/dist/types-BCto_Rzj.mjs +1 -0
  163. package/dist/types-DS7T32tb.cjs +0 -0
  164. package/dist/utilities-4S--uN0L.mjs +2 -0
  165. package/dist/utilities-4S--uN0L.mjs.map +1 -0
  166. package/dist/utilities-CxyT2chk.cjs +1 -0
  167. package/package.json +67 -56
  168. package/dist/babel/index.d.ts +0 -31
  169. package/dist/babel/index.js +0 -1
  170. package/dist/babel/plugin.d.ts +0 -34
  171. package/dist/babel/plugin.js +0 -19
  172. package/dist/chunk-FBBMZ4NC.cjs +0 -7
  173. package/dist/chunk-UCUR73HG.js +0 -7
  174. package/dist/components/env.d.ts +0 -105
  175. package/dist/components/env.js +0 -40
  176. package/dist/components/index.d.ts +0 -8
  177. package/dist/components/index.js +0 -1
  178. package/dist/fs-ECFlqnPg.d.cts +0 -378
  179. package/dist/fs-ECFlqnPg.d.ts +0 -378
  180. package/dist/helpers/index.d.ts +0 -35
  181. package/dist/helpers/index.js +0 -1
  182. package/dist/helpers/load.d.ts +0 -60
  183. package/dist/helpers/load.js +0 -7
  184. package/dist/helpers/persistence.js +0 -7
  185. package/dist/helpers/reflect.d.ts +0 -72
  186. package/dist/helpers/reflect.js +0 -7
  187. package/dist/helpers/source-file-env.js +0 -7
  188. package/dist/helpers/template-helpers.d.ts +0 -41
  189. package/dist/helpers/template-helpers.js +0 -7
  190. package/dist/index.d.ts +0 -71
  191. package/dist/index.js +0 -22
  192. package/dist/runtime-B75FziIk.d.ts +0 -2011
  193. package/dist/runtime-DqYFxAEo.d.cts +0 -2011
  194. package/dist/types/index.d.ts +0 -30
  195. package/dist/types/index.js +0 -1
  196. package/dist/types/plugin.d.ts +0 -1733
  197. package/dist/types/runtime.d.ts +0 -25
  198. /package/dist/{types/plugin.js → babel-Bmzkjy1p.cjs} +0 -0
  199. /package/dist/{types/runtime.js → components-BWruXLSx.cjs} +0 -0
@@ -0,0 +1,5 @@
1
+ import "../type-CnPIyotQ.mjs";
2
+ import { a as EnvType, c as __ΩEnvPluginResolvedConfig, i as EnvPluginUserConfig, l as __ΩEnvPluginUserConfig, n as EnvPluginOptions, o as __ΩEnvPluginContext, r as EnvPluginResolvedConfig, s as __ΩEnvPluginOptions, t as EnvPluginContext, u as __ΩEnvType } from "../plugin-CdupbOcS.mjs";
3
+ import "../config-BgxhYOhP.mjs";
4
+ import "../runtime-BWa_ko5I.mjs";
5
+ export { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig, EnvType, __ΩEnvPluginContext, __ΩEnvPluginOptions, __ΩEnvPluginResolvedConfig, __ΩEnvPluginUserConfig, __ΩEnvType };
@@ -0,0 +1 @@
1
+ import"../plugin-DrnPbdzR.mjs";export{};
@@ -1 +1 @@
1
- 'use strict';
1
+ require(`../runtime-BaZivi6m.cjs`);
@@ -1,25 +1,3 @@
1
- export { E as EnvInterface, S as SecretsInterface, _ as __ΩEnvInterface, c as __ΩSecretsInterface } from '../runtime-DqYFxAEo.cjs';
2
- import '@stryke/env/get-env-paths';
3
- import '@stryke/http/fetch';
4
- import '@stryke/types/base';
5
- import '@stryke/types/package-json';
6
- import 'jiti';
7
- import 'magic-string';
8
- import 'oxc-parser';
9
- import 'semver';
10
- import 'ts-morph';
11
- import 'undici';
12
- import 'unplugin';
13
- import '@babel/core';
14
- import '@storm-software/build-tools/types';
15
- import '@storm-software/config-tools/types';
16
- import '@storm-software/config/types';
17
- import '@stryke/types/configuration';
18
- import '@stryke/types/file';
19
- import 'vite';
20
- import '@babel/helper-plugin-utils';
21
- import '../fs-ECFlqnPg.cjs';
22
- import '@stryke/fs/resolve';
23
- import '@stryke/types/array';
24
- import '@stryke/types/tsconfig';
25
- import 'typescript';
1
+ import "../config-DO3dqNWo.cjs";
2
+ import { i as __ΩSecretsInterface, n as SecretsInterface, r as __ΩEnvInterface, t as EnvInterface } from "../runtime-BYdaCpVq.cjs";
3
+ export { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface };
@@ -0,0 +1,3 @@
1
+ import "../config-BgxhYOhP.mjs";
2
+ import { i as __ΩSecretsInterface, n as SecretsInterface, r as __ΩEnvInterface, t as EnvInterface } from "../runtime-BWa_ko5I.mjs";
3
+ export { EnvInterface, SecretsInterface, __ΩEnvInterface, __ΩSecretsInterface };
@@ -0,0 +1 @@
1
+ import"../runtime-DqCYc37d.mjs";export{};
@@ -0,0 +1 @@
1
+ export{};
File without changes
@@ -0,0 +1,2 @@
1
+ import{S as e}from"./persistence-Br-YMVb1.mjs";import{isUndefined as t}from"@stryke/type-checks/is-undefined";import{isString as n}from"@stryke/type-checks/is-string";import{getUniqueBy as r}from"@stryke/helpers/get-unique";import{StormJSON as i}from"@stryke/json/storm-json";import{isNull as a}from"@stryke/type-checks/is-null";function o(e,t){return c(e.type,t??e.getDefaultValue())}function s(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function c(r,o){return t(o)?`undefined`:a(o)?`null`:r.kind===e.ReflectionKind.boolean?String(o).trim().toLowerCase()===`true`?`true`:`false`:r.kind===e.ReflectionKind.string||r.kind===e.ReflectionKind.literal&&n(r.literal)?s(o):r.kind===e.ReflectionKind.enum?l(r).kind===e.ReflectionKind.string?s(o):`${String(o)}`:r.kind===e.ReflectionKind.union?d(r)?s(o):`${String(o)}`:r.kind===e.ReflectionKind.array?s(i.stringify(o)):r.kind===e.ReflectionKind.object||r.kind===e.ReflectionKind.objectLiteral?i.stringify(o):r.kind===e.ReflectionKind.property||r.kind===e.ReflectionKind.parameter?c(r.type,o):String(o)}function l(t){if(t.kind!==e.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${t.kind}.`);let i=r(t.values.filter(e=>e!=null),t=>n(t)?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number});if(i.length===0)throw Error(`No valid enum members could be found.`);return i[0]&&n(i[0])?{kind:e.ReflectionKind.string}:{kind:e.ReflectionKind.number}}function u(t){if(t.kind===e.ReflectionKind.union&&t.types.length>0)return r(t.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${t.kind}.`)}function d(t){return u(t).some(t=>t.kind===e.ReflectionKind.string||t.kind===e.ReflectionKind.literal&&n(t.literal))}export{o as t};
2
+ //# sourceMappingURL=utilities-4S--uN0L.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utilities-4S--uN0L.mjs","names":["ReflectionKind","getUniqueBy","StormJSON","isNull","isString","isUndefined","stringifyDefaultValue","property","value","stringifyValue","type","getDefaultValue","stringifyStringValue","String","replaceAll","kind","boolean","trim","toLowerCase","string","literal","enum","getEnumReflectionType","union","isStringUnion","array","stringify","object","objectLiteral","parameter","Error","unique","values","filter","undefined","enumMember","number","length","getUnionTypes","types","member","some","kindToName","void","never","null","symbol","bigint","class","regexp","templateLiteral","method","function","promise","typeParameter","tuple","tupleMember","rest","indexSignature","propertySignature","methodSignature","infer","callSignature","any","intersection"],"sources":["../../deepkit/src/utilities.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 ReflectionKind,\n ReflectionParameter,\n ReflectionProperty,\n Type,\n TypeNumber,\n TypeString\n} from \"@powerlines/deepkit/vendor/type\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport { isNull } from \"@stryke/type-checks/is-null\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\n/**\n * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.\n *\n * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyDefaultValue(\n property: ReflectionProperty | ReflectionParameter,\n value?: any\n): string {\n return stringifyValue(property.type, value ?? property.getDefaultValue());\n}\n\n/**\n * Stringifies a value as a string.\n *\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyStringValue(value?: any): string {\n return `\"${String(value).replaceAll('\"', '\\\\\"')}\"`;\n}\n\n/**\n * Converts any {@link Type}'s actual value to string representation.\n *\n * @param type - The {@link Type} of the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyValue(type: Type, value: any): string {\n return isUndefined(value)\n ? \"undefined\"\n : isNull(value)\n ? \"null\"\n : type.kind === ReflectionKind.boolean\n ? String(value).trim().toLowerCase() === \"true\"\n ? \"true\"\n : \"false\"\n : type.kind === ReflectionKind.string ||\n (type.kind === ReflectionKind.literal && isString(type.literal))\n ? stringifyStringValue(value)\n : type.kind === ReflectionKind.enum\n ? getEnumReflectionType(type).kind === ReflectionKind.string\n ? stringifyStringValue(value)\n : `${String(value)}`\n : type.kind === ReflectionKind.union\n ? isStringUnion(type)\n ? stringifyStringValue(value)\n : `${String(value)}`\n : type.kind === ReflectionKind.array\n ? stringifyStringValue(StormJSON.stringify(value))\n : type.kind === ReflectionKind.object ||\n type.kind === ReflectionKind.objectLiteral\n ? StormJSON.stringify(value)\n : type.kind === ReflectionKind.property ||\n type.kind === ReflectionKind.parameter\n ? stringifyValue(type.type, value)\n : String(value);\n}\n\n/**\n * Converts a {@link TypeEnum} to its underlying primitive type representation.\n *\n * @param type - The {@link TypeEnum} to evaluate.\n * @returns A string representation of the primitive type.\n */\nexport function getEnumReflectionType(type: Type): TypeString | TypeNumber {\n if (type.kind !== ReflectionKind.enum) {\n throw new Error(`Expected a TypeEnum, but received ${type.kind}.`);\n }\n\n const unique = getUniqueBy(\n type.values.filter(value => value !== undefined && value !== null),\n enumMember =>\n isString(enumMember)\n ? {\n kind: ReflectionKind.string\n }\n : {\n kind: ReflectionKind.number\n }\n );\n if (unique.length === 0) {\n throw new Error(`No valid enum members could be found.`);\n }\n\n return unique[0] && isString(unique[0])\n ? {\n kind: ReflectionKind.string\n }\n : {\n kind: ReflectionKind.number\n };\n}\n\n/**\n * Converts a {@link TypeUnion} to its underlying primitive type representation.\n *\n * @param type - The {@link TypeUnion} to evaluate.\n * @returns A string representation of the primitive type.\n */\nexport function getUnionTypes(type: Type): Type[] {\n if (type.kind === ReflectionKind.union && type.types.length > 0) {\n return getUniqueBy(type.types, member => member.kind);\n }\n\n throw new Error(`Expected a TypeUnion, but received ${type.kind}.`);\n}\n\nexport function isStringUnion(type: Type): boolean {\n return getUnionTypes(type).some(\n member =>\n member.kind === ReflectionKind.string ||\n (member.kind === ReflectionKind.literal && isString(member.literal))\n );\n}\n\n/**\n * Converts a ReflectionKind to its string representation.\n *\n * @param kind - The {@link ReflectionKind} to convert.\n * @returns A string representation of the kind.\n */\nexport function kindToName(kind: ReflectionKind): string {\n if (kind === ReflectionKind.void) {\n return \"void\";\n } else if (kind === ReflectionKind.never) {\n return \"never\";\n } else if (kind === ReflectionKind.null) {\n return \"null\";\n } else if (kind === ReflectionKind.undefined) {\n return \"undefined\";\n } else if (kind === ReflectionKind.symbol) {\n return \"symbol\";\n } else if (kind === ReflectionKind.bigint) {\n return \"bigint\";\n } else if (kind === ReflectionKind.number) {\n return \"number\";\n } else if (kind === ReflectionKind.string) {\n return \"string\";\n } else if (kind === ReflectionKind.boolean) {\n return \"boolean\";\n } else if (kind === ReflectionKind.literal) {\n return \"literal\";\n } else if (kind === ReflectionKind.class) {\n return \"class\";\n } else if (kind === ReflectionKind.array) {\n return \"array\";\n } else if (kind === ReflectionKind.object) {\n return \"object\";\n } else if (kind === ReflectionKind.objectLiteral) {\n return \"objectLiteral\";\n } else if (kind === ReflectionKind.union) {\n return \"union\";\n } else if (kind === ReflectionKind.enum) {\n return \"enum\";\n } else if (kind === ReflectionKind.regexp) {\n return \"regexp\";\n } else if (kind === ReflectionKind.templateLiteral) {\n return \"templateLiteral\";\n } else if (kind === ReflectionKind.property) {\n return \"property\";\n } else if (kind === ReflectionKind.method) {\n return \"method\";\n } else if (kind === ReflectionKind.function) {\n return \"function\";\n } else if (kind === ReflectionKind.parameter) {\n return \"parameter\";\n } else if (kind === ReflectionKind.promise) {\n return \"promise\";\n } else if (kind === ReflectionKind.typeParameter) {\n return \"typeParameter\";\n } else if (kind === ReflectionKind.tuple) {\n return \"tuple\";\n } else if (kind === ReflectionKind.tupleMember) {\n return \"tupleMember\";\n } else if (kind === ReflectionKind.enumMember) {\n return \"enumMember\";\n } else if (kind === ReflectionKind.rest) {\n return \"rest\";\n } else if (kind === ReflectionKind.indexSignature) {\n return \"indexSignature\";\n } else if (kind === ReflectionKind.propertySignature) {\n return \"propertySignature\";\n } else if (kind === ReflectionKind.methodSignature) {\n return \"methodSignature\";\n } else if (kind === ReflectionKind.infer) {\n return \"infer\";\n } else if (kind === ReflectionKind.callSignature) {\n return \"callSignature\";\n } else if (kind === ReflectionKind.any) {\n return \"any\";\n } else if (kind === ReflectionKind.intersection) {\n return \"intersection\";\n }\n\n return \"unknown\";\n}\n"],"mappings":"yUAuCA,SAAgBM,EACdC,EACAC,EACQ,CACR,OAAOC,EAAeF,EAASG,KAAMF,GAASD,EAASI,iBAAiB,CAAC,CAS3E,SAAgBC,EAAqBJ,EAAqB,CACxD,MAAO,IAAIK,OAAOL,EAAM,CAACM,WAAW,IAAK,MAAM,CAAA,GAUjD,SAAgBL,EAAeC,EAAYF,EAAoB,CAC7D,OAAOH,EAAYG,EAAM,CACrB,YACAL,EAAOK,EAAM,CACX,OACAE,EAAKK,OAASf,EAAAA,eAAegB,QAC3BH,OAAOL,EAAM,CAACS,MAAM,CAACC,aAAa,GAAK,OACrC,OACA,QACFR,EAAKK,OAASf,EAAAA,eAAemB,QAC1BT,EAAKK,OAASf,EAAAA,eAAeoB,SAAWhB,EAASM,EAAKU,QAAS,CAChER,EAAqBJ,EAAM,CAC3BE,EAAKK,OAASf,EAAAA,eAAeqB,KAC3BC,EAAsBZ,EAAK,CAACK,OAASf,EAAAA,eAAemB,OAClDP,EAAqBJ,EAAM,CAC3B,GAAGK,OAAOL,EAAM,GAClBE,EAAKK,OAASf,EAAAA,eAAeuB,MAC3BC,EAAcd,EAAK,CACjBE,EAAqBJ,EAAM,CAC3B,GAAGK,OAAOL,EAAM,GAClBE,EAAKK,OAASf,EAAAA,eAAeyB,MAC3Bb,EAAqBV,EAAUwB,UAAUlB,EAAM,CAAC,CAChDE,EAAKK,OAASf,EAAAA,eAAe2B,QAC3BjB,EAAKK,OAASf,EAAAA,eAAe4B,cAC7B1B,EAAUwB,UAAUlB,EAAM,CAC1BE,EAAKK,OAASf,EAAAA,eAAeO,UAC3BG,EAAKK,OAASf,EAAAA,eAAe6B,UAC7BpB,EAAeC,EAAKA,KAAMF,EAAM,CAChCK,OAAOL,EAAM,CASnC,SAAgBc,EAAsBZ,EAAqC,CACzE,GAAIA,EAAKK,OAASf,EAAAA,eAAeqB,KAC/B,MAAUS,MAAM,qCAAqCpB,EAAKK,KAAI,GAAI,CAGpE,IAAMgB,EAAS9B,EACbS,EAAKsB,OAAOC,OAAOzB,GAASA,GAAiC,KAAK,CAClE2B,GACE/B,EAAS+B,EAAW,CAChB,CACEpB,KAAMf,EAAAA,eAAemB,OACtB,CACD,CACEJ,KAAMf,EAAAA,eAAeoC,OAE/B,CAAC,CACD,GAAIL,EAAOM,SAAW,EACpB,MAAUP,MAAM,wCAAwC,CAG1D,OAAOC,EAAO,IAAM3B,EAAS2B,EAAO,GAAG,CACnC,CACEhB,KAAMf,EAAAA,eAAemB,OACtB,CACD,CACEJ,KAAMf,EAAAA,eAAeoC,OACtB,CASP,SAAgBE,EAAc5B,EAAoB,CAChD,GAAIA,EAAKK,OAASf,EAAAA,eAAeuB,OAASb,EAAK6B,MAAMF,OAAS,EAC5D,OAAOpC,EAAYS,EAAK6B,MAAOC,GAAUA,EAAOzB,KAAK,CAGvD,MAAUe,MAAM,sCAAsCpB,EAAKK,KAAI,GAAI,CAGrE,SAAgBS,EAAcd,EAAqB,CACjD,OAAO4B,EAAc5B,EAAK,CAAC+B,KACzBD,GACEA,EAAOzB,OAASf,EAAAA,eAAemB,QAC9BqB,EAAOzB,OAASf,EAAAA,eAAeoB,SAAWhB,EAASoC,EAAOpB,QAC/D,CAAC"}
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-DT2f8AgL.cjs`),t=require(`./persistence-KaP3-ka1.cjs`);let n=require(`@stryke/type-checks/is-undefined`),r=require(`@stryke/type-checks/is-string`),i=require(`@stryke/helpers/get-unique`),a=require(`@stryke/json/storm-json`),o=require(`@stryke/type-checks/is-null`);function s(e,t){return l(e.type,t??e.getDefaultValue())}function c(e){return`"${String(e).replaceAll(`"`,`\\"`)}"`}function l(e,i){return(0,n.isUndefined)(i)?`undefined`:(0,o.isNull)(i)?`null`:e.kind===t.S.ReflectionKind.boolean?String(i).trim().toLowerCase()===`true`?`true`:`false`:e.kind===t.S.ReflectionKind.string||e.kind===t.S.ReflectionKind.literal&&(0,r.isString)(e.literal)?c(i):e.kind===t.S.ReflectionKind.enum?u(e).kind===t.S.ReflectionKind.string?c(i):`${String(i)}`:e.kind===t.S.ReflectionKind.union?f(e)?c(i):`${String(i)}`:e.kind===t.S.ReflectionKind.array?c(a.StormJSON.stringify(i)):e.kind===t.S.ReflectionKind.object||e.kind===t.S.ReflectionKind.objectLiteral?a.StormJSON.stringify(i):e.kind===t.S.ReflectionKind.property||e.kind===t.S.ReflectionKind.parameter?l(e.type,i):String(i)}function u(e){if(e.kind!==t.S.ReflectionKind.enum)throw Error(`Expected a TypeEnum, but received ${e.kind}.`);let n=(0,i.getUniqueBy)(e.values.filter(e=>e!=null),e=>(0,r.isString)(e)?{kind:t.S.ReflectionKind.string}:{kind:t.S.ReflectionKind.number});if(n.length===0)throw Error(`No valid enum members could be found.`);return n[0]&&(0,r.isString)(n[0])?{kind:t.S.ReflectionKind.string}:{kind:t.S.ReflectionKind.number}}function d(e){if(e.kind===t.S.ReflectionKind.union&&e.types.length>0)return(0,i.getUniqueBy)(e.types,e=>e.kind);throw Error(`Expected a TypeUnion, but received ${e.kind}.`)}function f(e){return d(e).some(e=>e.kind===t.S.ReflectionKind.string||e.kind===t.S.ReflectionKind.literal&&(0,r.isString)(e.literal))}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-env",
3
- "version": "0.13.53",
3
+ "version": "0.13.55",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
6
6
  "repository": {
@@ -38,137 +38,149 @@
38
38
  },
39
39
  "license": "Apache-2.0",
40
40
  "private": false,
41
- "typings": "dist/index.d.ts",
41
+ "typings": "dist/index.d.mts",
42
42
  "main": "dist/index.cjs",
43
- "module": "dist/index.js",
43
+ "module": "dist/index.mjs",
44
44
  "exports": {
45
45
  "./package.json": "./package.json",
46
46
  ".": {
47
- "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
47
+ "import": {
48
+ "types": "./dist/index.d.mts",
49
+ "default": "./dist/index.mjs"
50
+ },
48
51
  "require": {
49
52
  "types": "./dist/index.d.cts",
50
53
  "default": "./dist/index.cjs"
51
54
  },
52
- "default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
55
+ "default": {
56
+ "types": "./dist/index.d.mts",
57
+ "default": "./dist/index.mjs"
58
+ }
53
59
  },
54
60
  "./index": {
55
- "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
61
+ "import": {
62
+ "types": "./dist/index.d.mts",
63
+ "default": "./dist/index.mjs"
64
+ },
56
65
  "require": {
57
66
  "types": "./dist/index.d.cts",
58
67
  "default": "./dist/index.cjs"
59
68
  },
60
- "default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
69
+ "default": {
70
+ "types": "./dist/index.d.mts",
71
+ "default": "./dist/index.mjs"
72
+ }
61
73
  },
62
74
  "./types": {
63
75
  "import": {
64
- "types": "./dist/types/index.d.ts",
65
- "default": "./dist/types/index.js"
76
+ "types": "./dist/types/index.d.mts",
77
+ "default": "./dist/types/index.mjs"
66
78
  },
67
79
  "require": {
68
80
  "types": "./dist/types/index.d.cts",
69
81
  "default": "./dist/types/index.cjs"
70
82
  },
71
83
  "default": {
72
- "types": "./dist/types/index.d.ts",
73
- "default": "./dist/types/index.js"
84
+ "types": "./dist/types/index.d.mts",
85
+ "default": "./dist/types/index.mjs"
74
86
  }
75
87
  },
76
88
  "./types/*": {
77
89
  "import": {
78
- "types": "./dist/types/*.d.ts",
79
- "default": "./dist/types/*.js"
90
+ "types": "./dist/types/*.d.mts",
91
+ "default": "./dist/types/*.mjs"
80
92
  },
81
93
  "require": {
82
94
  "types": "./dist/types/*.d.cts",
83
95
  "default": "./dist/types/*.cjs"
84
96
  },
85
97
  "default": {
86
- "types": "./dist/types/*.d.ts",
87
- "default": "./dist/types/*.js"
98
+ "types": "./dist/types/*.d.mts",
99
+ "default": "./dist/types/*.mjs"
88
100
  }
89
101
  },
90
102
  "./helpers": {
91
103
  "import": {
92
- "types": "./dist/helpers/index.d.ts",
93
- "default": "./dist/helpers/index.js"
104
+ "types": "./dist/helpers/index.d.mts",
105
+ "default": "./dist/helpers/index.mjs"
94
106
  },
95
107
  "require": {
96
108
  "types": "./dist/helpers/index.d.cts",
97
109
  "default": "./dist/helpers/index.cjs"
98
110
  },
99
111
  "default": {
100
- "types": "./dist/helpers/index.d.ts",
101
- "default": "./dist/helpers/index.js"
112
+ "types": "./dist/helpers/index.d.mts",
113
+ "default": "./dist/helpers/index.mjs"
102
114
  }
103
115
  },
104
116
  "./helpers/*": {
105
117
  "import": {
106
- "types": "./dist/helpers/*.d.ts",
107
- "default": "./dist/helpers/*.js"
118
+ "types": "./dist/helpers/*.d.mts",
119
+ "default": "./dist/helpers/*.mjs"
108
120
  },
109
121
  "require": {
110
122
  "types": "./dist/helpers/*.d.cts",
111
123
  "default": "./dist/helpers/*.cjs"
112
124
  },
113
125
  "default": {
114
- "types": "./dist/helpers/*.d.ts",
115
- "default": "./dist/helpers/*.js"
126
+ "types": "./dist/helpers/*.d.mts",
127
+ "default": "./dist/helpers/*.mjs"
116
128
  }
117
129
  },
118
130
  "./components": {
119
131
  "import": {
120
- "types": "./dist/components/index.d.ts",
121
- "default": "./dist/components/index.js"
132
+ "types": "./dist/components/index.d.mts",
133
+ "default": "./dist/components/index.mjs"
122
134
  },
123
135
  "require": {
124
136
  "types": "./dist/components/index.d.cts",
125
137
  "default": "./dist/components/index.cjs"
126
138
  },
127
139
  "default": {
128
- "types": "./dist/components/index.d.ts",
129
- "default": "./dist/components/index.js"
140
+ "types": "./dist/components/index.d.mts",
141
+ "default": "./dist/components/index.mjs"
130
142
  }
131
143
  },
132
144
  "./components/*": {
133
145
  "import": {
134
- "types": "./dist/components/*.d.ts",
135
- "default": "./dist/components/*.js"
146
+ "types": "./dist/components/*.d.mts",
147
+ "default": "./dist/components/*.mjs"
136
148
  },
137
149
  "require": {
138
150
  "types": "./dist/components/*.d.cts",
139
151
  "default": "./dist/components/*.cjs"
140
152
  },
141
153
  "default": {
142
- "types": "./dist/components/*.d.ts",
143
- "default": "./dist/components/*.js"
154
+ "types": "./dist/components/*.d.mts",
155
+ "default": "./dist/components/*.mjs"
144
156
  }
145
157
  },
146
158
  "./babel": {
147
159
  "import": {
148
- "types": "./dist/babel/index.d.ts",
149
- "default": "./dist/babel/index.js"
160
+ "types": "./dist/babel/index.d.mts",
161
+ "default": "./dist/babel/index.mjs"
150
162
  },
151
163
  "require": {
152
164
  "types": "./dist/babel/index.d.cts",
153
165
  "default": "./dist/babel/index.cjs"
154
166
  },
155
167
  "default": {
156
- "types": "./dist/babel/index.d.ts",
157
- "default": "./dist/babel/index.js"
168
+ "types": "./dist/babel/index.d.mts",
169
+ "default": "./dist/babel/index.mjs"
158
170
  }
159
171
  },
160
172
  "./babel/*": {
161
173
  "import": {
162
- "types": "./dist/babel/*.d.ts",
163
- "default": "./dist/babel/*.js"
174
+ "types": "./dist/babel/*.d.mts",
175
+ "default": "./dist/babel/*.mjs"
164
176
  },
165
177
  "require": {
166
178
  "types": "./dist/babel/*.d.cts",
167
179
  "default": "./dist/babel/*.cjs"
168
180
  },
169
181
  "default": {
170
- "types": "./dist/babel/*.d.ts",
171
- "default": "./dist/babel/*.js"
182
+ "types": "./dist/babel/*.d.mts",
183
+ "default": "./dist/babel/*.mjs"
172
184
  }
173
185
  }
174
186
  },
@@ -177,31 +189,30 @@
177
189
  "dependencies": {
178
190
  "@alloy-js/core": "^0.20.0",
179
191
  "@alloy-js/typescript": "^0.20.0",
192
+ "@alloy-js/markdown": "^0.20.0",
180
193
  "@babel/core": "^7.28.5",
181
194
  "@babel/types": "^7.28.5",
182
- "@powerlines/alloy": "^0.11.56",
183
- "@powerlines/plugin-babel": "^0.12.56",
184
- "@powerlines/plugin-plugin": "^0.11.55",
185
- "@storm-software/config-tools": "^1.188.50",
186
- "@stryke/capnp": "^0.12.32",
187
- "@stryke/env": "^0.20.25",
188
- "@stryke/fs": "^0.33.8",
189
- "@stryke/json": "^0.9.15",
190
- "@stryke/string-format": "^0.12.12",
191
- "@stryke/type-checks": "^0.4.3",
192
- "@stryke/types": "^0.10.12",
193
- "powerlines": "^0.28.0"
195
+ "@powerlines/alloy": "^0.11.58",
196
+ "@powerlines/plugin-babel": "^0.12.58",
197
+ "@powerlines/plugin-plugin": "^0.12.1",
198
+ "@storm-software/config-tools": "^1.188.52",
199
+ "@stryke/capnp": "^0.12.33",
200
+ "@stryke/env": "^0.20.26",
201
+ "@stryke/fs": "^0.33.9",
202
+ "@stryke/json": "^0.9.16",
203
+ "@stryke/string-format": "^0.12.13",
204
+ "@stryke/type-checks": "^0.4.4",
205
+ "@stryke/types": "^0.10.13",
206
+ "powerlines": "^0.30.0"
194
207
  },
195
208
  "devDependencies": {
196
209
  "@alloy-js/babel-preset": "^0.2.1",
197
210
  "@babel/preset-typescript": "^7.28.5",
198
- "@powerlines/nx": "^0.10.47",
199
- "@storm-software/tsup": "^0.2.48",
211
+ "@powerlines/nx": "^0.10.49",
200
212
  "@types/node": "^24.10.1",
201
- "tsup": "8.4.0",
202
213
  "typescript": "^5.9.3",
203
- "vite": "^7.2.4"
214
+ "vite": "^7.2.6"
204
215
  },
205
216
  "publishConfig": { "access": "public" },
206
- "gitHead": "3feaa815e117c46d827eee84c3521e54670abb9b"
217
+ "gitHead": "f0a4e1526773f5d4bfb63fd5ba1d02d5aa9bc771"
207
218
  }
@@ -1,31 +0,0 @@
1
- export { envBabelPlugin } from './plugin.js';
2
- import '../runtime-B75FziIk.js';
3
- import '@stryke/env/get-env-paths';
4
- import '@stryke/http/fetch';
5
- import '@stryke/types/base';
6
- import '@stryke/types/package-json';
7
- import 'jiti';
8
- import 'magic-string';
9
- import 'oxc-parser';
10
- import 'semver';
11
- import 'ts-morph';
12
- import 'undici';
13
- import 'unplugin';
14
- import '@babel/core';
15
- import '@storm-software/build-tools/types';
16
- import '@storm-software/config-tools/types';
17
- import '@storm-software/config/types';
18
- import '@stryke/types/configuration';
19
- import '@stryke/types/file';
20
- import 'vite';
21
- import '@babel/helper-plugin-utils';
22
- import '../fs-ECFlqnPg.js';
23
- import '@stryke/fs/resolve';
24
- import '@stryke/types/array';
25
- import '@stryke/types/tsconfig';
26
- import 'typescript';
27
- import '../types/plugin.js';
28
- import '@alloy-js/core/jsx-runtime';
29
- import '@deepkit/type';
30
- import '@stryke/capnp';
31
- import '@stryke/env/types';
@@ -1 +0,0 @@
1
- export*from'./plugin';
@@ -1,34 +0,0 @@
1
- import { D as DeclareBabelTransformPluginReturn } from '../runtime-B75FziIk.js';
2
- import { EnvPluginContext, EnvPluginResolvedConfig } from '../types/plugin.js';
3
- import '@stryke/env/get-env-paths';
4
- import '@stryke/http/fetch';
5
- import '@stryke/types/base';
6
- import '@stryke/types/package-json';
7
- import 'jiti';
8
- import 'magic-string';
9
- import 'oxc-parser';
10
- import 'semver';
11
- import 'ts-morph';
12
- import 'undici';
13
- import 'unplugin';
14
- import '@babel/core';
15
- import '@storm-software/build-tools/types';
16
- import '@storm-software/config-tools/types';
17
- import '@storm-software/config/types';
18
- import '@stryke/types/configuration';
19
- import '@stryke/types/file';
20
- import 'vite';
21
- import '@babel/helper-plugin-utils';
22
- import '../fs-ECFlqnPg.js';
23
- import '@stryke/fs/resolve';
24
- import '@stryke/types/array';
25
- import '@stryke/types/tsconfig';
26
- import 'typescript';
27
- import '@alloy-js/core/jsx-runtime';
28
- import '@deepkit/type';
29
- import '@stryke/capnp';
30
- import '@stryke/env/types';
31
-
32
- declare const envBabelPlugin: DeclareBabelTransformPluginReturn<EnvPluginContext<EnvPluginResolvedConfig>, Record<string, any>>;
33
-
34
- export { envBabelPlugin };
@@ -1,19 +0,0 @@
1
- import {a}from'../chunk-UCUR73HG.js';import {convertFromCapnp}from'@powerlines/deepkit/capnp';import {SerializedTypes}from'@powerlines/deepkit/schemas/reflection';import {stringifyDefaultValue}from'@powerlines/deepkit/utilities';import {ReflectionClass,ReflectionKind,resolveClassType,deserializeType}from'@powerlines/deepkit/vendor/type';import {createBabelPlugin}from'@powerlines/plugin-babel/helpers/create-plugin';import {addImport}from'@powerlines/plugin-babel/helpers/module-helpers';import {LogLevelLabel}from'@storm-software/config-tools/types';import*as E from'@stryke/capnp';import {readFileBufferSync}from'@stryke/fs/buffer';import {existsSync}from'node:fs';import {getEnvReflectionsPath}from'../helpers/persistence';/*****************************************
2
- *
3
- * ⚡ Built by Storm Software
4
- *
5
- *****************************************/
6
-
7
- const H=createBabelPlugin("env",({log:f,context:t})=>{function l(e,o,n=false){const a=t.env.types.env?.getProperties().filter(m=>m.getAlias().length>0);if(e.name){const m=t.config.env.prefix.find(i=>e.name&&e.name.startsWith(i)&&(t.env.types.env?.hasProperty(e.name.replace(`${i}_`,""))||a.some(r=>r.getAlias().includes(e.name.replace(`${i}_`,"")))));let s=e.name;if(m&&(s=e.name.replace(`${m}_`,"")),f(LogLevelLabel.TRACE,`Environment variable ${s} found in ${o.filename||"unknown file"}.`),t.env.types.env?.hasProperty(s)||a.some(i=>i.getAlias().includes(s))){const i=t.env.types.env.hasProperty(s)?t.env.types.env.getProperty(s):a.find(r=>r.getAlias().includes(s));if(!i||i.isIgnored())return;if(t.env.used.env.hasProperty(s)||t.env.used.env.addProperty(i.property),t.config.env.inject&&n){let r=t.env.parsed?.[s];if(r===void 0){const v=t.config.env.prefix.find(u=>t.env.parsed[`${u.replace(/_$/g,"")}_${s}`]);v&&(r=t.env.parsed[`${v.replace(/_$/g,"")}_${s}`]);}if(r??=i.getDefaultValue(),i.isValueRequired()&&r===void 0)throw new Error(`Environment variable \`${s}\` is not defined in the .env configuration files`);return stringifyDefaultValue(i,r)}}else throw new Error(`The "${s}" environment variable is not defined in the \`env\` type definition, but is used in the source code file ${o.filename?o.filename:"unknown"}.
8
-
9
- The following environment configuration names are defined in the \`env\` type definition:
10
- ${t.env.types.env?.getPropertyNames().sort((i,r)=>String(i).localeCompare(String(r))).map(i=>` - ${String(i)} ${a.some(r=>r.getNameAsString()===String(i)&&r.getAlias().length>0)?`(Alias: ${a?.find(r=>r.getNameAsString()===String(i))?.getAlias().join(", ")})`:""}`).join(`
11
- `)}
12
-
13
- Using the following env prefix:
14
- ${t.config.env.prefix.map(i=>` - ${i}`).join(`
15
- `)}
16
-
17
- Please check your \`env\` configuration option. If you are using a custom dotenv type definition, please make sure that the configuration names match the ones in the code.
18
-
19
- `)}}return a(l,"extractEnv"),{visitor:{MemberExpression(e,o){if(e.get("object")?.get("property")?.isIdentifier({name:"env"})&&e.get("object")?.get("object")?.isIdentifier({name:"$storm"})&&e.get("property")?.isIdentifier()){const n=e.get("property")?.node;l(n,o,false),e.replaceWithSourceString(`env.${n.name}`),addImport(e,{module:"storm:env",name:"env",imported:"env"});}else if(e.get("object")?.get("property")?.isIdentifier({name:"env"})&&e.get("object")?.get("object")?.isCallExpression({callee:{name:"useStorm",type:"Identifier"}})&&e.get("property")?.isIdentifier()){const n=e.get("property")?.node;l(n,o,false),e.replaceWithSourceString(`env.${n.name}`),addImport(e,{module:"storm:env",name:"env",imported:"env"});}else if(e.get("object")?.get("property")?.isIdentifier({name:"env"})&&e.get("object")?.get("object")?.isIdentifier({name:"process"})&&e.get("property")?.isIdentifier()){const n=e.get("property")?.node;if(!n.name)return;l(n,o,false),e.replaceWithSourceString(`env.${n.name}`),addImport(e,{module:"storm:env",name:"env",imported:"env"});}else if(e.get("object")?.get("property")?.isIdentifier({name:"env"})&&e.get("object")?.get("object")?.isMetaProperty()&&e.get("property")?.isIdentifier()){const n=e.get("property")?.node;if(!n.name)return;l(n,o,false),e.replaceWithSourceString(`env.${n.name}`),addImport(e,{module:"storm:env",name:"env",imported:"env"});}}},post(){f(LogLevelLabel.TRACE,`Adding environment variables from ${this.filename||"unknown file"} to env.json.`);let e=ReflectionClass.from({kind:ReflectionKind.objectLiteral,description:"An object containing the environment variables used by the application.",types:[]});const o=getEnvReflectionsPath(t,"env");o&&existsSync(o)&&(f(LogLevelLabel.TRACE,`Environment reflection file found at ${o}, reading existing reflection.`),e=resolveClassType(deserializeType(convertFromCapnp(new E.Message(readFileBufferSync(o),false).getRoot(SerializedTypes).types)))),f(LogLevelLabel.TRACE,`Adding new variables to env reflection at ${o}.`),e.getProperties().filter(n=>n.getNameAsString()&&!t.env.used.env.hasProperty(n.getNameAsString())).forEach(n=>{t.env.used.env.addProperty({...n,name:n.getNameAsString(),description:n.getDescription()??`The ${n.getNameAsString()} variable.`,default:n.getDefaultValue(),optional:n.isOptional()?true:void 0,readonly:n.isReadonly()?true:void 0,visibility:n.getVisibility(),type:n.getType(),tags:n.getTags()});});}}});export{H as envBabelPlugin};
@@ -1,7 +0,0 @@
1
- 'use strict';/*****************************************
2
- *
3
- * ⚡ Built by Storm Software
4
- *
5
- *****************************************/
6
-
7
- var c=Object.defineProperty;var d=(a,b)=>c(a,"name",{value:b,configurable:true});exports.a=d;
@@ -1,7 +0,0 @@
1
- /*****************************************
2
- *
3
- * ⚡ Built by Storm Software
4
- *
5
- *****************************************/
6
-
7
- var c=Object.defineProperty;var d=(a,b)=>c(a,"name",{value:b,configurable:true});export{d as a};
@@ -1,105 +0,0 @@
1
- import { Children as Children$1, SourceFileProps as SourceFileProps$1 } from '@alloy-js/core';
2
- import { Children } from '@alloy-js/core/jsx-runtime';
3
- import { a as StoragePreset } from '../fs-ECFlqnPg.js';
4
- import { InterfaceDeclarationProps } from '@alloy-js/typescript';
5
- import { ReflectionClass } from '@deepkit/type';
6
- import '@stryke/fs/resolve';
7
- import '@stryke/types/base';
8
-
9
- /**
10
- * A type that represents the props of a component that can have children.
11
- */
12
- interface ComponentProps {
13
- children?: Children;
14
- }
15
- interface TypescriptFileImportItem {
16
- name: string;
17
- default?: boolean;
18
- alias?: string;
19
- type?: boolean;
20
- }
21
- type TypescriptFileImports = Record<string, null | Array<TypescriptFileImportItem | string>>;
22
-
23
- interface TSDocModuleProps extends ComponentProps {
24
- /**
25
- * the prefix for the builtin module name
26
- *
27
- * @defaultValue "storm"
28
- */
29
- prefix?: string;
30
- /**
31
- * The name of the module
32
- *
33
- * @remarks
34
- * This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.
35
- *
36
- * @example
37
- * ```ts
38
- * import { MyModule } from "storm:my-module";
39
- * ```
40
- */
41
- name: Children$1;
42
- }
43
-
44
- type SourceFileProps = SourceFileProps$1 & ComponentProps & {
45
- /**
46
- * If true, indicates that the file is virtual and should not be written to disk.
47
- *
48
- * @defaultValue false
49
- */
50
- preset?: StoragePreset;
51
- /**
52
- * The metadata associated with the source file.
53
- *
54
- * @remarks
55
- * The values stored in the metadata will be available in the rendering context.
56
- */
57
- meta?: Record<string, any>;
58
- };
59
-
60
- type TypescriptFileProps = Omit<SourceFileProps, "filetype"> & ComponentProps & {
61
- header?: Children$1;
62
- imports?: TypescriptFileImports;
63
- export?: boolean | string;
64
- tsx?: boolean;
65
- };
66
-
67
- type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
68
- /**
69
- * The runtime module identifier.
70
- *
71
- * @remarks
72
- * This value will be included after the \`storm:\` prefix in the import statement.
73
- */
74
- id: string;
75
- /**
76
- * The description for the builtin module.
77
- */
78
- description?: string;
79
- /**
80
- * Whether the file is a TSX file.
81
- *
82
- * @defaultValue false
83
- */
84
- tsx?: boolean;
85
- };
86
-
87
- interface TypeScriptInterfaceProps<T extends Record<string, any> = Record<string, any>> extends InterfaceDeclarationProps, ComponentProps {
88
- reflection: ReflectionClass<T>;
89
- defaultValue?: Partial<T>;
90
- }
91
-
92
- /**
93
- * Generates the environment configuration typescript definition for the Powerlines project.
94
- */
95
- declare function EnvTypeDefinition(props: Omit<TypeScriptInterfaceProps, "name">): Children$1;
96
- interface EnvBuiltinProps extends Omit<BuiltinFileProps, "id"> {
97
- defaultConfig?: Children$1;
98
- }
99
- /**
100
- * Generates the environment configuration module for the Powerlines project.
101
- */
102
- declare function EnvBuiltin(props: EnvBuiltinProps): Children$1;
103
- declare type __ΩEnvBuiltinProps = any[];
104
-
105
- export { EnvBuiltin, type EnvBuiltinProps, EnvTypeDefinition, type __ΩEnvBuiltinProps };
@@ -1,40 +0,0 @@
1
- import {a}from'../chunk-UCUR73HG.js';import {createComponent,createIntrinsic,memo,mergeProps}from'@alloy-js/core/jsx-runtime';import {splitProps,code,Show,For,computed,createResource}from'@alloy-js/core';import {TypeDeclaration,IfStatement,ElseIfClause,ClassDeclaration,ClassMethod,VarDeclaration,NewExpression,FunctionDeclaration}from'@alloy-js/typescript';import {usePowerlines}from'@powerlines/alloy/core/contexts/context';import {refkey}from'@powerlines/alloy/helpers/refkey';import {BuiltinFile}from'@powerlines/alloy/typescript/components/builtin-file';import {TSDoc,TSDocLink,TSDocRemarks,TSDocExample,TSDocThrows,TSDocParam,TSDocReturns}from'@powerlines/alloy/typescript/components/tsdoc';import {TypeScriptInterface}from'@powerlines/alloy/typescript/components/typescript-interface';import {TypescriptObject}from'@powerlines/alloy/typescript/components/typescript-object';import {ReflectionClass,ReflectionKind}from'@powerlines/deepkit/vendor/type';import {titleCase}from'@stryke/string-format/title-case';import {isNull}from'@stryke/type-checks/is-null';import U from'defu';import {loadEnvFromContext}from'../helpers/load';import {readEnvTypeReflection}from'../helpers/persistence';/*****************************************
2
- *
3
- * ⚡ Built by Storm Software
4
- *
5
- *****************************************/
6
-
7
- function Z(u){const[{defaultValue:o,reflection:r}]=splitProps(u,["defaultValue","reflection"]),a=usePowerlines();return [createComponent(TypeScriptInterface,{name:" EnvBase",extends:["EnvInterface"],defaultValue:o,reflection:r,export:true}),createIntrinsic("hbr",{}),createIntrinsic("hbr",{}),createComponent(TypeDeclaration,{name:"Env",export:true,get children(){return code` {
8
- [Key in keyof EnvBase as Key ${a?.config.env.prefix.map(s=>`| \`${s.replace(/_$/g,"")}_\${Key}\``).join(" ")}]: EnvBase[Key];
9
- }
10
- `}})]}a(Z,"EnvTypeDefinition");function g(u){const[{context:o,name:r}]=splitProps(u,["context","name"]);return o?code`propertyName === "${r}" || propertyName.replace(/^(${o.config.env.prefix.sort((a,s)=>a.startsWith(s)?-1:s.startsWith(a)?1:a.localeCompare(s)).map(a=>`${a.replace(/_$/,"")}_`).join("|")})/g, "").toLowerCase().replace(/[\\s\\-_]+/g, "") === "${r.toLowerCase().replace(/[\s\-_]+/g,"")}"`:null}a(g,"ConfigPropertyConditional");function ee(u){const[{context:o,property:r,index:a$1}]=splitProps(u,["context","property","index"]);return o?[a$1===0?createComponent(IfStatement,{get condition(){return [createComponent(g,{get name(){return r.getNameAsString()},context:o}),createComponent(Show,{get when(){return memo(()=>!!r.getAlias())()&&r.getAlias().length>0},get children(){return [code` || `,createComponent(For,{get each(){return r.getAlias()},joiner:code` || `,children:a(s=>createComponent(g,{name:s,context:o}),"children")})]}})]},get children(){return code`return target["${r.getNameAsString()}"];`}}):createComponent(ElseIfClause,{get condition(){return [createComponent(g,{get name(){return r.getNameAsString()},context:o}),createComponent(Show,{get when(){return memo(()=>!!r.getAlias())()&&r.getAlias().length>0},get children(){return [code` || `,createComponent(For,{get each(){return r.getAlias()},joiner:code` || `,children:a(s=>createComponent(g,{name:s,context:o}),"children")})]}})]},get children(){return code`return target["${r.getNameAsString()}"];`}})]:null}a(ee,"ConfigPropertyGet");function te(u){const[{context:o,property:r,index:a$1}]=splitProps(u,["context","property","index"]);return o?[a$1===0?createComponent(IfStatement,{get condition(){return [createComponent(g,{get name(){return r.getNameAsString()},context:o}),createComponent(Show,{get when(){return memo(()=>!!r.getAlias())()&&r.getAlias().length>0},get children(){return [code` || `,createComponent(For,{get each(){return r.getAlias()},joiner:code` || `,children:a(s=>createComponent(g,{name:s,context:o}),"children")})]}})]},get children(){return code`
11
- target["${r.getNameAsString()}"] = newValue;
12
- return true;
13
- `}}):createComponent(ElseIfClause,{get condition(){return [createComponent(g,{get name(){return r.getNameAsString()},context:o}),createComponent(Show,{get when(){return memo(()=>!!r.getAlias())()&&r.getAlias().length>0},get children(){return [code` || `,createComponent(For,{get each(){return r.getAlias()},joiner:code` || `,children:a(s=>createComponent(g,{name:s,context:o}),"children")})]}})]},get children(){return code`
14
- target["${r.getNameAsString()}"] = newValue;
15
- return true;
16
- `}})]:null}a(te,"ConfigPropertySet");const re=refkey("createEnv"),ne=refkey("env"),ie=refkey("EnvSerializer");function Ee(u){const[{defaultConfig:o},r]=splitProps(u,["defaultConfig"]),a$1=usePowerlines(),s=computed(()=>a$1&&loadEnvFromContext(a$1,process.env)),h=createResource(async()=>{if(!a$1)return new ReflectionClass({kind:ReflectionKind.objectLiteral,description:"The initial environment configuration state for the Powerlines project.",types:[]});const l=await readEnvTypeReflection(a$1,"env");return l.getProperties().forEach(t=>{t.getAlias().filter(Boolean).forEach(y=>{l.addProperty({name:y,optional:t.isOptional()?true:void 0,readonly:t.isReadonly()?true:void 0,description:t.getDescription(),visibility:t.getVisibility(),type:t.getType(),default:t.getDefaultValue(),tags:{hidden:t.isHidden(),ignore:t.isIgnored(),internal:t.isInternal(),alias:t.getAlias().filter(I=>I!==y).concat(t.name),title:t.getTitle()||titleCase(t.name),readonly:t.isReadonly(),permission:t.getPermission(),domain:t.getDomain()}});});}),l.getProperties().forEach(t=>{t.setDefaultValue(s.value?.[t.getNameAsString()]??t.getAlias().reduce((w,y)=>w??s.value?.[y],void 0)??t.getDefaultValue());}),l}),D=computed(()=>new ReflectionClass({kind:ReflectionKind.objectLiteral,description:`The initial environment configuration state for the ${titleCase(a$1?.config?.name)} project.`,types:[]},h.data??void 0)),V=computed(()=>h.data?.getProperties().filter(l=>!l.isIgnored()).sort((l,t)=>l.getNameAsString().localeCompare(t.getNameAsString()))??[]),R=computed(()=>h.data?.getProperties().filter(l=>!l.isIgnored()&&!l.isReadonly()).sort((l,t)=>l.getNameAsString().localeCompare(t.getNameAsString()))??[]);return createComponent(BuiltinFile,mergeProps(r,{id:"env",description:"The Powerlines environment configuration module provides an interface to define environment configuration parameters.",get imports(){return U({"@powerlines/deepkit/vendor/type":["Type","stringify","serializer","serializeFunction","deserializeFunction","ReflectionKind","TemplateState","Serializer","TypeProperty","TypePropertySignature"],"@powerlines/plugin-env/types/runtime":[{name:"EnvInterface"}]},r.imports??{})},get children(){return [createComponent(Show,{get when(){return !isNull(h.data)},get children(){return [createComponent(Z,{get defaultValue(){return s.value},get reflection(){return h.data}}),createIntrinsic("hbr",{}),createIntrinsic("hbr",{})]}}),createComponent(TypescriptObject,{name:"initialEnv",type:"Partial<EnvBase>",defaultValue:s,reflection:D,export:true,const:true}),createIntrinsic("hbr",{}),createIntrinsic("hbr",{}),createComponent(TSDoc,{heading:"The environment configuration serializer for the Powerlines application.",get children(){return [createComponent(TSDocLink,{children:"https://deepkit.io/docs/serialization/serializers"}),createComponent(TSDocLink,{children:"https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918"}),createComponent(TSDocRemarks,{children:"This serializer is used to serialize and deserialize the Powerlines environment configuration."})]}}),createComponent(ClassDeclaration,{refkey:ie,name:"EnvSerializer",extends:"Serializer",export:true,get children(){return createComponent(ClassMethod,{name:"constructor",public:true,children:code`
17
- super("env");
18
-
19
- this.deserializeRegistry.register(
20
- ReflectionKind.boolean,
21
- (type: Type, state: TemplateState) => {
22
- state.addSetter(
23
- \`typeof \${state.accessor.toString()} !== "boolean" ? \${state.accessor.toString()} === 1 || \${state.accessor.toString()} === "1" || \${state.accessor.toString()}.toLowerCase() === "t" || \${state.accessor.toString()}.toLowerCase() === "true" || \${state.accessor.toString()}.toLowerCase() === "y" || \${state.accessor.toString()}.toLowerCase() === "yes" : \${state.accessor.toString()}\`
24
- );
25
- }
26
- );
27
- `})}}),createIntrinsic("hbr",{}),createIntrinsic("hbr",{}),createComponent(TSDoc,{heading:"A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.",get children(){return [createComponent(TSDocLink,{children:"https://deepkit.io/docs/serialization/serializers"}),createComponent(TSDocLink,{children:"https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918"}),createComponent(TSDocRemarks,{children:"This serializer is used to serialize and deserialize the Powerlines environment configuration."})]}}),createComponent(VarDeclaration,{name:"envSerializer",export:false,const:true,get initializer(){return createComponent(NewExpression,{args:[],target:"EnvSerializer"})}}),createIntrinsic("hbr",{}),createIntrinsic("hbr",{}),createComponent(TSDoc,{heading:"Serialize a environment configuration object to JSON data objects (not a JSON string).",get children(){return [createComponent(TSDocRemarks,{children:"The resulting JSON object can be stringified using JSON.stringify()."}),createComponent(TSDocExample,{children:"const json = serializeEnv(env);"}),createComponent(TSDocThrows,{children:"ValidationError when serialization or validation fails."})]}}),createComponent(VarDeclaration,{name:"serializeEnv",export:true,const:true,initializer:"serializeFunction<EnvBase>(envSerializer)"}),createIntrinsic("hbr",{}),createIntrinsic("hbr",{}),createComponent(TSDoc,{heading:"Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.",get children(){return [createComponent(TSDocRemarks,{children:"Types that are already correct will be used as-is."}),createComponent(TSDocExample,{children:"const env = deserializeEnv(json);"}),createComponent(TSDocThrows,{children:"ValidationError when deserialization fails."})]}}),createComponent(VarDeclaration,{name:"deserializeEnv",export:true,const:true,initializer:"deserializeFunction<EnvBase>(envSerializer)"}),createIntrinsic("hbr",{}),createIntrinsic("hbr",{}),createComponent(TSDoc,{heading:"Initializes the Powerlines environment configuration module.",get children(){return [createComponent(TSDocRemarks,{children:"This function initializes the Powerlines environment configuration object."}),createComponent(TSDocParam,{name:"environmentConfig",children:"The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime."}),createComponent(TSDocReturns,{children:"The initialized Powerlines configuration object."})]}}),createComponent(Show,{get when(){return !!a$1?.entryPath},get children(){return createComponent(FunctionDeclaration,{refkey:re,async:false,export:true,name:"createEnv",parameters:[{name:"environmentConfig",type:"Partial<Env>",optional:false,default:"{}"}],returnType:"Env",get children(){return [code`
28
- return new Proxy<Env>(
29
- deserializeEnv({
30
- ...initialEnv,
31
- ...environmentConfig
32
- }) as Env,
33
- {
34
- get: (target: EnvBase, propertyName: string) => { `,createIntrinsic("hbr",{}),createComponent(For,{each:V,children:a((l,t)=>createComponent(ee,{index:t,context:a$1,property:l}),"children")}),code`
35
- return undefined;
36
- }, `,createIntrinsic("hbr",{}),createIntrinsic("hbr",{}),code` set: (target: EnvBase, propertyName: string, newValue: any) => { `,createIntrinsic("hbr",{}),createComponent(For,{each:R,ender:code` else `,children:a((l,t)=>createComponent(te,{index:t,context:a$1,property:l}),"children")}),createIntrinsic("hbr",{}),code`return false;
37
- }
38
- }
39
- );
40
- `]}})}}),createIntrinsic("hbr",{}),createIntrinsic("hbr",{}),createIntrinsic("hbr",{}),createComponent(VarDeclaration,{refkey:ne,name:"env",type:"Env",export:true,const:true,get initializer(){return [code`createEnv(`,o||"{}",code` as Partial<Env>)`]}})]}}))}a(Ee,"EnvBuiltin");export{Ee as EnvBuiltin,Z as EnvTypeDefinition};