@highstate/designer 0.3.2 → 0.3.3
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/.output/nitro.json +15 -0
- package/.output/public/_nuxt/BiOpBOhF.js +69 -0
- package/.output/public/_nuxt/Cbvq2xei.js +1 -0
- package/.output/public/_nuxt/DVgDGs8k.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/4e80df08-b017-4dd3-92a5-670b9c4b88d5.json +1 -0
- package/.output/public/_nuxt/entry.D7UJUp71.css +5 -0
- package/.output/public/_nuxt/error-404.SWzu_puR.css +1 -0
- package/.output/public/_nuxt/error-500.Bkv_zTjr.css +1 -0
- package/.output/public/_nuxt/rjBY3mWU.js +1 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/robots.txt +1 -0
- package/.output/server/chunks/_/error-500.mjs +8 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/.output/server/chunks/build/client.manifest.mjs +85 -0
- package/.output/server/chunks/build/client.manifest.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +6161 -0
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/.output/server/chunks/routes/api/_trpc_.mjs +1067 -0
- package/.output/server/chunks/routes/api/_trpc_.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +341 -0
- package/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/.output/server/index.mjs +7 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/.nitro/get-stream@5.2.0/buffer-stream.js +52 -0
- package/.output/server/node_modules/.nitro/get-stream@5.2.0/index.js +60 -0
- package/.output/server/node_modules/.nitro/get-stream@5.2.0/package.json +50 -0
- package/.output/server/node_modules/.nitro/get-stream@6.0.1/buffer-stream.js +52 -0
- package/.output/server/node_modules/.nitro/get-stream@6.0.1/index.js +61 -0
- package/.output/server/node_modules/.nitro/get-stream@6.0.1/package.json +47 -0
- package/.output/server/node_modules/.nitro/mimic-response@1.0.1/index.js +32 -0
- package/.output/server/node_modules/.nitro/mimic-response@1.0.1/package.json +37 -0
- package/.output/server/node_modules/.nitro/mimic-response@3.1.0/index.js +77 -0
- package/.output/server/node_modules/.nitro/mimic-response@3.1.0/package.json +42 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14027 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/admin.js +31 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/backoff-timeout.js +174 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/call-credentials.js +153 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/call-interface.js +84 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/call-number.js +25 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/call.js +136 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/certificate-provider.js +134 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/channel-credentials.js +272 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/channel-options.js +71 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/channel.js +68 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/channelz.js +584 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/client-interceptors.js +428 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/client.js +433 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/compression-algorithms.js +26 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/compression-filter.js +295 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/connectivity-state.js +28 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/constants.js +64 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/control-plane-status.js +43 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/deadline.js +109 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/duration.js +47 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/environment.js +22 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/error.js +41 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/experimental.js +52 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/filter-stack.js +82 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/filter.js +38 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/http_proxy.js +266 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/index.js +144 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/internal-channel.js +572 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/load-balancer-child-handler.js +153 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/load-balancer-outlier-detection.js +567 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/load-balancer-pick-first.js +482 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/load-balancer-round-robin.js +182 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/load-balancer.js +117 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/load-balancing-call.js +294 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/logging.js +122 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/make-client.js +144 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/metadata.js +249 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/picker.js +86 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/resolver-dns.js +349 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/resolver-ip.js +105 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/resolver-uds.js +51 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/resolver.js +88 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/resolving-call.js +305 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/resolving-load-balancer.js +309 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/retrying-call.js +665 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/server-call.js +202 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/server-credentials.js +305 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/server-interceptors.js +770 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/server.js +1569 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/service-config.js +431 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/status-builder.js +68 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/stream-decoder.js +100 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/subchannel-address.js +202 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/subchannel-call.js +526 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/subchannel-interface.js +92 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/subchannel-pool.js +137 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/subchannel.js +371 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/tls-helpers.js +34 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/transport.js +662 -0
- package/.output/server/node_modules/@grpc/grpc-js/build/src/uri-parser.js +126 -0
- package/.output/server/node_modules/@grpc/grpc-js/package.json +87 -0
- package/.output/server/node_modules/@grpc/grpc-js/proto/channelz.proto +564 -0
- package/.output/server/node_modules/@grpc/proto-loader/build/src/index.js +244 -0
- package/.output/server/node_modules/@grpc/proto-loader/build/src/util.js +89 -0
- package/.output/server/node_modules/@grpc/proto-loader/package.json +69 -0
- package/.output/server/node_modules/@js-sdsl/ordered-map/dist/cjs/index.js +795 -0
- package/.output/server/node_modules/@js-sdsl/ordered-map/package.json +138 -0
- package/.output/server/node_modules/@logdna/tail-file/index.js +3 -0
- package/.output/server/node_modules/@logdna/tail-file/lib/tail-file.js +326 -0
- package/.output/server/node_modules/@logdna/tail-file/package.json +162 -0
- package/.output/server/node_modules/@protobufjs/aspromise/index.js +52 -0
- package/.output/server/node_modules/@protobufjs/aspromise/package.json +21 -0
- package/.output/server/node_modules/@protobufjs/base64/index.js +139 -0
- package/.output/server/node_modules/@protobufjs/base64/package.json +21 -0
- package/.output/server/node_modules/@protobufjs/codegen/index.js +99 -0
- package/.output/server/node_modules/@protobufjs/codegen/package.json +13 -0
- package/.output/server/node_modules/@protobufjs/eventemitter/index.js +76 -0
- package/.output/server/node_modules/@protobufjs/eventemitter/package.json +21 -0
- package/.output/server/node_modules/@protobufjs/fetch/index.js +115 -0
- package/.output/server/node_modules/@protobufjs/fetch/package.json +25 -0
- package/.output/server/node_modules/@protobufjs/float/index.js +335 -0
- package/.output/server/node_modules/@protobufjs/float/package.json +26 -0
- package/.output/server/node_modules/@protobufjs/inquire/index.js +17 -0
- package/.output/server/node_modules/@protobufjs/inquire/package.json +21 -0
- package/.output/server/node_modules/@protobufjs/path/index.js +65 -0
- package/.output/server/node_modules/@protobufjs/path/package.json +21 -0
- package/.output/server/node_modules/@protobufjs/pool/index.js +48 -0
- package/.output/server/node_modules/@protobufjs/pool/package.json +21 -0
- package/.output/server/node_modules/@protobufjs/utf8/index.js +105 -0
- package/.output/server/node_modules/@protobufjs/utf8/package.json +21 -0
- package/.output/server/node_modules/@pulumi/pulumi/asset/archive.js +84 -0
- package/.output/server/node_modules/@pulumi/pulumi/asset/asset.js +84 -0
- package/.output/server/node_modules/@pulumi/pulumi/asset/index.js +21 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/cmd.js +270 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/errors.js +84 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/events.js +47 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/index.js +27 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/localWorkspace.js +1049 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/minimumVersion.js +28 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/remoteStack.js +130 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/remoteWorkspace.js +131 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/server.js +170 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/stack.js +991 -0
- package/.output/server/node_modules/@pulumi/pulumi/automation/stackSettings.js +24 -0
- package/.output/server/node_modules/@pulumi/pulumi/errors.js +126 -0
- package/.output/server/node_modules/@pulumi/pulumi/log/index.js +132 -0
- package/.output/server/node_modules/@pulumi/pulumi/metadata.js +46 -0
- package/.output/server/node_modules/@pulumi/pulumi/output.js +677 -0
- package/.output/server/node_modules/@pulumi/pulumi/package.json +93 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/alias_pb.js +631 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/callback_grpc_pb.js +61 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/callback_pb.js +582 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/codegen/hcl_pb.js +808 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/engine_grpc_pb.js +158 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/engine_pb.js +1058 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/language_grpc_pb.js +510 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/language_pb.js +7222 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/plugin_pb.js +1159 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/provider_pb.js +11300 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/resource_grpc_pb.js +310 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/resource_pb.js +7447 -0
- package/.output/server/node_modules/@pulumi/pulumi/proto/source_pb.js +230 -0
- package/.output/server/node_modules/@pulumi/pulumi/resource.js +774 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/asyncIterableUtil.js +103 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/callbacks.js +456 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/config.js +129 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/debuggable.js +137 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/dependsOn.js +64 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/invoke.js +498 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/resource.js +928 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/rpc.js +844 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/settings.js +551 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/stack.js +276 -0
- package/.output/server/node_modules/@pulumi/pulumi/runtime/state.js +187 -0
- package/.output/server/node_modules/@pulumi/pulumi/utils.js +89 -0
- package/.output/server/node_modules/@pulumi/pulumi/version.js +17 -0
- package/.output/server/node_modules/@pulumi/query/asyncQueryable.js +279 -0
- package/.output/server/node_modules/@pulumi/query/base.js +34 -0
- package/.output/server/node_modules/@pulumi/query/index.js +87 -0
- package/.output/server/node_modules/@pulumi/query/interfaces.js +24 -0
- package/.output/server/node_modules/@pulumi/query/operators.js +1269 -0
- package/.output/server/node_modules/@pulumi/query/package.json +22 -0
- package/.output/server/node_modules/@pulumi/query/sources.js +81 -0
- package/.output/server/node_modules/@pulumi/query/util.js +23 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/index.mjs +78 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/system/policy.mjs +54 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/any/any.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/any/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/array/array.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/array/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs +37 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/awaited/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/bigint/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/boolean/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/clone/index.mjs +2 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs +9 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs +36 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs +42 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/composite/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/computed/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/const/const.mjs +54 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/const/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/constructor/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs +33 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/create/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/create/type.mjs +15 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/date/date.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/date/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs +8 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/discard/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs +18 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/enum/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/error/error.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/error/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs +18 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs +25 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/exclude/index.mjs +3 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs +635 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs +25 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs +19 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.mjs +20 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs +23 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extends/index.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs +18 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs +25 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/extract/index.mjs +3 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/function/function.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/function/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/guard/index.mjs +3 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs +230 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs +501 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs +70 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.mjs +4 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/helpers/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/indexed/index.mjs +4 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs +22 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs +20 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs +32 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs +91 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/integer/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intersect/index.mjs +3 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs +19 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs +38 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs +17 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs +26 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs +64 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/iterator/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/keyof/index.mjs +4 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs +19 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.mjs +12 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs +73 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs +35 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/literal/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs +10 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/mapped/index.mjs +3 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.mjs +9 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs +9 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs +102 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs +151 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/module/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/module/module.mjs +32 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/never/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/not/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/not/not.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/null/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/null/null.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/number/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/number/number.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/object/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs +22 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/omit/index.mjs +3 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs +22 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs +19 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs +71 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/optional/index.mjs +2 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs +18 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs +22 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/parameters/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/partial/index.mjs +2 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs +19 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs +61 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/patterns/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs +8 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/pick/index.mjs +3 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs +24 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs +19 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs +66 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/promise/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/readonly/index.mjs +2 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs +18 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs +22 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/record/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/record/record.mjs +94 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/recursive/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs +15 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/ref/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs +10 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/regexp/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs +8 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs +26 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/registry/index.mjs +2 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs +26 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/required/index.mjs +2 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs +18 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/required/required.mjs +60 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/rest/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs +15 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/return-type/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/schema/index.mjs +2 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/schema/schema.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/sets/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs +48 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/static/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/static/static.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/string/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/string/string.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/symbol/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/symbols/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs +10 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs +49 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs +53 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.mjs +7 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs +167 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs +33 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs +55 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs +13 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs +9 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/transform/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs +40 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/tuple/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs +9 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/type/index.mjs +13 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/type/javascript.mjs +89 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/type/json.mjs +221 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/type/type.mjs +60 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/undefined/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/union/index.mjs +3 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs +5 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs +36 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/union/union-type.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/union/union.mjs +10 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/unknown/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/void/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/type/void/void.mjs +6 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs +158 -0
- package/.output/server/node_modules/@sinclair/typebox/build/esm/value/guard/index.mjs +1 -0
- package/.output/server/node_modules/@sinclair/typebox/package.json +106 -0
- package/.output/server/node_modules/@sindresorhus/is/dist/index.js +434 -0
- package/.output/server/node_modules/@sindresorhus/is/package.json +96 -0
- package/.output/server/node_modules/@szmarczak/http-timer/dist/source/index.js +126 -0
- package/.output/server/node_modules/@szmarczak/http-timer/package.json +72 -0
- package/.output/server/node_modules/@trpc/server/dist/http.mjs +7 -0
- package/.output/server/node_modules/@trpc/server/dist/index.mjs +11 -0
- package/.output/server/node_modules/@trpc/server/dist/observable/observable.mjs +175 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/createProxy.mjs +73 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/TRPCError.mjs +78 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/formatter.mjs +5 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/getErrorShape.mjs +29 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/contentType.mjs +224 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/contentTypeParsers.mjs +12 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +76 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/isAbortError.mjs +7 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/parseConnectionParams.mjs +39 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/resolveResponse.mjs +569 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/initTRPC.mjs +80 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/middleware.mjs +90 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/parser.mjs +40 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs +194 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/rootConfig.mjs +6 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/router.mjs +176 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/rpc/codes.mjs +54 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/jsonl.mjs +631 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/sse.mjs +355 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/tracked.mjs +25 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/asyncIterable.mjs +167 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/createDeferred.mjs +15 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/disposable.mjs +41 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/readableStreamFrom.mjs +23 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/timerResource.mjs +23 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/stream/utils/withPing.mjs +127 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/transformer.mjs +101 -0
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import/utils.mjs +83 -0
- package/.output/server/node_modules/@trpc/server/dist/vendor/unpromise/unpromise.mjs +289 -0
- package/.output/server/node_modules/@trpc/server/package.json +156 -0
- package/.output/server/node_modules/@unhead/dom/dist/index.mjs +197 -0
- package/.output/server/node_modules/@unhead/dom/package.json +40 -0
- package/.output/server/node_modules/@unhead/shared/dist/index.mjs +731 -0
- package/.output/server/node_modules/@unhead/shared/package.json +47 -0
- package/.output/server/node_modules/@unhead/ssr/dist/index.mjs +95 -0
- package/.output/server/node_modules/@unhead/ssr/package.json +40 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6690 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +686 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1404 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1789 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6654 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1669 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +857 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +594 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/acorn/dist/acorn.mjs +6145 -0
- package/.output/server/node_modules/acorn/package.json +50 -0
- package/.output/server/node_modules/better-lock/dist/better_lock.js +377 -0
- package/.output/server/node_modules/better-lock/dist/errors.js +136 -0
- package/.output/server/node_modules/better-lock/dist/index.js +28 -0
- package/.output/server/node_modules/better-lock/dist/internals.js +75 -0
- package/.output/server/node_modules/better-lock/dist/tools.js +109 -0
- package/.output/server/node_modules/better-lock/package.json +60 -0
- package/.output/server/node_modules/cacheable-lookup/package.json +45 -0
- package/.output/server/node_modules/cacheable-lookup/source/index.js +436 -0
- package/.output/server/node_modules/cacheable-request/package.json +56 -0
- package/.output/server/node_modules/cacheable-request/src/index.js +251 -0
- package/.output/server/node_modules/clone-response/package.json +41 -0
- package/.output/server/node_modules/clone-response/src/index.js +17 -0
- package/.output/server/node_modules/confbox/dist/index.mjs +1 -0
- package/.output/server/node_modules/confbox/dist/json5.mjs +14 -0
- package/.output/server/node_modules/confbox/dist/shared/confbox.9388d834.mjs +1 -0
- package/.output/server/node_modules/confbox/dist/shared/confbox.f9f03f05.mjs +7 -0
- package/.output/server/node_modules/confbox/dist/toml.mjs +239 -0
- package/.output/server/node_modules/confbox/dist/yaml.mjs +32 -0
- package/.output/server/node_modules/confbox/package.json +86 -0
- package/.output/server/node_modules/consola/dist/core.mjs +410 -0
- package/.output/server/node_modules/consola/package.json +101 -0
- package/.output/server/node_modules/cross-spawn/index.js +39 -0
- package/.output/server/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/.output/server/node_modules/cross-spawn/lib/parse.js +91 -0
- package/.output/server/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/.output/server/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/.output/server/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/.output/server/node_modules/cross-spawn/package.json +73 -0
- package/.output/server/node_modules/decompress-response/index.js +58 -0
- package/.output/server/node_modules/decompress-response/package.json +56 -0
- package/.output/server/node_modules/defer-to-connect/dist/source/index.js +47 -0
- package/.output/server/node_modules/defer-to-connect/package.json +71 -0
- package/.output/server/node_modules/dettle/dist/debounce.js +91 -0
- package/.output/server/node_modules/dettle/dist/index.js +5 -0
- package/.output/server/node_modules/dettle/dist/throttle.js +12 -0
- package/.output/server/node_modules/dettle/package.json +28 -0
- package/.output/server/node_modules/devalue/index.js +3 -0
- package/.output/server/node_modules/devalue/package.json +34 -0
- package/.output/server/node_modules/devalue/src/base64.js +110 -0
- package/.output/server/node_modules/devalue/src/constants.js +6 -0
- package/.output/server/node_modules/devalue/src/parse.js +160 -0
- package/.output/server/node_modules/devalue/src/stringify.js +232 -0
- package/.output/server/node_modules/devalue/src/uneval.js +351 -0
- package/.output/server/node_modules/devalue/src/utils.js +113 -0
- package/.output/server/node_modules/dotenv/config.js +9 -0
- package/.output/server/node_modules/dotenv/lib/cli-options.js +11 -0
- package/.output/server/node_modules/dotenv/lib/env-options.js +24 -0
- package/.output/server/node_modules/dotenv/lib/main.js +361 -0
- package/.output/server/node_modules/dotenv/package.json +61 -0
- package/.output/server/node_modules/end-of-stream/index.js +94 -0
- package/.output/server/node_modules/end-of-stream/package.json +37 -0
- package/.output/server/node_modules/entities/lib/decode.js +536 -0
- package/.output/server/node_modules/entities/lib/decode_codepoint.js +76 -0
- package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +9 -0
- package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
- package/.output/server/node_modules/entities/package.json +90 -0
- package/.output/server/node_modules/esprima/dist/esprima.js +6709 -0
- package/.output/server/node_modules/esprima/package.json +112 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/execa/index.js +268 -0
- package/.output/server/node_modules/execa/lib/command.js +52 -0
- package/.output/server/node_modules/execa/lib/error.js +88 -0
- package/.output/server/node_modules/execa/lib/kill.js +115 -0
- package/.output/server/node_modules/execa/lib/promise.js +46 -0
- package/.output/server/node_modules/execa/lib/stdio.js +52 -0
- package/.output/server/node_modules/execa/lib/stream.js +97 -0
- package/.output/server/node_modules/execa/package.json +74 -0
- package/.output/server/node_modules/google-protobuf/google/protobuf/empty_pb.js +147 -0
- package/.output/server/node_modules/google-protobuf/google/protobuf/struct_pb.js +955 -0
- package/.output/server/node_modules/google-protobuf/google-protobuf.js +149 -0
- package/.output/server/node_modules/google-protobuf/package.json +35 -0
- package/.output/server/node_modules/got/dist/source/as-promise/create-rejection.js +30 -0
- package/.output/server/node_modules/got/dist/source/as-promise/index.js +176 -0
- package/.output/server/node_modules/got/dist/source/as-promise/normalize-arguments.js +78 -0
- package/.output/server/node_modules/got/dist/source/as-promise/parse-body.js +25 -0
- package/.output/server/node_modules/got/dist/source/as-promise/types.js +42 -0
- package/.output/server/node_modules/got/dist/source/core/calculate-retry-delay.js +29 -0
- package/.output/server/node_modules/got/dist/source/core/index.js +1505 -0
- package/.output/server/node_modules/got/dist/source/core/utils/dns-ip-version.js +17 -0
- package/.output/server/node_modules/got/dist/source/core/utils/get-body-size.js +32 -0
- package/.output/server/node_modules/got/dist/source/core/utils/get-buffer.js +16 -0
- package/.output/server/node_modules/got/dist/source/core/utils/is-form-data.js +4 -0
- package/.output/server/node_modules/got/dist/source/core/utils/is-response-ok.js +8 -0
- package/.output/server/node_modules/got/dist/source/core/utils/options-to-url.js +53 -0
- package/.output/server/node_modules/got/dist/source/core/utils/proxy-events.js +17 -0
- package/.output/server/node_modules/got/dist/source/core/utils/timed-out.js +121 -0
- package/.output/server/node_modules/got/dist/source/core/utils/unhandle.js +22 -0
- package/.output/server/node_modules/got/dist/source/core/utils/url-to-options.js +24 -0
- package/.output/server/node_modules/got/dist/source/core/utils/weakable-map.js +29 -0
- package/.output/server/node_modules/got/dist/source/create.js +240 -0
- package/.output/server/node_modules/got/dist/source/index.js +132 -0
- package/.output/server/node_modules/got/dist/source/types.js +2 -0
- package/.output/server/node_modules/got/dist/source/utils/deep-freeze.js +12 -0
- package/.output/server/node_modules/got/dist/source/utils/deprecation-warning.js +13 -0
- package/.output/server/node_modules/got/package.json +131 -0
- package/.output/server/node_modules/hookable/dist/index.mjs +290 -0
- package/.output/server/node_modules/hookable/package.json +49 -0
- package/.output/server/node_modules/http-cache-semantics/index.js +674 -0
- package/.output/server/node_modules/http-cache-semantics/package.json +18 -0
- package/.output/server/node_modules/http2-wrapper/package.json +54 -0
- package/.output/server/node_modules/http2-wrapper/source/agent.js +670 -0
- package/.output/server/node_modules/http2-wrapper/source/auto.js +149 -0
- package/.output/server/node_modules/http2-wrapper/source/client-request.js +445 -0
- package/.output/server/node_modules/http2-wrapper/source/incoming-message.js +58 -0
- package/.output/server/node_modules/http2-wrapper/source/index.js +28 -0
- package/.output/server/node_modules/http2-wrapper/source/utils/calculate-server-name.js +27 -0
- package/.output/server/node_modules/http2-wrapper/source/utils/errors.js +45 -0
- package/.output/server/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +13 -0
- package/.output/server/node_modules/http2-wrapper/source/utils/proxy-events.js +7 -0
- package/.output/server/node_modules/http2-wrapper/source/utils/url-to-options.js +25 -0
- package/.output/server/node_modules/human-signals/build/src/core.js +273 -0
- package/.output/server/node_modules/human-signals/build/src/main.js +71 -0
- package/.output/server/node_modules/human-signals/build/src/realtime.js +19 -0
- package/.output/server/node_modules/human-signals/build/src/signals.js +35 -0
- package/.output/server/node_modules/human-signals/package.json +64 -0
- package/.output/server/node_modules/import-meta-resolve/index.js +47 -0
- package/.output/server/node_modules/import-meta-resolve/lib/errors.js +507 -0
- package/.output/server/node_modules/import-meta-resolve/lib/get-format.js +159 -0
- package/.output/server/node_modules/import-meta-resolve/lib/package-json-reader.js +177 -0
- package/.output/server/node_modules/import-meta-resolve/lib/resolve.js +1297 -0
- package/.output/server/node_modules/import-meta-resolve/lib/utils.js +47 -0
- package/.output/server/node_modules/import-meta-resolve/package.json +95 -0
- package/.output/server/node_modules/is-stream/index.js +28 -0
- package/.output/server/node_modules/is-stream/package.json +42 -0
- package/.output/server/node_modules/isexe/index.js +57 -0
- package/.output/server/node_modules/isexe/mode.js +41 -0
- package/.output/server/node_modules/isexe/package.json +31 -0
- package/.output/server/node_modules/isexe/windows.js +42 -0
- package/.output/server/node_modules/js-yaml/index.js +7 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/loader.js +1644 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
- package/.output/server/node_modules/js-yaml/lib/js-yaml.js +39 -0
- package/.output/server/node_modules/js-yaml/package.json +49 -0
- package/.output/server/node_modules/json-buffer/index.js +58 -0
- package/.output/server/node_modules/json-buffer/package.json +34 -0
- package/.output/server/node_modules/keyv/package.json +57 -0
- package/.output/server/node_modules/keyv/src/index.js +259 -0
- package/.output/server/node_modules/lodash.camelcase/index.js +599 -0
- package/.output/server/node_modules/lodash.camelcase/package.json +19 -0
- package/.output/server/node_modules/long/package.json +50 -0
- package/.output/server/node_modules/long/umd/index.js +1432 -0
- package/.output/server/node_modules/long/umd/package.json +3 -0
- package/.output/server/node_modules/lowercase-keys/index.js +10 -0
- package/.output/server/node_modules/lowercase-keys/package.json +38 -0
- package/.output/server/node_modules/merge-stream/index.js +41 -0
- package/.output/server/node_modules/merge-stream/package.json +19 -0
- package/.output/server/node_modules/mimic-fn/index.js +13 -0
- package/.output/server/node_modules/mimic-fn/package.json +42 -0
- package/.output/server/node_modules/mlly/dist/index.mjs +2606 -0
- package/.output/server/node_modules/mlly/package.json +50 -0
- package/.output/server/node_modules/normalize-url/index.js +216 -0
- package/.output/server/node_modules/normalize-url/package.json +50 -0
- package/.output/server/node_modules/npm-run-path/index.js +47 -0
- package/.output/server/node_modules/npm-run-path/package.json +44 -0
- package/.output/server/node_modules/nypm/dist/index.mjs +306 -0
- package/.output/server/node_modules/nypm/package.json +60 -0
- package/.output/server/node_modules/once/once.js +42 -0
- package/.output/server/node_modules/once/package.json +33 -0
- package/.output/server/node_modules/onetime/index.js +44 -0
- package/.output/server/node_modules/onetime/package.json +43 -0
- package/.output/server/node_modules/p-cancelable/index.js +111 -0
- package/.output/server/node_modules/p-cancelable/package.json +49 -0
- package/.output/server/node_modules/path-key/index.js +16 -0
- package/.output/server/node_modules/path-key/package.json +39 -0
- package/.output/server/node_modules/pathe/dist/index.mjs +1 -0
- package/.output/server/node_modules/pathe/dist/shared/pathe.ff20891b.mjs +221 -0
- package/.output/server/node_modules/pathe/package.json +48 -0
- package/.output/server/node_modules/pkg-types/dist/index.mjs +156 -0
- package/.output/server/node_modules/pkg-types/package.json +47 -0
- package/.output/server/node_modules/promise-make-counter/dist/index.js +24 -0
- package/.output/server/node_modules/promise-make-counter/package.json +32 -0
- package/.output/server/node_modules/promise-make-naked/dist/index.js +25 -0
- package/.output/server/node_modules/promise-make-naked/dist/utils.js +4 -0
- package/.output/server/node_modules/promise-make-naked/package.json +27 -0
- package/.output/server/node_modules/protobufjs/ext/descriptor/index.js +1052 -0
- package/.output/server/node_modules/protobufjs/google/protobuf/api.json +118 -0
- package/.output/server/node_modules/protobufjs/google/protobuf/descriptor.json +739 -0
- package/.output/server/node_modules/protobufjs/google/protobuf/source_context.json +20 -0
- package/.output/server/node_modules/protobufjs/google/protobuf/type.json +202 -0
- package/.output/server/node_modules/protobufjs/index.js +4 -0
- package/.output/server/node_modules/protobufjs/package.json +112 -0
- package/.output/server/node_modules/protobufjs/src/common.js +399 -0
- package/.output/server/node_modules/protobufjs/src/converter.js +301 -0
- package/.output/server/node_modules/protobufjs/src/decoder.js +129 -0
- package/.output/server/node_modules/protobufjs/src/encoder.js +100 -0
- package/.output/server/node_modules/protobufjs/src/enum.js +198 -0
- package/.output/server/node_modules/protobufjs/src/field.js +377 -0
- package/.output/server/node_modules/protobufjs/src/index-light.js +104 -0
- package/.output/server/node_modules/protobufjs/src/index-minimal.js +36 -0
- package/.output/server/node_modules/protobufjs/src/index.js +12 -0
- package/.output/server/node_modules/protobufjs/src/mapfield.js +126 -0
- package/.output/server/node_modules/protobufjs/src/message.js +139 -0
- package/.output/server/node_modules/protobufjs/src/method.js +160 -0
- package/.output/server/node_modules/protobufjs/src/namespace.js +433 -0
- package/.output/server/node_modules/protobufjs/src/object.js +243 -0
- package/.output/server/node_modules/protobufjs/src/oneof.js +203 -0
- package/.output/server/node_modules/protobufjs/src/parse.js +893 -0
- package/.output/server/node_modules/protobufjs/src/reader.js +416 -0
- package/.output/server/node_modules/protobufjs/src/reader_buffer.js +51 -0
- package/.output/server/node_modules/protobufjs/src/root.js +368 -0
- package/.output/server/node_modules/protobufjs/src/roots.js +18 -0
- package/.output/server/node_modules/protobufjs/src/rpc/service.js +142 -0
- package/.output/server/node_modules/protobufjs/src/rpc.js +36 -0
- package/.output/server/node_modules/protobufjs/src/service.js +167 -0
- package/.output/server/node_modules/protobufjs/src/tokenize.js +416 -0
- package/.output/server/node_modules/protobufjs/src/type.js +589 -0
- package/.output/server/node_modules/protobufjs/src/types.js +196 -0
- package/.output/server/node_modules/protobufjs/src/util/longbits.js +200 -0
- package/.output/server/node_modules/protobufjs/src/util/minimal.js +438 -0
- package/.output/server/node_modules/protobufjs/src/util.js +212 -0
- package/.output/server/node_modules/protobufjs/src/verifier.js +177 -0
- package/.output/server/node_modules/protobufjs/src/wrappers.js +102 -0
- package/.output/server/node_modules/protobufjs/src/writer.js +465 -0
- package/.output/server/node_modules/protobufjs/src/writer_buffer.js +85 -0
- package/.output/server/node_modules/pump/index.js +86 -0
- package/.output/server/node_modules/pump/package.json +24 -0
- package/.output/server/node_modules/quick-lru/index.js +123 -0
- package/.output/server/node_modules/quick-lru/package.json +43 -0
- package/.output/server/node_modules/remeda/dist/chunk-23J5WHPE.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-2H7222YL.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-2TTHCYUC.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-3AO76THC.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-3MWN2VHC.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-3X47EJDR.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-54BCGHSM.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-5DU4ITSF.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-5G3KY7YR.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-5K4XWC27.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-5LYW332I.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-5O3FBXU6.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-5VD5RID3.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-6GTAPB47.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-6HBEBUDI.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-6IHL7GXT.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-6MJCR2TC.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-73TZMTEA.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-7BKSRZNG.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-7EFS5WOU.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-7KI2QQIQ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-7LYAC624.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-7QX4DO53.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-7ROMSESG.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-A3FCILQE.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-ANXBDSUI.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-ATQJ6737.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-AWX7RJXY.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-BLEEZ23Z.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-BO3LQZNF.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-BONXESQ2.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-BQ7TSIFE.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-BTFWISLJ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-BYFE4FDX.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-BZNENX2T.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-C4ACUJGS.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-C4OSHTCI.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-C6IMN7SF.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-CAZXBO45.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-CETFG6TX.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-CGDTCOHY.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-CGU6DJQK.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-COZRMC32.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-DAHUGBAA.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-DAQH7UR3.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-DEVKGLTN.js +2 -0
- package/.output/server/node_modules/remeda/dist/chunk-DH3BPT6T.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-DSLWSGID.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-DUDVLQA2.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-E3EM3KJY.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-E5GMYZMA.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-EJCQEWX4.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-EKGXROMD.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-EM24PB7A.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-EMIEIAAH.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-ENOHV5LT.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-ENXBNJ36.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-F6MOVT3B.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-FB2ENREB.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-FDH4IRIM.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-FFFVS7XT.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-FJ47D26D.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-FMPZ2CLX.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-FTGV3QMT.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-FW6RZCGF.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-G4OU46SC.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-GJJNKHO2.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-GK5I7C4J.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-H2MMZB4H.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-HBSRBOZK.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-HJSE3ESO.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-HO4FFX2R.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-HQOQUMZV.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-HV3WACXG.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-I3D2BSWJ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-I76XIBD5.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-ICQWNDYD.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-IEE7G5JG.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-IFSMCGFE.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-IUVYQYF2.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-J3IRE4DI.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-JET27MOQ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-JJZ7E4YG.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-JK3VNB42.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-JWKJXNB2.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-JYNHUNML.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-K26VP6CL.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-K3UJMX27.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-K5HTIQFL.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-K5LCXBBG.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-KCAOR2LA.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-KIA3HX3M.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-KQINSXIJ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-KSDEFWLH.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-LAI77QME.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-LFEOZTJ2.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-LIVAT3FO.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-LKOWEUPS.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-MD7HNZ54.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-MQWMWXZY.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-N4JUOEMS.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-NGEN63UD.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-NJXNQM3G.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-NMC53JVB.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-NMJS7ULY.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-NP7PEDI6.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-OC26KGXM.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-OEI2BOBZ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-OIQJEOF7.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-OWH4IQQW.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-OYJAL6JK.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-PJOV2RDB.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-PULGOXDA.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-PWMUXL7T.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-PZOXR343.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-QEKOZYJ5.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-R72GEKLP.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-RAAYCPUM.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-RBODUO3Q.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-RIKUOZVG.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-RLZQTLGN.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-RTWSSDNQ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-RU7WR4KH.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-RUHQUI2Z.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-RXDTYBQM.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-S23N53O3.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-S3CYJTB5.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-SFZGYJFI.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-SGAFZVQH.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-SIBGEYD6.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-SIQPZPLZ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-SOGKZP3K.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-T5XG33UI.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-TOHMEB3C.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-U2GFW3LV.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-U54ONDS6.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-U753ZCO5.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-UA6DVSZ3.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-UEZTW4YU.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-UIZMRUOL.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-UWLP4KOD.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-V6HCOU6T.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-VBBPTWMC.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-VCURCCIJ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-VCYTMP4D.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-VFKB5IBK.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-VFSOOVKJ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-VMV5GVZ5.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-VPCXVUT7.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-W2HQ33EO.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-W3QI2BKC.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-WIMS2EYK.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-WT5BLBHJ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-WY3JJUR4.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-WZSGNJRX.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-X5E5CJJQ.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-XBEN2OB2.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-XJHR6NID.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-XMLUDZIW.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-XSF7OVJO.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-XZ6COQKM.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-Y67GVJD3.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-YL2OFO3L.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-YVMG2XEU.js +1 -0
- package/.output/server/node_modules/remeda/dist/chunk-ZF7KX2VP.js +1 -0
- package/.output/server/node_modules/remeda/dist/index.js +1 -0
- package/.output/server/node_modules/remeda/package.json +88 -0
- package/.output/server/node_modules/resolve-alpn/index.js +43 -0
- package/.output/server/node_modules/resolve-alpn/package.json +34 -0
- package/.output/server/node_modules/responselike/package.json +39 -0
- package/.output/server/node_modules/responselike/src/index.js +34 -0
- package/.output/server/node_modules/semver/classes/comparator.js +141 -0
- package/.output/server/node_modules/semver/classes/range.js +554 -0
- package/.output/server/node_modules/semver/classes/semver.js +302 -0
- package/.output/server/node_modules/semver/functions/clean.js +6 -0
- package/.output/server/node_modules/semver/functions/cmp.js +52 -0
- package/.output/server/node_modules/semver/functions/coerce.js +60 -0
- package/.output/server/node_modules/semver/functions/compare-build.js +7 -0
- package/.output/server/node_modules/semver/functions/compare-loose.js +3 -0
- package/.output/server/node_modules/semver/functions/compare.js +5 -0
- package/.output/server/node_modules/semver/functions/diff.js +65 -0
- package/.output/server/node_modules/semver/functions/eq.js +3 -0
- package/.output/server/node_modules/semver/functions/gt.js +3 -0
- package/.output/server/node_modules/semver/functions/gte.js +3 -0
- package/.output/server/node_modules/semver/functions/inc.js +19 -0
- package/.output/server/node_modules/semver/functions/lt.js +3 -0
- package/.output/server/node_modules/semver/functions/lte.js +3 -0
- package/.output/server/node_modules/semver/functions/major.js +3 -0
- package/.output/server/node_modules/semver/functions/minor.js +3 -0
- package/.output/server/node_modules/semver/functions/neq.js +3 -0
- package/.output/server/node_modules/semver/functions/parse.js +16 -0
- package/.output/server/node_modules/semver/functions/patch.js +3 -0
- package/.output/server/node_modules/semver/functions/prerelease.js +6 -0
- package/.output/server/node_modules/semver/functions/rcompare.js +3 -0
- package/.output/server/node_modules/semver/functions/rsort.js +3 -0
- package/.output/server/node_modules/semver/functions/satisfies.js +10 -0
- package/.output/server/node_modules/semver/functions/sort.js +3 -0
- package/.output/server/node_modules/semver/functions/valid.js +6 -0
- package/.output/server/node_modules/semver/index.js +89 -0
- package/.output/server/node_modules/semver/internal/constants.js +35 -0
- package/.output/server/node_modules/semver/internal/debug.js +9 -0
- package/.output/server/node_modules/semver/internal/identifiers.js +23 -0
- package/.output/server/node_modules/semver/internal/lrucache.js +40 -0
- package/.output/server/node_modules/semver/internal/parse-options.js +15 -0
- package/.output/server/node_modules/semver/internal/re.js +217 -0
- package/.output/server/node_modules/semver/package.json +77 -0
- package/.output/server/node_modules/semver/preload.js +2 -0
- package/.output/server/node_modules/semver/ranges/gtr.js +4 -0
- package/.output/server/node_modules/semver/ranges/intersects.js +7 -0
- package/.output/server/node_modules/semver/ranges/ltr.js +4 -0
- package/.output/server/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/.output/server/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/.output/server/node_modules/semver/ranges/min-version.js +61 -0
- package/.output/server/node_modules/semver/ranges/outside.js +80 -0
- package/.output/server/node_modules/semver/ranges/simplify.js +47 -0
- package/.output/server/node_modules/semver/ranges/subset.js +247 -0
- package/.output/server/node_modules/semver/ranges/to-comparators.js +8 -0
- package/.output/server/node_modules/semver/ranges/valid.js +11 -0
- package/.output/server/node_modules/shebang-command/index.js +19 -0
- package/.output/server/node_modules/shebang-command/package.json +34 -0
- package/.output/server/node_modules/shebang-regex/index.js +2 -0
- package/.output/server/node_modules/shebang-regex/package.json +35 -0
- package/.output/server/node_modules/signal-exit/index.js +202 -0
- package/.output/server/node_modules/signal-exit/package.json +38 -0
- package/.output/server/node_modules/signal-exit/signals.js +53 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/strip-final-newline/index.js +16 -0
- package/.output/server/node_modules/strip-final-newline/package.json +40 -0
- package/.output/server/node_modules/stubborn-fs/dist/attemptify.js +19 -0
- package/.output/server/node_modules/stubborn-fs/dist/constants.js +8 -0
- package/.output/server/node_modules/stubborn-fs/dist/handlers.js +36 -0
- package/.output/server/node_modules/stubborn-fs/dist/index.js +53 -0
- package/.output/server/node_modules/stubborn-fs/dist/retryify.js +46 -0
- package/.output/server/node_modules/stubborn-fs/dist/retryify_queue.js +62 -0
- package/.output/server/node_modules/stubborn-fs/package.json +28 -0
- package/.output/server/node_modules/tiny-readdir/dist/constants.js +9 -0
- package/.output/server/node_modules/tiny-readdir/dist/index.js +185 -0
- package/.output/server/node_modules/tiny-readdir/dist/utils.js +9 -0
- package/.output/server/node_modules/tiny-readdir/package.json +34 -0
- package/.output/server/node_modules/tinyexec/dist/main.js +578 -0
- package/.output/server/node_modules/tinyexec/package.json +66 -0
- package/.output/server/node_modules/tmp/lib/tmp.js +784 -0
- package/.output/server/node_modules/tmp/package.json +56 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +630 -0
- package/.output/server/node_modules/ufo/package.json +47 -0
- package/.output/server/node_modules/unhead/dist/index.mjs +748 -0
- package/.output/server/node_modules/unhead/package.json +46 -0
- package/.output/server/node_modules/upath/build/code/upath.js +171 -0
- package/.output/server/node_modules/upath/package.json +60 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +196 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +50 -0
- package/.output/server/node_modules/watcher/dist/constants.js +16 -0
- package/.output/server/node_modules/watcher/dist/enums.js +35 -0
- package/.output/server/node_modules/watcher/dist/lazy_map_set.js +81 -0
- package/.output/server/node_modules/watcher/dist/utils.js +120 -0
- package/.output/server/node_modules/watcher/dist/watcher.js +396 -0
- package/.output/server/node_modules/watcher/dist/watcher_handler.js +248 -0
- package/.output/server/node_modules/watcher/dist/watcher_locker.js +139 -0
- package/.output/server/node_modules/watcher/dist/watcher_locks_resolver.js +42 -0
- package/.output/server/node_modules/watcher/dist/watcher_poller.js +116 -0
- package/.output/server/node_modules/watcher/dist/watcher_stats.js +29 -0
- package/.output/server/node_modules/watcher/package.json +37 -0
- package/.output/server/node_modules/which/package.json +43 -0
- package/.output/server/node_modules/which/which.js +125 -0
- package/.output/server/node_modules/wrappy/package.json +29 -0
- package/.output/server/node_modules/wrappy/wrappy.js +33 -0
- package/.output/server/node_modules/zod/lib/index.mjs +4382 -0
- package/.output/server/node_modules/zod/package.json +122 -0
- package/.output/server/package.json +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,2606 @@
|
|
|
1
|
+
import { tokenizer } from 'acorn';
|
|
2
|
+
import { builtinModules, createRequire } from 'node:module';
|
|
3
|
+
import fs, { realpathSync, statSync, promises } from 'node:fs';
|
|
4
|
+
import { joinURL } from 'ufo';
|
|
5
|
+
import { normalize, isAbsolute, extname as extname$1 } from 'pathe';
|
|
6
|
+
import { readPackageJSON } from 'pkg-types';
|
|
7
|
+
import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL as pathToFileURL$1 } from 'node:url';
|
|
8
|
+
import assert from 'node:assert';
|
|
9
|
+
import process$1 from 'node:process';
|
|
10
|
+
import path, { dirname } from 'node:path';
|
|
11
|
+
import v8 from 'node:v8';
|
|
12
|
+
import { format, inspect } from 'node:util';
|
|
13
|
+
|
|
14
|
+
const BUILTIN_MODULES = new Set(builtinModules);
|
|
15
|
+
function normalizeSlash(path) {
|
|
16
|
+
return path.replace(/\\/g, "/");
|
|
17
|
+
}
|
|
18
|
+
function isObject(value) {
|
|
19
|
+
return value !== null && typeof value === "object";
|
|
20
|
+
}
|
|
21
|
+
function matchAll(regex, string, addition) {
|
|
22
|
+
const matches = [];
|
|
23
|
+
for (const match of string.matchAll(regex)) {
|
|
24
|
+
matches.push({
|
|
25
|
+
...addition,
|
|
26
|
+
...match.groups,
|
|
27
|
+
code: match[0],
|
|
28
|
+
start: match.index,
|
|
29
|
+
end: (match.index || 0) + match[0].length
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return matches;
|
|
33
|
+
}
|
|
34
|
+
function clearImports(imports) {
|
|
35
|
+
return (imports || "").replace(/(\/\/[^\n]*\n|\/\*.*\*\/)/g, "").replace(/\s+/g, " ");
|
|
36
|
+
}
|
|
37
|
+
function getImportNames(cleanedImports) {
|
|
38
|
+
const topLevelImports = cleanedImports.replace(/{([^}]*)}/, "");
|
|
39
|
+
const namespacedImport = topLevelImports.match(/\* as \s*(\S*)/)?.[1];
|
|
40
|
+
const defaultImport = topLevelImports.split(",").find((index) => !/[*{}]/.test(index))?.trim() || void 0;
|
|
41
|
+
return {
|
|
42
|
+
namespacedImport,
|
|
43
|
+
defaultImport
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @typedef ErrnoExceptionFields
|
|
49
|
+
* @property {number | undefined} [errnode]
|
|
50
|
+
* @property {string | undefined} [code]
|
|
51
|
+
* @property {string | undefined} [path]
|
|
52
|
+
* @property {string | undefined} [syscall]
|
|
53
|
+
* @property {string | undefined} [url]
|
|
54
|
+
*
|
|
55
|
+
* @typedef {Error & ErrnoExceptionFields} ErrnoException
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
const own$1 = {}.hasOwnProperty;
|
|
60
|
+
|
|
61
|
+
const classRegExp = /^([A-Z][a-z\d]*)+$/;
|
|
62
|
+
// Sorted by a rough estimate on most frequently used entries.
|
|
63
|
+
const kTypes = new Set([
|
|
64
|
+
'string',
|
|
65
|
+
'function',
|
|
66
|
+
'number',
|
|
67
|
+
'object',
|
|
68
|
+
// Accept 'Function' and 'Object' as alternative to the lower cased version.
|
|
69
|
+
'Function',
|
|
70
|
+
'Object',
|
|
71
|
+
'boolean',
|
|
72
|
+
'bigint',
|
|
73
|
+
'symbol'
|
|
74
|
+
]);
|
|
75
|
+
|
|
76
|
+
const codes = {};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Create a list string in the form like 'A and B' or 'A, B, ..., and Z'.
|
|
80
|
+
* We cannot use Intl.ListFormat because it's not available in
|
|
81
|
+
* --without-intl builds.
|
|
82
|
+
*
|
|
83
|
+
* @param {Array<string>} array
|
|
84
|
+
* An array of strings.
|
|
85
|
+
* @param {string} [type]
|
|
86
|
+
* The list type to be inserted before the last element.
|
|
87
|
+
* @returns {string}
|
|
88
|
+
*/
|
|
89
|
+
function formatList(array, type = 'and') {
|
|
90
|
+
return array.length < 3
|
|
91
|
+
? array.join(` ${type} `)
|
|
92
|
+
: `${array.slice(0, -1).join(', ')}, ${type} ${array[array.length - 1]}`
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** @type {Map<string, MessageFunction | string>} */
|
|
96
|
+
const messages = new Map();
|
|
97
|
+
const nodeInternalPrefix = '__node_internal_';
|
|
98
|
+
/** @type {number} */
|
|
99
|
+
let userStackTraceLimit;
|
|
100
|
+
|
|
101
|
+
codes.ERR_INVALID_ARG_TYPE = createError(
|
|
102
|
+
'ERR_INVALID_ARG_TYPE',
|
|
103
|
+
/**
|
|
104
|
+
* @param {string} name
|
|
105
|
+
* @param {Array<string> | string} expected
|
|
106
|
+
* @param {unknown} actual
|
|
107
|
+
*/
|
|
108
|
+
(name, expected, actual) => {
|
|
109
|
+
assert(typeof name === 'string', "'name' must be a string");
|
|
110
|
+
if (!Array.isArray(expected)) {
|
|
111
|
+
expected = [expected];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
let message = 'The ';
|
|
115
|
+
if (name.endsWith(' argument')) {
|
|
116
|
+
// For cases like 'first argument'
|
|
117
|
+
message += `${name} `;
|
|
118
|
+
} else {
|
|
119
|
+
const type = name.includes('.') ? 'property' : 'argument';
|
|
120
|
+
message += `"${name}" ${type} `;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
message += 'must be ';
|
|
124
|
+
|
|
125
|
+
/** @type {Array<string>} */
|
|
126
|
+
const types = [];
|
|
127
|
+
/** @type {Array<string>} */
|
|
128
|
+
const instances = [];
|
|
129
|
+
/** @type {Array<string>} */
|
|
130
|
+
const other = [];
|
|
131
|
+
|
|
132
|
+
for (const value of expected) {
|
|
133
|
+
assert(
|
|
134
|
+
typeof value === 'string',
|
|
135
|
+
'All expected entries have to be of type string'
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
if (kTypes.has(value)) {
|
|
139
|
+
types.push(value.toLowerCase());
|
|
140
|
+
} else if (classRegExp.exec(value) === null) {
|
|
141
|
+
assert(
|
|
142
|
+
value !== 'object',
|
|
143
|
+
'The value "object" should be written as "Object"'
|
|
144
|
+
);
|
|
145
|
+
other.push(value);
|
|
146
|
+
} else {
|
|
147
|
+
instances.push(value);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Special handle `object` in case other instances are allowed to outline
|
|
152
|
+
// the differences between each other.
|
|
153
|
+
if (instances.length > 0) {
|
|
154
|
+
const pos = types.indexOf('object');
|
|
155
|
+
if (pos !== -1) {
|
|
156
|
+
types.slice(pos, 1);
|
|
157
|
+
instances.push('Object');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (types.length > 0) {
|
|
162
|
+
message += `${types.length > 1 ? 'one of type' : 'of type'} ${formatList(
|
|
163
|
+
types,
|
|
164
|
+
'or'
|
|
165
|
+
)}`;
|
|
166
|
+
if (instances.length > 0 || other.length > 0) message += ' or ';
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (instances.length > 0) {
|
|
170
|
+
message += `an instance of ${formatList(instances, 'or')}`;
|
|
171
|
+
if (other.length > 0) message += ' or ';
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (other.length > 0) {
|
|
175
|
+
if (other.length > 1) {
|
|
176
|
+
message += `one of ${formatList(other, 'or')}`;
|
|
177
|
+
} else {
|
|
178
|
+
if (other[0].toLowerCase() !== other[0]) message += 'an ';
|
|
179
|
+
message += `${other[0]}`;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
message += `. Received ${determineSpecificType(actual)}`;
|
|
184
|
+
|
|
185
|
+
return message
|
|
186
|
+
},
|
|
187
|
+
TypeError
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
codes.ERR_INVALID_MODULE_SPECIFIER = createError(
|
|
191
|
+
'ERR_INVALID_MODULE_SPECIFIER',
|
|
192
|
+
/**
|
|
193
|
+
* @param {string} request
|
|
194
|
+
* @param {string} reason
|
|
195
|
+
* @param {string} [base]
|
|
196
|
+
*/
|
|
197
|
+
(request, reason, base = undefined) => {
|
|
198
|
+
return `Invalid module "${request}" ${reason}${
|
|
199
|
+
base ? ` imported from ${base}` : ''
|
|
200
|
+
}`
|
|
201
|
+
},
|
|
202
|
+
TypeError
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
206
|
+
'ERR_INVALID_PACKAGE_CONFIG',
|
|
207
|
+
/**
|
|
208
|
+
* @param {string} path
|
|
209
|
+
* @param {string} [base]
|
|
210
|
+
* @param {string} [message]
|
|
211
|
+
*/
|
|
212
|
+
(path, base, message) => {
|
|
213
|
+
return `Invalid package config ${path}${
|
|
214
|
+
base ? ` while importing ${base}` : ''
|
|
215
|
+
}${message ? `. ${message}` : ''}`
|
|
216
|
+
},
|
|
217
|
+
Error
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
codes.ERR_INVALID_PACKAGE_TARGET = createError(
|
|
221
|
+
'ERR_INVALID_PACKAGE_TARGET',
|
|
222
|
+
/**
|
|
223
|
+
* @param {string} packagePath
|
|
224
|
+
* @param {string} key
|
|
225
|
+
* @param {unknown} target
|
|
226
|
+
* @param {boolean} [isImport=false]
|
|
227
|
+
* @param {string} [base]
|
|
228
|
+
*/
|
|
229
|
+
(packagePath, key, target, isImport = false, base = undefined) => {
|
|
230
|
+
const relatedError =
|
|
231
|
+
typeof target === 'string' &&
|
|
232
|
+
!isImport &&
|
|
233
|
+
target.length > 0 &&
|
|
234
|
+
!target.startsWith('./');
|
|
235
|
+
if (key === '.') {
|
|
236
|
+
assert(isImport === false);
|
|
237
|
+
return (
|
|
238
|
+
`Invalid "exports" main target ${JSON.stringify(target)} defined ` +
|
|
239
|
+
`in the package config ${packagePath}package.json${
|
|
240
|
+
base ? ` imported from ${base}` : ''
|
|
241
|
+
}${relatedError ? '; targets must start with "./"' : ''}`
|
|
242
|
+
)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return `Invalid "${
|
|
246
|
+
isImport ? 'imports' : 'exports'
|
|
247
|
+
}" target ${JSON.stringify(
|
|
248
|
+
target
|
|
249
|
+
)} defined for '${key}' in the package config ${packagePath}package.json${
|
|
250
|
+
base ? ` imported from ${base}` : ''
|
|
251
|
+
}${relatedError ? '; targets must start with "./"' : ''}`
|
|
252
|
+
},
|
|
253
|
+
Error
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
codes.ERR_MODULE_NOT_FOUND = createError(
|
|
257
|
+
'ERR_MODULE_NOT_FOUND',
|
|
258
|
+
/**
|
|
259
|
+
* @param {string} path
|
|
260
|
+
* @param {string} base
|
|
261
|
+
* @param {boolean} [exactUrl]
|
|
262
|
+
*/
|
|
263
|
+
(path, base, exactUrl = false) => {
|
|
264
|
+
return `Cannot find ${
|
|
265
|
+
exactUrl ? 'module' : 'package'
|
|
266
|
+
} '${path}' imported from ${base}`
|
|
267
|
+
},
|
|
268
|
+
Error
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
codes.ERR_NETWORK_IMPORT_DISALLOWED = createError(
|
|
272
|
+
'ERR_NETWORK_IMPORT_DISALLOWED',
|
|
273
|
+
"import of '%s' by %s is not supported: %s",
|
|
274
|
+
Error
|
|
275
|
+
);
|
|
276
|
+
|
|
277
|
+
codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
|
|
278
|
+
'ERR_PACKAGE_IMPORT_NOT_DEFINED',
|
|
279
|
+
/**
|
|
280
|
+
* @param {string} specifier
|
|
281
|
+
* @param {string} packagePath
|
|
282
|
+
* @param {string} base
|
|
283
|
+
*/
|
|
284
|
+
(specifier, packagePath, base) => {
|
|
285
|
+
return `Package import specifier "${specifier}" is not defined${
|
|
286
|
+
packagePath ? ` in package ${packagePath}package.json` : ''
|
|
287
|
+
} imported from ${base}`
|
|
288
|
+
},
|
|
289
|
+
TypeError
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
|
293
|
+
'ERR_PACKAGE_PATH_NOT_EXPORTED',
|
|
294
|
+
/**
|
|
295
|
+
* @param {string} packagePath
|
|
296
|
+
* @param {string} subpath
|
|
297
|
+
* @param {string} [base]
|
|
298
|
+
*/
|
|
299
|
+
(packagePath, subpath, base = undefined) => {
|
|
300
|
+
if (subpath === '.')
|
|
301
|
+
return `No "exports" main defined in ${packagePath}package.json${
|
|
302
|
+
base ? ` imported from ${base}` : ''
|
|
303
|
+
}`
|
|
304
|
+
return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${
|
|
305
|
+
base ? ` imported from ${base}` : ''
|
|
306
|
+
}`
|
|
307
|
+
},
|
|
308
|
+
Error
|
|
309
|
+
);
|
|
310
|
+
|
|
311
|
+
codes.ERR_UNSUPPORTED_DIR_IMPORT = createError(
|
|
312
|
+
'ERR_UNSUPPORTED_DIR_IMPORT',
|
|
313
|
+
"Directory import '%s' is not supported " +
|
|
314
|
+
'resolving ES modules imported from %s',
|
|
315
|
+
Error
|
|
316
|
+
);
|
|
317
|
+
|
|
318
|
+
codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
|
|
319
|
+
'ERR_UNSUPPORTED_RESOLVE_REQUEST',
|
|
320
|
+
'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
|
|
321
|
+
TypeError
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
325
|
+
'ERR_UNKNOWN_FILE_EXTENSION',
|
|
326
|
+
/**
|
|
327
|
+
* @param {string} extension
|
|
328
|
+
* @param {string} path
|
|
329
|
+
*/
|
|
330
|
+
(extension, path) => {
|
|
331
|
+
return `Unknown file extension "${extension}" for ${path}`
|
|
332
|
+
},
|
|
333
|
+
TypeError
|
|
334
|
+
);
|
|
335
|
+
|
|
336
|
+
codes.ERR_INVALID_ARG_VALUE = createError(
|
|
337
|
+
'ERR_INVALID_ARG_VALUE',
|
|
338
|
+
/**
|
|
339
|
+
* @param {string} name
|
|
340
|
+
* @param {unknown} value
|
|
341
|
+
* @param {string} [reason='is invalid']
|
|
342
|
+
*/
|
|
343
|
+
(name, value, reason = 'is invalid') => {
|
|
344
|
+
let inspected = inspect(value);
|
|
345
|
+
|
|
346
|
+
if (inspected.length > 128) {
|
|
347
|
+
inspected = `${inspected.slice(0, 128)}...`;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const type = name.includes('.') ? 'property' : 'argument';
|
|
351
|
+
|
|
352
|
+
return `The ${type} '${name}' ${reason}. Received ${inspected}`
|
|
353
|
+
},
|
|
354
|
+
TypeError
|
|
355
|
+
// Note: extra classes have been shaken out.
|
|
356
|
+
// , RangeError
|
|
357
|
+
);
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Utility function for registering the error codes. Only used here. Exported
|
|
361
|
+
* *only* to allow for testing.
|
|
362
|
+
* @param {string} sym
|
|
363
|
+
* @param {MessageFunction | string} value
|
|
364
|
+
* @param {ErrorConstructor} constructor
|
|
365
|
+
* @returns {new (...parameters: Array<any>) => Error}
|
|
366
|
+
*/
|
|
367
|
+
function createError(sym, value, constructor) {
|
|
368
|
+
// Special case for SystemError that formats the error message differently
|
|
369
|
+
// The SystemErrors only have SystemError as their base classes.
|
|
370
|
+
messages.set(sym, value);
|
|
371
|
+
|
|
372
|
+
return makeNodeErrorWithCode(constructor, sym)
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* @param {ErrorConstructor} Base
|
|
377
|
+
* @param {string} key
|
|
378
|
+
* @returns {ErrorConstructor}
|
|
379
|
+
*/
|
|
380
|
+
function makeNodeErrorWithCode(Base, key) {
|
|
381
|
+
// @ts-expect-error It’s a Node error.
|
|
382
|
+
return NodeError
|
|
383
|
+
/**
|
|
384
|
+
* @param {Array<unknown>} parameters
|
|
385
|
+
*/
|
|
386
|
+
function NodeError(...parameters) {
|
|
387
|
+
const limit = Error.stackTraceLimit;
|
|
388
|
+
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
|
|
389
|
+
const error = new Base();
|
|
390
|
+
// Reset the limit and setting the name property.
|
|
391
|
+
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
|
|
392
|
+
const message = getMessage(key, parameters, error);
|
|
393
|
+
Object.defineProperties(error, {
|
|
394
|
+
// Note: no need to implement `kIsNodeError` symbol, would be hard,
|
|
395
|
+
// probably.
|
|
396
|
+
message: {
|
|
397
|
+
value: message,
|
|
398
|
+
enumerable: false,
|
|
399
|
+
writable: true,
|
|
400
|
+
configurable: true
|
|
401
|
+
},
|
|
402
|
+
toString: {
|
|
403
|
+
/** @this {Error} */
|
|
404
|
+
value() {
|
|
405
|
+
return `${this.name} [${key}]: ${this.message}`
|
|
406
|
+
},
|
|
407
|
+
enumerable: false,
|
|
408
|
+
writable: true,
|
|
409
|
+
configurable: true
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
captureLargerStackTrace(error);
|
|
414
|
+
// @ts-expect-error It’s a Node error.
|
|
415
|
+
error.code = key;
|
|
416
|
+
return error
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* @returns {boolean}
|
|
422
|
+
*/
|
|
423
|
+
function isErrorStackTraceLimitWritable() {
|
|
424
|
+
// Do no touch Error.stackTraceLimit as V8 would attempt to install
|
|
425
|
+
// it again during deserialization.
|
|
426
|
+
try {
|
|
427
|
+
if (v8.startupSnapshot.isBuildingSnapshot()) {
|
|
428
|
+
return false
|
|
429
|
+
}
|
|
430
|
+
} catch {}
|
|
431
|
+
|
|
432
|
+
const desc = Object.getOwnPropertyDescriptor(Error, 'stackTraceLimit');
|
|
433
|
+
if (desc === undefined) {
|
|
434
|
+
return Object.isExtensible(Error)
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
return own$1.call(desc, 'writable') && desc.writable !== undefined
|
|
438
|
+
? desc.writable
|
|
439
|
+
: desc.set !== undefined
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* This function removes unnecessary frames from Node.js core errors.
|
|
444
|
+
* @template {(...parameters: unknown[]) => unknown} T
|
|
445
|
+
* @param {T} wrappedFunction
|
|
446
|
+
* @returns {T}
|
|
447
|
+
*/
|
|
448
|
+
function hideStackFrames(wrappedFunction) {
|
|
449
|
+
// We rename the functions that will be hidden to cut off the stacktrace
|
|
450
|
+
// at the outermost one
|
|
451
|
+
const hidden = nodeInternalPrefix + wrappedFunction.name;
|
|
452
|
+
Object.defineProperty(wrappedFunction, 'name', {value: hidden});
|
|
453
|
+
return wrappedFunction
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const captureLargerStackTrace = hideStackFrames(
|
|
457
|
+
/**
|
|
458
|
+
* @param {Error} error
|
|
459
|
+
* @returns {Error}
|
|
460
|
+
*/
|
|
461
|
+
// @ts-expect-error: fine
|
|
462
|
+
function (error) {
|
|
463
|
+
const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
|
|
464
|
+
if (stackTraceLimitIsWritable) {
|
|
465
|
+
userStackTraceLimit = Error.stackTraceLimit;
|
|
466
|
+
Error.stackTraceLimit = Number.POSITIVE_INFINITY;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
Error.captureStackTrace(error);
|
|
470
|
+
|
|
471
|
+
// Reset the limit
|
|
472
|
+
if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
|
|
473
|
+
|
|
474
|
+
return error
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* @param {string} key
|
|
480
|
+
* @param {Array<unknown>} parameters
|
|
481
|
+
* @param {Error} self
|
|
482
|
+
* @returns {string}
|
|
483
|
+
*/
|
|
484
|
+
function getMessage(key, parameters, self) {
|
|
485
|
+
const message = messages.get(key);
|
|
486
|
+
assert(message !== undefined, 'expected `message` to be found');
|
|
487
|
+
|
|
488
|
+
if (typeof message === 'function') {
|
|
489
|
+
assert(
|
|
490
|
+
message.length <= parameters.length, // Default options do not count.
|
|
491
|
+
`Code: ${key}; The provided arguments length (${parameters.length}) does not ` +
|
|
492
|
+
`match the required ones (${message.length}).`
|
|
493
|
+
);
|
|
494
|
+
return Reflect.apply(message, self, parameters)
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const regex = /%[dfijoOs]/g;
|
|
498
|
+
let expectedLength = 0;
|
|
499
|
+
while (regex.exec(message) !== null) expectedLength++;
|
|
500
|
+
assert(
|
|
501
|
+
expectedLength === parameters.length,
|
|
502
|
+
`Code: ${key}; The provided arguments length (${parameters.length}) does not ` +
|
|
503
|
+
`match the required ones (${expectedLength}).`
|
|
504
|
+
);
|
|
505
|
+
if (parameters.length === 0) return message
|
|
506
|
+
|
|
507
|
+
parameters.unshift(message);
|
|
508
|
+
return Reflect.apply(format, null, parameters)
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Determine the specific type of a value for type-mismatch errors.
|
|
513
|
+
* @param {unknown} value
|
|
514
|
+
* @returns {string}
|
|
515
|
+
*/
|
|
516
|
+
function determineSpecificType(value) {
|
|
517
|
+
if (value === null || value === undefined) {
|
|
518
|
+
return String(value)
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
if (typeof value === 'function' && value.name) {
|
|
522
|
+
return `function ${value.name}`
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
if (typeof value === 'object') {
|
|
526
|
+
if (value.constructor && value.constructor.name) {
|
|
527
|
+
return `an instance of ${value.constructor.name}`
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return `${inspect(value, {depth: -1})}`
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
let inspected = inspect(value, {colors: false});
|
|
534
|
+
|
|
535
|
+
if (inspected.length > 28) {
|
|
536
|
+
inspected = `${inspected.slice(0, 25)}...`;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
return `type ${typeof value} (${inspected})`
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// Manually “tree shaken” from:
|
|
543
|
+
// <https://github.com/nodejs/node/blob/7c3dce0/lib/internal/modules/package_json_reader.js>
|
|
544
|
+
// Last checked on: Apr 29, 2023.
|
|
545
|
+
// Removed the native dependency.
|
|
546
|
+
// Also: no need to cache, we do that in resolve already.
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
const hasOwnProperty$1 = {}.hasOwnProperty;
|
|
550
|
+
|
|
551
|
+
const {ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1} = codes;
|
|
552
|
+
|
|
553
|
+
/** @type {Map<string, PackageConfig>} */
|
|
554
|
+
const cache = new Map();
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* @param {string} jsonPath
|
|
558
|
+
* @param {{specifier: URL | string, base?: URL}} options
|
|
559
|
+
* @returns {PackageConfig}
|
|
560
|
+
*/
|
|
561
|
+
function read(jsonPath, {base, specifier}) {
|
|
562
|
+
const existing = cache.get(jsonPath);
|
|
563
|
+
|
|
564
|
+
if (existing) {
|
|
565
|
+
return existing
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/** @type {string | undefined} */
|
|
569
|
+
let string;
|
|
570
|
+
|
|
571
|
+
try {
|
|
572
|
+
string = fs.readFileSync(path.toNamespacedPath(jsonPath), 'utf8');
|
|
573
|
+
} catch (error) {
|
|
574
|
+
const exception = /** @type {ErrnoException} */ (error);
|
|
575
|
+
|
|
576
|
+
if (exception.code !== 'ENOENT') {
|
|
577
|
+
throw exception
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/** @type {PackageConfig} */
|
|
582
|
+
const result = {
|
|
583
|
+
exists: false,
|
|
584
|
+
pjsonPath: jsonPath,
|
|
585
|
+
main: undefined,
|
|
586
|
+
name: undefined,
|
|
587
|
+
type: 'none', // Ignore unknown types for forwards compatibility
|
|
588
|
+
exports: undefined,
|
|
589
|
+
imports: undefined
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
if (string !== undefined) {
|
|
593
|
+
/** @type {Record<string, unknown>} */
|
|
594
|
+
let parsed;
|
|
595
|
+
|
|
596
|
+
try {
|
|
597
|
+
parsed = JSON.parse(string);
|
|
598
|
+
} catch (error_) {
|
|
599
|
+
const cause = /** @type {ErrnoException} */ (error_);
|
|
600
|
+
const error = new ERR_INVALID_PACKAGE_CONFIG$1(
|
|
601
|
+
jsonPath,
|
|
602
|
+
(base ? `"${specifier}" from ` : '') + fileURLToPath$1(base || specifier),
|
|
603
|
+
cause.message
|
|
604
|
+
);
|
|
605
|
+
error.cause = cause;
|
|
606
|
+
throw error
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
result.exists = true;
|
|
610
|
+
|
|
611
|
+
if (
|
|
612
|
+
hasOwnProperty$1.call(parsed, 'name') &&
|
|
613
|
+
typeof parsed.name === 'string'
|
|
614
|
+
) {
|
|
615
|
+
result.name = parsed.name;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
if (
|
|
619
|
+
hasOwnProperty$1.call(parsed, 'main') &&
|
|
620
|
+
typeof parsed.main === 'string'
|
|
621
|
+
) {
|
|
622
|
+
result.main = parsed.main;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
if (hasOwnProperty$1.call(parsed, 'exports')) {
|
|
626
|
+
// @ts-expect-error: assume valid.
|
|
627
|
+
result.exports = parsed.exports;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
if (hasOwnProperty$1.call(parsed, 'imports')) {
|
|
631
|
+
// @ts-expect-error: assume valid.
|
|
632
|
+
result.imports = parsed.imports;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
// Ignore unknown types for forwards compatibility
|
|
636
|
+
if (
|
|
637
|
+
hasOwnProperty$1.call(parsed, 'type') &&
|
|
638
|
+
(parsed.type === 'commonjs' || parsed.type === 'module')
|
|
639
|
+
) {
|
|
640
|
+
result.type = parsed.type;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
cache.set(jsonPath, result);
|
|
645
|
+
|
|
646
|
+
return result
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* @param {URL | string} resolved
|
|
651
|
+
* @returns {PackageConfig}
|
|
652
|
+
*/
|
|
653
|
+
function getPackageScopeConfig(resolved) {
|
|
654
|
+
// Note: in Node, this is now a native module.
|
|
655
|
+
let packageJSONUrl = new URL('package.json', resolved);
|
|
656
|
+
|
|
657
|
+
while (true) {
|
|
658
|
+
const packageJSONPath = packageJSONUrl.pathname;
|
|
659
|
+
if (packageJSONPath.endsWith('node_modules/package.json')) {
|
|
660
|
+
break
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
const packageConfig = read(fileURLToPath$1(packageJSONUrl), {
|
|
664
|
+
specifier: resolved
|
|
665
|
+
});
|
|
666
|
+
|
|
667
|
+
if (packageConfig.exists) {
|
|
668
|
+
return packageConfig
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
const lastPackageJSONUrl = packageJSONUrl;
|
|
672
|
+
packageJSONUrl = new URL('../package.json', packageJSONUrl);
|
|
673
|
+
|
|
674
|
+
// Terminates at root where ../package.json equals ../../package.json
|
|
675
|
+
// (can't just check "/package.json" for Windows support).
|
|
676
|
+
if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
|
|
677
|
+
break
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
const packageJSONPath = fileURLToPath$1(packageJSONUrl);
|
|
682
|
+
// ^^ Note: in Node, this is now a native module.
|
|
683
|
+
|
|
684
|
+
return {
|
|
685
|
+
pjsonPath: packageJSONPath,
|
|
686
|
+
exists: false,
|
|
687
|
+
type: 'none'
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Returns the package type for a given URL.
|
|
693
|
+
* @param {URL} url - The URL to get the package type for.
|
|
694
|
+
* @returns {PackageType}
|
|
695
|
+
*/
|
|
696
|
+
function getPackageType(url) {
|
|
697
|
+
// To do @anonrig: Write a C++ function that returns only "type".
|
|
698
|
+
return getPackageScopeConfig(url).type
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
// Manually “tree shaken” from:
|
|
702
|
+
// <https://github.com/nodejs/node/blob/7c3dce0/lib/internal/modules/esm/get_format.js>
|
|
703
|
+
// Last checked on: Apr 29, 2023.
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
const {ERR_UNKNOWN_FILE_EXTENSION} = codes;
|
|
707
|
+
|
|
708
|
+
const hasOwnProperty = {}.hasOwnProperty;
|
|
709
|
+
|
|
710
|
+
/** @type {Record<string, string>} */
|
|
711
|
+
const extensionFormatMap = {
|
|
712
|
+
// @ts-expect-error: hush.
|
|
713
|
+
__proto__: null,
|
|
714
|
+
'.cjs': 'commonjs',
|
|
715
|
+
'.js': 'module',
|
|
716
|
+
'.json': 'json',
|
|
717
|
+
'.mjs': 'module'
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* @param {string | null} mime
|
|
722
|
+
* @returns {string | null}
|
|
723
|
+
*/
|
|
724
|
+
function mimeToFormat(mime) {
|
|
725
|
+
if (
|
|
726
|
+
mime &&
|
|
727
|
+
/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)
|
|
728
|
+
)
|
|
729
|
+
return 'module'
|
|
730
|
+
if (mime === 'application/json') return 'json'
|
|
731
|
+
return null
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* @callback ProtocolHandler
|
|
736
|
+
* @param {URL} parsed
|
|
737
|
+
* @param {{parentURL: string, source?: Buffer}} context
|
|
738
|
+
* @param {boolean} ignoreErrors
|
|
739
|
+
* @returns {string | null | void}
|
|
740
|
+
*/
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* @type {Record<string, ProtocolHandler>}
|
|
744
|
+
*/
|
|
745
|
+
const protocolHandlers = {
|
|
746
|
+
// @ts-expect-error: hush.
|
|
747
|
+
__proto__: null,
|
|
748
|
+
'data:': getDataProtocolModuleFormat,
|
|
749
|
+
'file:': getFileProtocolModuleFormat,
|
|
750
|
+
'http:': getHttpProtocolModuleFormat,
|
|
751
|
+
'https:': getHttpProtocolModuleFormat,
|
|
752
|
+
'node:'() {
|
|
753
|
+
return 'builtin'
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* @param {URL} parsed
|
|
759
|
+
*/
|
|
760
|
+
function getDataProtocolModuleFormat(parsed) {
|
|
761
|
+
const {1: mime} = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(
|
|
762
|
+
parsed.pathname
|
|
763
|
+
) || [null, null, null];
|
|
764
|
+
return mimeToFormat(mime)
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Returns the file extension from a URL.
|
|
769
|
+
*
|
|
770
|
+
* Should give similar result to
|
|
771
|
+
* `require('node:path').extname(require('node:url').fileURLToPath(url))`
|
|
772
|
+
* when used with a `file:` URL.
|
|
773
|
+
*
|
|
774
|
+
* @param {URL} url
|
|
775
|
+
* @returns {string}
|
|
776
|
+
*/
|
|
777
|
+
function extname(url) {
|
|
778
|
+
const pathname = url.pathname;
|
|
779
|
+
let index = pathname.length;
|
|
780
|
+
|
|
781
|
+
while (index--) {
|
|
782
|
+
const code = pathname.codePointAt(index);
|
|
783
|
+
|
|
784
|
+
if (code === 47 /* `/` */) {
|
|
785
|
+
return ''
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
if (code === 46 /* `.` */) {
|
|
789
|
+
return pathname.codePointAt(index - 1) === 47 /* `/` */
|
|
790
|
+
? ''
|
|
791
|
+
: pathname.slice(index)
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
return ''
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* @type {ProtocolHandler}
|
|
800
|
+
*/
|
|
801
|
+
function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
802
|
+
const value = extname(url);
|
|
803
|
+
|
|
804
|
+
if (value === '.js') {
|
|
805
|
+
const packageType = getPackageType(url);
|
|
806
|
+
|
|
807
|
+
if (packageType !== 'none') {
|
|
808
|
+
return packageType
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
return 'commonjs'
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
if (value === '') {
|
|
815
|
+
const packageType = getPackageType(url);
|
|
816
|
+
|
|
817
|
+
// Legacy behavior
|
|
818
|
+
if (packageType === 'none' || packageType === 'commonjs') {
|
|
819
|
+
return 'commonjs'
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// Note: we don’t implement WASM, so we don’t need
|
|
823
|
+
// `getFormatOfExtensionlessFile` from `formats`.
|
|
824
|
+
return 'module'
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
const format = extensionFormatMap[value];
|
|
828
|
+
if (format) return format
|
|
829
|
+
|
|
830
|
+
// Explicit undefined return indicates load hook should rerun format check
|
|
831
|
+
if (ignoreErrors) {
|
|
832
|
+
return undefined
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
const filepath = fileURLToPath$1(url);
|
|
836
|
+
throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath)
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
function getHttpProtocolModuleFormat() {
|
|
840
|
+
// To do: HTTPS imports.
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* @param {URL} url
|
|
845
|
+
* @param {{parentURL: string}} context
|
|
846
|
+
* @returns {string | null}
|
|
847
|
+
*/
|
|
848
|
+
function defaultGetFormatWithoutErrors(url, context) {
|
|
849
|
+
const protocol = url.protocol;
|
|
850
|
+
|
|
851
|
+
if (!hasOwnProperty.call(protocolHandlers, protocol)) {
|
|
852
|
+
return null
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
return protocolHandlers[protocol](url, context, true) || null
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
// Manually “tree shaken” from:
|
|
859
|
+
// <https://github.com/nodejs/node/blob/81a9a97/lib/internal/modules/esm/resolve.js>
|
|
860
|
+
// Last checked on: Apr 29, 2023.
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
|
|
864
|
+
|
|
865
|
+
const {
|
|
866
|
+
ERR_NETWORK_IMPORT_DISALLOWED,
|
|
867
|
+
ERR_INVALID_MODULE_SPECIFIER,
|
|
868
|
+
ERR_INVALID_PACKAGE_CONFIG,
|
|
869
|
+
ERR_INVALID_PACKAGE_TARGET,
|
|
870
|
+
ERR_MODULE_NOT_FOUND,
|
|
871
|
+
ERR_PACKAGE_IMPORT_NOT_DEFINED,
|
|
872
|
+
ERR_PACKAGE_PATH_NOT_EXPORTED,
|
|
873
|
+
ERR_UNSUPPORTED_DIR_IMPORT,
|
|
874
|
+
ERR_UNSUPPORTED_RESOLVE_REQUEST
|
|
875
|
+
} = codes;
|
|
876
|
+
|
|
877
|
+
const own = {}.hasOwnProperty;
|
|
878
|
+
|
|
879
|
+
const invalidSegmentRegEx =
|
|
880
|
+
/(^|\\|\/)((\.|%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;
|
|
881
|
+
const deprecatedInvalidSegmentRegEx =
|
|
882
|
+
/(^|\\|\/)((\.|%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;
|
|
883
|
+
const invalidPackageNameRegEx = /^\.|%|\\/;
|
|
884
|
+
const patternRegEx = /\*/g;
|
|
885
|
+
const encodedSeparatorRegEx = /%2f|%5c/i;
|
|
886
|
+
/** @type {Set<string>} */
|
|
887
|
+
const emittedPackageWarnings = new Set();
|
|
888
|
+
|
|
889
|
+
const doubleSlashRegEx = /[/\\]{2}/;
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
*
|
|
893
|
+
* @param {string} target
|
|
894
|
+
* @param {string} request
|
|
895
|
+
* @param {string} match
|
|
896
|
+
* @param {URL} packageJsonUrl
|
|
897
|
+
* @param {boolean} internal
|
|
898
|
+
* @param {URL} base
|
|
899
|
+
* @param {boolean} isTarget
|
|
900
|
+
*/
|
|
901
|
+
function emitInvalidSegmentDeprecation(
|
|
902
|
+
target,
|
|
903
|
+
request,
|
|
904
|
+
match,
|
|
905
|
+
packageJsonUrl,
|
|
906
|
+
internal,
|
|
907
|
+
base,
|
|
908
|
+
isTarget
|
|
909
|
+
) {
|
|
910
|
+
// @ts-expect-error: apparently it does exist, TS.
|
|
911
|
+
if (process$1.noDeprecation) {
|
|
912
|
+
return
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
const pjsonPath = fileURLToPath$1(packageJsonUrl);
|
|
916
|
+
const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
|
|
917
|
+
process$1.emitWarning(
|
|
918
|
+
`Use of deprecated ${
|
|
919
|
+
double ? 'double slash' : 'leading or trailing slash matching'
|
|
920
|
+
} resolving "${target}" for module ` +
|
|
921
|
+
`request "${request}" ${
|
|
922
|
+
request === match ? '' : `matched to "${match}" `
|
|
923
|
+
}in the "${
|
|
924
|
+
internal ? 'imports' : 'exports'
|
|
925
|
+
}" field module resolution of the package at ${pjsonPath}${
|
|
926
|
+
base ? ` imported from ${fileURLToPath$1(base)}` : ''
|
|
927
|
+
}.`,
|
|
928
|
+
'DeprecationWarning',
|
|
929
|
+
'DEP0166'
|
|
930
|
+
);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* @param {URL} url
|
|
935
|
+
* @param {URL} packageJsonUrl
|
|
936
|
+
* @param {URL} base
|
|
937
|
+
* @param {string} [main]
|
|
938
|
+
* @returns {void}
|
|
939
|
+
*/
|
|
940
|
+
function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
941
|
+
// @ts-expect-error: apparently it does exist, TS.
|
|
942
|
+
if (process$1.noDeprecation) {
|
|
943
|
+
return
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
const format = defaultGetFormatWithoutErrors(url, {parentURL: base.href});
|
|
947
|
+
if (format !== 'module') return
|
|
948
|
+
const urlPath = fileURLToPath$1(url.href);
|
|
949
|
+
const packagePath = fileURLToPath$1(new URL$1('.', packageJsonUrl));
|
|
950
|
+
const basePath = fileURLToPath$1(base);
|
|
951
|
+
if (!main) {
|
|
952
|
+
process$1.emitWarning(
|
|
953
|
+
`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(
|
|
954
|
+
packagePath.length
|
|
955
|
+
)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`,
|
|
956
|
+
'DeprecationWarning',
|
|
957
|
+
'DEP0151'
|
|
958
|
+
);
|
|
959
|
+
} else if (path.resolve(packagePath, main) !== urlPath) {
|
|
960
|
+
process$1.emitWarning(
|
|
961
|
+
`Package ${packagePath} has a "main" field set to "${main}", ` +
|
|
962
|
+
`excluding the full filename and extension to the resolved file at "${urlPath.slice(
|
|
963
|
+
packagePath.length
|
|
964
|
+
)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is ` +
|
|
965
|
+
'deprecated for ES modules.',
|
|
966
|
+
'DeprecationWarning',
|
|
967
|
+
'DEP0151'
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* @param {string} path
|
|
974
|
+
* @returns {Stats | undefined}
|
|
975
|
+
*/
|
|
976
|
+
function tryStatSync(path) {
|
|
977
|
+
// Note: from Node 15 onwards we can use `throwIfNoEntry: false` instead.
|
|
978
|
+
try {
|
|
979
|
+
return statSync(path)
|
|
980
|
+
} catch {
|
|
981
|
+
// Note: in Node code this returns `new Stats`,
|
|
982
|
+
// but in Node 22 that’s marked as a deprecated internal API.
|
|
983
|
+
// Which, well, we kinda are, but still to prevent that warning,
|
|
984
|
+
// just yield `undefined`.
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* Legacy CommonJS main resolution:
|
|
990
|
+
* 1. let M = pkg_url + (json main field)
|
|
991
|
+
* 2. TRY(M, M.js, M.json, M.node)
|
|
992
|
+
* 3. TRY(M/index.js, M/index.json, M/index.node)
|
|
993
|
+
* 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node)
|
|
994
|
+
* 5. NOT_FOUND
|
|
995
|
+
*
|
|
996
|
+
* @param {URL} url
|
|
997
|
+
* @returns {boolean}
|
|
998
|
+
*/
|
|
999
|
+
function fileExists(url) {
|
|
1000
|
+
const stats = statSync(url, {throwIfNoEntry: false});
|
|
1001
|
+
const isFile = stats ? stats.isFile() : undefined;
|
|
1002
|
+
return isFile === null || isFile === undefined ? false : isFile
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* @param {URL} packageJsonUrl
|
|
1007
|
+
* @param {PackageConfig} packageConfig
|
|
1008
|
+
* @param {URL} base
|
|
1009
|
+
* @returns {URL}
|
|
1010
|
+
*/
|
|
1011
|
+
function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
1012
|
+
/** @type {URL | undefined} */
|
|
1013
|
+
let guess;
|
|
1014
|
+
if (packageConfig.main !== undefined) {
|
|
1015
|
+
guess = new URL$1(packageConfig.main, packageJsonUrl);
|
|
1016
|
+
// Note: fs check redundances will be handled by Descriptor cache here.
|
|
1017
|
+
if (fileExists(guess)) return guess
|
|
1018
|
+
|
|
1019
|
+
const tries = [
|
|
1020
|
+
`./${packageConfig.main}.js`,
|
|
1021
|
+
`./${packageConfig.main}.json`,
|
|
1022
|
+
`./${packageConfig.main}.node`,
|
|
1023
|
+
`./${packageConfig.main}/index.js`,
|
|
1024
|
+
`./${packageConfig.main}/index.json`,
|
|
1025
|
+
`./${packageConfig.main}/index.node`
|
|
1026
|
+
];
|
|
1027
|
+
let i = -1;
|
|
1028
|
+
|
|
1029
|
+
while (++i < tries.length) {
|
|
1030
|
+
guess = new URL$1(tries[i], packageJsonUrl);
|
|
1031
|
+
if (fileExists(guess)) break
|
|
1032
|
+
guess = undefined;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
if (guess) {
|
|
1036
|
+
emitLegacyIndexDeprecation(
|
|
1037
|
+
guess,
|
|
1038
|
+
packageJsonUrl,
|
|
1039
|
+
base,
|
|
1040
|
+
packageConfig.main
|
|
1041
|
+
);
|
|
1042
|
+
return guess
|
|
1043
|
+
}
|
|
1044
|
+
// Fallthrough.
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
const tries = ['./index.js', './index.json', './index.node'];
|
|
1048
|
+
let i = -1;
|
|
1049
|
+
|
|
1050
|
+
while (++i < tries.length) {
|
|
1051
|
+
guess = new URL$1(tries[i], packageJsonUrl);
|
|
1052
|
+
if (fileExists(guess)) break
|
|
1053
|
+
guess = undefined;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
if (guess) {
|
|
1057
|
+
emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
|
|
1058
|
+
return guess
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
// Not found.
|
|
1062
|
+
throw new ERR_MODULE_NOT_FOUND(
|
|
1063
|
+
fileURLToPath$1(new URL$1('.', packageJsonUrl)),
|
|
1064
|
+
fileURLToPath$1(base)
|
|
1065
|
+
)
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* @param {URL} resolved
|
|
1070
|
+
* @param {URL} base
|
|
1071
|
+
* @param {boolean} [preserveSymlinks]
|
|
1072
|
+
* @returns {URL}
|
|
1073
|
+
*/
|
|
1074
|
+
function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
1075
|
+
if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) {
|
|
1076
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
1077
|
+
resolved.pathname,
|
|
1078
|
+
'must not include encoded "/" or "\\" characters',
|
|
1079
|
+
fileURLToPath$1(base)
|
|
1080
|
+
)
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/** @type {string} */
|
|
1084
|
+
let filePath;
|
|
1085
|
+
|
|
1086
|
+
try {
|
|
1087
|
+
filePath = fileURLToPath$1(resolved);
|
|
1088
|
+
} catch (error) {
|
|
1089
|
+
const cause = /** @type {ErrnoException} */ (error);
|
|
1090
|
+
Object.defineProperty(cause, 'input', {value: String(resolved)});
|
|
1091
|
+
Object.defineProperty(cause, 'module', {value: String(base)});
|
|
1092
|
+
throw cause
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
const stats = tryStatSync(
|
|
1096
|
+
filePath.endsWith('/') ? filePath.slice(-1) : filePath
|
|
1097
|
+
);
|
|
1098
|
+
|
|
1099
|
+
if (stats && stats.isDirectory()) {
|
|
1100
|
+
const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath$1(base));
|
|
1101
|
+
// @ts-expect-error Add this for `import.meta.resolve`.
|
|
1102
|
+
error.url = String(resolved);
|
|
1103
|
+
throw error
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
if (!stats || !stats.isFile()) {
|
|
1107
|
+
const error = new ERR_MODULE_NOT_FOUND(
|
|
1108
|
+
filePath || resolved.pathname,
|
|
1109
|
+
base && fileURLToPath$1(base),
|
|
1110
|
+
true
|
|
1111
|
+
);
|
|
1112
|
+
// @ts-expect-error Add this for `import.meta.resolve`.
|
|
1113
|
+
error.url = String(resolved);
|
|
1114
|
+
throw error
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
if (!preserveSymlinks) {
|
|
1118
|
+
const real = realpathSync(filePath);
|
|
1119
|
+
const {search, hash} = resolved;
|
|
1120
|
+
resolved = pathToFileURL$1(real + (filePath.endsWith(path.sep) ? '/' : ''));
|
|
1121
|
+
resolved.search = search;
|
|
1122
|
+
resolved.hash = hash;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
return resolved
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* @param {string} specifier
|
|
1130
|
+
* @param {URL | undefined} packageJsonUrl
|
|
1131
|
+
* @param {URL} base
|
|
1132
|
+
* @returns {Error}
|
|
1133
|
+
*/
|
|
1134
|
+
function importNotDefined(specifier, packageJsonUrl, base) {
|
|
1135
|
+
return new ERR_PACKAGE_IMPORT_NOT_DEFINED(
|
|
1136
|
+
specifier,
|
|
1137
|
+
packageJsonUrl && fileURLToPath$1(new URL$1('.', packageJsonUrl)),
|
|
1138
|
+
fileURLToPath$1(base)
|
|
1139
|
+
)
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* @param {string} subpath
|
|
1144
|
+
* @param {URL} packageJsonUrl
|
|
1145
|
+
* @param {URL} base
|
|
1146
|
+
* @returns {Error}
|
|
1147
|
+
*/
|
|
1148
|
+
function exportsNotFound(subpath, packageJsonUrl, base) {
|
|
1149
|
+
return new ERR_PACKAGE_PATH_NOT_EXPORTED(
|
|
1150
|
+
fileURLToPath$1(new URL$1('.', packageJsonUrl)),
|
|
1151
|
+
subpath,
|
|
1152
|
+
base && fileURLToPath$1(base)
|
|
1153
|
+
)
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* @param {string} request
|
|
1158
|
+
* @param {string} match
|
|
1159
|
+
* @param {URL} packageJsonUrl
|
|
1160
|
+
* @param {boolean} internal
|
|
1161
|
+
* @param {URL} [base]
|
|
1162
|
+
* @returns {never}
|
|
1163
|
+
*/
|
|
1164
|
+
function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
|
|
1165
|
+
const reason = `request is not a valid match in pattern "${match}" for the "${
|
|
1166
|
+
internal ? 'imports' : 'exports'
|
|
1167
|
+
}" resolution of ${fileURLToPath$1(packageJsonUrl)}`;
|
|
1168
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
1169
|
+
request,
|
|
1170
|
+
reason,
|
|
1171
|
+
base && fileURLToPath$1(base)
|
|
1172
|
+
)
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* @param {string} subpath
|
|
1177
|
+
* @param {unknown} target
|
|
1178
|
+
* @param {URL} packageJsonUrl
|
|
1179
|
+
* @param {boolean} internal
|
|
1180
|
+
* @param {URL} [base]
|
|
1181
|
+
* @returns {Error}
|
|
1182
|
+
*/
|
|
1183
|
+
function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
|
|
1184
|
+
target =
|
|
1185
|
+
typeof target === 'object' && target !== null
|
|
1186
|
+
? JSON.stringify(target, null, '')
|
|
1187
|
+
: `${target}`;
|
|
1188
|
+
|
|
1189
|
+
return new ERR_INVALID_PACKAGE_TARGET(
|
|
1190
|
+
fileURLToPath$1(new URL$1('.', packageJsonUrl)),
|
|
1191
|
+
subpath,
|
|
1192
|
+
target,
|
|
1193
|
+
internal,
|
|
1194
|
+
base && fileURLToPath$1(base)
|
|
1195
|
+
)
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* @param {string} target
|
|
1200
|
+
* @param {string} subpath
|
|
1201
|
+
* @param {string} match
|
|
1202
|
+
* @param {URL} packageJsonUrl
|
|
1203
|
+
* @param {URL} base
|
|
1204
|
+
* @param {boolean} pattern
|
|
1205
|
+
* @param {boolean} internal
|
|
1206
|
+
* @param {boolean} isPathMap
|
|
1207
|
+
* @param {Set<string> | undefined} conditions
|
|
1208
|
+
* @returns {URL}
|
|
1209
|
+
*/
|
|
1210
|
+
function resolvePackageTargetString(
|
|
1211
|
+
target,
|
|
1212
|
+
subpath,
|
|
1213
|
+
match,
|
|
1214
|
+
packageJsonUrl,
|
|
1215
|
+
base,
|
|
1216
|
+
pattern,
|
|
1217
|
+
internal,
|
|
1218
|
+
isPathMap,
|
|
1219
|
+
conditions
|
|
1220
|
+
) {
|
|
1221
|
+
if (subpath !== '' && !pattern && target[target.length - 1] !== '/')
|
|
1222
|
+
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)
|
|
1223
|
+
|
|
1224
|
+
if (!target.startsWith('./')) {
|
|
1225
|
+
if (internal && !target.startsWith('../') && !target.startsWith('/')) {
|
|
1226
|
+
let isURL = false;
|
|
1227
|
+
|
|
1228
|
+
try {
|
|
1229
|
+
new URL$1(target);
|
|
1230
|
+
isURL = true;
|
|
1231
|
+
} catch {
|
|
1232
|
+
// Continue regardless of error.
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
if (!isURL) {
|
|
1236
|
+
const exportTarget = pattern
|
|
1237
|
+
? RegExpPrototypeSymbolReplace.call(
|
|
1238
|
+
patternRegEx,
|
|
1239
|
+
target,
|
|
1240
|
+
() => subpath
|
|
1241
|
+
)
|
|
1242
|
+
: target + subpath;
|
|
1243
|
+
|
|
1244
|
+
return packageResolve(exportTarget, packageJsonUrl, conditions)
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
if (invalidSegmentRegEx.exec(target.slice(2)) !== null) {
|
|
1252
|
+
if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) {
|
|
1253
|
+
if (!isPathMap) {
|
|
1254
|
+
const request = pattern
|
|
1255
|
+
? match.replace('*', () => subpath)
|
|
1256
|
+
: match + subpath;
|
|
1257
|
+
const resolvedTarget = pattern
|
|
1258
|
+
? RegExpPrototypeSymbolReplace.call(
|
|
1259
|
+
patternRegEx,
|
|
1260
|
+
target,
|
|
1261
|
+
() => subpath
|
|
1262
|
+
)
|
|
1263
|
+
: target;
|
|
1264
|
+
emitInvalidSegmentDeprecation(
|
|
1265
|
+
resolvedTarget,
|
|
1266
|
+
request,
|
|
1267
|
+
match,
|
|
1268
|
+
packageJsonUrl,
|
|
1269
|
+
internal,
|
|
1270
|
+
base,
|
|
1271
|
+
true
|
|
1272
|
+
);
|
|
1273
|
+
}
|
|
1274
|
+
} else {
|
|
1275
|
+
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
const resolved = new URL$1(target, packageJsonUrl);
|
|
1280
|
+
const resolvedPath = resolved.pathname;
|
|
1281
|
+
const packagePath = new URL$1('.', packageJsonUrl).pathname;
|
|
1282
|
+
|
|
1283
|
+
if (!resolvedPath.startsWith(packagePath))
|
|
1284
|
+
throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)
|
|
1285
|
+
|
|
1286
|
+
if (subpath === '') return resolved
|
|
1287
|
+
|
|
1288
|
+
if (invalidSegmentRegEx.exec(subpath) !== null) {
|
|
1289
|
+
const request = pattern
|
|
1290
|
+
? match.replace('*', () => subpath)
|
|
1291
|
+
: match + subpath;
|
|
1292
|
+
if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) {
|
|
1293
|
+
if (!isPathMap) {
|
|
1294
|
+
const resolvedTarget = pattern
|
|
1295
|
+
? RegExpPrototypeSymbolReplace.call(
|
|
1296
|
+
patternRegEx,
|
|
1297
|
+
target,
|
|
1298
|
+
() => subpath
|
|
1299
|
+
)
|
|
1300
|
+
: target;
|
|
1301
|
+
emitInvalidSegmentDeprecation(
|
|
1302
|
+
resolvedTarget,
|
|
1303
|
+
request,
|
|
1304
|
+
match,
|
|
1305
|
+
packageJsonUrl,
|
|
1306
|
+
internal,
|
|
1307
|
+
base,
|
|
1308
|
+
false
|
|
1309
|
+
);
|
|
1310
|
+
}
|
|
1311
|
+
} else {
|
|
1312
|
+
throwInvalidSubpath(request, match, packageJsonUrl, internal, base);
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
if (pattern) {
|
|
1317
|
+
return new URL$1(
|
|
1318
|
+
RegExpPrototypeSymbolReplace.call(
|
|
1319
|
+
patternRegEx,
|
|
1320
|
+
resolved.href,
|
|
1321
|
+
() => subpath
|
|
1322
|
+
)
|
|
1323
|
+
)
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
return new URL$1(subpath, resolved)
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* @param {string} key
|
|
1331
|
+
* @returns {boolean}
|
|
1332
|
+
*/
|
|
1333
|
+
function isArrayIndex(key) {
|
|
1334
|
+
const keyNumber = Number(key);
|
|
1335
|
+
if (`${keyNumber}` !== key) return false
|
|
1336
|
+
return keyNumber >= 0 && keyNumber < 0xff_ff_ff_ff
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
/**
|
|
1340
|
+
* @param {URL} packageJsonUrl
|
|
1341
|
+
* @param {unknown} target
|
|
1342
|
+
* @param {string} subpath
|
|
1343
|
+
* @param {string} packageSubpath
|
|
1344
|
+
* @param {URL} base
|
|
1345
|
+
* @param {boolean} pattern
|
|
1346
|
+
* @param {boolean} internal
|
|
1347
|
+
* @param {boolean} isPathMap
|
|
1348
|
+
* @param {Set<string> | undefined} conditions
|
|
1349
|
+
* @returns {URL | null}
|
|
1350
|
+
*/
|
|
1351
|
+
function resolvePackageTarget(
|
|
1352
|
+
packageJsonUrl,
|
|
1353
|
+
target,
|
|
1354
|
+
subpath,
|
|
1355
|
+
packageSubpath,
|
|
1356
|
+
base,
|
|
1357
|
+
pattern,
|
|
1358
|
+
internal,
|
|
1359
|
+
isPathMap,
|
|
1360
|
+
conditions
|
|
1361
|
+
) {
|
|
1362
|
+
if (typeof target === 'string') {
|
|
1363
|
+
return resolvePackageTargetString(
|
|
1364
|
+
target,
|
|
1365
|
+
subpath,
|
|
1366
|
+
packageSubpath,
|
|
1367
|
+
packageJsonUrl,
|
|
1368
|
+
base,
|
|
1369
|
+
pattern,
|
|
1370
|
+
internal,
|
|
1371
|
+
isPathMap,
|
|
1372
|
+
conditions
|
|
1373
|
+
)
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
if (Array.isArray(target)) {
|
|
1377
|
+
/** @type {Array<unknown>} */
|
|
1378
|
+
const targetList = target;
|
|
1379
|
+
if (targetList.length === 0) return null
|
|
1380
|
+
|
|
1381
|
+
/** @type {ErrnoException | null | undefined} */
|
|
1382
|
+
let lastException;
|
|
1383
|
+
let i = -1;
|
|
1384
|
+
|
|
1385
|
+
while (++i < targetList.length) {
|
|
1386
|
+
const targetItem = targetList[i];
|
|
1387
|
+
/** @type {URL | null} */
|
|
1388
|
+
let resolveResult;
|
|
1389
|
+
try {
|
|
1390
|
+
resolveResult = resolvePackageTarget(
|
|
1391
|
+
packageJsonUrl,
|
|
1392
|
+
targetItem,
|
|
1393
|
+
subpath,
|
|
1394
|
+
packageSubpath,
|
|
1395
|
+
base,
|
|
1396
|
+
pattern,
|
|
1397
|
+
internal,
|
|
1398
|
+
isPathMap,
|
|
1399
|
+
conditions
|
|
1400
|
+
);
|
|
1401
|
+
} catch (error) {
|
|
1402
|
+
const exception = /** @type {ErrnoException} */ (error);
|
|
1403
|
+
lastException = exception;
|
|
1404
|
+
if (exception.code === 'ERR_INVALID_PACKAGE_TARGET') continue
|
|
1405
|
+
throw error
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
if (resolveResult === undefined) continue
|
|
1409
|
+
|
|
1410
|
+
if (resolveResult === null) {
|
|
1411
|
+
lastException = null;
|
|
1412
|
+
continue
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
return resolveResult
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
if (lastException === undefined || lastException === null) {
|
|
1419
|
+
return null
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
throw lastException
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
if (typeof target === 'object' && target !== null) {
|
|
1426
|
+
const keys = Object.getOwnPropertyNames(target);
|
|
1427
|
+
let i = -1;
|
|
1428
|
+
|
|
1429
|
+
while (++i < keys.length) {
|
|
1430
|
+
const key = keys[i];
|
|
1431
|
+
if (isArrayIndex(key)) {
|
|
1432
|
+
throw new ERR_INVALID_PACKAGE_CONFIG(
|
|
1433
|
+
fileURLToPath$1(packageJsonUrl),
|
|
1434
|
+
base,
|
|
1435
|
+
'"exports" cannot contain numeric property keys.'
|
|
1436
|
+
)
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
i = -1;
|
|
1441
|
+
|
|
1442
|
+
while (++i < keys.length) {
|
|
1443
|
+
const key = keys[i];
|
|
1444
|
+
if (key === 'default' || (conditions && conditions.has(key))) {
|
|
1445
|
+
// @ts-expect-error: indexable.
|
|
1446
|
+
const conditionalTarget = /** @type {unknown} */ (target[key]);
|
|
1447
|
+
const resolveResult = resolvePackageTarget(
|
|
1448
|
+
packageJsonUrl,
|
|
1449
|
+
conditionalTarget,
|
|
1450
|
+
subpath,
|
|
1451
|
+
packageSubpath,
|
|
1452
|
+
base,
|
|
1453
|
+
pattern,
|
|
1454
|
+
internal,
|
|
1455
|
+
isPathMap,
|
|
1456
|
+
conditions
|
|
1457
|
+
);
|
|
1458
|
+
if (resolveResult === undefined) continue
|
|
1459
|
+
return resolveResult
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
return null
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
if (target === null) {
|
|
1467
|
+
return null
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
throw invalidPackageTarget(
|
|
1471
|
+
packageSubpath,
|
|
1472
|
+
target,
|
|
1473
|
+
packageJsonUrl,
|
|
1474
|
+
internal,
|
|
1475
|
+
base
|
|
1476
|
+
)
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
/**
|
|
1480
|
+
* @param {unknown} exports
|
|
1481
|
+
* @param {URL} packageJsonUrl
|
|
1482
|
+
* @param {URL} base
|
|
1483
|
+
* @returns {boolean}
|
|
1484
|
+
*/
|
|
1485
|
+
function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
|
|
1486
|
+
if (typeof exports === 'string' || Array.isArray(exports)) return true
|
|
1487
|
+
if (typeof exports !== 'object' || exports === null) return false
|
|
1488
|
+
|
|
1489
|
+
const keys = Object.getOwnPropertyNames(exports);
|
|
1490
|
+
let isConditionalSugar = false;
|
|
1491
|
+
let i = 0;
|
|
1492
|
+
let keyIndex = -1;
|
|
1493
|
+
while (++keyIndex < keys.length) {
|
|
1494
|
+
const key = keys[keyIndex];
|
|
1495
|
+
const currentIsConditionalSugar = key === '' || key[0] !== '.';
|
|
1496
|
+
if (i++ === 0) {
|
|
1497
|
+
isConditionalSugar = currentIsConditionalSugar;
|
|
1498
|
+
} else if (isConditionalSugar !== currentIsConditionalSugar) {
|
|
1499
|
+
throw new ERR_INVALID_PACKAGE_CONFIG(
|
|
1500
|
+
fileURLToPath$1(packageJsonUrl),
|
|
1501
|
+
base,
|
|
1502
|
+
'"exports" cannot contain some keys starting with \'.\' and some not.' +
|
|
1503
|
+
' The exports object must either be an object of package subpath keys' +
|
|
1504
|
+
' or an object of main entry condition name keys only.'
|
|
1505
|
+
)
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
return isConditionalSugar
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/**
|
|
1513
|
+
* @param {string} match
|
|
1514
|
+
* @param {URL} pjsonUrl
|
|
1515
|
+
* @param {URL} base
|
|
1516
|
+
*/
|
|
1517
|
+
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
|
|
1518
|
+
// @ts-expect-error: apparently it does exist, TS.
|
|
1519
|
+
if (process$1.noDeprecation) {
|
|
1520
|
+
return
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
const pjsonPath = fileURLToPath$1(pjsonUrl);
|
|
1524
|
+
if (emittedPackageWarnings.has(pjsonPath + '|' + match)) return
|
|
1525
|
+
emittedPackageWarnings.add(pjsonPath + '|' + match);
|
|
1526
|
+
process$1.emitWarning(
|
|
1527
|
+
`Use of deprecated trailing slash pattern mapping "${match}" in the ` +
|
|
1528
|
+
`"exports" field module resolution of the package at ${pjsonPath}${
|
|
1529
|
+
base ? ` imported from ${fileURLToPath$1(base)}` : ''
|
|
1530
|
+
}. Mapping specifiers ending in "/" is no longer supported.`,
|
|
1531
|
+
'DeprecationWarning',
|
|
1532
|
+
'DEP0155'
|
|
1533
|
+
);
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* @param {URL} packageJsonUrl
|
|
1538
|
+
* @param {string} packageSubpath
|
|
1539
|
+
* @param {Record<string, unknown>} packageConfig
|
|
1540
|
+
* @param {URL} base
|
|
1541
|
+
* @param {Set<string> | undefined} conditions
|
|
1542
|
+
* @returns {URL}
|
|
1543
|
+
*/
|
|
1544
|
+
function packageExportsResolve(
|
|
1545
|
+
packageJsonUrl,
|
|
1546
|
+
packageSubpath,
|
|
1547
|
+
packageConfig,
|
|
1548
|
+
base,
|
|
1549
|
+
conditions
|
|
1550
|
+
) {
|
|
1551
|
+
let exports = packageConfig.exports;
|
|
1552
|
+
|
|
1553
|
+
if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) {
|
|
1554
|
+
exports = {'.': exports};
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
if (
|
|
1558
|
+
own.call(exports, packageSubpath) &&
|
|
1559
|
+
!packageSubpath.includes('*') &&
|
|
1560
|
+
!packageSubpath.endsWith('/')
|
|
1561
|
+
) {
|
|
1562
|
+
// @ts-expect-error: indexable.
|
|
1563
|
+
const target = exports[packageSubpath];
|
|
1564
|
+
const resolveResult = resolvePackageTarget(
|
|
1565
|
+
packageJsonUrl,
|
|
1566
|
+
target,
|
|
1567
|
+
'',
|
|
1568
|
+
packageSubpath,
|
|
1569
|
+
base,
|
|
1570
|
+
false,
|
|
1571
|
+
false,
|
|
1572
|
+
false,
|
|
1573
|
+
conditions
|
|
1574
|
+
);
|
|
1575
|
+
if (resolveResult === null || resolveResult === undefined) {
|
|
1576
|
+
throw exportsNotFound(packageSubpath, packageJsonUrl, base)
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
return resolveResult
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
let bestMatch = '';
|
|
1583
|
+
let bestMatchSubpath = '';
|
|
1584
|
+
const keys = Object.getOwnPropertyNames(exports);
|
|
1585
|
+
let i = -1;
|
|
1586
|
+
|
|
1587
|
+
while (++i < keys.length) {
|
|
1588
|
+
const key = keys[i];
|
|
1589
|
+
const patternIndex = key.indexOf('*');
|
|
1590
|
+
|
|
1591
|
+
if (
|
|
1592
|
+
patternIndex !== -1 &&
|
|
1593
|
+
packageSubpath.startsWith(key.slice(0, patternIndex))
|
|
1594
|
+
) {
|
|
1595
|
+
// When this reaches EOL, this can throw at the top of the whole function:
|
|
1596
|
+
//
|
|
1597
|
+
// if (StringPrototypeEndsWith(packageSubpath, '/'))
|
|
1598
|
+
// throwInvalidSubpath(packageSubpath)
|
|
1599
|
+
//
|
|
1600
|
+
// To match "imports" and the spec.
|
|
1601
|
+
if (packageSubpath.endsWith('/')) {
|
|
1602
|
+
emitTrailingSlashPatternDeprecation(
|
|
1603
|
+
packageSubpath,
|
|
1604
|
+
packageJsonUrl,
|
|
1605
|
+
base
|
|
1606
|
+
);
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
const patternTrailer = key.slice(patternIndex + 1);
|
|
1610
|
+
|
|
1611
|
+
if (
|
|
1612
|
+
packageSubpath.length >= key.length &&
|
|
1613
|
+
packageSubpath.endsWith(patternTrailer) &&
|
|
1614
|
+
patternKeyCompare(bestMatch, key) === 1 &&
|
|
1615
|
+
key.lastIndexOf('*') === patternIndex
|
|
1616
|
+
) {
|
|
1617
|
+
bestMatch = key;
|
|
1618
|
+
bestMatchSubpath = packageSubpath.slice(
|
|
1619
|
+
patternIndex,
|
|
1620
|
+
packageSubpath.length - patternTrailer.length
|
|
1621
|
+
);
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
if (bestMatch) {
|
|
1627
|
+
// @ts-expect-error: indexable.
|
|
1628
|
+
const target = /** @type {unknown} */ (exports[bestMatch]);
|
|
1629
|
+
const resolveResult = resolvePackageTarget(
|
|
1630
|
+
packageJsonUrl,
|
|
1631
|
+
target,
|
|
1632
|
+
bestMatchSubpath,
|
|
1633
|
+
bestMatch,
|
|
1634
|
+
base,
|
|
1635
|
+
true,
|
|
1636
|
+
false,
|
|
1637
|
+
packageSubpath.endsWith('/'),
|
|
1638
|
+
conditions
|
|
1639
|
+
);
|
|
1640
|
+
|
|
1641
|
+
if (resolveResult === null || resolveResult === undefined) {
|
|
1642
|
+
throw exportsNotFound(packageSubpath, packageJsonUrl, base)
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
return resolveResult
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
throw exportsNotFound(packageSubpath, packageJsonUrl, base)
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* @param {string} a
|
|
1653
|
+
* @param {string} b
|
|
1654
|
+
*/
|
|
1655
|
+
function patternKeyCompare(a, b) {
|
|
1656
|
+
const aPatternIndex = a.indexOf('*');
|
|
1657
|
+
const bPatternIndex = b.indexOf('*');
|
|
1658
|
+
const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
|
|
1659
|
+
const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
|
|
1660
|
+
if (baseLengthA > baseLengthB) return -1
|
|
1661
|
+
if (baseLengthB > baseLengthA) return 1
|
|
1662
|
+
if (aPatternIndex === -1) return 1
|
|
1663
|
+
if (bPatternIndex === -1) return -1
|
|
1664
|
+
if (a.length > b.length) return -1
|
|
1665
|
+
if (b.length > a.length) return 1
|
|
1666
|
+
return 0
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* @param {string} name
|
|
1671
|
+
* @param {URL} base
|
|
1672
|
+
* @param {Set<string>} [conditions]
|
|
1673
|
+
* @returns {URL}
|
|
1674
|
+
*/
|
|
1675
|
+
function packageImportsResolve(name, base, conditions) {
|
|
1676
|
+
if (name === '#' || name.startsWith('#/') || name.endsWith('/')) {
|
|
1677
|
+
const reason = 'is not a valid internal imports specifier name';
|
|
1678
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath$1(base))
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
/** @type {URL | undefined} */
|
|
1682
|
+
let packageJsonUrl;
|
|
1683
|
+
|
|
1684
|
+
const packageConfig = getPackageScopeConfig(base);
|
|
1685
|
+
|
|
1686
|
+
if (packageConfig.exists) {
|
|
1687
|
+
packageJsonUrl = pathToFileURL$1(packageConfig.pjsonPath);
|
|
1688
|
+
const imports = packageConfig.imports;
|
|
1689
|
+
if (imports) {
|
|
1690
|
+
if (own.call(imports, name) && !name.includes('*')) {
|
|
1691
|
+
const resolveResult = resolvePackageTarget(
|
|
1692
|
+
packageJsonUrl,
|
|
1693
|
+
imports[name],
|
|
1694
|
+
'',
|
|
1695
|
+
name,
|
|
1696
|
+
base,
|
|
1697
|
+
false,
|
|
1698
|
+
true,
|
|
1699
|
+
false,
|
|
1700
|
+
conditions
|
|
1701
|
+
);
|
|
1702
|
+
if (resolveResult !== null && resolveResult !== undefined) {
|
|
1703
|
+
return resolveResult
|
|
1704
|
+
}
|
|
1705
|
+
} else {
|
|
1706
|
+
let bestMatch = '';
|
|
1707
|
+
let bestMatchSubpath = '';
|
|
1708
|
+
const keys = Object.getOwnPropertyNames(imports);
|
|
1709
|
+
let i = -1;
|
|
1710
|
+
|
|
1711
|
+
while (++i < keys.length) {
|
|
1712
|
+
const key = keys[i];
|
|
1713
|
+
const patternIndex = key.indexOf('*');
|
|
1714
|
+
|
|
1715
|
+
if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) {
|
|
1716
|
+
const patternTrailer = key.slice(patternIndex + 1);
|
|
1717
|
+
if (
|
|
1718
|
+
name.length >= key.length &&
|
|
1719
|
+
name.endsWith(patternTrailer) &&
|
|
1720
|
+
patternKeyCompare(bestMatch, key) === 1 &&
|
|
1721
|
+
key.lastIndexOf('*') === patternIndex
|
|
1722
|
+
) {
|
|
1723
|
+
bestMatch = key;
|
|
1724
|
+
bestMatchSubpath = name.slice(
|
|
1725
|
+
patternIndex,
|
|
1726
|
+
name.length - patternTrailer.length
|
|
1727
|
+
);
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
if (bestMatch) {
|
|
1733
|
+
const target = imports[bestMatch];
|
|
1734
|
+
const resolveResult = resolvePackageTarget(
|
|
1735
|
+
packageJsonUrl,
|
|
1736
|
+
target,
|
|
1737
|
+
bestMatchSubpath,
|
|
1738
|
+
bestMatch,
|
|
1739
|
+
base,
|
|
1740
|
+
true,
|
|
1741
|
+
true,
|
|
1742
|
+
false,
|
|
1743
|
+
conditions
|
|
1744
|
+
);
|
|
1745
|
+
|
|
1746
|
+
if (resolveResult !== null && resolveResult !== undefined) {
|
|
1747
|
+
return resolveResult
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
throw importNotDefined(name, packageJsonUrl, base)
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* @param {string} specifier
|
|
1759
|
+
* @param {URL} base
|
|
1760
|
+
*/
|
|
1761
|
+
function parsePackageName(specifier, base) {
|
|
1762
|
+
let separatorIndex = specifier.indexOf('/');
|
|
1763
|
+
let validPackageName = true;
|
|
1764
|
+
let isScoped = false;
|
|
1765
|
+
if (specifier[0] === '@') {
|
|
1766
|
+
isScoped = true;
|
|
1767
|
+
if (separatorIndex === -1 || specifier.length === 0) {
|
|
1768
|
+
validPackageName = false;
|
|
1769
|
+
} else {
|
|
1770
|
+
separatorIndex = specifier.indexOf('/', separatorIndex + 1);
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
const packageName =
|
|
1775
|
+
separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex);
|
|
1776
|
+
|
|
1777
|
+
// Package name cannot have leading . and cannot have percent-encoding or
|
|
1778
|
+
// \\ separators.
|
|
1779
|
+
if (invalidPackageNameRegEx.exec(packageName) !== null) {
|
|
1780
|
+
validPackageName = false;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
if (!validPackageName) {
|
|
1784
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
1785
|
+
specifier,
|
|
1786
|
+
'is not a valid package name',
|
|
1787
|
+
fileURLToPath$1(base)
|
|
1788
|
+
)
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
const packageSubpath =
|
|
1792
|
+
'.' + (separatorIndex === -1 ? '' : specifier.slice(separatorIndex));
|
|
1793
|
+
|
|
1794
|
+
return {packageName, packageSubpath, isScoped}
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
/**
|
|
1798
|
+
* @param {string} specifier
|
|
1799
|
+
* @param {URL} base
|
|
1800
|
+
* @param {Set<string> | undefined} conditions
|
|
1801
|
+
* @returns {URL}
|
|
1802
|
+
*/
|
|
1803
|
+
function packageResolve(specifier, base, conditions) {
|
|
1804
|
+
if (builtinModules.includes(specifier)) {
|
|
1805
|
+
return new URL$1('node:' + specifier)
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
const {packageName, packageSubpath, isScoped} = parsePackageName(
|
|
1809
|
+
specifier,
|
|
1810
|
+
base
|
|
1811
|
+
);
|
|
1812
|
+
|
|
1813
|
+
// ResolveSelf
|
|
1814
|
+
const packageConfig = getPackageScopeConfig(base);
|
|
1815
|
+
|
|
1816
|
+
// Can’t test.
|
|
1817
|
+
/* c8 ignore next 16 */
|
|
1818
|
+
if (packageConfig.exists) {
|
|
1819
|
+
const packageJsonUrl = pathToFileURL$1(packageConfig.pjsonPath);
|
|
1820
|
+
if (
|
|
1821
|
+
packageConfig.name === packageName &&
|
|
1822
|
+
packageConfig.exports !== undefined &&
|
|
1823
|
+
packageConfig.exports !== null
|
|
1824
|
+
) {
|
|
1825
|
+
return packageExportsResolve(
|
|
1826
|
+
packageJsonUrl,
|
|
1827
|
+
packageSubpath,
|
|
1828
|
+
packageConfig,
|
|
1829
|
+
base,
|
|
1830
|
+
conditions
|
|
1831
|
+
)
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
let packageJsonUrl = new URL$1(
|
|
1836
|
+
'./node_modules/' + packageName + '/package.json',
|
|
1837
|
+
base
|
|
1838
|
+
);
|
|
1839
|
+
let packageJsonPath = fileURLToPath$1(packageJsonUrl);
|
|
1840
|
+
/** @type {string} */
|
|
1841
|
+
let lastPath;
|
|
1842
|
+
do {
|
|
1843
|
+
const stat = tryStatSync(packageJsonPath.slice(0, -13));
|
|
1844
|
+
if (!stat || !stat.isDirectory()) {
|
|
1845
|
+
lastPath = packageJsonPath;
|
|
1846
|
+
packageJsonUrl = new URL$1(
|
|
1847
|
+
(isScoped ? '../../../../node_modules/' : '../../../node_modules/') +
|
|
1848
|
+
packageName +
|
|
1849
|
+
'/package.json',
|
|
1850
|
+
packageJsonUrl
|
|
1851
|
+
);
|
|
1852
|
+
packageJsonPath = fileURLToPath$1(packageJsonUrl);
|
|
1853
|
+
continue
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
// Package match.
|
|
1857
|
+
const packageConfig = read(packageJsonPath, {base, specifier});
|
|
1858
|
+
if (packageConfig.exports !== undefined && packageConfig.exports !== null) {
|
|
1859
|
+
return packageExportsResolve(
|
|
1860
|
+
packageJsonUrl,
|
|
1861
|
+
packageSubpath,
|
|
1862
|
+
packageConfig,
|
|
1863
|
+
base,
|
|
1864
|
+
conditions
|
|
1865
|
+
)
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
if (packageSubpath === '.') {
|
|
1869
|
+
return legacyMainResolve(packageJsonUrl, packageConfig, base)
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
return new URL$1(packageSubpath, packageJsonUrl)
|
|
1873
|
+
// Cross-platform root check.
|
|
1874
|
+
} while (packageJsonPath.length !== lastPath.length)
|
|
1875
|
+
|
|
1876
|
+
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath$1(base), false)
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
/**
|
|
1880
|
+
* @param {string} specifier
|
|
1881
|
+
* @returns {boolean}
|
|
1882
|
+
*/
|
|
1883
|
+
function isRelativeSpecifier(specifier) {
|
|
1884
|
+
if (specifier[0] === '.') {
|
|
1885
|
+
if (specifier.length === 1 || specifier[1] === '/') return true
|
|
1886
|
+
if (
|
|
1887
|
+
specifier[1] === '.' &&
|
|
1888
|
+
(specifier.length === 2 || specifier[2] === '/')
|
|
1889
|
+
) {
|
|
1890
|
+
return true
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
return false
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* @param {string} specifier
|
|
1899
|
+
* @returns {boolean}
|
|
1900
|
+
*/
|
|
1901
|
+
function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
|
|
1902
|
+
if (specifier === '') return false
|
|
1903
|
+
if (specifier[0] === '/') return true
|
|
1904
|
+
return isRelativeSpecifier(specifier)
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
/**
|
|
1908
|
+
* The “Resolver Algorithm Specification” as detailed in the Node docs (which is
|
|
1909
|
+
* sync and slightly lower-level than `resolve`).
|
|
1910
|
+
*
|
|
1911
|
+
* @param {string} specifier
|
|
1912
|
+
* `/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc.
|
|
1913
|
+
* @param {URL} base
|
|
1914
|
+
* Full URL (to a file) that `specifier` is resolved relative from.
|
|
1915
|
+
* @param {Set<string>} [conditions]
|
|
1916
|
+
* Conditions.
|
|
1917
|
+
* @param {boolean} [preserveSymlinks]
|
|
1918
|
+
* Keep symlinks instead of resolving them.
|
|
1919
|
+
* @returns {URL}
|
|
1920
|
+
* A URL object to the found thing.
|
|
1921
|
+
*/
|
|
1922
|
+
function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
1923
|
+
// Note: The Node code supports `base` as a string (in this internal API) too,
|
|
1924
|
+
// we don’t.
|
|
1925
|
+
const protocol = base.protocol;
|
|
1926
|
+
const isData = protocol === 'data:';
|
|
1927
|
+
const isRemote = isData || protocol === 'http:' || protocol === 'https:';
|
|
1928
|
+
// Order swapped from spec for minor perf gain.
|
|
1929
|
+
// Ok since relative URLs cannot parse as URLs.
|
|
1930
|
+
/** @type {URL | undefined} */
|
|
1931
|
+
let resolved;
|
|
1932
|
+
|
|
1933
|
+
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
|
|
1934
|
+
try {
|
|
1935
|
+
resolved = new URL$1(specifier, base);
|
|
1936
|
+
} catch (error_) {
|
|
1937
|
+
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
1938
|
+
error.cause = error_;
|
|
1939
|
+
throw error
|
|
1940
|
+
}
|
|
1941
|
+
} else if (protocol === 'file:' && specifier[0] === '#') {
|
|
1942
|
+
resolved = packageImportsResolve(specifier, base, conditions);
|
|
1943
|
+
} else {
|
|
1944
|
+
try {
|
|
1945
|
+
resolved = new URL$1(specifier);
|
|
1946
|
+
} catch (error_) {
|
|
1947
|
+
// Note: actual code uses `canBeRequiredWithoutScheme`.
|
|
1948
|
+
if (isRemote && !builtinModules.includes(specifier)) {
|
|
1949
|
+
const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
|
|
1950
|
+
error.cause = error_;
|
|
1951
|
+
throw error
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
resolved = packageResolve(specifier, base, conditions);
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
assert(resolved !== undefined, 'expected to be defined');
|
|
1959
|
+
|
|
1960
|
+
if (resolved.protocol !== 'file:') {
|
|
1961
|
+
return resolved
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
return finalizeResolution(resolved, base, preserveSymlinks)
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
function fileURLToPath(id) {
|
|
1968
|
+
if (typeof id === "string" && !id.startsWith("file://")) {
|
|
1969
|
+
return normalizeSlash(id);
|
|
1970
|
+
}
|
|
1971
|
+
return normalizeSlash(fileURLToPath$1(id));
|
|
1972
|
+
}
|
|
1973
|
+
function pathToFileURL(id) {
|
|
1974
|
+
return pathToFileURL$1(fileURLToPath(id)).toString();
|
|
1975
|
+
}
|
|
1976
|
+
const INVALID_CHAR_RE = /[\u0000-\u001F"#$&*+,/:;<=>?@[\]^`{|}\u007F]+/g;
|
|
1977
|
+
function sanitizeURIComponent(name = "", replacement = "_") {
|
|
1978
|
+
return name.replace(INVALID_CHAR_RE, replacement).replace(/%../g, replacement);
|
|
1979
|
+
}
|
|
1980
|
+
function sanitizeFilePath(filePath = "") {
|
|
1981
|
+
return filePath.replace(/\?.*$/, "").split(/[/\\]/g).map((p) => sanitizeURIComponent(p)).join("/").replace(/^([A-Za-z])_\//, "$1:/");
|
|
1982
|
+
}
|
|
1983
|
+
function normalizeid(id) {
|
|
1984
|
+
if (typeof id !== "string") {
|
|
1985
|
+
id = id.toString();
|
|
1986
|
+
}
|
|
1987
|
+
if (/(node|data|http|https|file):/.test(id)) {
|
|
1988
|
+
return id;
|
|
1989
|
+
}
|
|
1990
|
+
if (BUILTIN_MODULES.has(id)) {
|
|
1991
|
+
return "node:" + id;
|
|
1992
|
+
}
|
|
1993
|
+
return "file://" + encodeURI(normalizeSlash(id));
|
|
1994
|
+
}
|
|
1995
|
+
async function loadURL(url) {
|
|
1996
|
+
const code = await promises.readFile(fileURLToPath(url), "utf8");
|
|
1997
|
+
return code;
|
|
1998
|
+
}
|
|
1999
|
+
function toDataURL(code) {
|
|
2000
|
+
const base64 = Buffer.from(code).toString("base64");
|
|
2001
|
+
return `data:text/javascript;base64,${base64}`;
|
|
2002
|
+
}
|
|
2003
|
+
function isNodeBuiltin(id = "") {
|
|
2004
|
+
id = id.replace(/^node:/, "").split("/")[0];
|
|
2005
|
+
return BUILTIN_MODULES.has(id);
|
|
2006
|
+
}
|
|
2007
|
+
const ProtocolRegex = /^(?<proto>.{2,}?):.+$/;
|
|
2008
|
+
function getProtocol(id) {
|
|
2009
|
+
const proto = id.match(ProtocolRegex);
|
|
2010
|
+
return proto ? proto.groups?.proto : void 0;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
const DEFAULT_CONDITIONS_SET = /* @__PURE__ */ new Set(["node", "import"]);
|
|
2014
|
+
const DEFAULT_EXTENSIONS = [".mjs", ".cjs", ".js", ".json"];
|
|
2015
|
+
const NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([
|
|
2016
|
+
"ERR_MODULE_NOT_FOUND",
|
|
2017
|
+
"ERR_UNSUPPORTED_DIR_IMPORT",
|
|
2018
|
+
"MODULE_NOT_FOUND",
|
|
2019
|
+
"ERR_PACKAGE_PATH_NOT_EXPORTED"
|
|
2020
|
+
]);
|
|
2021
|
+
function _tryModuleResolve(id, url, conditions) {
|
|
2022
|
+
try {
|
|
2023
|
+
return moduleResolve(id, url, conditions);
|
|
2024
|
+
} catch (error) {
|
|
2025
|
+
if (!NOT_FOUND_ERRORS.has(error?.code)) {
|
|
2026
|
+
throw error;
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
function _resolve(id, options = {}) {
|
|
2031
|
+
if (typeof id !== "string") {
|
|
2032
|
+
if (id instanceof URL) {
|
|
2033
|
+
id = fileURLToPath(id);
|
|
2034
|
+
} else {
|
|
2035
|
+
throw new TypeError("input must be a `string` or `URL`");
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
if (/(node|data|http|https):/.test(id)) {
|
|
2039
|
+
return id;
|
|
2040
|
+
}
|
|
2041
|
+
if (BUILTIN_MODULES.has(id)) {
|
|
2042
|
+
return "node:" + id;
|
|
2043
|
+
}
|
|
2044
|
+
if (id.startsWith("file://")) {
|
|
2045
|
+
id = fileURLToPath(id);
|
|
2046
|
+
}
|
|
2047
|
+
if (isAbsolute(id)) {
|
|
2048
|
+
try {
|
|
2049
|
+
const stat = statSync(id);
|
|
2050
|
+
if (stat.isFile()) {
|
|
2051
|
+
return pathToFileURL(id);
|
|
2052
|
+
}
|
|
2053
|
+
} catch (error) {
|
|
2054
|
+
if (error?.code !== "ENOENT") {
|
|
2055
|
+
throw error;
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
const conditionsSet = options.conditions ? new Set(options.conditions) : DEFAULT_CONDITIONS_SET;
|
|
2060
|
+
const _urls = (Array.isArray(options.url) ? options.url : [options.url]).filter(Boolean).map((url) => new URL(normalizeid(url.toString())));
|
|
2061
|
+
if (_urls.length === 0) {
|
|
2062
|
+
_urls.push(new URL(pathToFileURL(process.cwd())));
|
|
2063
|
+
}
|
|
2064
|
+
const urls = [..._urls];
|
|
2065
|
+
for (const url of _urls) {
|
|
2066
|
+
if (url.protocol === "file:") {
|
|
2067
|
+
urls.push(
|
|
2068
|
+
new URL("./", url),
|
|
2069
|
+
// If url is directory
|
|
2070
|
+
new URL(joinURL(url.pathname, "_index.js"), url),
|
|
2071
|
+
// TODO: Remove in next major version?
|
|
2072
|
+
new URL("node_modules", url)
|
|
2073
|
+
);
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
let resolved;
|
|
2077
|
+
for (const url of urls) {
|
|
2078
|
+
resolved = _tryModuleResolve(id, url, conditionsSet);
|
|
2079
|
+
if (resolved) {
|
|
2080
|
+
break;
|
|
2081
|
+
}
|
|
2082
|
+
for (const prefix of ["", "/index"]) {
|
|
2083
|
+
for (const extension of options.extensions || DEFAULT_EXTENSIONS) {
|
|
2084
|
+
resolved = _tryModuleResolve(
|
|
2085
|
+
joinURL(id, prefix) + extension,
|
|
2086
|
+
url,
|
|
2087
|
+
conditionsSet
|
|
2088
|
+
);
|
|
2089
|
+
if (resolved) {
|
|
2090
|
+
break;
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
if (resolved) {
|
|
2094
|
+
break;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
if (resolved) {
|
|
2098
|
+
break;
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
if (!resolved) {
|
|
2102
|
+
const error = new Error(
|
|
2103
|
+
`Cannot find module ${id} imported from ${urls.join(", ")}`
|
|
2104
|
+
);
|
|
2105
|
+
error.code = "ERR_MODULE_NOT_FOUND";
|
|
2106
|
+
throw error;
|
|
2107
|
+
}
|
|
2108
|
+
return pathToFileURL(resolved);
|
|
2109
|
+
}
|
|
2110
|
+
function resolveSync(id, options) {
|
|
2111
|
+
return _resolve(id, options);
|
|
2112
|
+
}
|
|
2113
|
+
function resolve(id, options) {
|
|
2114
|
+
try {
|
|
2115
|
+
return Promise.resolve(resolveSync(id, options));
|
|
2116
|
+
} catch (error) {
|
|
2117
|
+
return Promise.reject(error);
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
function resolvePathSync(id, options) {
|
|
2121
|
+
return fileURLToPath(resolveSync(id, options));
|
|
2122
|
+
}
|
|
2123
|
+
function resolvePath(id, options) {
|
|
2124
|
+
try {
|
|
2125
|
+
return Promise.resolve(resolvePathSync(id, options));
|
|
2126
|
+
} catch (error) {
|
|
2127
|
+
return Promise.reject(error);
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
function createResolve(defaults) {
|
|
2131
|
+
return (id, url) => {
|
|
2132
|
+
return resolve(id, { url, ...defaults });
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2135
|
+
const NODE_MODULES_RE = /^(.+\/node_modules\/)([^/@]+|@[^/]+\/[^/]+)(\/?.*?)?$/;
|
|
2136
|
+
function parseNodeModulePath(path) {
|
|
2137
|
+
if (!path) {
|
|
2138
|
+
return {};
|
|
2139
|
+
}
|
|
2140
|
+
path = normalize(fileURLToPath(path));
|
|
2141
|
+
const match = NODE_MODULES_RE.exec(path);
|
|
2142
|
+
if (!match) {
|
|
2143
|
+
return {};
|
|
2144
|
+
}
|
|
2145
|
+
const [, dir, name, subpath] = match;
|
|
2146
|
+
return {
|
|
2147
|
+
dir,
|
|
2148
|
+
name,
|
|
2149
|
+
subpath: subpath ? `.${subpath}` : void 0
|
|
2150
|
+
};
|
|
2151
|
+
}
|
|
2152
|
+
async function lookupNodeModuleSubpath(path) {
|
|
2153
|
+
path = normalize(fileURLToPath(path));
|
|
2154
|
+
const { name, subpath } = parseNodeModulePath(path);
|
|
2155
|
+
if (!name || !subpath) {
|
|
2156
|
+
return subpath;
|
|
2157
|
+
}
|
|
2158
|
+
const { exports } = await readPackageJSON(path).catch(() => {
|
|
2159
|
+
}) || {};
|
|
2160
|
+
if (exports) {
|
|
2161
|
+
const resolvedSubpath = _findSubpath(subpath, exports);
|
|
2162
|
+
if (resolvedSubpath) {
|
|
2163
|
+
return resolvedSubpath;
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
return subpath;
|
|
2167
|
+
}
|
|
2168
|
+
function _findSubpath(subpath, exports) {
|
|
2169
|
+
if (typeof exports === "string") {
|
|
2170
|
+
exports = { ".": exports };
|
|
2171
|
+
}
|
|
2172
|
+
if (!subpath.startsWith(".")) {
|
|
2173
|
+
subpath = subpath.startsWith("/") ? `.${subpath}` : `./${subpath}`;
|
|
2174
|
+
}
|
|
2175
|
+
if (subpath in (exports || {})) {
|
|
2176
|
+
return subpath;
|
|
2177
|
+
}
|
|
2178
|
+
return _flattenExports(exports).find((p) => p.fsPath === subpath)?.subpath;
|
|
2179
|
+
}
|
|
2180
|
+
function _flattenExports(exports = {}, parentSubpath = "./") {
|
|
2181
|
+
return Object.entries(exports).flatMap(([key, value]) => {
|
|
2182
|
+
const [subpath, condition] = key.startsWith(".") ? [key.slice(1), void 0] : ["", key];
|
|
2183
|
+
const _subPath = joinURL(parentSubpath, subpath);
|
|
2184
|
+
if (typeof value === "string") {
|
|
2185
|
+
return [{ subpath: _subPath, fsPath: value, condition }];
|
|
2186
|
+
} else {
|
|
2187
|
+
return _flattenExports(value, _subPath);
|
|
2188
|
+
}
|
|
2189
|
+
});
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
const ESM_STATIC_IMPORT_RE = /(?<=\s|^|;|\})import\s*([\s"']*(?<imports>[\p{L}\p{M}\w\t\n\r $*,/{}@.]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gmu;
|
|
2193
|
+
const DYNAMIC_IMPORT_RE = /import\s*\((?<expression>(?:[^()]+|\((?:[^()]+|\([^()]*\))*\))*)\)/gm;
|
|
2194
|
+
const IMPORT_NAMED_TYPE_RE = /(?<=\s|^|;|})import\s*type\s+([\s"']*(?<imports>[\w\t\n\r $*,/{}]+)from\s*)?["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][\s;]*/gm;
|
|
2195
|
+
const EXPORT_DECAL_RE = /\bexport\s+(?<declaration>(async function\s*\*?|function\s*\*?|let|const enum|const|enum|var|class))\s+\*?(?<name>[\w$]+)(?<extraNames>.*,\s*[\s\w:[\]{}]*[\w$\]}]+)*/g;
|
|
2196
|
+
const EXPORT_DECAL_TYPE_RE = /\bexport\s+(?<declaration>(interface|type|declare (async function|function|let|const enum|const|enum|var|class)))\s+(?<name>[\w$]+)/g;
|
|
2197
|
+
const EXPORT_NAMED_RE = /\bexport\s*{(?<exports>[^}]+?)[\s,]*}(\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][^\n;]*)?/g;
|
|
2198
|
+
const EXPORT_NAMED_TYPE_RE = /\bexport\s+type\s*{(?<exports>[^}]+?)[\s,]*}(\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][^\n;]*)?/g;
|
|
2199
|
+
const EXPORT_NAMED_DESTRUCT = /\bexport\s+(let|var|const)\s+(?:{(?<exports1>[^}]+?)[\s,]*}|\[(?<exports2>[^\]]+?)[\s,]*])\s+=/gm;
|
|
2200
|
+
const EXPORT_STAR_RE = /\bexport\s*(\*)(\s*as\s+(?<name>[\w$]+)\s+)?\s*(\s*from\s*["']\s*(?<specifier>(?<="\s*)[^"]*[^\s"](?=\s*")|(?<='\s*)[^']*[^\s'](?=\s*'))\s*["'][^\n;]*)?/g;
|
|
2201
|
+
const EXPORT_DEFAULT_RE = /\bexport\s+default\s+(async function|function|class|true|false|\W|\d)|\bexport\s+default\s+(?<defaultName>.*)/g;
|
|
2202
|
+
const TYPE_RE = /^\s*?type\s/;
|
|
2203
|
+
function findStaticImports(code) {
|
|
2204
|
+
return _filterStatement(
|
|
2205
|
+
_tryGetLocations(code, "import"),
|
|
2206
|
+
matchAll(ESM_STATIC_IMPORT_RE, code, { type: "static" })
|
|
2207
|
+
);
|
|
2208
|
+
}
|
|
2209
|
+
function findDynamicImports(code) {
|
|
2210
|
+
return _filterStatement(
|
|
2211
|
+
_tryGetLocations(code, "import"),
|
|
2212
|
+
matchAll(DYNAMIC_IMPORT_RE, code, { type: "dynamic" })
|
|
2213
|
+
);
|
|
2214
|
+
}
|
|
2215
|
+
function findTypeImports(code) {
|
|
2216
|
+
return [
|
|
2217
|
+
...matchAll(IMPORT_NAMED_TYPE_RE, code, { type: "type" }),
|
|
2218
|
+
...matchAll(ESM_STATIC_IMPORT_RE, code, { type: "static" }).filter(
|
|
2219
|
+
(match) => /[^A-Za-z]type\s/.test(match.imports)
|
|
2220
|
+
)
|
|
2221
|
+
];
|
|
2222
|
+
}
|
|
2223
|
+
function parseStaticImport(matched) {
|
|
2224
|
+
const cleanedImports = clearImports(matched.imports);
|
|
2225
|
+
const namedImports = {};
|
|
2226
|
+
const _matches = cleanedImports.match(/{([^}]*)}/)?.[1]?.split(",") || [];
|
|
2227
|
+
for (const namedImport of _matches) {
|
|
2228
|
+
const _match = namedImport.match(/^\s*(\S*) as (\S*)\s*$/);
|
|
2229
|
+
const source = _match?.[1] || namedImport.trim();
|
|
2230
|
+
const importName = _match?.[2] || source;
|
|
2231
|
+
if (source && !TYPE_RE.test(source)) {
|
|
2232
|
+
namedImports[source] = importName;
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
const { namespacedImport, defaultImport } = getImportNames(cleanedImports);
|
|
2236
|
+
return {
|
|
2237
|
+
...matched,
|
|
2238
|
+
defaultImport,
|
|
2239
|
+
namespacedImport,
|
|
2240
|
+
namedImports
|
|
2241
|
+
};
|
|
2242
|
+
}
|
|
2243
|
+
function parseTypeImport(matched) {
|
|
2244
|
+
if (matched.type === "type") {
|
|
2245
|
+
return parseStaticImport(matched);
|
|
2246
|
+
}
|
|
2247
|
+
const cleanedImports = clearImports(matched.imports);
|
|
2248
|
+
const namedImports = {};
|
|
2249
|
+
const _matches = cleanedImports.match(/{([^}]*)}/)?.[1]?.split(",") || [];
|
|
2250
|
+
for (const namedImport of _matches) {
|
|
2251
|
+
const _match = /\s+as\s+/.test(namedImport) ? namedImport.match(/^\s*type\s+(\S*) as (\S*)\s*$/) : namedImport.match(/^\s*type\s+(\S*)\s*$/);
|
|
2252
|
+
const source = _match?.[1] || namedImport.trim();
|
|
2253
|
+
const importName = _match?.[2] || source;
|
|
2254
|
+
if (source && TYPE_RE.test(namedImport)) {
|
|
2255
|
+
namedImports[source] = importName;
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
const { namespacedImport, defaultImport } = getImportNames(cleanedImports);
|
|
2259
|
+
return {
|
|
2260
|
+
...matched,
|
|
2261
|
+
defaultImport,
|
|
2262
|
+
namespacedImport,
|
|
2263
|
+
namedImports
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
function findExports(code) {
|
|
2267
|
+
const declaredExports = matchAll(EXPORT_DECAL_RE, code, {
|
|
2268
|
+
type: "declaration"
|
|
2269
|
+
});
|
|
2270
|
+
for (const declaredExport of declaredExports) {
|
|
2271
|
+
const extraNamesStr = declaredExport.extraNames;
|
|
2272
|
+
if (extraNamesStr) {
|
|
2273
|
+
const extraNames = matchAll(
|
|
2274
|
+
/({.*?})|(\[.*?])|(,\s*(?<name>\w+))/g,
|
|
2275
|
+
extraNamesStr,
|
|
2276
|
+
{}
|
|
2277
|
+
).map((m) => m.name).filter(Boolean);
|
|
2278
|
+
declaredExport.names = [declaredExport.name, ...extraNames];
|
|
2279
|
+
}
|
|
2280
|
+
delete declaredExport.extraNames;
|
|
2281
|
+
}
|
|
2282
|
+
const namedExports = normalizeNamedExports(
|
|
2283
|
+
matchAll(EXPORT_NAMED_RE, code, {
|
|
2284
|
+
type: "named"
|
|
2285
|
+
})
|
|
2286
|
+
);
|
|
2287
|
+
const destructuredExports = matchAll(
|
|
2288
|
+
EXPORT_NAMED_DESTRUCT,
|
|
2289
|
+
code,
|
|
2290
|
+
{ type: "named" }
|
|
2291
|
+
);
|
|
2292
|
+
for (const namedExport of destructuredExports) {
|
|
2293
|
+
namedExport.exports = namedExport.exports1 || namedExport.exports2;
|
|
2294
|
+
namedExport.names = namedExport.exports.replace(/^\r?\n?/, "").split(/\s*,\s*/g).filter((name) => !TYPE_RE.test(name)).map(
|
|
2295
|
+
(name) => name.replace(/^.*?\s*:\s*/, "").replace(/\s*=\s*.*$/, "").trim()
|
|
2296
|
+
);
|
|
2297
|
+
}
|
|
2298
|
+
const defaultExport = matchAll(EXPORT_DEFAULT_RE, code, {
|
|
2299
|
+
type: "default",
|
|
2300
|
+
name: "default"
|
|
2301
|
+
});
|
|
2302
|
+
const starExports = matchAll(EXPORT_STAR_RE, code, {
|
|
2303
|
+
type: "star"
|
|
2304
|
+
});
|
|
2305
|
+
const exports = normalizeExports([
|
|
2306
|
+
...declaredExports,
|
|
2307
|
+
...namedExports,
|
|
2308
|
+
...destructuredExports,
|
|
2309
|
+
...defaultExport,
|
|
2310
|
+
...starExports
|
|
2311
|
+
]);
|
|
2312
|
+
if (exports.length === 0) {
|
|
2313
|
+
return [];
|
|
2314
|
+
}
|
|
2315
|
+
const exportLocations = _tryGetLocations(code, "export");
|
|
2316
|
+
if (exportLocations && exportLocations.length === 0) {
|
|
2317
|
+
return [];
|
|
2318
|
+
}
|
|
2319
|
+
return (
|
|
2320
|
+
// Filter false positive export matches
|
|
2321
|
+
_filterStatement(exportLocations, exports).filter((exp, index, exports2) => {
|
|
2322
|
+
const nextExport = exports2[index + 1];
|
|
2323
|
+
return !nextExport || exp.type !== nextExport.type || !exp.name || exp.name !== nextExport.name;
|
|
2324
|
+
})
|
|
2325
|
+
);
|
|
2326
|
+
}
|
|
2327
|
+
function findTypeExports(code) {
|
|
2328
|
+
const declaredExports = matchAll(
|
|
2329
|
+
EXPORT_DECAL_TYPE_RE,
|
|
2330
|
+
code,
|
|
2331
|
+
{ type: "declaration" }
|
|
2332
|
+
);
|
|
2333
|
+
const namedExports = normalizeNamedExports(
|
|
2334
|
+
matchAll(EXPORT_NAMED_TYPE_RE, code, {
|
|
2335
|
+
type: "named"
|
|
2336
|
+
})
|
|
2337
|
+
);
|
|
2338
|
+
const exports = normalizeExports([
|
|
2339
|
+
...declaredExports,
|
|
2340
|
+
...namedExports
|
|
2341
|
+
]);
|
|
2342
|
+
if (exports.length === 0) {
|
|
2343
|
+
return [];
|
|
2344
|
+
}
|
|
2345
|
+
const exportLocations = _tryGetLocations(code, "export");
|
|
2346
|
+
if (exportLocations && exportLocations.length === 0) {
|
|
2347
|
+
return [];
|
|
2348
|
+
}
|
|
2349
|
+
return (
|
|
2350
|
+
// Filter false positive export matches
|
|
2351
|
+
_filterStatement(exportLocations, exports).filter((exp, index, exports2) => {
|
|
2352
|
+
const nextExport = exports2[index + 1];
|
|
2353
|
+
return !nextExport || exp.type !== nextExport.type || !exp.name || exp.name !== nextExport.name;
|
|
2354
|
+
})
|
|
2355
|
+
);
|
|
2356
|
+
}
|
|
2357
|
+
function normalizeExports(exports) {
|
|
2358
|
+
for (const exp of exports) {
|
|
2359
|
+
if (!exp.name && exp.names && exp.names.length === 1) {
|
|
2360
|
+
exp.name = exp.names[0];
|
|
2361
|
+
}
|
|
2362
|
+
if (exp.name === "default" && exp.type !== "default") {
|
|
2363
|
+
exp._type = exp.type;
|
|
2364
|
+
exp.type = "default";
|
|
2365
|
+
}
|
|
2366
|
+
if (!exp.names && exp.name) {
|
|
2367
|
+
exp.names = [exp.name];
|
|
2368
|
+
}
|
|
2369
|
+
if (exp.type === "declaration" && exp.declaration) {
|
|
2370
|
+
exp.declarationType = exp.declaration.replace(
|
|
2371
|
+
/^declare\s*/,
|
|
2372
|
+
""
|
|
2373
|
+
);
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
return exports;
|
|
2377
|
+
}
|
|
2378
|
+
function normalizeNamedExports(namedExports) {
|
|
2379
|
+
for (const namedExport of namedExports) {
|
|
2380
|
+
namedExport.names = namedExport.exports.replace(/^\r?\n?/, "").split(/\s*,\s*/g).filter((name) => !TYPE_RE.test(name)).map((name) => name.replace(/^.*?\sas\s/, "").trim());
|
|
2381
|
+
}
|
|
2382
|
+
return namedExports;
|
|
2383
|
+
}
|
|
2384
|
+
function findExportNames(code) {
|
|
2385
|
+
return findExports(code).flatMap((exp) => exp.names).filter(Boolean);
|
|
2386
|
+
}
|
|
2387
|
+
async function resolveModuleExportNames(id, options) {
|
|
2388
|
+
const url = await resolvePath(id, options);
|
|
2389
|
+
const code = await loadURL(url);
|
|
2390
|
+
const exports = findExports(code);
|
|
2391
|
+
const exportNames = new Set(
|
|
2392
|
+
exports.flatMap((exp) => exp.names).filter(Boolean)
|
|
2393
|
+
);
|
|
2394
|
+
for (const exp of exports) {
|
|
2395
|
+
if (exp.type !== "star" || !exp.specifier) {
|
|
2396
|
+
continue;
|
|
2397
|
+
}
|
|
2398
|
+
const subExports = await resolveModuleExportNames(exp.specifier, {
|
|
2399
|
+
...options,
|
|
2400
|
+
url
|
|
2401
|
+
});
|
|
2402
|
+
for (const subExport of subExports) {
|
|
2403
|
+
exportNames.add(subExport);
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
return [...exportNames];
|
|
2407
|
+
}
|
|
2408
|
+
function _filterStatement(locations, statements) {
|
|
2409
|
+
return statements.filter((exp) => {
|
|
2410
|
+
return !locations || locations.some((location) => {
|
|
2411
|
+
return exp.start <= location.start && exp.end >= location.end;
|
|
2412
|
+
});
|
|
2413
|
+
});
|
|
2414
|
+
}
|
|
2415
|
+
function _tryGetLocations(code, label) {
|
|
2416
|
+
try {
|
|
2417
|
+
return _getLocations(code, label);
|
|
2418
|
+
} catch {
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
function _getLocations(code, label) {
|
|
2422
|
+
const tokens = tokenizer(code, {
|
|
2423
|
+
ecmaVersion: "latest",
|
|
2424
|
+
sourceType: "module",
|
|
2425
|
+
allowHashBang: true,
|
|
2426
|
+
allowAwaitOutsideFunction: true,
|
|
2427
|
+
allowImportExportEverywhere: true
|
|
2428
|
+
});
|
|
2429
|
+
const locations = [];
|
|
2430
|
+
for (const token of tokens) {
|
|
2431
|
+
if (token.type.label === label) {
|
|
2432
|
+
locations.push({
|
|
2433
|
+
start: token.start,
|
|
2434
|
+
end: token.end
|
|
2435
|
+
});
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
return locations;
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
function createCommonJS(url) {
|
|
2442
|
+
const __filename = fileURLToPath(url);
|
|
2443
|
+
const __dirname = dirname(__filename);
|
|
2444
|
+
let _nativeRequire;
|
|
2445
|
+
const getNativeRequire = () => {
|
|
2446
|
+
if (!_nativeRequire) {
|
|
2447
|
+
_nativeRequire = createRequire(url);
|
|
2448
|
+
}
|
|
2449
|
+
return _nativeRequire;
|
|
2450
|
+
};
|
|
2451
|
+
function require(id) {
|
|
2452
|
+
return getNativeRequire()(id);
|
|
2453
|
+
}
|
|
2454
|
+
require.resolve = function requireResolve(id, options) {
|
|
2455
|
+
return getNativeRequire().resolve(id, options);
|
|
2456
|
+
};
|
|
2457
|
+
return {
|
|
2458
|
+
__filename,
|
|
2459
|
+
__dirname,
|
|
2460
|
+
require
|
|
2461
|
+
};
|
|
2462
|
+
}
|
|
2463
|
+
function interopDefault(sourceModule, opts = {}) {
|
|
2464
|
+
if (!isObject(sourceModule) || !("default" in sourceModule)) {
|
|
2465
|
+
return sourceModule;
|
|
2466
|
+
}
|
|
2467
|
+
const defaultValue = sourceModule.default;
|
|
2468
|
+
if (defaultValue === void 0 || defaultValue === null) {
|
|
2469
|
+
return sourceModule;
|
|
2470
|
+
}
|
|
2471
|
+
const _defaultType = typeof defaultValue;
|
|
2472
|
+
if (_defaultType !== "object" && !(_defaultType === "function" && !opts.preferNamespace)) {
|
|
2473
|
+
return opts.preferNamespace ? sourceModule : defaultValue;
|
|
2474
|
+
}
|
|
2475
|
+
for (const key in sourceModule) {
|
|
2476
|
+
try {
|
|
2477
|
+
if (!(key in defaultValue)) {
|
|
2478
|
+
Object.defineProperty(defaultValue, key, {
|
|
2479
|
+
enumerable: key !== "default",
|
|
2480
|
+
configurable: key !== "default",
|
|
2481
|
+
get() {
|
|
2482
|
+
return sourceModule[key];
|
|
2483
|
+
}
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
} catch {
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
return defaultValue;
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
const EVAL_ESM_IMPORT_RE = /(?<=import .* from ["'])([^"']+)(?=["'])|(?<=export .* from ["'])([^"']+)(?=["'])|(?<=import\s*["'])([^"']+)(?=["'])|(?<=import\s*\(["'])([^"']+)(?=["']\))/g;
|
|
2493
|
+
async function loadModule(id, options = {}) {
|
|
2494
|
+
const url = await resolve(id, options);
|
|
2495
|
+
const code = await loadURL(url);
|
|
2496
|
+
return evalModule(code, { ...options, url });
|
|
2497
|
+
}
|
|
2498
|
+
async function evalModule(code, options = {}) {
|
|
2499
|
+
const transformed = await transformModule(code, options);
|
|
2500
|
+
const dataURL = toDataURL(transformed);
|
|
2501
|
+
return import(dataURL).catch((error) => {
|
|
2502
|
+
error.stack = error.stack.replace(
|
|
2503
|
+
new RegExp(dataURL, "g"),
|
|
2504
|
+
options.url || "_mlly_eval_"
|
|
2505
|
+
);
|
|
2506
|
+
throw error;
|
|
2507
|
+
});
|
|
2508
|
+
}
|
|
2509
|
+
function transformModule(code, options = {}) {
|
|
2510
|
+
if (options.url && options.url.endsWith(".json")) {
|
|
2511
|
+
return Promise.resolve("export default " + code);
|
|
2512
|
+
}
|
|
2513
|
+
if (options.url) {
|
|
2514
|
+
code = code.replace(/import\.meta\.url/g, `'${options.url}'`);
|
|
2515
|
+
}
|
|
2516
|
+
return Promise.resolve(code);
|
|
2517
|
+
}
|
|
2518
|
+
async function resolveImports(code, options) {
|
|
2519
|
+
const imports = [...code.matchAll(EVAL_ESM_IMPORT_RE)].map((m) => m[0]);
|
|
2520
|
+
if (imports.length === 0) {
|
|
2521
|
+
return code;
|
|
2522
|
+
}
|
|
2523
|
+
const uniqueImports = [...new Set(imports)];
|
|
2524
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
2525
|
+
await Promise.all(
|
|
2526
|
+
uniqueImports.map(async (id) => {
|
|
2527
|
+
let url = await resolve(id, options);
|
|
2528
|
+
if (url.endsWith(".json")) {
|
|
2529
|
+
const code2 = await loadURL(url);
|
|
2530
|
+
url = toDataURL(await transformModule(code2, { url }));
|
|
2531
|
+
}
|
|
2532
|
+
resolved.set(id, url);
|
|
2533
|
+
})
|
|
2534
|
+
);
|
|
2535
|
+
const re = new RegExp(
|
|
2536
|
+
uniqueImports.map((index) => `(${index})`).join("|"),
|
|
2537
|
+
"g"
|
|
2538
|
+
);
|
|
2539
|
+
return code.replace(re, (id) => resolved.get(id));
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
const ESM_RE = /([\s;]|^)(import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m;
|
|
2543
|
+
const CJS_RE = /([\s;]|^)(module.exports\b|exports\.\w|require\s*\(|global\.\w)/m;
|
|
2544
|
+
const COMMENT_RE = /\/\*.+?\*\/|\/\/.*(?=[nr])/g;
|
|
2545
|
+
const BUILTIN_EXTENSIONS = /* @__PURE__ */ new Set([".mjs", ".cjs", ".node", ".wasm"]);
|
|
2546
|
+
function hasESMSyntax(code, opts = {}) {
|
|
2547
|
+
if (opts.stripComments) {
|
|
2548
|
+
code = code.replace(COMMENT_RE, "");
|
|
2549
|
+
}
|
|
2550
|
+
return ESM_RE.test(code);
|
|
2551
|
+
}
|
|
2552
|
+
function hasCJSSyntax(code, opts = {}) {
|
|
2553
|
+
if (opts.stripComments) {
|
|
2554
|
+
code = code.replace(COMMENT_RE, "");
|
|
2555
|
+
}
|
|
2556
|
+
return CJS_RE.test(code);
|
|
2557
|
+
}
|
|
2558
|
+
function detectSyntax(code, opts = {}) {
|
|
2559
|
+
if (opts.stripComments) {
|
|
2560
|
+
code = code.replace(COMMENT_RE, "");
|
|
2561
|
+
}
|
|
2562
|
+
const hasESM = hasESMSyntax(code, {});
|
|
2563
|
+
const hasCJS = hasCJSSyntax(code, {});
|
|
2564
|
+
return {
|
|
2565
|
+
hasESM,
|
|
2566
|
+
hasCJS,
|
|
2567
|
+
isMixed: hasESM && hasCJS
|
|
2568
|
+
};
|
|
2569
|
+
}
|
|
2570
|
+
const validNodeImportDefaults = {
|
|
2571
|
+
allowedProtocols: ["node", "file", "data"]
|
|
2572
|
+
};
|
|
2573
|
+
async function isValidNodeImport(id, _options = {}) {
|
|
2574
|
+
if (isNodeBuiltin(id)) {
|
|
2575
|
+
return true;
|
|
2576
|
+
}
|
|
2577
|
+
const options = { ...validNodeImportDefaults, ..._options };
|
|
2578
|
+
const proto = getProtocol(id);
|
|
2579
|
+
if (proto && !options.allowedProtocols?.includes(proto)) {
|
|
2580
|
+
return false;
|
|
2581
|
+
}
|
|
2582
|
+
if (proto === "data") {
|
|
2583
|
+
return true;
|
|
2584
|
+
}
|
|
2585
|
+
const resolvedPath = await resolvePath(id, options);
|
|
2586
|
+
const extension = extname$1(resolvedPath);
|
|
2587
|
+
if (BUILTIN_EXTENSIONS.has(extension)) {
|
|
2588
|
+
return true;
|
|
2589
|
+
}
|
|
2590
|
+
if (extension !== ".js") {
|
|
2591
|
+
return false;
|
|
2592
|
+
}
|
|
2593
|
+
const package_ = await readPackageJSON(resolvedPath).catch(() => {
|
|
2594
|
+
});
|
|
2595
|
+
if (package_?.type === "module") {
|
|
2596
|
+
return true;
|
|
2597
|
+
}
|
|
2598
|
+
if (/\.(\w+-)?esm?(-\w+)?\.js$|\/(esm?)\//.test(resolvedPath)) {
|
|
2599
|
+
return false;
|
|
2600
|
+
}
|
|
2601
|
+
const code = options.code || await promises.readFile(resolvedPath, "utf8").catch(() => {
|
|
2602
|
+
}) || "";
|
|
2603
|
+
return !hasESMSyntax(code, { stripComments: options.stripComments });
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
export { DYNAMIC_IMPORT_RE, ESM_STATIC_IMPORT_RE, EXPORT_DECAL_RE, EXPORT_DECAL_TYPE_RE, createCommonJS, createResolve, detectSyntax, evalModule, fileURLToPath, findDynamicImports, findExportNames, findExports, findStaticImports, findTypeExports, findTypeImports, getProtocol, hasCJSSyntax, hasESMSyntax, interopDefault, isNodeBuiltin, isValidNodeImport, loadModule, loadURL, lookupNodeModuleSubpath, normalizeid, parseNodeModulePath, parseStaticImport, parseTypeImport, pathToFileURL, resolve, resolveImports, resolveModuleExportNames, resolvePath, resolvePathSync, resolveSync, sanitizeFilePath, sanitizeURIComponent, toDataURL, transformModule };
|