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