@depup/nitro 3.0.260311-beta-depup.0
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/LICENSE +27 -0
- package/README.md +32 -0
- package/changes.json +14 -0
- package/dist/THIRD-PARTY-LICENSES.md +1646 -0
- package/dist/_build/common.mjs +29361 -0
- package/dist/_build/rolldown.mjs +173 -0
- package/dist/_build/rollup.mjs +194 -0
- package/dist/_build/vite.build.mjs +18 -0
- package/dist/_chunks/nitro.mjs +1159 -0
- package/dist/_chunks/nitro2.mjs +102 -0
- package/dist/_chunks/nitro3.mjs +129 -0
- package/dist/_chunks/utils.mjs +272 -0
- package/dist/_common.mjs +35 -0
- package/dist/_dev.d.mts +12 -0
- package/dist/_dev.mjs +519 -0
- package/dist/_libs/_.mjs +3 -0
- package/dist/_libs/_2.mjs +2 -0
- package/dist/_libs/_3.mjs +3 -0
- package/dist/_libs/_4.mjs +2 -0
- package/dist/_libs/_5.mjs +3 -0
- package/dist/_libs/_6.mjs +4 -0
- package/dist/_libs/_7.mjs +5 -0
- package/dist/_libs/c12+rc9.mjs +812 -0
- package/dist/_libs/c12+readdirp+chokidar.d.mts +230 -0
- package/dist/_libs/citty.mjs +361 -0
- package/dist/_libs/commondir+is-reference.mjs +1311 -0
- package/dist/_libs/compatx.d.mts +47 -0
- package/dist/_libs/compatx.mjs +45 -0
- package/dist/_libs/esbuild.d.mts +20 -0
- package/dist/_libs/escape-string-regexp.mjs +7 -0
- package/dist/_libs/estree+pluginutils.d.mts +241 -0
- package/dist/_libs/estree-walker.mjs +184 -0
- package/dist/_libs/exsolve.d.mts +1 -0
- package/dist/_libs/hasown+resolve+deepmerge.mjs +1949 -0
- package/dist/_libs/httpxy.d.mts +82 -0
- package/dist/_libs/httpxy.mjs +671 -0
- package/dist/_libs/js-tokens.d.mts +1 -0
- package/dist/_libs/klona.mjs +37 -0
- package/dist/_libs/magic-string.d.mts +220 -0
- package/dist/_libs/mlly.d.mts +57 -0
- package/dist/_libs/nypm+tinyexec.mjs +845 -0
- package/dist/_libs/perfect-debounce.mjs +88 -0
- package/dist/_libs/pkg-types.d.mts +23 -0
- package/dist/_libs/plugin-alias.mjs +64 -0
- package/dist/_libs/plugin-inject.mjs +131 -0
- package/dist/_libs/plugin-json.mjs +34 -0
- package/dist/_libs/pluginutils.mjs +646 -0
- package/dist/_libs/readdirp+chokidar.mjs +1606 -0
- package/dist/_libs/remapping.mjs +115 -0
- package/dist/_libs/resolve-uri+gen-mapping.mjs +442 -0
- package/dist/_libs/rou3.d.mts +44 -0
- package/dist/_libs/rou3.mjs +496 -0
- package/dist/_libs/std-env.d.mts +12 -0
- package/dist/_libs/strip-literal.d.mts +1 -0
- package/dist/_libs/tsconfck.mjs +813 -0
- package/dist/_libs/ultrahtml.mjs +127 -0
- package/dist/_libs/unimport+unplugin.mjs +1684 -0
- package/dist/_libs/unplugin+unimport.d.mts +423 -0
- package/dist/_libs/unwasm.d.mts +29 -0
- package/dist/_presets.mjs +1759 -0
- package/dist/builder.d.mts +64 -0
- package/dist/builder.mjs +15 -0
- package/dist/cli/_chunks/build.mjs +47 -0
- package/dist/cli/_chunks/common.mjs +14 -0
- package/dist/cli/_chunks/deploy.mjs +40 -0
- package/dist/cli/_chunks/dev.mjs +62 -0
- package/dist/cli/_chunks/docs.mjs +30 -0
- package/dist/cli/_chunks/list.mjs +25 -0
- package/dist/cli/_chunks/prepare.mjs +17 -0
- package/dist/cli/_chunks/preview.mjs +51 -0
- package/dist/cli/_chunks/run.mjs +53 -0
- package/dist/cli/_chunks/task.mjs +14 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +22 -0
- package/dist/node_modules/@poppinss/colors/build/index.js +139 -0
- package/dist/node_modules/@poppinss/colors/package.json +118 -0
- package/dist/node_modules/@poppinss/dumper/build/chunk-26HALFTP.js +602 -0
- package/dist/node_modules/@poppinss/dumper/build/formatters/console/main.js +441 -0
- package/dist/node_modules/@poppinss/dumper/build/formatters/html/main.js +725 -0
- package/dist/node_modules/@poppinss/dumper/package.json +122 -0
- package/dist/node_modules/@poppinss/exception/build/index.js +44 -0
- package/dist/node_modules/@poppinss/exception/package.json +109 -0
- package/dist/node_modules/@sindresorhus/is/distribution/index.js +1354 -0
- package/dist/node_modules/@sindresorhus/is/distribution/utilities.js +3 -0
- package/dist/node_modules/@sindresorhus/is/package.json +81 -0
- package/dist/node_modules/@speed-highlight/core/dist/index.js +4 -0
- package/dist/node_modules/@speed-highlight/core/dist/terminal.js +2 -0
- package/dist/node_modules/@speed-highlight/core/package.json +94 -0
- package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
- package/dist/node_modules/cookie-es/package.json +37 -0
- package/dist/node_modules/croner/dist/croner.js +1 -0
- package/dist/node_modules/croner/package.json +73 -0
- package/dist/node_modules/defu/dist/defu.mjs +69 -0
- package/dist/node_modules/defu/package.json +43 -0
- package/dist/node_modules/destr/dist/index.mjs +72 -0
- package/dist/node_modules/destr/package.json +47 -0
- package/dist/node_modules/error-stack-parser-es/dist/index.mjs +38 -0
- package/dist/node_modules/error-stack-parser-es/dist/lite.mjs +167 -0
- package/dist/node_modules/error-stack-parser-es/package.json +83 -0
- package/dist/node_modules/get-port-please/dist/index.mjs +430 -0
- package/dist/node_modules/get-port-please/package.json +39 -0
- package/dist/node_modules/kleur/index.mjs +110 -0
- package/dist/node_modules/kleur/package.json +51 -0
- package/dist/node_modules/rendu/dist/index.mjs +380 -0
- package/dist/node_modules/rendu/package.json +47 -0
- package/dist/node_modules/scule/dist/index.mjs +80 -0
- package/dist/node_modules/scule/package.json +43 -0
- package/dist/node_modules/source-map/lib/array-set.js +100 -0
- package/dist/node_modules/source-map/lib/base64-vlq.js +94 -0
- package/dist/node_modules/source-map/lib/base64.js +19 -0
- package/dist/node_modules/source-map/lib/binary-search.js +113 -0
- package/dist/node_modules/source-map/lib/mapping-list.js +83 -0
- package/dist/node_modules/source-map/lib/mappings.wasm +0 -0
- package/dist/node_modules/source-map/lib/read-wasm.js +27 -0
- package/dist/node_modules/source-map/lib/source-map-consumer.js +1081 -0
- package/dist/node_modules/source-map/lib/source-map-generator.js +439 -0
- package/dist/node_modules/source-map/lib/source-node.js +430 -0
- package/dist/node_modules/source-map/lib/url.js +13 -0
- package/dist/node_modules/source-map/lib/util.js +444 -0
- package/dist/node_modules/source-map/lib/wasm.js +138 -0
- package/dist/node_modules/source-map/package.json +79 -0
- package/dist/node_modules/source-map/source-map.js +10 -0
- package/dist/node_modules/supports-color/index.js +202 -0
- package/dist/node_modules/supports-color/package.json +64 -0
- package/dist/node_modules/ufo/dist/index.mjs +645 -0
- package/dist/node_modules/ufo/package.json +48 -0
- package/dist/node_modules/unctx/dist/index.mjs +131 -0
- package/dist/node_modules/unctx/package.json +67 -0
- package/dist/node_modules/youch/build/helpers-B9BQYaS6.js +23 -0
- package/dist/node_modules/youch/build/index.js +212 -0
- package/dist/node_modules/youch/build/public/error_cause/style.css +5 -0
- package/dist/node_modules/youch/build/public/error_info/script.js +13 -0
- package/dist/node_modules/youch/build/public/error_info/style.css +145 -0
- package/dist/node_modules/youch/build/public/error_metadata/style.css +3 -0
- package/dist/node_modules/youch/build/public/error_stack/script.js +72 -0
- package/dist/node_modules/youch/build/public/error_stack/style.css +219 -0
- package/dist/node_modules/youch/build/public/error_stack_source/style.css +123 -0
- package/dist/node_modules/youch/build/public/header/script.js +14 -0
- package/dist/node_modules/youch/build/public/header/style.css +56 -0
- package/dist/node_modules/youch/build/public/layout/script.js +12 -0
- package/dist/node_modules/youch/build/public/layout/style.css +435 -0
- package/dist/node_modules/youch/build/public_dir-C5bujZKB.js +25 -0
- package/dist/node_modules/youch/build/src/templates/error_cause/main.js +44 -0
- package/dist/node_modules/youch/build/src/templates/error_info/main.js +72 -0
- package/dist/node_modules/youch/build/src/templates/error_metadata/main.js +65 -0
- package/dist/node_modules/youch/build/src/templates/error_stack/main.js +152 -0
- package/dist/node_modules/youch/build/src/templates/error_stack_source/main.js +46 -0
- package/dist/node_modules/youch/build/src/templates/header/main.js +24 -0
- package/dist/node_modules/youch/build/src/templates/layout/main.js +27 -0
- package/dist/node_modules/youch/package.json +135 -0
- package/dist/node_modules/youch-core/build/index.js +316 -0
- package/dist/node_modules/youch-core/package.json +124 -0
- package/dist/presets/_nitro/runtime/nitro-dev.mjs +20 -0
- package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +15 -0
- package/dist/presets/_nitro/runtime/service-worker.mjs +23 -0
- package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +14 -0
- package/dist/presets/aws-lambda/runtime/_utils.mjs +116 -0
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +31 -0
- package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +13 -0
- package/dist/presets/azure/runtime/_utils.mjs +50 -0
- package/dist/presets/azure/runtime/azure-swa.mjs +30 -0
- package/dist/presets/bun/runtime/bun.mjs +40 -0
- package/dist/presets/cloudflare/runtime/_module-handler.mjs +87 -0
- package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +72 -0
- package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +17 -0
- package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +39 -0
- package/dist/presets/cloudflare/runtime/plugin.dev.mjs +96 -0
- package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
- package/dist/presets/deno/runtime/deno-deploy.mjs +19 -0
- package/dist/presets/deno/runtime/deno-server.mjs +39 -0
- package/dist/presets/netlify/runtime/netlify-edge.mjs +20 -0
- package/dist/presets/netlify/runtime/netlify.mjs +20 -0
- package/dist/presets/node/runtime/node-cluster.mjs +54 -0
- package/dist/presets/node/runtime/node-middleware.mjs +14 -0
- package/dist/presets/node/runtime/node-server.mjs +47 -0
- package/dist/presets/standard/runtime/server.mjs +4 -0
- package/dist/presets/stormkit/runtime/stormkit.mjs +27 -0
- package/dist/presets/vercel/runtime/cron-handler.mjs +25 -0
- package/dist/presets/vercel/runtime/isr.mjs +19 -0
- package/dist/presets/vercel/runtime/vercel.node.mjs +24 -0
- package/dist/presets/vercel/runtime/vercel.web.mjs +23 -0
- package/dist/presets/winterjs/runtime/winterjs.mjs +91 -0
- package/dist/presets/zeabur/runtime/zeabur.mjs +4 -0
- package/dist/presets/zephyr/runtime/server.mjs +3 -0
- package/dist/runtime/app.d.mts +1 -0
- package/dist/runtime/app.mjs +1 -0
- package/dist/runtime/cache.d.mts +1 -0
- package/dist/runtime/cache.mjs +1 -0
- package/dist/runtime/config.d.mts +3 -0
- package/dist/runtime/config.mjs +4 -0
- package/dist/runtime/context.d.mts +1 -0
- package/dist/runtime/context.mjs +1 -0
- package/dist/runtime/database.d.mts +1 -0
- package/dist/runtime/database.mjs +1 -0
- package/dist/runtime/internal/app.d.mts +16 -0
- package/dist/runtime/internal/app.mjs +208 -0
- package/dist/runtime/internal/cache.d.mts +7 -0
- package/dist/runtime/internal/cache.mjs +41 -0
- package/dist/runtime/internal/context.d.mts +14 -0
- package/dist/runtime/internal/context.mjs +24 -0
- package/dist/runtime/internal/database.d.mts +2 -0
- package/dist/runtime/internal/database.mjs +12 -0
- package/dist/runtime/internal/empty.mjs +0 -0
- package/dist/runtime/internal/error/dev.d.mts +10 -0
- package/dist/runtime/internal/error/dev.mjs +121 -0
- package/dist/runtime/internal/error/hooks.d.mts +1 -0
- package/dist/runtime/internal/error/hooks.mjs +9 -0
- package/dist/runtime/internal/error/prod.d.mts +6 -0
- package/dist/runtime/internal/error/prod.mjs +40 -0
- package/dist/runtime/internal/error/utils.d.mts +8 -0
- package/dist/runtime/internal/error/utils.mjs +3 -0
- package/dist/runtime/internal/meta.d.mts +2 -0
- package/dist/runtime/internal/meta.mjs +3 -0
- package/dist/runtime/internal/plugin.d.mts +3 -0
- package/dist/runtime/internal/plugin.mjs +4 -0
- package/dist/runtime/internal/route-rules.d.mts +9 -0
- package/dist/runtime/internal/route-rules.mjs +72 -0
- package/dist/runtime/internal/routes/dev-tasks.d.mts +3 -0
- package/dist/runtime/internal/routes/dev-tasks.mjs +25 -0
- package/dist/runtime/internal/routes/openapi.d.mts +3 -0
- package/dist/runtime/internal/routes/openapi.mjs +94 -0
- package/dist/runtime/internal/routes/renderer-template.d.mts +2 -0
- package/dist/runtime/internal/routes/renderer-template.dev.d.mts +3 -0
- package/dist/runtime/internal/routes/renderer-template.dev.mjs +19 -0
- package/dist/runtime/internal/routes/renderer-template.mjs +4 -0
- package/dist/runtime/internal/routes/scalar.d.mts +3 -0
- package/dist/runtime/internal/routes/scalar.mjs +193 -0
- package/dist/runtime/internal/routes/swagger.d.mts +3 -0
- package/dist/runtime/internal/routes/swagger.mjs +42 -0
- package/dist/runtime/internal/runtime-config.d.mts +9 -0
- package/dist/runtime/internal/runtime-config.mjs +54 -0
- package/dist/runtime/internal/static.d.mts +3 -0
- package/dist/runtime/internal/static.mjs +67 -0
- package/dist/runtime/internal/storage.d.mts +2 -0
- package/dist/runtime/internal/storage.mjs +6 -0
- package/dist/runtime/internal/task.d.mts +19 -0
- package/dist/runtime/internal/task.mjs +69 -0
- package/dist/runtime/internal/vite/dev-entry.mjs +18 -0
- package/dist/runtime/internal/vite/dev-worker.mjs +264 -0
- package/dist/runtime/internal/vite/ssr-renderer.mjs +6 -0
- package/dist/runtime/meta.d.mts +5 -0
- package/dist/runtime/meta.mjs +27 -0
- package/dist/runtime/nitro.d.mts +11 -0
- package/dist/runtime/nitro.mjs +34 -0
- package/dist/runtime/runtime-config.d.mts +1 -0
- package/dist/runtime/runtime-config.mjs +1 -0
- package/dist/runtime/storage.d.mts +1 -0
- package/dist/runtime/storage.mjs +1 -0
- package/dist/runtime/task.d.mts +1 -0
- package/dist/runtime/task.mjs +1 -0
- package/dist/runtime/virtual/_runtime_warn.d.mts +1 -0
- package/dist/runtime/virtual/_runtime_warn.mjs +5 -0
- package/dist/runtime/virtual/database.d.mts +8 -0
- package/dist/runtime/virtual/database.mjs +2 -0
- package/dist/runtime/virtual/error-handler.d.mts +6 -0
- package/dist/runtime/virtual/error-handler.mjs +9 -0
- package/dist/runtime/virtual/feature-flags.d.mts +7 -0
- package/dist/runtime/virtual/feature-flags.mjs +7 -0
- package/dist/runtime/virtual/plugins.d.mts +3 -0
- package/dist/runtime/virtual/plugins.mjs +2 -0
- package/dist/runtime/virtual/polyfills.d.mts +3 -0
- package/dist/runtime/virtual/polyfills.mjs +2 -0
- package/dist/runtime/virtual/public-assets.d.mts +9 -0
- package/dist/runtime/virtual/public-assets.mjs +8 -0
- package/dist/runtime/virtual/renderer-template.d.mts +4 -0
- package/dist/runtime/virtual/renderer-template.mjs +7 -0
- package/dist/runtime/virtual/routing-meta.d.mts +7 -0
- package/dist/runtime/virtual/routing-meta.mjs +2 -0
- package/dist/runtime/virtual/routing.d.mts +8 -0
- package/dist/runtime/virtual/routing.mjs +11 -0
- package/dist/runtime/virtual/runtime-config.d.mts +3 -0
- package/dist/runtime/virtual/runtime-config.mjs +5 -0
- package/dist/runtime/virtual/server-assets.d.mts +7 -0
- package/dist/runtime/virtual/server-assets.mjs +12 -0
- package/dist/runtime/virtual/storage.d.mts +3 -0
- package/dist/runtime/virtual/storage.mjs +5 -0
- package/dist/runtime/virtual/tasks.d.mts +10 -0
- package/dist/runtime/virtual/tasks.mjs +3 -0
- package/dist/runtime/vite.d.mts +8 -0
- package/dist/runtime/vite.mjs +9 -0
- package/dist/types/index.d.mts +3010 -0
- package/dist/types/index.mjs +1 -0
- package/dist/vite.d.mts +52 -0
- package/dist/vite.mjs +740 -0
- package/lib/h3.d.mts +1 -0
- package/lib/h3.mjs +1 -0
- package/lib/tsconfig.json +27 -0
- package/lib/vite.types.d.mts +26 -0
- package/lib/vite.types.mjs +2 -0
- package/package.json +256 -0
- package/skills/nitro/SKILL.md +10 -0
- package/skills/nitro/docs/TOC.md +83 -0
- package/skills/nitro/docs/_navigation.json +679 -0
- package/skills/nitro/docs/config/index.md +1147 -0
- package/skills/nitro/docs/deploy/index.md +64 -0
- package/skills/nitro/docs/deploy/providers/alwaysdata.md +50 -0
- package/skills/nitro/docs/deploy/providers/aws-amplify.md +81 -0
- package/skills/nitro/docs/deploy/providers/aws.md +47 -0
- package/skills/nitro/docs/deploy/providers/azure.md +72 -0
- package/skills/nitro/docs/deploy/providers/cleavr.md +33 -0
- package/skills/nitro/docs/deploy/providers/cloudflare.md +375 -0
- package/skills/nitro/docs/deploy/providers/deno-deploy.md +66 -0
- package/skills/nitro/docs/deploy/providers/digitalocean.md +46 -0
- package/skills/nitro/docs/deploy/providers/firebase.md +32 -0
- package/skills/nitro/docs/deploy/providers/flightcontrol.md +67 -0
- package/skills/nitro/docs/deploy/providers/genezio.md +67 -0
- package/skills/nitro/docs/deploy/providers/github-pages.md +68 -0
- package/skills/nitro/docs/deploy/providers/gitlab-pages.md +37 -0
- package/skills/nitro/docs/deploy/providers/heroku.md +84 -0
- package/skills/nitro/docs/deploy/providers/iis.md +38 -0
- package/skills/nitro/docs/deploy/providers/koyeb.md +109 -0
- package/skills/nitro/docs/deploy/providers/netlify.md +47 -0
- package/skills/nitro/docs/deploy/providers/platform-sh.md +37 -0
- package/skills/nitro/docs/deploy/providers/render.md +37 -0
- package/skills/nitro/docs/deploy/providers/stormkit.md +24 -0
- package/skills/nitro/docs/deploy/providers/vercel.md +179 -0
- package/skills/nitro/docs/deploy/providers/zeabur.md +19 -0
- package/skills/nitro/docs/deploy/providers/zephyr.md +99 -0
- package/skills/nitro/docs/deploy/providers/zerops.md +102 -0
- package/skills/nitro/docs/deploy/runtimes/bun.md +15 -0
- package/skills/nitro/docs/deploy/runtimes/deno.md +19 -0
- package/skills/nitro/docs/deploy/runtimes/node.md +63 -0
- package/skills/nitro/docs/docs/assets.md +166 -0
- package/skills/nitro/docs/docs/cache.md +408 -0
- package/skills/nitro/docs/docs/configuration.md +256 -0
- package/skills/nitro/docs/docs/database.md +185 -0
- package/skills/nitro/docs/docs/index.md +56 -0
- package/skills/nitro/docs/docs/lifecycle.md +204 -0
- package/skills/nitro/docs/docs/migration.md +215 -0
- package/skills/nitro/docs/docs/nightly.md +31 -0
- package/skills/nitro/docs/docs/plugins.md +164 -0
- package/skills/nitro/docs/docs/quick-start.md +110 -0
- package/skills/nitro/docs/docs/renderer.md +322 -0
- package/skills/nitro/docs/docs/routing.md +711 -0
- package/skills/nitro/docs/docs/server-entry.md +239 -0
- package/skills/nitro/docs/docs/storage.md +261 -0
- package/skills/nitro/docs/docs/tasks.md +277 -0
- package/skills/nitro/docs/examples/api-routes.md +145 -0
- package/skills/nitro/docs/examples/auto-imports.md +93 -0
- package/skills/nitro/docs/examples/cached-handler.md +81 -0
- package/skills/nitro/docs/examples/custom-error-handler.md +98 -0
- package/skills/nitro/docs/examples/database.md +157 -0
- package/skills/nitro/docs/examples/elysia.md +70 -0
- package/skills/nitro/docs/examples/express.md +78 -0
- package/skills/nitro/docs/examples/fastify.md +79 -0
- package/skills/nitro/docs/examples/hello-world.md +68 -0
- package/skills/nitro/docs/examples/hono.md +74 -0
- package/skills/nitro/docs/examples/import-alias.md +100 -0
- package/skills/nitro/docs/examples/index.md +3 -0
- package/skills/nitro/docs/examples/middleware.md +91 -0
- package/skills/nitro/docs/examples/mono-jsx.md +68 -0
- package/skills/nitro/docs/examples/nano-jsx.md +70 -0
- package/skills/nitro/docs/examples/plugins.md +91 -0
- package/skills/nitro/docs/examples/renderer.md +113 -0
- package/skills/nitro/docs/examples/runtime-config.md +97 -0
- package/skills/nitro/docs/examples/server-fetch.md +87 -0
- package/skills/nitro/docs/examples/shiki.md +198 -0
- package/skills/nitro/docs/examples/virtual-routes.md +74 -0
- package/skills/nitro/docs/examples/vite-nitro-plugin.md +79 -0
- package/skills/nitro/docs/examples/vite-rsc.md +1041 -0
- package/skills/nitro/docs/examples/vite-ssr-html.md +217 -0
- package/skills/nitro/docs/examples/vite-ssr-preact.md +247 -0
- package/skills/nitro/docs/examples/vite-ssr-react.md +226 -0
- package/skills/nitro/docs/examples/vite-ssr-solid.md +256 -0
- package/skills/nitro/docs/examples/vite-ssr-tsr-react.md +442 -0
- package/skills/nitro/docs/examples/vite-ssr-tss-react.md +444 -0
- package/skills/nitro/docs/examples/vite-ssr-vue-router.md +616 -0
- package/skills/nitro/docs/examples/vite-trpc.md +335 -0
- package/skills/nitro/docs/examples/websocket.md +282 -0
- package/skills/nitro/docs/index.md +121 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
function createContext(opts = {}) {
|
|
2
|
+
let currentInstance;
|
|
3
|
+
let isSingleton = false;
|
|
4
|
+
const checkConflict = (instance) => {
|
|
5
|
+
if (currentInstance && currentInstance !== instance) {
|
|
6
|
+
throw new Error("Context conflict");
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
let als;
|
|
10
|
+
if (opts.asyncContext) {
|
|
11
|
+
const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage;
|
|
12
|
+
if (_AsyncLocalStorage) {
|
|
13
|
+
als = new _AsyncLocalStorage();
|
|
14
|
+
} else {
|
|
15
|
+
console.warn("[unctx] `AsyncLocalStorage` is not provided.");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const _getCurrentInstance = () => {
|
|
19
|
+
if (als) {
|
|
20
|
+
const instance = als.getStore();
|
|
21
|
+
if (instance !== void 0) {
|
|
22
|
+
return instance;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return currentInstance;
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
use: () => {
|
|
29
|
+
const _instance = _getCurrentInstance();
|
|
30
|
+
if (_instance === void 0) {
|
|
31
|
+
throw new Error("Context is not available");
|
|
32
|
+
}
|
|
33
|
+
return _instance;
|
|
34
|
+
},
|
|
35
|
+
tryUse: () => {
|
|
36
|
+
return _getCurrentInstance();
|
|
37
|
+
},
|
|
38
|
+
set: (instance, replace) => {
|
|
39
|
+
if (!replace) {
|
|
40
|
+
checkConflict(instance);
|
|
41
|
+
}
|
|
42
|
+
currentInstance = instance;
|
|
43
|
+
isSingleton = true;
|
|
44
|
+
},
|
|
45
|
+
unset: () => {
|
|
46
|
+
currentInstance = void 0;
|
|
47
|
+
isSingleton = false;
|
|
48
|
+
},
|
|
49
|
+
call: (instance, callback) => {
|
|
50
|
+
checkConflict(instance);
|
|
51
|
+
currentInstance = instance;
|
|
52
|
+
try {
|
|
53
|
+
return als ? als.run(instance, callback) : callback();
|
|
54
|
+
} finally {
|
|
55
|
+
if (!isSingleton) {
|
|
56
|
+
currentInstance = void 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
async callAsync(instance, callback) {
|
|
61
|
+
currentInstance = instance;
|
|
62
|
+
const onRestore = () => {
|
|
63
|
+
currentInstance = instance;
|
|
64
|
+
};
|
|
65
|
+
const onLeave = () => currentInstance === instance ? onRestore : void 0;
|
|
66
|
+
asyncHandlers.add(onLeave);
|
|
67
|
+
try {
|
|
68
|
+
const r = als ? als.run(instance, callback) : callback();
|
|
69
|
+
if (!isSingleton) {
|
|
70
|
+
currentInstance = void 0;
|
|
71
|
+
}
|
|
72
|
+
return await r;
|
|
73
|
+
} finally {
|
|
74
|
+
asyncHandlers.delete(onLeave);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function createNamespace(defaultOpts = {}) {
|
|
80
|
+
const contexts = {};
|
|
81
|
+
return {
|
|
82
|
+
get(key, opts = {}) {
|
|
83
|
+
if (!contexts[key]) {
|
|
84
|
+
contexts[key] = createContext({ ...defaultOpts, ...opts });
|
|
85
|
+
}
|
|
86
|
+
return contexts[key];
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : {};
|
|
91
|
+
const globalKey = "__unctx__";
|
|
92
|
+
const defaultNamespace = _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace());
|
|
93
|
+
const getContext = (key, opts = {}) => defaultNamespace.get(key, opts);
|
|
94
|
+
const useContext = (key, opts = {}) => getContext(key, opts).use;
|
|
95
|
+
const asyncHandlersKey = "__unctx_async_handlers__";
|
|
96
|
+
const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set());
|
|
97
|
+
function executeAsync(function_) {
|
|
98
|
+
const restores = [];
|
|
99
|
+
for (const leaveHandler of asyncHandlers) {
|
|
100
|
+
const restore2 = leaveHandler();
|
|
101
|
+
if (restore2) {
|
|
102
|
+
restores.push(restore2);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const restore = () => {
|
|
106
|
+
for (const restore2 of restores) {
|
|
107
|
+
restore2();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
let awaitable = function_();
|
|
111
|
+
if (awaitable && typeof awaitable === "object" && "catch" in awaitable) {
|
|
112
|
+
awaitable = awaitable.catch((error) => {
|
|
113
|
+
restore();
|
|
114
|
+
throw error;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return [awaitable, restore];
|
|
118
|
+
}
|
|
119
|
+
function withAsyncContext(function_, transformed) {
|
|
120
|
+
if (!transformed) {
|
|
121
|
+
console.warn(
|
|
122
|
+
"[unctx] `withAsyncContext` needs transformation for async context support in",
|
|
123
|
+
function_,
|
|
124
|
+
"\n",
|
|
125
|
+
function_.toString()
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
return function_;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { createContext, createNamespace, defaultNamespace, executeAsync, getContext, useContext, withAsyncContext };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "unctx",
|
|
3
|
+
"version": "2.5.0",
|
|
4
|
+
"description": "Composition-api in Vanilla js",
|
|
5
|
+
"repository": "unjs/unctx",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./transform": {
|
|
15
|
+
"types": "./dist/transform.d.ts",
|
|
16
|
+
"import": "./dist/transform.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./plugin": {
|
|
19
|
+
"types": "./dist/plugin.d.ts",
|
|
20
|
+
"import": "./dist/plugin.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/index.cjs",
|
|
24
|
+
"module": "./dist/index.mjs",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"typesVersions": {
|
|
27
|
+
"*": {
|
|
28
|
+
"*": [
|
|
29
|
+
"./dist/*",
|
|
30
|
+
"./dist/index.d.ts"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "unbuild",
|
|
39
|
+
"dev": "vitest",
|
|
40
|
+
"lint": "eslint . && prettier -c src test",
|
|
41
|
+
"lint:fix": "eslint --fix . && prettier -w src test",
|
|
42
|
+
"prepack": "unbuild",
|
|
43
|
+
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
|
|
44
|
+
"test": "pnpm lint && pnpm test:types && vitest run --coverage",
|
|
45
|
+
"test:types": "tsc --noEmit"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"acorn": "^8.15.0",
|
|
49
|
+
"estree-walker": "^3.0.3",
|
|
50
|
+
"magic-string": "^0.30.21",
|
|
51
|
+
"unplugin": "^2.3.11"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/estree": "^1.0.8",
|
|
55
|
+
"@types/node": "^25.0.2",
|
|
56
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
57
|
+
"changelogen": "^0.6.2",
|
|
58
|
+
"eslint": "^9.39.2",
|
|
59
|
+
"eslint-config-unjs": "^0.5.0",
|
|
60
|
+
"jiti": "^2.6.1",
|
|
61
|
+
"prettier": "^3.7.4",
|
|
62
|
+
"typescript": "^5.9.3",
|
|
63
|
+
"unbuild": "^3.6.1",
|
|
64
|
+
"vitest": "^4.0.16"
|
|
65
|
+
},
|
|
66
|
+
"packageManager": "pnpm@10.26.0"
|
|
67
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import useColors from "@poppinss/colors";
|
|
2
|
+
const ANSI_REGEX = new RegExp([`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`, "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"), "g");
|
|
3
|
+
function htmlEscape(value) {
|
|
4
|
+
return value.replace(/&/g, "&").replace(/\\"/g, "\"").replace(/</g, "<").replace(/>/g, ">");
|
|
5
|
+
}
|
|
6
|
+
function wordWrap(value, options) {
|
|
7
|
+
const width = options.width;
|
|
8
|
+
const indent = options.indent;
|
|
9
|
+
const newLine = `${options.newLine}${indent}`;
|
|
10
|
+
if (!width) return options.escape ? options.escape(value) : htmlEscape(value);
|
|
11
|
+
let regexString = ".{1," + width + "}";
|
|
12
|
+
regexString += "([\\s]+|$)|[^\\s]+?([\\s]+|$)";
|
|
13
|
+
const re = new RegExp(regexString, "g");
|
|
14
|
+
return (value.match(re) || []).map(function(line) {
|
|
15
|
+
if (line.slice(-1) === "\n") line = line.slice(0, line.length - 1);
|
|
16
|
+
return options.escape ? options.escape(line) : htmlEscape(line);
|
|
17
|
+
}).join(newLine);
|
|
18
|
+
}
|
|
19
|
+
function stripAnsi(value) {
|
|
20
|
+
return value.replace(ANSI_REGEX, "");
|
|
21
|
+
}
|
|
22
|
+
const colors = useColors.ansi();
|
|
23
|
+
export { wordWrap as i, htmlEscape as n, stripAnsi as r, colors as t };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { n as BaseComponent } from "./public_dir-C5bujZKB.js";
|
|
2
|
+
import { Header } from "./src/templates/header/main.js";
|
|
3
|
+
import { Layout } from "./src/templates/layout/main.js";
|
|
4
|
+
import "./helpers-B9BQYaS6.js";
|
|
5
|
+
import { ErrorInfo } from "./src/templates/error_info/main.js";
|
|
6
|
+
import { ErrorCause } from "./src/templates/error_cause/main.js";
|
|
7
|
+
import { ErrorStack } from "./src/templates/error_stack/main.js";
|
|
8
|
+
import { ErrorMetadata } from "./src/templates/error_metadata/main.js";
|
|
9
|
+
import { ErrorStackSource } from "./src/templates/error_stack_source/main.js";
|
|
10
|
+
import { parse } from "cookie-es";
|
|
11
|
+
import { ErrorParser } from "youch-core";
|
|
12
|
+
import { createScript, createStyleSheet } from "@poppinss/dumper/html";
|
|
13
|
+
var Metadata = class {
|
|
14
|
+
#groups = {};
|
|
15
|
+
#toArray(value) {
|
|
16
|
+
return Array.isArray(value) ? value : [value];
|
|
17
|
+
}
|
|
18
|
+
group(name, sections) {
|
|
19
|
+
this.#groups[name] = this.#groups[name] ?? {};
|
|
20
|
+
Object.keys(sections).forEach((section) => {
|
|
21
|
+
if (!this.#groups[name][section]) this.#groups[name][section] = sections[section];
|
|
22
|
+
else {
|
|
23
|
+
this.#groups[name][section] = this.#toArray(this.#groups[name][section]);
|
|
24
|
+
this.#groups[name][section].push(...this.#toArray(sections[section]));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
toJSON() {
|
|
30
|
+
return this.#groups;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var Templates = class {
|
|
34
|
+
#knownTemplates;
|
|
35
|
+
#styles = new Map([["global", createStyleSheet()]]);
|
|
36
|
+
#scripts = new Map([["global", createScript()]]);
|
|
37
|
+
constructor(devMode) {
|
|
38
|
+
this.devMode = devMode;
|
|
39
|
+
this.#knownTemplates = {
|
|
40
|
+
layout: new Layout(devMode),
|
|
41
|
+
header: new Header(devMode),
|
|
42
|
+
errorInfo: new ErrorInfo(devMode),
|
|
43
|
+
errorStack: new ErrorStack(devMode),
|
|
44
|
+
errorStackSource: new ErrorStackSource(devMode),
|
|
45
|
+
errorCause: new ErrorCause(devMode),
|
|
46
|
+
errorMetadata: new ErrorMetadata(devMode)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
#getStylesAndScripts(cspNonce) {
|
|
50
|
+
let customInjectedStyles = "";
|
|
51
|
+
let globalScript = "";
|
|
52
|
+
const styles = [];
|
|
53
|
+
const scripts = [];
|
|
54
|
+
const cspNonceAttr = cspNonce ? ` nonce="${cspNonce}"` : "";
|
|
55
|
+
this.#styles.forEach((bucket, name) => {
|
|
56
|
+
if (name === "injected") customInjectedStyles = `<style id="${name}-styles"${cspNonceAttr}>${bucket}</style>`;
|
|
57
|
+
else styles.push(`<style id="${name}-styles"${cspNonceAttr}>${bucket}</style>`);
|
|
58
|
+
});
|
|
59
|
+
this.#scripts.forEach((bucket, name) => {
|
|
60
|
+
if (name === "global") globalScript = `<script id="${name}-script"${cspNonceAttr}>${bucket}<\/script>`;
|
|
61
|
+
scripts.push(`<script id="${name}-script"${cspNonceAttr}>${bucket}<\/script>`);
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
styles: `${styles.join("\n")}\n${customInjectedStyles}`,
|
|
65
|
+
scripts: scripts.join("\n"),
|
|
66
|
+
globalScript
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async #collectStylesAndScripts(templateName) {
|
|
70
|
+
if (!this.#styles.has(templateName)) {
|
|
71
|
+
const styles = await this.#knownTemplates[templateName].getStyles();
|
|
72
|
+
if (styles) this.#styles.set(templateName, styles);
|
|
73
|
+
}
|
|
74
|
+
if (!this.#scripts.has(templateName)) {
|
|
75
|
+
const script = await this.#knownTemplates[templateName].getScript();
|
|
76
|
+
if (script) this.#scripts.set(templateName, script);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async #tmplToHTML(templateName, props) {
|
|
80
|
+
const component = this.#knownTemplates[templateName];
|
|
81
|
+
if (!component) throw new Error(`Invalid template "${templateName}"`);
|
|
82
|
+
await this.#collectStylesAndScripts(templateName);
|
|
83
|
+
return component.toHTML(props);
|
|
84
|
+
}
|
|
85
|
+
async #tmplToANSI(templateName, props) {
|
|
86
|
+
const component = this.#knownTemplates[templateName];
|
|
87
|
+
if (!component) throw new Error(`Invalid template "${templateName}"`);
|
|
88
|
+
return component.toANSI(props);
|
|
89
|
+
}
|
|
90
|
+
use(templateName, component) {
|
|
91
|
+
this.#knownTemplates[templateName] = component;
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
injectStyles(cssFragment) {
|
|
95
|
+
let injectedStyles = this.#styles.get("injected") ?? "";
|
|
96
|
+
injectedStyles += `\n${cssFragment}`;
|
|
97
|
+
this.#styles.set("injected", injectedStyles);
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
async toHTML(props) {
|
|
101
|
+
const html = await this.#tmplToHTML("layout", {
|
|
102
|
+
title: props.title,
|
|
103
|
+
ide: props.ide,
|
|
104
|
+
cspNonce: props.cspNonce,
|
|
105
|
+
children: async () => {
|
|
106
|
+
return `${await this.#tmplToHTML("header", props)}${await this.#tmplToHTML("errorInfo", props)}${await this.#tmplToHTML("errorStack", {
|
|
107
|
+
ide: process.env.EDITOR ?? "vscode",
|
|
108
|
+
sourceCodeRenderer: (error, frame) => {
|
|
109
|
+
return this.#tmplToHTML("errorStackSource", {
|
|
110
|
+
error,
|
|
111
|
+
frame,
|
|
112
|
+
ide: props.ide,
|
|
113
|
+
cspNonce: props.cspNonce
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
...props
|
|
117
|
+
})}${await this.#tmplToHTML("errorCause", props)}${await this.#tmplToHTML("errorMetadata", props)}`;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
const { globalScript, scripts, styles } = this.#getStylesAndScripts(props.cspNonce);
|
|
121
|
+
return html.replace("<!-- STYLES -->", styles).replace("<!-- SCRIPTS -->", scripts).replace("<!-- GLOBAL SCRIPT -->", globalScript);
|
|
122
|
+
}
|
|
123
|
+
async toANSI(props) {
|
|
124
|
+
return await this.#tmplToANSI("layout", {
|
|
125
|
+
title: props.title,
|
|
126
|
+
children: async () => {
|
|
127
|
+
return `${await this.#tmplToANSI("header", {})}${await this.#tmplToANSI("errorInfo", props)}${await this.#tmplToANSI("errorStack", {
|
|
128
|
+
ide: process.env.EDITOR ?? "vscode",
|
|
129
|
+
sourceCodeRenderer: (error, frame) => {
|
|
130
|
+
return this.#tmplToANSI("errorStackSource", {
|
|
131
|
+
error,
|
|
132
|
+
frame
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
...props
|
|
136
|
+
})}${await this.#tmplToANSI("errorCause", props)}${await this.#tmplToANSI("errorMetadata", props)}`;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var Youch = class {
|
|
142
|
+
#sourceLoader;
|
|
143
|
+
#parsers = [];
|
|
144
|
+
#transformers = [];
|
|
145
|
+
templates = new Templates(false);
|
|
146
|
+
metadata = new Metadata();
|
|
147
|
+
#createErrorParser(options) {
|
|
148
|
+
const errorParser = new ErrorParser(options);
|
|
149
|
+
if (this.#sourceLoader) errorParser.defineSourceLoader(this.#sourceLoader);
|
|
150
|
+
this.#parsers.forEach((parser) => errorParser.useParser(parser));
|
|
151
|
+
this.#transformers.forEach((transformer) => errorParser.useTransformer(transformer));
|
|
152
|
+
return errorParser;
|
|
153
|
+
}
|
|
154
|
+
#defineRequestMetadataGroup(request) {
|
|
155
|
+
if (!request || Object.keys(request).length === 0) return;
|
|
156
|
+
this.metadata.group("Request", {
|
|
157
|
+
...request.url ? { url: {
|
|
158
|
+
key: "URL",
|
|
159
|
+
value: request.url
|
|
160
|
+
} } : {},
|
|
161
|
+
...request.method ? { method: {
|
|
162
|
+
key: "Method",
|
|
163
|
+
value: request.method
|
|
164
|
+
} } : {},
|
|
165
|
+
...request.headers ? { headers: Object.keys(request.headers).map((key) => {
|
|
166
|
+
const value = request.headers[key];
|
|
167
|
+
return {
|
|
168
|
+
key,
|
|
169
|
+
value: key === "cookie" ? { ...parse(value) } : value
|
|
170
|
+
};
|
|
171
|
+
}) } : {}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
defineSourceLoader(loader) {
|
|
175
|
+
this.#sourceLoader = loader;
|
|
176
|
+
return this;
|
|
177
|
+
}
|
|
178
|
+
useParser(parser) {
|
|
179
|
+
this.#parsers.push(parser);
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
useTransformer(transformer) {
|
|
183
|
+
this.#transformers.push(transformer);
|
|
184
|
+
return this;
|
|
185
|
+
}
|
|
186
|
+
async toJSON(error, options) {
|
|
187
|
+
options = { ...options };
|
|
188
|
+
return this.#createErrorParser({ offset: options.offset }).parse(error);
|
|
189
|
+
}
|
|
190
|
+
async toHTML(error, options) {
|
|
191
|
+
options = { ...options };
|
|
192
|
+
this.#defineRequestMetadataGroup(options.request);
|
|
193
|
+
const parsedError = await this.#createErrorParser({ offset: options.offset }).parse(error);
|
|
194
|
+
return this.templates.toHTML({
|
|
195
|
+
title: options.title ?? "An error has occurred",
|
|
196
|
+
ide: options.ide ?? process.env.IDE ?? "vscode",
|
|
197
|
+
cspNonce: options.cspNonce,
|
|
198
|
+
error: parsedError,
|
|
199
|
+
metadata: this.metadata
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
async toANSI(error, options) {
|
|
203
|
+
options = { ...options };
|
|
204
|
+
const parsedError = await this.#createErrorParser({ offset: options.offset }).parse(error);
|
|
205
|
+
return this.templates.toANSI({
|
|
206
|
+
title: "",
|
|
207
|
+
error: parsedError,
|
|
208
|
+
metadata: this.metadata
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
export { BaseComponent, Metadata, Youch };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function copyErrorMessage(button) {
|
|
2
|
+
const errorText = button.dataset.errorText;
|
|
3
|
+
|
|
4
|
+
navigator.clipboard.writeText(errorText)
|
|
5
|
+
.then(() => {
|
|
6
|
+
button.classList.add('copied');
|
|
7
|
+
setTimeout(() => button.classList.remove('copied'), 2000);
|
|
8
|
+
})
|
|
9
|
+
.catch(() => {
|
|
10
|
+
button.classList.add('copied');
|
|
11
|
+
setTimeout(() => button.classList.remove('copied'), 2000);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--copy-button-active-bg: var(--slate-a4);
|
|
3
|
+
--copy-button-border: var(--slate-7);
|
|
4
|
+
--copy-button-success-bg: var(--green-5);
|
|
5
|
+
--copy-button-success-border: var(--green-7);
|
|
6
|
+
--copy-button-success-fg: var(--green-12);
|
|
7
|
+
}
|
|
8
|
+
html.dark {
|
|
9
|
+
--copy-button-active-bg: var(--slate-a4);
|
|
10
|
+
--copy-button-border: var(--slate-7);
|
|
11
|
+
--copy-button-success-bg: var(--green-3);
|
|
12
|
+
--copy-button-success-border: var(--green-4);
|
|
13
|
+
--copy-button-success-fg: var(--green-11);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#error-name {
|
|
17
|
+
color: var(--danger-fg);
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
-webkit-font-smoothing: antialiased;
|
|
20
|
+
-moz-osx-font-smoothing: grayscale;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
#error-title {
|
|
24
|
+
color: var(--title-fg);
|
|
25
|
+
font-size: 32px;
|
|
26
|
+
-webkit-font-smoothing: antialiased;
|
|
27
|
+
-moz-osx-font-smoothing: grayscale;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#error-message {
|
|
31
|
+
color: var(--danger-fg);
|
|
32
|
+
font-size: 22px;
|
|
33
|
+
font-weight: 700;
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
align-items: flex-start;
|
|
37
|
+
gap: 12px;
|
|
38
|
+
-webkit-font-smoothing: antialiased;
|
|
39
|
+
-moz-osx-font-smoothing: grayscale;
|
|
40
|
+
position: relative;
|
|
41
|
+
word-break: break-word;
|
|
42
|
+
}
|
|
43
|
+
#error-message svg {
|
|
44
|
+
margin-top: 1.5px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#error-hint {
|
|
48
|
+
border-top: 1px solid var(--border);
|
|
49
|
+
padding-top: 15px;
|
|
50
|
+
margin-top: 15px;
|
|
51
|
+
font-size: 15px;
|
|
52
|
+
font-style: italic;
|
|
53
|
+
display: flex;
|
|
54
|
+
gap: 12px;
|
|
55
|
+
align-items: flex-start;
|
|
56
|
+
padding-left: 1px;
|
|
57
|
+
}
|
|
58
|
+
#error-hint svg {
|
|
59
|
+
margin-bottom: -2px;
|
|
60
|
+
}
|
|
61
|
+
#error-hint strong {
|
|
62
|
+
color: var(--title-fg);
|
|
63
|
+
}
|
|
64
|
+
#error-hint a {
|
|
65
|
+
color: var(--links-fg);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#copy-error-btn {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
margin-left: auto;
|
|
73
|
+
position: relative;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
|
|
76
|
+
background: transparent;
|
|
77
|
+
border: 1px solid var(--copy-button-border);
|
|
78
|
+
|
|
79
|
+
font-size: 13px;
|
|
80
|
+
font-family: inherit;
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
padding: 4px 8px 6px 8px;
|
|
83
|
+
border-radius: var(--radius);
|
|
84
|
+
color: var(--surface-fg);
|
|
85
|
+
transition: all 0.2s ease;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#copy-error-btn svg {
|
|
89
|
+
width: 18px;
|
|
90
|
+
height: 18px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
#copy-error-btn:hover {
|
|
94
|
+
background: var(--copy-button-active-bg);
|
|
95
|
+
color: var(--title-fg);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
#copy-error-btn:active {
|
|
99
|
+
transform: scale(0.95);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
#copy-error-btn.copied::after {
|
|
103
|
+
content: 'Copied';
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: -30px;
|
|
106
|
+
left: 50%;
|
|
107
|
+
transform: translateX(-50%);
|
|
108
|
+
background: var(--copy-button-success-bg);
|
|
109
|
+
color: var(--copy-button-success-fg);
|
|
110
|
+
border: 1px solid var(--copy-button-success-border);
|
|
111
|
+
border-radius: 20px;
|
|
112
|
+
font-size: 13px;
|
|
113
|
+
font-family: inherit;
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
padding: 2px 8px 4px 8px;
|
|
116
|
+
letter-spacing: 0.3px;
|
|
117
|
+
white-space: nowrap;
|
|
118
|
+
opacity: 0;
|
|
119
|
+
animation: copyFeedback 2s ease-in-out forwards;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes copyFeedback {
|
|
123
|
+
0% {
|
|
124
|
+
opacity: 0;
|
|
125
|
+
transform: translateX(-50%) translateY(5px);
|
|
126
|
+
}
|
|
127
|
+
10% {
|
|
128
|
+
opacity: 1;
|
|
129
|
+
transform: translateX(-50%) translateY(0);
|
|
130
|
+
}
|
|
131
|
+
90% {
|
|
132
|
+
opacity: 1;
|
|
133
|
+
transform: translateX(-50%) translateY(0);
|
|
134
|
+
}
|
|
135
|
+
100% {
|
|
136
|
+
opacity: 0;
|
|
137
|
+
transform: translateX(-50%) translateY(-5px);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@media (min-width: 1024px) {
|
|
142
|
+
#error-hint {
|
|
143
|
+
align-items: center;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function showFormattedFrames(button) {
|
|
2
|
+
document.querySelector('#all-frames-toggle input[type="checkbox"]').disabled = false
|
|
3
|
+
const parent = button.closest('section')
|
|
4
|
+
|
|
5
|
+
const formattedFrames = parent.querySelector('#stack-frames-formatted')
|
|
6
|
+
formattedFrames.classList.add('visible')
|
|
7
|
+
|
|
8
|
+
const rawFrames = parent.querySelector('#stack-frames-raw')
|
|
9
|
+
rawFrames.classList.remove('visible')
|
|
10
|
+
|
|
11
|
+
button.parentElement.querySelectorAll('button').forEach((btn) => btn.classList.remove('active'))
|
|
12
|
+
button.classList.add('active')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function showRawFrames(button) {
|
|
16
|
+
document.querySelector('#all-frames-toggle input[type="checkbox"]').disabled = true
|
|
17
|
+
const parent = button.closest('section')
|
|
18
|
+
|
|
19
|
+
const formattedFrames = parent.querySelector('#stack-frames-formatted')
|
|
20
|
+
formattedFrames.classList.remove('visible')
|
|
21
|
+
|
|
22
|
+
const rawFrames = parent.querySelector('#stack-frames-raw')
|
|
23
|
+
rawFrames.classList.add('visible')
|
|
24
|
+
|
|
25
|
+
button.parentElement.querySelectorAll('button').forEach((btn) => btn.classList.remove('active'))
|
|
26
|
+
button.classList.add('active')
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function toggleFrameSource(parent) {
|
|
30
|
+
if (parent.classList.contains('expanded')) {
|
|
31
|
+
parent.classList.remove('expanded')
|
|
32
|
+
} else {
|
|
33
|
+
parent.classList.add('expanded')
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function toggleAllFrames() {
|
|
38
|
+
const wrapper = document.querySelector('#stack-frames-wrapper')
|
|
39
|
+
const indicator = document.querySelector('#all-frames-toggle input[type="checkbox"]')
|
|
40
|
+
if (indicator.checked) {
|
|
41
|
+
wrapper.classList.add('display-all')
|
|
42
|
+
} else {
|
|
43
|
+
wrapper.classList.remove('display-all')
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
document.querySelector('#formatted-frames-toggle').addEventListener('click', function () {
|
|
48
|
+
showFormattedFrames(this)
|
|
49
|
+
})
|
|
50
|
+
document.querySelector('#raw-frames-toggle').addEventListener('click', function () {
|
|
51
|
+
showRawFrames(this)
|
|
52
|
+
})
|
|
53
|
+
document
|
|
54
|
+
.querySelector('#all-frames-toggle input[type="checkbox"]')
|
|
55
|
+
.addEventListener('change', function () {
|
|
56
|
+
toggleAllFrames()
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
document.querySelectorAll('button[class="stack-frame-location"]').forEach((sfl) => {
|
|
60
|
+
sfl.addEventListener('click', function (e) {
|
|
61
|
+
if (e.target.tagName === 'A') {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
toggleFrameSource(e.target.closest('li'))
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
document.querySelectorAll('button[class="stack-frame-toggle-indicator"]').forEach((sfl) => {
|
|
69
|
+
sfl.addEventListener('click', function (e) {
|
|
70
|
+
toggleFrameSource(e.target.closest('li'))
|
|
71
|
+
})
|
|
72
|
+
})
|