@powerlines/plugin-env 0.16.59 → 0.16.61
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/README.md +14 -16
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -3
- package/dist/_virtual/{rolldown_runtime.mjs → _rolldown/runtime.mjs} +2 -3
- package/dist/babel/index.cjs +1 -0
- package/dist/babel/plugin.cjs +20 -19
- package/dist/babel/plugin.d.cts +0 -1
- package/dist/babel/plugin.d.cts.map +1 -1
- package/dist/babel/plugin.d.mts +0 -1
- package/dist/babel/plugin.d.mts.map +1 -1
- package/dist/babel/plugin.mjs +3 -3
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/docs.cjs +26 -25
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +1 -1
- package/dist/components/env-builtin.cjs +155 -153
- package/dist/components/env-builtin.d.cts +0 -1
- package/dist/components/env-builtin.d.cts.map +1 -1
- package/dist/components/env-builtin.d.mts +0 -1
- package/dist/components/env-builtin.d.mts.map +1 -1
- package/dist/components/env-builtin.mjs +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/helpers/automd-generator.cjs +4 -3
- package/dist/helpers/automd-generator.d.cts +2 -3
- package/dist/helpers/automd-generator.d.cts.map +1 -1
- package/dist/helpers/automd-generator.d.mts +2 -3
- package/dist/helpers/automd-generator.d.mts.map +1 -1
- package/dist/helpers/automd-generator.mjs +1 -1
- package/dist/helpers/automd-generator.mjs.map +1 -1
- package/dist/helpers/create-reflection-resource.cjs +1 -0
- package/dist/helpers/create-reflection-resource.d.cts +0 -1
- package/dist/helpers/create-reflection-resource.d.cts.map +1 -1
- package/dist/helpers/create-reflection-resource.d.mts +0 -1
- package/dist/helpers/create-reflection-resource.d.mts.map +1 -1
- package/dist/helpers/create-reflection-resource.mjs.map +1 -1
- package/dist/helpers/docs-helper.cjs +4 -2
- package/dist/helpers/docs-helper.d.cts +0 -1
- package/dist/helpers/docs-helper.d.cts.map +1 -1
- package/dist/helpers/docs-helper.d.mts +0 -1
- package/dist/helpers/docs-helper.d.mts.map +1 -1
- package/dist/helpers/docs-helper.mjs +1 -1
- package/dist/helpers/docs-helper.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -0
- package/dist/helpers/load.cjs +19 -17
- package/dist/helpers/load.d.cts +0 -1
- package/dist/helpers/load.d.cts.map +1 -1
- package/dist/helpers/load.d.mts +0 -1
- package/dist/helpers/load.d.mts.map +1 -1
- package/dist/helpers/load.mjs +2 -2
- package/dist/helpers/load.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +59 -58
- package/dist/helpers/persistence.d.cts +0 -1
- package/dist/helpers/persistence.d.cts.map +1 -1
- package/dist/helpers/persistence.d.mts +0 -1
- package/dist/helpers/persistence.d.mts.map +1 -1
- package/dist/helpers/persistence.mjs +15 -15
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/reflect.cjs +40 -39
- package/dist/helpers/reflect.d.cts.map +1 -1
- package/dist/helpers/reflect.d.mts.map +1 -1
- package/dist/helpers/reflect.mjs +2 -2
- package/dist/helpers/reflect.mjs.map +1 -1
- package/dist/helpers/source-file-env.cjs +8 -7
- package/dist/helpers/source-file-env.d.cts.map +1 -1
- package/dist/helpers/source-file-env.d.mts.map +1 -1
- package/dist/helpers/source-file-env.mjs.map +1 -1
- package/dist/helpers/template-helpers.cjs +6 -5
- package/dist/helpers/template-helpers.d.cts +0 -1
- package/dist/helpers/template-helpers.d.cts.map +1 -1
- package/dist/helpers/template-helpers.d.mts +0 -1
- package/dist/helpers/template-helpers.d.mts.map +1 -1
- package/dist/helpers/template-helpers.mjs.map +1 -1
- package/dist/index.cjs +49 -49
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.cjs +7 -7
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs +6 -6
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.cjs +6 -6
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs +6 -6
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.cjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.cjs +655 -655
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs +655 -655
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.cjs +179 -179
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs +179 -179
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.cjs +188 -188
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs +188 -188
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.cjs +297 -297
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs +297 -297
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.cjs +8 -8
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs +8 -8
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.cjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs +4 -4
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.cjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.cjs +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs.map +1 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.cjs +5 -5
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs +4 -4
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs.map +1 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.cjs +2 -2
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs +1 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs.map +1 -1
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +18 -18
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +2 -2
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +1308 -1311
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +1294 -1297
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs.map +1 -1
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs +2194 -2194
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs +2193 -2193
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs.map +1 -1
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +3 -3
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +3 -3
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +34 -34
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +33 -33
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +221 -223
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +220 -222
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs.map +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +1 -1
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.cjs +3 -3
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs +5 -5
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs +1 -1
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +6 -6
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +5 -5
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +10 -10
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +16 -16
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +412 -412
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +189 -189
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs.map +1 -1
- package/dist/types/index.cjs +1 -0
- package/dist/types/plugin.cjs +20 -19
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs.map +1 -1
- package/dist/types/runtime.cjs +1 -0
- package/dist/types/runtime.d.cts.map +1 -1
- package/dist/types/runtime.d.mts.map +1 -1
- package/dist/types/runtime.mjs.map +1 -1
- package/package.json +45 -26
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.cjs +0 -37
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.mjs +0 -38
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/index.cjs +0 -3
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/index.mjs +0 -5
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.cjs +0 -6
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs +0 -7
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-collection.cjs +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-collection.mjs +0 -3
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.cjs +0 -19
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs +0 -20
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.cjs +0 -63
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs +0 -64
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.cjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs +0 -17
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.cjs +0 -32
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.mjs +0 -33
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.cjs +0 -28
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.mjs +0 -29
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.cjs +0 -122
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.mjs +0 -123
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.cjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.mjs +0 -9
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.mjs.map +0 -1
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +0 -43
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +0 -43
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs.map +0 -1
|
@@ -1,81 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
const require_helpers_load = require('../helpers/load.cjs');
|
|
4
|
-
let
|
|
5
|
-
let
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
let
|
|
9
|
-
let
|
|
10
|
-
let
|
|
11
|
-
let
|
|
12
|
-
let
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
let
|
|
4
|
+
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
5
|
+
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
6
|
+
let defu = require("defu");
|
|
7
|
+
defu = require_runtime.__toESM(defu);
|
|
8
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
9
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
10
|
+
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
11
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
12
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
13
|
+
let _powerlines_plugin_alloy_helpers_refkey = require("@powerlines/plugin-alloy/helpers/refkey");
|
|
14
|
+
let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
15
|
+
let _powerlines_plugin_alloy_typescript_components_interface_declaration = require("@powerlines/plugin-alloy/typescript/components/interface-declaration");
|
|
16
|
+
let _powerlines_plugin_alloy_typescript_components_object_declaration = require("@powerlines/plugin-alloy/typescript/components/object-declaration");
|
|
17
|
+
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
16
18
|
|
|
17
19
|
//#region src/components/env-builtin.tsx
|
|
18
20
|
/**
|
|
19
21
|
* Generates the environment configuration typescript definition for the Powerlines project.
|
|
20
22
|
*/
|
|
21
23
|
function EnvTypeDefinition(props) {
|
|
22
|
-
const [{ defaultValue, reflection }] = (0,
|
|
23
|
-
const context = (0,
|
|
24
|
+
const [{ defaultValue, reflection }] = (0, _alloy_js_core.splitProps)(props, ["defaultValue", "reflection"]);
|
|
25
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
24
26
|
return [
|
|
25
|
-
(0,
|
|
27
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
26
28
|
name: " EnvBase",
|
|
27
29
|
defaultValue,
|
|
28
30
|
reflection,
|
|
29
31
|
"export": true
|
|
30
32
|
}),
|
|
31
|
-
(0,
|
|
32
|
-
(0,
|
|
33
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
34
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
33
35
|
heading: "The environment configuration object with prefixed keys.",
|
|
34
36
|
get children() {
|
|
35
|
-
return (0,
|
|
37
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The \`Env\` type extends the \`EnvBase\` interface by including additional keys that are prefixed according to the project's configuration. This allows for flexibility in accessing environment variables with different naming conventions.` });
|
|
36
38
|
}
|
|
37
39
|
}),
|
|
38
|
-
(0,
|
|
40
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeDeclaration, {
|
|
39
41
|
name: "Env",
|
|
40
42
|
"export": true,
|
|
41
43
|
get children() {
|
|
42
|
-
return
|
|
44
|
+
return _alloy_js_core.code` {
|
|
43
45
|
[Key in keyof EnvBase as Key ${context.config.env.prefix.map((prefix) => `| \`${prefix.replace(/_$/g, "")}_\${Key}\``).join(" ")}]: EnvBase[Key];
|
|
44
46
|
}
|
|
45
47
|
`;
|
|
46
48
|
}
|
|
47
49
|
}),
|
|
48
|
-
(0,
|
|
50
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
49
51
|
];
|
|
50
52
|
}
|
|
51
53
|
function ConfigPropertyConditional(props) {
|
|
52
|
-
const [{ context, name }] = (0,
|
|
53
|
-
return
|
|
54
|
+
const [{ context, name }] = (0, _alloy_js_core.splitProps)(props, ["context", "name"]);
|
|
55
|
+
return _alloy_js_core.code`propertyName === "${name}" || propertyName.replace(/^(${context.config.env.prefix.sort((a, b) => a.startsWith(b) ? -1 : b.startsWith(a) ? 1 : a.localeCompare(b)).map((prefix) => `${prefix.replace(/_$/, "")}_`).join("|")})/g, "").toLowerCase().replace(/[\\s\\-_]+/g, "") === "${name.toLowerCase().replace(/[\s\-_]+/g, "")}"`;
|
|
54
56
|
}
|
|
55
57
|
function ConfigPropertyGet(props) {
|
|
56
|
-
const [{ context, property, index }] = (0,
|
|
58
|
+
const [{ context, property, index }] = (0, _alloy_js_core.splitProps)(props, [
|
|
57
59
|
"context",
|
|
58
60
|
"property",
|
|
59
61
|
"index"
|
|
60
62
|
]);
|
|
61
|
-
return [index === 0 ? (0,
|
|
63
|
+
return [index === 0 ? (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
62
64
|
get condition() {
|
|
63
|
-
return [(0,
|
|
65
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
64
66
|
get name() {
|
|
65
67
|
return property.getNameAsString();
|
|
66
68
|
},
|
|
67
69
|
context
|
|
68
|
-
}), (0,
|
|
70
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
69
71
|
get when() {
|
|
70
|
-
return (0,
|
|
72
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!property.getAlias())() && property.getAlias().length > 0;
|
|
71
73
|
},
|
|
72
74
|
get children() {
|
|
73
|
-
return [
|
|
75
|
+
return [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
74
76
|
get each() {
|
|
75
77
|
return property.getAlias();
|
|
76
78
|
},
|
|
77
|
-
joiner:
|
|
78
|
-
children: (alias) => (0,
|
|
79
|
+
joiner: _alloy_js_core.code` || `,
|
|
80
|
+
children: (alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
79
81
|
name: alias,
|
|
80
82
|
context
|
|
81
83
|
})
|
|
@@ -84,26 +86,26 @@ function ConfigPropertyGet(props) {
|
|
|
84
86
|
})];
|
|
85
87
|
},
|
|
86
88
|
get children() {
|
|
87
|
-
return
|
|
89
|
+
return _alloy_js_core.code`return target["${property.getNameAsString()}"];`;
|
|
88
90
|
}
|
|
89
|
-
}) : (0,
|
|
91
|
+
}) : (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
|
|
90
92
|
get condition() {
|
|
91
|
-
return [(0,
|
|
93
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
92
94
|
get name() {
|
|
93
95
|
return property.getNameAsString();
|
|
94
96
|
},
|
|
95
97
|
context
|
|
96
|
-
}), (0,
|
|
98
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
97
99
|
get when() {
|
|
98
|
-
return (0,
|
|
100
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!property.getAlias())() && property.getAlias().length > 0;
|
|
99
101
|
},
|
|
100
102
|
get children() {
|
|
101
|
-
return [
|
|
103
|
+
return [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
102
104
|
get each() {
|
|
103
105
|
return property.getAlias();
|
|
104
106
|
},
|
|
105
|
-
joiner:
|
|
106
|
-
children: (alias) => (0,
|
|
107
|
+
joiner: _alloy_js_core.code` || `,
|
|
108
|
+
children: (alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
107
109
|
name: alias,
|
|
108
110
|
context
|
|
109
111
|
})
|
|
@@ -112,34 +114,34 @@ function ConfigPropertyGet(props) {
|
|
|
112
114
|
})];
|
|
113
115
|
},
|
|
114
116
|
get children() {
|
|
115
|
-
return
|
|
117
|
+
return _alloy_js_core.code`return target["${property.getNameAsString()}"];`;
|
|
116
118
|
}
|
|
117
119
|
})];
|
|
118
120
|
}
|
|
119
121
|
function ConfigPropertySet(props) {
|
|
120
|
-
const [{ context, property, index }] = (0,
|
|
122
|
+
const [{ context, property, index }] = (0, _alloy_js_core.splitProps)(props, [
|
|
121
123
|
"context",
|
|
122
124
|
"property",
|
|
123
125
|
"index"
|
|
124
126
|
]);
|
|
125
|
-
return [index === 0 ? (0,
|
|
127
|
+
return [index === 0 ? (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
126
128
|
get condition() {
|
|
127
|
-
return [(0,
|
|
129
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
128
130
|
get name() {
|
|
129
131
|
return property.getNameAsString();
|
|
130
132
|
},
|
|
131
133
|
context
|
|
132
|
-
}), (0,
|
|
134
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
133
135
|
get when() {
|
|
134
|
-
return (0,
|
|
136
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!property.getAlias())() && property.getAlias().length > 0;
|
|
135
137
|
},
|
|
136
138
|
get children() {
|
|
137
|
-
return [
|
|
139
|
+
return [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
138
140
|
get each() {
|
|
139
141
|
return property.getAlias();
|
|
140
142
|
},
|
|
141
|
-
joiner:
|
|
142
|
-
children: (alias) => (0,
|
|
143
|
+
joiner: _alloy_js_core.code` || `,
|
|
144
|
+
children: (alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
143
145
|
name: alias,
|
|
144
146
|
context
|
|
145
147
|
})
|
|
@@ -148,29 +150,29 @@ function ConfigPropertySet(props) {
|
|
|
148
150
|
})];
|
|
149
151
|
},
|
|
150
152
|
get children() {
|
|
151
|
-
return
|
|
153
|
+
return _alloy_js_core.code`
|
|
152
154
|
target["${property.getNameAsString()}"] = newValue;
|
|
153
155
|
return true;
|
|
154
156
|
`;
|
|
155
157
|
}
|
|
156
|
-
}) : (0,
|
|
158
|
+
}) : (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
|
|
157
159
|
get condition() {
|
|
158
|
-
return [(0,
|
|
160
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
159
161
|
get name() {
|
|
160
162
|
return property.getNameAsString();
|
|
161
163
|
},
|
|
162
164
|
context
|
|
163
|
-
}), (0,
|
|
165
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
164
166
|
get when() {
|
|
165
|
-
return (0,
|
|
167
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!property.getAlias())() && property.getAlias().length > 0;
|
|
166
168
|
},
|
|
167
169
|
get children() {
|
|
168
|
-
return [
|
|
170
|
+
return [_alloy_js_core.code` || `, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
169
171
|
get each() {
|
|
170
172
|
return property.getAlias();
|
|
171
173
|
},
|
|
172
|
-
joiner:
|
|
173
|
-
children: (alias) => (0,
|
|
174
|
+
joiner: _alloy_js_core.code` || `,
|
|
175
|
+
children: (alias) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyConditional, {
|
|
174
176
|
name: alias,
|
|
175
177
|
context
|
|
176
178
|
})
|
|
@@ -179,42 +181,42 @@ function ConfigPropertySet(props) {
|
|
|
179
181
|
})];
|
|
180
182
|
},
|
|
181
183
|
get children() {
|
|
182
|
-
return
|
|
184
|
+
return _alloy_js_core.code`
|
|
183
185
|
target["${property.getNameAsString()}"] = newValue;
|
|
184
186
|
return true;
|
|
185
187
|
`;
|
|
186
188
|
}
|
|
187
189
|
})];
|
|
188
190
|
}
|
|
189
|
-
const createEnvRefkey = (0,
|
|
190
|
-
const envRefkey = (0,
|
|
191
|
-
const envSerializerRefkey = (0,
|
|
191
|
+
const createEnvRefkey = (0, _powerlines_plugin_alloy_helpers_refkey.refkey)("createEnv");
|
|
192
|
+
const envRefkey = (0, _powerlines_plugin_alloy_helpers_refkey.refkey)("env");
|
|
193
|
+
const envSerializerRefkey = (0, _powerlines_plugin_alloy_helpers_refkey.refkey)("EnvSerializer");
|
|
192
194
|
/**
|
|
193
195
|
* Generates the environment configuration module for the Powerlines project.
|
|
194
196
|
*/
|
|
195
197
|
function EnvBuiltin(props) {
|
|
196
|
-
const [{ defaultConfig, reflection, children }, rest] = (0,
|
|
198
|
+
const [{ defaultConfig, reflection, children }, rest] = (0, _alloy_js_core.splitProps)(props, [
|
|
197
199
|
"defaultConfig",
|
|
198
200
|
"reflection",
|
|
199
201
|
"children"
|
|
200
202
|
]);
|
|
201
|
-
const context = (0,
|
|
202
|
-
const defaultValue = (0,
|
|
203
|
-
const envInstance = (0,
|
|
204
|
-
return new
|
|
205
|
-
kind:
|
|
206
|
-
description: `The initial environment configuration state for the ${(0,
|
|
203
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
204
|
+
const defaultValue = (0, _alloy_js_core.computed)(() => context && require_helpers_load.loadEnvFromContext(context, process.env));
|
|
205
|
+
const envInstance = (0, _alloy_js_core.computed)(() => {
|
|
206
|
+
return new _powerlines_deepkit_vendor_type.ReflectionClass({
|
|
207
|
+
kind: _powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
208
|
+
description: `The initial environment configuration state for the ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.name)} project.`,
|
|
207
209
|
types: []
|
|
208
210
|
}, reflection);
|
|
209
211
|
});
|
|
210
|
-
const reflectionGetProperties = (0,
|
|
211
|
-
const reflectionSetProperties = (0,
|
|
212
|
-
return (0,
|
|
212
|
+
const reflectionGetProperties = (0, _alloy_js_core.computed)(() => reflection?.getProperties().filter((property) => !property.isIgnored()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
213
|
+
const reflectionSetProperties = (0, _alloy_js_core.computed)(() => reflection?.getProperties().filter((property) => !property.isIgnored() && !property.isReadonly()).sort((a, b) => a.getNameAsString().localeCompare(b.getNameAsString())) ?? []);
|
|
214
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
|
|
213
215
|
id: "env",
|
|
214
216
|
description: "The environment configuration module provides an interface to define environment configuration parameters."
|
|
215
217
|
}, rest, {
|
|
216
218
|
get imports() {
|
|
217
|
-
return
|
|
219
|
+
return (0, defu.default)({ "@powerlines/deepkit/vendor/type": [
|
|
218
220
|
"stringify",
|
|
219
221
|
"serializer",
|
|
220
222
|
"serializeFunction",
|
|
@@ -229,24 +231,24 @@ function EnvBuiltin(props) {
|
|
|
229
231
|
},
|
|
230
232
|
get children() {
|
|
231
233
|
return [
|
|
232
|
-
(0,
|
|
234
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
233
235
|
get when() {
|
|
234
236
|
return Boolean(reflection);
|
|
235
237
|
},
|
|
236
238
|
get children() {
|
|
237
239
|
return [
|
|
238
|
-
(0,
|
|
240
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(EnvTypeDefinition, {
|
|
239
241
|
get defaultValue() {
|
|
240
242
|
return defaultValue.value;
|
|
241
243
|
},
|
|
242
244
|
reflection
|
|
243
245
|
}),
|
|
244
|
-
(0,
|
|
245
|
-
(0,
|
|
246
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
247
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
246
248
|
];
|
|
247
249
|
}
|
|
248
250
|
}),
|
|
249
|
-
(0,
|
|
251
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_object_declaration.ObjectDeclaration, {
|
|
250
252
|
name: "initialEnv",
|
|
251
253
|
type: "Partial<EnvBase>",
|
|
252
254
|
defaultValue,
|
|
@@ -255,28 +257,28 @@ function EnvBuiltin(props) {
|
|
|
255
257
|
"const": true,
|
|
256
258
|
doc: "The initial environment configuration object values for the runtime."
|
|
257
259
|
}),
|
|
258
|
-
(0,
|
|
259
|
-
(0,
|
|
260
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
261
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
260
262
|
heading: "The environment configuration serializer for the Powerlines application.",
|
|
261
263
|
get children() {
|
|
262
264
|
return [
|
|
263
|
-
(0,
|
|
264
|
-
(0,
|
|
265
|
-
(0,
|
|
265
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
|
|
266
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
|
|
267
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
|
|
266
268
|
];
|
|
267
269
|
}
|
|
268
270
|
}),
|
|
269
|
-
(0,
|
|
271
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ClassDeclaration, {
|
|
270
272
|
refkey: envSerializerRefkey,
|
|
271
273
|
name: "EnvSerializer",
|
|
272
274
|
"extends": "Serializer",
|
|
273
275
|
"export": true,
|
|
274
276
|
get children() {
|
|
275
|
-
return (0,
|
|
277
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ClassMethod, {
|
|
276
278
|
name: "constructor",
|
|
277
279
|
"public": true,
|
|
278
280
|
doc: "Initializes a new instance of the `EnvSerializer` class.",
|
|
279
|
-
children:
|
|
281
|
+
children: _alloy_js_core.code`super("env");
|
|
280
282
|
|
|
281
283
|
this.deserializeRegistry.register(
|
|
282
284
|
ReflectionKind.boolean,
|
|
@@ -289,82 +291,82 @@ function EnvBuiltin(props) {
|
|
|
289
291
|
});
|
|
290
292
|
}
|
|
291
293
|
}),
|
|
292
|
-
(0,
|
|
293
|
-
(0,
|
|
294
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
295
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
294
296
|
heading: "A {@link EnvSerializer | environment configuration serializer} instance for the Powerlines application.",
|
|
295
297
|
get children() {
|
|
296
298
|
return [
|
|
297
|
-
(0,
|
|
298
|
-
(0,
|
|
299
|
-
(0,
|
|
299
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://deepkit.io/docs/serialization/serializers` }),
|
|
300
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://github.com/marcj/untitled-code/blob/master/packages/type/src/serializer.ts#L1918` }),
|
|
301
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This serializer is used to serialize and deserialize the Powerlines environment configuration.` })
|
|
300
302
|
];
|
|
301
303
|
}
|
|
302
304
|
}),
|
|
303
|
-
(0,
|
|
305
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
304
306
|
name: "envSerializer",
|
|
305
307
|
"export": false,
|
|
306
308
|
"const": true,
|
|
307
309
|
get initializer() {
|
|
308
|
-
return (0,
|
|
310
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.NewExpression, {
|
|
309
311
|
args: [],
|
|
310
312
|
target: "EnvSerializer"
|
|
311
313
|
});
|
|
312
314
|
}
|
|
313
315
|
}),
|
|
314
|
-
(0,
|
|
315
|
-
(0,
|
|
316
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
317
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
316
318
|
heading: "Serialize a environment configuration object to JSON data objects (not a JSON string).",
|
|
317
319
|
get children() {
|
|
318
320
|
return [
|
|
319
|
-
(0,
|
|
320
|
-
(0,
|
|
321
|
-
(0,
|
|
321
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The resulting JSON object can be stringified using \`JSON.stringify()\`.` }),
|
|
322
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const json = serializeEnv(env);` }),
|
|
323
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocThrows, { children: `ValidationError when serialization or validation fails.` })
|
|
322
324
|
];
|
|
323
325
|
}
|
|
324
326
|
}),
|
|
325
|
-
(0,
|
|
327
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
326
328
|
name: "serializeEnv",
|
|
327
329
|
"export": true,
|
|
328
330
|
"const": true,
|
|
329
331
|
initializer: "serializeFunction<EnvBase>(envSerializer)"
|
|
330
332
|
}),
|
|
331
|
-
(0,
|
|
332
|
-
(0,
|
|
333
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
334
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
333
335
|
heading: "Deserialize a environment configuration object from JSON data objects to JavaScript objects, without running any validators.",
|
|
334
336
|
get children() {
|
|
335
337
|
return [
|
|
336
|
-
(0,
|
|
337
|
-
(0,
|
|
338
|
-
(0,
|
|
338
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `Types that are already correct will be used as-is.` }),
|
|
339
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const env = deserializeEnv(json);` }),
|
|
340
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocThrows, { children: `ValidationError when deserialization fails.` })
|
|
339
341
|
];
|
|
340
342
|
}
|
|
341
343
|
}),
|
|
342
|
-
(0,
|
|
344
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
343
345
|
name: "deserializeEnv",
|
|
344
346
|
"export": true,
|
|
345
347
|
"const": true,
|
|
346
348
|
initializer: "deserializeFunction<EnvBase>(envSerializer)"
|
|
347
349
|
}),
|
|
348
|
-
(0,
|
|
349
|
-
(0,
|
|
350
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
351
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
350
352
|
heading: "Initializes the Powerlines environment configuration module.",
|
|
351
353
|
get children() {
|
|
352
354
|
return [
|
|
353
|
-
(0,
|
|
354
|
-
(0,
|
|
355
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This function initializes the Powerlines environment configuration object.` }),
|
|
356
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
355
357
|
name: "environmentConfig",
|
|
356
358
|
children: `The dynamic/runtime configuration - this could include the current environment variables or any other environment-specific settings provided by the runtime.`
|
|
357
359
|
}),
|
|
358
|
-
(0,
|
|
360
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The initialized Powerlines configuration object.` })
|
|
359
361
|
];
|
|
360
362
|
}
|
|
361
363
|
}),
|
|
362
|
-
(0,
|
|
364
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
363
365
|
get when() {
|
|
364
366
|
return Boolean(context?.entryPath);
|
|
365
367
|
},
|
|
366
368
|
get children() {
|
|
367
|
-
return (0,
|
|
369
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
368
370
|
refkey: createEnvRefkey,
|
|
369
371
|
async: false,
|
|
370
372
|
"export": true,
|
|
@@ -378,7 +380,7 @@ function EnvBuiltin(props) {
|
|
|
378
380
|
returnType: "Env",
|
|
379
381
|
get children() {
|
|
380
382
|
return [
|
|
381
|
-
|
|
383
|
+
_alloy_js_core.code`
|
|
382
384
|
return new Proxy<Env>(
|
|
383
385
|
deserializeEnv({
|
|
384
386
|
...initialEnv,
|
|
@@ -386,32 +388,32 @@ function EnvBuiltin(props) {
|
|
|
386
388
|
}) as Env,
|
|
387
389
|
{
|
|
388
390
|
get: (target: EnvBase, propertyName: string) => { `,
|
|
389
|
-
(0,
|
|
390
|
-
(0,
|
|
391
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
392
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
391
393
|
each: reflectionGetProperties,
|
|
392
|
-
children: (property, index) => (0,
|
|
394
|
+
children: (property, index) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertyGet, {
|
|
393
395
|
index,
|
|
394
396
|
context,
|
|
395
397
|
property
|
|
396
398
|
})
|
|
397
399
|
}),
|
|
398
|
-
|
|
400
|
+
_alloy_js_core.code`
|
|
399
401
|
return undefined;
|
|
400
402
|
}, `,
|
|
401
|
-
(0,
|
|
402
|
-
|
|
403
|
-
(0,
|
|
404
|
-
(0,
|
|
403
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
404
|
+
_alloy_js_core.code` set: (target: EnvBase, propertyName: string, newValue: any) => { `,
|
|
405
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
406
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
405
407
|
each: reflectionSetProperties,
|
|
406
|
-
ender:
|
|
407
|
-
children: (property, index) => (0,
|
|
408
|
+
ender: _alloy_js_core.code` else `,
|
|
409
|
+
children: (property, index) => (0, _alloy_js_core_jsx_runtime.createComponent)(ConfigPropertySet, {
|
|
408
410
|
index,
|
|
409
411
|
context,
|
|
410
412
|
property
|
|
411
413
|
})
|
|
412
414
|
}),
|
|
413
|
-
(0,
|
|
414
|
-
|
|
415
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
416
|
+
_alloy_js_core.code`return false;
|
|
415
417
|
}
|
|
416
418
|
}
|
|
417
419
|
);
|
|
@@ -421,31 +423,31 @@ function EnvBuiltin(props) {
|
|
|
421
423
|
});
|
|
422
424
|
}
|
|
423
425
|
}),
|
|
424
|
-
(0,
|
|
425
|
-
(0,
|
|
426
|
-
(0,
|
|
426
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
427
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
428
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
427
429
|
heading: "The environment configuration object.",
|
|
428
430
|
get children() {
|
|
429
|
-
return (0,
|
|
431
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This object provides access to the environment configuration parameters in the application runtime.` });
|
|
430
432
|
}
|
|
431
433
|
}),
|
|
432
|
-
(0,
|
|
434
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
433
435
|
refkey: envRefkey,
|
|
434
436
|
name: "env",
|
|
435
437
|
type: "Env",
|
|
436
438
|
"export": true,
|
|
437
439
|
"const": true,
|
|
438
440
|
get initializer() {
|
|
439
|
-
return [
|
|
441
|
+
return [_alloy_js_core.code`createEnv(${defaultConfig || "{}"} as Partial<Env>);`];
|
|
440
442
|
}
|
|
441
443
|
}),
|
|
442
|
-
(0,
|
|
443
|
-
(0,
|
|
444
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
445
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
444
446
|
"export": true,
|
|
445
447
|
"const": true,
|
|
446
448
|
name: "isCI",
|
|
447
449
|
doc: "Detect if the application is running in a continuous integration (CI) environment.",
|
|
448
|
-
initializer:
|
|
450
|
+
initializer: _alloy_js_core.code`Boolean(
|
|
449
451
|
env.CI ||
|
|
450
452
|
env.RUN_ID ||
|
|
451
453
|
env.AGOLA_GIT_REF ||
|
|
@@ -500,57 +502,57 @@ function EnvBuiltin(props) {
|
|
|
500
502
|
);
|
|
501
503
|
`
|
|
502
504
|
}),
|
|
503
|
-
(0,
|
|
504
|
-
(0,
|
|
505
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
506
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
505
507
|
heading: "Detect the \\`mode\\` of the current runtime environment.",
|
|
506
508
|
get children() {
|
|
507
|
-
return (0,
|
|
509
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: _alloy_js_core.code`The \`mode\` is determined by the \`MODE\` environment variable, or falls back to the \`NEXT_PUBLIC_VERCEL_ENV\`, \`NODE_ENV\`, or defaults to \`production\`. While the value can potentially be any string, it is generally recommended to only allow a value in the following list:
|
|
508
510
|
- \`production\`
|
|
509
511
|
- \`test\`
|
|
510
512
|
- \`development\`
|
|
511
513
|
` });
|
|
512
514
|
}
|
|
513
515
|
}),
|
|
514
|
-
(0,
|
|
516
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
515
517
|
"export": true,
|
|
516
518
|
"const": true,
|
|
517
519
|
name: "mode",
|
|
518
|
-
initializer:
|
|
520
|
+
initializer: _alloy_js_core.code`String(env.MODE) || "production"; `
|
|
519
521
|
}),
|
|
520
|
-
(0,
|
|
521
|
-
(0,
|
|
522
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
523
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
522
524
|
"export": true,
|
|
523
525
|
"const": true,
|
|
524
526
|
name: "isProduction",
|
|
525
527
|
doc: "Detect if the application is running in `\"production\"` mode",
|
|
526
|
-
initializer:
|
|
528
|
+
initializer: _alloy_js_core.code`["prd", "prod", "production"].includes(mode.toLowerCase()); `
|
|
527
529
|
}),
|
|
528
|
-
(0,
|
|
529
|
-
(0,
|
|
530
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
531
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
530
532
|
"export": true,
|
|
531
533
|
"const": true,
|
|
532
534
|
name: "isTest",
|
|
533
535
|
doc: "Detect if the application is running in `\"test\"` mode",
|
|
534
|
-
initializer:
|
|
536
|
+
initializer: _alloy_js_core.code`["tst", "test", "testing", "stg", "stage", "staging"].includes(mode.toLowerCase()) || env.TEST; `
|
|
535
537
|
}),
|
|
536
|
-
(0,
|
|
537
|
-
(0,
|
|
538
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
539
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
538
540
|
"export": true,
|
|
539
541
|
"const": true,
|
|
540
542
|
name: "isDevelopment",
|
|
541
543
|
doc: "Detect if the application is running in `\"development\"` mode",
|
|
542
|
-
initializer:
|
|
544
|
+
initializer: _alloy_js_core.code`["dev", "development"].includes(mode.toLowerCase()); `
|
|
543
545
|
}),
|
|
544
|
-
(0,
|
|
545
|
-
(0,
|
|
546
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
547
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
546
548
|
"export": true,
|
|
547
549
|
"const": true,
|
|
548
550
|
name: "isDebug",
|
|
549
551
|
doc: "Detect if the application is currently being debugged",
|
|
550
|
-
initializer:
|
|
552
|
+
initializer: _alloy_js_core.code`Boolean(isDevelopment && env.DEBUG); `
|
|
551
553
|
}),
|
|
552
|
-
(0,
|
|
553
|
-
(0,
|
|
554
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
555
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
554
556
|
get when() {
|
|
555
557
|
return Boolean(children);
|
|
556
558
|
},
|