@powerlines/plugin-env 0.15.161 → 0.15.162
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.
- package/dist/{chunk-CNVrAnJR.cjs → _virtual/rolldown_runtime.cjs} +3 -18
- package/dist/{chunk-CsF2CmBJ.mjs → _virtual/rolldown_runtime.mjs} +1 -1
- package/dist/babel/index.cjs +2 -5
- package/dist/babel/index.d.cts +1 -14
- package/dist/babel/index.d.mts +1 -14
- package/dist/babel/index.mjs +1 -4
- package/dist/babel/plugin.cjs +140 -4
- package/dist/babel/plugin.d.cts +9 -15
- package/dist/babel/plugin.d.cts.map +1 -0
- package/dist/babel/plugin.d.mts +9 -15
- package/dist/babel/plugin.d.mts.map +1 -0
- package/dist/babel/plugin.mjs +140 -4
- package/dist/babel/plugin.mjs.map +1 -0
- package/dist/components/docs.cjs +66 -6
- package/dist/components/docs.d.cts +25 -2
- package/dist/components/docs.d.cts.map +1 -0
- package/dist/components/docs.d.mts +25 -2
- package/dist/components/docs.d.mts.map +1 -0
- package/dist/components/docs.mjs +66 -6
- package/dist/components/docs.mjs.map +1 -0
- package/dist/components/env.cjs +582 -11
- package/dist/components/env.d.cts +23 -2
- package/dist/components/env.d.cts.map +1 -0
- package/dist/components/env.d.mts +23 -2
- package/dist/components/env.d.mts.map +1 -0
- package/dist/components/env.mjs +581 -10
- package/dist/components/env.mjs.map +1 -0
- package/dist/components/index.cjs +5 -15
- package/dist/components/index.d.cts +2 -3
- package/dist/components/index.d.mts +2 -3
- package/dist/components/index.mjs +2 -12
- package/dist/helpers/automd-generator.cjs +31 -3
- package/dist/helpers/automd-generator.mjs +31 -3
- package/dist/helpers/automd-generator.mjs.map +1 -0
- package/dist/helpers/create-reflection-resource.cjs +21 -4
- package/dist/helpers/create-reflection-resource.d.cts +14 -4
- package/dist/helpers/create-reflection-resource.d.cts.map +1 -0
- package/dist/helpers/create-reflection-resource.d.mts +14 -4
- package/dist/helpers/create-reflection-resource.d.mts.map +1 -0
- package/dist/helpers/create-reflection-resource.mjs +22 -4
- package/dist/helpers/create-reflection-resource.mjs.map +1 -0
- package/dist/helpers/docs-helper.cjs +22 -5
- package/dist/helpers/docs-helper.d.cts +1 -2
- package/dist/helpers/docs-helper.d.cts.map +1 -1
- package/dist/helpers/docs-helper.d.mts +1 -2
- package/dist/helpers/docs-helper.d.mts.map +1 -1
- package/dist/helpers/docs-helper.mjs +23 -5
- package/dist/helpers/docs-helper.mjs.map +1 -0
- package/dist/helpers/index.cjs +32 -38
- package/dist/helpers/index.d.cts +6 -9
- package/dist/helpers/index.d.mts +6 -9
- package/dist/helpers/index.mjs +6 -12
- package/dist/helpers/load.cjs +133 -10
- package/dist/helpers/load.d.cts +36 -4
- package/dist/helpers/load.d.cts.map +1 -0
- package/dist/helpers/load.d.mts +36 -4
- package/dist/helpers/load.d.mts.map +1 -0
- package/dist/helpers/load.mjs +132 -9
- package/dist/helpers/load.mjs.map +1 -0
- package/dist/helpers/persistence.cjs +321 -15
- package/dist/helpers/persistence.d.cts +85 -4
- package/dist/helpers/persistence.d.cts.map +1 -0
- package/dist/helpers/persistence.d.mts +85 -4
- package/dist/helpers/persistence.d.mts.map +1 -0
- package/dist/helpers/persistence.mjs +310 -5
- package/dist/helpers/persistence.mjs.map +1 -0
- package/dist/helpers/reflect.cjs +262 -13
- package/dist/helpers/reflect.d.cts +47 -4
- package/dist/helpers/reflect.d.cts.map +1 -0
- package/dist/helpers/reflect.d.mts +47 -4
- package/dist/helpers/reflect.d.mts.map +1 -0
- package/dist/helpers/reflect.mjs +254 -5
- package/dist/helpers/reflect.mjs.map +1 -0
- package/dist/helpers/source-file-env.cjs +57 -3
- package/dist/helpers/source-file-env.d.cts +9 -2
- package/dist/helpers/source-file-env.d.cts.map +1 -0
- package/dist/helpers/source-file-env.d.mts +9 -2
- package/dist/helpers/source-file-env.d.mts.map +1 -0
- package/dist/helpers/source-file-env.mjs +56 -2
- package/dist/helpers/source-file-env.mjs.map +1 -0
- package/dist/helpers/template-helpers.cjs +69 -6
- package/dist/helpers/template-helpers.d.cts +16 -4
- package/dist/helpers/template-helpers.d.cts.map +1 -0
- package/dist/helpers/template-helpers.d.mts +16 -4
- package/dist/helpers/template-helpers.d.mts.map +1 -0
- package/dist/helpers/template-helpers.mjs +69 -6
- package/dist/helpers/template-helpers.mjs.map +1 -0
- package/dist/index.cjs +98 -258
- package/dist/index.d.cts +25 -15
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +25 -15
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +22 -182
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/parse-type-definition.cjs +37 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/parse-type-definition.mjs +38 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/parse-type-definition.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/to-array.cjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/to-array.mjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/to-array.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.cjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/index.cjs +3 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/index.mjs +5 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.cjs +6 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs +7 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-collection.cjs +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-collection.mjs +3 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-object.cjs +19 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs +20 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.cjs +63 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs +64 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-string.cjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/type-detect.cjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs +17 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-parent-path.cjs +32 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-parent-path.mjs +33 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-parent-path.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-type.cjs +28 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs +29 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs.map +1 -0
- package/dist/{join-paths-B0RBTuuw.cjs → node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.cjs} +13 -65
- package/dist/{join-paths-Dd9KxuyL.mjs → node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs} +5 -45
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/regex.cjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/regex.mjs +9 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/regex.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/slash.cjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/slash.mjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/slash.mjs.map +1 -0
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.cjs +346 -0
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs +347 -0
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs.map +1 -0
- package/dist/{json5-DEV_07Nb.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.cjs} +1 -1
- package/dist/{json5-jq90mF9X.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.mjs} +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.mjs.map +1 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.cjs +3 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.mjs +3 -0
- package/dist/{confbox.DA7CpUDY-DShUZ_rW.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs} +2 -2
- package/dist/{confbox.DA7CpUDY-r6FXRsI6.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs} +2 -7
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs.map +1 -0
- package/dist/{confbox.DnMsyigM-C13n3X-S.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs} +3 -13
- package/dist/{confbox.DnMsyigM-V6Wj0LPC.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs} +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs.map +1 -0
- package/dist/{toml-DvrxV201.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.cjs} +1 -1
- package/dist/{toml-uuOYvEAO.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.mjs} +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.mjs.map +1 -0
- package/dist/{yaml-CQSFMRMS.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.cjs} +1 -1
- package/dist/{yaml-CIn2Gddw.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.mjs} +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.mjs.map +1 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +43 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +43 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs.map +1 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +46 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +46 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.cjs +288 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.mjs +286 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.mjs.map +1 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.cjs +71 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.mjs +69 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.mjs.map +1 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +1013 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +1008 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +23 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +14 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +2698 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +2686 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs.map +1 -0
- package/dist/{load-CC_Pu2Om.cjs → node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs} +195 -2332
- package/dist/{load-EM4edkA2.mjs → node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs} +195 -2319
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs.map +1 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +29 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +30 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs.map +1 -0
- package/dist/{multipart-parser-aEF5a4Xf.cjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs} +8 -5
- package/dist/{multipart-parser-D65rtMfY.mjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs} +4 -3
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +22 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +18 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +1 -0
- package/dist/{node-Co8KdzkZ.cjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs} +796 -814
- package/dist/{node-D9MigVDD.mjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs} +795 -807
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +11768 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +11764 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +25 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +21 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +20 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +18 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/nypm@0.6.4/node_modules/nypm/dist/index.cjs +194 -0
- package/dist/node_modules/.pnpm/nypm@0.6.4/node_modules/nypm/dist/index.mjs +192 -0
- package/dist/node_modules/.pnpm/nypm@0.6.4/node_modules/nypm/dist/index.mjs.map +1 -0
- package/dist/{dist-BQc8ZRwl.cjs → node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs} +1 -1
- package/dist/{dist-mV5Swt78.mjs → node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs} +1 -1
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.cjs +3 -0
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs +3 -0
- package/dist/{defu-DV5Grr85.mjs → node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs} +8 -43
- package/dist/{defu-CrqNIh1A.cjs → node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs} +2 -90
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +1 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +127 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +126 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +138 -0
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +137 -0
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +629 -0
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +628 -0
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs.map +1 -0
- package/dist/types/index.cjs +9 -10
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/index.mjs +2 -3
- package/dist/types/plugin.cjs +133 -7
- package/dist/types/plugin.d.cts +155 -3
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +155 -3
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +129 -3
- package/dist/types/plugin.mjs.map +1 -0
- package/dist/types/runtime.cjs +242 -3
- package/dist/types/runtime.d.cts +792 -2
- package/dist/{runtime-BDzzR4wH.d.cts.map → types/runtime.d.cts.map} +1 -1
- package/dist/types/runtime.d.mts +792 -2
- package/dist/{runtime-lYSIZdMn.d.mts.map → types/runtime.d.mts.map} +1 -1
- package/dist/types/runtime.mjs +241 -2
- package/dist/types/runtime.mjs.map +1 -0
- package/package.json +9 -9
- package/dist/automd-generator-BpvZRK0k.mjs +0 -32
- package/dist/automd-generator-BpvZRK0k.mjs.map +0 -1
- package/dist/automd-generator-CxG1owAE.cjs +0 -37
- package/dist/babel-BZqmdVF4.cjs +0 -0
- package/dist/babel-DgietUY3.mjs +0 -1
- package/dist/components-BUo6Koax.cjs +0 -0
- package/dist/components-DDFmImcI.mjs +0 -1
- package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs.map +0 -1
- package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs.map +0 -1
- package/dist/create-reflection-resource-3svZm2rY.d.cts +0 -14
- package/dist/create-reflection-resource-3svZm2rY.d.cts.map +0 -1
- package/dist/create-reflection-resource-CCpA76Yq.d.mts +0 -14
- package/dist/create-reflection-resource-CCpA76Yq.d.mts.map +0 -1
- package/dist/create-reflection-resource-D0QrD1Td.mjs +0 -23
- package/dist/create-reflection-resource-D0QrD1Td.mjs.map +0 -1
- package/dist/create-reflection-resource-d2zdTyOE.cjs +0 -27
- package/dist/defu-DV5Grr85.mjs.map +0 -1
- package/dist/dist-C_a6goTt.cjs +0 -15282
- package/dist/dist-CjWvISyq.mjs +0 -15271
- package/dist/dist-CjWvISyq.mjs.map +0 -1
- package/dist/dist-mV5Swt78.mjs.map +0 -1
- package/dist/docs-BAKwE4PJ.d.cts +0 -25
- package/dist/docs-BAKwE4PJ.d.cts.map +0 -1
- package/dist/docs-CVf-w8oz.d.mts +0 -25
- package/dist/docs-CVf-w8oz.d.mts.map +0 -1
- package/dist/docs-E0aCTO7H.cjs +0 -72
- package/dist/docs-WdCIcQmw.mjs +0 -67
- package/dist/docs-WdCIcQmw.mjs.map +0 -1
- package/dist/docs-helper-BSYSI2cH.mjs +0 -24
- package/dist/docs-helper-BSYSI2cH.mjs.map +0 -1
- package/dist/docs-helper-BWe1dt1m.cjs +0 -28
- package/dist/env-BSCEigpj.cjs +0 -593
- package/dist/env-D0KBPuAd.d.mts +0 -23
- package/dist/env-D0KBPuAd.d.mts.map +0 -1
- package/dist/env-DqI7dwC-.mjs +0 -582
- package/dist/env-DqI7dwC-.mjs.map +0 -1
- package/dist/env-DwM7pJm7.d.cts +0 -23
- package/dist/env-DwM7pJm7.d.cts.map +0 -1
- package/dist/helpers-45e1bvAO.mjs +0 -1
- package/dist/helpers-DgYP3uej.cjs +0 -0
- package/dist/index-BNRXMhlr.d.mts +0 -1
- package/dist/index-Bdi8CvaN.d.cts +0 -16
- package/dist/index-Bdi8CvaN.d.cts.map +0 -1
- package/dist/index-CEDY7cmG.d.cts +0 -1
- package/dist/index-CREkvfw9.d.mts +0 -1
- package/dist/index-DSiHnMH2.d.cts +0 -1
- package/dist/index-Drhzdkqe.d.mts +0 -16
- package/dist/index-Drhzdkqe.d.mts.map +0 -1
- package/dist/index-dhjtMp5F.d.mts +0 -1
- package/dist/index-uTS5iDq_.d.cts +0 -1
- package/dist/join-paths-Dd9KxuyL.mjs.map +0 -1
- package/dist/json5-jq90mF9X.mjs.map +0 -1
- package/dist/jsonc-CBh70baJ.cjs +0 -4
- package/dist/jsonc-CDLU6bgi.mjs +0 -4
- package/dist/load-EM4edkA2.mjs.map +0 -1
- package/dist/load-GpP6cojj.d.mts +0 -36
- package/dist/load-GpP6cojj.d.mts.map +0 -1
- package/dist/load-PHGmxX_X.d.cts +0 -36
- package/dist/load-PHGmxX_X.d.cts.map +0 -1
- package/dist/multipart-parser-D65rtMfY.mjs.map +0 -1
- package/dist/node-D9MigVDD.mjs.map +0 -1
- package/dist/persistence-5S3EirDm.mjs +0 -586
- package/dist/persistence-5S3EirDm.mjs.map +0 -1
- package/dist/persistence-BR4cUaN6.d.cts +0 -85
- package/dist/persistence-BR4cUaN6.d.cts.map +0 -1
- package/dist/persistence-DrKQZNCv.d.mts +0 -85
- package/dist/persistence-DrKQZNCv.d.mts.map +0 -1
- package/dist/persistence-DzS7SzMj.cjs +0 -712
- package/dist/plugin-CM1TSv1B.cjs +0 -159
- package/dist/plugin-CSVnrdpE.cjs +0 -146
- package/dist/plugin-CSe5f2cD.d.cts +0 -155
- package/dist/plugin-CSe5f2cD.d.cts.map +0 -1
- package/dist/plugin-DMbVjdcQ.d.mts +0 -155
- package/dist/plugin-DMbVjdcQ.d.mts.map +0 -1
- package/dist/plugin-Vyvy9w9Z.mjs +0 -141
- package/dist/plugin-Vyvy9w9Z.mjs.map +0 -1
- package/dist/plugin-eBjQJP6x.mjs +0 -130
- package/dist/plugin-eBjQJP6x.mjs.map +0 -1
- package/dist/reflect-Dm8a3c29.d.cts +0 -47
- package/dist/reflect-Dm8a3c29.d.cts.map +0 -1
- package/dist/reflect-Dpz8ifa0.d.mts +0 -47
- package/dist/reflect-Dpz8ifa0.d.mts.map +0 -1
- package/dist/runtime-BDzzR4wH.d.cts +0 -792
- package/dist/runtime-C5ukCv3P.mjs +0 -242
- package/dist/runtime-C5ukCv3P.mjs.map +0 -1
- package/dist/runtime-g0TEIoZK.cjs +0 -253
- package/dist/runtime-lYSIZdMn.d.mts +0 -792
- package/dist/source-file-env-4Vdtzc5-.cjs +0 -68
- package/dist/source-file-env-Brfopjyr.d.cts +0 -9
- package/dist/source-file-env-Brfopjyr.d.cts.map +0 -1
- package/dist/source-file-env-DWejSP2U.d.mts +0 -9
- package/dist/source-file-env-DWejSP2U.d.mts.map +0 -1
- package/dist/source-file-env-Tj-6qobx.mjs +0 -57
- package/dist/source-file-env-Tj-6qobx.mjs.map +0 -1
- package/dist/template-helpers-1SKodHKt.d.mts +0 -16
- package/dist/template-helpers-1SKodHKt.d.mts.map +0 -1
- package/dist/template-helpers-Cw8aba1r.mjs +0 -70
- package/dist/template-helpers-Cw8aba1r.mjs.map +0 -1
- package/dist/template-helpers-DoFoTIAC.cjs +0 -75
- package/dist/template-helpers-zyitPfMz.d.cts +0 -16
- package/dist/template-helpers-zyitPfMz.d.cts.map +0 -1
- package/dist/toml-uuOYvEAO.mjs.map +0 -1
- package/dist/types-DyPQho_C.mjs +0 -1
- package/dist/types-o3zWarRp.cjs +0 -0
- package/dist/yaml-CIn2Gddw.mjs.map +0 -1
|
@@ -1,6 +1,311 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
1
|
+
import { __ΩEnvPluginContext, __ΩEnvPluginResolvedConfig, __ΩEnvType } from "../types/plugin.mjs";
|
|
2
|
+
import { joinPaths } from "../node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs";
|
|
3
|
+
import { createEnvReflection } from "./reflect.mjs";
|
|
4
|
+
import { ReflectionClass, ReflectionKind, deserializeType, resolveClassType } from "@powerlines/deepkit/vendor/type";
|
|
5
|
+
import { __ΩContext, __ΩUnresolvedContext } from "powerlines/types/context";
|
|
6
|
+
import { convertFromCapnp, convertToCapnp } from "@powerlines/deepkit/capnp";
|
|
7
|
+
import { getReflectionsPath } from "@powerlines/deepkit/resolve-reflections";
|
|
8
|
+
import { SerializedTypes } from "@powerlines/deepkit/schemas/reflection";
|
|
9
|
+
import * as capnp from "@stryke/capnp";
|
|
10
|
+
import { readFileBuffer, writeFileBuffer, writeFileBufferSync } from "@stryke/fs/buffer";
|
|
11
|
+
import { isEmptyObject } from "@stryke/type-checks/is-empty-object";
|
|
12
|
+
import { existsSync } from "node:fs";
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
//#region src/helpers/persistence.ts
|
|
15
|
+
/**
|
|
16
|
+
* Resolves the runtime type definition file for the environment variables.
|
|
17
|
+
*
|
|
18
|
+
* @param context - The plugin context.
|
|
19
|
+
* @returns The runtime type definition file for the environment variables.
|
|
20
|
+
*/
|
|
21
|
+
async function resolveRuntimeTypeFile(context) {
|
|
22
|
+
const resolved = await context.fs.resolve("@powerlines/plugin-env/types/runtime");
|
|
23
|
+
if (!resolved) throw new Error(`Failed to resolve the runtime type definition file for the environment variables. Please ensure that the "@powerlines/plugin-env" package is installed.`);
|
|
24
|
+
return resolved;
|
|
25
|
+
}
|
|
26
|
+
resolveRuntimeTypeFile.__type = [
|
|
27
|
+
() => __ΩUnresolvedContext,
|
|
28
|
+
() => __ΩEnvPluginResolvedConfig,
|
|
29
|
+
"context",
|
|
30
|
+
"resolveRuntimeTypeFile",
|
|
31
|
+
"Resolves the runtime type definition file for the environment variables.",
|
|
32
|
+
"Pn\"o!\"2#&`/$?%"
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Gets the default type definition for the environment variables.
|
|
36
|
+
*
|
|
37
|
+
* @param context - The plugin context.
|
|
38
|
+
* @returns The default type definition for the environment variables.
|
|
39
|
+
*/
|
|
40
|
+
async function getEnvDefaultTypeDefinition(context) {
|
|
41
|
+
return {
|
|
42
|
+
file: await resolveRuntimeTypeFile(context),
|
|
43
|
+
name: "EnvInterface"
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
getEnvDefaultTypeDefinition.__type = [
|
|
47
|
+
() => __ΩUnresolvedContext,
|
|
48
|
+
() => __ΩEnvPluginResolvedConfig,
|
|
49
|
+
"context",
|
|
50
|
+
"getEnvDefaultTypeDefinition",
|
|
51
|
+
"Gets the default type definition for the environment variables.",
|
|
52
|
+
"Pn\"o!\"2#!`/$?%"
|
|
53
|
+
];
|
|
54
|
+
/** Gets the default type definition for the environment secrets.
|
|
55
|
+
*
|
|
56
|
+
* @param context - The plugin context.
|
|
57
|
+
* @returns The default type definition for the environment secrets.
|
|
58
|
+
*/
|
|
59
|
+
async function getSecretsDefaultTypeDefinition(context) {
|
|
60
|
+
return {
|
|
61
|
+
file: await resolveRuntimeTypeFile(context),
|
|
62
|
+
name: "SecretsInterface"
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
getSecretsDefaultTypeDefinition.__type = [
|
|
66
|
+
() => __ΩUnresolvedContext,
|
|
67
|
+
() => __ΩEnvPluginResolvedConfig,
|
|
68
|
+
"context",
|
|
69
|
+
"getSecretsDefaultTypeDefinition",
|
|
70
|
+
"Pn\"o!\"2#!`/$"
|
|
71
|
+
];
|
|
72
|
+
/**
|
|
73
|
+
* Gets the path to the environment type reflections.
|
|
74
|
+
*
|
|
75
|
+
* @param context - The plugin context.
|
|
76
|
+
* @param name - The name of the type reflections.
|
|
77
|
+
* @returns The path to the environment type reflections.
|
|
78
|
+
*/
|
|
79
|
+
function getEnvTypeReflectionsPath(context, name = "env") {
|
|
80
|
+
return joinPaths(getReflectionsPath(context), "env", `${name}-types.bin`);
|
|
81
|
+
}
|
|
82
|
+
getEnvTypeReflectionsPath.__type = [
|
|
83
|
+
() => __ΩContext,
|
|
84
|
+
() => __ΩEnvPluginResolvedConfig,
|
|
85
|
+
"context",
|
|
86
|
+
() => __ΩEnvType,
|
|
87
|
+
"name",
|
|
88
|
+
() => "env",
|
|
89
|
+
"getEnvTypeReflectionsPath",
|
|
90
|
+
"Gets the path to the environment type reflections.",
|
|
91
|
+
"Pn\"o!\"2#n$2%>&&/'?("
|
|
92
|
+
];
|
|
93
|
+
/**
|
|
94
|
+
* Reads the environment type reflection from the file system.
|
|
95
|
+
*
|
|
96
|
+
* @param context - The plugin context.
|
|
97
|
+
* @param name - The name of the type reflections.
|
|
98
|
+
* @returns The environment type reflection.
|
|
99
|
+
*/
|
|
100
|
+
async function readEnvTypeReflection(context, name = "env") {
|
|
101
|
+
const filePath = getEnvTypeReflectionsPath(context, name);
|
|
102
|
+
if (!existsSync(filePath)) {
|
|
103
|
+
if (!context.env.types.env || isEmptyObject(context.env.types.env)) {
|
|
104
|
+
const reflection$1 = createEnvReflection(context);
|
|
105
|
+
const message = new capnp.Message();
|
|
106
|
+
reflection$1.messageRoot = message.initRoot(SerializedTypes);
|
|
107
|
+
reflection$1.dataBuffer = message.toArrayBuffer();
|
|
108
|
+
context.env.types.env = reflection$1;
|
|
109
|
+
await writeEnvTypeReflection(context, context.env.types.env, name);
|
|
110
|
+
}
|
|
111
|
+
return context.env.types.env;
|
|
112
|
+
}
|
|
113
|
+
const buffer = await readFileBuffer(filePath);
|
|
114
|
+
const messageRoot = new capnp.Message(buffer, false).getRoot(SerializedTypes);
|
|
115
|
+
const reflection = resolveClassType(deserializeType(convertFromCapnp(messageRoot.types)));
|
|
116
|
+
context.env.types[name] = reflection;
|
|
117
|
+
context.env.types[name].messageRoot = messageRoot;
|
|
118
|
+
context.env.types[name].dataBuffer = buffer;
|
|
119
|
+
return reflection;
|
|
120
|
+
}
|
|
121
|
+
readEnvTypeReflection.__type = [
|
|
122
|
+
() => __ΩEnvPluginContext,
|
|
123
|
+
"context",
|
|
124
|
+
() => __ΩEnvType,
|
|
125
|
+
"name",
|
|
126
|
+
() => "env",
|
|
127
|
+
() => ReflectionClass,
|
|
128
|
+
"readEnvTypeReflection",
|
|
129
|
+
"Reads the environment type reflection from the file system.",
|
|
130
|
+
"Pn!2\"n#2$>%P\"7&`/'?("
|
|
131
|
+
];
|
|
132
|
+
/**
|
|
133
|
+
* Writes the environment type reflection to the file system.
|
|
134
|
+
*
|
|
135
|
+
* @param context - The plugin context.
|
|
136
|
+
* @param reflection - The environment type reflection to write.
|
|
137
|
+
* @param name - The name of the type reflections.
|
|
138
|
+
*/
|
|
139
|
+
async function writeEnvTypeReflection(context, reflection, name = "env") {
|
|
140
|
+
const serialized = reflection.serializeType();
|
|
141
|
+
const message = new capnp.Message();
|
|
142
|
+
convertToCapnp(serialized, message.initRoot(SerializedTypes)._initTypes(serialized.length));
|
|
143
|
+
await writeFileBuffer(getEnvTypeReflectionsPath(context, name), message.toArrayBuffer());
|
|
144
|
+
}
|
|
145
|
+
writeEnvTypeReflection.__type = [
|
|
146
|
+
() => __ΩEnvPluginContext,
|
|
147
|
+
"context",
|
|
148
|
+
() => ReflectionClass,
|
|
149
|
+
"reflection",
|
|
150
|
+
() => __ΩEnvType,
|
|
151
|
+
"name",
|
|
152
|
+
() => "env",
|
|
153
|
+
"writeEnvTypeReflection",
|
|
154
|
+
"Writes the environment type reflection to the file system.",
|
|
155
|
+
"Pn!2\"P\"7#2$n%2&>'\"/(?)"
|
|
156
|
+
];
|
|
157
|
+
function getEnvReflectionsPath(context, name) {
|
|
158
|
+
return joinPaths(getReflectionsPath(context), "env", `${name}.bin`);
|
|
159
|
+
}
|
|
160
|
+
getEnvReflectionsPath.__type = [
|
|
161
|
+
() => __ΩEnvPluginContext,
|
|
162
|
+
"context",
|
|
163
|
+
() => __ΩEnvType,
|
|
164
|
+
"name",
|
|
165
|
+
"getEnvReflectionsPath",
|
|
166
|
+
"Pn!2\"n#2$&/%"
|
|
167
|
+
];
|
|
168
|
+
/**
|
|
169
|
+
* Reads the environment reflection data from the file system.
|
|
170
|
+
*
|
|
171
|
+
* @param context - The plugin context.
|
|
172
|
+
* @returns The environment reflection data.
|
|
173
|
+
*/
|
|
174
|
+
async function readEnvReflection(context) {
|
|
175
|
+
const filePath = getEnvReflectionsPath(context, "env");
|
|
176
|
+
if (!existsSync(filePath)) {
|
|
177
|
+
if (!context.env.types.env) context.env.types.env = await readEnvTypeReflection(context, "env");
|
|
178
|
+
if (!context.env.used.env || isEmptyObject(context.env.used.env)) {
|
|
179
|
+
const reflection$1 = createEnvReflection(context, {
|
|
180
|
+
type: {
|
|
181
|
+
kind: ReflectionKind.objectLiteral,
|
|
182
|
+
typeName: "Env",
|
|
183
|
+
description: `An object containing the environment configuration parameters that are used (at least once) by the ${context.config.name ? `${context.config.name} application` : "application"}.`,
|
|
184
|
+
types: []
|
|
185
|
+
},
|
|
186
|
+
superReflection: context.env.types.env
|
|
187
|
+
});
|
|
188
|
+
reflection$1.name = "Env";
|
|
189
|
+
const message = new capnp.Message();
|
|
190
|
+
reflection$1.messageRoot = message.initRoot(SerializedTypes);
|
|
191
|
+
reflection$1.dataBuffer = message.toArrayBuffer();
|
|
192
|
+
context.env.used.env = reflection$1;
|
|
193
|
+
await writeEnvReflection(context, context.env.used.env, "env");
|
|
194
|
+
}
|
|
195
|
+
return context.env.used.env;
|
|
196
|
+
}
|
|
197
|
+
const buffer = await readFileBuffer(filePath);
|
|
198
|
+
const messageRoot = new capnp.Message(buffer, false).getRoot(SerializedTypes);
|
|
199
|
+
const reflection = resolveClassType(deserializeType(convertFromCapnp(messageRoot.types)));
|
|
200
|
+
context.env.used.env = reflection;
|
|
201
|
+
context.env.used.env.messageRoot = messageRoot;
|
|
202
|
+
context.env.used.env.dataBuffer = buffer;
|
|
203
|
+
return reflection;
|
|
204
|
+
}
|
|
205
|
+
readEnvReflection.__type = [
|
|
206
|
+
() => __ΩEnvPluginContext,
|
|
207
|
+
"context",
|
|
208
|
+
() => ReflectionClass,
|
|
209
|
+
"readEnvReflection",
|
|
210
|
+
"Reads the environment reflection data from the file system.",
|
|
211
|
+
"Pn!2\"P\"7#`/$?%"
|
|
212
|
+
];
|
|
213
|
+
/**
|
|
214
|
+
* Reads the secret environment reflection data from the file system.
|
|
215
|
+
*
|
|
216
|
+
* @param context - The plugin context.
|
|
217
|
+
* @returns The environment reflection data.
|
|
218
|
+
*/
|
|
219
|
+
async function readSecretsReflection(context) {
|
|
220
|
+
const filePath = getEnvReflectionsPath(context, "secrets");
|
|
221
|
+
if (!existsSync(filePath)) {
|
|
222
|
+
if (!context.env.types.secrets) context.env.types.secrets = await readEnvTypeReflection(context, "secrets");
|
|
223
|
+
if (!context.env.used.secrets || isEmptyObject(context.env.used.secrets)) {
|
|
224
|
+
const reflection$1 = createEnvReflection(context, {
|
|
225
|
+
type: {
|
|
226
|
+
kind: ReflectionKind.objectLiteral,
|
|
227
|
+
typeName: "Secrets",
|
|
228
|
+
description: `An object containing the secret configuration parameters that are used (at least once) by the ${context.config.name ? `${context.config.name} application` : "application"}.`,
|
|
229
|
+
types: []
|
|
230
|
+
},
|
|
231
|
+
superReflection: context.env.types.secrets
|
|
232
|
+
});
|
|
233
|
+
reflection$1.name = "Secrets";
|
|
234
|
+
const message = new capnp.Message();
|
|
235
|
+
reflection$1.messageRoot = message.initRoot(SerializedTypes);
|
|
236
|
+
reflection$1.dataBuffer = message.toArrayBuffer();
|
|
237
|
+
context.env.used.secrets = reflection$1;
|
|
238
|
+
await writeEnvReflection(context, context.env.used.secrets, "secrets");
|
|
239
|
+
}
|
|
240
|
+
return context.env.used.secrets;
|
|
241
|
+
}
|
|
242
|
+
const buffer = await readFileBuffer(filePath);
|
|
243
|
+
const messageRoot = new capnp.Message(buffer, false).getRoot(SerializedTypes);
|
|
244
|
+
const reflection = resolveClassType(deserializeType(convertFromCapnp(messageRoot.types)));
|
|
245
|
+
context.env.used.secrets = reflection;
|
|
246
|
+
context.env.used.secrets.messageRoot = messageRoot;
|
|
247
|
+
context.env.used.secrets.dataBuffer = buffer;
|
|
248
|
+
return reflection;
|
|
249
|
+
}
|
|
250
|
+
readSecretsReflection.__type = [
|
|
251
|
+
() => __ΩEnvPluginContext,
|
|
252
|
+
"context",
|
|
253
|
+
() => ReflectionClass,
|
|
254
|
+
"readSecretsReflection",
|
|
255
|
+
"Reads the secret environment reflection data from the file system.",
|
|
256
|
+
"Pn!2\"P\"7#`/$?%"
|
|
257
|
+
];
|
|
258
|
+
/**
|
|
259
|
+
* Writes the environment reflection data to the file system.
|
|
260
|
+
*
|
|
261
|
+
* @param context - The plugin context.
|
|
262
|
+
* @param reflection - The reflection data to write.
|
|
263
|
+
* @param name - The name of the reflection (either "env" or "secrets").
|
|
264
|
+
*/
|
|
265
|
+
async function writeEnvReflection(context, reflection, name = "env") {
|
|
266
|
+
const serialized = reflection.serializeType();
|
|
267
|
+
const message = new capnp.Message();
|
|
268
|
+
convertToCapnp(serialized, message.initRoot(SerializedTypes)._initTypes(serialized.length));
|
|
269
|
+
await writeFileBuffer(getEnvReflectionsPath(context, name), message.toArrayBuffer());
|
|
270
|
+
}
|
|
271
|
+
writeEnvReflection.__type = [
|
|
272
|
+
() => __ΩEnvPluginContext,
|
|
273
|
+
"context",
|
|
274
|
+
() => ReflectionClass,
|
|
275
|
+
"reflection",
|
|
276
|
+
() => __ΩEnvType,
|
|
277
|
+
"name",
|
|
278
|
+
() => "env",
|
|
279
|
+
"writeEnvReflection",
|
|
280
|
+
"Writes the environment reflection data to the file system.",
|
|
281
|
+
"Pn!2\"P\"7#2$n%2&>'\"/(?)"
|
|
282
|
+
];
|
|
283
|
+
/**
|
|
284
|
+
* Writes the environment reflection data to the file system.
|
|
285
|
+
*
|
|
286
|
+
* @param context - The plugin context.
|
|
287
|
+
* @param reflection - The reflection data to write.
|
|
288
|
+
* @param name - The name of the reflection (either "env" or "secrets").
|
|
289
|
+
*/
|
|
290
|
+
function writeEnvReflectionSync(context, reflection, name = "env") {
|
|
291
|
+
const serialized = reflection.serializeType();
|
|
292
|
+
const message = new capnp.Message();
|
|
293
|
+
convertToCapnp(serialized, message.initRoot(SerializedTypes)._initTypes(serialized.length));
|
|
294
|
+
writeFileBufferSync(getEnvReflectionsPath(context, name), message.toArrayBuffer());
|
|
295
|
+
}
|
|
296
|
+
writeEnvReflectionSync.__type = [
|
|
297
|
+
() => __ΩEnvPluginContext,
|
|
298
|
+
"context",
|
|
299
|
+
() => ReflectionClass,
|
|
300
|
+
"reflection",
|
|
301
|
+
() => __ΩEnvType,
|
|
302
|
+
"name",
|
|
303
|
+
() => "env",
|
|
304
|
+
"writeEnvReflectionSync",
|
|
305
|
+
"Writes the environment reflection data to the file system.",
|
|
306
|
+
"Pn!2\"P\"7#2$n%2&>'\"/(?)"
|
|
307
|
+
];
|
|
308
|
+
|
|
309
|
+
//#endregion
|
|
310
|
+
export { getEnvDefaultTypeDefinition, getEnvReflectionsPath, getEnvTypeReflectionsPath, getSecretsDefaultTypeDefinition, readEnvReflection, readEnvTypeReflection, readSecretsReflection, resolveRuntimeTypeFile, writeEnvReflection, writeEnvReflectionSync, writeEnvTypeReflection };
|
|
311
|
+
//# sourceMappingURL=persistence.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence.mjs","names":[],"sources":["../../src/helpers/persistence.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 { convertFromCapnp, convertToCapnp } from \"@powerlines/deepkit/capnp\";\nimport { getReflectionsPath } from \"@powerlines/deepkit/resolve-reflections\";\nimport { SerializedTypes } from \"@powerlines/deepkit/schemas/reflection\";\nimport { Reflection } from \"@powerlines/deepkit/types\";\nimport {\n deserializeType,\n ReflectionClass,\n ReflectionKind,\n resolveClassType\n} from \"@powerlines/deepkit/vendor/type\";\nimport * as capnp from \"@stryke/capnp\";\nimport {\n readFileBuffer,\n writeFileBuffer,\n writeFileBufferSync\n} from \"@stryke/fs/buffer\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isEmptyObject } from \"@stryke/type-checks/is-empty-object\";\nimport type { TypeDefinition } from \"@stryke/types/configuration\";\nimport { existsSync } from \"node:fs\";\nimport { Context, UnresolvedContext } from \"powerlines/types/context\";\nimport {\n EnvPluginContext,\n EnvPluginResolvedConfig,\n EnvType\n} from \"../types/plugin\";\nimport { createEnvReflection } from \"./reflect\";\n\n/**\n * Resolves the runtime type definition file for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The runtime type definition file for the environment variables.\n */\nexport async function resolveRuntimeTypeFile(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<string> {\n const resolved = await context.fs.resolve(\n \"@powerlines/plugin-env/types/runtime\"\n );\n if (!resolved) {\n throw new Error(\n `Failed to resolve the runtime type definition file for the environment variables. Please ensure that the \"@powerlines/plugin-env\" package is installed.`\n );\n }\n\n return resolved;\n}\n\n/**\n * Gets the default type definition for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment variables.\n */\nexport async function getEnvDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"EnvInterface\"\n };\n}\n\n/** Gets the default type definition for the environment secrets.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment secrets.\n */\nexport async function getSecretsDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"SecretsInterface\"\n };\n}\n\n/**\n * Gets the path to the environment type reflections.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The path to the environment type reflections.\n */\nexport function getEnvTypeReflectionsPath(\n context: Context<EnvPluginResolvedConfig>,\n name: EnvType = \"env\"\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}-types.bin`);\n}\n\n/**\n * Reads the environment type reflection from the file system.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The environment type reflection.\n */\nexport async function readEnvTypeReflection(\n context: EnvPluginContext,\n name: EnvType = \"env\"\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvTypeReflectionsPath(context, name);\n if (!existsSync(filePath)) {\n if (!context.env.types.env || isEmptyObject(context.env.types.env)) {\n const reflection = createEnvReflection(context) as Reflection;\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.types.env = reflection;\n await writeEnvTypeReflection(context, context.env.types.env, name);\n }\n\n return context.env.types.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.types[name] = reflection;\n context.env.types[name].messageRoot = messageRoot;\n context.env.types[name].dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment type reflection to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The environment type reflection to write.\n * @param name - The name of the type reflections.\n */\nexport async function writeEnvTypeReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvTypeReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\nexport function getEnvReflectionsPath(\n context: EnvPluginContext,\n name: EnvType\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}.bin`);\n}\n\n/**\n * Reads the environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readEnvReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"env\");\n if (!existsSync(filePath)) {\n if (!context.env.types.env) {\n context.env.types.env = await readEnvTypeReflection(context, \"env\");\n }\n\n if (!context.env.used.env || isEmptyObject(context.env.used.env)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.env\n }) as Reflection;\n reflection.name = \"Env\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.env = reflection;\n await writeEnvReflection(context, context.env.used.env, \"env\");\n }\n\n return context.env.used.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.env = reflection;\n context.env.used.env.messageRoot = messageRoot;\n context.env.used.env.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Reads the secret environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readSecretsReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"secrets\");\n if (!existsSync(filePath)) {\n if (!context.env.types.secrets) {\n context.env.types.secrets = await readEnvTypeReflection(\n context,\n \"secrets\"\n );\n }\n\n if (!context.env.used.secrets || isEmptyObject(context.env.used.secrets)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.secrets\n }) as Reflection;\n reflection.name = \"Secrets\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.secrets = reflection;\n await writeEnvReflection(context, context.env.used.secrets, \"secrets\");\n }\n\n return context.env.used.secrets;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.secrets = reflection;\n context.env.used.secrets.messageRoot = messageRoot;\n context.env.used.secrets.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport async function writeEnvReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport function writeEnvReflectionSync(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n writeFileBufferSync(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n"],"mappings":"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"}
|
package/dist/helpers/reflect.cjs
CHANGED
|
@@ -1,14 +1,263 @@
|
|
|
1
|
-
require('../
|
|
2
|
-
require('../
|
|
3
|
-
require('../
|
|
4
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_types_runtime = require('../types/runtime.cjs');
|
|
3
|
+
const require_types_plugin = require('../types/plugin.cjs');
|
|
4
|
+
const require_join_paths = require('../node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.cjs');
|
|
5
|
+
const require_is_parent_path = require('../node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-parent-path.cjs');
|
|
6
|
+
const require_helpers_persistence = require('./persistence.cjs');
|
|
7
|
+
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
8
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
9
|
+
let __powerlines_deepkit_reflect_type = require("@powerlines/deepkit/reflect-type");
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
//#region src/helpers/reflect.ts
|
|
12
|
+
function __assignType(fn, args) {
|
|
13
|
+
fn.__type = args;
|
|
14
|
+
return fn;
|
|
15
|
+
}
|
|
16
|
+
function mergeEnvReflections(context, reflections) {
|
|
17
|
+
return createEnvReflection(context, { type: (0, __powerlines_deepkit_vendor_type.merge)(reflections.map(__assignType((reflection) => reflection.type, [
|
|
18
|
+
"reflection",
|
|
19
|
+
"",
|
|
20
|
+
"P\"2!\"/\""
|
|
21
|
+
]))) });
|
|
22
|
+
}
|
|
23
|
+
mergeEnvReflections.__type = [
|
|
24
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
25
|
+
"context",
|
|
26
|
+
() => __powerlines_deepkit_vendor_type.ReflectionClass,
|
|
27
|
+
"reflections",
|
|
28
|
+
() => __powerlines_deepkit_vendor_type.ReflectionClass,
|
|
29
|
+
"mergeEnvReflections",
|
|
30
|
+
"Pn!2\"P\"7#F2$P\"7%/&"
|
|
31
|
+
];
|
|
32
|
+
function mergeSecretsReflections(context, reflections) {
|
|
33
|
+
return createSecretsReflection(context, { type: (0, __powerlines_deepkit_vendor_type.merge)(reflections.map(__assignType((reflection) => reflection.type, [
|
|
34
|
+
"reflection",
|
|
35
|
+
"",
|
|
36
|
+
"P\"2!\"/\""
|
|
37
|
+
]))) });
|
|
38
|
+
}
|
|
39
|
+
mergeSecretsReflections.__type = [
|
|
40
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
41
|
+
"context",
|
|
42
|
+
() => __powerlines_deepkit_vendor_type.ReflectionClass,
|
|
43
|
+
"reflections",
|
|
44
|
+
() => __powerlines_deepkit_vendor_type.ReflectionClass,
|
|
45
|
+
"mergeSecretsReflections",
|
|
46
|
+
"Pn!2\"P\"7#F2$P\"7%/&"
|
|
47
|
+
];
|
|
48
|
+
const __ΩCreateEnvReflectionOptions = [
|
|
49
|
+
() => __powerlines_deepkit_vendor_type.__ΩTypeObjectLiteral,
|
|
50
|
+
() => __powerlines_deepkit_vendor_type.__ΩTypeClass,
|
|
51
|
+
"type",
|
|
52
|
+
() => __powerlines_deepkit_vendor_type.ReflectionClass,
|
|
53
|
+
"superReflection",
|
|
54
|
+
"CreateEnvReflectionOptions",
|
|
55
|
+
"PPn!n\"J4#8P\"7$4%8Mw&y"
|
|
56
|
+
];
|
|
57
|
+
var BaseEnv = class {
|
|
58
|
+
PLATFORM = "neutral";
|
|
59
|
+
MODE = "production";
|
|
60
|
+
DEBUG = false;
|
|
61
|
+
TEST = false;
|
|
62
|
+
MINIMAL = false;
|
|
63
|
+
NO_COLOR = false;
|
|
64
|
+
FORCE_COLOR = false;
|
|
65
|
+
FORCE_HYPERLINK = false;
|
|
66
|
+
STACKTRACE = false;
|
|
67
|
+
INCLUDE_ERROR_DATA = false;
|
|
68
|
+
CI = false;
|
|
69
|
+
static __type = [
|
|
70
|
+
"APP_NAME",
|
|
71
|
+
"APP_VERSION",
|
|
72
|
+
"BUILD_ID",
|
|
73
|
+
"BUILD_TIMESTAMP",
|
|
74
|
+
"BUILD_CHECKSUM",
|
|
75
|
+
"RELEASE_ID",
|
|
76
|
+
"RELEASE_TAG",
|
|
77
|
+
"ORGANIZATION",
|
|
78
|
+
"node",
|
|
79
|
+
"browser",
|
|
80
|
+
"neutral",
|
|
81
|
+
"PLATFORM",
|
|
82
|
+
function() {
|
|
83
|
+
return "neutral";
|
|
84
|
+
},
|
|
85
|
+
"development",
|
|
86
|
+
"test",
|
|
87
|
+
"production",
|
|
88
|
+
"MODE",
|
|
89
|
+
function() {
|
|
90
|
+
return "production";
|
|
91
|
+
},
|
|
92
|
+
"ENVIRONMENT",
|
|
93
|
+
"DEBUG",
|
|
94
|
+
function() {
|
|
95
|
+
return false;
|
|
96
|
+
},
|
|
97
|
+
"TEST",
|
|
98
|
+
function() {
|
|
99
|
+
return false;
|
|
100
|
+
},
|
|
101
|
+
"MINIMAL",
|
|
102
|
+
function() {
|
|
103
|
+
return false;
|
|
104
|
+
},
|
|
105
|
+
"NO_COLOR",
|
|
106
|
+
function() {
|
|
107
|
+
return false;
|
|
108
|
+
},
|
|
109
|
+
"FORCE_COLOR",
|
|
110
|
+
function() {
|
|
111
|
+
return false;
|
|
112
|
+
},
|
|
113
|
+
"FORCE_HYPERLINK",
|
|
114
|
+
function() {
|
|
115
|
+
return false;
|
|
116
|
+
},
|
|
117
|
+
"STACKTRACE",
|
|
118
|
+
function() {
|
|
119
|
+
return false;
|
|
120
|
+
},
|
|
121
|
+
"INCLUDE_ERROR_DATA",
|
|
122
|
+
function() {
|
|
123
|
+
return false;
|
|
124
|
+
},
|
|
125
|
+
"ERROR_URL",
|
|
126
|
+
"DEFAULT_TIMEZONE",
|
|
127
|
+
"DEFAULT_LOCALE",
|
|
128
|
+
"CI",
|
|
129
|
+
function() {
|
|
130
|
+
return false;
|
|
131
|
+
},
|
|
132
|
+
() => require_types_runtime.__ΩEnvInterface,
|
|
133
|
+
"BaseEnv",
|
|
134
|
+
"&3!&3\"&3#&3$&3%&3&&3'&3(P.).*.+J3,>-P.../.0J31>2&33)34>5)36>7)38>9)3:>;P')J3<>=P')J3>>?)3@>A)3B>C&3D&3E&3F)3G>H5nIx\"wJ"
|
|
135
|
+
];
|
|
136
|
+
};
|
|
137
|
+
var BaseSecrets = class {
|
|
138
|
+
static __type = [
|
|
139
|
+
"ENCRYPTION_KEY",
|
|
140
|
+
() => require_types_runtime.__ΩSecretsInterface,
|
|
141
|
+
"BaseSecrets",
|
|
142
|
+
"&3!5n\"x\"w#"
|
|
143
|
+
];
|
|
144
|
+
};
|
|
145
|
+
function createEnvReflection(context, options = {}) {
|
|
146
|
+
const parent = options.superReflection ?? new __powerlines_deepkit_vendor_type.ReflectionClass({
|
|
147
|
+
kind: __powerlines_deepkit_vendor_type.ReflectionKind.class,
|
|
148
|
+
description: `The base environment configuration definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
|
|
149
|
+
classType: BaseEnv,
|
|
150
|
+
types: [],
|
|
151
|
+
implements: [{
|
|
152
|
+
kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
153
|
+
typeName: "EnvInterface",
|
|
154
|
+
description: `The environment configuration interface definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
|
|
155
|
+
types: []
|
|
156
|
+
}]
|
|
157
|
+
});
|
|
158
|
+
parent.name = "Env";
|
|
159
|
+
const result = new __powerlines_deepkit_vendor_type.ReflectionClass(options.type ?? {
|
|
160
|
+
kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
161
|
+
typeName: "Env",
|
|
162
|
+
description: `A schema describing the list of available environment variables that can be used by the ${context.config.name ? `${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} application` : "application"}.`,
|
|
163
|
+
types: []
|
|
164
|
+
}, parent);
|
|
165
|
+
result.name = "Env";
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
createEnvReflection.__type = [
|
|
169
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
170
|
+
"context",
|
|
171
|
+
() => __ΩCreateEnvReflectionOptions,
|
|
172
|
+
"options",
|
|
173
|
+
() => ({}),
|
|
174
|
+
() => __powerlines_deepkit_vendor_type.ReflectionClass,
|
|
175
|
+
"createEnvReflection",
|
|
176
|
+
"Pn!2\"n#2$>%P\"7&/'"
|
|
177
|
+
];
|
|
178
|
+
function createSecretsReflection(context, options = {}) {
|
|
179
|
+
const parent = options.superReflection ?? new __powerlines_deepkit_vendor_type.ReflectionClass({
|
|
180
|
+
kind: __powerlines_deepkit_vendor_type.ReflectionKind.class,
|
|
181
|
+
description: `The base secrets configuration definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
|
|
182
|
+
classType: BaseSecrets,
|
|
183
|
+
types: [],
|
|
184
|
+
implements: [{
|
|
185
|
+
kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
186
|
+
typeName: "SecretsInterface",
|
|
187
|
+
description: `The secrets configuration interface definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
|
|
188
|
+
types: []
|
|
189
|
+
}]
|
|
190
|
+
});
|
|
191
|
+
parent.name = "Secrets";
|
|
192
|
+
const result = new __powerlines_deepkit_vendor_type.ReflectionClass(options.type ?? {
|
|
193
|
+
kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
194
|
+
typeName: "Secrets",
|
|
195
|
+
description: `A schema describing the list of available environment secrets that can be used by the ${context.config.name ? `${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} application` : "application"}.`,
|
|
196
|
+
types: []
|
|
197
|
+
}, parent);
|
|
198
|
+
result.name = "Secrets";
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
createSecretsReflection.__type = [
|
|
202
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
203
|
+
"context",
|
|
204
|
+
() => __ΩCreateEnvReflectionOptions,
|
|
205
|
+
"options",
|
|
206
|
+
() => ({}),
|
|
207
|
+
() => __powerlines_deepkit_vendor_type.ReflectionClass,
|
|
208
|
+
"createSecretsReflection",
|
|
209
|
+
"Pn!2\"n#2$>%P\"7&/'"
|
|
210
|
+
];
|
|
211
|
+
async function reflectEnv(context, file, name) {
|
|
212
|
+
let config;
|
|
213
|
+
if (file) config = (0, __powerlines_deepkit_vendor_type.resolveClassType)(await (0, __powerlines_deepkit_reflect_type.reflectType)(context, {
|
|
214
|
+
file: !require_is_parent_path.isParentPath(file, context.workspaceConfig.workspaceRoot) ? require_join_paths.joinPaths(context.workspaceConfig.workspaceRoot, file) : file,
|
|
215
|
+
name
|
|
216
|
+
}));
|
|
217
|
+
const defaultConfigType = await (0, __powerlines_deepkit_reflect_type.reflectType)(context, await require_helpers_persistence.getEnvDefaultTypeDefinition(context));
|
|
218
|
+
return mergeEnvReflections(context, [
|
|
219
|
+
await require_helpers_persistence.readEnvTypeReflection(context, "env"),
|
|
220
|
+
config,
|
|
221
|
+
(0, __powerlines_deepkit_vendor_type.resolveClassType)(defaultConfigType)
|
|
222
|
+
].filter(Boolean));
|
|
223
|
+
}
|
|
224
|
+
reflectEnv.__type = [
|
|
225
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
226
|
+
"context",
|
|
227
|
+
"file",
|
|
228
|
+
"name",
|
|
229
|
+
"reflectEnv",
|
|
230
|
+
"Pn!2\"&2#8&2$8\"/%"
|
|
231
|
+
];
|
|
232
|
+
async function reflectSecrets(context, file, name) {
|
|
233
|
+
let config;
|
|
234
|
+
if (file) config = (0, __powerlines_deepkit_vendor_type.resolveClassType)(await (0, __powerlines_deepkit_reflect_type.reflectType)(context, {
|
|
235
|
+
file: !require_is_parent_path.isParentPath(file, context.workspaceConfig.workspaceRoot) ? require_join_paths.joinPaths(context.workspaceConfig.workspaceRoot, file) : file,
|
|
236
|
+
name
|
|
237
|
+
}));
|
|
238
|
+
const defaultSecretsType = await (0, __powerlines_deepkit_reflect_type.reflectType)(context, await require_helpers_persistence.getSecretsDefaultTypeDefinition(context));
|
|
239
|
+
return mergeSecretsReflections(context, [
|
|
240
|
+
await require_helpers_persistence.readSecretsReflection(context),
|
|
241
|
+
config,
|
|
242
|
+
(0, __powerlines_deepkit_vendor_type.resolveClassType)(defaultSecretsType)
|
|
243
|
+
].filter(Boolean));
|
|
244
|
+
}
|
|
245
|
+
reflectSecrets.__type = [
|
|
246
|
+
() => require_types_plugin.__ΩEnvPluginContext,
|
|
247
|
+
"context",
|
|
248
|
+
"file",
|
|
249
|
+
"name",
|
|
250
|
+
"reflectSecrets",
|
|
251
|
+
"Pn!2\"&2#8&2$8\"/%"
|
|
252
|
+
];
|
|
253
|
+
|
|
254
|
+
//#endregion
|
|
255
|
+
exports.BaseEnv = BaseEnv;
|
|
256
|
+
exports.BaseSecrets = BaseSecrets;
|
|
257
|
+
exports.__ΩCreateEnvReflectionOptions = __ΩCreateEnvReflectionOptions;
|
|
258
|
+
exports.createEnvReflection = createEnvReflection;
|
|
259
|
+
exports.createSecretsReflection = createSecretsReflection;
|
|
260
|
+
exports.mergeEnvReflections = mergeEnvReflections;
|
|
261
|
+
exports.mergeSecretsReflections = mergeSecretsReflections;
|
|
262
|
+
exports.reflectEnv = reflectEnv;
|
|
263
|
+
exports.reflectSecrets = reflectSecrets;
|
|
@@ -1,4 +1,47 @@
|
|
|
1
|
-
import "../runtime
|
|
2
|
-
import "../plugin
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { EnvInterface, SecretsInterface } from "../types/runtime.cjs";
|
|
2
|
+
import { EnvPluginContext } from "../types/plugin.cjs";
|
|
3
|
+
import { ReflectionClass, TypeClass, TypeObjectLiteral } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
|
|
5
|
+
//#region src/helpers/reflect.d.ts
|
|
6
|
+
declare function mergeEnvReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
7
|
+
declare function mergeSecretsReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
8
|
+
interface CreateEnvReflectionOptions {
|
|
9
|
+
type?: TypeObjectLiteral | TypeClass;
|
|
10
|
+
superReflection?: ReflectionClass<any>;
|
|
11
|
+
}
|
|
12
|
+
declare class BaseEnv implements EnvInterface {
|
|
13
|
+
APP_NAME: string;
|
|
14
|
+
APP_VERSION: string;
|
|
15
|
+
BUILD_ID: string;
|
|
16
|
+
BUILD_TIMESTAMP: string;
|
|
17
|
+
BUILD_CHECKSUM: string;
|
|
18
|
+
RELEASE_ID: string;
|
|
19
|
+
RELEASE_TAG: string;
|
|
20
|
+
ORGANIZATION: string;
|
|
21
|
+
PLATFORM: "node" | "browser" | "neutral";
|
|
22
|
+
MODE: "development" | "test" | "production";
|
|
23
|
+
ENVIRONMENT: string;
|
|
24
|
+
DEBUG: boolean;
|
|
25
|
+
TEST: boolean;
|
|
26
|
+
MINIMAL: boolean;
|
|
27
|
+
NO_COLOR: boolean;
|
|
28
|
+
FORCE_COLOR: number | boolean;
|
|
29
|
+
FORCE_HYPERLINK: number | boolean;
|
|
30
|
+
STACKTRACE: boolean;
|
|
31
|
+
INCLUDE_ERROR_DATA: boolean;
|
|
32
|
+
ERROR_URL: string;
|
|
33
|
+
DEFAULT_TIMEZONE: string;
|
|
34
|
+
DEFAULT_LOCALE: string;
|
|
35
|
+
CI: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare class BaseSecrets implements SecretsInterface {
|
|
38
|
+
ENCRYPTION_KEY: string;
|
|
39
|
+
}
|
|
40
|
+
declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
41
|
+
declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
42
|
+
declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
43
|
+
declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
44
|
+
declare type __ΩCreateEnvReflectionOptions = any[];
|
|
45
|
+
//#endregion
|
|
46
|
+
export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
|
|
47
|
+
//# sourceMappingURL=reflect.d.cts.map
|