@powerlines/plugin-env 0.16.60 → 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
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["ReflectionClass","ReflectionKind","alloy","render","automd","babel","parseTypeDefinition","toArray","ENV_PREFIXES","existsSync","joinPaths","constantCase","isSetString","defu","envBabelPlugin","EnvDocsFile","EnvBuiltin","env","getDocsOutputPath","loadEnv","getEnvDefaultTypeDefinition","getEnvReflectionsPath","getEnvTypeReflectionsPath","getSecretsDefaultTypeDefinition","readEnvReflection","readEnvTypeReflection","readSecretsReflection","writeEnvReflection","writeEnvTypeReflection","reflectEnv","reflectSecrets","plugin","options","name","config","debug","types","validate","inject","prefix","transform","plugins","file","fs","resolve","warn","envDefaultTypeDefinition","secrets","secretsDefaultTypeDefinition","reduce","ret","formattedPrefix","includes","push","framework","filter","Boolean","replace","configResolved","parsed","used","injected","command","skipCache","persistedMeta","checksum","meta","Error","getProperties","length","envWithAlias","prop","getAlias","Object","entries","forEach","key","value","unprefixedKey","startsWith","slice","aliasKey","find","reverse","hasProperty","getProperty","setDefaultValue","kind","objectLiteral","typeName","description","prepare","_self$","result","_$createComponent","defaultConfig","reflection","order","handler","trace","docs","levelOffset","buildEnd","reflectionPath","generators","vite","envPrefix"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n ReflectionClass,\n ReflectionKind\n} from \"@powerlines/deepkit/vendor/type\";\nimport alloy from \"@powerlines/plugin-alloy\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport automd from \"@powerlines/plugin-automd\";\nimport babel from \"@powerlines/plugin-babel\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { ENV_PREFIXES } from \"@stryke/env/types\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport type { UserConfig as ViteUserConfig } from \"vite\";\nimport { envBabelPlugin } from \"./babel/plugin\";\nimport { EnvDocsFile } from \"./components/docs\";\nimport { EnvBuiltin } from \"./components/env-builtin\";\nimport { env } from \"./helpers/automd-generator\";\nimport { getDocsOutputPath } from \"./helpers/docs-helper\";\nimport { loadEnv } from \"./helpers/load\";\nimport {\n getEnvDefaultTypeDefinition,\n getEnvReflectionsPath,\n getEnvTypeReflectionsPath,\n getSecretsDefaultTypeDefinition,\n readEnvReflection,\n readEnvTypeReflection,\n readSecretsReflection,\n writeEnvReflection,\n writeEnvTypeReflection\n} from \"./helpers/persistence\";\nimport { reflectEnv, reflectSecrets } from \"./helpers/reflect\";\nimport { EnvPluginContext, EnvPluginOptions } from \"./types/plugin\";\n\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n env?: EnvPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to inject environment variables into the source code.\n */\nexport const plugin = <TContext extends EnvPluginContext = EnvPluginContext>(\n options: EnvPluginOptions = {}\n) => {\n return [\n alloy(options.alloy),\n babel(options.babel),\n {\n name: \"env\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `env` build plugin.\"\n );\n\n const config = {\n env: defu(options, {\n types: {} as TypeDefinitionParameter,\n validate: false,\n inject: false,\n prefix: []\n }),\n transform: {\n babel: {\n plugins: [envBabelPlugin]\n }\n }\n };\n\n if (\n isSetString(config.env.types) ||\n (config.env.types && isSetString(config.env.types.file))\n ) {\n config.env.types = parseTypeDefinition(\n config.env.types\n ) as TypeDefinition;\n\n const file = await this.fs.resolve(config.env.types.file);\n if (file) {\n config.env.types.file = file;\n }\n } else {\n this.warn(\n \"The `env.types` configuration parameter was not provided. Please ensure this is expected.\"\n );\n\n const envDefaultTypeDefinition =\n await getEnvDefaultTypeDefinition(this);\n\n const file = await this.fs.resolve(envDefaultTypeDefinition.file);\n if (file) {\n config.env.types = parseTypeDefinition(\n `${file}#${envDefaultTypeDefinition.name}`\n ) as TypeDefinition;\n }\n }\n\n if (\n isSetString(config.env.secrets) ||\n (config.env.secrets && isSetString(config.env.secrets.file))\n ) {\n config.env.secrets = parseTypeDefinition(\n config.env.secrets\n ) as TypeDefinition;\n\n const file = await this.fs.resolve(config.env.secrets.file);\n if (file) {\n config.env.secrets.file = file;\n }\n } else {\n const secretsDefaultTypeDefinition =\n await getSecretsDefaultTypeDefinition(this);\n\n const file = await this.fs.resolve(secretsDefaultTypeDefinition.file);\n if (file) {\n config.env.secrets = parseTypeDefinition(\n `${file}#${secretsDefaultTypeDefinition.name}`\n ) as TypeDefinition;\n }\n }\n\n config.env.prefix = toArray(\n (config.env.prefix ?? []) as string[]\n ).reduce(\n (ret: string[], prefix: string) => {\n const formattedPrefix = constantCase(prefix);\n if (!ret.includes(formattedPrefix)) {\n ret.push(formattedPrefix);\n }\n\n return ret;\n },\n [\n ...ENV_PREFIXES,\n \"POWERLINES_\",\n this.config.framework &&\n this.config.framework !== \"powerlines\" &&\n `${constantCase(this.config.framework)}_`\n ].filter(Boolean) as string[]\n );\n\n config.env.prefix = toArray(config.env.prefix).reduce((ret, prefix) => {\n if (!ret.includes(prefix.replace(/_$/g, \"\"))) {\n ret.push(prefix.replace(/_$/g, \"\"));\n }\n return ret;\n }, [] as string[]);\n\n return config;\n },\n async configResolved() {\n this.debug(\n `Environment plugin configuration has been resolved for the Powerlines project.`\n );\n\n this.env = defu(\n {\n parsed: await loadEnv(this, this.config.env)\n },\n this.env ?? {},\n {\n types: {\n env: {}\n },\n used: {\n env: {},\n secrets: {}\n },\n parsed: {},\n injected: {}\n }\n ) as EnvPluginContext[\"env\"];\n\n if (\n this.config.command !== \"prepare\" &&\n !this.config.skipCache &&\n this.persistedMeta?.checksum === this.meta.checksum &&\n existsSync(getEnvTypeReflectionsPath(this, \"env\"))\n ) {\n this.debug(\n `Skipping reflection initialization as the meta checksum has not changed.`\n );\n\n this.env.types.env = await readEnvTypeReflection(this, \"env\");\n\n if (existsSync(getEnvReflectionsPath(this, \"env\"))) {\n this.env.used.env = await readEnvReflection(this);\n }\n\n if (existsSync(getEnvTypeReflectionsPath(this, \"secrets\"))) {\n this.env.types.secrets = await readEnvTypeReflection(\n this,\n \"secrets\"\n );\n }\n\n if (existsSync(getEnvReflectionsPath(this, \"secrets\"))) {\n this.env.used.secrets = await readSecretsReflection(this);\n }\n } else {\n this.debug(\n `Starting environment configuration reflection initialization.`\n );\n\n this.env.types.env = await reflectEnv(\n this,\n this.config.env.types?.file,\n this.config.env.types?.name\n );\n if (!this.env.types.env) {\n throw new Error(\n \"Failed to find the environment configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.env, \"env\");\n\n this.env.types.secrets = await reflectSecrets(\n this,\n this.config.env.secrets?.file,\n this.config.env.secrets?.name\n );\n if (!this.env.types.secrets) {\n throw new Error(\n \"Failed to find the secrets configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.secrets, \"secrets\");\n\n this.debug(\n `Resolved ${\n this.env.types.env.getProperties().length ?? 0\n } environment configuration parameters and ${\n this.env.types.secrets?.getProperties().length ?? 0\n } secret configuration parameters`\n );\n\n const envWithAlias = this.env.types.env\n .getProperties()\n .filter(prop => prop.getAlias().length > 0);\n\n Object.entries(await loadEnv(this, this.config.env)).forEach(\n ([key, value]) => {\n const unprefixedKey = this.config.env.prefix.reduce(\n (ret, prefix) => {\n if (key.replace(/_$/g, \"\").startsWith(prefix)) {\n return key.replace(/_$/g, \"\").slice(prefix.length);\n }\n return ret;\n },\n key\n );\n\n const aliasKey = envWithAlias.find(prop =>\n prop?.getAlias().reverse().includes(unprefixedKey)\n );\n if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) {\n this.env.types.env\n .getProperty(unprefixedKey)\n .setDefaultValue(value);\n }\n }\n );\n\n this.env.used.env = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.env\n );\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n\n if (this.env.types.secrets) {\n await writeEnvTypeReflection(\n this,\n this.env.types.secrets,\n \"secrets\"\n );\n\n this.env.used.secrets = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.secrets\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async prepare() {\n this.debug(\n `Preparing the Environment runtime artifacts for the Powerlines project.`\n );\n\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <EnvBuiltin\n defaultConfig={this.config.env.defaultConfig}\n reflection={result}\n />\n );\n },\n transform: {\n order: \"post\",\n async handler() {\n if (this.env.used.env.getProperties().length > 0) {\n this.trace(\n `Persisting used environment configuration reflections to ${getEnvReflectionsPath(\n this,\n \"env\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n\n if (this.env.used.secrets.getProperties().length > 0) {\n this.trace(\n `Persisting used secret configuration reflections to ${getEnvReflectionsPath(\n this,\n \"secrets\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async docs() {\n this.debug(\n `Documenting environment variables configuration values in \"${joinPaths(\n getDocsOutputPath(this),\n \"env.md\"\n )}\"`\n );\n\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <EnvDocsFile levelOffset={0} reflection={result} />\n );\n },\n async buildEnd() {\n const reflectionPath = getEnvReflectionsPath(this, \"env\");\n\n this.debug(`Writing env reflection types to ${reflectionPath}.`);\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n },\n {\n name: \"env:automd-generator\",\n config() {\n return {\n automd: defu(options.automd ?? {}, {\n generators: {\n env: env(this)\n }\n })\n };\n }\n },\n {\n name: \"env:vite\",\n vite: {\n configResolved(this: TContext) {\n return {\n envPrefix: this.config?.env?.prefix\n } as ViteUserConfig;\n }\n }\n },\n automd(options.automd)\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa+B,UACX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AAQ5B,UAAU,EAAE,EAAE,EACjCoG,YAAY,EACVvF,KAAKA,IAAI,KAAI,EACf,EACD,CAAA,EACF;;GAEJ;EACD;GACEgB,MAAM;GACNwE,MAAM,EACJ/C,iBAA+B;AAC7B,WAAO,EACLgD,WAAW,KAAKxE,QAAQjB,KAAKsB,QAC9B;MAEL;GACD;EACDnC,OAAO4B,QAAQ5B,OAAO;EACvB;;AAGH,kBAAe2B"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ReflectionClass","ReflectionKind","alloy","render","automd","babel","parseTypeDefinition","toArray","ENV_PREFIXES","existsSync","joinPaths","constantCase","isSetString","defu","envBabelPlugin","EnvDocsFile","EnvBuiltin","env","getDocsOutputPath","loadEnv","getEnvDefaultTypeDefinition","getEnvReflectionsPath","getEnvTypeReflectionsPath","getSecretsDefaultTypeDefinition","readEnvReflection","readEnvTypeReflection","readSecretsReflection","writeEnvReflection","writeEnvTypeReflection","reflectEnv","reflectSecrets","plugin","options","name","config","debug","types","validate","inject","prefix","transform","plugins","file","fs","resolve","warn","envDefaultTypeDefinition","secrets","secretsDefaultTypeDefinition","reduce","ret","formattedPrefix","includes","push","framework","filter","Boolean","replace","configResolved","parsed","used","injected","command","skipCache","persistedMeta","checksum","meta","Error","getProperties","length","envWithAlias","prop","getAlias","Object","entries","forEach","key","value","unprefixedKey","startsWith","slice","aliasKey","find","reverse","hasProperty","getProperty","setDefaultValue","kind","objectLiteral","typeName","description","prepare","_self$","result","_$createComponent","defaultConfig","reflection","order","handler","trace","docs","levelOffset","buildEnd","reflectionPath","generators","vite","envPrefix"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n ReflectionClass,\n ReflectionKind\n} from \"@powerlines/deepkit/vendor/type\";\nimport alloy from \"@powerlines/plugin-alloy\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport automd from \"@powerlines/plugin-automd\";\nimport babel from \"@powerlines/plugin-babel\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { ENV_PREFIXES } from \"@stryke/env/types\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport type { UserConfig as ViteUserConfig } from \"vite\";\nimport { envBabelPlugin } from \"./babel/plugin\";\nimport { EnvDocsFile } from \"./components/docs\";\nimport { EnvBuiltin } from \"./components/env-builtin\";\nimport { env } from \"./helpers/automd-generator\";\nimport { getDocsOutputPath } from \"./helpers/docs-helper\";\nimport { loadEnv } from \"./helpers/load\";\nimport {\n getEnvDefaultTypeDefinition,\n getEnvReflectionsPath,\n getEnvTypeReflectionsPath,\n getSecretsDefaultTypeDefinition,\n readEnvReflection,\n readEnvTypeReflection,\n readSecretsReflection,\n writeEnvReflection,\n writeEnvTypeReflection\n} from \"./helpers/persistence\";\nimport { reflectEnv, reflectSecrets } from \"./helpers/reflect\";\nimport { EnvPluginContext, EnvPluginOptions } from \"./types/plugin\";\n\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n env?: EnvPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to inject environment variables into the source code.\n */\nexport const plugin = <TContext extends EnvPluginContext = EnvPluginContext>(\n options: EnvPluginOptions = {}\n) => {\n return [\n alloy(options.alloy),\n babel(options.babel),\n {\n name: \"env\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `env` build plugin.\"\n );\n\n const config = {\n env: defu(options, {\n types: {} as TypeDefinitionParameter,\n validate: false,\n inject: false,\n prefix: []\n }),\n transform: {\n babel: {\n plugins: [envBabelPlugin]\n }\n }\n };\n\n if (\n isSetString(config.env.types) ||\n (config.env.types && isSetString(config.env.types.file))\n ) {\n config.env.types = parseTypeDefinition(\n config.env.types\n ) as TypeDefinition;\n\n const file = await this.fs.resolve(config.env.types.file);\n if (file) {\n config.env.types.file = file;\n }\n } else {\n this.warn(\n \"The `env.types` configuration parameter was not provided. Please ensure this is expected.\"\n );\n\n const envDefaultTypeDefinition =\n await getEnvDefaultTypeDefinition(this);\n\n const file = await this.fs.resolve(envDefaultTypeDefinition.file);\n if (file) {\n config.env.types = parseTypeDefinition(\n `${file}#${envDefaultTypeDefinition.name}`\n ) as TypeDefinition;\n }\n }\n\n if (\n isSetString(config.env.secrets) ||\n (config.env.secrets && isSetString(config.env.secrets.file))\n ) {\n config.env.secrets = parseTypeDefinition(\n config.env.secrets\n ) as TypeDefinition;\n\n const file = await this.fs.resolve(config.env.secrets.file);\n if (file) {\n config.env.secrets.file = file;\n }\n } else {\n const secretsDefaultTypeDefinition =\n await getSecretsDefaultTypeDefinition(this);\n\n const file = await this.fs.resolve(secretsDefaultTypeDefinition.file);\n if (file) {\n config.env.secrets = parseTypeDefinition(\n `${file}#${secretsDefaultTypeDefinition.name}`\n ) as TypeDefinition;\n }\n }\n\n config.env.prefix = toArray(\n (config.env.prefix ?? []) as string[]\n ).reduce(\n (ret: string[], prefix: string) => {\n const formattedPrefix = constantCase(prefix);\n if (!ret.includes(formattedPrefix)) {\n ret.push(formattedPrefix);\n }\n\n return ret;\n },\n [\n ...ENV_PREFIXES,\n \"POWERLINES_\",\n this.config.framework &&\n this.config.framework !== \"powerlines\" &&\n `${constantCase(this.config.framework)}_`\n ].filter(Boolean) as string[]\n );\n\n config.env.prefix = toArray(config.env.prefix).reduce((ret, prefix) => {\n if (!ret.includes(prefix.replace(/_$/g, \"\"))) {\n ret.push(prefix.replace(/_$/g, \"\"));\n }\n return ret;\n }, [] as string[]);\n\n return config;\n },\n async configResolved() {\n this.debug(\n `Environment plugin configuration has been resolved for the Powerlines project.`\n );\n\n this.env = defu(\n {\n parsed: await loadEnv(this, this.config.env)\n },\n this.env ?? {},\n {\n types: {\n env: {}\n },\n used: {\n env: {},\n secrets: {}\n },\n parsed: {},\n injected: {}\n }\n ) as EnvPluginContext[\"env\"];\n\n if (\n this.config.command !== \"prepare\" &&\n !this.config.skipCache &&\n this.persistedMeta?.checksum === this.meta.checksum &&\n existsSync(getEnvTypeReflectionsPath(this, \"env\"))\n ) {\n this.debug(\n `Skipping reflection initialization as the meta checksum has not changed.`\n );\n\n this.env.types.env = await readEnvTypeReflection(this, \"env\");\n\n if (existsSync(getEnvReflectionsPath(this, \"env\"))) {\n this.env.used.env = await readEnvReflection(this);\n }\n\n if (existsSync(getEnvTypeReflectionsPath(this, \"secrets\"))) {\n this.env.types.secrets = await readEnvTypeReflection(\n this,\n \"secrets\"\n );\n }\n\n if (existsSync(getEnvReflectionsPath(this, \"secrets\"))) {\n this.env.used.secrets = await readSecretsReflection(this);\n }\n } else {\n this.debug(\n `Starting environment configuration reflection initialization.`\n );\n\n this.env.types.env = await reflectEnv(\n this,\n this.config.env.types?.file,\n this.config.env.types?.name\n );\n if (!this.env.types.env) {\n throw new Error(\n \"Failed to find the environment configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.env, \"env\");\n\n this.env.types.secrets = await reflectSecrets(\n this,\n this.config.env.secrets?.file,\n this.config.env.secrets?.name\n );\n if (!this.env.types.secrets) {\n throw new Error(\n \"Failed to find the secrets configuration type reflection in the context.\"\n );\n }\n\n await writeEnvTypeReflection(this, this.env.types.secrets, \"secrets\");\n\n this.debug(\n `Resolved ${\n this.env.types.env.getProperties().length ?? 0\n } environment configuration parameters and ${\n this.env.types.secrets?.getProperties().length ?? 0\n } secret configuration parameters`\n );\n\n const envWithAlias = this.env.types.env\n .getProperties()\n .filter(prop => prop.getAlias().length > 0);\n\n Object.entries(await loadEnv(this, this.config.env)).forEach(\n ([key, value]) => {\n const unprefixedKey = this.config.env.prefix.reduce(\n (ret, prefix) => {\n if (key.replace(/_$/g, \"\").startsWith(prefix)) {\n return key.replace(/_$/g, \"\").slice(prefix.length);\n }\n return ret;\n },\n key\n );\n\n const aliasKey = envWithAlias.find(prop =>\n prop?.getAlias().reverse().includes(unprefixedKey)\n );\n if (this.env.types.env?.hasProperty(unprefixedKey) || aliasKey) {\n this.env.types.env\n .getProperty(unprefixedKey)\n .setDefaultValue(value);\n }\n }\n );\n\n this.env.used.env = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.env\n );\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n\n if (this.env.types.secrets) {\n await writeEnvTypeReflection(\n this,\n this.env.types.secrets,\n \"secrets\"\n );\n\n this.env.used.secrets = new ReflectionClass(\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters used by the ${\n this.config.name\n ? `${this.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n this.env.types.secrets\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async prepare() {\n this.debug(\n `Preparing the Environment runtime artifacts for the Powerlines project.`\n );\n\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <EnvBuiltin\n defaultConfig={this.config.env.defaultConfig}\n reflection={result}\n />\n );\n },\n transform: {\n order: \"post\",\n async handler() {\n if (this.env.used.env.getProperties().length > 0) {\n this.trace(\n `Persisting used environment configuration reflections to ${getEnvReflectionsPath(\n this,\n \"env\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n\n if (this.env.used.secrets.getProperties().length > 0) {\n this.trace(\n `Persisting used secret configuration reflections to ${getEnvReflectionsPath(\n this,\n \"secrets\"\n )}.`\n );\n await writeEnvReflection(this, this.env.used.secrets, \"secrets\");\n }\n }\n },\n async docs() {\n this.debug(\n `Documenting environment variables configuration values in \"${joinPaths(\n getDocsOutputPath(this),\n \"env.md\"\n )}\"`\n );\n\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <EnvDocsFile levelOffset={0} reflection={result} />\n );\n },\n async buildEnd() {\n const reflectionPath = getEnvReflectionsPath(this, \"env\");\n\n this.debug(`Writing env reflection types to ${reflectionPath}.`);\n\n await writeEnvReflection(this, this.env.used.env, \"env\");\n }\n },\n {\n name: \"env:automd-generator\",\n config() {\n return {\n automd: defu(options.automd ?? {}, {\n generators: {\n env: env(this)\n }\n })\n };\n }\n },\n {\n name: \"env:vite\",\n vite: {\n configResolved(this: TContext) {\n return {\n envPrefix: this.config?.env?.prefix\n } as ViteUserConfig;\n }\n }\n },\n automd(options.automd)\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa+B,UACXC,UAA4B,EAAE,KAC3B;AACH,QAAO;EACL9B,MAAM8B,QAAQ9B,MAAM;EACpBG,MAAM2B,QAAQ3B,MAAM;EACpB;GACE4B,MAAM;GACN,MAAMC,SAAS;AACb,SAAKC,MACH,yEACD;IAED,MAAMD,SAAS;KACbjB,KAAKJ,KAAKmB,SAAS;MACjBI,OAAO,EAA6B;MACpCC,UAAU;MACVC,QAAQ;MACRC,QAAQ,EAAA;MACT,CAAC;KACFC,WAAW,EACTnC,OAAO,EACLoC,SAAS,CAAC3B,eAAc,EAC1B,EACF;KACD;AAED,QACEF,YAAYsB,OAAOjB,IAAImB,MAAM,IAC5BF,OAAOjB,IAAImB,SAASxB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SAAS,GAAG;AAChD,WAAK8B,MACH,4DAA4D9E,sBAC1D,MACA,MACD,CAAA,GACF;AACD,YAAMM,mBAAmB,MAAM,KAAKV,IAAI2C,KAAK3C,KAAK,MAAM;;AAG1D,SAAI,KAAKA,IAAI2C,KAAKb,QAAQqB,eAAe,CAACC,SAAS,GAAG;AACpD,WAAK8B,MACH,uDAAuD9E,sBACrD,MACA,UACD,CAAA,GACF;AACD,YAAMM,mBAAmB,MAAM,KAAKV,IAAI2C,KAAKb,SAAS,UAAU;;;IAGrE;GACD,MAAMqD,OAAO;AACX,SAAKjE,MACH,8DAA8DzB,UAC5DQ,kBAAkB,KAAK,EACvB,SACD,CAAA,GACF;IAED,MAAM2E,SAAS,MAAMpE,sBAAsB,MAAM,MAAM;AAEvD,WAAOtB,OACL,MAAI2F,gBACH/E,aAAW;KAACsF,aAAa;KAAGL,YAAYH;KAAM,CACjD,CAAC;;GAEH,MAAMS,WAAW;IACf,MAAMC,iBAAiBlF,sBAAsB,MAAM,MAAM;AAEzD,SAAKc,MAAM,mCAAmCoE,eAAc,GAAI;AAEhE,UAAM5E,mBAAmB,MAAM,KAAKV,IAAI2C,KAAK3C,KAAK,MAAM;;GAE3D;EACD;GACEgB,MAAM;GACNC,SAAS;AACP,WAAO,EACL9B,QAAQS,KAAKmB,QAAQ5B,UAAU,EAAE,EAAE,EACjCoG,YAAY,EACVvF,KAAKA,IAAI,KAAI,EACf,EACD,CAAA,EACF;;GAEJ;EACD;GACEgB,MAAM;GACNwE,MAAM,EACJ/C,iBAA+B;AAC7B,WAAO,EACLgD,WAAW,KAAKxE,QAAQjB,KAAKsB,QAC9B;MAEL;GACD;EACDnC,OAAO4B,QAAQ5B,OAAO;EACvB"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_runtime = require('../../../../../../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
const require_pathe_M_eThtNZ = require('../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs');
|
|
3
3
|
const require_main$1 = require('../../../../dotenv@17.3.1/node_modules/dotenv/lib/main.cjs');
|
|
4
4
|
const require_index = require('../../../../exsolve@1.0.8/node_modules/exsolve/dist/index.cjs');
|
|
5
5
|
const require_jiti = require('../../../../jiti@2.6.1/node_modules/jiti/lib/jiti.cjs');
|
|
6
|
-
const require_defu = require('../../../../defu@6.1.4/node_modules/defu/dist/defu.cjs');
|
|
7
6
|
const require_index$1 = require('../../../../rc9@2.1.2/node_modules/rc9/dist/index.cjs');
|
|
8
7
|
const require_index$2 = require('../../../../pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs');
|
|
9
8
|
let node_fs = require("node:fs");
|
|
10
9
|
let node_os = require("node:os");
|
|
11
10
|
let node_fs_promises = require("node:fs/promises");
|
|
12
11
|
let node_url = require("node:url");
|
|
12
|
+
let defu = require("defu");
|
|
13
13
|
|
|
14
14
|
//#region ../../node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs
|
|
15
|
-
var import_main = /* @__PURE__ */
|
|
15
|
+
var import_main = /* @__PURE__ */ require_runtime.__toESM(require_main$1.default, 1);
|
|
16
16
|
/**
|
|
17
17
|
* Load and interpolate environment variables into `process.env`.
|
|
18
18
|
* If you need more control (or access to the values), consider using `loadDotenv` instead
|
|
@@ -119,8 +119,8 @@ async function loadConfig(options) {
|
|
|
119
119
|
extendKey: "extends",
|
|
120
120
|
...options.extend
|
|
121
121
|
};
|
|
122
|
-
const _merger = options.merger ||
|
|
123
|
-
options.jiti = options.jiti || require_jiti.
|
|
122
|
+
const _merger = options.merger || defu.defu;
|
|
123
|
+
options.jiti = options.jiti || require_jiti.default(require_pathe_M_eThtNZ.join(options.cwd, options.configFile), {
|
|
124
124
|
interopDefault: true,
|
|
125
125
|
moduleCache: false,
|
|
126
126
|
extensions: [...SUPPORTED_EXTENSIONS],
|
|
@@ -275,7 +275,7 @@ async function resolveConfig(source, options, sourceOptions = {}) {
|
|
|
275
275
|
const res$1 = await options.resolve(source, options);
|
|
276
276
|
if (res$1) return res$1;
|
|
277
277
|
}
|
|
278
|
-
const _merger = options.merger ||
|
|
278
|
+
const _merger = options.merger || defu.defu;
|
|
279
279
|
const customProviderKeys = Object.keys(sourceOptions.giget?.providers || {}).map((key) => `${key}:`);
|
|
280
280
|
const gigetPrefixes = customProviderKeys.length > 0 ? [...new Set([...customProviderKeys, ...GIGET_PREFIXES])] : GIGET_PREFIXES;
|
|
281
281
|
if (options.giget !== false && gigetPrefixes.some((prefix) => source.startsWith(prefix))) {
|
|
@@ -324,7 +324,7 @@ async function resolveConfig(source, options, sourceOptions = {}) {
|
|
|
324
324
|
};
|
|
325
325
|
if (Object.keys(envConfig).length > 0) res.config = _merger(envConfig, res.config);
|
|
326
326
|
}
|
|
327
|
-
res.meta =
|
|
327
|
+
res.meta = (0, defu.defu)(res.sourceOptions.meta, res.config.$meta);
|
|
328
328
|
delete res.config.$meta;
|
|
329
329
|
if (res.sourceOptions.overrides) res.config = _merger(res.sourceOptions.overrides, res.config);
|
|
330
330
|
res.configFile = _normalize(res.configFile);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { __toESM } from "../../../../../../_virtual/
|
|
1
|
+
import { __toESM } from "../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { basename, dirname, extname, join, normalize, resolve } from "../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs";
|
|
3
3
|
import { require_main } from "../../../../dotenv@17.3.1/node_modules/dotenv/lib/main.mjs";
|
|
4
4
|
import { resolveModulePath } from "../../../../exsolve@1.0.8/node_modules/exsolve/dist/index.mjs";
|
|
5
|
-
import
|
|
6
|
-
import { defu } from "../../../../defu@6.1.4/node_modules/defu/dist/defu.mjs";
|
|
5
|
+
import createJiti from "../../../../jiti@2.6.1/node_modules/jiti/lib/jiti.mjs";
|
|
7
6
|
import { read, readUser } from "../../../../rc9@2.1.2/node_modules/rc9/dist/index.mjs";
|
|
8
7
|
import { findWorkspaceDir, readPackageJSON } from "../../../../pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs";
|
|
9
8
|
import { existsSync, promises, statSync } from "node:fs";
|
|
10
9
|
import { homedir } from "node:os";
|
|
11
10
|
import { readFile, rm } from "node:fs/promises";
|
|
12
11
|
import { pathToFileURL } from "node:url";
|
|
12
|
+
import { defu as defu$1 } from "defu";
|
|
13
13
|
|
|
14
14
|
//#region ../../node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs
|
|
15
15
|
var import_main = /* @__PURE__ */ __toESM(require_main(), 1);
|
|
@@ -119,7 +119,7 @@ async function loadConfig(options) {
|
|
|
119
119
|
extendKey: "extends",
|
|
120
120
|
...options.extend
|
|
121
121
|
};
|
|
122
|
-
const _merger = options.merger || defu;
|
|
122
|
+
const _merger = options.merger || defu$1;
|
|
123
123
|
options.jiti = options.jiti || createJiti(join(options.cwd, options.configFile), {
|
|
124
124
|
interopDefault: true,
|
|
125
125
|
moduleCache: false,
|
|
@@ -275,7 +275,7 @@ async function resolveConfig(source, options, sourceOptions = {}) {
|
|
|
275
275
|
const res$1 = await options.resolve(source, options);
|
|
276
276
|
if (res$1) return res$1;
|
|
277
277
|
}
|
|
278
|
-
const _merger = options.merger || defu;
|
|
278
|
+
const _merger = options.merger || defu$1;
|
|
279
279
|
const customProviderKeys = Object.keys(sourceOptions.giget?.providers || {}).map((key) => `${key}:`);
|
|
280
280
|
const gigetPrefixes = customProviderKeys.length > 0 ? [...new Set([...customProviderKeys, ...GIGET_PREFIXES])] : GIGET_PREFIXES;
|
|
281
281
|
if (options.giget !== false && gigetPrefixes.some((prefix) => source.startsWith(prefix))) {
|
|
@@ -324,7 +324,7 @@ async function resolveConfig(source, options, sourceOptions = {}) {
|
|
|
324
324
|
};
|
|
325
325
|
if (Object.keys(envConfig).length > 0) res.config = _merger(envConfig, res.config);
|
|
326
326
|
}
|
|
327
|
-
res.meta = defu(res.sourceOptions.meta, res.config.$meta);
|
|
327
|
+
res.meta = defu$1(res.sourceOptions.meta, res.config.$meta);
|
|
328
328
|
delete res.config.$meta;
|
|
329
329
|
if (res.sourceOptions.overrides) res.config = _merger(res.sourceOptions.overrides, res.config);
|
|
330
330
|
res.configFile = _normalize(res.configFile);
|
package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["dotenv","rc9.read","rc9.readUser"],"sources":["../../../../../../../../../node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs"],"sourcesContent":["import { existsSync, promises, statSync } from \"node:fs\";\nimport { basename, dirname, extname, join, normalize, resolve } from \"pathe\";\nimport * as dotenv from \"dotenv\";\nimport { readFile, rm } from \"node:fs/promises\";\nimport { pathToFileURL } from \"node:url\";\nimport { homedir } from \"node:os\";\nimport { resolveModulePath } from \"exsolve\";\nimport { createJiti } from \"jiti\";\nimport * as rc9 from \"rc9\";\nimport { defu } from \"defu\";\nimport { findWorkspaceDir, readPackageJSON } from \"pkg-types\";\nimport { debounce } from \"perfect-debounce\";\n\n//#region src/dotenv.ts\n/**\n* Load and interpolate environment variables into `process.env`.\n* If you need more control (or access to the values), consider using `loadDotenv` instead\n*\n*/\nasync function setupDotenv(options) {\n\tconst targetEnvironment = options.env ?? process.env;\n\tconst environment = await loadDotenv({\n\t\tcwd: options.cwd,\n\t\tfileName: options.fileName ?? \".env\",\n\t\tenv: targetEnvironment,\n\t\tinterpolate: options.interpolate ?? true\n\t});\n\tconst dotenvVars = getDotEnvVars(targetEnvironment);\n\tfor (const key in environment) {\n\t\tif (key.startsWith(\"_\")) continue;\n\t\tif (targetEnvironment[key] === void 0 || dotenvVars.has(key)) targetEnvironment[key] = environment[key];\n\t}\n\treturn environment;\n}\n/** Load environment variables into an object. */\nasync function loadDotenv(options) {\n\tconst environment = Object.create(null);\n\tconst cwd = resolve(options.cwd || \".\");\n\tconst _fileName = options.fileName || \".env\";\n\tconst dotenvFiles = typeof _fileName === \"string\" ? [_fileName] : _fileName;\n\tconst dotenvVars = getDotEnvVars(options.env || {});\n\tObject.assign(environment, options.env);\n\tfor (const file of dotenvFiles) {\n\t\tconst dotenvFile = resolve(cwd, file);\n\t\tif (!statSync(dotenvFile, { throwIfNoEntry: false })?.isFile()) continue;\n\t\tconst parsed = dotenv.parse(await promises.readFile(dotenvFile, \"utf8\"));\n\t\tfor (const key in parsed) {\n\t\t\tif (key in environment && !dotenvVars.has(key)) continue;\n\t\t\tenvironment[key] = parsed[key];\n\t\t\tdotenvVars.add(key);\n\t\t}\n\t}\n\tif (options.interpolate) interpolate(environment);\n\treturn environment;\n}\nfunction interpolate(target, source = {}, parse = (v) => v) {\n\tfunction getValue(key) {\n\t\treturn source[key] === void 0 ? target[key] : source[key];\n\t}\n\tfunction interpolate$1(value, parents = []) {\n\t\tif (typeof value !== \"string\") return value;\n\t\treturn parse((value.match(/(.?\\${?(?:[\\w:]+)?}?)/g) || []).reduce((newValue, match) => {\n\t\t\tconst parts = /(.?)\\${?([\\w:]+)?}?/g.exec(match) || [];\n\t\t\tconst prefix = parts[1];\n\t\t\tlet value$1, replacePart;\n\t\t\tif (prefix === \"\\\\\") {\n\t\t\t\treplacePart = parts[0] || \"\";\n\t\t\t\tvalue$1 = replacePart.replace(String.raw`\\$`, \"$\");\n\t\t\t} else {\n\t\t\t\tconst key = parts[2];\n\t\t\t\treplacePart = (parts[0] || \"\").slice(prefix.length);\n\t\t\t\tif (parents.includes(key)) {\n\t\t\t\t\tconsole.warn(`Please avoid recursive environment variables ( loop: ${parents.join(\" > \")} > ${key} )`);\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\tvalue$1 = getValue(key);\n\t\t\t\tvalue$1 = interpolate$1(value$1, [...parents, key]);\n\t\t\t}\n\t\t\treturn value$1 === void 0 ? newValue : newValue.replace(replacePart, value$1);\n\t\t}, value));\n\t}\n\tfor (const key in target) target[key] = interpolate$1(getValue(key));\n}\nfunction getDotEnvVars(targetEnvironment) {\n\tconst globalRegistry = globalThis.__c12_dotenv_vars__ ||= /* @__PURE__ */ new Map();\n\tif (!globalRegistry.has(targetEnvironment)) globalRegistry.set(targetEnvironment, /* @__PURE__ */ new Set());\n\treturn globalRegistry.get(targetEnvironment);\n}\n\n//#endregion\n//#region src/loader.ts\nconst _normalize = (p) => p?.replace(/\\\\/g, \"/\");\nconst ASYNC_LOADERS = {\n\t\".yaml\": () => import(\"confbox/yaml\").then((r) => r.parseYAML),\n\t\".yml\": () => import(\"confbox/yaml\").then((r) => r.parseYAML),\n\t\".jsonc\": () => import(\"confbox/jsonc\").then((r) => r.parseJSONC),\n\t\".json5\": () => import(\"confbox/json5\").then((r) => r.parseJSON5),\n\t\".toml\": () => import(\"confbox/toml\").then((r) => r.parseTOML)\n};\nconst SUPPORTED_EXTENSIONS = Object.freeze([\n\t\".js\",\n\t\".ts\",\n\t\".mjs\",\n\t\".cjs\",\n\t\".mts\",\n\t\".cts\",\n\t\".json\",\n\t\".jsonc\",\n\t\".json5\",\n\t\".yaml\",\n\t\".yml\",\n\t\".toml\"\n]);\nasync function loadConfig(options) {\n\toptions.cwd = resolve(process.cwd(), options.cwd || \".\");\n\toptions.name = options.name || \"config\";\n\toptions.envName = options.envName ?? process.env.NODE_ENV;\n\toptions.configFile = options.configFile ?? (options.name === \"config\" ? \"config\" : `${options.name}.config`);\n\toptions.rcFile = options.rcFile ?? `.${options.name}rc`;\n\tif (options.extend !== false) options.extend = {\n\t\textendKey: \"extends\",\n\t\t...options.extend\n\t};\n\tconst _merger = options.merger || defu;\n\toptions.jiti = options.jiti || createJiti(join(options.cwd, options.configFile), {\n\t\tinteropDefault: true,\n\t\tmoduleCache: false,\n\t\textensions: [...SUPPORTED_EXTENSIONS],\n\t\t...options.jitiOptions\n\t});\n\tconst r = {\n\t\tconfig: {},\n\t\tcwd: options.cwd,\n\t\tconfigFile: resolve(options.cwd, options.configFile),\n\t\tlayers: [],\n\t\t_configFile: void 0\n\t};\n\tconst rawConfigs = {\n\t\toverrides: options.overrides,\n\t\tmain: void 0,\n\t\trc: void 0,\n\t\tpackageJson: void 0,\n\t\tdefaultConfig: options.defaultConfig\n\t};\n\tif (options.dotenv) await setupDotenv({\n\t\tcwd: options.cwd,\n\t\t...options.dotenv === true ? {} : options.dotenv\n\t});\n\tconst _mainConfig = await resolveConfig(\".\", options);\n\tif (_mainConfig.configFile) {\n\t\trawConfigs.main = _mainConfig.config;\n\t\tr.configFile = _mainConfig.configFile;\n\t\tr._configFile = _mainConfig._configFile;\n\t}\n\tif (_mainConfig.meta) r.meta = _mainConfig.meta;\n\tif (options.rcFile) {\n\t\tconst rcSources = [];\n\t\trcSources.push(rc9.read({\n\t\t\tname: options.rcFile,\n\t\t\tdir: options.cwd\n\t\t}));\n\t\tif (options.globalRc) {\n\t\t\tconst workspaceDir = await findWorkspaceDir(options.cwd).catch(() => {});\n\t\t\tif (workspaceDir) rcSources.push(rc9.read({\n\t\t\t\tname: options.rcFile,\n\t\t\t\tdir: workspaceDir\n\t\t\t}));\n\t\t\trcSources.push(rc9.readUser({\n\t\t\t\tname: options.rcFile,\n\t\t\t\tdir: options.cwd\n\t\t\t}));\n\t\t}\n\t\trawConfigs.rc = _merger({}, ...rcSources);\n\t}\n\tif (options.packageJson) {\n\t\tconst keys = (Array.isArray(options.packageJson) ? options.packageJson : [typeof options.packageJson === \"string\" ? options.packageJson : options.name]).filter((t) => t && typeof t === \"string\");\n\t\tconst pkgJsonFile = await readPackageJSON(options.cwd).catch(() => {});\n\t\trawConfigs.packageJson = _merger({}, ...keys.map((key) => pkgJsonFile?.[key]));\n\t}\n\tconst configs = {};\n\tfor (const key in rawConfigs) {\n\t\tconst value = rawConfigs[key];\n\t\tconfigs[key] = await (typeof value === \"function\" ? value({\n\t\t\tconfigs,\n\t\t\trawConfigs\n\t\t}) : value);\n\t}\n\tif (Array.isArray(configs.main)) r.config = configs.main;\n\telse {\n\t\tr.config = _merger(configs.overrides, configs.main, configs.rc, configs.packageJson, configs.defaultConfig);\n\t\tif (options.extend) {\n\t\t\tawait extendConfig(r.config, options);\n\t\t\tr.layers = r.config._layers;\n\t\t\tdelete r.config._layers;\n\t\t\tr.config = _merger(r.config, ...r.layers.map((e) => e.config));\n\t\t}\n\t}\n\tr.layers = [...[\n\t\tconfigs.overrides && {\n\t\t\tconfig: configs.overrides,\n\t\t\tconfigFile: void 0,\n\t\t\tcwd: void 0\n\t\t},\n\t\t{\n\t\t\tconfig: configs.main,\n\t\t\tconfigFile: options.configFile,\n\t\t\tcwd: options.cwd\n\t\t},\n\t\tconfigs.rc && {\n\t\t\tconfig: configs.rc,\n\t\t\tconfigFile: options.rcFile\n\t\t},\n\t\tconfigs.packageJson && {\n\t\t\tconfig: configs.packageJson,\n\t\t\tconfigFile: \"package.json\"\n\t\t}\n\t].filter((l) => l && l.config), ...r.layers];\n\tif (options.defaults) r.config = _merger(r.config, options.defaults);\n\tif (options.omit$Keys) {\n\t\tfor (const key in r.config) if (key.startsWith(\"$\")) delete r.config[key];\n\t}\n\tif (options.configFileRequired && !r._configFile) throw new Error(`Required config (${r.configFile}) cannot be resolved.`);\n\treturn r;\n}\nasync function extendConfig(config, options) {\n\tconfig._layers = config._layers || [];\n\tif (!options.extend) return;\n\tlet keys = options.extend.extendKey;\n\tif (typeof keys === \"string\") keys = [keys];\n\tconst extendSources = [];\n\tfor (const key of keys) {\n\t\textendSources.push(...(Array.isArray(config[key]) ? config[key] : [config[key]]).filter(Boolean));\n\t\tdelete config[key];\n\t}\n\tfor (let extendSource of extendSources) {\n\t\tconst originalExtendSource = extendSource;\n\t\tlet sourceOptions = {};\n\t\tif (extendSource.source) {\n\t\t\tsourceOptions = extendSource.options || {};\n\t\t\textendSource = extendSource.source;\n\t\t}\n\t\tif (Array.isArray(extendSource)) {\n\t\t\tsourceOptions = extendSource[1] || {};\n\t\t\textendSource = extendSource[0];\n\t\t}\n\t\tif (typeof extendSource !== \"string\") {\n\t\t\tconsole.warn(`Cannot extend config from \\`${JSON.stringify(originalExtendSource)}\\` in ${options.cwd}`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst _config = await resolveConfig(extendSource, options, sourceOptions);\n\t\tif (!_config.config) {\n\t\t\tconsole.warn(`Cannot extend config from \\`${extendSource}\\` in ${options.cwd}`);\n\t\t\tcontinue;\n\t\t}\n\t\tawait extendConfig(_config.config, {\n\t\t\t...options,\n\t\t\tcwd: _config.cwd\n\t\t});\n\t\tconfig._layers.push(_config);\n\t\tif (_config.config._layers) {\n\t\t\tconfig._layers.push(..._config.config._layers);\n\t\t\tdelete _config.config._layers;\n\t\t}\n\t}\n}\nconst GIGET_PREFIXES = [\n\t\"gh:\",\n\t\"github:\",\n\t\"gitlab:\",\n\t\"bitbucket:\",\n\t\"https://\",\n\t\"http://\"\n];\nconst NPM_PACKAGE_RE = /^(@[\\da-z~-][\\d._a-z~-]*\\/)?[\\da-z~-][\\d._a-z~-]*($|\\/.*)/;\nasync function resolveConfig(source, options, sourceOptions = {}) {\n\tif (options.resolve) {\n\t\tconst res$1 = await options.resolve(source, options);\n\t\tif (res$1) return res$1;\n\t}\n\tconst _merger = options.merger || defu;\n\tconst customProviderKeys = Object.keys(sourceOptions.giget?.providers || {}).map((key) => `${key}:`);\n\tconst gigetPrefixes = customProviderKeys.length > 0 ? [...new Set([...customProviderKeys, ...GIGET_PREFIXES])] : GIGET_PREFIXES;\n\tif (options.giget !== false && gigetPrefixes.some((prefix) => source.startsWith(prefix))) {\n\t\tconst { downloadTemplate } = await import(\"giget\");\n\t\tconst { digest } = await import(\"ohash\");\n\t\tconst cloneName = source.replace(/\\W+/g, \"_\").split(\"_\").splice(0, 3).join(\"_\") + \"_\" + digest(source).slice(0, 10).replace(/[-_]/g, \"\");\n\t\tlet cloneDir;\n\t\tconst localNodeModules = resolve(options.cwd, \"node_modules\");\n\t\tconst parentDir = dirname(options.cwd);\n\t\tif (basename(parentDir) === \".c12\") cloneDir = join(parentDir, cloneName);\n\t\telse if (existsSync(localNodeModules)) cloneDir = join(localNodeModules, \".c12\", cloneName);\n\t\telse cloneDir = process.env.XDG_CACHE_HOME ? resolve(process.env.XDG_CACHE_HOME, \"c12\", cloneName) : resolve(homedir(), \".cache/c12\", cloneName);\n\t\tif (existsSync(cloneDir) && !sourceOptions.install) await rm(cloneDir, { recursive: true });\n\t\tsource = (await downloadTemplate(source, {\n\t\t\tdir: cloneDir,\n\t\t\tinstall: sourceOptions.install,\n\t\t\tforce: sourceOptions.install,\n\t\t\tauth: sourceOptions.auth,\n\t\t\t...options.giget,\n\t\t\t...sourceOptions.giget\n\t\t})).dir;\n\t}\n\tif (NPM_PACKAGE_RE.test(source)) source = tryResolve(source, options) || source;\n\tconst ext = extname(source);\n\tconst isDir = !ext || ext === basename(source);\n\tconst cwd = resolve(options.cwd, isDir ? source : dirname(source));\n\tif (isDir) source = options.configFile;\n\tconst res = {\n\t\tconfig: void 0,\n\t\tconfigFile: void 0,\n\t\tcwd,\n\t\tsource,\n\t\tsourceOptions\n\t};\n\tres.configFile = tryResolve(resolve(cwd, source), options) || tryResolve(resolve(cwd, \".config\", source.replace(/\\.config$/, \"\")), options) || tryResolve(resolve(cwd, \".config\", source), options) || source;\n\tif (!existsSync(res.configFile)) return res;\n\tres._configFile = res.configFile;\n\tconst configFileExt = extname(res.configFile) || \"\";\n\tif (configFileExt in ASYNC_LOADERS) res.config = (await ASYNC_LOADERS[configFileExt]())(await readFile(res.configFile, \"utf8\"));\n\telse res.config = await options.jiti.import(res.configFile, { default: true });\n\tif (typeof res.config === \"function\") res.config = await res.config(options.context);\n\tif (options.envName) {\n\t\tconst envConfig = {\n\t\t\t...res.config[\"$\" + options.envName],\n\t\t\t...res.config.$env?.[options.envName]\n\t\t};\n\t\tif (Object.keys(envConfig).length > 0) res.config = _merger(envConfig, res.config);\n\t}\n\tres.meta = defu(res.sourceOptions.meta, res.config.$meta);\n\tdelete res.config.$meta;\n\tif (res.sourceOptions.overrides) res.config = _merger(res.sourceOptions.overrides, res.config);\n\tres.configFile = _normalize(res.configFile);\n\tres.source = _normalize(res.source);\n\treturn res;\n}\nfunction tryResolve(id, options) {\n\tconst res = resolveModulePath(id, {\n\t\ttry: true,\n\t\tfrom: pathToFileURL(join(options.cwd || \".\", options.configFile || \"/\")),\n\t\tsuffixes: [\"\", \"/index\"],\n\t\textensions: SUPPORTED_EXTENSIONS,\n\t\tcache: false\n\t});\n\treturn res ? normalize(res) : void 0;\n}\n\n//#endregion\n//#region src/types.ts\nfunction createDefineConfig() {\n\treturn (input) => input;\n}\n\n//#endregion\n//#region src/watch.ts\nconst eventMap = {\n\tadd: \"created\",\n\tchange: \"updated\",\n\tunlink: \"removed\"\n};\nasync function watchConfig(options) {\n\tlet config = await loadConfig(options);\n\tconst configName = options.name || \"config\";\n\tconst configFileName = options.configFile ?? (options.name === \"config\" ? \"config\" : `${options.name}.config`);\n\tconst watchingFiles = [...new Set((config.layers || []).filter((l) => l.cwd).flatMap((l) => [\n\t\t...SUPPORTED_EXTENSIONS.flatMap((ext) => [\n\t\t\tresolve(l.cwd, configFileName + ext),\n\t\t\tresolve(l.cwd, \".config\", configFileName + ext),\n\t\t\tresolve(l.cwd, \".config\", configFileName.replace(/\\.config$/, \"\") + ext)\n\t\t]),\n\t\tl.source && resolve(l.cwd, l.source),\n\t\toptions.rcFile && resolve(l.cwd, typeof options.rcFile === \"string\" ? options.rcFile : `.${configName}rc`),\n\t\toptions.packageJson && resolve(l.cwd, \"package.json\")\n\t]).filter(Boolean))];\n\tconst watch = await import(\"chokidar\").then((r) => r.watch || r.default || r);\n\tconst { diff } = await import(\"ohash/utils\");\n\tconst _fswatcher = watch(watchingFiles, {\n\t\tignoreInitial: true,\n\t\t...options.chokidarOptions\n\t});\n\tconst onChange = async (event, path) => {\n\t\tconst type = eventMap[event];\n\t\tif (!type) return;\n\t\tif (options.onWatch) await options.onWatch({\n\t\t\ttype,\n\t\t\tpath\n\t\t});\n\t\tconst oldConfig = config;\n\t\ttry {\n\t\t\tconfig = await loadConfig(options);\n\t\t} catch (error) {\n\t\t\tconsole.warn(`Failed to load config ${path}\\n${error}`);\n\t\t\treturn;\n\t\t}\n\t\tconst changeCtx = {\n\t\t\tnewConfig: config,\n\t\t\toldConfig,\n\t\t\tgetDiff: () => diff(oldConfig.config, config.config)\n\t\t};\n\t\tif (options.acceptHMR) {\n\t\t\tif (await options.acceptHMR(changeCtx)) return;\n\t\t}\n\t\tif (options.onUpdate) await options.onUpdate(changeCtx);\n\t};\n\tif (options.debounce === false) _fswatcher.on(\"all\", onChange);\n\telse _fswatcher.on(\"all\", debounce(onChange, options.debounce ?? 100));\n\tconst utils = {\n\t\twatchingFiles,\n\t\tunwatch: async () => {\n\t\t\tawait _fswatcher.close();\n\t\t}\n\t};\n\treturn new Proxy(utils, { get(_, prop) {\n\t\tif (prop in utils) return utils[prop];\n\t\treturn config[prop];\n\t} });\n}\n\n//#endregion\nexport { SUPPORTED_EXTENSIONS, createDefineConfig, loadConfig, loadDotenv, setupDotenv, watchConfig };"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,eAAe,YAAY,SAAS;CACnC,MAAM,oBAAoB,QAAQ,OAAO,QAAQ;CACjD,MAAM,cAAc,MAAM,WAAW;EACpC,KAAK,QAAQ;EACb,UAAU,QAAQ,YAAY;EAC9B,KAAK;EACL,aAAa,QAAQ,eAAe;EACpC,CAAC;CACF,MAAM,aAAa,cAAc,kBAAkB;AACnD,MAAK,MAAM,OAAO,aAAa;AAC9B,MAAI,IAAI,WAAW,IAAI,CAAE;AACzB,MAAI,kBAAkB,SAAS,KAAK,KAAK,WAAW,IAAI,IAAI,CAAE,mBAAkB,OAAO,YAAY;;AAEpG,QAAO;;;AAGR,eAAe,WAAW,SAAS;CAClC,MAAM,cAAc,OAAO,OAAO,KAAK;CACvC,MAAM,MAAM,QAAQ,QAAQ,OAAO,IAAI;CACvC,MAAM,YAAY,QAAQ,YAAY;CACt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,IAAI,OAAO,MAAM,QAAQ;GAC5B,GAAG,IAAI,OAAO,OAAO,QAAQ;GAC7B;AACD,MAAI,OAAO,KAAK,UAAU,CAAC,SAAS,EAAG,KAAI,SAAS,QAAQ,WAAW,IAAI,OAAO;;AAEnF,KAAI,OAAO,KAAK,IAAI,cAAc,MAAM,IAAI,OAAO,MAAM;AACzD,QAAO,IAAI,OAAO;AAClB,KAAI,IAAI,cAAc,UAAW,KAAI,SAAS,QAAQ,IAAI,cAAc,WAAW,IAAI,OAAO;AAC9F,KAAI,aAAa,WAAW,IAAI,WAAW;AAC3C,KAAI,SAAS,WAAW,IAAI,OAAO;AACnC,QAAO;;AAER,SAAS,WAAW,IAAI,SAAS;CAChC,MAAM,MAAM,kBAAkB,IAAI;EACjC,KAAK;EACL,MAAM,cAAc,KAAK,QAAQ,OAAO,KAAK,QAAQ,cAAc,IAAI,CAAC;EACxE,UAAU,CAAC,IAAI,SAAS;EACxB,YAAY;EACZ,OAAO;EACP,CAAC;AACF,QAAO,MAAM,UAAU,IAAI,GAAG,KAAK"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["dotenv","defu","rc9.read","rc9.readUser"],"sources":["../../../../../../../../../node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs"],"sourcesContent":["import { existsSync, promises, statSync } from \"node:fs\";\nimport { basename, dirname, extname, join, normalize, resolve } from \"pathe\";\nimport * as dotenv from \"dotenv\";\nimport { readFile, rm } from \"node:fs/promises\";\nimport { pathToFileURL } from \"node:url\";\nimport { homedir } from \"node:os\";\nimport { resolveModulePath } from \"exsolve\";\nimport { createJiti } from \"jiti\";\nimport * as rc9 from \"rc9\";\nimport { defu } from \"defu\";\nimport { findWorkspaceDir, readPackageJSON } from \"pkg-types\";\nimport { debounce } from \"perfect-debounce\";\n\n//#region src/dotenv.ts\n/**\n* Load and interpolate environment variables into `process.env`.\n* If you need more control (or access to the values), consider using `loadDotenv` instead\n*\n*/\nasync function setupDotenv(options) {\n\tconst targetEnvironment = options.env ?? process.env;\n\tconst environment = await loadDotenv({\n\t\tcwd: options.cwd,\n\t\tfileName: options.fileName ?? \".env\",\n\t\tenv: targetEnvironment,\n\t\tinterpolate: options.interpolate ?? true\n\t});\n\tconst dotenvVars = getDotEnvVars(targetEnvironment);\n\tfor (const key in environment) {\n\t\tif (key.startsWith(\"_\")) continue;\n\t\tif (targetEnvironment[key] === void 0 || dotenvVars.has(key)) targetEnvironment[key] = environment[key];\n\t}\n\treturn environment;\n}\n/** Load environment variables into an object. */\nasync function loadDotenv(options) {\n\tconst environment = Object.create(null);\n\tconst cwd = resolve(options.cwd || \".\");\n\tconst _fileName = options.fileName || \".env\";\n\tconst dotenvFiles = typeof _fileName === \"string\" ? [_fileName] : _fileName;\n\tconst dotenvVars = getDotEnvVars(options.env || {});\n\tObject.assign(environment, options.env);\n\tfor (const file of dotenvFiles) {\n\t\tconst dotenvFile = resolve(cwd, file);\n\t\tif (!statSync(dotenvFile, { throwIfNoEntry: false })?.isFile()) continue;\n\t\tconst parsed = dotenv.parse(await promises.readFile(dotenvFile, \"utf8\"));\n\t\tfor (const key in parsed) {\n\t\t\tif (key in environment && !dotenvVars.has(key)) continue;\n\t\t\tenvironment[key] = parsed[key];\n\t\t\tdotenvVars.add(key);\n\t\t}\n\t}\n\tif (options.interpolate) interpolate(environment);\n\treturn environment;\n}\nfunction interpolate(target, source = {}, parse = (v) => v) {\n\tfunction getValue(key) {\n\t\treturn source[key] === void 0 ? target[key] : source[key];\n\t}\n\tfunction interpolate$1(value, parents = []) {\n\t\tif (typeof value !== \"string\") return value;\n\t\treturn parse((value.match(/(.?\\${?(?:[\\w:]+)?}?)/g) || []).reduce((newValue, match) => {\n\t\t\tconst parts = /(.?)\\${?([\\w:]+)?}?/g.exec(match) || [];\n\t\t\tconst prefix = parts[1];\n\t\t\tlet value$1, replacePart;\n\t\t\tif (prefix === \"\\\\\") {\n\t\t\t\treplacePart = parts[0] || \"\";\n\t\t\t\tvalue$1 = replacePart.replace(String.raw`\\$`, \"$\");\n\t\t\t} else {\n\t\t\t\tconst key = parts[2];\n\t\t\t\treplacePart = (parts[0] || \"\").slice(prefix.length);\n\t\t\t\tif (parents.includes(key)) {\n\t\t\t\t\tconsole.warn(`Please avoid recursive environment variables ( loop: ${parents.join(\" > \")} > ${key} )`);\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\tvalue$1 = getValue(key);\n\t\t\t\tvalue$1 = interpolate$1(value$1, [...parents, key]);\n\t\t\t}\n\t\t\treturn value$1 === void 0 ? newValue : newValue.replace(replacePart, value$1);\n\t\t}, value));\n\t}\n\tfor (const key in target) target[key] = interpolate$1(getValue(key));\n}\nfunction getDotEnvVars(targetEnvironment) {\n\tconst globalRegistry = globalThis.__c12_dotenv_vars__ ||= /* @__PURE__ */ new Map();\n\tif (!globalRegistry.has(targetEnvironment)) globalRegistry.set(targetEnvironment, /* @__PURE__ */ new Set());\n\treturn globalRegistry.get(targetEnvironment);\n}\n\n//#endregion\n//#region src/loader.ts\nconst _normalize = (p) => p?.replace(/\\\\/g, \"/\");\nconst ASYNC_LOADERS = {\n\t\".yaml\": () => import(\"confbox/yaml\").then((r) => r.parseYAML),\n\t\".yml\": () => import(\"confbox/yaml\").then((r) => r.parseYAML),\n\t\".jsonc\": () => import(\"confbox/jsonc\").then((r) => r.parseJSONC),\n\t\".json5\": () => import(\"confbox/json5\").then((r) => r.parseJSON5),\n\t\".toml\": () => import(\"confbox/toml\").then((r) => r.parseTOML)\n};\nconst SUPPORTED_EXTENSIONS = Object.freeze([\n\t\".js\",\n\t\".ts\",\n\t\".mjs\",\n\t\".cjs\",\n\t\".mts\",\n\t\".cts\",\n\t\".json\",\n\t\".jsonc\",\n\t\".json5\",\n\t\".yaml\",\n\t\".yml\",\n\t\".toml\"\n]);\nasync function loadConfig(options) {\n\toptions.cwd = resolve(process.cwd(), options.cwd || \".\");\n\toptions.name = options.name || \"config\";\n\toptions.envName = options.envName ?? process.env.NODE_ENV;\n\toptions.configFile = options.configFile ?? (options.name === \"config\" ? \"config\" : `${options.name}.config`);\n\toptions.rcFile = options.rcFile ?? `.${options.name}rc`;\n\tif (options.extend !== false) options.extend = {\n\t\textendKey: \"extends\",\n\t\t...options.extend\n\t};\n\tconst _merger = options.merger || defu;\n\toptions.jiti = options.jiti || createJiti(join(options.cwd, options.configFile), {\n\t\tinteropDefault: true,\n\t\tmoduleCache: false,\n\t\textensions: [...SUPPORTED_EXTENSIONS],\n\t\t...options.jitiOptions\n\t});\n\tconst r = {\n\t\tconfig: {},\n\t\tcwd: options.cwd,\n\t\tconfigFile: resolve(options.cwd, options.configFile),\n\t\tlayers: [],\n\t\t_configFile: void 0\n\t};\n\tconst rawConfigs = {\n\t\toverrides: options.overrides,\n\t\tmain: void 0,\n\t\trc: void 0,\n\t\tpackageJson: void 0,\n\t\tdefaultConfig: options.defaultConfig\n\t};\n\tif (options.dotenv) await setupDotenv({\n\t\tcwd: options.cwd,\n\t\t...options.dotenv === true ? {} : options.dotenv\n\t});\n\tconst _mainConfig = await resolveConfig(\".\", options);\n\tif (_mainConfig.configFile) {\n\t\trawConfigs.main = _mainConfig.config;\n\t\tr.configFile = _mainConfig.configFile;\n\t\tr._configFile = _mainConfig._configFile;\n\t}\n\tif (_mainConfig.meta) r.meta = _mainConfig.meta;\n\tif (options.rcFile) {\n\t\tconst rcSources = [];\n\t\trcSources.push(rc9.read({\n\t\t\tname: options.rcFile,\n\t\t\tdir: options.cwd\n\t\t}));\n\t\tif (options.globalRc) {\n\t\t\tconst workspaceDir = await findWorkspaceDir(options.cwd).catch(() => {});\n\t\t\tif (workspaceDir) rcSources.push(rc9.read({\n\t\t\t\tname: options.rcFile,\n\t\t\t\tdir: workspaceDir\n\t\t\t}));\n\t\t\trcSources.push(rc9.readUser({\n\t\t\t\tname: options.rcFile,\n\t\t\t\tdir: options.cwd\n\t\t\t}));\n\t\t}\n\t\trawConfigs.rc = _merger({}, ...rcSources);\n\t}\n\tif (options.packageJson) {\n\t\tconst keys = (Array.isArray(options.packageJson) ? options.packageJson : [typeof options.packageJson === \"string\" ? options.packageJson : options.name]).filter((t) => t && typeof t === \"string\");\n\t\tconst pkgJsonFile = await readPackageJSON(options.cwd).catch(() => {});\n\t\trawConfigs.packageJson = _merger({}, ...keys.map((key) => pkgJsonFile?.[key]));\n\t}\n\tconst configs = {};\n\tfor (const key in rawConfigs) {\n\t\tconst value = rawConfigs[key];\n\t\tconfigs[key] = await (typeof value === \"function\" ? value({\n\t\t\tconfigs,\n\t\t\trawConfigs\n\t\t}) : value);\n\t}\n\tif (Array.isArray(configs.main)) r.config = configs.main;\n\telse {\n\t\tr.config = _merger(configs.overrides, configs.main, configs.rc, configs.packageJson, configs.defaultConfig);\n\t\tif (options.extend) {\n\t\t\tawait extendConfig(r.config, options);\n\t\t\tr.layers = r.config._layers;\n\t\t\tdelete r.config._layers;\n\t\t\tr.config = _merger(r.config, ...r.layers.map((e) => e.config));\n\t\t}\n\t}\n\tr.layers = [...[\n\t\tconfigs.overrides && {\n\t\t\tconfig: configs.overrides,\n\t\t\tconfigFile: void 0,\n\t\t\tcwd: void 0\n\t\t},\n\t\t{\n\t\t\tconfig: configs.main,\n\t\t\tconfigFile: options.configFile,\n\t\t\tcwd: options.cwd\n\t\t},\n\t\tconfigs.rc && {\n\t\t\tconfig: configs.rc,\n\t\t\tconfigFile: options.rcFile\n\t\t},\n\t\tconfigs.packageJson && {\n\t\t\tconfig: configs.packageJson,\n\t\t\tconfigFile: \"package.json\"\n\t\t}\n\t].filter((l) => l && l.config), ...r.layers];\n\tif (options.defaults) r.config = _merger(r.config, options.defaults);\n\tif (options.omit$Keys) {\n\t\tfor (const key in r.config) if (key.startsWith(\"$\")) delete r.config[key];\n\t}\n\tif (options.configFileRequired && !r._configFile) throw new Error(`Required config (${r.configFile}) cannot be resolved.`);\n\treturn r;\n}\nasync function extendConfig(config, options) {\n\tconfig._layers = config._layers || [];\n\tif (!options.extend) return;\n\tlet keys = options.extend.extendKey;\n\tif (typeof keys === \"string\") keys = [keys];\n\tconst extendSources = [];\n\tfor (const key of keys) {\n\t\textendSources.push(...(Array.isArray(config[key]) ? config[key] : [config[key]]).filter(Boolean));\n\t\tdelete config[key];\n\t}\n\tfor (let extendSource of extendSources) {\n\t\tconst originalExtendSource = extendSource;\n\t\tlet sourceOptions = {};\n\t\tif (extendSource.source) {\n\t\t\tsourceOptions = extendSource.options || {};\n\t\t\textendSource = extendSource.source;\n\t\t}\n\t\tif (Array.isArray(extendSource)) {\n\t\t\tsourceOptions = extendSource[1] || {};\n\t\t\textendSource = extendSource[0];\n\t\t}\n\t\tif (typeof extendSource !== \"string\") {\n\t\t\tconsole.warn(`Cannot extend config from \\`${JSON.stringify(originalExtendSource)}\\` in ${options.cwd}`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst _config = await resolveConfig(extendSource, options, sourceOptions);\n\t\tif (!_config.config) {\n\t\t\tconsole.warn(`Cannot extend config from \\`${extendSource}\\` in ${options.cwd}`);\n\t\t\tcontinue;\n\t\t}\n\t\tawait extendConfig(_config.config, {\n\t\t\t...options,\n\t\t\tcwd: _config.cwd\n\t\t});\n\t\tconfig._layers.push(_config);\n\t\tif (_config.config._layers) {\n\t\t\tconfig._layers.push(..._config.config._layers);\n\t\t\tdelete _config.config._layers;\n\t\t}\n\t}\n}\nconst GIGET_PREFIXES = [\n\t\"gh:\",\n\t\"github:\",\n\t\"gitlab:\",\n\t\"bitbucket:\",\n\t\"https://\",\n\t\"http://\"\n];\nconst NPM_PACKAGE_RE = /^(@[\\da-z~-][\\d._a-z~-]*\\/)?[\\da-z~-][\\d._a-z~-]*($|\\/.*)/;\nasync function resolveConfig(source, options, sourceOptions = {}) {\n\tif (options.resolve) {\n\t\tconst res$1 = await options.resolve(source, options);\n\t\tif (res$1) return res$1;\n\t}\n\tconst _merger = options.merger || defu;\n\tconst customProviderKeys = Object.keys(sourceOptions.giget?.providers || {}).map((key) => `${key}:`);\n\tconst gigetPrefixes = customProviderKeys.length > 0 ? [...new Set([...customProviderKeys, ...GIGET_PREFIXES])] : GIGET_PREFIXES;\n\tif (options.giget !== false && gigetPrefixes.some((prefix) => source.startsWith(prefix))) {\n\t\tconst { downloadTemplate } = await import(\"giget\");\n\t\tconst { digest } = await import(\"ohash\");\n\t\tconst cloneName = source.replace(/\\W+/g, \"_\").split(\"_\").splice(0, 3).join(\"_\") + \"_\" + digest(source).slice(0, 10).replace(/[-_]/g, \"\");\n\t\tlet cloneDir;\n\t\tconst localNodeModules = resolve(options.cwd, \"node_modules\");\n\t\tconst parentDir = dirname(options.cwd);\n\t\tif (basename(parentDir) === \".c12\") cloneDir = join(parentDir, cloneName);\n\t\telse if (existsSync(localNodeModules)) cloneDir = join(localNodeModules, \".c12\", cloneName);\n\t\telse cloneDir = process.env.XDG_CACHE_HOME ? resolve(process.env.XDG_CACHE_HOME, \"c12\", cloneName) : resolve(homedir(), \".cache/c12\", cloneName);\n\t\tif (existsSync(cloneDir) && !sourceOptions.install) await rm(cloneDir, { recursive: true });\n\t\tsource = (await downloadTemplate(source, {\n\t\t\tdir: cloneDir,\n\t\t\tinstall: sourceOptions.install,\n\t\t\tforce: sourceOptions.install,\n\t\t\tauth: sourceOptions.auth,\n\t\t\t...options.giget,\n\t\t\t...sourceOptions.giget\n\t\t})).dir;\n\t}\n\tif (NPM_PACKAGE_RE.test(source)) source = tryResolve(source, options) || source;\n\tconst ext = extname(source);\n\tconst isDir = !ext || ext === basename(source);\n\tconst cwd = resolve(options.cwd, isDir ? source : dirname(source));\n\tif (isDir) source = options.configFile;\n\tconst res = {\n\t\tconfig: void 0,\n\t\tconfigFile: void 0,\n\t\tcwd,\n\t\tsource,\n\t\tsourceOptions\n\t};\n\tres.configFile = tryResolve(resolve(cwd, source), options) || tryResolve(resolve(cwd, \".config\", source.replace(/\\.config$/, \"\")), options) || tryResolve(resolve(cwd, \".config\", source), options) || source;\n\tif (!existsSync(res.configFile)) return res;\n\tres._configFile = res.configFile;\n\tconst configFileExt = extname(res.configFile) || \"\";\n\tif (configFileExt in ASYNC_LOADERS) res.config = (await ASYNC_LOADERS[configFileExt]())(await readFile(res.configFile, \"utf8\"));\n\telse res.config = await options.jiti.import(res.configFile, { default: true });\n\tif (typeof res.config === \"function\") res.config = await res.config(options.context);\n\tif (options.envName) {\n\t\tconst envConfig = {\n\t\t\t...res.config[\"$\" + options.envName],\n\t\t\t...res.config.$env?.[options.envName]\n\t\t};\n\t\tif (Object.keys(envConfig).length > 0) res.config = _merger(envConfig, res.config);\n\t}\n\tres.meta = defu(res.sourceOptions.meta, res.config.$meta);\n\tdelete res.config.$meta;\n\tif (res.sourceOptions.overrides) res.config = _merger(res.sourceOptions.overrides, res.config);\n\tres.configFile = _normalize(res.configFile);\n\tres.source = _normalize(res.source);\n\treturn res;\n}\nfunction tryResolve(id, options) {\n\tconst res = resolveModulePath(id, {\n\t\ttry: true,\n\t\tfrom: pathToFileURL(join(options.cwd || \".\", options.configFile || \"/\")),\n\t\tsuffixes: [\"\", \"/index\"],\n\t\textensions: SUPPORTED_EXTENSIONS,\n\t\tcache: false\n\t});\n\treturn res ? normalize(res) : void 0;\n}\n\n//#endregion\n//#region src/types.ts\nfunction createDefineConfig() {\n\treturn (input) => input;\n}\n\n//#endregion\n//#region src/watch.ts\nconst eventMap = {\n\tadd: \"created\",\n\tchange: \"updated\",\n\tunlink: \"removed\"\n};\nasync function watchConfig(options) {\n\tlet config = await loadConfig(options);\n\tconst configName = options.name || \"config\";\n\tconst configFileName = options.configFile ?? (options.name === \"config\" ? \"config\" : `${options.name}.config`);\n\tconst watchingFiles = [...new Set((config.layers || []).filter((l) => l.cwd).flatMap((l) => [\n\t\t...SUPPORTED_EXTENSIONS.flatMap((ext) => [\n\t\t\tresolve(l.cwd, configFileName + ext),\n\t\t\tresolve(l.cwd, \".config\", configFileName + ext),\n\t\t\tresolve(l.cwd, \".config\", configFileName.replace(/\\.config$/, \"\") + ext)\n\t\t]),\n\t\tl.source && resolve(l.cwd, l.source),\n\t\toptions.rcFile && resolve(l.cwd, typeof options.rcFile === \"string\" ? options.rcFile : `.${configName}rc`),\n\t\toptions.packageJson && resolve(l.cwd, \"package.json\")\n\t]).filter(Boolean))];\n\tconst watch = await import(\"chokidar\").then((r) => r.watch || r.default || r);\n\tconst { diff } = await import(\"ohash/utils\");\n\tconst _fswatcher = watch(watchingFiles, {\n\t\tignoreInitial: true,\n\t\t...options.chokidarOptions\n\t});\n\tconst onChange = async (event, path) => {\n\t\tconst type = eventMap[event];\n\t\tif (!type) return;\n\t\tif (options.onWatch) await options.onWatch({\n\t\t\ttype,\n\t\t\tpath\n\t\t});\n\t\tconst oldConfig = config;\n\t\ttry {\n\t\t\tconfig = await loadConfig(options);\n\t\t} catch (error) {\n\t\t\tconsole.warn(`Failed to load config ${path}\\n${error}`);\n\t\t\treturn;\n\t\t}\n\t\tconst changeCtx = {\n\t\t\tnewConfig: config,\n\t\t\toldConfig,\n\t\t\tgetDiff: () => diff(oldConfig.config, config.config)\n\t\t};\n\t\tif (options.acceptHMR) {\n\t\t\tif (await options.acceptHMR(changeCtx)) return;\n\t\t}\n\t\tif (options.onUpdate) await options.onUpdate(changeCtx);\n\t};\n\tif (options.debounce === false) _fswatcher.on(\"all\", onChange);\n\telse _fswatcher.on(\"all\", debounce(onChange, options.debounce ?? 100));\n\tconst utils = {\n\t\twatchingFiles,\n\t\tunwatch: async () => {\n\t\t\tawait _fswatcher.close();\n\t\t}\n\t};\n\treturn new Proxy(utils, { get(_, prop) {\n\t\tif (prop in utils) return utils[prop];\n\t\treturn config[prop];\n\t} });\n}\n\n//#endregion\nexport { SUPPORTED_EXTENSIONS, createDefineConfig, loadConfig, loadDotenv, setupDotenv, watchConfig };"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,eAAe,YAAY,SAAS;CACnC,MAAM,oBAAoB,QAAQ,OAAO,QAAQ;CACjD,MAAM,cAAc,MAAM,WAAW;EACpC,KAAK,QAAQ;EACb,UAAU,QAAQ,YAAY;E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4
|
-
function i(e, t
|
|
4
|
+
function i(e, t = {}) {
|
|
5
5
|
return {
|
|
6
|
-
sample: t
|
|
7
|
-
whiteSpace: t
|
|
6
|
+
sample: t.indent === void 0 && t.preserveIndentation !== !1 && e.slice(0, t?.sampleSize || 1024),
|
|
7
|
+
whiteSpace: t.preserveWhitespace === !1 ? void 0 : {
|
|
8
8
|
start: n.exec(e)?.[0] || ``,
|
|
9
9
|
end: r.exec(e)?.[0] || ``
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
function a(e, n
|
|
14
|
-
!n
|
|
13
|
+
function a(e, n, r) {
|
|
14
|
+
!n || typeof n != `object` || Object.defineProperty(n, t, {
|
|
15
15
|
enumerable: !1,
|
|
16
16
|
configurable: !0,
|
|
17
17
|
writable: !0,
|
|
18
|
-
value: i(e, r
|
|
18
|
+
value: i(e, r)
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
//#region ../../node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs
|
|
2
2
|
const t = Symbol.for(`__confbox_fmt__`), n = /^(\s+)/, r = /(\s+)$/;
|
|
3
|
-
function i(e, t
|
|
3
|
+
function i(e, t = {}) {
|
|
4
4
|
return {
|
|
5
|
-
sample: t
|
|
6
|
-
whiteSpace: t
|
|
5
|
+
sample: t.indent === void 0 && t.preserveIndentation !== !1 && e.slice(0, t?.sampleSize || 1024),
|
|
6
|
+
whiteSpace: t.preserveWhitespace === !1 ? void 0 : {
|
|
7
7
|
start: n.exec(e)?.[0] || ``,
|
|
8
8
|
end: r.exec(e)?.[0] || ``
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
function a(e, n
|
|
13
|
-
!n
|
|
12
|
+
function a(e, n, r) {
|
|
13
|
+
!n || typeof n != `object` || Object.defineProperty(n, t, {
|
|
14
14
|
enumerable: !1,
|
|
15
15
|
configurable: !0,
|
|
16
16
|
writable: !0,
|
|
17
|
-
value: i(e, r
|
|
17
|
+
value: i(e, r)
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_format.mjs","names":[
|
|
1
|
+
{"version":3,"file":"_format.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs"],"sourcesContent":["import{t as e}from\"./libs/detect-indent.mjs\";const t=Symbol.for(`__confbox_fmt__`),n=/^(\\s+)/,r=/(\\s+)$/;function i(e,t={}){return{sample:t.indent===void 0&&t.preserveIndentation!==!1&&e.slice(0,t?.sampleSize||1024),whiteSpace:t.preserveWhitespace===!1?void 0:{start:n.exec(e)?.[0]||``,end:r.exec(e)?.[0]||``}}}function a(e,n,r){!n||typeof n!=`object`||Object.defineProperty(n,t,{enumerable:!1,configurable:!0,writable:!0,value:i(e,r)})}function o(n,r){if(!n||typeof n!=`object`||!(t in n))return{indent:r?.indent??2,whitespace:{start:``,end:``}};let i=n[t];return{indent:r?.indent||e(i.sample||``).indent,whitespace:i.whiteSpace||{start:``,end:``}}}export{a as n,o as t};"],"x_google_ignoreList":[0],"mappings":";AAA6C,MAAM,IAAE,OAAO,IAAI,kBAAkB,EAAC,IAAE,UAAS,IAAE;AAAS,SAAS,EAAE,GAAE,IAAE,EAAE,EAAC;AAAC,QAAM;EAAC,QAAO,EAAE,WAAS,KAAK,KAAG,EAAE,wBAAsB,CAAC,KAAG,EAAE,MAAM,GAAE,GAAG,cAAY,KAAK;EAAC,YAAW,EAAE,uBAAqB,CAAC,IAAE,KAAK,IAAE;GAAC,OAAM,EAAE,KAAK,EAAE,GAAG,MAAI;GAAG,KAAI,EAAE,KAAK,EAAE,GAAG,MAAI;GAAG;EAAC;;AAAC,SAAS,EAAE,GAAE,GAAE,GAAE;AAAC,EAAC,KAAG,OAAO,KAAG,YAAU,OAAO,eAAe,GAAE,GAAE;EAAC,YAAW,CAAC;EAAE,cAAa,CAAC;EAAE,UAAS,CAAC;EAAE,OAAM,EAAE,GAAE,EAAE;EAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require__format = require('./_format.cjs');
|
|
2
2
|
|
|
3
3
|
//#region ../../node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs
|
|
4
|
-
function n(t, n
|
|
5
|
-
let r = JSON.parse(t, n
|
|
6
|
-
return require__format.a(t, r, n
|
|
4
|
+
function n(t, n) {
|
|
5
|
+
let r = JSON.parse(t, n?.reviver);
|
|
6
|
+
return require__format.a(t, r, n), r;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a } from "./_format.mjs";
|
|
2
2
|
|
|
3
3
|
//#region ../../node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs
|
|
4
|
-
function n(t, n
|
|
5
|
-
let r = JSON.parse(t, n
|
|
6
|
-
return a(t, r, n
|
|
4
|
+
function n(t, n) {
|
|
5
|
+
let r = JSON.parse(t, n?.reviver);
|
|
6
|
+
return a(t, r, n), r;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
//#endregion
|
package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.mjs","names":["
|
|
1
|
+
{"version":3,"file":"json.mjs","names":["e"],"sources":["../../../../../../../../../../node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs"],"sourcesContent":["import{n as e,t}from\"./_format.mjs\";function n(t,n){let r=JSON.parse(t,n?.reviver);return e(t,r,n),r}function r(e,n){let r=t(e,n),i=JSON.stringify(e,n?.replacer,r.indent);return r.whitespace.start+i+r.whitespace.end}export{r as n,n as t};"],"x_google_ignoreList":[0],"mappings":";;;AAAoC,SAAS,EAAE,GAAE,GAAE;CAAC,IAAI,IAAE,KAAK,MAAM,GAAE,GAAG,QAAQ;AAAC,QAAOA,EAAE,GAAE,GAAE,EAAE,EAAC"}
|