@powerlines/plugin-env 0.15.161 → 0.15.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CNVrAnJR.cjs → _virtual/rolldown_runtime.cjs} +3 -18
- package/dist/{chunk-CsF2CmBJ.mjs → _virtual/rolldown_runtime.mjs} +1 -1
- package/dist/babel/index.cjs +2 -5
- package/dist/babel/index.d.cts +1 -14
- package/dist/babel/index.d.mts +1 -14
- package/dist/babel/index.mjs +1 -4
- package/dist/babel/plugin.cjs +140 -4
- package/dist/babel/plugin.d.cts +9 -15
- package/dist/babel/plugin.d.cts.map +1 -0
- package/dist/babel/plugin.d.mts +9 -15
- package/dist/babel/plugin.d.mts.map +1 -0
- package/dist/babel/plugin.mjs +140 -4
- package/dist/babel/plugin.mjs.map +1 -0
- package/dist/components/docs.cjs +66 -6
- package/dist/components/docs.d.cts +25 -2
- package/dist/components/docs.d.cts.map +1 -0
- package/dist/components/docs.d.mts +25 -2
- package/dist/components/docs.d.mts.map +1 -0
- package/dist/components/docs.mjs +66 -6
- package/dist/components/docs.mjs.map +1 -0
- package/dist/components/env.cjs +582 -11
- package/dist/components/env.d.cts +23 -2
- package/dist/components/env.d.cts.map +1 -0
- package/dist/components/env.d.mts +23 -2
- package/dist/components/env.d.mts.map +1 -0
- package/dist/components/env.mjs +581 -10
- package/dist/components/env.mjs.map +1 -0
- package/dist/components/index.cjs +5 -15
- package/dist/components/index.d.cts +2 -3
- package/dist/components/index.d.mts +2 -3
- package/dist/components/index.mjs +2 -12
- package/dist/helpers/automd-generator.cjs +31 -3
- package/dist/helpers/automd-generator.mjs +31 -3
- package/dist/helpers/automd-generator.mjs.map +1 -0
- package/dist/helpers/create-reflection-resource.cjs +21 -4
- package/dist/helpers/create-reflection-resource.d.cts +14 -4
- package/dist/helpers/create-reflection-resource.d.cts.map +1 -0
- package/dist/helpers/create-reflection-resource.d.mts +14 -4
- package/dist/helpers/create-reflection-resource.d.mts.map +1 -0
- package/dist/helpers/create-reflection-resource.mjs +22 -4
- package/dist/helpers/create-reflection-resource.mjs.map +1 -0
- package/dist/helpers/docs-helper.cjs +22 -5
- package/dist/helpers/docs-helper.d.cts +1 -2
- package/dist/helpers/docs-helper.d.cts.map +1 -1
- package/dist/helpers/docs-helper.d.mts +1 -2
- package/dist/helpers/docs-helper.d.mts.map +1 -1
- package/dist/helpers/docs-helper.mjs +23 -5
- package/dist/helpers/docs-helper.mjs.map +1 -0
- package/dist/helpers/index.cjs +32 -38
- package/dist/helpers/index.d.cts +6 -9
- package/dist/helpers/index.d.mts +6 -9
- package/dist/helpers/index.mjs +6 -12
- package/dist/helpers/load.cjs +133 -10
- package/dist/helpers/load.d.cts +36 -4
- package/dist/helpers/load.d.cts.map +1 -0
- package/dist/helpers/load.d.mts +36 -4
- package/dist/helpers/load.d.mts.map +1 -0
- package/dist/helpers/load.mjs +132 -9
- package/dist/helpers/load.mjs.map +1 -0
- package/dist/helpers/persistence.cjs +321 -15
- package/dist/helpers/persistence.d.cts +85 -4
- package/dist/helpers/persistence.d.cts.map +1 -0
- package/dist/helpers/persistence.d.mts +85 -4
- package/dist/helpers/persistence.d.mts.map +1 -0
- package/dist/helpers/persistence.mjs +310 -5
- package/dist/helpers/persistence.mjs.map +1 -0
- package/dist/helpers/reflect.cjs +262 -13
- package/dist/helpers/reflect.d.cts +47 -4
- package/dist/helpers/reflect.d.cts.map +1 -0
- package/dist/helpers/reflect.d.mts +47 -4
- package/dist/helpers/reflect.d.mts.map +1 -0
- package/dist/helpers/reflect.mjs +254 -5
- package/dist/helpers/reflect.mjs.map +1 -0
- package/dist/helpers/source-file-env.cjs +57 -3
- package/dist/helpers/source-file-env.d.cts +9 -2
- package/dist/helpers/source-file-env.d.cts.map +1 -0
- package/dist/helpers/source-file-env.d.mts +9 -2
- package/dist/helpers/source-file-env.d.mts.map +1 -0
- package/dist/helpers/source-file-env.mjs +56 -2
- package/dist/helpers/source-file-env.mjs.map +1 -0
- package/dist/helpers/template-helpers.cjs +69 -6
- package/dist/helpers/template-helpers.d.cts +16 -4
- package/dist/helpers/template-helpers.d.cts.map +1 -0
- package/dist/helpers/template-helpers.d.mts +16 -4
- package/dist/helpers/template-helpers.d.mts.map +1 -0
- package/dist/helpers/template-helpers.mjs +69 -6
- package/dist/helpers/template-helpers.mjs.map +1 -0
- package/dist/index.cjs +98 -258
- package/dist/index.d.cts +25 -15
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +25 -15
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +22 -182
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/parse-type-definition.cjs +37 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/parse-type-definition.mjs +38 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/parse-type-definition.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/to-array.cjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/to-array.mjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/to-array.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.cjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/index.cjs +3 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/index.mjs +5 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.cjs +6 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs +7 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-collection.cjs +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-collection.mjs +3 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-object.cjs +19 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs +20 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.cjs +63 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs +64 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-string.cjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/type-detect.cjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs +17 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.38/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-parent-path.cjs +32 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-parent-path.mjs +33 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-parent-path.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-type.cjs +28 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs +29 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs.map +1 -0
- package/dist/{join-paths-B0RBTuuw.cjs → node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.cjs} +13 -65
- package/dist/{join-paths-Dd9KxuyL.mjs → node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs} +5 -45
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/regex.cjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/regex.mjs +9 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/regex.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/slash.cjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/slash.mjs +15 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.26.4/node_modules/@stryke/path/dist/slash.mjs.map +1 -0
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.cjs +346 -0
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs +347 -0
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs.map +1 -0
- package/dist/{json5-DEV_07Nb.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.cjs} +1 -1
- package/dist/{json5-jq90mF9X.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.mjs} +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.mjs.map +1 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.cjs +3 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.mjs +3 -0
- package/dist/{confbox.DA7CpUDY-DShUZ_rW.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs} +2 -2
- package/dist/{confbox.DA7CpUDY-r6FXRsI6.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs} +2 -7
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs.map +1 -0
- package/dist/{confbox.DnMsyigM-C13n3X-S.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs} +3 -13
- package/dist/{confbox.DnMsyigM-V6Wj0LPC.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs} +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs.map +1 -0
- package/dist/{toml-DvrxV201.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.cjs} +1 -1
- package/dist/{toml-uuOYvEAO.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.mjs} +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.mjs.map +1 -0
- package/dist/{yaml-CQSFMRMS.cjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.cjs} +1 -1
- package/dist/{yaml-CIn2Gddw.mjs → node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.mjs} +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.mjs.map +1 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +43 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +43 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs.map +1 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +46 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +46 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.cjs +288 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.mjs +286 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.mjs.map +1 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.cjs +71 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.mjs +69 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.mjs.map +1 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +1013 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +1008 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +23 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +14 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +2698 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +2686 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs.map +1 -0
- package/dist/{load-CC_Pu2Om.cjs → node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs} +195 -2332
- package/dist/{load-EM4edkA2.mjs → node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs} +195 -2319
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs.map +1 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +29 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +30 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs.map +1 -0
- package/dist/{multipart-parser-aEF5a4Xf.cjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs} +8 -5
- package/dist/{multipart-parser-D65rtMfY.mjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs} +4 -3
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +22 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +18 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +1 -0
- package/dist/{node-Co8KdzkZ.cjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs} +796 -814
- package/dist/{node-D9MigVDD.mjs → node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs} +795 -807
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +11768 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +11764 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +25 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +21 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +20 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +18 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/nypm@0.6.4/node_modules/nypm/dist/index.cjs +194 -0
- package/dist/node_modules/.pnpm/nypm@0.6.4/node_modules/nypm/dist/index.mjs +192 -0
- package/dist/node_modules/.pnpm/nypm@0.6.4/node_modules/nypm/dist/index.mjs.map +1 -0
- package/dist/{dist-BQc8ZRwl.cjs → node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs} +1 -1
- package/dist/{dist-mV5Swt78.mjs → node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs} +1 -1
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.cjs +3 -0
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs +3 -0
- package/dist/{defu-DV5Grr85.mjs → node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs} +8 -43
- package/dist/{defu-CrqNIh1A.cjs → node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs} +2 -90
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +1 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +127 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +126 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +138 -0
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +137 -0
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +629 -0
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +628 -0
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs.map +1 -0
- package/dist/types/index.cjs +9 -10
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/index.mjs +2 -3
- package/dist/types/plugin.cjs +133 -7
- package/dist/types/plugin.d.cts +155 -3
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +155 -3
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +129 -3
- package/dist/types/plugin.mjs.map +1 -0
- package/dist/types/runtime.cjs +242 -3
- package/dist/types/runtime.d.cts +792 -2
- package/dist/{runtime-BDzzR4wH.d.cts.map → types/runtime.d.cts.map} +1 -1
- package/dist/types/runtime.d.mts +792 -2
- package/dist/{runtime-lYSIZdMn.d.mts.map → types/runtime.d.mts.map} +1 -1
- package/dist/types/runtime.mjs +241 -2
- package/dist/types/runtime.mjs.map +1 -0
- package/package.json +9 -9
- package/dist/automd-generator-BpvZRK0k.mjs +0 -32
- package/dist/automd-generator-BpvZRK0k.mjs.map +0 -1
- package/dist/automd-generator-CxG1owAE.cjs +0 -37
- package/dist/babel-BZqmdVF4.cjs +0 -0
- package/dist/babel-DgietUY3.mjs +0 -1
- package/dist/components-BUo6Koax.cjs +0 -0
- package/dist/components-DDFmImcI.mjs +0 -1
- package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs.map +0 -1
- package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs.map +0 -1
- package/dist/create-reflection-resource-3svZm2rY.d.cts +0 -14
- package/dist/create-reflection-resource-3svZm2rY.d.cts.map +0 -1
- package/dist/create-reflection-resource-CCpA76Yq.d.mts +0 -14
- package/dist/create-reflection-resource-CCpA76Yq.d.mts.map +0 -1
- package/dist/create-reflection-resource-D0QrD1Td.mjs +0 -23
- package/dist/create-reflection-resource-D0QrD1Td.mjs.map +0 -1
- package/dist/create-reflection-resource-d2zdTyOE.cjs +0 -27
- package/dist/defu-DV5Grr85.mjs.map +0 -1
- package/dist/dist-C_a6goTt.cjs +0 -15282
- package/dist/dist-CjWvISyq.mjs +0 -15271
- package/dist/dist-CjWvISyq.mjs.map +0 -1
- package/dist/dist-mV5Swt78.mjs.map +0 -1
- package/dist/docs-BAKwE4PJ.d.cts +0 -25
- package/dist/docs-BAKwE4PJ.d.cts.map +0 -1
- package/dist/docs-CVf-w8oz.d.mts +0 -25
- package/dist/docs-CVf-w8oz.d.mts.map +0 -1
- package/dist/docs-E0aCTO7H.cjs +0 -72
- package/dist/docs-WdCIcQmw.mjs +0 -67
- package/dist/docs-WdCIcQmw.mjs.map +0 -1
- package/dist/docs-helper-BSYSI2cH.mjs +0 -24
- package/dist/docs-helper-BSYSI2cH.mjs.map +0 -1
- package/dist/docs-helper-BWe1dt1m.cjs +0 -28
- package/dist/env-BSCEigpj.cjs +0 -593
- package/dist/env-D0KBPuAd.d.mts +0 -23
- package/dist/env-D0KBPuAd.d.mts.map +0 -1
- package/dist/env-DqI7dwC-.mjs +0 -582
- package/dist/env-DqI7dwC-.mjs.map +0 -1
- package/dist/env-DwM7pJm7.d.cts +0 -23
- package/dist/env-DwM7pJm7.d.cts.map +0 -1
- package/dist/helpers-45e1bvAO.mjs +0 -1
- package/dist/helpers-DgYP3uej.cjs +0 -0
- package/dist/index-BNRXMhlr.d.mts +0 -1
- package/dist/index-Bdi8CvaN.d.cts +0 -16
- package/dist/index-Bdi8CvaN.d.cts.map +0 -1
- package/dist/index-CEDY7cmG.d.cts +0 -1
- package/dist/index-CREkvfw9.d.mts +0 -1
- package/dist/index-DSiHnMH2.d.cts +0 -1
- package/dist/index-Drhzdkqe.d.mts +0 -16
- package/dist/index-Drhzdkqe.d.mts.map +0 -1
- package/dist/index-dhjtMp5F.d.mts +0 -1
- package/dist/index-uTS5iDq_.d.cts +0 -1
- package/dist/join-paths-Dd9KxuyL.mjs.map +0 -1
- package/dist/json5-jq90mF9X.mjs.map +0 -1
- package/dist/jsonc-CBh70baJ.cjs +0 -4
- package/dist/jsonc-CDLU6bgi.mjs +0 -4
- package/dist/load-EM4edkA2.mjs.map +0 -1
- package/dist/load-GpP6cojj.d.mts +0 -36
- package/dist/load-GpP6cojj.d.mts.map +0 -1
- package/dist/load-PHGmxX_X.d.cts +0 -36
- package/dist/load-PHGmxX_X.d.cts.map +0 -1
- package/dist/multipart-parser-D65rtMfY.mjs.map +0 -1
- package/dist/node-D9MigVDD.mjs.map +0 -1
- package/dist/persistence-5S3EirDm.mjs +0 -586
- package/dist/persistence-5S3EirDm.mjs.map +0 -1
- package/dist/persistence-BR4cUaN6.d.cts +0 -85
- package/dist/persistence-BR4cUaN6.d.cts.map +0 -1
- package/dist/persistence-DrKQZNCv.d.mts +0 -85
- package/dist/persistence-DrKQZNCv.d.mts.map +0 -1
- package/dist/persistence-DzS7SzMj.cjs +0 -712
- package/dist/plugin-CM1TSv1B.cjs +0 -159
- package/dist/plugin-CSVnrdpE.cjs +0 -146
- package/dist/plugin-CSe5f2cD.d.cts +0 -155
- package/dist/plugin-CSe5f2cD.d.cts.map +0 -1
- package/dist/plugin-DMbVjdcQ.d.mts +0 -155
- package/dist/plugin-DMbVjdcQ.d.mts.map +0 -1
- package/dist/plugin-Vyvy9w9Z.mjs +0 -141
- package/dist/plugin-Vyvy9w9Z.mjs.map +0 -1
- package/dist/plugin-eBjQJP6x.mjs +0 -130
- package/dist/plugin-eBjQJP6x.mjs.map +0 -1
- package/dist/reflect-Dm8a3c29.d.cts +0 -47
- package/dist/reflect-Dm8a3c29.d.cts.map +0 -1
- package/dist/reflect-Dpz8ifa0.d.mts +0 -47
- package/dist/reflect-Dpz8ifa0.d.mts.map +0 -1
- package/dist/runtime-BDzzR4wH.d.cts +0 -792
- package/dist/runtime-C5ukCv3P.mjs +0 -242
- package/dist/runtime-C5ukCv3P.mjs.map +0 -1
- package/dist/runtime-g0TEIoZK.cjs +0 -253
- package/dist/runtime-lYSIZdMn.d.mts +0 -792
- package/dist/source-file-env-4Vdtzc5-.cjs +0 -68
- package/dist/source-file-env-Brfopjyr.d.cts +0 -9
- package/dist/source-file-env-Brfopjyr.d.cts.map +0 -1
- package/dist/source-file-env-DWejSP2U.d.mts +0 -9
- package/dist/source-file-env-DWejSP2U.d.mts.map +0 -1
- package/dist/source-file-env-Tj-6qobx.mjs +0 -57
- package/dist/source-file-env-Tj-6qobx.mjs.map +0 -1
- package/dist/template-helpers-1SKodHKt.d.mts +0 -16
- package/dist/template-helpers-1SKodHKt.d.mts.map +0 -1
- package/dist/template-helpers-Cw8aba1r.mjs +0 -70
- package/dist/template-helpers-Cw8aba1r.mjs.map +0 -1
- package/dist/template-helpers-DoFoTIAC.cjs +0 -75
- package/dist/template-helpers-zyitPfMz.d.cts +0 -16
- package/dist/template-helpers-zyitPfMz.d.cts.map +0 -1
- package/dist/toml-uuOYvEAO.mjs.map +0 -1
- package/dist/types-DyPQho_C.mjs +0 -1
- package/dist/types-o3zWarRp.cjs +0 -0
- package/dist/yaml-CIn2Gddw.mjs.map +0 -1
package/dist/{load-EM4edkA2.mjs → node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs}
RENAMED
|
@@ -1,1365 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as __ΩEnvPluginOptions, t as __ΩEnvPluginContext } from "./plugin-eBjQJP6x.mjs";
|
|
3
|
-
import { t as joinPaths } from "./join-paths-Dd9KxuyL.mjs";
|
|
4
|
-
import { n as removeEnvPrefix } from "./source-file-env-Tj-6qobx.mjs";
|
|
5
|
-
import { a as isAbsolute$1, c as resolve$1, i as extname, n as basename, o as join, r as dirname$1, s as normalize$1, t as defu } from "./defu-DV5Grr85.mjs";
|
|
6
|
-
import { n as x, t as h } from "./confbox.DnMsyigM-V6Wj0LPC.mjs";
|
|
7
|
-
import { createRequire } from "node:module";
|
|
8
|
-
import fs, { existsSync, lstatSync, promises, readFileSync, realpathSync, statSync } from "node:fs";
|
|
9
|
-
import { __ΩWorkspaceConfig } from "powerlines/types/config";
|
|
10
|
-
import { loadEnv, loadEnvFile } from "@stryke/env/load-env";
|
|
11
|
-
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
12
|
-
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
13
|
-
import path, { isAbsolute, resolve } from "node:path";
|
|
14
|
-
import { homedir } from "node:os";
|
|
15
|
-
import { readFile, rm, writeFile } from "node:fs/promises";
|
|
16
|
-
import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
|
|
17
|
-
import assert from "node:assert";
|
|
18
|
-
import process$1 from "node:process";
|
|
19
|
-
import v8 from "node:v8";
|
|
20
|
-
import { format, inspect } from "node:util";
|
|
21
|
-
import { DEFAULT_ENVIRONMENT } from "powerlines/lib/constants/environments";
|
|
1
|
+
import { __commonJSMin, __require } from "../../../../../../_virtual/rolldown_runtime.mjs";
|
|
22
2
|
|
|
23
|
-
//#region ../../node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json
|
|
24
|
-
var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25
|
-
module.exports = {
|
|
26
|
-
"name": "dotenv",
|
|
27
|
-
"version": "17.2.3",
|
|
28
|
-
"description": "Loads environment variables from .env file",
|
|
29
|
-
"main": "lib/main.js",
|
|
30
|
-
"types": "lib/main.d.ts",
|
|
31
|
-
"exports": {
|
|
32
|
-
".": {
|
|
33
|
-
"types": "./lib/main.d.ts",
|
|
34
|
-
"require": "./lib/main.js",
|
|
35
|
-
"default": "./lib/main.js"
|
|
36
|
-
},
|
|
37
|
-
"./config": "./config.js",
|
|
38
|
-
"./config.js": "./config.js",
|
|
39
|
-
"./lib/env-options": "./lib/env-options.js",
|
|
40
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
|
41
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
|
42
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
43
|
-
"./package.json": "./package.json"
|
|
44
|
-
},
|
|
45
|
-
"scripts": {
|
|
46
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
47
|
-
"lint": "standard",
|
|
48
|
-
"pretest": "npm run lint && npm run dts-check",
|
|
49
|
-
"test": "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
50
|
-
"test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
|
|
51
|
-
"prerelease": "npm test",
|
|
52
|
-
"release": "standard-version"
|
|
53
|
-
},
|
|
54
|
-
"repository": {
|
|
55
|
-
"type": "git",
|
|
56
|
-
"url": "git://github.com/motdotla/dotenv.git"
|
|
57
|
-
},
|
|
58
|
-
"homepage": "https://github.com/motdotla/dotenv#readme",
|
|
59
|
-
"funding": "https://dotenvx.com",
|
|
60
|
-
"keywords": [
|
|
61
|
-
"dotenv",
|
|
62
|
-
"env",
|
|
63
|
-
".env",
|
|
64
|
-
"environment",
|
|
65
|
-
"variables",
|
|
66
|
-
"config",
|
|
67
|
-
"settings"
|
|
68
|
-
],
|
|
69
|
-
"readmeFilename": "README.md",
|
|
70
|
-
"license": "BSD-2-Clause",
|
|
71
|
-
"devDependencies": {
|
|
72
|
-
"@types/node": "^18.11.3",
|
|
73
|
-
"decache": "^4.6.2",
|
|
74
|
-
"sinon": "^14.0.1",
|
|
75
|
-
"standard": "^17.0.0",
|
|
76
|
-
"standard-version": "^9.5.0",
|
|
77
|
-
"tap": "^19.2.0",
|
|
78
|
-
"typescript": "^4.8.4"
|
|
79
|
-
},
|
|
80
|
-
"engines": { "node": ">=12" },
|
|
81
|
-
"browser": { "fs": false }
|
|
82
|
-
};
|
|
83
|
-
}));
|
|
84
|
-
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region ../../node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js
|
|
87
|
-
var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
88
|
-
const fs$1 = __require("node:fs");
|
|
89
|
-
const path$1 = __require("node:path");
|
|
90
|
-
const os = __require("node:os");
|
|
91
|
-
const crypto = __require("node:crypto");
|
|
92
|
-
const version = require_package().version;
|
|
93
|
-
const TIPS = [
|
|
94
|
-
"🔐 encrypt with Dotenvx: https://dotenvx.com",
|
|
95
|
-
"🔐 prevent committing .env to code: https://dotenvx.com/precommit",
|
|
96
|
-
"🔐 prevent building .env in docker: https://dotenvx.com/prebuild",
|
|
97
|
-
"📡 add observability to secrets: https://dotenvx.com/ops",
|
|
98
|
-
"👥 sync secrets across teammates & machines: https://dotenvx.com/ops",
|
|
99
|
-
"🗂️ backup and recover secrets: https://dotenvx.com/ops",
|
|
100
|
-
"✅ audit secrets and track compliance: https://dotenvx.com/ops",
|
|
101
|
-
"🔄 add secrets lifecycle management: https://dotenvx.com/ops",
|
|
102
|
-
"🔑 add access controls to secrets: https://dotenvx.com/ops",
|
|
103
|
-
"🛠️ run anywhere with `dotenvx run -- yourcommand`",
|
|
104
|
-
"⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
|
|
105
|
-
"⚙️ enable debug logging with { debug: true }",
|
|
106
|
-
"⚙️ override existing env vars with { override: true }",
|
|
107
|
-
"⚙️ suppress all logs with { quiet: true }",
|
|
108
|
-
"⚙️ write to custom object with { processEnv: myObject }",
|
|
109
|
-
"⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"
|
|
110
|
-
];
|
|
111
|
-
function _getRandomTip() {
|
|
112
|
-
return TIPS[Math.floor(Math.random() * TIPS.length)];
|
|
113
|
-
}
|
|
114
|
-
function parseBoolean(value) {
|
|
115
|
-
if (typeof value === "string") return ![
|
|
116
|
-
"false",
|
|
117
|
-
"0",
|
|
118
|
-
"no",
|
|
119
|
-
"off",
|
|
120
|
-
""
|
|
121
|
-
].includes(value.toLowerCase());
|
|
122
|
-
return Boolean(value);
|
|
123
|
-
}
|
|
124
|
-
function supportsAnsi() {
|
|
125
|
-
return process.stdout.isTTY;
|
|
126
|
-
}
|
|
127
|
-
function dim(text) {
|
|
128
|
-
return supportsAnsi() ? `\x1b[2m${text}\x1b[0m` : text;
|
|
129
|
-
}
|
|
130
|
-
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
|
131
|
-
function parse$1(src) {
|
|
132
|
-
const obj = {};
|
|
133
|
-
let lines = src.toString();
|
|
134
|
-
lines = lines.replace(/\r\n?/gm, "\n");
|
|
135
|
-
let match;
|
|
136
|
-
while ((match = LINE.exec(lines)) != null) {
|
|
137
|
-
const key = match[1];
|
|
138
|
-
let value = match[2] || "";
|
|
139
|
-
value = value.trim();
|
|
140
|
-
const maybeQuote = value[0];
|
|
141
|
-
value = value.replace(/^(['"`])([\s\S]*)\1$/gm, "$2");
|
|
142
|
-
if (maybeQuote === "\"") {
|
|
143
|
-
value = value.replace(/\\n/g, "\n");
|
|
144
|
-
value = value.replace(/\\r/g, "\r");
|
|
145
|
-
}
|
|
146
|
-
obj[key] = value;
|
|
147
|
-
}
|
|
148
|
-
return obj;
|
|
149
|
-
}
|
|
150
|
-
function _parseVault(options) {
|
|
151
|
-
options = options || {};
|
|
152
|
-
const vaultPath = _vaultPath(options);
|
|
153
|
-
options.path = vaultPath;
|
|
154
|
-
const result = DotenvModule.configDotenv(options);
|
|
155
|
-
if (!result.parsed) {
|
|
156
|
-
const err = /* @__PURE__ */ new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
157
|
-
err.code = "MISSING_DATA";
|
|
158
|
-
throw err;
|
|
159
|
-
}
|
|
160
|
-
const keys = _dotenvKey(options).split(",");
|
|
161
|
-
const length = keys.length;
|
|
162
|
-
let decrypted;
|
|
163
|
-
for (let i = 0; i < length; i++) try {
|
|
164
|
-
const attrs = _instructions(result, keys[i].trim());
|
|
165
|
-
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
166
|
-
break;
|
|
167
|
-
} catch (error) {
|
|
168
|
-
if (i + 1 >= length) throw error;
|
|
169
|
-
}
|
|
170
|
-
return DotenvModule.parse(decrypted);
|
|
171
|
-
}
|
|
172
|
-
function _warn(message) {
|
|
173
|
-
console.error(`[dotenv@${version}][WARN] ${message}`);
|
|
174
|
-
}
|
|
175
|
-
function _debug(message) {
|
|
176
|
-
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
177
|
-
}
|
|
178
|
-
function _log(message) {
|
|
179
|
-
console.log(`[dotenv@${version}] ${message}`);
|
|
180
|
-
}
|
|
181
|
-
function _dotenvKey(options) {
|
|
182
|
-
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) return options.DOTENV_KEY;
|
|
183
|
-
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) return process.env.DOTENV_KEY;
|
|
184
|
-
return "";
|
|
185
|
-
}
|
|
186
|
-
function _instructions(result, dotenvKey) {
|
|
187
|
-
let uri;
|
|
188
|
-
try {
|
|
189
|
-
uri = new URL(dotenvKey);
|
|
190
|
-
} catch (error) {
|
|
191
|
-
if (error.code === "ERR_INVALID_URL") {
|
|
192
|
-
const err = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
193
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
194
|
-
throw err;
|
|
195
|
-
}
|
|
196
|
-
throw error;
|
|
197
|
-
}
|
|
198
|
-
const key = uri.password;
|
|
199
|
-
if (!key) {
|
|
200
|
-
const err = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
201
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
202
|
-
throw err;
|
|
203
|
-
}
|
|
204
|
-
const environment = uri.searchParams.get("environment");
|
|
205
|
-
if (!environment) {
|
|
206
|
-
const err = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
207
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
208
|
-
throw err;
|
|
209
|
-
}
|
|
210
|
-
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
211
|
-
const ciphertext = result.parsed[environmentKey];
|
|
212
|
-
if (!ciphertext) {
|
|
213
|
-
const err = /* @__PURE__ */ new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
214
|
-
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
215
|
-
throw err;
|
|
216
|
-
}
|
|
217
|
-
return {
|
|
218
|
-
ciphertext,
|
|
219
|
-
key
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
function _vaultPath(options) {
|
|
223
|
-
let possibleVaultPath = null;
|
|
224
|
-
if (options && options.path && options.path.length > 0) if (Array.isArray(options.path)) {
|
|
225
|
-
for (const filepath of options.path) if (fs$1.existsSync(filepath)) possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
226
|
-
} else possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
227
|
-
else possibleVaultPath = path$1.resolve(process.cwd(), ".env.vault");
|
|
228
|
-
if (fs$1.existsSync(possibleVaultPath)) return possibleVaultPath;
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
function _resolveHome(envPath) {
|
|
232
|
-
return envPath[0] === "~" ? path$1.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
233
|
-
}
|
|
234
|
-
function _configVault(options) {
|
|
235
|
-
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
236
|
-
const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
237
|
-
if (debug || !quiet) _log("Loading env from encrypted .env.vault");
|
|
238
|
-
const parsed = DotenvModule._parseVault(options);
|
|
239
|
-
let processEnv = process.env;
|
|
240
|
-
if (options && options.processEnv != null) processEnv = options.processEnv;
|
|
241
|
-
DotenvModule.populate(processEnv, parsed, options);
|
|
242
|
-
return { parsed };
|
|
243
|
-
}
|
|
244
|
-
function configDotenv(options) {
|
|
245
|
-
const dotenvPath = path$1.resolve(process.cwd(), ".env");
|
|
246
|
-
let encoding = "utf8";
|
|
247
|
-
let processEnv = process.env;
|
|
248
|
-
if (options && options.processEnv != null) processEnv = options.processEnv;
|
|
249
|
-
let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
250
|
-
let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
251
|
-
if (options && options.encoding) encoding = options.encoding;
|
|
252
|
-
else if (debug) _debug("No encoding is specified. UTF-8 is used by default");
|
|
253
|
-
let optionPaths = [dotenvPath];
|
|
254
|
-
if (options && options.path) if (!Array.isArray(options.path)) optionPaths = [_resolveHome(options.path)];
|
|
255
|
-
else {
|
|
256
|
-
optionPaths = [];
|
|
257
|
-
for (const filepath of options.path) optionPaths.push(_resolveHome(filepath));
|
|
258
|
-
}
|
|
259
|
-
let lastError;
|
|
260
|
-
const parsedAll = {};
|
|
261
|
-
for (const path$2 of optionPaths) try {
|
|
262
|
-
const parsed = DotenvModule.parse(fs$1.readFileSync(path$2, { encoding }));
|
|
263
|
-
DotenvModule.populate(parsedAll, parsed, options);
|
|
264
|
-
} catch (e) {
|
|
265
|
-
if (debug) _debug(`Failed to load ${path$2} ${e.message}`);
|
|
266
|
-
lastError = e;
|
|
267
|
-
}
|
|
268
|
-
const populated = DotenvModule.populate(processEnv, parsedAll, options);
|
|
269
|
-
debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
|
|
270
|
-
quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
|
|
271
|
-
if (debug || !quiet) {
|
|
272
|
-
const keysCount = Object.keys(populated).length;
|
|
273
|
-
const shortPaths = [];
|
|
274
|
-
for (const filePath of optionPaths) try {
|
|
275
|
-
const relative = path$1.relative(process.cwd(), filePath);
|
|
276
|
-
shortPaths.push(relative);
|
|
277
|
-
} catch (e) {
|
|
278
|
-
if (debug) _debug(`Failed to load ${filePath} ${e.message}`);
|
|
279
|
-
lastError = e;
|
|
280
|
-
}
|
|
281
|
-
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`);
|
|
282
|
-
}
|
|
283
|
-
if (lastError) return {
|
|
284
|
-
parsed: parsedAll,
|
|
285
|
-
error: lastError
|
|
286
|
-
};
|
|
287
|
-
else return { parsed: parsedAll };
|
|
288
|
-
}
|
|
289
|
-
function config(options) {
|
|
290
|
-
if (_dotenvKey(options).length === 0) return DotenvModule.configDotenv(options);
|
|
291
|
-
const vaultPath = _vaultPath(options);
|
|
292
|
-
if (!vaultPath) {
|
|
293
|
-
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
294
|
-
return DotenvModule.configDotenv(options);
|
|
295
|
-
}
|
|
296
|
-
return DotenvModule._configVault(options);
|
|
297
|
-
}
|
|
298
|
-
function decrypt(encrypted, keyStr) {
|
|
299
|
-
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
300
|
-
let ciphertext = Buffer.from(encrypted, "base64");
|
|
301
|
-
const nonce = ciphertext.subarray(0, 12);
|
|
302
|
-
const authTag = ciphertext.subarray(-16);
|
|
303
|
-
ciphertext = ciphertext.subarray(12, -16);
|
|
304
|
-
try {
|
|
305
|
-
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
306
|
-
aesgcm.setAuthTag(authTag);
|
|
307
|
-
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
308
|
-
} catch (error) {
|
|
309
|
-
const isRange = error instanceof RangeError;
|
|
310
|
-
const invalidKeyLength = error.message === "Invalid key length";
|
|
311
|
-
const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
|
|
312
|
-
if (isRange || invalidKeyLength) {
|
|
313
|
-
const err = /* @__PURE__ */ new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
314
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
315
|
-
throw err;
|
|
316
|
-
} else if (decryptionFailed) {
|
|
317
|
-
const err = /* @__PURE__ */ new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
318
|
-
err.code = "DECRYPTION_FAILED";
|
|
319
|
-
throw err;
|
|
320
|
-
} else throw error;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function populate(processEnv, parsed, options = {}) {
|
|
324
|
-
const debug = Boolean(options && options.debug);
|
|
325
|
-
const override = Boolean(options && options.override);
|
|
326
|
-
const populated = {};
|
|
327
|
-
if (typeof parsed !== "object") {
|
|
328
|
-
const err = /* @__PURE__ */ new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
329
|
-
err.code = "OBJECT_REQUIRED";
|
|
330
|
-
throw err;
|
|
331
|
-
}
|
|
332
|
-
for (const key of Object.keys(parsed)) if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
333
|
-
if (override === true) {
|
|
334
|
-
processEnv[key] = parsed[key];
|
|
335
|
-
populated[key] = parsed[key];
|
|
336
|
-
}
|
|
337
|
-
if (debug) if (override === true) _debug(`"${key}" is already defined and WAS overwritten`);
|
|
338
|
-
else _debug(`"${key}" is already defined and was NOT overwritten`);
|
|
339
|
-
} else {
|
|
340
|
-
processEnv[key] = parsed[key];
|
|
341
|
-
populated[key] = parsed[key];
|
|
342
|
-
}
|
|
343
|
-
return populated;
|
|
344
|
-
}
|
|
345
|
-
const DotenvModule = {
|
|
346
|
-
configDotenv,
|
|
347
|
-
_configVault,
|
|
348
|
-
_parseVault,
|
|
349
|
-
config,
|
|
350
|
-
decrypt,
|
|
351
|
-
parse: parse$1,
|
|
352
|
-
populate
|
|
353
|
-
};
|
|
354
|
-
module.exports.configDotenv = DotenvModule.configDotenv;
|
|
355
|
-
module.exports._configVault = DotenvModule._configVault;
|
|
356
|
-
module.exports._parseVault = DotenvModule._parseVault;
|
|
357
|
-
module.exports.config = DotenvModule.config;
|
|
358
|
-
module.exports.decrypt = DotenvModule.decrypt;
|
|
359
|
-
module.exports.parse = DotenvModule.parse;
|
|
360
|
-
module.exports.populate = DotenvModule.populate;
|
|
361
|
-
module.exports = DotenvModule;
|
|
362
|
-
}));
|
|
363
|
-
|
|
364
|
-
//#endregion
|
|
365
|
-
//#region ../../node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs
|
|
366
|
-
const nodeBuiltins = [
|
|
367
|
-
"_http_agent",
|
|
368
|
-
"_http_client",
|
|
369
|
-
"_http_common",
|
|
370
|
-
"_http_incoming",
|
|
371
|
-
"_http_outgoing",
|
|
372
|
-
"_http_server",
|
|
373
|
-
"_stream_duplex",
|
|
374
|
-
"_stream_passthrough",
|
|
375
|
-
"_stream_readable",
|
|
376
|
-
"_stream_transform",
|
|
377
|
-
"_stream_wrap",
|
|
378
|
-
"_stream_writable",
|
|
379
|
-
"_tls_common",
|
|
380
|
-
"_tls_wrap",
|
|
381
|
-
"assert",
|
|
382
|
-
"assert/strict",
|
|
383
|
-
"async_hooks",
|
|
384
|
-
"buffer",
|
|
385
|
-
"child_process",
|
|
386
|
-
"cluster",
|
|
387
|
-
"console",
|
|
388
|
-
"constants",
|
|
389
|
-
"crypto",
|
|
390
|
-
"dgram",
|
|
391
|
-
"diagnostics_channel",
|
|
392
|
-
"dns",
|
|
393
|
-
"dns/promises",
|
|
394
|
-
"domain",
|
|
395
|
-
"events",
|
|
396
|
-
"fs",
|
|
397
|
-
"fs/promises",
|
|
398
|
-
"http",
|
|
399
|
-
"http2",
|
|
400
|
-
"https",
|
|
401
|
-
"inspector",
|
|
402
|
-
"inspector/promises",
|
|
403
|
-
"module",
|
|
404
|
-
"net",
|
|
405
|
-
"os",
|
|
406
|
-
"path",
|
|
407
|
-
"path/posix",
|
|
408
|
-
"path/win32",
|
|
409
|
-
"perf_hooks",
|
|
410
|
-
"process",
|
|
411
|
-
"punycode",
|
|
412
|
-
"querystring",
|
|
413
|
-
"readline",
|
|
414
|
-
"readline/promises",
|
|
415
|
-
"repl",
|
|
416
|
-
"stream",
|
|
417
|
-
"stream/consumers",
|
|
418
|
-
"stream/promises",
|
|
419
|
-
"stream/web",
|
|
420
|
-
"string_decoder",
|
|
421
|
-
"sys",
|
|
422
|
-
"timers",
|
|
423
|
-
"timers/promises",
|
|
424
|
-
"tls",
|
|
425
|
-
"trace_events",
|
|
426
|
-
"tty",
|
|
427
|
-
"url",
|
|
428
|
-
"util",
|
|
429
|
-
"util/types",
|
|
430
|
-
"v8",
|
|
431
|
-
"vm",
|
|
432
|
-
"wasi",
|
|
433
|
-
"worker_threads",
|
|
434
|
-
"zlib"
|
|
435
|
-
];
|
|
436
|
-
const own$1 = {}.hasOwnProperty;
|
|
437
|
-
const classRegExp = /^([A-Z][a-z\d]*)+$/;
|
|
438
|
-
const kTypes = new Set([
|
|
439
|
-
"string",
|
|
440
|
-
"function",
|
|
441
|
-
"number",
|
|
442
|
-
"object",
|
|
443
|
-
"Function",
|
|
444
|
-
"Object",
|
|
445
|
-
"boolean",
|
|
446
|
-
"bigint",
|
|
447
|
-
"symbol"
|
|
448
|
-
]);
|
|
449
|
-
const messages = /* @__PURE__ */ new Map();
|
|
450
|
-
const nodeInternalPrefix = "__node_internal_";
|
|
451
|
-
let userStackTraceLimit;
|
|
452
|
-
/**
|
|
453
|
-
* Create a list string in the form like 'A and B' or 'A, B, ..., and Z'.
|
|
454
|
-
* We cannot use Intl.ListFormat because it's not available in
|
|
455
|
-
* --without-intl builds.
|
|
456
|
-
*
|
|
457
|
-
* @param {Array<string>} array
|
|
458
|
-
* An array of strings.
|
|
459
|
-
* @param {string} [type]
|
|
460
|
-
* The list type to be inserted before the last element.
|
|
461
|
-
* @returns {string}
|
|
462
|
-
*/
|
|
463
|
-
function formatList(array, type = "and") {
|
|
464
|
-
return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* Utility function for registering the error codes.
|
|
468
|
-
*/
|
|
469
|
-
function createError(sym, value, constructor) {
|
|
470
|
-
messages.set(sym, value);
|
|
471
|
-
return makeNodeErrorWithCode(constructor, sym);
|
|
472
|
-
}
|
|
473
|
-
function makeNodeErrorWithCode(Base, key) {
|
|
474
|
-
return function NodeError(...parameters) {
|
|
475
|
-
const limit = Error.stackTraceLimit;
|
|
476
|
-
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
|
|
477
|
-
const error = new Base();
|
|
478
|
-
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
|
|
479
|
-
const message = getMessage(key, parameters, error);
|
|
480
|
-
Object.defineProperties(error, {
|
|
481
|
-
message: {
|
|
482
|
-
value: message,
|
|
483
|
-
enumerable: false,
|
|
484
|
-
writable: true,
|
|
485
|
-
configurable: true
|
|
486
|
-
},
|
|
487
|
-
toString: {
|
|
488
|
-
value() {
|
|
489
|
-
return `${this.name} [${key}]: ${this.message}`;
|
|
490
|
-
},
|
|
491
|
-
enumerable: false,
|
|
492
|
-
writable: true,
|
|
493
|
-
configurable: true
|
|
494
|
-
}
|
|
495
|
-
});
|
|
496
|
-
captureLargerStackTrace(error);
|
|
497
|
-
error.code = key;
|
|
498
|
-
return error;
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
function isErrorStackTraceLimitWritable() {
|
|
502
|
-
try {
|
|
503
|
-
if (v8.startupSnapshot.isBuildingSnapshot()) return false;
|
|
504
|
-
} catch {}
|
|
505
|
-
const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
506
|
-
if (desc === void 0) return Object.isExtensible(Error);
|
|
507
|
-
return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* This function removes unnecessary frames from Node.js core errors.
|
|
511
|
-
*/
|
|
512
|
-
function hideStackFrames(wrappedFunction) {
|
|
513
|
-
const hidden = nodeInternalPrefix + wrappedFunction.name;
|
|
514
|
-
Object.defineProperty(wrappedFunction, "name", { value: hidden });
|
|
515
|
-
return wrappedFunction;
|
|
516
|
-
}
|
|
517
|
-
const captureLargerStackTrace = hideStackFrames(function(error) {
|
|
518
|
-
const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
|
|
519
|
-
if (stackTraceLimitIsWritable) {
|
|
520
|
-
userStackTraceLimit = Error.stackTraceLimit;
|
|
521
|
-
Error.stackTraceLimit = Number.POSITIVE_INFINITY;
|
|
522
|
-
}
|
|
523
|
-
Error.captureStackTrace(error);
|
|
524
|
-
if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
|
|
525
|
-
return error;
|
|
526
|
-
});
|
|
527
|
-
function getMessage(key, parameters, self) {
|
|
528
|
-
const message = messages.get(key);
|
|
529
|
-
assert.ok(message !== void 0, "expected `message` to be found");
|
|
530
|
-
if (typeof message === "function") {
|
|
531
|
-
assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
|
|
532
|
-
return Reflect.apply(message, self, parameters);
|
|
533
|
-
}
|
|
534
|
-
const regex = /%[dfijoOs]/g;
|
|
535
|
-
let expectedLength = 0;
|
|
536
|
-
while (regex.exec(message) !== null) expectedLength++;
|
|
537
|
-
assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
|
|
538
|
-
if (parameters.length === 0) return message;
|
|
539
|
-
parameters.unshift(message);
|
|
540
|
-
return Reflect.apply(format, null, parameters);
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* Determine the specific type of a value for type-mismatch errors.
|
|
544
|
-
*/
|
|
545
|
-
function determineSpecificType(value) {
|
|
546
|
-
if (value === null || value === void 0) return String(value);
|
|
547
|
-
if (typeof value === "function" && value.name) return `function ${value.name}`;
|
|
548
|
-
if (typeof value === "object") {
|
|
549
|
-
if (value.constructor && value.constructor.name) return `an instance of ${value.constructor.name}`;
|
|
550
|
-
return `${inspect(value, { depth: -1 })}`;
|
|
551
|
-
}
|
|
552
|
-
let inspected = inspect(value, { colors: false });
|
|
553
|
-
if (inspected.length > 28) inspected = `${inspected.slice(0, 25)}...`;
|
|
554
|
-
return `type ${typeof value} (${inspected})`;
|
|
555
|
-
}
|
|
556
|
-
createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
|
|
557
|
-
assert.ok(typeof name === "string", "'name' must be a string");
|
|
558
|
-
if (!Array.isArray(expected)) expected = [expected];
|
|
559
|
-
let message = "The ";
|
|
560
|
-
if (name.endsWith(" argument")) message += `${name} `;
|
|
561
|
-
else {
|
|
562
|
-
const type = name.includes(".") ? "property" : "argument";
|
|
563
|
-
message += `"${name}" ${type} `;
|
|
564
|
-
}
|
|
565
|
-
message += "must be ";
|
|
566
|
-
const types = [];
|
|
567
|
-
const instances = [];
|
|
568
|
-
const other = [];
|
|
569
|
-
for (const value of expected) {
|
|
570
|
-
assert.ok(typeof value === "string", "All expected entries have to be of type string");
|
|
571
|
-
if (kTypes.has(value)) types.push(value.toLowerCase());
|
|
572
|
-
else if (classRegExp.exec(value) === null) {
|
|
573
|
-
assert.ok(value !== "object", "The value \"object\" should be written as \"Object\"");
|
|
574
|
-
other.push(value);
|
|
575
|
-
} else instances.push(value);
|
|
576
|
-
}
|
|
577
|
-
if (instances.length > 0) {
|
|
578
|
-
const pos = types.indexOf("object");
|
|
579
|
-
if (pos !== -1) {
|
|
580
|
-
types.slice(pos, 1);
|
|
581
|
-
instances.push("Object");
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
if (types.length > 0) {
|
|
585
|
-
message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`;
|
|
586
|
-
if (instances.length > 0 || other.length > 0) message += " or ";
|
|
587
|
-
}
|
|
588
|
-
if (instances.length > 0) {
|
|
589
|
-
message += `an instance of ${formatList(instances, "or")}`;
|
|
590
|
-
if (other.length > 0) message += " or ";
|
|
591
|
-
}
|
|
592
|
-
if (other.length > 0) if (other.length > 1) message += `one of ${formatList(other, "or")}`;
|
|
593
|
-
else {
|
|
594
|
-
if (other[0]?.toLowerCase() !== other[0]) message += "an ";
|
|
595
|
-
message += `${other[0]}`;
|
|
596
|
-
}
|
|
597
|
-
message += `. Received ${determineSpecificType(actual)}`;
|
|
598
|
-
return message;
|
|
599
|
-
}, TypeError);
|
|
600
|
-
const ERR_INVALID_MODULE_SPECIFIER = createError(
|
|
601
|
-
"ERR_INVALID_MODULE_SPECIFIER",
|
|
602
|
-
/**
|
|
603
|
-
* @param {string} request
|
|
604
|
-
* @param {string} reason
|
|
605
|
-
* @param {string} [base]
|
|
606
|
-
*/
|
|
607
|
-
(request, reason, base) => {
|
|
608
|
-
return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
|
|
609
|
-
},
|
|
610
|
-
TypeError
|
|
611
|
-
);
|
|
612
|
-
const ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1$1, base, message) => {
|
|
613
|
-
return `Invalid package config ${path$1$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
614
|
-
}, Error);
|
|
615
|
-
const ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = false, base) => {
|
|
616
|
-
const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
617
|
-
if (key === ".") {
|
|
618
|
-
assert.ok(isImport === false);
|
|
619
|
-
return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? "; targets must start with \"./\"" : ""}`;
|
|
620
|
-
}
|
|
621
|
-
return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? "; targets must start with \"./\"" : ""}`;
|
|
622
|
-
}, Error);
|
|
623
|
-
const ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1$1, base, exactUrl = false) => {
|
|
624
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${path$1$1}' imported from ${base}`;
|
|
625
|
-
}, Error);
|
|
626
|
-
createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error);
|
|
627
|
-
const ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => {
|
|
628
|
-
return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
|
|
629
|
-
}, TypeError);
|
|
630
|
-
const ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
|
631
|
-
"ERR_PACKAGE_PATH_NOT_EXPORTED",
|
|
632
|
-
/**
|
|
633
|
-
* @param {string} packagePath
|
|
634
|
-
* @param {string} subpath
|
|
635
|
-
* @param {string} [base]
|
|
636
|
-
*/
|
|
637
|
-
(packagePath, subpath, base) => {
|
|
638
|
-
if (subpath === ".") return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
639
|
-
return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
640
|
-
},
|
|
641
|
-
Error
|
|
642
|
-
);
|
|
643
|
-
const ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error);
|
|
644
|
-
const ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", "Failed to resolve module specifier \"%s\" from \"%s\": Invalid relative URL or base scheme is not hierarchical.", TypeError);
|
|
645
|
-
const ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1$1) => {
|
|
646
|
-
return `Unknown file extension "${extension}" for ${path$1$1}`;
|
|
647
|
-
}, TypeError);
|
|
648
|
-
createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
|
|
649
|
-
let inspected = inspect(value);
|
|
650
|
-
if (inspected.length > 128) inspected = `${inspected.slice(0, 128)}...`;
|
|
651
|
-
return `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
|
|
652
|
-
}, TypeError);
|
|
653
|
-
const hasOwnProperty$1 = {}.hasOwnProperty;
|
|
654
|
-
const cache = /* @__PURE__ */ new Map();
|
|
655
|
-
function read$1(jsonPath, { base, specifier }) {
|
|
656
|
-
const existing = cache.get(jsonPath);
|
|
657
|
-
if (existing) return existing;
|
|
658
|
-
let string;
|
|
659
|
-
try {
|
|
660
|
-
string = fs.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
|
|
661
|
-
} catch (error) {
|
|
662
|
-
const exception = error;
|
|
663
|
-
if (exception.code !== "ENOENT") throw exception;
|
|
664
|
-
}
|
|
665
|
-
const result = {
|
|
666
|
-
exists: false,
|
|
667
|
-
pjsonPath: jsonPath,
|
|
668
|
-
main: void 0,
|
|
669
|
-
name: void 0,
|
|
670
|
-
type: "none",
|
|
671
|
-
exports: void 0,
|
|
672
|
-
imports: void 0
|
|
673
|
-
};
|
|
674
|
-
if (string !== void 0) {
|
|
675
|
-
let parsed;
|
|
676
|
-
try {
|
|
677
|
-
parsed = JSON.parse(string);
|
|
678
|
-
} catch (error_) {
|
|
679
|
-
const error = new ERR_INVALID_PACKAGE_CONFIG(jsonPath, (base ? `"${specifier}" from ` : "") + fileURLToPath(base || specifier), error_.message);
|
|
680
|
-
error.cause = error_;
|
|
681
|
-
throw error;
|
|
682
|
-
}
|
|
683
|
-
result.exists = true;
|
|
684
|
-
if (hasOwnProperty$1.call(parsed, "name") && typeof parsed.name === "string") result.name = parsed.name;
|
|
685
|
-
if (hasOwnProperty$1.call(parsed, "main") && typeof parsed.main === "string") result.main = parsed.main;
|
|
686
|
-
if (hasOwnProperty$1.call(parsed, "exports")) result.exports = parsed.exports;
|
|
687
|
-
if (hasOwnProperty$1.call(parsed, "imports")) result.imports = parsed.imports;
|
|
688
|
-
if (hasOwnProperty$1.call(parsed, "type") && (parsed.type === "commonjs" || parsed.type === "module")) result.type = parsed.type;
|
|
689
|
-
}
|
|
690
|
-
cache.set(jsonPath, result);
|
|
691
|
-
return result;
|
|
692
|
-
}
|
|
693
|
-
function getPackageScopeConfig(resolved) {
|
|
694
|
-
let packageJSONUrl = new URL("package.json", resolved);
|
|
695
|
-
while (true) {
|
|
696
|
-
if (packageJSONUrl.pathname.endsWith("node_modules/package.json")) break;
|
|
697
|
-
const packageConfig = read$1(fileURLToPath(packageJSONUrl), { specifier: resolved });
|
|
698
|
-
if (packageConfig.exists) return packageConfig;
|
|
699
|
-
const lastPackageJSONUrl = packageJSONUrl;
|
|
700
|
-
packageJSONUrl = new URL("../package.json", packageJSONUrl);
|
|
701
|
-
if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) break;
|
|
702
|
-
}
|
|
703
|
-
return {
|
|
704
|
-
pjsonPath: fileURLToPath(packageJSONUrl),
|
|
705
|
-
exists: false,
|
|
706
|
-
type: "none"
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
const hasOwnProperty = {}.hasOwnProperty;
|
|
710
|
-
const extensionFormatMap = {
|
|
711
|
-
__proto__: null,
|
|
712
|
-
".json": "json",
|
|
713
|
-
".cjs": "commonjs",
|
|
714
|
-
".cts": "commonjs",
|
|
715
|
-
".js": "module",
|
|
716
|
-
".ts": "module",
|
|
717
|
-
".mts": "module",
|
|
718
|
-
".mjs": "module"
|
|
719
|
-
};
|
|
720
|
-
const protocolHandlers = {
|
|
721
|
-
__proto__: null,
|
|
722
|
-
"data:": getDataProtocolModuleFormat,
|
|
723
|
-
"file:": getFileProtocolModuleFormat,
|
|
724
|
-
"node:": () => "builtin"
|
|
725
|
-
};
|
|
726
|
-
function mimeToFormat(mime) {
|
|
727
|
-
if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) return "module";
|
|
728
|
-
if (mime === "application/json") return "json";
|
|
729
|
-
return null;
|
|
730
|
-
}
|
|
731
|
-
function getDataProtocolModuleFormat(parsed) {
|
|
732
|
-
const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(parsed.pathname) || [
|
|
733
|
-
null,
|
|
734
|
-
null,
|
|
735
|
-
null
|
|
736
|
-
];
|
|
737
|
-
return mimeToFormat(mime);
|
|
738
|
-
}
|
|
739
|
-
/**
|
|
740
|
-
* Returns the file extension from a URL.
|
|
741
|
-
*
|
|
742
|
-
* Should give similar result to
|
|
743
|
-
* `require('node:path').extname(require('node:url').fileURLToPath(url))`
|
|
744
|
-
* when used with a `file:` URL.
|
|
745
|
-
*
|
|
746
|
-
*/
|
|
747
|
-
function extname$1(url) {
|
|
748
|
-
const pathname = url.pathname;
|
|
749
|
-
let index = pathname.length;
|
|
750
|
-
while (index--) {
|
|
751
|
-
const code = pathname.codePointAt(index);
|
|
752
|
-
if (code === 47) return "";
|
|
753
|
-
if (code === 46) return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index);
|
|
754
|
-
}
|
|
755
|
-
return "";
|
|
756
|
-
}
|
|
757
|
-
function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
758
|
-
const ext = extname$1(url);
|
|
759
|
-
if (ext === ".js") {
|
|
760
|
-
const { type: packageType } = getPackageScopeConfig(url);
|
|
761
|
-
if (packageType !== "none") return packageType;
|
|
762
|
-
return "commonjs";
|
|
763
|
-
}
|
|
764
|
-
if (ext === "") {
|
|
765
|
-
const { type: packageType } = getPackageScopeConfig(url);
|
|
766
|
-
if (packageType === "none" || packageType === "commonjs") return "commonjs";
|
|
767
|
-
return "module";
|
|
768
|
-
}
|
|
769
|
-
const format$1 = extensionFormatMap[ext];
|
|
770
|
-
if (format$1) return format$1;
|
|
771
|
-
if (ignoreErrors) return;
|
|
772
|
-
throw new ERR_UNKNOWN_FILE_EXTENSION(ext, fileURLToPath(url));
|
|
773
|
-
}
|
|
774
|
-
function defaultGetFormatWithoutErrors(url, context) {
|
|
775
|
-
const protocol = url.protocol;
|
|
776
|
-
if (!hasOwnProperty.call(protocolHandlers, protocol)) return null;
|
|
777
|
-
return protocolHandlers[protocol](url, context, true) || null;
|
|
778
|
-
}
|
|
779
|
-
const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
|
|
780
|
-
const own = {}.hasOwnProperty;
|
|
781
|
-
const invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
|
|
782
|
-
const deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i;
|
|
783
|
-
const invalidPackageNameRegEx = /^\.|%|\\/;
|
|
784
|
-
const patternRegEx = /\*/g;
|
|
785
|
-
const encodedSeparatorRegEx = /%2f|%5c/i;
|
|
786
|
-
const emittedPackageWarnings = /* @__PURE__ */ new Set();
|
|
787
|
-
const doubleSlashRegEx = /[/\\]{2}/;
|
|
788
|
-
function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
|
|
789
|
-
if (process$1.noDeprecation) return;
|
|
790
|
-
const pjsonPath = fileURLToPath(packageJsonUrl);
|
|
791
|
-
const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
|
|
792
|
-
process$1.emitWarning(`Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ""}.`, "DeprecationWarning", "DEP0166");
|
|
793
|
-
}
|
|
794
|
-
function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
795
|
-
if (process$1.noDeprecation) return;
|
|
796
|
-
if (defaultGetFormatWithoutErrors(url, { parentURL: base.href }) !== "module") return;
|
|
797
|
-
const urlPath = fileURLToPath(url.href);
|
|
798
|
-
const packagePath = fileURLToPath(new URL$1(".", packageJsonUrl));
|
|
799
|
-
const basePath = fileURLToPath(base);
|
|
800
|
-
if (!main) process$1.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
801
|
-
else if (path.resolve(packagePath, main) !== urlPath) process$1.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
802
|
-
}
|
|
803
|
-
function tryStatSync(path$1$1) {
|
|
804
|
-
try {
|
|
805
|
-
return statSync(path$1$1);
|
|
806
|
-
} catch {}
|
|
807
|
-
}
|
|
808
|
-
/**
|
|
809
|
-
* Legacy CommonJS main resolution:
|
|
810
|
-
* 1. let M = pkg_url + (json main field)
|
|
811
|
-
* 2. TRY(M, M.js, M.json, M.node)
|
|
812
|
-
* 3. TRY(M/index.js, M/index.json, M/index.node)
|
|
813
|
-
* 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node)
|
|
814
|
-
* 5. NOT_FOUND
|
|
815
|
-
*/
|
|
816
|
-
function fileExists(url) {
|
|
817
|
-
const stats = statSync(url, { throwIfNoEntry: false });
|
|
818
|
-
const isFile = stats ? stats.isFile() : void 0;
|
|
819
|
-
return isFile === null || isFile === void 0 ? false : isFile;
|
|
820
|
-
}
|
|
821
|
-
function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
822
|
-
let guess;
|
|
823
|
-
if (packageConfig.main !== void 0) {
|
|
824
|
-
guess = new URL$1(packageConfig.main, packageJsonUrl);
|
|
825
|
-
if (fileExists(guess)) return guess;
|
|
826
|
-
const tries$1 = [
|
|
827
|
-
`./${packageConfig.main}.js`,
|
|
828
|
-
`./${packageConfig.main}.json`,
|
|
829
|
-
`./${packageConfig.main}.node`,
|
|
830
|
-
`./${packageConfig.main}/index.js`,
|
|
831
|
-
`./${packageConfig.main}/index.json`,
|
|
832
|
-
`./${packageConfig.main}/index.node`
|
|
833
|
-
];
|
|
834
|
-
let i$1 = -1;
|
|
835
|
-
while (++i$1 < tries$1.length) {
|
|
836
|
-
guess = new URL$1(tries$1[i$1], packageJsonUrl);
|
|
837
|
-
if (fileExists(guess)) break;
|
|
838
|
-
guess = void 0;
|
|
839
|
-
}
|
|
840
|
-
if (guess) {
|
|
841
|
-
emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
|
|
842
|
-
return guess;
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
const tries = [
|
|
846
|
-
"./index.js",
|
|
847
|
-
"./index.json",
|
|
848
|
-
"./index.node"
|
|
849
|
-
];
|
|
850
|
-
let i = -1;
|
|
851
|
-
while (++i < tries.length) {
|
|
852
|
-
guess = new URL$1(tries[i], packageJsonUrl);
|
|
853
|
-
if (fileExists(guess)) break;
|
|
854
|
-
guess = void 0;
|
|
855
|
-
}
|
|
856
|
-
if (guess) {
|
|
857
|
-
emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
|
|
858
|
-
return guess;
|
|
859
|
-
}
|
|
860
|
-
throw new ERR_MODULE_NOT_FOUND(fileURLToPath(new URL$1(".", packageJsonUrl)), fileURLToPath(base));
|
|
861
|
-
}
|
|
862
|
-
function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
863
|
-
if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) throw new ERR_INVALID_MODULE_SPECIFIER(resolved.pathname, String.raw`must not include encoded "/" or "\" characters`, fileURLToPath(base));
|
|
864
|
-
let filePath;
|
|
865
|
-
try {
|
|
866
|
-
filePath = fileURLToPath(resolved);
|
|
867
|
-
} catch (error) {
|
|
868
|
-
Object.defineProperty(error, "input", { value: String(resolved) });
|
|
869
|
-
Object.defineProperty(error, "module", { value: String(base) });
|
|
870
|
-
throw error;
|
|
871
|
-
}
|
|
872
|
-
const stats = tryStatSync(filePath.endsWith("/") ? filePath.slice(-1) : filePath);
|
|
873
|
-
if (stats && stats.isDirectory()) {
|
|
874
|
-
const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath(base));
|
|
875
|
-
error.url = String(resolved);
|
|
876
|
-
throw error;
|
|
877
|
-
}
|
|
878
|
-
if (!stats || !stats.isFile()) {
|
|
879
|
-
const error = new ERR_MODULE_NOT_FOUND(filePath || resolved.pathname, base && fileURLToPath(base), true);
|
|
880
|
-
error.url = String(resolved);
|
|
881
|
-
throw error;
|
|
882
|
-
}
|
|
883
|
-
if (!preserveSymlinks) {
|
|
884
|
-
const real = realpathSync(filePath);
|
|
885
|
-
const { search, hash } = resolved;
|
|
886
|
-
resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? "/" : ""));
|
|
887
|
-
resolved.search = search;
|
|
888
|
-
resolved.hash = hash;
|
|
889
|
-
}
|
|
890
|
-
return resolved;
|
|
891
|
-
}
|
|
892
|
-
function importNotDefined(specifier, packageJsonUrl, base) {
|
|
893
|
-
return new ERR_PACKAGE_IMPORT_NOT_DEFINED(specifier, packageJsonUrl && fileURLToPath(new URL$1(".", packageJsonUrl)), fileURLToPath(base));
|
|
894
|
-
}
|
|
895
|
-
function exportsNotFound(subpath, packageJsonUrl, base) {
|
|
896
|
-
return new ERR_PACKAGE_PATH_NOT_EXPORTED(fileURLToPath(new URL$1(".", packageJsonUrl)), subpath, base && fileURLToPath(base));
|
|
897
|
-
}
|
|
898
|
-
function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
|
|
899
|
-
throw new ERR_INVALID_MODULE_SPECIFIER(request, `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath(packageJsonUrl)}`, base && fileURLToPath(base));
|
|
900
|
-
}
|
|
901
|
-
function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
|
|
902
|
-
target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`;
|
|
903
|
-
return new ERR_INVALID_PACKAGE_TARGET(fileURLToPath(new URL$1(".", packageJsonUrl)), subpath, target, internal, base && fileURLToPath(base));
|
|
904
|
-
}
|
|
905
|
-
function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) {
|
|
906
|
-
if (subpath !== "" && !pattern && target.at(-1) !== "/") throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
907
|
-
if (!target.startsWith("./")) {
|
|
908
|
-
if (internal && !target.startsWith("../") && !target.startsWith("/")) {
|
|
909
|
-
let isURL = false;
|
|
910
|
-
try {
|
|
911
|
-
new URL$1(target);
|
|
912
|
-
isURL = true;
|
|
913
|
-
} catch {}
|
|
914
|
-
if (!isURL) return packageResolve(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target + subpath, packageJsonUrl, conditions);
|
|
915
|
-
}
|
|
916
|
-
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
917
|
-
}
|
|
918
|
-
if (invalidSegmentRegEx.exec(target.slice(2)) !== null) if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) {
|
|
919
|
-
if (!isPathMap) {
|
|
920
|
-
const request = pattern ? match.replace("*", () => subpath) : match + subpath;
|
|
921
|
-
emitInvalidSegmentDeprecation(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target, request, match, packageJsonUrl, internal, base, true);
|
|
922
|
-
}
|
|
923
|
-
} else throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
924
|
-
const resolved = new URL$1(target, packageJsonUrl);
|
|
925
|
-
const resolvedPath = resolved.pathname;
|
|
926
|
-
const packagePath = new URL$1(".", packageJsonUrl).pathname;
|
|
927
|
-
if (!resolvedPath.startsWith(packagePath)) throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
928
|
-
if (subpath === "") return resolved;
|
|
929
|
-
if (invalidSegmentRegEx.exec(subpath) !== null) {
|
|
930
|
-
const request = pattern ? match.replace("*", () => subpath) : match + subpath;
|
|
931
|
-
if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) {
|
|
932
|
-
if (!isPathMap) emitInvalidSegmentDeprecation(pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target, request, match, packageJsonUrl, internal, base, false);
|
|
933
|
-
} else throwInvalidSubpath(request, match, packageJsonUrl, internal, base);
|
|
934
|
-
}
|
|
935
|
-
if (pattern) return new URL$1(RegExpPrototypeSymbolReplace.call(patternRegEx, resolved.href, () => subpath));
|
|
936
|
-
return new URL$1(subpath, resolved);
|
|
937
|
-
}
|
|
938
|
-
function isArrayIndex(key) {
|
|
939
|
-
const keyNumber = Number(key);
|
|
940
|
-
if (`${keyNumber}` !== key) return false;
|
|
941
|
-
return keyNumber >= 0 && keyNumber < 4294967295;
|
|
942
|
-
}
|
|
943
|
-
function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) {
|
|
944
|
-
if (typeof target === "string") return resolvePackageTargetString(target, subpath, packageSubpath, packageJsonUrl, base, pattern, internal, isPathMap, conditions);
|
|
945
|
-
if (Array.isArray(target)) {
|
|
946
|
-
const targetList = target;
|
|
947
|
-
if (targetList.length === 0) return null;
|
|
948
|
-
let lastException;
|
|
949
|
-
let i = -1;
|
|
950
|
-
while (++i < targetList.length) {
|
|
951
|
-
const targetItem = targetList[i];
|
|
952
|
-
let resolveResult;
|
|
953
|
-
try {
|
|
954
|
-
resolveResult = resolvePackageTarget(packageJsonUrl, targetItem, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions);
|
|
955
|
-
} catch (error) {
|
|
956
|
-
const exception = error;
|
|
957
|
-
lastException = exception;
|
|
958
|
-
if (exception.code === "ERR_INVALID_PACKAGE_TARGET") continue;
|
|
959
|
-
throw error;
|
|
960
|
-
}
|
|
961
|
-
if (resolveResult === void 0) continue;
|
|
962
|
-
if (resolveResult === null) {
|
|
963
|
-
lastException = null;
|
|
964
|
-
continue;
|
|
965
|
-
}
|
|
966
|
-
return resolveResult;
|
|
967
|
-
}
|
|
968
|
-
if (lastException === void 0 || lastException === null) return null;
|
|
969
|
-
throw lastException;
|
|
970
|
-
}
|
|
971
|
-
if (typeof target === "object" && target !== null) {
|
|
972
|
-
const keys = Object.getOwnPropertyNames(target);
|
|
973
|
-
let i = -1;
|
|
974
|
-
while (++i < keys.length) {
|
|
975
|
-
const key = keys[i];
|
|
976
|
-
if (isArrayIndex(key)) throw new ERR_INVALID_PACKAGE_CONFIG(fileURLToPath(packageJsonUrl), fileURLToPath(base), "\"exports\" cannot contain numeric property keys.");
|
|
977
|
-
}
|
|
978
|
-
i = -1;
|
|
979
|
-
while (++i < keys.length) {
|
|
980
|
-
const key = keys[i];
|
|
981
|
-
if (key === "default" || conditions && conditions.has(key)) {
|
|
982
|
-
const conditionalTarget = target[key];
|
|
983
|
-
const resolveResult = resolvePackageTarget(packageJsonUrl, conditionalTarget, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions);
|
|
984
|
-
if (resolveResult === void 0) continue;
|
|
985
|
-
return resolveResult;
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
return null;
|
|
989
|
-
}
|
|
990
|
-
if (target === null) return null;
|
|
991
|
-
throw invalidPackageTarget(packageSubpath, target, packageJsonUrl, internal, base);
|
|
992
|
-
}
|
|
993
|
-
function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
|
|
994
|
-
if (typeof exports === "string" || Array.isArray(exports)) return true;
|
|
995
|
-
if (typeof exports !== "object" || exports === null) return false;
|
|
996
|
-
const keys = Object.getOwnPropertyNames(exports);
|
|
997
|
-
let isConditionalSugar = false;
|
|
998
|
-
let i = 0;
|
|
999
|
-
let keyIndex = -1;
|
|
1000
|
-
while (++keyIndex < keys.length) {
|
|
1001
|
-
const key = keys[keyIndex];
|
|
1002
|
-
const currentIsConditionalSugar = key === "" || key[0] !== ".";
|
|
1003
|
-
if (i++ === 0) isConditionalSugar = currentIsConditionalSugar;
|
|
1004
|
-
else if (isConditionalSugar !== currentIsConditionalSugar) throw new ERR_INVALID_PACKAGE_CONFIG(fileURLToPath(packageJsonUrl), fileURLToPath(base), "\"exports\" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.");
|
|
1005
|
-
}
|
|
1006
|
-
return isConditionalSugar;
|
|
1007
|
-
}
|
|
1008
|
-
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
|
|
1009
|
-
if (process$1.noDeprecation) return;
|
|
1010
|
-
const pjsonPath = fileURLToPath(pjsonUrl);
|
|
1011
|
-
if (emittedPackageWarnings.has(pjsonPath + "|" + match)) return;
|
|
1012
|
-
emittedPackageWarnings.add(pjsonPath + "|" + match);
|
|
1013
|
-
process$1.emitWarning(`Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, "DeprecationWarning", "DEP0155");
|
|
1014
|
-
}
|
|
1015
|
-
function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
|
|
1016
|
-
let exports = packageConfig.exports;
|
|
1017
|
-
if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) exports = { ".": exports };
|
|
1018
|
-
if (own.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
|
|
1019
|
-
const target = exports[packageSubpath];
|
|
1020
|
-
const resolveResult = resolvePackageTarget(packageJsonUrl, target, "", packageSubpath, base, false, false, false, conditions);
|
|
1021
|
-
if (resolveResult === null || resolveResult === void 0) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
1022
|
-
return resolveResult;
|
|
1023
|
-
}
|
|
1024
|
-
let bestMatch = "";
|
|
1025
|
-
let bestMatchSubpath = "";
|
|
1026
|
-
const keys = Object.getOwnPropertyNames(exports);
|
|
1027
|
-
let i = -1;
|
|
1028
|
-
while (++i < keys.length) {
|
|
1029
|
-
const key = keys[i];
|
|
1030
|
-
const patternIndex = key.indexOf("*");
|
|
1031
|
-
if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) {
|
|
1032
|
-
if (packageSubpath.endsWith("/")) emitTrailingSlashPatternDeprecation(packageSubpath, packageJsonUrl, base);
|
|
1033
|
-
const patternTrailer = key.slice(patternIndex + 1);
|
|
1034
|
-
if (packageSubpath.length >= key.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) {
|
|
1035
|
-
bestMatch = key;
|
|
1036
|
-
bestMatchSubpath = packageSubpath.slice(patternIndex, packageSubpath.length - patternTrailer.length);
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
if (bestMatch) {
|
|
1041
|
-
const target = exports[bestMatch];
|
|
1042
|
-
const resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith("/"), conditions);
|
|
1043
|
-
if (resolveResult === null || resolveResult === void 0) throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
1044
|
-
return resolveResult;
|
|
1045
|
-
}
|
|
1046
|
-
throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
1047
|
-
}
|
|
1048
|
-
function patternKeyCompare(a, b) {
|
|
1049
|
-
const aPatternIndex = a.indexOf("*");
|
|
1050
|
-
const bPatternIndex = b.indexOf("*");
|
|
1051
|
-
const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
|
|
1052
|
-
const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
|
|
1053
|
-
if (baseLengthA > baseLengthB) return -1;
|
|
1054
|
-
if (baseLengthB > baseLengthA) return 1;
|
|
1055
|
-
if (aPatternIndex === -1) return 1;
|
|
1056
|
-
if (bPatternIndex === -1) return -1;
|
|
1057
|
-
if (a.length > b.length) return -1;
|
|
1058
|
-
if (b.length > a.length) return 1;
|
|
1059
|
-
return 0;
|
|
1060
|
-
}
|
|
1061
|
-
function packageImportsResolve(name, base, conditions) {
|
|
1062
|
-
if (name === "#" || name.startsWith("#/") || name.endsWith("/")) throw new ERR_INVALID_MODULE_SPECIFIER(name, "is not a valid internal imports specifier name", fileURLToPath(base));
|
|
1063
|
-
let packageJsonUrl;
|
|
1064
|
-
const packageConfig = getPackageScopeConfig(base);
|
|
1065
|
-
if (packageConfig.exists) {
|
|
1066
|
-
packageJsonUrl = pathToFileURL(packageConfig.pjsonPath);
|
|
1067
|
-
const imports = packageConfig.imports;
|
|
1068
|
-
if (imports) if (own.call(imports, name) && !name.includes("*")) {
|
|
1069
|
-
const resolveResult = resolvePackageTarget(packageJsonUrl, imports[name], "", name, base, false, true, false, conditions);
|
|
1070
|
-
if (resolveResult !== null && resolveResult !== void 0) return resolveResult;
|
|
1071
|
-
} else {
|
|
1072
|
-
let bestMatch = "";
|
|
1073
|
-
let bestMatchSubpath = "";
|
|
1074
|
-
const keys = Object.getOwnPropertyNames(imports);
|
|
1075
|
-
let i = -1;
|
|
1076
|
-
while (++i < keys.length) {
|
|
1077
|
-
const key = keys[i];
|
|
1078
|
-
const patternIndex = key.indexOf("*");
|
|
1079
|
-
if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) {
|
|
1080
|
-
const patternTrailer = key.slice(patternIndex + 1);
|
|
1081
|
-
if (name.length >= key.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) {
|
|
1082
|
-
bestMatch = key;
|
|
1083
|
-
bestMatchSubpath = name.slice(patternIndex, name.length - patternTrailer.length);
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
if (bestMatch) {
|
|
1088
|
-
const target = imports[bestMatch];
|
|
1089
|
-
const resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, true, true, false, conditions);
|
|
1090
|
-
if (resolveResult !== null && resolveResult !== void 0) return resolveResult;
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
throw importNotDefined(name, packageJsonUrl, base);
|
|
1095
|
-
}
|
|
1096
|
-
/**
|
|
1097
|
-
* @param {string} specifier
|
|
1098
|
-
* @param {URL} base
|
|
1099
|
-
*/
|
|
1100
|
-
function parsePackageName(specifier, base) {
|
|
1101
|
-
let separatorIndex = specifier.indexOf("/");
|
|
1102
|
-
let validPackageName = true;
|
|
1103
|
-
let isScoped = false;
|
|
1104
|
-
if (specifier[0] === "@") {
|
|
1105
|
-
isScoped = true;
|
|
1106
|
-
if (separatorIndex === -1 || specifier.length === 0) validPackageName = false;
|
|
1107
|
-
else separatorIndex = specifier.indexOf("/", separatorIndex + 1);
|
|
1108
|
-
}
|
|
1109
|
-
const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex);
|
|
1110
|
-
if (invalidPackageNameRegEx.exec(packageName) !== null) validPackageName = false;
|
|
1111
|
-
if (!validPackageName) throw new ERR_INVALID_MODULE_SPECIFIER(specifier, "is not a valid package name", fileURLToPath(base));
|
|
1112
|
-
return {
|
|
1113
|
-
packageName,
|
|
1114
|
-
packageSubpath: "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex)),
|
|
1115
|
-
isScoped
|
|
1116
|
-
};
|
|
1117
|
-
}
|
|
1118
|
-
function packageResolve(specifier, base, conditions) {
|
|
1119
|
-
if (nodeBuiltins.includes(specifier)) return new URL$1("node:" + specifier);
|
|
1120
|
-
const { packageName, packageSubpath, isScoped } = parsePackageName(specifier, base);
|
|
1121
|
-
const packageConfig = getPackageScopeConfig(base);
|
|
1122
|
-
if (packageConfig.exists && packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) return packageExportsResolve(pathToFileURL(packageConfig.pjsonPath), packageSubpath, packageConfig, base, conditions);
|
|
1123
|
-
let packageJsonUrl = new URL$1("./node_modules/" + packageName + "/package.json", base);
|
|
1124
|
-
let packageJsonPath = fileURLToPath(packageJsonUrl);
|
|
1125
|
-
let lastPath;
|
|
1126
|
-
do {
|
|
1127
|
-
const stat = tryStatSync(packageJsonPath.slice(0, -13));
|
|
1128
|
-
if (!stat || !stat.isDirectory()) {
|
|
1129
|
-
lastPath = packageJsonPath;
|
|
1130
|
-
packageJsonUrl = new URL$1((isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", packageJsonUrl);
|
|
1131
|
-
packageJsonPath = fileURLToPath(packageJsonUrl);
|
|
1132
|
-
continue;
|
|
1133
|
-
}
|
|
1134
|
-
const packageConfig$1 = read$1(packageJsonPath, {
|
|
1135
|
-
base,
|
|
1136
|
-
specifier
|
|
1137
|
-
});
|
|
1138
|
-
if (packageConfig$1.exports !== void 0 && packageConfig$1.exports !== null) return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig$1, base, conditions);
|
|
1139
|
-
if (packageSubpath === ".") return legacyMainResolve(packageJsonUrl, packageConfig$1, base);
|
|
1140
|
-
return new URL$1(packageSubpath, packageJsonUrl);
|
|
1141
|
-
} while (packageJsonPath.length !== lastPath.length);
|
|
1142
|
-
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), false);
|
|
1143
|
-
}
|
|
1144
|
-
function isRelativeSpecifier(specifier) {
|
|
1145
|
-
if (specifier[0] === ".") {
|
|
1146
|
-
if (specifier.length === 1 || specifier[1] === "/") return true;
|
|
1147
|
-
if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) return true;
|
|
1148
|
-
}
|
|
1149
|
-
return false;
|
|
1150
|
-
}
|
|
1151
|
-
function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
|
|
1152
|
-
if (specifier === "") return false;
|
|
1153
|
-
if (specifier[0] === "/") return true;
|
|
1154
|
-
return isRelativeSpecifier(specifier);
|
|
1155
|
-
}
|
|
1156
|
-
/**
|
|
1157
|
-
* The “Resolver Algorithm Specification” as detailed in the Node docs (which is
|
|
1158
|
-
* sync and slightly lower-level than `resolve`).
|
|
1159
|
-
*
|
|
1160
|
-
* @param {string} specifier
|
|
1161
|
-
* `/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc.
|
|
1162
|
-
* @param {URL} base
|
|
1163
|
-
* Full URL (to a file) that `specifier` is resolved relative from.
|
|
1164
|
-
* @param {Set<string>} [conditions]
|
|
1165
|
-
* Conditions.
|
|
1166
|
-
* @param {boolean} [preserveSymlinks]
|
|
1167
|
-
* Keep symlinks instead of resolving them.
|
|
1168
|
-
* @returns {URL}
|
|
1169
|
-
* A URL object to the found thing.
|
|
1170
|
-
*/
|
|
1171
|
-
function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
1172
|
-
const protocol = base.protocol;
|
|
1173
|
-
const isData = protocol === "data:";
|
|
1174
|
-
let resolved;
|
|
1175
|
-
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) try {
|
|
1176
|
-
resolved = new URL$1(specifier, base);
|
|
1177
|
-
} catch (error_) {
|
|
1178
|
-
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
1179
|
-
error.cause = error_;
|
|
1180
|
-
throw error;
|
|
1181
|
-
}
|
|
1182
|
-
else if (protocol === "file:" && specifier[0] === "#") resolved = packageImportsResolve(specifier, base, conditions);
|
|
1183
|
-
else try {
|
|
1184
|
-
resolved = new URL$1(specifier);
|
|
1185
|
-
} catch (error_) {
|
|
1186
|
-
if (isData && !nodeBuiltins.includes(specifier)) {
|
|
1187
|
-
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
1188
|
-
error.cause = error_;
|
|
1189
|
-
throw error;
|
|
1190
|
-
}
|
|
1191
|
-
resolved = packageResolve(specifier, base, conditions);
|
|
1192
|
-
}
|
|
1193
|
-
assert.ok(resolved !== void 0, "expected to be defined");
|
|
1194
|
-
if (resolved.protocol !== "file:") return resolved;
|
|
1195
|
-
return finalizeResolution(resolved, base, preserveSymlinks);
|
|
1196
|
-
}
|
|
1197
|
-
const DEFAULT_CONDITIONS_SET = /* @__PURE__ */ new Set(["node", "import"]);
|
|
1198
|
-
const isWindows = /* @__PURE__ */ (() => process.platform === "win32")();
|
|
1199
|
-
const globalCache = /* @__PURE__ */ (() => globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map())();
|
|
1200
|
-
/**
|
|
1201
|
-
* Synchronously resolves a module url based on the options provided.
|
|
1202
|
-
*
|
|
1203
|
-
* @param {string} input - The identifier or path of the module to resolve.
|
|
1204
|
-
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
|
|
1205
|
-
* @returns {string} The resolved URL as a string.
|
|
1206
|
-
*/
|
|
1207
|
-
function resolveModuleURL(input, options) {
|
|
1208
|
-
const parsedInput = _parseInput(input);
|
|
1209
|
-
if ("external" in parsedInput) return parsedInput.external;
|
|
1210
|
-
const specifier = parsedInput.specifier;
|
|
1211
|
-
let url = parsedInput.url;
|
|
1212
|
-
let absolutePath = parsedInput.absolutePath;
|
|
1213
|
-
let cacheKey;
|
|
1214
|
-
let cacheObj;
|
|
1215
|
-
if (options?.cache !== false) {
|
|
1216
|
-
cacheKey = _cacheKey(absolutePath || specifier, options);
|
|
1217
|
-
cacheObj = options?.cache && typeof options?.cache === "object" ? options.cache : globalCache;
|
|
1218
|
-
}
|
|
1219
|
-
if (cacheObj) {
|
|
1220
|
-
const cached = cacheObj.get(cacheKey);
|
|
1221
|
-
if (typeof cached === "string") return cached;
|
|
1222
|
-
if (cached instanceof Error) {
|
|
1223
|
-
if (options?.try) return;
|
|
1224
|
-
throw cached;
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
if (absolutePath) try {
|
|
1228
|
-
const stat = lstatSync(absolutePath);
|
|
1229
|
-
if (stat.isSymbolicLink()) {
|
|
1230
|
-
absolutePath = realpathSync(absolutePath);
|
|
1231
|
-
url = pathToFileURL(absolutePath);
|
|
1232
|
-
}
|
|
1233
|
-
if (stat.isFile()) {
|
|
1234
|
-
if (cacheObj) cacheObj.set(cacheKey, url.href);
|
|
1235
|
-
return url.href;
|
|
1236
|
-
}
|
|
1237
|
-
} catch (error) {
|
|
1238
|
-
if (error?.code !== "ENOENT") {
|
|
1239
|
-
if (cacheObj) cacheObj.set(cacheKey, error);
|
|
1240
|
-
throw error;
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
const conditionsSet = options?.conditions ? new Set(options.conditions) : DEFAULT_CONDITIONS_SET;
|
|
1244
|
-
const target = specifier || url.href;
|
|
1245
|
-
const bases = _normalizeBases(options?.from);
|
|
1246
|
-
const suffixes = options?.suffixes || [""];
|
|
1247
|
-
const extensions = options?.extensions ? ["", ...options.extensions] : [""];
|
|
1248
|
-
let resolved;
|
|
1249
|
-
for (const base of bases) {
|
|
1250
|
-
for (const suffix of suffixes) {
|
|
1251
|
-
let name = _join(target, suffix);
|
|
1252
|
-
if (name === ".") name += "/.";
|
|
1253
|
-
for (const extension of extensions) {
|
|
1254
|
-
resolved = _tryModuleResolve(name + extension, base, conditionsSet);
|
|
1255
|
-
if (resolved) break;
|
|
1256
|
-
}
|
|
1257
|
-
if (resolved) break;
|
|
1258
|
-
}
|
|
1259
|
-
if (resolved) break;
|
|
1260
|
-
}
|
|
1261
|
-
if (!resolved) {
|
|
1262
|
-
const error = /* @__PURE__ */ new Error(`Cannot resolve module "${input}" (from: ${bases.map((u) => _fmtPath(u)).join(", ")})`);
|
|
1263
|
-
error.code = "ERR_MODULE_NOT_FOUND";
|
|
1264
|
-
if (cacheObj) cacheObj.set(cacheKey, error);
|
|
1265
|
-
if (options?.try) return;
|
|
1266
|
-
throw error;
|
|
1267
|
-
}
|
|
1268
|
-
if (cacheObj) cacheObj.set(cacheKey, resolved.href);
|
|
1269
|
-
return resolved.href;
|
|
1270
|
-
}
|
|
1271
|
-
/**
|
|
1272
|
-
* Synchronously resolves a module then converts it to a file path
|
|
1273
|
-
*
|
|
1274
|
-
* (throws error if reolved path is not file:// scheme)
|
|
1275
|
-
*
|
|
1276
|
-
* @param {string} id - The identifier or path of the module to resolve.
|
|
1277
|
-
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
|
|
1278
|
-
* @returns {string} The resolved URL as a string.
|
|
1279
|
-
*/
|
|
1280
|
-
function resolveModulePath(id, options) {
|
|
1281
|
-
const resolved = resolveModuleURL(id, options);
|
|
1282
|
-
if (!resolved) return;
|
|
1283
|
-
if (!resolved.startsWith("file://") && options?.try) return;
|
|
1284
|
-
const absolutePath = fileURLToPath(resolved);
|
|
1285
|
-
return isWindows ? _normalizeWinPath(absolutePath) : absolutePath;
|
|
1286
|
-
}
|
|
1287
|
-
function _tryModuleResolve(specifier, base, conditions) {
|
|
1288
|
-
try {
|
|
1289
|
-
return moduleResolve(specifier, base, conditions);
|
|
1290
|
-
} catch {}
|
|
1291
|
-
}
|
|
1292
|
-
function _normalizeBases(inputs) {
|
|
1293
|
-
const urls = (Array.isArray(inputs) ? inputs : [inputs]).flatMap((input) => _normalizeBase(input));
|
|
1294
|
-
if (urls.length === 0) return [pathToFileURL("./")];
|
|
1295
|
-
return urls;
|
|
1296
|
-
}
|
|
1297
|
-
function _normalizeBase(input) {
|
|
1298
|
-
if (!input) return [];
|
|
1299
|
-
if (_isURL(input)) return [input];
|
|
1300
|
-
if (typeof input !== "string") return [];
|
|
1301
|
-
if (/^(?:node|data|http|https|file):/.test(input)) return new URL(input);
|
|
1302
|
-
try {
|
|
1303
|
-
if (input.endsWith("/") || statSync(input).isDirectory()) return pathToFileURL(input + "/");
|
|
1304
|
-
return pathToFileURL(input);
|
|
1305
|
-
} catch {
|
|
1306
|
-
return [pathToFileURL(input + "/"), pathToFileURL(input)];
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
function _fmtPath(input) {
|
|
1310
|
-
try {
|
|
1311
|
-
return fileURLToPath(input);
|
|
1312
|
-
} catch {
|
|
1313
|
-
return input;
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
function _cacheKey(id, opts) {
|
|
1317
|
-
return JSON.stringify([
|
|
1318
|
-
id,
|
|
1319
|
-
(opts?.conditions || ["node", "import"]).sort(),
|
|
1320
|
-
opts?.extensions,
|
|
1321
|
-
opts?.from,
|
|
1322
|
-
opts?.suffixes
|
|
1323
|
-
]);
|
|
1324
|
-
}
|
|
1325
|
-
function _join(a, b) {
|
|
1326
|
-
if (!a || !b || b === "/") return a;
|
|
1327
|
-
return (a.endsWith("/") ? a : a + "/") + (b.startsWith("/") ? b.slice(1) : b);
|
|
1328
|
-
}
|
|
1329
|
-
function _normalizeWinPath(path$1$1) {
|
|
1330
|
-
return path$1$1.replace(/\\/g, "/").replace(/^[a-z]:\//, (r) => r.toUpperCase());
|
|
1331
|
-
}
|
|
1332
|
-
function _isURL(input) {
|
|
1333
|
-
return input instanceof URL || input?.constructor?.name === "URL";
|
|
1334
|
-
}
|
|
1335
|
-
function _parseInput(input) {
|
|
1336
|
-
if (typeof input === "string") {
|
|
1337
|
-
if (input.startsWith("file:")) {
|
|
1338
|
-
const url = new URL(input);
|
|
1339
|
-
return {
|
|
1340
|
-
url,
|
|
1341
|
-
absolutePath: fileURLToPath(url)
|
|
1342
|
-
};
|
|
1343
|
-
}
|
|
1344
|
-
if (isAbsolute(input)) return {
|
|
1345
|
-
url: pathToFileURL(input),
|
|
1346
|
-
absolutePath: input
|
|
1347
|
-
};
|
|
1348
|
-
if (/^(?:node|data|http|https):/.test(input)) return { external: input };
|
|
1349
|
-
if (nodeBuiltins.includes(input) && !input.includes(":")) return { external: `node:${input}` };
|
|
1350
|
-
return { specifier: input };
|
|
1351
|
-
}
|
|
1352
|
-
if (_isURL(input)) {
|
|
1353
|
-
if (input.protocol === "file:") return {
|
|
1354
|
-
url: input,
|
|
1355
|
-
absolutePath: fileURLToPath(input)
|
|
1356
|
-
};
|
|
1357
|
-
return { external: input.href };
|
|
1358
|
-
}
|
|
1359
|
-
throw new TypeError("id must be a `string` or `URL`");
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
//#endregion
|
|
1363
3
|
//#region ../../node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs
|
|
1364
4
|
var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1365
5
|
(() => {
|
|
@@ -1390,7 +30,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1390
30
|
var i = {};
|
|
1391
31
|
(() => {
|
|
1392
32
|
"use strict";
|
|
1393
|
-
__webpack_require__.d(i, { default: () => createJiti
|
|
33
|
+
__webpack_require__.d(i, { default: () => createJiti });
|
|
1394
34
|
const e$1 = __require("node:os");
|
|
1395
35
|
var t$1 = [
|
|
1396
36
|
509,
|
|
@@ -2320,7 +960,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2320
960
|
5: a,
|
|
2321
961
|
"5module": a + " export import",
|
|
2322
962
|
6: a + " const class extends export import super"
|
|
2323
|
-
}, h
|
|
963
|
+
}, h = /^in(stanceof)?$/, c = /* @__PURE__ */ new RegExp("[" + r + "]"), p = /* @__PURE__ */ new RegExp("[" + r + "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");
|
|
2324
964
|
function isInAstralSet(e$2, t$2) {
|
|
2325
965
|
for (var i$1 = 65536, s$1 = 0; s$1 < t$2.length; s$1 += 2) {
|
|
2326
966
|
if ((i$1 += t$2[s$1]) > e$2) return !1;
|
|
@@ -2343,9 +983,9 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2343
983
|
binop: t$2
|
|
2344
984
|
});
|
|
2345
985
|
}
|
|
2346
|
-
var l = { beforeExpr: !0 }, u = { startsExpr: !0 }, d
|
|
986
|
+
var l = { beforeExpr: !0 }, u = { startsExpr: !0 }, d = {};
|
|
2347
987
|
function kw(e$2, t$2) {
|
|
2348
|
-
return void 0 === t$2 && (t$2 = {}), t$2.keyword = e$2, d
|
|
988
|
+
return void 0 === t$2 && (t$2 = {}), t$2.keyword = e$2, d[e$2] = new acorn_TokenType(e$2, t$2);
|
|
2349
989
|
}
|
|
2350
990
|
var f = {
|
|
2351
991
|
num: new acorn_TokenType("num", u),
|
|
@@ -2492,7 +1132,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2492
1132
|
}
|
|
2493
1133
|
return -1;
|
|
2494
1134
|
}
|
|
2495
|
-
var x
|
|
1135
|
+
var x = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, v = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, y = Object.prototype, _ = y.hasOwnProperty, E = y.toString, b = Object.hasOwn || function(e$2, t$2) {
|
|
2496
1136
|
return _.call(e$2, t$2);
|
|
2497
1137
|
}, S = Array.isArray || function(e$2) {
|
|
2498
1138
|
return "[object Array]" === E.call(e$2);
|
|
@@ -2551,13 +1191,13 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2551
1191
|
}
|
|
2552
1192
|
return S(t$2.onComment) && (t$2.onComment = function(e$3, t$3) {
|
|
2553
1193
|
return function(i$2, s$2, r$1, n$1, a$1, o$1) {
|
|
2554
|
-
var h$
|
|
1194
|
+
var h$1 = {
|
|
2555
1195
|
type: i$2 ? "Block" : "Line",
|
|
2556
1196
|
value: s$2,
|
|
2557
1197
|
start: r$1,
|
|
2558
1198
|
end: n$1
|
|
2559
1199
|
};
|
|
2560
|
-
e$3.locations && (h$
|
|
1200
|
+
e$3.locations && (h$1.loc = new acorn_SourceLocation(this, a$1, o$1)), e$3.ranges && (h$1.range = [r$1, n$1]), t$3.push(h$1);
|
|
2561
1201
|
};
|
|
2562
1202
|
}(t$2, t$2.onComment)), t$2;
|
|
2563
1203
|
}
|
|
@@ -2703,7 +1343,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2703
1343
|
for (var r$1 = i$1 + 1; isIdentifierChar(s$1 = this.input.charCodeAt(r$1), !0);) ++r$1;
|
|
2704
1344
|
if (92 === s$1 || s$1 > 55295 && s$1 < 56320) return !0;
|
|
2705
1345
|
var n$1 = this.input.slice(i$1, r$1);
|
|
2706
|
-
if (!h
|
|
1346
|
+
if (!h.test(n$1)) return !0;
|
|
2707
1347
|
}
|
|
2708
1348
|
return !1;
|
|
2709
1349
|
}, L.isAsyncFunction = function() {
|
|
@@ -2724,8 +1364,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2724
1364
|
if (a$1 && m.test(this.input.slice(n$1, n$1 + a$1[0].length))) return !1;
|
|
2725
1365
|
}
|
|
2726
1366
|
if (t$2) {
|
|
2727
|
-
var o$1, h$
|
|
2728
|
-
if (!("of" !== this.input.slice(s$1, h$
|
|
1367
|
+
var o$1, h$1 = s$1 + 2;
|
|
1368
|
+
if (!("of" !== this.input.slice(s$1, h$1) || h$1 !== this.input.length && (isIdentifierChar(o$1 = this.input.charCodeAt(h$1)) || o$1 > 55295 && o$1 < 56320))) return !1;
|
|
2729
1369
|
}
|
|
2730
1370
|
var c$1 = this.input.charCodeAt(s$1);
|
|
2731
1371
|
return isIdentifierStart(c$1, !0) || 92 === c$1;
|
|
@@ -2758,8 +1398,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2758
1398
|
case f._import:
|
|
2759
1399
|
if (this.options.ecmaVersion > 10 && r$1 === f._import) {
|
|
2760
1400
|
v.lastIndex = this.pos;
|
|
2761
|
-
var a$1 = v.exec(this.input), o$1 = this.pos + a$1[0].length, h$
|
|
2762
|
-
if (40 === h$
|
|
1401
|
+
var a$1 = v.exec(this.input), o$1 = this.pos + a$1[0].length, h$1 = this.input.charCodeAt(o$1);
|
|
1402
|
+
if (40 === h$1 || 46 === h$1) return this.parseExpressionStatement(n$1, this.parseExpression());
|
|
2763
1403
|
}
|
|
2764
1404
|
return this.options.allowImportExportEverywhere || (t$2 || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r$1 === f._import ? this.parseImport(n$1) : this.parseExport(n$1, i$1);
|
|
2765
1405
|
default:
|
|
@@ -2795,8 +1435,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2795
1435
|
}
|
|
2796
1436
|
var n$1 = this.isContextual("let"), a$1 = !1, o$1 = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
2797
1437
|
if (o$1) {
|
|
2798
|
-
var h$
|
|
2799
|
-
return this.next(), "await using" === o$1 && this.next(), this.parseVar(h$
|
|
1438
|
+
var h$1 = this.startNode();
|
|
1439
|
+
return this.next(), "await using" === o$1 && this.next(), this.parseVar(h$1, !0, o$1), this.finishNode(h$1, "VariableDeclaration"), this.parseForAfterInit(e$2, h$1, t$2);
|
|
2800
1440
|
}
|
|
2801
1441
|
var c$1 = this.containsEsc, p$1 = new acorn_DestructuringErrors(), l$1 = this.start, u$1 = t$2 > -1 ? this.parseExprSubscripts(p$1, "await") : this.parseExpression(!0, p$1);
|
|
2802
1442
|
return this.type === f._in || (a$1 = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t$2 > -1 ? (this.type === f._in && this.unexpected(t$2), e$2.await = !0) : a$1 && this.options.ecmaVersion >= 8 && (u$1.start !== l$1 || c$1 || "Identifier" !== u$1.type || "async" !== u$1.name ? this.options.ecmaVersion >= 9 && (e$2.await = !1) : this.unexpected()), n$1 && a$1 && this.raise(u$1.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(u$1, !1, p$1), this.checkLValPattern(u$1), this.parseForIn(e$2, u$1)) : (this.checkExpressionErrors(p$1, !0), t$2 > -1 && this.unexpected(t$2), this.parseFor(e$2, u$1));
|
|
@@ -2840,9 +1480,9 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2840
1480
|
}, L.parseLabeledStatement = function(e$2, t$2, i$1, s$1) {
|
|
2841
1481
|
for (var r$1 = 0, n$1 = this.labels; r$1 < n$1.length; r$1 += 1) n$1[r$1].name === t$2 && this.raise(i$1.start, "Label '" + t$2 + "' is already declared");
|
|
2842
1482
|
for (var a$1 = this.type.isLoop ? "loop" : this.type === f._switch ? "switch" : null, o$1 = this.labels.length - 1; o$1 >= 0; o$1--) {
|
|
2843
|
-
var h$
|
|
2844
|
-
if (h$
|
|
2845
|
-
h$
|
|
1483
|
+
var h$1 = this.labels[o$1];
|
|
1484
|
+
if (h$1.statementStart !== e$2.start) break;
|
|
1485
|
+
h$1.statementStart = this.start, h$1.kind = a$1;
|
|
2846
1486
|
}
|
|
2847
1487
|
return this.labels.push({
|
|
2848
1488
|
name: t$2,
|
|
@@ -2904,8 +1544,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2904
1544
|
this.isClassElementNameStart() || this.type === f.star ? o$1 = !0 : s$1 = "static";
|
|
2905
1545
|
}
|
|
2906
1546
|
if (i$1.static = o$1, !s$1 && t$2 >= 8 && this.eatContextual("async") && (!this.isClassElementNameStart() && this.type !== f.star || this.canInsertSemicolon() ? s$1 = "async" : n$1 = !0), !s$1 && (t$2 >= 9 || !n$1) && this.eat(f.star) && (r$1 = !0), !s$1 && !n$1 && !r$1) {
|
|
2907
|
-
var h$
|
|
2908
|
-
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? a$1 = h$
|
|
1547
|
+
var h$1 = this.value;
|
|
1548
|
+
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? a$1 = h$1 : s$1 = h$1);
|
|
2909
1549
|
}
|
|
2910
1550
|
if (s$1 ? (i$1.computed = !1, i$1.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), i$1.key.name = s$1, this.finishNode(i$1.key, "Identifier")) : this.parseClassElementName(i$1), t$2 < 13 || this.type === f.parenL || "method" !== a$1 || r$1 || n$1) {
|
|
2911
1551
|
var c$1 = !i$1.static && checkKeyName(i$1, "constructor"), p$1 = c$1 && e$2;
|
|
@@ -2989,8 +1629,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2989
1629
|
this.checkPatternExport(e$2, n$1);
|
|
2990
1630
|
}
|
|
2991
1631
|
else if ("ArrayPattern" === i$1) for (var a$1 = 0, o$1 = t$2.elements; a$1 < o$1.length; a$1 += 1) {
|
|
2992
|
-
var h$
|
|
2993
|
-
h$
|
|
1632
|
+
var h$1 = o$1[a$1];
|
|
1633
|
+
h$1 && this.checkPatternExport(e$2, h$1);
|
|
2994
1634
|
}
|
|
2995
1635
|
else "Property" === i$1 ? this.checkPatternExport(e$2, t$2.value) : "AssignmentPattern" === i$1 ? this.checkPatternExport(e$2, t$2.left) : "RestElement" === i$1 && this.checkPatternExport(e$2, t$2.argument);
|
|
2996
1636
|
}, L.checkVariableExport = function(e$2, t$2) {
|
|
@@ -3168,8 +1808,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3168
1808
|
break;
|
|
3169
1809
|
case "ArrayPattern":
|
|
3170
1810
|
for (var a$1 = 0, o$1 = e$2.elements; a$1 < o$1.length; a$1 += 1) {
|
|
3171
|
-
var h$
|
|
3172
|
-
h$
|
|
1811
|
+
var h$1 = o$1[a$1];
|
|
1812
|
+
h$1 && this.checkLValInnerPattern(h$1, t$2, i$1);
|
|
3173
1813
|
}
|
|
3174
1814
|
break;
|
|
3175
1815
|
default: this.checkLValSimple(e$2, t$2, i$1);
|
|
@@ -3297,11 +1937,11 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3297
1937
|
}
|
|
3298
1938
|
var s$1 = !1, r$1 = -1, n$1 = -1, a$1 = -1;
|
|
3299
1939
|
t$2 ? (r$1 = t$2.parenthesizedAssign, n$1 = t$2.trailingComma, a$1 = t$2.doubleProto, t$2.parenthesizedAssign = t$2.trailingComma = -1) : (t$2 = new acorn_DestructuringErrors(), s$1 = !0);
|
|
3300
|
-
var o$1 = this.start, h$
|
|
1940
|
+
var o$1 = this.start, h$1 = this.startLoc;
|
|
3301
1941
|
this.type !== f.parenL && this.type !== f.name || (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = "await" === e$2);
|
|
3302
1942
|
var c$1 = this.parseMaybeConditional(e$2, t$2);
|
|
3303
|
-
if (i$1 && (c$1 = i$1.call(this, c$1, o$1, h$
|
|
3304
|
-
var p$1 = this.startNodeAt(o$1, h$
|
|
1943
|
+
if (i$1 && (c$1 = i$1.call(this, c$1, o$1, h$1)), this.type.isAssign) {
|
|
1944
|
+
var p$1 = this.startNodeAt(o$1, h$1);
|
|
3305
1945
|
return p$1.operator = this.value, this.type === f.eq && (c$1 = this.toAssignable(c$1, !1, t$2)), s$1 || (t$2.parenthesizedAssign = t$2.trailingComma = t$2.doubleProto = -1), t$2.shorthandAssign >= c$1.start && (t$2.shorthandAssign = -1), this.type === f.eq ? this.checkLValPattern(c$1) : this.checkLValSimple(c$1), p$1.left = c$1, this.next(), p$1.right = this.parseMaybeAssign(e$2), a$1 > -1 && (t$2.doubleProto = a$1), this.finishNode(p$1, "AssignmentExpression");
|
|
3306
1946
|
}
|
|
3307
1947
|
return s$1 && this.checkExpressionErrors(t$2, !0), r$1 > -1 && (t$2.parenthesizedAssign = r$1), n$1 > -1 && (t$2.trailingComma = n$1), c$1;
|
|
@@ -3321,9 +1961,9 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3321
1961
|
if (null != n$1 && (!r$1 || this.type !== f._in) && n$1 > s$1) {
|
|
3322
1962
|
var a$1 = this.type === f.logicalOR || this.type === f.logicalAND, o$1 = this.type === f.coalesce;
|
|
3323
1963
|
o$1 && (n$1 = f.logicalAND.binop);
|
|
3324
|
-
var h$
|
|
1964
|
+
var h$1 = this.value;
|
|
3325
1965
|
this.next();
|
|
3326
|
-
var c$1 = this.start, p$1 = this.startLoc, l$1 = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, r$1), c$1, p$1, n$1, r$1), u$1 = this.buildBinary(t$2, i$1, e$2, l$1, h$
|
|
1966
|
+
var c$1 = this.start, p$1 = this.startLoc, l$1 = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, r$1), c$1, p$1, n$1, r$1), u$1 = this.buildBinary(t$2, i$1, e$2, l$1, h$1, a$1 || o$1);
|
|
3327
1967
|
return (a$1 && this.type === f.coalesce || o$1 && (this.type === f.logicalOR || this.type === f.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(u$1, t$2, i$1, s$1, r$1);
|
|
3328
1968
|
}
|
|
3329
1969
|
return e$2;
|
|
@@ -3335,8 +1975,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3335
1975
|
var r$1, n$1 = this.start, a$1 = this.startLoc;
|
|
3336
1976
|
if (this.isContextual("await") && this.canAwait) r$1 = this.parseAwait(s$1), t$2 = !0;
|
|
3337
1977
|
else if (this.type.prefix) {
|
|
3338
|
-
var o$1 = this.startNode(), h$
|
|
3339
|
-
o$1.operator = this.value, o$1.prefix = !0, this.next(), o$1.argument = this.parseMaybeUnary(null, !0, h$
|
|
1978
|
+
var o$1 = this.startNode(), h$1 = this.type === f.incDec;
|
|
1979
|
+
o$1.operator = this.value, o$1.prefix = !0, this.next(), o$1.argument = this.parseMaybeUnary(null, !0, h$1, s$1), this.checkExpressionErrors(e$2, !0), h$1 ? this.checkLValSimple(o$1.argument) : this.strict && "delete" === o$1.operator && isLocalVariableAccess(o$1.argument) ? this.raiseRecoverable(o$1.start, "Deleting local variable in strict mode") : "delete" === o$1.operator && isPrivateFieldAccess(o$1.argument) ? this.raiseRecoverable(o$1.start, "Private fields can not be deleted") : t$2 = !0, r$1 = this.finishNode(o$1, h$1 ? "UpdateExpression" : "UnaryExpression");
|
|
3340
1980
|
} else if (t$2 || this.type !== f.privateId) {
|
|
3341
1981
|
if (r$1 = this.parseExprSubscripts(e$2, s$1), this.checkExpressionErrors(e$2)) return r$1;
|
|
3342
1982
|
for (; this.type.postfix && !this.canInsertSemicolon();) {
|
|
@@ -3355,8 +1995,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3355
1995
|
var o$1 = this.parseSubscript(e$2, t$2, i$1, s$1, n$1, a$1, r$1);
|
|
3356
1996
|
if (o$1.optional && (a$1 = !0), o$1 === e$2 || "ArrowFunctionExpression" === o$1.type) {
|
|
3357
1997
|
if (a$1) {
|
|
3358
|
-
var h$
|
|
3359
|
-
h$
|
|
1998
|
+
var h$1 = this.startNodeAt(t$2, i$1);
|
|
1999
|
+
h$1.expression = o$1, o$1 = this.finishNode(h$1, "ChainExpression");
|
|
3360
2000
|
}
|
|
3361
2001
|
return o$1;
|
|
3362
2002
|
}
|
|
@@ -3367,22 +2007,22 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3367
2007
|
}, $.parseSubscriptAsyncArrow = function(e$2, t$2, i$1, s$1) {
|
|
3368
2008
|
return this.parseArrowExpression(this.startNodeAt(e$2, t$2), i$1, !0, s$1);
|
|
3369
2009
|
}, $.parseSubscript = function(e$2, t$2, i$1, s$1, r$1, n$1, a$1) {
|
|
3370
|
-
var o$1 = this.options.ecmaVersion >= 11, h$
|
|
3371
|
-
s$1 && h$
|
|
2010
|
+
var o$1 = this.options.ecmaVersion >= 11, h$1 = o$1 && this.eat(f.questionDot);
|
|
2011
|
+
s$1 && h$1 && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
3372
2012
|
var c$1 = this.eat(f.bracketL);
|
|
3373
|
-
if (c$1 || h$
|
|
2013
|
+
if (c$1 || h$1 && this.type !== f.parenL && this.type !== f.backQuote || this.eat(f.dot)) {
|
|
3374
2014
|
var p$1 = this.startNodeAt(t$2, i$1);
|
|
3375
|
-
p$1.object = e$2, c$1 ? (p$1.property = this.parseExpression(), this.expect(f.bracketR)) : this.type === f.privateId && "Super" !== e$2.type ? p$1.property = this.parsePrivateIdent() : p$1.property = this.parseIdent("never" !== this.options.allowReserved), p$1.computed = !!c$1, o$1 && (p$1.optional = h$
|
|
2015
|
+
p$1.object = e$2, c$1 ? (p$1.property = this.parseExpression(), this.expect(f.bracketR)) : this.type === f.privateId && "Super" !== e$2.type ? p$1.property = this.parsePrivateIdent() : p$1.property = this.parseIdent("never" !== this.options.allowReserved), p$1.computed = !!c$1, o$1 && (p$1.optional = h$1), e$2 = this.finishNode(p$1, "MemberExpression");
|
|
3376
2016
|
} else if (!s$1 && this.eat(f.parenL)) {
|
|
3377
|
-
var l$1 = new acorn_DestructuringErrors(), u$1 = this.yieldPos, d$
|
|
2017
|
+
var l$1 = new acorn_DestructuringErrors(), u$1 = this.yieldPos, d$1 = this.awaitPos, m$1 = this.awaitIdentPos;
|
|
3378
2018
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
3379
2019
|
var g$1 = this.parseExprList(f.parenR, this.options.ecmaVersion >= 8, !1, l$1);
|
|
3380
|
-
if (r$1 && !h$
|
|
3381
|
-
this.checkExpressionErrors(l$1, !0), this.yieldPos = u$1 || this.yieldPos, this.awaitPos = d$
|
|
3382
|
-
var x$
|
|
3383
|
-
x$
|
|
2020
|
+
if (r$1 && !h$1 && this.shouldParseAsyncArrow()) return this.checkPatternErrors(l$1, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = u$1, this.awaitPos = d$1, this.awaitIdentPos = m$1, this.parseSubscriptAsyncArrow(t$2, i$1, g$1, a$1);
|
|
2021
|
+
this.checkExpressionErrors(l$1, !0), this.yieldPos = u$1 || this.yieldPos, this.awaitPos = d$1 || this.awaitPos, this.awaitIdentPos = m$1 || this.awaitIdentPos;
|
|
2022
|
+
var x$1 = this.startNodeAt(t$2, i$1);
|
|
2023
|
+
x$1.callee = e$2, x$1.arguments = g$1, o$1 && (x$1.optional = h$1), e$2 = this.finishNode(x$1, "CallExpression");
|
|
3384
2024
|
} else if (this.type === f.backQuote) {
|
|
3385
|
-
(h$
|
|
2025
|
+
(h$1 || n$1) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
3386
2026
|
var v$1 = this.startNodeAt(t$2, i$1);
|
|
3387
2027
|
v$1.tag = e$2, v$1.quasi = this.parseTemplate({ isTagged: !0 }), e$2 = this.finishNode(v$1, "TaggedTemplateExpression");
|
|
3388
2028
|
}
|
|
@@ -3394,13 +2034,13 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3394
2034
|
case f._super: return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), s$1 = this.startNode(), this.next(), this.type !== f.parenL || this.allowDirectSuper || this.raise(s$1.start, "super() call outside constructor of a subclass"), this.type !== f.dot && this.type !== f.bracketL && this.type !== f.parenL && this.unexpected(), this.finishNode(s$1, "Super");
|
|
3395
2035
|
case f._this: return s$1 = this.startNode(), this.next(), this.finishNode(s$1, "ThisExpression");
|
|
3396
2036
|
case f.name:
|
|
3397
|
-
var n$1 = this.start, a$1 = this.startLoc, o$1 = this.containsEsc, h$
|
|
3398
|
-
if (this.options.ecmaVersion >= 8 && !o$1 && "async" === h$
|
|
2037
|
+
var n$1 = this.start, a$1 = this.startLoc, o$1 = this.containsEsc, h$1 = this.parseIdent(!1);
|
|
2038
|
+
if (this.options.ecmaVersion >= 8 && !o$1 && "async" === h$1.name && !this.canInsertSemicolon() && this.eat(f._function)) return this.overrideContext(F.f_expr), this.parseFunction(this.startNodeAt(n$1, a$1), 0, !1, !0, t$2);
|
|
3399
2039
|
if (r$1 && !this.canInsertSemicolon()) {
|
|
3400
|
-
if (this.eat(f.arrow)) return this.parseArrowExpression(this.startNodeAt(n$1, a$1), [h$
|
|
3401
|
-
if (this.options.ecmaVersion >= 8 && "async" === h$
|
|
2040
|
+
if (this.eat(f.arrow)) return this.parseArrowExpression(this.startNodeAt(n$1, a$1), [h$1], !1, t$2);
|
|
2041
|
+
if (this.options.ecmaVersion >= 8 && "async" === h$1.name && this.type === f.name && !o$1 && (!this.potentialArrowInForAwait || "of" !== this.value || this.containsEsc)) return h$1 = this.parseIdent(!1), !this.canInsertSemicolon() && this.eat(f.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAt(n$1, a$1), [h$1], !0, t$2);
|
|
3402
2042
|
}
|
|
3403
|
-
return h$
|
|
2043
|
+
return h$1;
|
|
3404
2044
|
case f.regexp:
|
|
3405
2045
|
var c$1 = this.value;
|
|
3406
2046
|
return (s$1 = this.parseLiteral(c$1.value)).regex = {
|
|
@@ -3458,7 +2098,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3458
2098
|
var i$1, s$1 = this.start, r$1 = this.startLoc, n$1 = this.options.ecmaVersion >= 8;
|
|
3459
2099
|
if (this.options.ecmaVersion >= 6) {
|
|
3460
2100
|
this.next();
|
|
3461
|
-
var a$1, o$1 = this.start, h$
|
|
2101
|
+
var a$1, o$1 = this.start, h$1 = this.startLoc, c$1 = [], p$1 = !0, l$1 = !1, u$1 = new acorn_DestructuringErrors(), d$1 = this.yieldPos, m$1 = this.awaitPos;
|
|
3462
2102
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== f.parenR;) {
|
|
3463
2103
|
if (p$1 ? p$1 = !1 : this.expect(f.comma), n$1 && this.afterTrailingComma(f.parenR, !0)) {
|
|
3464
2104
|
l$1 = !0;
|
|
@@ -3470,9 +2110,9 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3470
2110
|
}
|
|
3471
2111
|
c$1.push(this.parseMaybeAssign(!1, u$1, this.parseParenItem));
|
|
3472
2112
|
}
|
|
3473
|
-
var g$1 = this.lastTokEnd, x$
|
|
3474
|
-
if (this.expect(f.parenR), e$2 && this.shouldParseArrow(c$1) && this.eat(f.arrow)) return this.checkPatternErrors(u$1, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = d$
|
|
3475
|
-
c$1.length && !l$1 || this.unexpected(this.lastTokStart), a$1 && this.unexpected(a$1), this.checkExpressionErrors(u$1, !0), this.yieldPos = d$
|
|
2113
|
+
var g$1 = this.lastTokEnd, x$1 = this.lastTokEndLoc;
|
|
2114
|
+
if (this.expect(f.parenR), e$2 && this.shouldParseArrow(c$1) && this.eat(f.arrow)) return this.checkPatternErrors(u$1, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = d$1, this.awaitPos = m$1, this.parseParenArrowList(s$1, r$1, c$1, t$2);
|
|
2115
|
+
c$1.length && !l$1 || this.unexpected(this.lastTokStart), a$1 && this.unexpected(a$1), this.checkExpressionErrors(u$1, !0), this.yieldPos = d$1 || this.yieldPos, this.awaitPos = m$1 || this.awaitPos, c$1.length > 1 ? ((i$1 = this.startNodeAt(o$1, h$1)).expressions = c$1, this.finishNodeAt(i$1, "SequenceExpression", g$1, x$1)) : i$1 = c$1[0];
|
|
3476
2116
|
} else i$1 = this.parseParenExpression();
|
|
3477
2117
|
if (this.options.preserveParens) {
|
|
3478
2118
|
var v$1 = this.startNodeAt(s$1, r$1);
|
|
@@ -3561,8 +2201,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3561
2201
|
else {
|
|
3562
2202
|
var o$1 = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e$2.params);
|
|
3563
2203
|
n$1 && !o$1 || (a$1 = this.strictDirective(this.end)) && o$1 && this.raiseRecoverable(e$2.start, "Illegal 'use strict' directive in function with non-simple parameter list");
|
|
3564
|
-
var h$
|
|
3565
|
-
this.labels = [], a$1 && (this.strict = !0), this.checkParams(e$2, !n$1 && !a$1 && !t$2 && !i$1 && this.isSimpleParamList(e$2.params)), this.strict && e$2.id && this.checkLValSimple(e$2.id, 5), e$2.body = this.parseBlock(!1, void 0, a$1 && !n$1), e$2.expression = !1, this.adaptDirectivePrologue(e$2.body.body), this.labels = h$
|
|
2204
|
+
var h$1 = this.labels;
|
|
2205
|
+
this.labels = [], a$1 && (this.strict = !0), this.checkParams(e$2, !n$1 && !a$1 && !t$2 && !i$1 && this.isSimpleParamList(e$2.params)), this.strict && e$2.id && this.checkLValSimple(e$2.id, 5), e$2.body = this.parseBlock(!1, void 0, a$1 && !n$1), e$2.expression = !1, this.adaptDirectivePrologue(e$2.body.body), this.labels = h$1;
|
|
3566
2206
|
}
|
|
3567
2207
|
this.exitScope();
|
|
3568
2208
|
}, $.isSimpleParamList = function(e$2) {
|
|
@@ -3672,10 +2312,10 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3672
2312
|
for (var i$1 in e$2) t$2[i$1] = e$2[i$1];
|
|
3673
2313
|
return t$2;
|
|
3674
2314
|
};
|
|
3675
|
-
var K = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", z
|
|
2315
|
+
var K = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", z = K + " Extended_Pictographic", J = z + " EBase EComp EMod EPres ExtPict", Y = {
|
|
3676
2316
|
9: K,
|
|
3677
|
-
10: z
|
|
3678
|
-
11: z
|
|
2317
|
+
10: z,
|
|
2318
|
+
11: z,
|
|
3679
2319
|
12: J,
|
|
3680
2320
|
13: J,
|
|
3681
2321
|
14: J
|
|
@@ -3842,8 +2482,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3842
2482
|
var a$1 = this.regexp_eatModifiers(e$2);
|
|
3843
2483
|
i$1 || a$1 || 58 !== e$2.current() || e$2.raise("Invalid regular expression modifiers");
|
|
3844
2484
|
for (var o$1 = 0; o$1 < a$1.length; o$1++) {
|
|
3845
|
-
var h$
|
|
3846
|
-
(a$1.indexOf(h$
|
|
2485
|
+
var h$1 = a$1.charAt(o$1);
|
|
2486
|
+
(a$1.indexOf(h$1, o$1 + 1) > -1 || i$1.indexOf(h$1) > -1) && e$2.raise("Duplicate regular expression modifiers");
|
|
3847
2487
|
}
|
|
3848
2488
|
}
|
|
3849
2489
|
}
|
|
@@ -4245,7 +2885,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4245
2885
|
}
|
|
4246
2886
|
break;
|
|
4247
2887
|
default:
|
|
4248
|
-
if (!(e$2 > 8 && e$2 < 14 || e$2 >= 5760 && x
|
|
2888
|
+
if (!(e$2 > 8 && e$2 < 14 || e$2 >= 5760 && x.test(String.fromCharCode(e$2)))) break e;
|
|
4249
2889
|
++this.pos;
|
|
4250
2890
|
}
|
|
4251
2891
|
}
|
|
@@ -4376,19 +3016,19 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4376
3016
|
this.containsEsc && this.unexpected(n$1);
|
|
4377
3017
|
var o$1 = this.regexpState || (this.regexpState = new acorn_RegExpValidationState(this));
|
|
4378
3018
|
o$1.reset(i$1, r$1, a$1), this.validateRegExpFlags(o$1), this.validateRegExpPattern(o$1);
|
|
4379
|
-
var h$
|
|
3019
|
+
var h$1 = null;
|
|
4380
3020
|
try {
|
|
4381
|
-
h$
|
|
3021
|
+
h$1 = new RegExp(r$1, a$1);
|
|
4382
3022
|
} catch (e$3) {}
|
|
4383
3023
|
return this.finishToken(f.regexp, {
|
|
4384
3024
|
pattern: r$1,
|
|
4385
3025
|
flags: a$1,
|
|
4386
|
-
value: h$
|
|
3026
|
+
value: h$1
|
|
4387
3027
|
});
|
|
4388
3028
|
}, ce.readInt = function(e$2, t$2, i$1) {
|
|
4389
|
-
for (var s$1 = this.options.ecmaVersion >= 12 && void 0 === t$2, r$1 = i$1 && 48 === this.input.charCodeAt(this.pos), n$1 = this.pos, a$1 = 0, o$1 = 0, h$
|
|
3029
|
+
for (var s$1 = this.options.ecmaVersion >= 12 && void 0 === t$2, r$1 = i$1 && 48 === this.input.charCodeAt(this.pos), n$1 = this.pos, a$1 = 0, o$1 = 0, h$1 = 0, c$1 = null == t$2 ? Infinity : t$2; h$1 < c$1; ++h$1, ++this.pos) {
|
|
4390
3030
|
var p$1 = this.input.charCodeAt(this.pos), l$1 = void 0;
|
|
4391
|
-
if (s$1 && 95 === p$1) r$1 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), 95 === o$1 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), 0 === h$
|
|
3031
|
+
if (s$1 && 95 === p$1) r$1 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), 95 === o$1 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), 0 === h$1 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), o$1 = p$1;
|
|
4392
3032
|
else {
|
|
4393
3033
|
if ((l$1 = p$1 >= 97 ? p$1 - 97 + 10 : p$1 >= 65 ? p$1 - 65 + 10 : p$1 >= 48 && p$1 <= 57 ? p$1 - 48 : Infinity) >= e$2) break;
|
|
4394
3034
|
o$1 = p$1, a$1 = a$1 * e$2 + l$1;
|
|
@@ -4519,7 +3159,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4519
3159
|
return e$2 + this.input.slice(i$1, this.pos);
|
|
4520
3160
|
}, ce.readWord = function() {
|
|
4521
3161
|
var e$2 = this.readWord1(), t$2 = f.name;
|
|
4522
|
-
return this.keywords.test(e$2) && (t$2 = d
|
|
3162
|
+
return this.keywords.test(e$2) && (t$2 = d[e$2]), this.finishToken(t$2, e$2);
|
|
4523
3163
|
};
|
|
4524
3164
|
acorn_Parser.acorn = {
|
|
4525
3165
|
Parser: acorn_Parser,
|
|
@@ -4531,7 +3171,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4531
3171
|
Node: acorn_Node,
|
|
4532
3172
|
TokenType: acorn_TokenType,
|
|
4533
3173
|
tokTypes: f,
|
|
4534
|
-
keywordTypes: d
|
|
3174
|
+
keywordTypes: d,
|
|
4535
3175
|
TokContext: acorn_TokContext,
|
|
4536
3176
|
tokContexts: F,
|
|
4537
3177
|
isIdentifierChar,
|
|
@@ -4540,7 +3180,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4540
3180
|
isNewLine,
|
|
4541
3181
|
lineBreak: m,
|
|
4542
3182
|
lineBreakG: g,
|
|
4543
|
-
nonASCIIwhitespace: x
|
|
3183
|
+
nonASCIIwhitespace: x
|
|
4544
3184
|
};
|
|
4545
3185
|
const le = __require("node:module"), ue = __require("node:fs");
|
|
4546
3186
|
String.fromCharCode;
|
|
@@ -4574,8 +3214,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4574
3214
|
}
|
|
4575
3215
|
const ge = /^[/\\]{2}/, xe = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, ve = /^[A-Za-z]:$/, ye = /.(\.[^./]+|\.)$/, pathe_M_eThtNZ_normalize = function(e$2) {
|
|
4576
3216
|
if (0 === e$2.length) return ".";
|
|
4577
|
-
const t$2 = (e$2 = pathe_M_eThtNZ_normalizeWindowsPath(e$2)).match(ge), i$1 = isAbsolute
|
|
4578
|
-
return 0 === (e$2 = normalizeString(e$2, !i$1)).length ? i$1 ? "/" : s$1 ? "./" : "." : (s$1 && (e$2 += "/"), ve.test(e$2) && (e$2 += "/"), t$2 ? i$1 ? `//${e$2}` : `//./${e$2}` : i$1 && !isAbsolute
|
|
3217
|
+
const t$2 = (e$2 = pathe_M_eThtNZ_normalizeWindowsPath(e$2)).match(ge), i$1 = isAbsolute(e$2), s$1 = "/" === e$2[e$2.length - 1];
|
|
3218
|
+
return 0 === (e$2 = normalizeString(e$2, !i$1)).length ? i$1 ? "/" : s$1 ? "./" : "." : (s$1 && (e$2 += "/"), ve.test(e$2) && (e$2 += "/"), t$2 ? i$1 ? `//${e$2}` : `//./${e$2}` : i$1 && !isAbsolute(e$2) ? `/${e$2}` : e$2);
|
|
4579
3219
|
}, pathe_M_eThtNZ_join = function(...e$2) {
|
|
4580
3220
|
let t$2 = "";
|
|
4581
3221
|
for (const i$1 of e$2) if (i$1) if (t$2.length > 0) {
|
|
@@ -4591,9 +3231,9 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4591
3231
|
let t$2 = "", i$1 = !1;
|
|
4592
3232
|
for (let s$1 = (e$2 = e$2.map((e$3) => pathe_M_eThtNZ_normalizeWindowsPath(e$3))).length - 1; s$1 >= -1 && !i$1; s$1--) {
|
|
4593
3233
|
const r$1 = s$1 >= 0 ? e$2[s$1] : pathe_M_eThtNZ_cwd();
|
|
4594
|
-
r$1 && 0 !== r$1.length && (t$2 = `${r$1}/${t$2}`, i$1 = isAbsolute
|
|
3234
|
+
r$1 && 0 !== r$1.length && (t$2 = `${r$1}/${t$2}`, i$1 = isAbsolute(r$1));
|
|
4595
3235
|
}
|
|
4596
|
-
return t$2 = normalizeString(t$2, !i$1), i$1 && !isAbsolute
|
|
3236
|
+
return t$2 = normalizeString(t$2, !i$1), i$1 && !isAbsolute(t$2) ? `/${t$2}` : t$2.length > 0 ? t$2 : ".";
|
|
4597
3237
|
};
|
|
4598
3238
|
function normalizeString(e$2, t$2) {
|
|
4599
3239
|
let i$1 = "", s$1 = 0, r$1 = -1, n$1 = 0, a$1 = null;
|
|
@@ -4624,16 +3264,16 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4624
3264
|
}
|
|
4625
3265
|
return i$1;
|
|
4626
3266
|
}
|
|
4627
|
-
const isAbsolute
|
|
3267
|
+
const isAbsolute = function(e$2) {
|
|
4628
3268
|
return xe.test(e$2);
|
|
4629
|
-
}, extname
|
|
3269
|
+
}, extname = function(e$2) {
|
|
4630
3270
|
if (".." === e$2) return "";
|
|
4631
3271
|
const t$2 = ye.exec(pathe_M_eThtNZ_normalizeWindowsPath(e$2));
|
|
4632
3272
|
return t$2 && t$2[1] || "";
|
|
4633
3273
|
}, pathe_M_eThtNZ_dirname = function(e$2) {
|
|
4634
3274
|
const t$2 = pathe_M_eThtNZ_normalizeWindowsPath(e$2).replace(/\/$/, "").split("/").slice(0, -1);
|
|
4635
|
-
return 1 === t$2.length && ve.test(t$2[0]) && (t$2[0] += "/"), t$2.join("/") || (isAbsolute
|
|
4636
|
-
}, basename
|
|
3275
|
+
return 1 === t$2.length && ve.test(t$2[0]) && (t$2[0] += "/"), t$2.join("/") || (isAbsolute(e$2) ? "/" : ".");
|
|
3276
|
+
}, basename = function(e$2, t$2) {
|
|
4637
3277
|
const i$1 = pathe_M_eThtNZ_normalizeWindowsPath(e$2).split("/");
|
|
4638
3278
|
let s$1 = "";
|
|
4639
3279
|
for (let e$3 = i$1.length - 1; e$3 >= 0; e$3--) {
|
|
@@ -4659,19 +3299,19 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4659
3299
|
"bigint",
|
|
4660
3300
|
"symbol"
|
|
4661
3301
|
]), Te = {};
|
|
4662
|
-
function formatList
|
|
3302
|
+
function formatList(e$2, t$2 = "and") {
|
|
4663
3303
|
return e$2.length < 3 ? e$2.join(` ${t$2} `) : `${e$2.slice(0, -1).join(", ")}, ${t$2} ${e$2[e$2.length - 1]}`;
|
|
4664
3304
|
}
|
|
4665
3305
|
const Ae = /* @__PURE__ */ new Map();
|
|
4666
3306
|
let Ne;
|
|
4667
|
-
function createError
|
|
3307
|
+
function createError(e$2, t$2, i$1) {
|
|
4668
3308
|
return Ae.set(e$2, t$2), function(e$3, t$3) {
|
|
4669
3309
|
return NodeError;
|
|
4670
3310
|
function NodeError(...i$2) {
|
|
4671
3311
|
const s$1 = Error.stackTraceLimit;
|
|
4672
|
-
isErrorStackTraceLimitWritable
|
|
3312
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
|
|
4673
3313
|
const r$1 = new e$3();
|
|
4674
|
-
isErrorStackTraceLimitWritable
|
|
3314
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = s$1);
|
|
4675
3315
|
const n$1 = function(e$4, t$4, i$3) {
|
|
4676
3316
|
const s$2 = Ae.get(e$4);
|
|
4677
3317
|
if (Ee(void 0 !== s$2, "expected `message` to be found"), "function" == typeof s$2) return Ee(s$2.length <= t$4.length, `Code: ${e$4}; The provided arguments length (${t$4.length}) does not match the required ones (${s$2.length}).`), Reflect.apply(s$2, i$3, t$4);
|
|
@@ -4699,14 +3339,14 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4699
3339
|
}
|
|
4700
3340
|
}(i$1, e$2);
|
|
4701
3341
|
}
|
|
4702
|
-
function isErrorStackTraceLimitWritable
|
|
3342
|
+
function isErrorStackTraceLimitWritable() {
|
|
4703
3343
|
try {
|
|
4704
3344
|
if (ke.startupSnapshot.isBuildingSnapshot()) return !1;
|
|
4705
3345
|
} catch {}
|
|
4706
3346
|
const e$2 = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
4707
3347
|
return void 0 === e$2 ? Object.isExtensible(Error) : Ce.call(e$2, "writable") && void 0 !== e$2.writable ? e$2.writable : void 0 !== e$2.set;
|
|
4708
3348
|
}
|
|
4709
|
-
Te.ERR_INVALID_ARG_TYPE = createError
|
|
3349
|
+
Te.ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (e$2, t$2, i$1) => {
|
|
4710
3350
|
Ee("string" == typeof e$2, "'name' must be a string"), Array.isArray(t$2) || (t$2 = [t$2]);
|
|
4711
3351
|
let s$1 = "The ";
|
|
4712
3352
|
if (e$2.endsWith(" argument")) s$1 += `${e$2} `;
|
|
@@ -4721,7 +3361,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4721
3361
|
const e$3 = r$1.indexOf("object");
|
|
4722
3362
|
-1 !== e$3 && (r$1.slice(e$3, 1), n$1.push("Object"));
|
|
4723
3363
|
}
|
|
4724
|
-
return r$1.length > 0 && (s$1 += `${r$1.length > 1 ? "one of type" : "of type"} ${formatList
|
|
3364
|
+
return r$1.length > 0 && (s$1 += `${r$1.length > 1 ? "one of type" : "of type"} ${formatList(r$1, "or")}`, (n$1.length > 0 || a$1.length > 0) && (s$1 += " or ")), n$1.length > 0 && (s$1 += `an instance of ${formatList(n$1, "or")}`, a$1.length > 0 && (s$1 += " or ")), a$1.length > 0 && (a$1.length > 1 ? s$1 += `one of ${formatList(a$1, "or")}` : (a$1[0].toLowerCase() !== a$1[0] && (s$1 += "an "), s$1 += `${a$1[0]}`)), s$1 += `. Received ${function(e$3) {
|
|
4725
3365
|
if (null == e$3) return String(e$3);
|
|
4726
3366
|
if ("function" == typeof e$3 && e$3.name) return `function ${e$3.name}`;
|
|
4727
3367
|
if ("object" == typeof e$3) return e$3.constructor && e$3.constructor.name ? `an instance of ${e$3.constructor.name}` : `${(0, we.inspect)(e$3, { depth: -1 })}`;
|
|
@@ -4729,10 +3369,10 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4729
3369
|
t$3.length > 28 && (t$3 = `${t$3.slice(0, 25)}...`);
|
|
4730
3370
|
return `type ${typeof e$3} (${t$3})`;
|
|
4731
3371
|
}(i$1)}`, s$1;
|
|
4732
|
-
}, TypeError), Te.ERR_INVALID_MODULE_SPECIFIER = createError
|
|
3372
|
+
}, TypeError), Te.ERR_INVALID_MODULE_SPECIFIER = createError("ERR_INVALID_MODULE_SPECIFIER", (e$2, t$2, i$1 = void 0) => `Invalid module "${e$2}" ${t$2}${i$1 ? ` imported from ${i$1}` : ""}`, TypeError), Te.ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (e$2, t$2, i$1) => `Invalid package config ${e$2}${t$2 ? ` while importing ${t$2}` : ""}${i$1 ? `. ${i$1}` : ""}`, Error), Te.ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (e$2, t$2, i$1, s$1 = !1, r$1 = void 0) => {
|
|
4733
3373
|
const n$1 = "string" == typeof i$1 && !s$1 && i$1.length > 0 && !i$1.startsWith("./");
|
|
4734
3374
|
return "." === t$2 ? (Ee(!1 === s$1), `Invalid "exports" main target ${JSON.stringify(i$1)} defined in the package config ${e$2}package.json${r$1 ? ` imported from ${r$1}` : ""}${n$1 ? "; targets must start with \"./\"" : ""}`) : `Invalid "${s$1 ? "imports" : "exports"}" target ${JSON.stringify(i$1)} defined for '${t$2}' in the package config ${e$2}package.json${r$1 ? ` imported from ${r$1}` : ""}${n$1 ? "; targets must start with \"./\"" : ""}`;
|
|
4735
|
-
}, Error), Te.ERR_MODULE_NOT_FOUND = createError
|
|
3375
|
+
}, Error), Te.ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (e$2, t$2, i$1 = !1) => `Cannot find ${i$1 ? "module" : "package"} '${e$2}' imported from ${t$2}`, Error), Te.ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), Te.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (e$2, t$2, i$1) => `Package import specifier "${e$2}" is not defined${t$2 ? ` in package ${t$2}package.json` : ""} imported from ${i$1}`, TypeError), Te.ERR_PACKAGE_PATH_NOT_EXPORTED = createError("ERR_PACKAGE_PATH_NOT_EXPORTED", (e$2, t$2, i$1 = void 0) => "." === t$2 ? `No "exports" main defined in ${e$2}package.json${i$1 ? ` imported from ${i$1}` : ""}` : `Package subpath '${t$2}' is not defined by "exports" in ${e$2}package.json${i$1 ? ` imported from ${i$1}` : ""}`, Error), Te.ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), Te.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", "Failed to resolve module specifier \"%s\" from \"%s\": Invalid relative URL or base scheme is not hierarchical.", TypeError), Te.ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (e$2, t$2) => `Unknown file extension "${e$2}" for ${t$2}`, TypeError), Te.ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (e$2, t$2, i$1 = "is invalid") => {
|
|
4736
3376
|
let s$1 = (0, we.inspect)(t$2);
|
|
4737
3377
|
s$1.length > 128 && (s$1 = `${s$1.slice(0, 128)}...`);
|
|
4738
3378
|
return `The ${e$2.includes(".") ? "property" : "argument"} '${e$2}' ${i$1}. Received ${s$1}`;
|
|
@@ -4741,11 +3381,11 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4741
3381
|
const t$2 = "__node_internal_" + e$2.name;
|
|
4742
3382
|
return Object.defineProperty(e$2, "name", { value: t$2 }), e$2;
|
|
4743
3383
|
}(function(e$2) {
|
|
4744
|
-
const t$2 = isErrorStackTraceLimitWritable
|
|
3384
|
+
const t$2 = isErrorStackTraceLimitWritable();
|
|
4745
3385
|
return t$2 && (Ne = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(e$2), t$2 && (Error.stackTraceLimit = Ne), e$2;
|
|
4746
3386
|
});
|
|
4747
3387
|
const Oe = {}.hasOwnProperty, { ERR_INVALID_PACKAGE_CONFIG: De } = Te, Ve = /* @__PURE__ */ new Map();
|
|
4748
|
-
function read
|
|
3388
|
+
function read(e$2, { base: t$2, specifier: i$1 }) {
|
|
4749
3389
|
const s$1 = Ve.get(e$2);
|
|
4750
3390
|
if (s$1) return s$1;
|
|
4751
3391
|
let r$1;
|
|
@@ -4776,11 +3416,11 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4776
3416
|
}
|
|
4777
3417
|
return Ve.set(e$2, n$1), n$1;
|
|
4778
3418
|
}
|
|
4779
|
-
function getPackageScopeConfig
|
|
3419
|
+
function getPackageScopeConfig(e$2) {
|
|
4780
3420
|
let t$2 = new URL("package.json", e$2);
|
|
4781
3421
|
for (;;) {
|
|
4782
3422
|
if (t$2.pathname.endsWith("node_modules/package.json")) break;
|
|
4783
|
-
const i$1 = read
|
|
3423
|
+
const i$1 = read((0, _e.fileURLToPath)(t$2), { specifier: e$2 });
|
|
4784
3424
|
if (i$1.exists) return i$1;
|
|
4785
3425
|
const s$1 = t$2;
|
|
4786
3426
|
if (t$2 = new URL("../package.json", t$2), t$2.pathname === s$1.pathname) break;
|
|
@@ -4792,7 +3432,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4792
3432
|
};
|
|
4793
3433
|
}
|
|
4794
3434
|
function getPackageType(e$2) {
|
|
4795
|
-
return getPackageScopeConfig
|
|
3435
|
+
return getPackageScopeConfig(e$2).type;
|
|
4796
3436
|
}
|
|
4797
3437
|
const { ERR_UNKNOWN_FILE_EXTENSION: Ue } = Te, Me = {}.hasOwnProperty, je = {
|
|
4798
3438
|
__proto__: null,
|
|
@@ -4843,12 +3483,12 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4843
3483
|
};
|
|
4844
3484
|
function getHttpProtocolModuleFormat() {}
|
|
4845
3485
|
const Be = RegExp.prototype[Symbol.replace], { ERR_INVALID_MODULE_SPECIFIER: $e, ERR_INVALID_PACKAGE_CONFIG: qe, ERR_INVALID_PACKAGE_TARGET: We, ERR_MODULE_NOT_FOUND: Ge, ERR_PACKAGE_IMPORT_NOT_DEFINED: He, ERR_PACKAGE_PATH_NOT_EXPORTED: Ke, ERR_UNSUPPORTED_DIR_IMPORT: ze, ERR_UNSUPPORTED_RESOLVE_REQUEST: Je } = Te, Ye = {}.hasOwnProperty, Qe = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i, Ze = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i, Xe = /^\.|%|\\/, et = /\*/g, tt = /%2f|%5c/i, it = /* @__PURE__ */ new Set(), st = /[/\\]{2}/;
|
|
4846
|
-
function emitInvalidSegmentDeprecation
|
|
3486
|
+
function emitInvalidSegmentDeprecation(e$2, t$2, i$1, s$1, r$1, n$1, a$1) {
|
|
4847
3487
|
if (be.noDeprecation) return;
|
|
4848
|
-
const o$1 = (0, _e.fileURLToPath)(s$1), h$
|
|
4849
|
-
be.emitWarning(`Use of deprecated ${h$
|
|
3488
|
+
const o$1 = (0, _e.fileURLToPath)(s$1), h$1 = null !== st.exec(a$1 ? e$2 : t$2);
|
|
3489
|
+
be.emitWarning(`Use of deprecated ${h$1 ? "double slash" : "leading or trailing slash matching"} resolving "${e$2}" for module request "${t$2}" ${t$2 === i$1 ? "" : `matched to "${i$1}" `}in the "${r$1 ? "imports" : "exports"}" field module resolution of the package at ${o$1}${n$1 ? ` imported from ${(0, _e.fileURLToPath)(n$1)}` : ""}.`, "DeprecationWarning", "DEP0166");
|
|
4850
3490
|
}
|
|
4851
|
-
function emitLegacyIndexDeprecation
|
|
3491
|
+
function emitLegacyIndexDeprecation(e$2, t$2, i$1, s$1) {
|
|
4852
3492
|
if (be.noDeprecation) return;
|
|
4853
3493
|
if ("module" !== function(e$3, t$3) {
|
|
4854
3494
|
const i$2 = e$3.protocol;
|
|
@@ -4857,19 +3497,19 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4857
3497
|
const n$1 = (0, _e.fileURLToPath)(e$2.href), a$1 = (0, _e.fileURLToPath)(new _e.URL(".", t$2)), o$1 = (0, _e.fileURLToPath)(i$1);
|
|
4858
3498
|
s$1 ? Se.resolve(a$1, s$1) !== n$1 && be.emitWarning(`Package ${a$1} has a "main" field set to "${s$1}", excluding the full filename and extension to the resolved file at "${n$1.slice(a$1.length)}", imported from ${o$1}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151") : be.emitWarning(`No "main" or "exports" field defined in the package.json for ${a$1} resolving the main entry point "${n$1.slice(a$1.length)}", imported from ${o$1}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
4859
3499
|
}
|
|
4860
|
-
function tryStatSync
|
|
3500
|
+
function tryStatSync(e$2) {
|
|
4861
3501
|
try {
|
|
4862
3502
|
return (0, ue.statSync)(e$2);
|
|
4863
3503
|
} catch {}
|
|
4864
3504
|
}
|
|
4865
|
-
function fileExists
|
|
3505
|
+
function fileExists(e$2) {
|
|
4866
3506
|
const t$2 = (0, ue.statSync)(e$2, { throwIfNoEntry: !1 }), i$1 = t$2 ? t$2.isFile() : void 0;
|
|
4867
3507
|
return null != i$1 && i$1;
|
|
4868
3508
|
}
|
|
4869
|
-
function legacyMainResolve
|
|
3509
|
+
function legacyMainResolve(e$2, t$2, i$1) {
|
|
4870
3510
|
let s$1;
|
|
4871
3511
|
if (void 0 !== t$2.main) {
|
|
4872
|
-
if (s$1 = new _e.URL(t$2.main, e$2), fileExists
|
|
3512
|
+
if (s$1 = new _e.URL(t$2.main, e$2), fileExists(s$1)) return s$1;
|
|
4873
3513
|
const r$2 = [
|
|
4874
3514
|
`./${t$2.main}.js`,
|
|
4875
3515
|
`./${t$2.main}.json`,
|
|
@@ -4879,8 +3519,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4879
3519
|
`./${t$2.main}/index.node`
|
|
4880
3520
|
];
|
|
4881
3521
|
let n$2 = -1;
|
|
4882
|
-
for (; ++n$2 < r$2.length && (s$1 = new _e.URL(r$2[n$2], e$2), !fileExists
|
|
4883
|
-
if (s$1) return emitLegacyIndexDeprecation
|
|
3522
|
+
for (; ++n$2 < r$2.length && (s$1 = new _e.URL(r$2[n$2], e$2), !fileExists(s$1));) s$1 = void 0;
|
|
3523
|
+
if (s$1) return emitLegacyIndexDeprecation(s$1, e$2, i$1, t$2.main), s$1;
|
|
4884
3524
|
}
|
|
4885
3525
|
const r$1 = [
|
|
4886
3526
|
"./index.js",
|
|
@@ -4888,54 +3528,54 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4888
3528
|
"./index.node"
|
|
4889
3529
|
];
|
|
4890
3530
|
let n$1 = -1;
|
|
4891
|
-
for (; ++n$1 < r$1.length && (s$1 = new _e.URL(r$1[n$1], e$2), !fileExists
|
|
4892
|
-
if (s$1) return emitLegacyIndexDeprecation
|
|
3531
|
+
for (; ++n$1 < r$1.length && (s$1 = new _e.URL(r$1[n$1], e$2), !fileExists(s$1));) s$1 = void 0;
|
|
3532
|
+
if (s$1) return emitLegacyIndexDeprecation(s$1, e$2, i$1, t$2.main), s$1;
|
|
4893
3533
|
throw new Ge((0, _e.fileURLToPath)(new _e.URL(".", e$2)), (0, _e.fileURLToPath)(i$1));
|
|
4894
3534
|
}
|
|
4895
|
-
function exportsNotFound
|
|
3535
|
+
function exportsNotFound(e$2, t$2, i$1) {
|
|
4896
3536
|
return new Ke((0, _e.fileURLToPath)(new _e.URL(".", t$2)), e$2, i$1 && (0, _e.fileURLToPath)(i$1));
|
|
4897
3537
|
}
|
|
4898
|
-
function invalidPackageTarget
|
|
3538
|
+
function invalidPackageTarget(e$2, t$2, i$1, s$1, r$1) {
|
|
4899
3539
|
return t$2 = "object" == typeof t$2 && null !== t$2 ? JSON.stringify(t$2, null, "") : `${t$2}`, new We((0, _e.fileURLToPath)(new _e.URL(".", i$1)), e$2, t$2, s$1, r$1 && (0, _e.fileURLToPath)(r$1));
|
|
4900
3540
|
}
|
|
4901
|
-
function resolvePackageTargetString
|
|
4902
|
-
if ("" !== t$2 && !n$1 && "/" !== e$2[e$2.length - 1]) throw invalidPackageTarget
|
|
3541
|
+
function resolvePackageTargetString(e$2, t$2, i$1, s$1, r$1, n$1, a$1, o$1, h$1) {
|
|
3542
|
+
if ("" !== t$2 && !n$1 && "/" !== e$2[e$2.length - 1]) throw invalidPackageTarget(i$1, e$2, s$1, a$1, r$1);
|
|
4903
3543
|
if (!e$2.startsWith("./")) {
|
|
4904
3544
|
if (a$1 && !e$2.startsWith("../") && !e$2.startsWith("/")) {
|
|
4905
3545
|
let i$2 = !1;
|
|
4906
3546
|
try {
|
|
4907
3547
|
new _e.URL(e$2), i$2 = !0;
|
|
4908
3548
|
} catch {}
|
|
4909
|
-
if (!i$2) return packageResolve
|
|
3549
|
+
if (!i$2) return packageResolve(n$1 ? Be.call(et, e$2, () => t$2) : e$2 + t$2, s$1, h$1);
|
|
4910
3550
|
}
|
|
4911
|
-
throw invalidPackageTarget
|
|
3551
|
+
throw invalidPackageTarget(i$1, e$2, s$1, a$1, r$1);
|
|
4912
3552
|
}
|
|
4913
3553
|
if (null !== Qe.exec(e$2.slice(2))) {
|
|
4914
|
-
if (null !== Ze.exec(e$2.slice(2))) throw invalidPackageTarget
|
|
3554
|
+
if (null !== Ze.exec(e$2.slice(2))) throw invalidPackageTarget(i$1, e$2, s$1, a$1, r$1);
|
|
4915
3555
|
if (!o$1) {
|
|
4916
3556
|
const o$2 = n$1 ? i$1.replace("*", () => t$2) : i$1 + t$2;
|
|
4917
|
-
emitInvalidSegmentDeprecation
|
|
3557
|
+
emitInvalidSegmentDeprecation(n$1 ? Be.call(et, e$2, () => t$2) : e$2, o$2, i$1, s$1, a$1, r$1, !0);
|
|
4918
3558
|
}
|
|
4919
3559
|
}
|
|
4920
3560
|
const c$1 = new _e.URL(e$2, s$1), p$1 = c$1.pathname, l$1 = new _e.URL(".", s$1).pathname;
|
|
4921
|
-
if (!p$1.startsWith(l$1)) throw invalidPackageTarget
|
|
3561
|
+
if (!p$1.startsWith(l$1)) throw invalidPackageTarget(i$1, e$2, s$1, a$1, r$1);
|
|
4922
3562
|
if ("" === t$2) return c$1;
|
|
4923
3563
|
if (null !== Qe.exec(t$2)) {
|
|
4924
|
-
const h$
|
|
3564
|
+
const h$2 = n$1 ? i$1.replace("*", () => t$2) : i$1 + t$2;
|
|
4925
3565
|
if (null === Ze.exec(t$2)) {
|
|
4926
|
-
if (!o$1) emitInvalidSegmentDeprecation
|
|
3566
|
+
if (!o$1) emitInvalidSegmentDeprecation(n$1 ? Be.call(et, e$2, () => t$2) : e$2, h$2, i$1, s$1, a$1, r$1, !1);
|
|
4927
3567
|
} else (function(e$3, t$3, i$2, s$2, r$2) {
|
|
4928
3568
|
throw new $e(e$3, `request is not a valid match in pattern "${t$3}" for the "${s$2 ? "imports" : "exports"}" resolution of ${(0, _e.fileURLToPath)(i$2)}`, r$2 && (0, _e.fileURLToPath)(r$2));
|
|
4929
|
-
})(h$
|
|
3569
|
+
})(h$2, i$1, s$1, a$1, r$1);
|
|
4930
3570
|
}
|
|
4931
3571
|
return n$1 ? new _e.URL(Be.call(et, c$1.href, () => t$2)) : new _e.URL(t$2, c$1);
|
|
4932
3572
|
}
|
|
4933
|
-
function isArrayIndex
|
|
3573
|
+
function isArrayIndex(e$2) {
|
|
4934
3574
|
const t$2 = Number(e$2);
|
|
4935
3575
|
return `${t$2}` === e$2 && t$2 >= 0 && t$2 < 4294967295;
|
|
4936
3576
|
}
|
|
4937
|
-
function resolvePackageTarget
|
|
4938
|
-
if ("string" == typeof t$2) return resolvePackageTargetString
|
|
3577
|
+
function resolvePackageTarget(e$2, t$2, i$1, s$1, r$1, n$1, a$1, o$1, h$1) {
|
|
3578
|
+
if ("string" == typeof t$2) return resolvePackageTargetString(t$2, i$1, s$1, e$2, r$1, n$1, a$1, o$1, h$1);
|
|
4939
3579
|
if (Array.isArray(t$2)) {
|
|
4940
3580
|
const c$1 = t$2;
|
|
4941
3581
|
if (0 === c$1.length) return null;
|
|
@@ -4944,7 +3584,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4944
3584
|
const t$3 = c$1[l$1];
|
|
4945
3585
|
let u$1;
|
|
4946
3586
|
try {
|
|
4947
|
-
u$1 = resolvePackageTarget
|
|
3587
|
+
u$1 = resolvePackageTarget(e$2, t$3, i$1, s$1, r$1, n$1, a$1, o$1, h$1);
|
|
4948
3588
|
} catch (e$3) {
|
|
4949
3589
|
if (p$1 = e$3, "ERR_INVALID_PACKAGE_TARGET" === e$3.code) continue;
|
|
4950
3590
|
throw e$3;
|
|
@@ -4960,11 +3600,11 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4960
3600
|
if ("object" == typeof t$2 && null !== t$2) {
|
|
4961
3601
|
const c$1 = Object.getOwnPropertyNames(t$2);
|
|
4962
3602
|
let p$1 = -1;
|
|
4963
|
-
for (; ++p$1 < c$1.length;) if (isArrayIndex
|
|
3603
|
+
for (; ++p$1 < c$1.length;) if (isArrayIndex(c$1[p$1])) throw new qe((0, _e.fileURLToPath)(e$2), r$1, "\"exports\" cannot contain numeric property keys.");
|
|
4964
3604
|
for (p$1 = -1; ++p$1 < c$1.length;) {
|
|
4965
3605
|
const l$1 = c$1[p$1];
|
|
4966
|
-
if ("default" === l$1 || h$
|
|
4967
|
-
const c$2 = resolvePackageTarget
|
|
3606
|
+
if ("default" === l$1 || h$1 && h$1.has(l$1)) {
|
|
3607
|
+
const c$2 = resolvePackageTarget(e$2, t$2[l$1], i$1, s$1, r$1, n$1, a$1, o$1, h$1);
|
|
4968
3608
|
if (void 0 === c$2) continue;
|
|
4969
3609
|
return c$2;
|
|
4970
3610
|
}
|
|
@@ -4972,14 +3612,14 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4972
3612
|
return null;
|
|
4973
3613
|
}
|
|
4974
3614
|
if (null === t$2) return null;
|
|
4975
|
-
throw invalidPackageTarget
|
|
3615
|
+
throw invalidPackageTarget(s$1, t$2, e$2, a$1, r$1);
|
|
4976
3616
|
}
|
|
4977
|
-
function emitTrailingSlashPatternDeprecation
|
|
3617
|
+
function emitTrailingSlashPatternDeprecation(e$2, t$2, i$1) {
|
|
4978
3618
|
if (be.noDeprecation) return;
|
|
4979
3619
|
const s$1 = (0, _e.fileURLToPath)(t$2);
|
|
4980
3620
|
it.has(s$1 + "|" + e$2) || (it.add(s$1 + "|" + e$2), be.emitWarning(`Use of deprecated trailing slash pattern mapping "${e$2}" in the "exports" field module resolution of the package at ${s$1}${i$1 ? ` imported from ${(0, _e.fileURLToPath)(i$1)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, "DeprecationWarning", "DEP0155"));
|
|
4981
3621
|
}
|
|
4982
|
-
function packageExportsResolve
|
|
3622
|
+
function packageExportsResolve(e$2, t$2, i$1, s$1, r$1) {
|
|
4983
3623
|
let n$1 = i$1.exports;
|
|
4984
3624
|
if (function(e$3, t$3, i$2) {
|
|
4985
3625
|
if ("string" == typeof e$3 || Array.isArray(e$3)) return !0;
|
|
@@ -4993,55 +3633,55 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4993
3633
|
}
|
|
4994
3634
|
return r$2;
|
|
4995
3635
|
}(n$1, e$2, s$1) && (n$1 = { ".": n$1 }), Ye.call(n$1, t$2) && !t$2.includes("*") && !t$2.endsWith("/")) {
|
|
4996
|
-
const i$2 = resolvePackageTarget
|
|
4997
|
-
if (null == i$2) throw exportsNotFound
|
|
3636
|
+
const i$2 = resolvePackageTarget(e$2, n$1[t$2], "", t$2, s$1, !1, !1, !1, r$1);
|
|
3637
|
+
if (null == i$2) throw exportsNotFound(t$2, e$2, s$1);
|
|
4998
3638
|
return i$2;
|
|
4999
3639
|
}
|
|
5000
3640
|
let a$1 = "", o$1 = "";
|
|
5001
|
-
const h$
|
|
3641
|
+
const h$1 = Object.getOwnPropertyNames(n$1);
|
|
5002
3642
|
let c$1 = -1;
|
|
5003
|
-
for (; ++c$1 < h$
|
|
5004
|
-
const i$2 = h$
|
|
3643
|
+
for (; ++c$1 < h$1.length;) {
|
|
3644
|
+
const i$2 = h$1[c$1], r$2 = i$2.indexOf("*");
|
|
5005
3645
|
if (-1 !== r$2 && t$2.startsWith(i$2.slice(0, r$2))) {
|
|
5006
|
-
t$2.endsWith("/") && emitTrailingSlashPatternDeprecation
|
|
3646
|
+
t$2.endsWith("/") && emitTrailingSlashPatternDeprecation(t$2, e$2, s$1);
|
|
5007
3647
|
const n$2 = i$2.slice(r$2 + 1);
|
|
5008
|
-
t$2.length >= i$2.length && t$2.endsWith(n$2) && 1 === patternKeyCompare
|
|
3648
|
+
t$2.length >= i$2.length && t$2.endsWith(n$2) && 1 === patternKeyCompare(a$1, i$2) && i$2.lastIndexOf("*") === r$2 && (a$1 = i$2, o$1 = t$2.slice(r$2, t$2.length - n$2.length));
|
|
5009
3649
|
}
|
|
5010
3650
|
}
|
|
5011
3651
|
if (a$1) {
|
|
5012
|
-
const i$2 = resolvePackageTarget
|
|
5013
|
-
if (null == i$2) throw exportsNotFound
|
|
3652
|
+
const i$2 = resolvePackageTarget(e$2, n$1[a$1], o$1, a$1, s$1, !0, !1, t$2.endsWith("/"), r$1);
|
|
3653
|
+
if (null == i$2) throw exportsNotFound(t$2, e$2, s$1);
|
|
5014
3654
|
return i$2;
|
|
5015
3655
|
}
|
|
5016
|
-
throw exportsNotFound
|
|
3656
|
+
throw exportsNotFound(t$2, e$2, s$1);
|
|
5017
3657
|
}
|
|
5018
|
-
function patternKeyCompare
|
|
3658
|
+
function patternKeyCompare(e$2, t$2) {
|
|
5019
3659
|
const i$1 = e$2.indexOf("*"), s$1 = t$2.indexOf("*"), r$1 = -1 === i$1 ? e$2.length : i$1 + 1, n$1 = -1 === s$1 ? t$2.length : s$1 + 1;
|
|
5020
3660
|
return r$1 > n$1 ? -1 : n$1 > r$1 || -1 === i$1 ? 1 : -1 === s$1 || e$2.length > t$2.length ? -1 : t$2.length > e$2.length ? 1 : 0;
|
|
5021
3661
|
}
|
|
5022
|
-
function packageImportsResolve
|
|
3662
|
+
function packageImportsResolve(e$2, t$2, i$1) {
|
|
5023
3663
|
if ("#" === e$2 || e$2.startsWith("#/") || e$2.endsWith("/")) throw new $e(e$2, "is not a valid internal imports specifier name", (0, _e.fileURLToPath)(t$2));
|
|
5024
3664
|
let s$1;
|
|
5025
|
-
const r$1 = getPackageScopeConfig
|
|
3665
|
+
const r$1 = getPackageScopeConfig(t$2);
|
|
5026
3666
|
if (r$1.exists) {
|
|
5027
3667
|
s$1 = (0, _e.pathToFileURL)(r$1.pjsonPath);
|
|
5028
3668
|
const n$1 = r$1.imports;
|
|
5029
3669
|
if (n$1) if (Ye.call(n$1, e$2) && !e$2.includes("*")) {
|
|
5030
|
-
const r$2 = resolvePackageTarget
|
|
3670
|
+
const r$2 = resolvePackageTarget(s$1, n$1[e$2], "", e$2, t$2, !1, !0, !1, i$1);
|
|
5031
3671
|
if (null != r$2) return r$2;
|
|
5032
3672
|
} else {
|
|
5033
3673
|
let r$2 = "", a$1 = "";
|
|
5034
3674
|
const o$1 = Object.getOwnPropertyNames(n$1);
|
|
5035
|
-
let h$
|
|
5036
|
-
for (; ++h$
|
|
5037
|
-
const t$3 = o$1[h$
|
|
3675
|
+
let h$1 = -1;
|
|
3676
|
+
for (; ++h$1 < o$1.length;) {
|
|
3677
|
+
const t$3 = o$1[h$1], i$2 = t$3.indexOf("*");
|
|
5038
3678
|
if (-1 !== i$2 && e$2.startsWith(t$3.slice(0, -1))) {
|
|
5039
3679
|
const s$2 = t$3.slice(i$2 + 1);
|
|
5040
|
-
e$2.length >= t$3.length && e$2.endsWith(s$2) && 1 === patternKeyCompare
|
|
3680
|
+
e$2.length >= t$3.length && e$2.endsWith(s$2) && 1 === patternKeyCompare(r$2, t$3) && t$3.lastIndexOf("*") === i$2 && (r$2 = t$3, a$1 = e$2.slice(i$2, e$2.length - s$2.length));
|
|
5041
3681
|
}
|
|
5042
3682
|
}
|
|
5043
3683
|
if (r$2) {
|
|
5044
|
-
const e$3 = resolvePackageTarget
|
|
3684
|
+
const e$3 = resolvePackageTarget(s$1, n$1[r$2], a$1, r$2, t$2, !0, !0, !1, i$1);
|
|
5045
3685
|
if (null != e$3) return e$3;
|
|
5046
3686
|
}
|
|
5047
3687
|
}
|
|
@@ -5050,7 +3690,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5050
3690
|
return new He(e$3, t$3 && (0, _e.fileURLToPath)(new _e.URL(".", t$3)), (0, _e.fileURLToPath)(i$2));
|
|
5051
3691
|
}(e$2, s$1, t$2);
|
|
5052
3692
|
}
|
|
5053
|
-
function packageResolve
|
|
3693
|
+
function packageResolve(e$2, t$2, i$1) {
|
|
5054
3694
|
if (le.builtinModules.includes(e$2)) return new _e.URL("node:" + e$2);
|
|
5055
3695
|
const { packageName: s$1, packageSubpath: r$1, isScoped: n$1 } = function(e$3, t$3) {
|
|
5056
3696
|
let i$2 = e$3.indexOf("/"), s$2 = !0, r$2 = !1;
|
|
@@ -5062,27 +3702,27 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5062
3702
|
packageSubpath: "." + (-1 === i$2 ? "" : e$3.slice(i$2)),
|
|
5063
3703
|
isScoped: r$2
|
|
5064
3704
|
};
|
|
5065
|
-
}(e$2, t$2), a$1 = getPackageScopeConfig
|
|
3705
|
+
}(e$2, t$2), a$1 = getPackageScopeConfig(t$2);
|
|
5066
3706
|
if (a$1.exists) {
|
|
5067
3707
|
const e$3 = (0, _e.pathToFileURL)(a$1.pjsonPath);
|
|
5068
|
-
if (a$1.name === s$1 && void 0 !== a$1.exports && null !== a$1.exports) return packageExportsResolve
|
|
3708
|
+
if (a$1.name === s$1 && void 0 !== a$1.exports && null !== a$1.exports) return packageExportsResolve(e$3, r$1, a$1, t$2, i$1);
|
|
5069
3709
|
}
|
|
5070
|
-
let o$1, h$
|
|
3710
|
+
let o$1, h$1 = new _e.URL("./node_modules/" + s$1 + "/package.json", t$2), c$1 = (0, _e.fileURLToPath)(h$1);
|
|
5071
3711
|
do {
|
|
5072
|
-
const a$2 = tryStatSync
|
|
3712
|
+
const a$2 = tryStatSync(c$1.slice(0, -13));
|
|
5073
3713
|
if (!a$2 || !a$2.isDirectory()) {
|
|
5074
|
-
o$1 = c$1, h$
|
|
3714
|
+
o$1 = c$1, h$1 = new _e.URL((n$1 ? "../../../../node_modules/" : "../../../node_modules/") + s$1 + "/package.json", h$1), c$1 = (0, _e.fileURLToPath)(h$1);
|
|
5075
3715
|
continue;
|
|
5076
3716
|
}
|
|
5077
|
-
const p$1 = read
|
|
3717
|
+
const p$1 = read(c$1, {
|
|
5078
3718
|
base: t$2,
|
|
5079
3719
|
specifier: e$2
|
|
5080
3720
|
});
|
|
5081
|
-
return void 0 !== p$1.exports && null !== p$1.exports ? packageExportsResolve
|
|
3721
|
+
return void 0 !== p$1.exports && null !== p$1.exports ? packageExportsResolve(h$1, r$1, p$1, t$2, i$1) : "." === r$1 ? legacyMainResolve(h$1, p$1, t$2) : new _e.URL(r$1, h$1);
|
|
5082
3722
|
} while (c$1.length !== o$1.length);
|
|
5083
3723
|
throw new Ge(s$1, (0, _e.fileURLToPath)(t$2), !1);
|
|
5084
3724
|
}
|
|
5085
|
-
function moduleResolve
|
|
3725
|
+
function moduleResolve(e$2, t$2, i$1, s$1) {
|
|
5086
3726
|
const r$1 = t$2.protocol, n$1 = "data:" === r$1 || "http:" === r$1 || "https:" === r$1;
|
|
5087
3727
|
let a$1;
|
|
5088
3728
|
if (function(e$3) {
|
|
@@ -5099,7 +3739,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5099
3739
|
const s$2 = new Je(e$2, t$2);
|
|
5100
3740
|
throw s$2.cause = i$2, s$2;
|
|
5101
3741
|
}
|
|
5102
|
-
else if ("file:" === r$1 && "#" === e$2[0]) a$1 = packageImportsResolve
|
|
3742
|
+
else if ("file:" === r$1 && "#" === e$2[0]) a$1 = packageImportsResolve(e$2, t$2, i$1);
|
|
5103
3743
|
else try {
|
|
5104
3744
|
a$1 = new _e.URL(e$2);
|
|
5105
3745
|
} catch (s$2) {
|
|
@@ -5107,7 +3747,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5107
3747
|
const i$2 = new Je(e$2, t$2);
|
|
5108
3748
|
throw i$2.cause = s$2, i$2;
|
|
5109
3749
|
}
|
|
5110
|
-
a$1 = packageResolve
|
|
3750
|
+
a$1 = packageResolve(e$2, t$2, i$1);
|
|
5111
3751
|
}
|
|
5112
3752
|
return Ee(void 0 !== a$1, "expected to be defined"), "file:" !== a$1.protocol ? a$1 : function(e$3, t$3) {
|
|
5113
3753
|
if (null !== tt.exec(e$3.pathname)) throw new $e(e$3.pathname, "must not include encoded \"/\" or \"\\\" characters", (0, _e.fileURLToPath)(t$3));
|
|
@@ -5118,7 +3758,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5118
3758
|
const s$3 = i$3;
|
|
5119
3759
|
throw Object.defineProperty(s$3, "input", { value: String(e$3) }), Object.defineProperty(s$3, "module", { value: String(t$3) }), s$3;
|
|
5120
3760
|
}
|
|
5121
|
-
const s$2 = tryStatSync
|
|
3761
|
+
const s$2 = tryStatSync(i$2.endsWith("/") ? i$2.slice(-1) : i$2);
|
|
5122
3762
|
if (s$2 && s$2.isDirectory()) {
|
|
5123
3763
|
const s$3 = new ze(i$2, (0, _e.fileURLToPath)(t$3));
|
|
5124
3764
|
throw s$3.url = String(e$3), s$3;
|
|
@@ -5134,11 +3774,11 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5134
3774
|
return e$3;
|
|
5135
3775
|
}(a$1, t$2);
|
|
5136
3776
|
}
|
|
5137
|
-
function fileURLToPath
|
|
3777
|
+
function fileURLToPath(e$2) {
|
|
5138
3778
|
return "string" != typeof e$2 || e$2.startsWith("file://") ? normalizeSlash((0, _e.fileURLToPath)(e$2)) : normalizeSlash(e$2);
|
|
5139
3779
|
}
|
|
5140
|
-
function pathToFileURL
|
|
5141
|
-
return (0, _e.pathToFileURL)(fileURLToPath
|
|
3780
|
+
function pathToFileURL(e$2) {
|
|
3781
|
+
return (0, _e.pathToFileURL)(fileURLToPath(e$2)).toString();
|
|
5142
3782
|
}
|
|
5143
3783
|
const rt = new Set(["node", "import"]), nt = [
|
|
5144
3784
|
".mjs",
|
|
@@ -5151,9 +3791,9 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5151
3791
|
"MODULE_NOT_FOUND",
|
|
5152
3792
|
"ERR_PACKAGE_PATH_NOT_EXPORTED"
|
|
5153
3793
|
]);
|
|
5154
|
-
function _tryModuleResolve
|
|
3794
|
+
function _tryModuleResolve(e$2, t$2, i$1) {
|
|
5155
3795
|
try {
|
|
5156
|
-
return moduleResolve
|
|
3796
|
+
return moduleResolve(e$2, t$2, i$1);
|
|
5157
3797
|
} catch (e$3) {
|
|
5158
3798
|
if (!at.has(e$3?.code)) throw e$3;
|
|
5159
3799
|
}
|
|
@@ -5161,26 +3801,26 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5161
3801
|
function _resolve(e$2, t$2 = {}) {
|
|
5162
3802
|
if ("string" != typeof e$2) {
|
|
5163
3803
|
if (!(e$2 instanceof URL)) throw new TypeError("input must be a `string` or `URL`");
|
|
5164
|
-
e$2 = fileURLToPath
|
|
3804
|
+
e$2 = fileURLToPath(e$2);
|
|
5165
3805
|
}
|
|
5166
3806
|
if (/(?:node|data|http|https):/.test(e$2)) return e$2;
|
|
5167
3807
|
if (Ie.has(e$2)) return "node:" + e$2;
|
|
5168
|
-
if (e$2.startsWith("file://") && (e$2 = fileURLToPath
|
|
5169
|
-
if ((0, ue.statSync)(e$2).isFile()) return pathToFileURL
|
|
3808
|
+
if (e$2.startsWith("file://") && (e$2 = fileURLToPath(e$2)), isAbsolute(e$2)) try {
|
|
3809
|
+
if ((0, ue.statSync)(e$2).isFile()) return pathToFileURL(e$2);
|
|
5170
3810
|
} catch (e$3) {
|
|
5171
3811
|
if ("ENOENT" !== e$3?.code) throw e$3;
|
|
5172
3812
|
}
|
|
5173
3813
|
const i$1 = t$2.conditions ? new Set(t$2.conditions) : rt, s$1 = (Array.isArray(t$2.url) ? t$2.url : [t$2.url]).filter(Boolean).map((e$3) => new URL(function(e$4) {
|
|
5174
3814
|
return "string" != typeof e$4 && (e$4 = e$4.toString()), /(?:node|data|http|https|file):/.test(e$4) ? e$4 : Ie.has(e$4) ? "node:" + e$4 : "file://" + encodeURI(normalizeSlash(e$4));
|
|
5175
3815
|
}(e$3.toString())));
|
|
5176
|
-
0 === s$1.length && s$1.push(new URL(pathToFileURL
|
|
3816
|
+
0 === s$1.length && s$1.push(new URL(pathToFileURL(process.cwd())));
|
|
5177
3817
|
const r$1 = [...s$1];
|
|
5178
3818
|
for (const e$3 of s$1) "file:" === e$3.protocol && r$1.push(new URL("./", e$3), new URL(dist_joinURL(e$3.pathname, "_index.js"), e$3), new URL("node_modules", e$3));
|
|
5179
3819
|
let n$1;
|
|
5180
3820
|
for (const s$2 of r$1) {
|
|
5181
|
-
if (n$1 = _tryModuleResolve
|
|
3821
|
+
if (n$1 = _tryModuleResolve(e$2, s$2, i$1), n$1) break;
|
|
5182
3822
|
for (const r$2 of ["", "/index"]) {
|
|
5183
|
-
for (const a$1 of t$2.extensions || nt) if (n$1 = _tryModuleResolve
|
|
3823
|
+
for (const a$1 of t$2.extensions || nt) if (n$1 = _tryModuleResolve(dist_joinURL(e$2, r$2) + a$1, s$2, i$1), n$1) break;
|
|
5184
3824
|
if (n$1) break;
|
|
5185
3825
|
}
|
|
5186
3826
|
if (n$1) break;
|
|
@@ -5189,13 +3829,13 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5189
3829
|
const t$3 = /* @__PURE__ */ new Error(`Cannot find module ${e$2} imported from ${r$1.join(", ")}`);
|
|
5190
3830
|
throw t$3.code = "ERR_MODULE_NOT_FOUND", t$3;
|
|
5191
3831
|
}
|
|
5192
|
-
return pathToFileURL
|
|
3832
|
+
return pathToFileURL(n$1);
|
|
5193
3833
|
}
|
|
5194
3834
|
function resolveSync(e$2, t$2) {
|
|
5195
3835
|
return _resolve(e$2, t$2);
|
|
5196
3836
|
}
|
|
5197
3837
|
function resolvePathSync(e$2, t$2) {
|
|
5198
|
-
return fileURLToPath
|
|
3838
|
+
return fileURLToPath(resolveSync(e$2, t$2));
|
|
5199
3839
|
}
|
|
5200
3840
|
const ot = /(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m, ht = /\/\*.+?\*\/|\/\/.*(?=[nr])/g;
|
|
5201
3841
|
function hasESMSyntax(e$2, t$2 = {}) {
|
|
@@ -5381,8 +4021,8 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5381
4021
|
let n$1 = r$1.indexOf(s$1);
|
|
5382
4022
|
if (-1 === n$1) return i$1 + r$1 + s$1;
|
|
5383
4023
|
let a$1 = i$1, o$1 = 0;
|
|
5384
|
-
const h$
|
|
5385
|
-
for (; -1 !== n$1;) a$1 += r$1.slice(o$1, n$1) + h$
|
|
4024
|
+
const h$1 = (22 === t$2 ? s$1 : "") + i$1;
|
|
4025
|
+
for (; -1 !== n$1;) a$1 += r$1.slice(o$1, n$1) + h$1, o$1 = n$1 + s$1.length, n$1 = r$1.indexOf(s$1, o$1);
|
|
5386
4026
|
return a$1 += r$1.slice(o$1) + s$1, a$1;
|
|
5387
4027
|
};
|
|
5388
4028
|
}, Dt = (base_format(0, 0), base_format(1, 22), base_format(2, 22), base_format(3, 23), base_format(4, 24), base_format(53, 55), base_format(7, 27), base_format(8, 28), base_format(9, 29), base_format(30, 39), base_format(31, 39)), Vt = base_format(32, 39), Ut = base_format(33, 39), Mt = base_format(34, 39), jt = (base_format(35, 39), base_format(36, 39)), Ft = (base_format(37, 39), base_format(90, 39));
|
|
@@ -5512,7 +4152,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5512
4152
|
try {
|
|
5513
4153
|
return e$2.nativeRequire.resolve(t$2, {
|
|
5514
4154
|
...s$1,
|
|
5515
|
-
paths: [pathe_M_eThtNZ_dirname(fileURLToPath
|
|
4155
|
+
paths: [pathe_M_eThtNZ_dirname(fileURLToPath(i$1)), ...s$1?.paths || []]
|
|
5516
4156
|
});
|
|
5517
4157
|
} catch {}
|
|
5518
4158
|
}
|
|
@@ -5539,7 +4179,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5539
4179
|
}
|
|
5540
4180
|
const r$1 = jitiResolve(e$2, t$2, i$1);
|
|
5541
4181
|
if (!r$1 && i$1.try) return;
|
|
5542
|
-
const n$1 = extname
|
|
4182
|
+
const n$1 = extname(r$1);
|
|
5543
4183
|
if (".json" === n$1) {
|
|
5544
4184
|
debug(e$2, "[json]", r$1);
|
|
5545
4185
|
const t$3 = e$2.nativeRequire(r$1);
|
|
@@ -5565,14 +4205,14 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5565
4205
|
}
|
|
5566
4206
|
function nativeImportOrRequire(e$2, t$2, i$1) {
|
|
5567
4207
|
return i$1 && e$2.nativeImport ? e$2.nativeImport(function(e$3) {
|
|
5568
|
-
return kt && isAbsolute
|
|
4208
|
+
return kt && isAbsolute(e$3) ? pathToFileURL(e$3) : e$3;
|
|
5569
4209
|
}(t$2)).then((t$3) => jitiInteropDefault(e$2, t$3)) : jitiInteropDefault(e$2, e$2.nativeRequire(t$2));
|
|
5570
4210
|
}
|
|
5571
4211
|
const zt = "9";
|
|
5572
4212
|
function getCache(e$2, t$2, i$1) {
|
|
5573
4213
|
if (!e$2.opts.fsCache || !t$2.filename) return i$1();
|
|
5574
4214
|
const s$1 = ` /* v${zt}-${utils_hash(t$2.source, 16)} */\n`;
|
|
5575
|
-
let r$1 = `${basename
|
|
4215
|
+
let r$1 = `${basename(pathe_M_eThtNZ_dirname(t$2.filename))}-${function(e$3) {
|
|
5576
4216
|
const t$3 = e$3.split(lt).pop();
|
|
5577
4217
|
if (!t$3) return;
|
|
5578
4218
|
const i$2 = t$3.lastIndexOf(".");
|
|
@@ -5629,7 +4269,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5629
4269
|
return i$1.startsWith("#!") && (i$1 = "// " + i$1), i$1;
|
|
5630
4270
|
}
|
|
5631
4271
|
function eval_evalModule(e$2, t$2, i$1 = {}) {
|
|
5632
|
-
const s$1 = i$1.id || (i$1.filename ? basename
|
|
4272
|
+
const s$1 = i$1.id || (i$1.filename ? basename(i$1.filename) : `_jitiEval.${i$1.ext || (i$1.async ? "mjs" : "js")}`), r$1 = i$1.filename || jitiResolve(e$2, s$1, { async: i$1.async }), n$1 = i$1.ext || extname(r$1), a$1 = i$1.cache || e$2.parentCache || {}, o$1 = /\.[cm]?tsx?$/.test(n$1), h$1 = ".mjs" === n$1 || ".js" === n$1 && "module" === function(e$3) {
|
|
5633
4273
|
for (; e$3 && "." !== e$3 && "/" !== e$3;) {
|
|
5634
4274
|
e$3 = pathe_M_eThtNZ_join(e$3, "..");
|
|
5635
4275
|
try {
|
|
@@ -5640,7 +4280,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5640
4280
|
break;
|
|
5641
4281
|
} catch {}
|
|
5642
4282
|
}
|
|
5643
|
-
}(r$1)?.type, c$1 = ".cjs" === n$1, p$1 = i$1.forceTranspile ?? (!c$1 && !(h$
|
|
4283
|
+
}(r$1)?.type, c$1 = ".cjs" === n$1, p$1 = i$1.forceTranspile ?? (!c$1 && !(h$1 && i$1.async) && (o$1 || h$1 || e$2.isTransformRe.test(r$1) || hasESMSyntax(t$2))), l$1 = Gt.performance.now();
|
|
5644
4284
|
if (p$1) {
|
|
5645
4285
|
t$2 = transform(e$2, {
|
|
5646
4286
|
filename: r$1,
|
|
@@ -5670,7 +4310,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5670
4310
|
}
|
|
5671
4311
|
const u$1 = new le.Module(r$1);
|
|
5672
4312
|
u$1.filename = r$1, e$2.parentModule && (u$1.parent = e$2.parentModule, Array.isArray(e$2.parentModule.children) && !e$2.parentModule.children.includes(u$1) && e$2.parentModule.children.push(u$1));
|
|
5673
|
-
const d$
|
|
4313
|
+
const d$1 = createJiti(r$1, e$2.opts, {
|
|
5674
4314
|
parentModule: u$1,
|
|
5675
4315
|
parentCache: a$1,
|
|
5676
4316
|
nativeImport: e$2.nativeImport,
|
|
@@ -5678,7 +4318,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5678
4318
|
createRequire: e$2.createRequire
|
|
5679
4319
|
}, !0);
|
|
5680
4320
|
let f$1;
|
|
5681
|
-
u$1.require = d$
|
|
4321
|
+
u$1.require = d$1, u$1.path = pathe_M_eThtNZ_dirname(r$1), u$1.paths = le.Module._nodeModulePaths(u$1.path), a$1[r$1] = u$1, e$2.opts.moduleCache && (e$2.nativeRequire.cache[r$1] = u$1);
|
|
5682
4322
|
const m$1 = function(e$3, t$3) {
|
|
5683
4323
|
return `(${t$3?.async ? "async " : ""}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e$3}\n});`;
|
|
5684
4324
|
}(t$2, { async: i$1.async });
|
|
@@ -5696,7 +4336,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5696
4336
|
}
|
|
5697
4337
|
let g$1;
|
|
5698
4338
|
try {
|
|
5699
|
-
g$1 = f$1(u$1.exports, u$1.require, u$1, u$1.filename, pathe_M_eThtNZ_dirname(u$1.filename), d$
|
|
4339
|
+
g$1 = f$1(u$1.exports, u$1.require, u$1, u$1.filename, pathe_M_eThtNZ_dirname(u$1.filename), d$1.import, d$1.esmResolve);
|
|
5700
4340
|
} catch (t$3) {
|
|
5701
4341
|
e$2.opts.moduleCache && delete e$2.nativeRequire.cache[r$1], e$2.onError(t$3);
|
|
5702
4342
|
}
|
|
@@ -5711,7 +4351,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5711
4351
|
return i$1.async ? Promise.resolve(g$1).then(next) : next();
|
|
5712
4352
|
}
|
|
5713
4353
|
const Jt = "win32" === (0, e$1.platform)();
|
|
5714
|
-
function createJiti
|
|
4354
|
+
function createJiti(e$2, t$2 = {}, i$1, s$1 = !1) {
|
|
5715
4355
|
const r$1 = s$1 ? t$2 : function(e$3) {
|
|
5716
4356
|
const t$3 = {
|
|
5717
4357
|
fsCache: _booleanEnv("JITI_FS_CACHE", _booleanEnv("JITI_CACHE", !0)),
|
|
@@ -5748,15 +4388,15 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5748
4388
|
"typescript",
|
|
5749
4389
|
"jiti",
|
|
5750
4390
|
...r$1.nativeModules || []
|
|
5751
|
-
], o$1 = /* @__PURE__ */ new RegExp(`node_modules/(${a$1.map((e$3) => escapeStringRegexp(e$3)).join("|")})/`), h$
|
|
4391
|
+
], o$1 = /* @__PURE__ */ new RegExp(`node_modules/(${a$1.map((e$3) => escapeStringRegexp(e$3)).join("|")})/`), h$1 = [...r$1.transformModules || []], c$1 = /* @__PURE__ */ new RegExp(`node_modules/(${h$1.map((e$3) => escapeStringRegexp(e$3)).join("|")})/`);
|
|
5752
4392
|
e$2 || (e$2 = process.cwd()), !s$1 && isDir(e$2) && (e$2 = pathe_M_eThtNZ_join(e$2, "_index.js"));
|
|
5753
|
-
const p$1 = pathToFileURL
|
|
4393
|
+
const p$1 = pathToFileURL(e$2), l$1 = [...r$1.extensions].filter((e$3) => ".js" !== e$3), u$1 = i$1.createRequire(Jt ? e$2.replace(/\//g, "\\") : e$2), d$1 = {
|
|
5754
4394
|
filename: e$2,
|
|
5755
4395
|
url: p$1,
|
|
5756
4396
|
opts: r$1,
|
|
5757
4397
|
alias: n$1,
|
|
5758
4398
|
nativeModules: a$1,
|
|
5759
|
-
transformModules: h$
|
|
4399
|
+
transformModules: h$1,
|
|
5760
4400
|
isNativeRe: o$1,
|
|
5761
4401
|
isTransformRe: c$1,
|
|
5762
4402
|
additionalExts: l$1,
|
|
@@ -5767,27 +4407,27 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5767
4407
|
nativeImport: i$1.nativeImport,
|
|
5768
4408
|
createRequire: i$1.createRequire
|
|
5769
4409
|
};
|
|
5770
|
-
s$1 || debug(d$
|
|
4410
|
+
s$1 || debug(d$1, "[init]", ...[
|
|
5771
4411
|
["version:", ut.rE],
|
|
5772
4412
|
["module-cache:", r$1.moduleCache],
|
|
5773
4413
|
["fs-cache:", r$1.fsCache],
|
|
5774
4414
|
["rebuild-fs-cache:", r$1.rebuildFsCache],
|
|
5775
4415
|
["interop-defaults:", r$1.interopDefault]
|
|
5776
|
-
].flat()), s$1 || prepareCacheDir(d$
|
|
4416
|
+
].flat()), s$1 || prepareCacheDir(d$1);
|
|
5777
4417
|
return Object.assign(function(e$3) {
|
|
5778
|
-
return jitiRequire(d$
|
|
4418
|
+
return jitiRequire(d$1, e$3, { async: !1 });
|
|
5779
4419
|
}, {
|
|
5780
4420
|
cache: r$1.moduleCache ? u$1.cache : Object.create(null),
|
|
5781
4421
|
extensions: u$1.extensions,
|
|
5782
4422
|
main: u$1.main,
|
|
5783
4423
|
options: r$1,
|
|
5784
4424
|
resolve: Object.assign(function(e$3) {
|
|
5785
|
-
return jitiResolve(d$
|
|
4425
|
+
return jitiResolve(d$1, e$3, { async: !1 });
|
|
5786
4426
|
}, { paths: u$1.resolve.paths }),
|
|
5787
|
-
transform: (e$3) => transform(d$
|
|
5788
|
-
evalModule: (e$3, t$3) => eval_evalModule(d$
|
|
4427
|
+
transform: (e$3) => transform(d$1, e$3),
|
|
4428
|
+
evalModule: (e$3, t$3) => eval_evalModule(d$1, e$3, t$3),
|
|
5789
4429
|
async import(e$3, t$3) {
|
|
5790
|
-
const i$2 = await jitiRequire(d$
|
|
4430
|
+
const i$2 = await jitiRequire(d$1, e$3, {
|
|
5791
4431
|
...t$3,
|
|
5792
4432
|
async: !0
|
|
5793
4433
|
});
|
|
@@ -5795,12 +4435,12 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5795
4435
|
},
|
|
5796
4436
|
esmResolve(e$3, t$3) {
|
|
5797
4437
|
"string" == typeof t$3 && (t$3 = { parentURL: t$3 });
|
|
5798
|
-
const i$2 = jitiResolve(d$
|
|
4438
|
+
const i$2 = jitiResolve(d$1, e$3, {
|
|
5799
4439
|
parentURL: p$1,
|
|
5800
4440
|
...t$3,
|
|
5801
4441
|
async: !0
|
|
5802
4442
|
});
|
|
5803
|
-
return !i$2 || "string" != typeof i$2 || i$2.startsWith("file://") ? i$2 : pathToFileURL
|
|
4443
|
+
return !i$2 || "string" != typeof i$2 || i$2.startsWith("file://") ? i$2 : pathToFileURL(i$2);
|
|
5804
4444
|
}
|
|
5805
4445
|
});
|
|
5806
4446
|
}
|
|
@@ -5809,771 +4449,7 @@ var require_jiti = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5809
4449
|
}));
|
|
5810
4450
|
|
|
5811
4451
|
//#endregion
|
|
5812
|
-
|
|
5813
|
-
var import_jiti = /* @__PURE__ */ __toESM(require_jiti(), 1);
|
|
5814
|
-
function onError(err) {
|
|
5815
|
-
throw err;
|
|
5816
|
-
}
|
|
5817
|
-
const nativeImport = (id) => import(id);
|
|
5818
|
-
let _transform;
|
|
5819
|
-
function lazyTransform(...args) {
|
|
5820
|
-
if (!_transform) _transform = createRequire(import.meta.url)("../dist/babel.cjs");
|
|
5821
|
-
return _transform(...args);
|
|
5822
|
-
}
|
|
5823
|
-
function createJiti(id, opts = {}) {
|
|
5824
|
-
if (!opts.transform) opts = {
|
|
5825
|
-
...opts,
|
|
5826
|
-
transform: lazyTransform
|
|
5827
|
-
};
|
|
5828
|
-
return (0, import_jiti.default)(id, opts, {
|
|
5829
|
-
onError,
|
|
5830
|
-
nativeImport,
|
|
5831
|
-
createRequire
|
|
5832
|
-
});
|
|
5833
|
-
}
|
|
5834
|
-
|
|
5835
|
-
//#endregion
|
|
5836
|
-
//#region ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
|
|
5837
|
-
const suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
|
|
5838
|
-
const suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
5839
|
-
const JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
|
|
5840
|
-
function jsonParseTransform(key, value) {
|
|
5841
|
-
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
|
|
5842
|
-
warnKeyDropped(key);
|
|
5843
|
-
return;
|
|
5844
|
-
}
|
|
5845
|
-
return value;
|
|
5846
|
-
}
|
|
5847
|
-
function warnKeyDropped(key) {
|
|
5848
|
-
console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`);
|
|
5849
|
-
}
|
|
5850
|
-
function destr(value, options = {}) {
|
|
5851
|
-
if (typeof value !== "string") return value;
|
|
5852
|
-
if (value[0] === "\"" && value[value.length - 1] === "\"" && value.indexOf("\\") === -1) return value.slice(1, -1);
|
|
5853
|
-
const _value = value.trim();
|
|
5854
|
-
if (_value.length <= 9) switch (_value.toLowerCase()) {
|
|
5855
|
-
case "true": return true;
|
|
5856
|
-
case "false": return false;
|
|
5857
|
-
case "undefined": return;
|
|
5858
|
-
case "null": return null;
|
|
5859
|
-
case "nan": return NaN;
|
|
5860
|
-
case "infinity": return Number.POSITIVE_INFINITY;
|
|
5861
|
-
case "-infinity": return Number.NEGATIVE_INFINITY;
|
|
5862
|
-
}
|
|
5863
|
-
if (!JsonSigRx.test(value)) {
|
|
5864
|
-
if (options.strict) throw new SyntaxError("[destr] Invalid JSON");
|
|
5865
|
-
return value;
|
|
5866
|
-
}
|
|
5867
|
-
try {
|
|
5868
|
-
if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
|
|
5869
|
-
if (options.strict) throw new Error("[destr] Possible prototype pollution");
|
|
5870
|
-
return JSON.parse(value, jsonParseTransform);
|
|
5871
|
-
}
|
|
5872
|
-
return JSON.parse(value);
|
|
5873
|
-
} catch (error) {
|
|
5874
|
-
if (options.strict) throw error;
|
|
5875
|
-
return value;
|
|
5876
|
-
}
|
|
5877
|
-
}
|
|
4452
|
+
export default require_jiti();
|
|
5878
4453
|
|
|
5879
|
-
|
|
5880
|
-
//#
|
|
5881
|
-
function isBuffer(obj) {
|
|
5882
|
-
return obj && obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
|
|
5883
|
-
}
|
|
5884
|
-
function keyIdentity(key) {
|
|
5885
|
-
return key;
|
|
5886
|
-
}
|
|
5887
|
-
function flatten(target, opts) {
|
|
5888
|
-
opts = opts || {};
|
|
5889
|
-
const delimiter$1 = opts.delimiter || ".";
|
|
5890
|
-
const maxDepth = opts.maxDepth;
|
|
5891
|
-
const transformKey = opts.transformKey || keyIdentity;
|
|
5892
|
-
const output = {};
|
|
5893
|
-
function step(object, prev, currentDepth) {
|
|
5894
|
-
currentDepth = currentDepth || 1;
|
|
5895
|
-
Object.keys(object).forEach(function(key) {
|
|
5896
|
-
const value = object[key];
|
|
5897
|
-
const isarray = opts.safe && Array.isArray(value);
|
|
5898
|
-
const type = Object.prototype.toString.call(value);
|
|
5899
|
-
const isbuffer = isBuffer(value);
|
|
5900
|
-
const isobject = type === "[object Object]" || type === "[object Array]";
|
|
5901
|
-
const newKey = prev ? prev + delimiter$1 + transformKey(key) : transformKey(key);
|
|
5902
|
-
if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) return step(value, newKey, currentDepth + 1);
|
|
5903
|
-
output[newKey] = value;
|
|
5904
|
-
});
|
|
5905
|
-
}
|
|
5906
|
-
step(target);
|
|
5907
|
-
return output;
|
|
5908
|
-
}
|
|
5909
|
-
function unflatten(target, opts) {
|
|
5910
|
-
opts = opts || {};
|
|
5911
|
-
const delimiter$1 = opts.delimiter || ".";
|
|
5912
|
-
const overwrite = opts.overwrite || false;
|
|
5913
|
-
const transformKey = opts.transformKey || keyIdentity;
|
|
5914
|
-
const result = {};
|
|
5915
|
-
if (isBuffer(target) || Object.prototype.toString.call(target) !== "[object Object]") return target;
|
|
5916
|
-
function getkey(key) {
|
|
5917
|
-
const parsedKey = Number(key);
|
|
5918
|
-
return isNaN(parsedKey) || key.indexOf(".") !== -1 || opts.object ? key : parsedKey;
|
|
5919
|
-
}
|
|
5920
|
-
function addKeys(keyPrefix, recipient, target$1) {
|
|
5921
|
-
return Object.keys(target$1).reduce(function(result$1, key) {
|
|
5922
|
-
result$1[keyPrefix + delimiter$1 + key] = target$1[key];
|
|
5923
|
-
return result$1;
|
|
5924
|
-
}, recipient);
|
|
5925
|
-
}
|
|
5926
|
-
function isEmpty(val) {
|
|
5927
|
-
const type = Object.prototype.toString.call(val);
|
|
5928
|
-
const isArray = type === "[object Array]";
|
|
5929
|
-
const isObject = type === "[object Object]";
|
|
5930
|
-
if (!val) return true;
|
|
5931
|
-
else if (isArray) return !val.length;
|
|
5932
|
-
else if (isObject) return !Object.keys(val).length;
|
|
5933
|
-
}
|
|
5934
|
-
target = Object.keys(target).reduce(function(result$1, key) {
|
|
5935
|
-
const type = Object.prototype.toString.call(target[key]);
|
|
5936
|
-
if (!(type === "[object Object]" || type === "[object Array]") || isEmpty(target[key])) {
|
|
5937
|
-
result$1[key] = target[key];
|
|
5938
|
-
return result$1;
|
|
5939
|
-
} else return addKeys(key, result$1, flatten(target[key], opts));
|
|
5940
|
-
}, {});
|
|
5941
|
-
Object.keys(target).forEach(function(key) {
|
|
5942
|
-
const split = key.split(delimiter$1).map(transformKey);
|
|
5943
|
-
let key1 = getkey(split.shift());
|
|
5944
|
-
let key2 = getkey(split[0]);
|
|
5945
|
-
let recipient = result;
|
|
5946
|
-
while (key2 !== void 0) {
|
|
5947
|
-
if (key1 === "__proto__") return;
|
|
5948
|
-
const type = Object.prototype.toString.call(recipient[key1]);
|
|
5949
|
-
const isobject = type === "[object Object]" || type === "[object Array]";
|
|
5950
|
-
if (!overwrite && !isobject && typeof recipient[key1] !== "undefined") return;
|
|
5951
|
-
if (overwrite && !isobject || !overwrite && recipient[key1] == null) recipient[key1] = typeof key2 === "number" && !opts.object ? [] : {};
|
|
5952
|
-
recipient = recipient[key1];
|
|
5953
|
-
if (split.length > 0) {
|
|
5954
|
-
key1 = getkey(split.shift());
|
|
5955
|
-
key2 = getkey(split[0]);
|
|
5956
|
-
}
|
|
5957
|
-
}
|
|
5958
|
-
recipient[key1] = unflatten(target[key], opts);
|
|
5959
|
-
});
|
|
5960
|
-
return result;
|
|
5961
|
-
}
|
|
5962
|
-
const RE_KEY_VAL = /^\s*([^\s=]+)\s*=\s*(.*)?\s*$/;
|
|
5963
|
-
const RE_LINES = /\n|\r|\r\n/;
|
|
5964
|
-
const defaults = {
|
|
5965
|
-
name: ".conf",
|
|
5966
|
-
dir: process.cwd(),
|
|
5967
|
-
flat: false
|
|
5968
|
-
};
|
|
5969
|
-
function withDefaults(options) {
|
|
5970
|
-
if (typeof options === "string") options = { name: options };
|
|
5971
|
-
return {
|
|
5972
|
-
...defaults,
|
|
5973
|
-
...options
|
|
5974
|
-
};
|
|
5975
|
-
}
|
|
5976
|
-
function parse(contents, options = {}) {
|
|
5977
|
-
const config$1 = {};
|
|
5978
|
-
const lines = contents.split(RE_LINES);
|
|
5979
|
-
for (const line of lines) {
|
|
5980
|
-
const match = line.match(RE_KEY_VAL);
|
|
5981
|
-
if (!match) continue;
|
|
5982
|
-
const key = match[1];
|
|
5983
|
-
if (!key || key === "__proto__" || key === "constructor") continue;
|
|
5984
|
-
const value = destr((match[2] || "").trim());
|
|
5985
|
-
if (key.endsWith("[]")) {
|
|
5986
|
-
const nkey = key.slice(0, Math.max(0, key.length - 2));
|
|
5987
|
-
config$1[nkey] = (config$1[nkey] || []).concat(value);
|
|
5988
|
-
continue;
|
|
5989
|
-
}
|
|
5990
|
-
config$1[key] = value;
|
|
5991
|
-
}
|
|
5992
|
-
return options.flat ? config$1 : unflatten(config$1, { overwrite: true });
|
|
5993
|
-
}
|
|
5994
|
-
function parseFile(path$2, options) {
|
|
5995
|
-
if (!existsSync(path$2)) return {};
|
|
5996
|
-
return parse(readFileSync(path$2, "utf8"), options);
|
|
5997
|
-
}
|
|
5998
|
-
function read(options) {
|
|
5999
|
-
options = withDefaults(options);
|
|
6000
|
-
return parseFile(resolve(options.dir, options.name), options);
|
|
6001
|
-
}
|
|
6002
|
-
function readUser(options) {
|
|
6003
|
-
options = withDefaults(options);
|
|
6004
|
-
options.dir = process.env.XDG_CONFIG_HOME || homedir();
|
|
6005
|
-
return read(options);
|
|
6006
|
-
}
|
|
6007
|
-
|
|
6008
|
-
//#endregion
|
|
6009
|
-
//#region ../../node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs
|
|
6010
|
-
const defaultFindOptions = {
|
|
6011
|
-
startingFrom: ".",
|
|
6012
|
-
rootPattern: /^node_modules$/,
|
|
6013
|
-
reverse: false,
|
|
6014
|
-
test: (filePath) => {
|
|
6015
|
-
try {
|
|
6016
|
-
if (statSync(filePath).isFile()) return true;
|
|
6017
|
-
} catch {}
|
|
6018
|
-
}
|
|
6019
|
-
};
|
|
6020
|
-
async function findFile(filename, _options = {}) {
|
|
6021
|
-
const filenames = Array.isArray(filename) ? filename : [filename];
|
|
6022
|
-
const options = {
|
|
6023
|
-
...defaultFindOptions,
|
|
6024
|
-
..._options
|
|
6025
|
-
};
|
|
6026
|
-
const basePath = resolve$1(options.startingFrom);
|
|
6027
|
-
const leadingSlash = basePath[0] === "/";
|
|
6028
|
-
const segments = basePath.split("/").filter(Boolean);
|
|
6029
|
-
if (filenames.includes(segments.at(-1)) && await options.test(basePath)) return basePath;
|
|
6030
|
-
if (leadingSlash) segments[0] = "/" + segments[0];
|
|
6031
|
-
let root = segments.findIndex((r) => r.match(options.rootPattern));
|
|
6032
|
-
if (root === -1) root = 0;
|
|
6033
|
-
if (options.reverse) for (let index = root + 1; index <= segments.length; index++) for (const filename2 of filenames) {
|
|
6034
|
-
const filePath = join(...segments.slice(0, index), filename2);
|
|
6035
|
-
if (await options.test(filePath)) return filePath;
|
|
6036
|
-
}
|
|
6037
|
-
else for (let index = segments.length; index > root; index--) for (const filename2 of filenames) {
|
|
6038
|
-
const filePath = join(...segments.slice(0, index), filename2);
|
|
6039
|
-
if (await options.test(filePath)) return filePath;
|
|
6040
|
-
}
|
|
6041
|
-
throw new Error(`Cannot find matching ${filename} in ${options.startingFrom} or parent directories`);
|
|
6042
|
-
}
|
|
6043
|
-
function findNearestFile(filename, options = {}) {
|
|
6044
|
-
return findFile(filename, options);
|
|
6045
|
-
}
|
|
6046
|
-
function _resolvePath(id, opts = {}) {
|
|
6047
|
-
if (id instanceof URL || id.startsWith("file://")) return normalize$1(fileURLToPath(id));
|
|
6048
|
-
if (isAbsolute$1(id)) return normalize$1(id);
|
|
6049
|
-
return resolveModulePath(id, {
|
|
6050
|
-
...opts,
|
|
6051
|
-
from: opts.from || opts.parent || opts.url
|
|
6052
|
-
});
|
|
6053
|
-
}
|
|
6054
|
-
const lockFiles = [
|
|
6055
|
-
"yarn.lock",
|
|
6056
|
-
"package-lock.json",
|
|
6057
|
-
"pnpm-lock.yaml",
|
|
6058
|
-
"npm-shrinkwrap.json",
|
|
6059
|
-
"bun.lockb",
|
|
6060
|
-
"bun.lock",
|
|
6061
|
-
"deno.lock"
|
|
6062
|
-
];
|
|
6063
|
-
const packageFiles = [
|
|
6064
|
-
"package.json",
|
|
6065
|
-
"package.json5",
|
|
6066
|
-
"package.yaml"
|
|
6067
|
-
];
|
|
6068
|
-
const workspaceFiles = [
|
|
6069
|
-
"pnpm-workspace.yaml",
|
|
6070
|
-
"lerna.json",
|
|
6071
|
-
"turbo.json",
|
|
6072
|
-
"rush.json",
|
|
6073
|
-
"deno.json",
|
|
6074
|
-
"deno.jsonc"
|
|
6075
|
-
];
|
|
6076
|
-
const FileCache = /* @__PURE__ */ new Map();
|
|
6077
|
-
async function readPackageJSON(id, options = {}) {
|
|
6078
|
-
const resolvedPath = await resolvePackageJSON(id, options);
|
|
6079
|
-
const cache$1 = options.cache && typeof options.cache !== "boolean" ? options.cache : FileCache;
|
|
6080
|
-
if (options.cache && cache$1.has(resolvedPath)) return cache$1.get(resolvedPath);
|
|
6081
|
-
const blob = await promises.readFile(resolvedPath, "utf8");
|
|
6082
|
-
let parsed;
|
|
6083
|
-
try {
|
|
6084
|
-
parsed = x(blob);
|
|
6085
|
-
} catch {
|
|
6086
|
-
parsed = h(blob);
|
|
6087
|
-
}
|
|
6088
|
-
cache$1.set(resolvedPath, parsed);
|
|
6089
|
-
return parsed;
|
|
6090
|
-
}
|
|
6091
|
-
async function resolvePackageJSON(id = process.cwd(), options = {}) {
|
|
6092
|
-
return findNearestFile("package.json", {
|
|
6093
|
-
...options,
|
|
6094
|
-
startingFrom: _resolvePath(id, options)
|
|
6095
|
-
});
|
|
6096
|
-
}
|
|
6097
|
-
const workspaceTests = {
|
|
6098
|
-
workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r) => dirname$1(r)),
|
|
6099
|
-
gitConfig: (opts) => findFile(".git/config", opts).then((r) => resolve$1(r, "../..")),
|
|
6100
|
-
lockFile: (opts) => findFile(lockFiles, opts).then((r) => dirname$1(r)),
|
|
6101
|
-
packageJson: (opts) => findFile(packageFiles, opts).then((r) => dirname$1(r))
|
|
6102
|
-
};
|
|
6103
|
-
async function findWorkspaceDir(id = process.cwd(), options = {}) {
|
|
6104
|
-
const startingFrom = _resolvePath(id, options);
|
|
6105
|
-
const tests = options.tests || [
|
|
6106
|
-
"workspaceFile",
|
|
6107
|
-
"gitConfig",
|
|
6108
|
-
"lockFile",
|
|
6109
|
-
"packageJson"
|
|
6110
|
-
];
|
|
6111
|
-
for (const testName of tests) {
|
|
6112
|
-
const test = workspaceTests[testName];
|
|
6113
|
-
if (options[testName] === false || !test) continue;
|
|
6114
|
-
const direction = options[testName] || (testName === "gitConfig" ? "closest" : "furthest");
|
|
6115
|
-
const detected = await test({
|
|
6116
|
-
...options,
|
|
6117
|
-
startingFrom,
|
|
6118
|
-
reverse: direction === "furthest"
|
|
6119
|
-
}).catch(() => {});
|
|
6120
|
-
if (detected) return detected;
|
|
6121
|
-
}
|
|
6122
|
-
throw new Error(`Cannot detect workspace root from ${id}`);
|
|
6123
|
-
}
|
|
6124
|
-
|
|
6125
|
-
//#endregion
|
|
6126
|
-
//#region ../../node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs
|
|
6127
|
-
var import_main = /* @__PURE__ */ __toESM(require_main(), 1);
|
|
6128
|
-
/**
|
|
6129
|
-
* Load and interpolate environment variables into `process.env`.
|
|
6130
|
-
* If you need more control (or access to the values), consider using `loadDotenv` instead
|
|
6131
|
-
*
|
|
6132
|
-
*/
|
|
6133
|
-
async function setupDotenv(options) {
|
|
6134
|
-
const targetEnvironment = options.env ?? process.env;
|
|
6135
|
-
const environment = await loadDotenv({
|
|
6136
|
-
cwd: options.cwd,
|
|
6137
|
-
fileName: options.fileName ?? ".env",
|
|
6138
|
-
env: targetEnvironment,
|
|
6139
|
-
interpolate: options.interpolate ?? true
|
|
6140
|
-
});
|
|
6141
|
-
const dotenvVars = getDotEnvVars(targetEnvironment);
|
|
6142
|
-
for (const key in environment) {
|
|
6143
|
-
if (key.startsWith("_")) continue;
|
|
6144
|
-
if (targetEnvironment[key] === void 0 || dotenvVars.has(key)) targetEnvironment[key] = environment[key];
|
|
6145
|
-
}
|
|
6146
|
-
return environment;
|
|
6147
|
-
}
|
|
6148
|
-
/** Load environment variables into an object. */
|
|
6149
|
-
async function loadDotenv(options) {
|
|
6150
|
-
const environment = Object.create(null);
|
|
6151
|
-
const cwd$1 = resolve$1(options.cwd || ".");
|
|
6152
|
-
const _fileName = options.fileName || ".env";
|
|
6153
|
-
const dotenvFiles = typeof _fileName === "string" ? [_fileName] : _fileName;
|
|
6154
|
-
const dotenvVars = getDotEnvVars(options.env || {});
|
|
6155
|
-
Object.assign(environment, options.env);
|
|
6156
|
-
for (const file of dotenvFiles) {
|
|
6157
|
-
const dotenvFile = resolve$1(cwd$1, file);
|
|
6158
|
-
if (!statSync(dotenvFile, { throwIfNoEntry: false })?.isFile()) continue;
|
|
6159
|
-
const parsed = import_main.parse(await promises.readFile(dotenvFile, "utf8"));
|
|
6160
|
-
for (const key in parsed) {
|
|
6161
|
-
if (key in environment && !dotenvVars.has(key)) continue;
|
|
6162
|
-
environment[key] = parsed[key];
|
|
6163
|
-
dotenvVars.add(key);
|
|
6164
|
-
}
|
|
6165
|
-
}
|
|
6166
|
-
if (options.interpolate) interpolate(environment);
|
|
6167
|
-
return environment;
|
|
6168
|
-
}
|
|
6169
|
-
function interpolate(target, source = {}, parse$2 = (v) => v) {
|
|
6170
|
-
function getValue(key) {
|
|
6171
|
-
return source[key] === void 0 ? target[key] : source[key];
|
|
6172
|
-
}
|
|
6173
|
-
function interpolate$1(value, parents = []) {
|
|
6174
|
-
if (typeof value !== "string") return value;
|
|
6175
|
-
return parse$2((value.match(/(.?\${?(?:[\w:]+)?}?)/g) || []).reduce((newValue, match) => {
|
|
6176
|
-
const parts = /(.?)\${?([\w:]+)?}?/g.exec(match) || [];
|
|
6177
|
-
const prefix = parts[1];
|
|
6178
|
-
let value$1, replacePart;
|
|
6179
|
-
if (prefix === "\\") {
|
|
6180
|
-
replacePart = parts[0] || "";
|
|
6181
|
-
value$1 = replacePart.replace(String.raw`\$`, "$");
|
|
6182
|
-
} else {
|
|
6183
|
-
const key = parts[2];
|
|
6184
|
-
replacePart = (parts[0] || "").slice(prefix.length);
|
|
6185
|
-
if (parents.includes(key)) {
|
|
6186
|
-
console.warn(`Please avoid recursive environment variables ( loop: ${parents.join(" > ")} > ${key} )`);
|
|
6187
|
-
return "";
|
|
6188
|
-
}
|
|
6189
|
-
value$1 = getValue(key);
|
|
6190
|
-
value$1 = interpolate$1(value$1, [...parents, key]);
|
|
6191
|
-
}
|
|
6192
|
-
return value$1 === void 0 ? newValue : newValue.replace(replacePart, value$1);
|
|
6193
|
-
}, value));
|
|
6194
|
-
}
|
|
6195
|
-
for (const key in target) target[key] = interpolate$1(getValue(key));
|
|
6196
|
-
}
|
|
6197
|
-
function getDotEnvVars(targetEnvironment) {
|
|
6198
|
-
const globalRegistry = globalThis.__c12_dotenv_vars__ ||= /* @__PURE__ */ new Map();
|
|
6199
|
-
if (!globalRegistry.has(targetEnvironment)) globalRegistry.set(targetEnvironment, /* @__PURE__ */ new Set());
|
|
6200
|
-
return globalRegistry.get(targetEnvironment);
|
|
6201
|
-
}
|
|
6202
|
-
const _normalize = (p) => p?.replace(/\\/g, "/");
|
|
6203
|
-
const ASYNC_LOADERS = {
|
|
6204
|
-
".yaml": () => import("./yaml-CIn2Gddw.mjs").then((r) => r.parseYAML),
|
|
6205
|
-
".yml": () => import("./yaml-CIn2Gddw.mjs").then((r) => r.parseYAML),
|
|
6206
|
-
".jsonc": () => import("./jsonc-CDLU6bgi.mjs").then((r) => r.parseJSONC),
|
|
6207
|
-
".json5": () => import("./json5-jq90mF9X.mjs").then((r) => r.parseJSON5),
|
|
6208
|
-
".toml": () => import("./toml-uuOYvEAO.mjs").then((r) => r.parseTOML)
|
|
6209
|
-
};
|
|
6210
|
-
const SUPPORTED_EXTENSIONS = Object.freeze([
|
|
6211
|
-
".js",
|
|
6212
|
-
".ts",
|
|
6213
|
-
".mjs",
|
|
6214
|
-
".cjs",
|
|
6215
|
-
".mts",
|
|
6216
|
-
".cts",
|
|
6217
|
-
".json",
|
|
6218
|
-
".jsonc",
|
|
6219
|
-
".json5",
|
|
6220
|
-
".yaml",
|
|
6221
|
-
".yml",
|
|
6222
|
-
".toml"
|
|
6223
|
-
]);
|
|
6224
|
-
async function loadConfig(options) {
|
|
6225
|
-
options.cwd = resolve$1(process.cwd(), options.cwd || ".");
|
|
6226
|
-
options.name = options.name || "config";
|
|
6227
|
-
options.envName = options.envName ?? process.env.NODE_ENV;
|
|
6228
|
-
options.configFile = options.configFile ?? (options.name === "config" ? "config" : `${options.name}.config`);
|
|
6229
|
-
options.rcFile = options.rcFile ?? `.${options.name}rc`;
|
|
6230
|
-
if (options.extend !== false) options.extend = {
|
|
6231
|
-
extendKey: "extends",
|
|
6232
|
-
...options.extend
|
|
6233
|
-
};
|
|
6234
|
-
const _merger = options.merger || defu;
|
|
6235
|
-
options.jiti = options.jiti || createJiti(join(options.cwd, options.configFile), {
|
|
6236
|
-
interopDefault: true,
|
|
6237
|
-
moduleCache: false,
|
|
6238
|
-
extensions: [...SUPPORTED_EXTENSIONS],
|
|
6239
|
-
...options.jitiOptions
|
|
6240
|
-
});
|
|
6241
|
-
const r = {
|
|
6242
|
-
config: {},
|
|
6243
|
-
cwd: options.cwd,
|
|
6244
|
-
configFile: resolve$1(options.cwd, options.configFile),
|
|
6245
|
-
layers: [],
|
|
6246
|
-
_configFile: void 0
|
|
6247
|
-
};
|
|
6248
|
-
const rawConfigs = {
|
|
6249
|
-
overrides: options.overrides,
|
|
6250
|
-
main: void 0,
|
|
6251
|
-
rc: void 0,
|
|
6252
|
-
packageJson: void 0,
|
|
6253
|
-
defaultConfig: options.defaultConfig
|
|
6254
|
-
};
|
|
6255
|
-
if (options.dotenv) await setupDotenv({
|
|
6256
|
-
cwd: options.cwd,
|
|
6257
|
-
...options.dotenv === true ? {} : options.dotenv
|
|
6258
|
-
});
|
|
6259
|
-
const _mainConfig = await resolveConfig(".", options);
|
|
6260
|
-
if (_mainConfig.configFile) {
|
|
6261
|
-
rawConfigs.main = _mainConfig.config;
|
|
6262
|
-
r.configFile = _mainConfig.configFile;
|
|
6263
|
-
r._configFile = _mainConfig._configFile;
|
|
6264
|
-
}
|
|
6265
|
-
if (_mainConfig.meta) r.meta = _mainConfig.meta;
|
|
6266
|
-
if (options.rcFile) {
|
|
6267
|
-
const rcSources = [];
|
|
6268
|
-
rcSources.push(read({
|
|
6269
|
-
name: options.rcFile,
|
|
6270
|
-
dir: options.cwd
|
|
6271
|
-
}));
|
|
6272
|
-
if (options.globalRc) {
|
|
6273
|
-
const workspaceDir = await findWorkspaceDir(options.cwd).catch(() => {});
|
|
6274
|
-
if (workspaceDir) rcSources.push(read({
|
|
6275
|
-
name: options.rcFile,
|
|
6276
|
-
dir: workspaceDir
|
|
6277
|
-
}));
|
|
6278
|
-
rcSources.push(readUser({
|
|
6279
|
-
name: options.rcFile,
|
|
6280
|
-
dir: options.cwd
|
|
6281
|
-
}));
|
|
6282
|
-
}
|
|
6283
|
-
rawConfigs.rc = _merger({}, ...rcSources);
|
|
6284
|
-
}
|
|
6285
|
-
if (options.packageJson) {
|
|
6286
|
-
const keys = (Array.isArray(options.packageJson) ? options.packageJson : [typeof options.packageJson === "string" ? options.packageJson : options.name]).filter((t) => t && typeof t === "string");
|
|
6287
|
-
const pkgJsonFile = await readPackageJSON(options.cwd).catch(() => {});
|
|
6288
|
-
rawConfigs.packageJson = _merger({}, ...keys.map((key) => pkgJsonFile?.[key]));
|
|
6289
|
-
}
|
|
6290
|
-
const configs = {};
|
|
6291
|
-
for (const key in rawConfigs) {
|
|
6292
|
-
const value = rawConfigs[key];
|
|
6293
|
-
configs[key] = await (typeof value === "function" ? value({
|
|
6294
|
-
configs,
|
|
6295
|
-
rawConfigs
|
|
6296
|
-
}) : value);
|
|
6297
|
-
}
|
|
6298
|
-
if (Array.isArray(configs.main)) r.config = configs.main;
|
|
6299
|
-
else {
|
|
6300
|
-
r.config = _merger(configs.overrides, configs.main, configs.rc, configs.packageJson, configs.defaultConfig);
|
|
6301
|
-
if (options.extend) {
|
|
6302
|
-
await extendConfig(r.config, options);
|
|
6303
|
-
r.layers = r.config._layers;
|
|
6304
|
-
delete r.config._layers;
|
|
6305
|
-
r.config = _merger(r.config, ...r.layers.map((e) => e.config));
|
|
6306
|
-
}
|
|
6307
|
-
}
|
|
6308
|
-
r.layers = [...[
|
|
6309
|
-
configs.overrides && {
|
|
6310
|
-
config: configs.overrides,
|
|
6311
|
-
configFile: void 0,
|
|
6312
|
-
cwd: void 0
|
|
6313
|
-
},
|
|
6314
|
-
{
|
|
6315
|
-
config: configs.main,
|
|
6316
|
-
configFile: options.configFile,
|
|
6317
|
-
cwd: options.cwd
|
|
6318
|
-
},
|
|
6319
|
-
configs.rc && {
|
|
6320
|
-
config: configs.rc,
|
|
6321
|
-
configFile: options.rcFile
|
|
6322
|
-
},
|
|
6323
|
-
configs.packageJson && {
|
|
6324
|
-
config: configs.packageJson,
|
|
6325
|
-
configFile: "package.json"
|
|
6326
|
-
}
|
|
6327
|
-
].filter((l) => l && l.config), ...r.layers];
|
|
6328
|
-
if (options.defaults) r.config = _merger(r.config, options.defaults);
|
|
6329
|
-
if (options.omit$Keys) {
|
|
6330
|
-
for (const key in r.config) if (key.startsWith("$")) delete r.config[key];
|
|
6331
|
-
}
|
|
6332
|
-
if (options.configFileRequired && !r._configFile) throw new Error(`Required config (${r.configFile}) cannot be resolved.`);
|
|
6333
|
-
return r;
|
|
6334
|
-
}
|
|
6335
|
-
async function extendConfig(config$1, options) {
|
|
6336
|
-
config$1._layers = config$1._layers || [];
|
|
6337
|
-
if (!options.extend) return;
|
|
6338
|
-
let keys = options.extend.extendKey;
|
|
6339
|
-
if (typeof keys === "string") keys = [keys];
|
|
6340
|
-
const extendSources = [];
|
|
6341
|
-
for (const key of keys) {
|
|
6342
|
-
extendSources.push(...(Array.isArray(config$1[key]) ? config$1[key] : [config$1[key]]).filter(Boolean));
|
|
6343
|
-
delete config$1[key];
|
|
6344
|
-
}
|
|
6345
|
-
for (let extendSource of extendSources) {
|
|
6346
|
-
const originalExtendSource = extendSource;
|
|
6347
|
-
let sourceOptions = {};
|
|
6348
|
-
if (extendSource.source) {
|
|
6349
|
-
sourceOptions = extendSource.options || {};
|
|
6350
|
-
extendSource = extendSource.source;
|
|
6351
|
-
}
|
|
6352
|
-
if (Array.isArray(extendSource)) {
|
|
6353
|
-
sourceOptions = extendSource[1] || {};
|
|
6354
|
-
extendSource = extendSource[0];
|
|
6355
|
-
}
|
|
6356
|
-
if (typeof extendSource !== "string") {
|
|
6357
|
-
console.warn(`Cannot extend config from \`${JSON.stringify(originalExtendSource)}\` in ${options.cwd}`);
|
|
6358
|
-
continue;
|
|
6359
|
-
}
|
|
6360
|
-
const _config = await resolveConfig(extendSource, options, sourceOptions);
|
|
6361
|
-
if (!_config.config) {
|
|
6362
|
-
console.warn(`Cannot extend config from \`${extendSource}\` in ${options.cwd}`);
|
|
6363
|
-
continue;
|
|
6364
|
-
}
|
|
6365
|
-
await extendConfig(_config.config, {
|
|
6366
|
-
...options,
|
|
6367
|
-
cwd: _config.cwd
|
|
6368
|
-
});
|
|
6369
|
-
config$1._layers.push(_config);
|
|
6370
|
-
if (_config.config._layers) {
|
|
6371
|
-
config$1._layers.push(..._config.config._layers);
|
|
6372
|
-
delete _config.config._layers;
|
|
6373
|
-
}
|
|
6374
|
-
}
|
|
6375
|
-
}
|
|
6376
|
-
const GIGET_PREFIXES = [
|
|
6377
|
-
"gh:",
|
|
6378
|
-
"github:",
|
|
6379
|
-
"gitlab:",
|
|
6380
|
-
"bitbucket:",
|
|
6381
|
-
"https://",
|
|
6382
|
-
"http://"
|
|
6383
|
-
];
|
|
6384
|
-
const NPM_PACKAGE_RE = /^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/;
|
|
6385
|
-
async function resolveConfig(source, options, sourceOptions = {}) {
|
|
6386
|
-
if (options.resolve) {
|
|
6387
|
-
const res$1 = await options.resolve(source, options);
|
|
6388
|
-
if (res$1) return res$1;
|
|
6389
|
-
}
|
|
6390
|
-
const _merger = options.merger || defu;
|
|
6391
|
-
const customProviderKeys = Object.keys(sourceOptions.giget?.providers || {}).map((key) => `${key}:`);
|
|
6392
|
-
const gigetPrefixes = customProviderKeys.length > 0 ? [...new Set([...customProviderKeys, ...GIGET_PREFIXES])] : GIGET_PREFIXES;
|
|
6393
|
-
if (options.giget !== false && gigetPrefixes.some((prefix) => source.startsWith(prefix))) {
|
|
6394
|
-
const { downloadTemplate } = await import("./dist-CjWvISyq.mjs");
|
|
6395
|
-
const { digest } = await import("./dist-mV5Swt78.mjs");
|
|
6396
|
-
const cloneName = source.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + digest(source).slice(0, 10).replace(/[-_]/g, "");
|
|
6397
|
-
let cloneDir;
|
|
6398
|
-
const localNodeModules = resolve$1(options.cwd, "node_modules");
|
|
6399
|
-
const parentDir = dirname$1(options.cwd);
|
|
6400
|
-
if (basename(parentDir) === ".c12") cloneDir = join(parentDir, cloneName);
|
|
6401
|
-
else if (existsSync(localNodeModules)) cloneDir = join(localNodeModules, ".c12", cloneName);
|
|
6402
|
-
else cloneDir = process.env.XDG_CACHE_HOME ? resolve$1(process.env.XDG_CACHE_HOME, "c12", cloneName) : resolve$1(homedir(), ".cache/c12", cloneName);
|
|
6403
|
-
if (existsSync(cloneDir) && !sourceOptions.install) await rm(cloneDir, { recursive: true });
|
|
6404
|
-
source = (await downloadTemplate(source, {
|
|
6405
|
-
dir: cloneDir,
|
|
6406
|
-
install: sourceOptions.install,
|
|
6407
|
-
force: sourceOptions.install,
|
|
6408
|
-
auth: sourceOptions.auth,
|
|
6409
|
-
...options.giget,
|
|
6410
|
-
...sourceOptions.giget
|
|
6411
|
-
})).dir;
|
|
6412
|
-
}
|
|
6413
|
-
if (NPM_PACKAGE_RE.test(source)) source = tryResolve(source, options) || source;
|
|
6414
|
-
const ext = extname(source);
|
|
6415
|
-
const isDir = !ext || ext === basename(source);
|
|
6416
|
-
const cwd$1 = resolve$1(options.cwd, isDir ? source : dirname$1(source));
|
|
6417
|
-
if (isDir) source = options.configFile;
|
|
6418
|
-
const res = {
|
|
6419
|
-
config: void 0,
|
|
6420
|
-
configFile: void 0,
|
|
6421
|
-
cwd: cwd$1,
|
|
6422
|
-
source,
|
|
6423
|
-
sourceOptions
|
|
6424
|
-
};
|
|
6425
|
-
res.configFile = tryResolve(resolve$1(cwd$1, source), options) || tryResolve(resolve$1(cwd$1, ".config", source.replace(/\.config$/, "")), options) || tryResolve(resolve$1(cwd$1, ".config", source), options) || source;
|
|
6426
|
-
if (!existsSync(res.configFile)) return res;
|
|
6427
|
-
res._configFile = res.configFile;
|
|
6428
|
-
const configFileExt = extname(res.configFile) || "";
|
|
6429
|
-
if (configFileExt in ASYNC_LOADERS) res.config = (await ASYNC_LOADERS[configFileExt]())(await readFile(res.configFile, "utf8"));
|
|
6430
|
-
else res.config = await options.jiti.import(res.configFile, { default: true });
|
|
6431
|
-
if (typeof res.config === "function") res.config = await res.config(options.context);
|
|
6432
|
-
if (options.envName) {
|
|
6433
|
-
const envConfig = {
|
|
6434
|
-
...res.config["$" + options.envName],
|
|
6435
|
-
...res.config.$env?.[options.envName]
|
|
6436
|
-
};
|
|
6437
|
-
if (Object.keys(envConfig).length > 0) res.config = _merger(envConfig, res.config);
|
|
6438
|
-
}
|
|
6439
|
-
res.meta = defu(res.sourceOptions.meta, res.config.$meta);
|
|
6440
|
-
delete res.config.$meta;
|
|
6441
|
-
if (res.sourceOptions.overrides) res.config = _merger(res.sourceOptions.overrides, res.config);
|
|
6442
|
-
res.configFile = _normalize(res.configFile);
|
|
6443
|
-
res.source = _normalize(res.source);
|
|
6444
|
-
return res;
|
|
6445
|
-
}
|
|
6446
|
-
function tryResolve(id, options) {
|
|
6447
|
-
const res = resolveModulePath(id, {
|
|
6448
|
-
try: true,
|
|
6449
|
-
from: pathToFileURL(join(options.cwd || ".", options.configFile || "/")),
|
|
6450
|
-
suffixes: ["", "/index"],
|
|
6451
|
-
extensions: SUPPORTED_EXTENSIONS,
|
|
6452
|
-
cache: false
|
|
6453
|
-
});
|
|
6454
|
-
return res ? normalize$1(res) : void 0;
|
|
6455
|
-
}
|
|
6456
|
-
|
|
6457
|
-
//#endregion
|
|
6458
|
-
//#region src/helpers/load.ts
|
|
6459
|
-
function __assignType(fn, args) {
|
|
6460
|
-
fn.__type = args;
|
|
6461
|
-
return fn;
|
|
6462
|
-
}
|
|
6463
|
-
async function loadEnvFiles(options, mode, cwd$1) {
|
|
6464
|
-
let env = await loadEnv(cwd$1, mode);
|
|
6465
|
-
if (options.additionalFiles && options.additionalFiles?.length > 0) {
|
|
6466
|
-
const additionalEnvFiles = await Promise.all(options.additionalFiles.map(__assignType(async (additionalEnvFile) => loadEnvFile(additionalEnvFile, cwd$1), [
|
|
6467
|
-
"additionalEnvFile",
|
|
6468
|
-
"",
|
|
6469
|
-
"P\"2!\"/\""
|
|
6470
|
-
])));
|
|
6471
|
-
for (const additionalEnvFile of additionalEnvFiles) env = defu(additionalEnvFile, env);
|
|
6472
|
-
}
|
|
6473
|
-
return removeEnvPrefix(env);
|
|
6474
|
-
}
|
|
6475
|
-
loadEnvFiles.__type = [
|
|
6476
|
-
() => __ΩEnvPluginOptions,
|
|
6477
|
-
"options",
|
|
6478
|
-
"mode",
|
|
6479
|
-
"cwd",
|
|
6480
|
-
"loadEnvFiles",
|
|
6481
|
-
"Pn!2\"&2#&2$\"`/%"
|
|
6482
|
-
];
|
|
6483
|
-
async function loadEnvDirectory(options, directory, mode, cacheDir, packageJson, workspaceConfig) {
|
|
6484
|
-
const [envResult, c12Result] = await Promise.all([(loadEnvFiles.Ω = [["!"]], loadEnvFiles(options, mode, directory)), loadConfig({
|
|
6485
|
-
cwd: directory,
|
|
6486
|
-
name: "storm",
|
|
6487
|
-
envName: mode,
|
|
6488
|
-
defaults: {
|
|
6489
|
-
NAME: packageJson.name?.replace(`@${workspaceConfig.namespace}/`, ""),
|
|
6490
|
-
MODE: mode,
|
|
6491
|
-
ORG: workspaceConfig.organization
|
|
6492
|
-
},
|
|
6493
|
-
globalRc: true,
|
|
6494
|
-
packageJson: true,
|
|
6495
|
-
dotenv: true,
|
|
6496
|
-
jitiOptions: {
|
|
6497
|
-
fsCache: joinPaths(cacheDir, "jiti"),
|
|
6498
|
-
moduleCache: true
|
|
6499
|
-
}
|
|
6500
|
-
})]);
|
|
6501
|
-
return defu(envResult, c12Result.config, workspaceConfig);
|
|
6502
|
-
}
|
|
6503
|
-
loadEnvDirectory.__type = [
|
|
6504
|
-
() => __ΩEnvPluginOptions,
|
|
6505
|
-
"options",
|
|
6506
|
-
"directory",
|
|
6507
|
-
"mode",
|
|
6508
|
-
"cacheDir",
|
|
6509
|
-
"packageJson",
|
|
6510
|
-
() => __ΩWorkspaceConfig,
|
|
6511
|
-
"workspaceConfig",
|
|
6512
|
-
"loadEnvDirectory",
|
|
6513
|
-
"Pn!2\"&2#&2$&2%!2&n'2(\"`/)"
|
|
6514
|
-
];
|
|
6515
|
-
/**
|
|
6516
|
-
* Retrieves various dotenv configuration parameters from the context.
|
|
6517
|
-
*
|
|
6518
|
-
* @param context - The context to retrieve the dotenv configuration from.
|
|
6519
|
-
* @param parsed - The parsed dotenv configuration.
|
|
6520
|
-
* @returns An object containing the dotenv configuration.
|
|
6521
|
-
*/
|
|
6522
|
-
function loadEnvFromContext(context, parsed) {
|
|
6523
|
-
return defu({
|
|
6524
|
-
APP_NAME: kebabCase(context.config.name || context.packageJson.name?.replace(`/${context.workspaceConfig.namespace}`, "")),
|
|
6525
|
-
APP_VERSION: context.packageJson.version,
|
|
6526
|
-
BUILD_ID: context.meta.buildId,
|
|
6527
|
-
BUILD_TIMESTAMP: new Date(context.meta.timestamp).toISOString(),
|
|
6528
|
-
BUILD_CHECKSUM: context.meta.checksum,
|
|
6529
|
-
RELEASE_ID: context.meta.releaseId,
|
|
6530
|
-
RELEASE_TAG: `${kebabCase(context.config.name)}@${context.packageJson.version}`,
|
|
6531
|
-
DEFAULT_LOCALE: context.workspaceConfig.locale,
|
|
6532
|
-
DEFAULT_TIMEZONE: context.workspaceConfig.timezone,
|
|
6533
|
-
LOG_LEVEL: context.config.logLevel === "trace" ? "debug" : context.config.logLevel,
|
|
6534
|
-
ERROR_URL: context.workspaceConfig.error?.url,
|
|
6535
|
-
ORGANIZATION: context.config.organization || (isSetObject(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization),
|
|
6536
|
-
PLATFORM: context.config.build.platform,
|
|
6537
|
-
MODE: context.config.mode,
|
|
6538
|
-
TEST: context.config.mode === "test",
|
|
6539
|
-
DEBUG: context.config.mode === "development",
|
|
6540
|
-
STACKTRACE: context.config.mode !== "production",
|
|
6541
|
-
ENVIRONMENT: !context.environment.name || context.environment.name === DEFAULT_ENVIRONMENT ? context.config.mode : context.environment.name
|
|
6542
|
-
}, isSetObject(context?.env?.types?.env) ? context.env.types.env?.getProperties().reduce(__assignType((ret, prop) => {
|
|
6543
|
-
ret[prop.name] = parsed[prop.name] ?? prop.getDefaultValue();
|
|
6544
|
-
return ret;
|
|
6545
|
-
}, [
|
|
6546
|
-
"ret",
|
|
6547
|
-
"prop",
|
|
6548
|
-
"",
|
|
6549
|
-
"P\"2!\"2\"\"/#"
|
|
6550
|
-
]), {}) : {});
|
|
6551
|
-
}
|
|
6552
|
-
loadEnvFromContext.__type = [
|
|
6553
|
-
() => __ΩEnvPluginContext,
|
|
6554
|
-
"context",
|
|
6555
|
-
"parsed",
|
|
6556
|
-
"loadEnvFromContext",
|
|
6557
|
-
"Retrieves various dotenv configuration parameters from the context.",
|
|
6558
|
-
"Pn!2\"!2#\"/$?%"
|
|
6559
|
-
];
|
|
6560
|
-
async function loadEnv$1(context, options) {
|
|
6561
|
-
const [project, workspace, config$1] = await Promise.all([
|
|
6562
|
-
(loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.config.projectRoot, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)),
|
|
6563
|
-
(loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.workspaceConfig.workspaceRoot, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig)),
|
|
6564
|
-
(loadEnvDirectory.Ω = [["!"]], loadEnvDirectory(options, context.envPaths.config, context.config.mode, context.cachePath, context.packageJson, context.workspaceConfig))
|
|
6565
|
-
]);
|
|
6566
|
-
return defu(loadEnvFromContext(context, process.env), project, workspace, config$1);
|
|
6567
|
-
}
|
|
6568
|
-
loadEnv$1.__type = [
|
|
6569
|
-
() => __ΩEnvPluginContext,
|
|
6570
|
-
"context",
|
|
6571
|
-
() => __ΩEnvPluginOptions,
|
|
6572
|
-
"options",
|
|
6573
|
-
"loadEnv",
|
|
6574
|
-
"Pn!2\"n#2$\"`/%"
|
|
6575
|
-
];
|
|
6576
|
-
|
|
6577
|
-
//#endregion
|
|
6578
|
-
export { loadEnvFromContext as n, loadEnv$1 as t };
|
|
6579
|
-
//# sourceMappingURL=load-EM4edkA2.mjs.map
|
|
4454
|
+
export { require_jiti };
|
|
4455
|
+
//# sourceMappingURL=jiti.mjs.map
|