@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.
Files changed (370) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +32 -0
  3. package/changes.json +14 -0
  4. package/dist/THIRD-PARTY-LICENSES.md +1646 -0
  5. package/dist/_build/common.mjs +29361 -0
  6. package/dist/_build/rolldown.mjs +173 -0
  7. package/dist/_build/rollup.mjs +194 -0
  8. package/dist/_build/vite.build.mjs +18 -0
  9. package/dist/_chunks/nitro.mjs +1159 -0
  10. package/dist/_chunks/nitro2.mjs +102 -0
  11. package/dist/_chunks/nitro3.mjs +129 -0
  12. package/dist/_chunks/utils.mjs +272 -0
  13. package/dist/_common.mjs +35 -0
  14. package/dist/_dev.d.mts +12 -0
  15. package/dist/_dev.mjs +519 -0
  16. package/dist/_libs/_.mjs +3 -0
  17. package/dist/_libs/_2.mjs +2 -0
  18. package/dist/_libs/_3.mjs +3 -0
  19. package/dist/_libs/_4.mjs +2 -0
  20. package/dist/_libs/_5.mjs +3 -0
  21. package/dist/_libs/_6.mjs +4 -0
  22. package/dist/_libs/_7.mjs +5 -0
  23. package/dist/_libs/c12+rc9.mjs +812 -0
  24. package/dist/_libs/c12+readdirp+chokidar.d.mts +230 -0
  25. package/dist/_libs/citty.mjs +361 -0
  26. package/dist/_libs/commondir+is-reference.mjs +1311 -0
  27. package/dist/_libs/compatx.d.mts +47 -0
  28. package/dist/_libs/compatx.mjs +45 -0
  29. package/dist/_libs/esbuild.d.mts +20 -0
  30. package/dist/_libs/escape-string-regexp.mjs +7 -0
  31. package/dist/_libs/estree+pluginutils.d.mts +241 -0
  32. package/dist/_libs/estree-walker.mjs +184 -0
  33. package/dist/_libs/exsolve.d.mts +1 -0
  34. package/dist/_libs/hasown+resolve+deepmerge.mjs +1949 -0
  35. package/dist/_libs/httpxy.d.mts +82 -0
  36. package/dist/_libs/httpxy.mjs +671 -0
  37. package/dist/_libs/js-tokens.d.mts +1 -0
  38. package/dist/_libs/klona.mjs +37 -0
  39. package/dist/_libs/magic-string.d.mts +220 -0
  40. package/dist/_libs/mlly.d.mts +57 -0
  41. package/dist/_libs/nypm+tinyexec.mjs +845 -0
  42. package/dist/_libs/perfect-debounce.mjs +88 -0
  43. package/dist/_libs/pkg-types.d.mts +23 -0
  44. package/dist/_libs/plugin-alias.mjs +64 -0
  45. package/dist/_libs/plugin-inject.mjs +131 -0
  46. package/dist/_libs/plugin-json.mjs +34 -0
  47. package/dist/_libs/pluginutils.mjs +646 -0
  48. package/dist/_libs/readdirp+chokidar.mjs +1606 -0
  49. package/dist/_libs/remapping.mjs +115 -0
  50. package/dist/_libs/resolve-uri+gen-mapping.mjs +442 -0
  51. package/dist/_libs/rou3.d.mts +44 -0
  52. package/dist/_libs/rou3.mjs +496 -0
  53. package/dist/_libs/std-env.d.mts +12 -0
  54. package/dist/_libs/strip-literal.d.mts +1 -0
  55. package/dist/_libs/tsconfck.mjs +813 -0
  56. package/dist/_libs/ultrahtml.mjs +127 -0
  57. package/dist/_libs/unimport+unplugin.mjs +1684 -0
  58. package/dist/_libs/unplugin+unimport.d.mts +423 -0
  59. package/dist/_libs/unwasm.d.mts +29 -0
  60. package/dist/_presets.mjs +1759 -0
  61. package/dist/builder.d.mts +64 -0
  62. package/dist/builder.mjs +15 -0
  63. package/dist/cli/_chunks/build.mjs +47 -0
  64. package/dist/cli/_chunks/common.mjs +14 -0
  65. package/dist/cli/_chunks/deploy.mjs +40 -0
  66. package/dist/cli/_chunks/dev.mjs +62 -0
  67. package/dist/cli/_chunks/docs.mjs +30 -0
  68. package/dist/cli/_chunks/list.mjs +25 -0
  69. package/dist/cli/_chunks/prepare.mjs +17 -0
  70. package/dist/cli/_chunks/preview.mjs +51 -0
  71. package/dist/cli/_chunks/run.mjs +53 -0
  72. package/dist/cli/_chunks/task.mjs +14 -0
  73. package/dist/cli/index.d.mts +1 -0
  74. package/dist/cli/index.mjs +22 -0
  75. package/dist/node_modules/@poppinss/colors/build/index.js +139 -0
  76. package/dist/node_modules/@poppinss/colors/package.json +118 -0
  77. package/dist/node_modules/@poppinss/dumper/build/chunk-26HALFTP.js +602 -0
  78. package/dist/node_modules/@poppinss/dumper/build/formatters/console/main.js +441 -0
  79. package/dist/node_modules/@poppinss/dumper/build/formatters/html/main.js +725 -0
  80. package/dist/node_modules/@poppinss/dumper/package.json +122 -0
  81. package/dist/node_modules/@poppinss/exception/build/index.js +44 -0
  82. package/dist/node_modules/@poppinss/exception/package.json +109 -0
  83. package/dist/node_modules/@sindresorhus/is/distribution/index.js +1354 -0
  84. package/dist/node_modules/@sindresorhus/is/distribution/utilities.js +3 -0
  85. package/dist/node_modules/@sindresorhus/is/package.json +81 -0
  86. package/dist/node_modules/@speed-highlight/core/dist/index.js +4 -0
  87. package/dist/node_modules/@speed-highlight/core/dist/terminal.js +2 -0
  88. package/dist/node_modules/@speed-highlight/core/package.json +94 -0
  89. package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
  90. package/dist/node_modules/cookie-es/package.json +37 -0
  91. package/dist/node_modules/croner/dist/croner.js +1 -0
  92. package/dist/node_modules/croner/package.json +73 -0
  93. package/dist/node_modules/defu/dist/defu.mjs +69 -0
  94. package/dist/node_modules/defu/package.json +43 -0
  95. package/dist/node_modules/destr/dist/index.mjs +72 -0
  96. package/dist/node_modules/destr/package.json +47 -0
  97. package/dist/node_modules/error-stack-parser-es/dist/index.mjs +38 -0
  98. package/dist/node_modules/error-stack-parser-es/dist/lite.mjs +167 -0
  99. package/dist/node_modules/error-stack-parser-es/package.json +83 -0
  100. package/dist/node_modules/get-port-please/dist/index.mjs +430 -0
  101. package/dist/node_modules/get-port-please/package.json +39 -0
  102. package/dist/node_modules/kleur/index.mjs +110 -0
  103. package/dist/node_modules/kleur/package.json +51 -0
  104. package/dist/node_modules/rendu/dist/index.mjs +380 -0
  105. package/dist/node_modules/rendu/package.json +47 -0
  106. package/dist/node_modules/scule/dist/index.mjs +80 -0
  107. package/dist/node_modules/scule/package.json +43 -0
  108. package/dist/node_modules/source-map/lib/array-set.js +100 -0
  109. package/dist/node_modules/source-map/lib/base64-vlq.js +94 -0
  110. package/dist/node_modules/source-map/lib/base64.js +19 -0
  111. package/dist/node_modules/source-map/lib/binary-search.js +113 -0
  112. package/dist/node_modules/source-map/lib/mapping-list.js +83 -0
  113. package/dist/node_modules/source-map/lib/mappings.wasm +0 -0
  114. package/dist/node_modules/source-map/lib/read-wasm.js +27 -0
  115. package/dist/node_modules/source-map/lib/source-map-consumer.js +1081 -0
  116. package/dist/node_modules/source-map/lib/source-map-generator.js +439 -0
  117. package/dist/node_modules/source-map/lib/source-node.js +430 -0
  118. package/dist/node_modules/source-map/lib/url.js +13 -0
  119. package/dist/node_modules/source-map/lib/util.js +444 -0
  120. package/dist/node_modules/source-map/lib/wasm.js +138 -0
  121. package/dist/node_modules/source-map/package.json +79 -0
  122. package/dist/node_modules/source-map/source-map.js +10 -0
  123. package/dist/node_modules/supports-color/index.js +202 -0
  124. package/dist/node_modules/supports-color/package.json +64 -0
  125. package/dist/node_modules/ufo/dist/index.mjs +645 -0
  126. package/dist/node_modules/ufo/package.json +48 -0
  127. package/dist/node_modules/unctx/dist/index.mjs +131 -0
  128. package/dist/node_modules/unctx/package.json +67 -0
  129. package/dist/node_modules/youch/build/helpers-B9BQYaS6.js +23 -0
  130. package/dist/node_modules/youch/build/index.js +212 -0
  131. package/dist/node_modules/youch/build/public/error_cause/style.css +5 -0
  132. package/dist/node_modules/youch/build/public/error_info/script.js +13 -0
  133. package/dist/node_modules/youch/build/public/error_info/style.css +145 -0
  134. package/dist/node_modules/youch/build/public/error_metadata/style.css +3 -0
  135. package/dist/node_modules/youch/build/public/error_stack/script.js +72 -0
  136. package/dist/node_modules/youch/build/public/error_stack/style.css +219 -0
  137. package/dist/node_modules/youch/build/public/error_stack_source/style.css +123 -0
  138. package/dist/node_modules/youch/build/public/header/script.js +14 -0
  139. package/dist/node_modules/youch/build/public/header/style.css +56 -0
  140. package/dist/node_modules/youch/build/public/layout/script.js +12 -0
  141. package/dist/node_modules/youch/build/public/layout/style.css +435 -0
  142. package/dist/node_modules/youch/build/public_dir-C5bujZKB.js +25 -0
  143. package/dist/node_modules/youch/build/src/templates/error_cause/main.js +44 -0
  144. package/dist/node_modules/youch/build/src/templates/error_info/main.js +72 -0
  145. package/dist/node_modules/youch/build/src/templates/error_metadata/main.js +65 -0
  146. package/dist/node_modules/youch/build/src/templates/error_stack/main.js +152 -0
  147. package/dist/node_modules/youch/build/src/templates/error_stack_source/main.js +46 -0
  148. package/dist/node_modules/youch/build/src/templates/header/main.js +24 -0
  149. package/dist/node_modules/youch/build/src/templates/layout/main.js +27 -0
  150. package/dist/node_modules/youch/package.json +135 -0
  151. package/dist/node_modules/youch-core/build/index.js +316 -0
  152. package/dist/node_modules/youch-core/package.json +124 -0
  153. package/dist/presets/_nitro/runtime/nitro-dev.mjs +20 -0
  154. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +15 -0
  155. package/dist/presets/_nitro/runtime/service-worker.mjs +23 -0
  156. package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +14 -0
  157. package/dist/presets/aws-lambda/runtime/_utils.mjs +116 -0
  158. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +31 -0
  159. package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +13 -0
  160. package/dist/presets/azure/runtime/_utils.mjs +50 -0
  161. package/dist/presets/azure/runtime/azure-swa.mjs +30 -0
  162. package/dist/presets/bun/runtime/bun.mjs +40 -0
  163. package/dist/presets/cloudflare/runtime/_module-handler.mjs +87 -0
  164. package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +72 -0
  165. package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +17 -0
  166. package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +39 -0
  167. package/dist/presets/cloudflare/runtime/plugin.dev.mjs +96 -0
  168. package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
  169. package/dist/presets/deno/runtime/deno-deploy.mjs +19 -0
  170. package/dist/presets/deno/runtime/deno-server.mjs +39 -0
  171. package/dist/presets/netlify/runtime/netlify-edge.mjs +20 -0
  172. package/dist/presets/netlify/runtime/netlify.mjs +20 -0
  173. package/dist/presets/node/runtime/node-cluster.mjs +54 -0
  174. package/dist/presets/node/runtime/node-middleware.mjs +14 -0
  175. package/dist/presets/node/runtime/node-server.mjs +47 -0
  176. package/dist/presets/standard/runtime/server.mjs +4 -0
  177. package/dist/presets/stormkit/runtime/stormkit.mjs +27 -0
  178. package/dist/presets/vercel/runtime/cron-handler.mjs +25 -0
  179. package/dist/presets/vercel/runtime/isr.mjs +19 -0
  180. package/dist/presets/vercel/runtime/vercel.node.mjs +24 -0
  181. package/dist/presets/vercel/runtime/vercel.web.mjs +23 -0
  182. package/dist/presets/winterjs/runtime/winterjs.mjs +91 -0
  183. package/dist/presets/zeabur/runtime/zeabur.mjs +4 -0
  184. package/dist/presets/zephyr/runtime/server.mjs +3 -0
  185. package/dist/runtime/app.d.mts +1 -0
  186. package/dist/runtime/app.mjs +1 -0
  187. package/dist/runtime/cache.d.mts +1 -0
  188. package/dist/runtime/cache.mjs +1 -0
  189. package/dist/runtime/config.d.mts +3 -0
  190. package/dist/runtime/config.mjs +4 -0
  191. package/dist/runtime/context.d.mts +1 -0
  192. package/dist/runtime/context.mjs +1 -0
  193. package/dist/runtime/database.d.mts +1 -0
  194. package/dist/runtime/database.mjs +1 -0
  195. package/dist/runtime/internal/app.d.mts +16 -0
  196. package/dist/runtime/internal/app.mjs +208 -0
  197. package/dist/runtime/internal/cache.d.mts +7 -0
  198. package/dist/runtime/internal/cache.mjs +41 -0
  199. package/dist/runtime/internal/context.d.mts +14 -0
  200. package/dist/runtime/internal/context.mjs +24 -0
  201. package/dist/runtime/internal/database.d.mts +2 -0
  202. package/dist/runtime/internal/database.mjs +12 -0
  203. package/dist/runtime/internal/empty.mjs +0 -0
  204. package/dist/runtime/internal/error/dev.d.mts +10 -0
  205. package/dist/runtime/internal/error/dev.mjs +121 -0
  206. package/dist/runtime/internal/error/hooks.d.mts +1 -0
  207. package/dist/runtime/internal/error/hooks.mjs +9 -0
  208. package/dist/runtime/internal/error/prod.d.mts +6 -0
  209. package/dist/runtime/internal/error/prod.mjs +40 -0
  210. package/dist/runtime/internal/error/utils.d.mts +8 -0
  211. package/dist/runtime/internal/error/utils.mjs +3 -0
  212. package/dist/runtime/internal/meta.d.mts +2 -0
  213. package/dist/runtime/internal/meta.mjs +3 -0
  214. package/dist/runtime/internal/plugin.d.mts +3 -0
  215. package/dist/runtime/internal/plugin.mjs +4 -0
  216. package/dist/runtime/internal/route-rules.d.mts +9 -0
  217. package/dist/runtime/internal/route-rules.mjs +72 -0
  218. package/dist/runtime/internal/routes/dev-tasks.d.mts +3 -0
  219. package/dist/runtime/internal/routes/dev-tasks.mjs +25 -0
  220. package/dist/runtime/internal/routes/openapi.d.mts +3 -0
  221. package/dist/runtime/internal/routes/openapi.mjs +94 -0
  222. package/dist/runtime/internal/routes/renderer-template.d.mts +2 -0
  223. package/dist/runtime/internal/routes/renderer-template.dev.d.mts +3 -0
  224. package/dist/runtime/internal/routes/renderer-template.dev.mjs +19 -0
  225. package/dist/runtime/internal/routes/renderer-template.mjs +4 -0
  226. package/dist/runtime/internal/routes/scalar.d.mts +3 -0
  227. package/dist/runtime/internal/routes/scalar.mjs +193 -0
  228. package/dist/runtime/internal/routes/swagger.d.mts +3 -0
  229. package/dist/runtime/internal/routes/swagger.mjs +42 -0
  230. package/dist/runtime/internal/runtime-config.d.mts +9 -0
  231. package/dist/runtime/internal/runtime-config.mjs +54 -0
  232. package/dist/runtime/internal/static.d.mts +3 -0
  233. package/dist/runtime/internal/static.mjs +67 -0
  234. package/dist/runtime/internal/storage.d.mts +2 -0
  235. package/dist/runtime/internal/storage.mjs +6 -0
  236. package/dist/runtime/internal/task.d.mts +19 -0
  237. package/dist/runtime/internal/task.mjs +69 -0
  238. package/dist/runtime/internal/vite/dev-entry.mjs +18 -0
  239. package/dist/runtime/internal/vite/dev-worker.mjs +264 -0
  240. package/dist/runtime/internal/vite/ssr-renderer.mjs +6 -0
  241. package/dist/runtime/meta.d.mts +5 -0
  242. package/dist/runtime/meta.mjs +27 -0
  243. package/dist/runtime/nitro.d.mts +11 -0
  244. package/dist/runtime/nitro.mjs +34 -0
  245. package/dist/runtime/runtime-config.d.mts +1 -0
  246. package/dist/runtime/runtime-config.mjs +1 -0
  247. package/dist/runtime/storage.d.mts +1 -0
  248. package/dist/runtime/storage.mjs +1 -0
  249. package/dist/runtime/task.d.mts +1 -0
  250. package/dist/runtime/task.mjs +1 -0
  251. package/dist/runtime/virtual/_runtime_warn.d.mts +1 -0
  252. package/dist/runtime/virtual/_runtime_warn.mjs +5 -0
  253. package/dist/runtime/virtual/database.d.mts +8 -0
  254. package/dist/runtime/virtual/database.mjs +2 -0
  255. package/dist/runtime/virtual/error-handler.d.mts +6 -0
  256. package/dist/runtime/virtual/error-handler.mjs +9 -0
  257. package/dist/runtime/virtual/feature-flags.d.mts +7 -0
  258. package/dist/runtime/virtual/feature-flags.mjs +7 -0
  259. package/dist/runtime/virtual/plugins.d.mts +3 -0
  260. package/dist/runtime/virtual/plugins.mjs +2 -0
  261. package/dist/runtime/virtual/polyfills.d.mts +3 -0
  262. package/dist/runtime/virtual/polyfills.mjs +2 -0
  263. package/dist/runtime/virtual/public-assets.d.mts +9 -0
  264. package/dist/runtime/virtual/public-assets.mjs +8 -0
  265. package/dist/runtime/virtual/renderer-template.d.mts +4 -0
  266. package/dist/runtime/virtual/renderer-template.mjs +7 -0
  267. package/dist/runtime/virtual/routing-meta.d.mts +7 -0
  268. package/dist/runtime/virtual/routing-meta.mjs +2 -0
  269. package/dist/runtime/virtual/routing.d.mts +8 -0
  270. package/dist/runtime/virtual/routing.mjs +11 -0
  271. package/dist/runtime/virtual/runtime-config.d.mts +3 -0
  272. package/dist/runtime/virtual/runtime-config.mjs +5 -0
  273. package/dist/runtime/virtual/server-assets.d.mts +7 -0
  274. package/dist/runtime/virtual/server-assets.mjs +12 -0
  275. package/dist/runtime/virtual/storage.d.mts +3 -0
  276. package/dist/runtime/virtual/storage.mjs +5 -0
  277. package/dist/runtime/virtual/tasks.d.mts +10 -0
  278. package/dist/runtime/virtual/tasks.mjs +3 -0
  279. package/dist/runtime/vite.d.mts +8 -0
  280. package/dist/runtime/vite.mjs +9 -0
  281. package/dist/types/index.d.mts +3010 -0
  282. package/dist/types/index.mjs +1 -0
  283. package/dist/vite.d.mts +52 -0
  284. package/dist/vite.mjs +740 -0
  285. package/lib/h3.d.mts +1 -0
  286. package/lib/h3.mjs +1 -0
  287. package/lib/tsconfig.json +27 -0
  288. package/lib/vite.types.d.mts +26 -0
  289. package/lib/vite.types.mjs +2 -0
  290. package/package.json +256 -0
  291. package/skills/nitro/SKILL.md +10 -0
  292. package/skills/nitro/docs/TOC.md +83 -0
  293. package/skills/nitro/docs/_navigation.json +679 -0
  294. package/skills/nitro/docs/config/index.md +1147 -0
  295. package/skills/nitro/docs/deploy/index.md +64 -0
  296. package/skills/nitro/docs/deploy/providers/alwaysdata.md +50 -0
  297. package/skills/nitro/docs/deploy/providers/aws-amplify.md +81 -0
  298. package/skills/nitro/docs/deploy/providers/aws.md +47 -0
  299. package/skills/nitro/docs/deploy/providers/azure.md +72 -0
  300. package/skills/nitro/docs/deploy/providers/cleavr.md +33 -0
  301. package/skills/nitro/docs/deploy/providers/cloudflare.md +375 -0
  302. package/skills/nitro/docs/deploy/providers/deno-deploy.md +66 -0
  303. package/skills/nitro/docs/deploy/providers/digitalocean.md +46 -0
  304. package/skills/nitro/docs/deploy/providers/firebase.md +32 -0
  305. package/skills/nitro/docs/deploy/providers/flightcontrol.md +67 -0
  306. package/skills/nitro/docs/deploy/providers/genezio.md +67 -0
  307. package/skills/nitro/docs/deploy/providers/github-pages.md +68 -0
  308. package/skills/nitro/docs/deploy/providers/gitlab-pages.md +37 -0
  309. package/skills/nitro/docs/deploy/providers/heroku.md +84 -0
  310. package/skills/nitro/docs/deploy/providers/iis.md +38 -0
  311. package/skills/nitro/docs/deploy/providers/koyeb.md +109 -0
  312. package/skills/nitro/docs/deploy/providers/netlify.md +47 -0
  313. package/skills/nitro/docs/deploy/providers/platform-sh.md +37 -0
  314. package/skills/nitro/docs/deploy/providers/render.md +37 -0
  315. package/skills/nitro/docs/deploy/providers/stormkit.md +24 -0
  316. package/skills/nitro/docs/deploy/providers/vercel.md +179 -0
  317. package/skills/nitro/docs/deploy/providers/zeabur.md +19 -0
  318. package/skills/nitro/docs/deploy/providers/zephyr.md +99 -0
  319. package/skills/nitro/docs/deploy/providers/zerops.md +102 -0
  320. package/skills/nitro/docs/deploy/runtimes/bun.md +15 -0
  321. package/skills/nitro/docs/deploy/runtimes/deno.md +19 -0
  322. package/skills/nitro/docs/deploy/runtimes/node.md +63 -0
  323. package/skills/nitro/docs/docs/assets.md +166 -0
  324. package/skills/nitro/docs/docs/cache.md +408 -0
  325. package/skills/nitro/docs/docs/configuration.md +256 -0
  326. package/skills/nitro/docs/docs/database.md +185 -0
  327. package/skills/nitro/docs/docs/index.md +56 -0
  328. package/skills/nitro/docs/docs/lifecycle.md +204 -0
  329. package/skills/nitro/docs/docs/migration.md +215 -0
  330. package/skills/nitro/docs/docs/nightly.md +31 -0
  331. package/skills/nitro/docs/docs/plugins.md +164 -0
  332. package/skills/nitro/docs/docs/quick-start.md +110 -0
  333. package/skills/nitro/docs/docs/renderer.md +322 -0
  334. package/skills/nitro/docs/docs/routing.md +711 -0
  335. package/skills/nitro/docs/docs/server-entry.md +239 -0
  336. package/skills/nitro/docs/docs/storage.md +261 -0
  337. package/skills/nitro/docs/docs/tasks.md +277 -0
  338. package/skills/nitro/docs/examples/api-routes.md +145 -0
  339. package/skills/nitro/docs/examples/auto-imports.md +93 -0
  340. package/skills/nitro/docs/examples/cached-handler.md +81 -0
  341. package/skills/nitro/docs/examples/custom-error-handler.md +98 -0
  342. package/skills/nitro/docs/examples/database.md +157 -0
  343. package/skills/nitro/docs/examples/elysia.md +70 -0
  344. package/skills/nitro/docs/examples/express.md +78 -0
  345. package/skills/nitro/docs/examples/fastify.md +79 -0
  346. package/skills/nitro/docs/examples/hello-world.md +68 -0
  347. package/skills/nitro/docs/examples/hono.md +74 -0
  348. package/skills/nitro/docs/examples/import-alias.md +100 -0
  349. package/skills/nitro/docs/examples/index.md +3 -0
  350. package/skills/nitro/docs/examples/middleware.md +91 -0
  351. package/skills/nitro/docs/examples/mono-jsx.md +68 -0
  352. package/skills/nitro/docs/examples/nano-jsx.md +70 -0
  353. package/skills/nitro/docs/examples/plugins.md +91 -0
  354. package/skills/nitro/docs/examples/renderer.md +113 -0
  355. package/skills/nitro/docs/examples/runtime-config.md +97 -0
  356. package/skills/nitro/docs/examples/server-fetch.md +87 -0
  357. package/skills/nitro/docs/examples/shiki.md +198 -0
  358. package/skills/nitro/docs/examples/virtual-routes.md +74 -0
  359. package/skills/nitro/docs/examples/vite-nitro-plugin.md +79 -0
  360. package/skills/nitro/docs/examples/vite-rsc.md +1041 -0
  361. package/skills/nitro/docs/examples/vite-ssr-html.md +217 -0
  362. package/skills/nitro/docs/examples/vite-ssr-preact.md +247 -0
  363. package/skills/nitro/docs/examples/vite-ssr-react.md +226 -0
  364. package/skills/nitro/docs/examples/vite-ssr-solid.md +256 -0
  365. package/skills/nitro/docs/examples/vite-ssr-tsr-react.md +442 -0
  366. package/skills/nitro/docs/examples/vite-ssr-tss-react.md +444 -0
  367. package/skills/nitro/docs/examples/vite-ssr-vue-router.md +616 -0
  368. package/skills/nitro/docs/examples/vite-trpc.md +335 -0
  369. package/skills/nitro/docs/examples/websocket.md +282 -0
  370. package/skills/nitro/docs/index.md +121 -0
@@ -0,0 +1,435 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ :root {
8
+ --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
10
+ --font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono',
11
+ 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono',
12
+ 'Courier New', monospace;
13
+ --radius: 6px;
14
+ }
15
+
16
+ :root {
17
+ /**
18
+ * The slate shade is used as the main color for the page
19
+ * background and the text.
20
+ */
21
+ --slate-1: #fcfcfd;
22
+ --slate-2: #f9f9fb;
23
+ --slate-3: #f0f0f3;
24
+ --slate-4: #e8e8ec;
25
+ --slate-5: #e0e1e6;
26
+ --slate-6: #d9d9e0;
27
+ --slate-7: #cdced6;
28
+ --slate-8: #b9bbc6;
29
+ --slate-9: #8b8d98;
30
+ --slate-10: #80838d;
31
+ --slate-11: #60646c;
32
+ --slate-12: #1c2024;
33
+
34
+ --slate-a1: #00005503;
35
+ --slate-a2: #00005506;
36
+ --slate-a3: #0000330f;
37
+ --slate-a4: #00002d17;
38
+ --slate-a5: #0009321f;
39
+ --slate-a6: #00002f26;
40
+ --slate-a7: #00062e32;
41
+ --slate-a8: #00083046;
42
+ --slate-a9: #00051d74;
43
+ --slate-a10: #00071b7f;
44
+ --slate-a11: #0007149f;
45
+ --slate-a12: #000509e3;
46
+
47
+ /**
48
+ * The green shade is used for links and the accent color
49
+ */
50
+ --green-1: #fbfefc;
51
+ --green-2: #f4fbf6;
52
+ --green-3: #e6f6eb;
53
+ --green-4: #d6f1df;
54
+ --green-5: #c4e8d1;
55
+ --green-6: #adddc0;
56
+ --green-7: #8eceaa;
57
+ --green-8: #5bb98b;
58
+ --green-9: #30a46c;
59
+ --green-10: #2b9a66;
60
+ --green-11: #218358;
61
+ --green-12: #193b2d;
62
+
63
+ /**
64
+ * The red shade is used as the danger color
65
+ */
66
+ --red-1: #fffcfc;
67
+ --red-2: #fff7f7;
68
+ --red-3: #feebec;
69
+ --red-4: #ffdbdc;
70
+ --red-5: #ffcdce;
71
+ --red-6: #fdbdbe;
72
+ --red-7: #f4a9aa;
73
+ --red-8: #eb8e90;
74
+ --red-9: #e5484d;
75
+ --red-10: #dc3e42;
76
+ --red-11: #ce2c31;
77
+ --red-12: #641723;
78
+
79
+ --surface-bg: var(--slate-2);
80
+ --surface-fg: var(--slate-11);
81
+ --muted-fg: var(--slate-10);
82
+
83
+ --title-fg: var(--slate-12);
84
+ --subtitle-fg: var(--green-10);
85
+ --links-fg: var(--green-11);
86
+ --danger-fg: var(--red-11);
87
+ --border: var(--slate-4);
88
+
89
+ --checkbox-border: var(--slate-a7);
90
+ --checkbox-active-bg: var(--green-5);
91
+ --checkbox-active-fg: var(--green-11);
92
+ --checkbox-active-border: var(--green-6);
93
+
94
+ --card-bg: #ffffff;
95
+ --card-shadow: 0 0 0 1px color-mix(in oklab, var(--slate-a3), var(--slate-3) 25%),
96
+ 0 8px 40px rgba(0, 0, 0, 0.05), 0 12px 32px -16px var(--slate-a3);
97
+
98
+ /**
99
+ * Colors for dumper. Also used by the errorStackSource
100
+ */
101
+ --pre-bg-color: #fff;
102
+ --pre-fg-color: #212121;
103
+ --toggle-fg-color: #989999;
104
+ --braces-fg-color: #0431fa;
105
+ --brackets-fg-color: #0431fa;
106
+ --dt-number-fg-color: #1976d2;
107
+ --dt-bigint-fg-color: #1976d2;
108
+ --dt-boolean-fg-color: #1976d2;
109
+ --dt-string-fg-color: #22863a;
110
+ --dt-null-fg-color: #9c9c9d;
111
+ --dt-undefined-fg-color: #9c9c9d;
112
+ --prototype-label-fg-color: #9c9c9d;
113
+ --dt-symbol-fg-color: #d32f2f;
114
+ --dt-regex-fg-color: #1976d2;
115
+ --dt-date-fg-color: #7b3814;
116
+ --dt-buffer-fg-color: #7b3814;
117
+ --function-label-fg-color: #6f42c1;
118
+ --array-label-fg-color: #d32f2f;
119
+ --object-label-fg-color: #d32f2f;
120
+ --map-label-fg-color: #d32f2f;
121
+ --set-label-fg-color: #d32f2f;
122
+ --object-key-fg-color: #212121;
123
+ --object-key-prefix-fg-color: #9c9c9d;
124
+ --class-label-fg-color: #6f42c1;
125
+ --collpase-label-fg-color: #9c9c9d;
126
+ --getter-label-fg-color: #7b3814;
127
+ --circular-label-fg-color: #7b3814;
128
+ --weakset-label-fg-color: #7b3814;
129
+ --weakref-label-fg-color: #7b3814;
130
+ --weakmap-label-fg-color: #7b3814;
131
+ --observable-label-fg-color: #7b3814;
132
+ --promise-label-fg-color: #7b3814;
133
+ --generator-label-fg-color: #7b3814;
134
+ --blob-label-fg-color: #7b3814;
135
+ --unknown-label-fg-color: #7b3814;
136
+
137
+ color-scheme: only light;
138
+ }
139
+
140
+ html.dark {
141
+ /**
142
+ * The slate shade is used as the main color for the page
143
+ * background and the text.
144
+ */
145
+ --slate-1: #111113;
146
+ --slate-2: #18191b;
147
+ --slate-3: #212225;
148
+ --slate-4: #272a2d;
149
+ --slate-5: #2e3135;
150
+ --slate-6: #363a3f;
151
+ --slate-7: #43484e;
152
+ --slate-8: #5a6169;
153
+ --slate-9: #696e77;
154
+ --slate-10: #777b84;
155
+ --slate-11: #b0b4ba;
156
+ --slate-12: #edeef0;
157
+
158
+ --slate-a1: #00000000;
159
+ --slate-a2: #d8f4f609;
160
+ --slate-a3: #ddeaf814;
161
+ --slate-a4: #d3edf81d;
162
+ --slate-a5: #d9edfe25;
163
+ --slate-a6: #d6ebfd30;
164
+ --slate-a7: #d9edff40;
165
+ --slate-a8: #d9edff5d;
166
+ --slate-a9: #dfebfd6d;
167
+ --slate-a10: #e5edfd7b;
168
+ --slate-a11: #f1f7feb5;
169
+ --slate-a12: #fcfdffef;
170
+
171
+ /**
172
+ * The green shade is used for links and the accent color
173
+ */
174
+ --green-1: #0e1512;
175
+ --green-2: #121b17;
176
+ --green-3: #132d21;
177
+ --green-4: #113b29;
178
+ --green-5: #174933;
179
+ --green-6: #20573e;
180
+ --green-7: #28684a;
181
+ --green-8: #2f7c57;
182
+ --green-9: #30a46c;
183
+ --green-10: #33b074;
184
+ --green-11: #3dd68c;
185
+ --green-12: #b1f1cb;
186
+
187
+ /**
188
+ * The red shade is used as the danger color
189
+ */
190
+ --red-1: #191111;
191
+ --red-2: #201314;
192
+ --red-3: #3b1219;
193
+ --red-4: #500f1c;
194
+ --red-5: #611623;
195
+ --red-6: #72232d;
196
+ --red-7: #8c333a;
197
+ --red-8: #b54548;
198
+ --red-9: #e5484d;
199
+ --red-10: #ec5d5e;
200
+ --red-11: #ff9592;
201
+ --red-12: #ffd1d9;
202
+
203
+ --surface-bg: var(--slate-2);
204
+ --surface-fg: var(--slate-11);
205
+ --muted-fg: var(--slate-10);
206
+
207
+ --title-fg: var(--slate-12);
208
+ --subtitle-fg: var(--green-10);
209
+ --links-fg: var(--green-11);
210
+ --danger-fg: var(--red-11);
211
+ --border: var(--slate-4);
212
+
213
+ --checkbox-border: var(--slate-a7);
214
+ --checkbox-active-bg: var(--green-5);
215
+ --checkbox-active-fg: var(--green-11);
216
+ --checkbox-active-border: var(--green-6);
217
+
218
+ --card-bg: var(--slate-a2);
219
+ --card-shadow: 0 0 0 1px color-mix(in oklab, var(--slate-a3), var(--slate-3) 25%),
220
+ 0 8px 20px rgba(0, 0, 0, 0.05), 0 12px 32px -16px var(--slate-a1);
221
+
222
+ /**
223
+ * Colors for dumper. Also used by the errorStackSource
224
+ */
225
+ --pre-bg-color: var(--slate-a1);
226
+ --pre-fg-color: #94e2d5;
227
+ --toggle-fg-color: #7c7c8c;
228
+ --braces-fg-color: #f38ba8;
229
+ --brackets-fg-color: #f38ba8;
230
+ --dt-number-fg-color: #fab387;
231
+ --dt-bigint-fg-color: #fab387;
232
+ --dt-boolean-fg-color: #cba6f7;
233
+ --dt-string-fg-color: #a6e3a1;
234
+ --dt-null-fg-color: #6c7086;
235
+ --dt-undefined-fg-color: #6c7086;
236
+ --prototype-label-fg-color: #6c7086;
237
+ --dt-symbol-fg-color: #f9e2af;
238
+ --dt-regex-fg-color: #cba6f7;
239
+ --dt-date-fg-color: #94e2d5;
240
+ --dt-buffer-fg-color: #94e2d5;
241
+ --function-label-fg-color: #cba6f7;
242
+ --array-label-fg-color: #f9e2af;
243
+ --object-label-fg-color: #f9e2af;
244
+ --map-label-fg-color: #f9e2af;
245
+ --set-label-fg-color: #f9e2af;
246
+ --object-key-fg-color: #89b4fa;
247
+ --object-key-prefix-fg-color: #6c7086;
248
+ --class-label-fg-color: #cba6f7;
249
+ --collpase-label-fg-color: #6c7086;
250
+ --getter-label-fg-color: #94e2d5;
251
+ --circular-label-fg-color: #94e2d5;
252
+ --weakset-label-fg-color: #94e2d5;
253
+ --weakref-label-fg-color: #94e2d5;
254
+ --weakmap-label-fg-color: #94e2d5;
255
+ --observable-label-fg-color: #94e2d5;
256
+ --promise-label-fg-color: #94e2d5;
257
+ --generator-label-fg-color: #94e2d5;
258
+ --blob-label-fg-color: #94e2d5;
259
+ --unknown-label-fg-color: #94e2d5;
260
+
261
+ color-scheme: dark;
262
+ }
263
+
264
+ html,
265
+ body {
266
+ background: var(--surface-bg);
267
+ font-family: var(--font-sans);
268
+ color: var(--surface-fg);
269
+ line-height: 1.2;
270
+ }
271
+
272
+ code {
273
+ color: var(--title-fg);
274
+ }
275
+
276
+ a {
277
+ color: var(--links-fg);
278
+ }
279
+
280
+ input[type='checkbox'] {
281
+ appearance: none;
282
+ -webkit-appearance: none;
283
+ display: flex;
284
+ align-content: center;
285
+ justify-content: center;
286
+ border: 2px solid var(--checkbox-border);
287
+ border-radius: 4px;
288
+ }
289
+ input[type='checkbox']:checked {
290
+ background: var(--checkbox-active-bg);
291
+ border-color: var(--checkbox-active-border);
292
+ }
293
+ input[type='checkbox']:checked + span {
294
+ color: var(--title-fg);
295
+ }
296
+
297
+ input[type='checkbox']::before {
298
+ content: '';
299
+ width: 15px;
300
+ height: 15px;
301
+ background: var(--checkbox-active-fg);
302
+ mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTIgOSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzguMjJhLjc1Ljc1IDAgMCAxIDAgMS4wNjFsLTcuMjYgNy4yNmEuNzUuNzUgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1Ljc1IDAgMCAxIDEuMDYyIDAiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==);
303
+ mask-position: center;
304
+ mask-repeat: no-repeat;
305
+ mask-size: 75%;
306
+ visibility: hidden;
307
+ }
308
+ input[type='checkbox']:checked::before {
309
+ visibility: visible;
310
+ }
311
+
312
+ input[type='checkbox']:disabled,
313
+ input[type='checkbox']:disabled + span {
314
+ opacity: 0.5;
315
+ }
316
+
317
+ /**
318
+ * Overriding existing defaults of dumper
319
+ */
320
+ .dumper-dump,
321
+ .dumper-dump pre,
322
+ .dumper-dump code,
323
+ .dumper-dump samp {
324
+ font-family: var(--font-mono);
325
+ }
326
+ .dumper-dump pre {
327
+ font-size: 13px;
328
+ padding: calc(0.5vw + 8px);
329
+ }
330
+ .dumper-dump .dumper-toggle span {
331
+ font-size: 12px;
332
+ }
333
+
334
+ /**
335
+ * Layout centers all the elements for displaying the
336
+ * error and its metadata
337
+ */
338
+ #layout {
339
+ max-width: 1280px;
340
+ margin: auto;
341
+ display: flex;
342
+ flex-direction: column;
343
+ gap: 24px;
344
+ padding: calc(1vw + 15px);
345
+ }
346
+
347
+ .card {
348
+ background: var(--card-bg);
349
+ box-shadow: var(--card-shadow);
350
+ border-radius: var(--radius);
351
+ padding: calc(2vw + 7px);
352
+ display: flex;
353
+ flex-direction: column;
354
+ gap: 12px;
355
+ }
356
+
357
+ .card-heading {
358
+ display: flex;
359
+ justify-content: space-between;
360
+ align-items: center;
361
+ }
362
+
363
+ .card-title {
364
+ font-size: 18px;
365
+ color: var(--title-fg);
366
+ -webkit-font-smoothing: antialiased;
367
+ -moz-osx-font-smoothing: grayscale;
368
+ }
369
+
370
+ .card-subtitle {
371
+ color: var(--subtitle-fg);
372
+ font-size: 12px;
373
+ font-weight: 600;
374
+ margin-top: 20px;
375
+ margin-bottom: 10px;
376
+ text-transform: uppercase;
377
+ -webkit-font-smoothing: antialiased;
378
+ -moz-osx-font-smoothing: grayscale;
379
+ }
380
+
381
+ .card-table {
382
+ width: 100%;
383
+ max-width: 100%;
384
+ border-spacing: 0;
385
+ table-layout: fixed;
386
+ overflow: scroll;
387
+ border: 1px solid var(--border);
388
+ border-radius: var(--radius);
389
+ -webkit-font-smoothing: antialiased;
390
+ -moz-osx-font-smoothing: grayscale;
391
+ }
392
+
393
+ .card-table td {
394
+ border-bottom: 1px solid var(--border);
395
+ padding: calc(0.8vw + 4px) calc(0.8vw + 8px);
396
+ word-wrap: break-word;
397
+ }
398
+
399
+ .card-table tr:last-child td {
400
+ border-bottom: 0;
401
+ }
402
+
403
+ .card-table td.table-value .dumper-dump pre {
404
+ padding: 0;
405
+ -webkit-font-smoothing: initial;
406
+ -moz-osx-font-smoothing: initial;
407
+ }
408
+
409
+ @media (min-width: 768px) {
410
+ #layout {
411
+ padding: 40px;
412
+ }
413
+
414
+ .card {
415
+ padding: 22px 30px;
416
+ }
417
+
418
+ .card-table td {
419
+ padding: 6px 12px;
420
+ }
421
+
422
+ .card-table td.table-key {
423
+ width: 180px;
424
+ }
425
+
426
+ .dumper-dump pre {
427
+ padding: 10px 15px;
428
+ }
429
+ }
430
+
431
+ @media (min-width: 1024px) {
432
+ .card-table td.table-key {
433
+ width: 200px;
434
+ }
435
+ }
@@ -0,0 +1,25 @@
1
+ import { readFile } from "node:fs/promises";
2
+ var BaseComponent = class {
3
+ #cachedStyles;
4
+ #cachedScript;
5
+ #inDevMode;
6
+ scriptFile;
7
+ cssFile;
8
+ constructor(devMode) {
9
+ this.#inDevMode = devMode;
10
+ }
11
+ async getStyles() {
12
+ if (!this.cssFile) return null;
13
+ if (this.#inDevMode) return await readFile(this.cssFile, "utf-8");
14
+ this.#cachedStyles = this.#cachedStyles ?? await readFile(this.cssFile, "utf-8");
15
+ return this.#cachedStyles;
16
+ }
17
+ async getScript() {
18
+ if (!this.scriptFile) return null;
19
+ if (this.#inDevMode) return await readFile(this.scriptFile, "utf-8");
20
+ this.#cachedScript = this.#cachedScript ?? await readFile(this.scriptFile, "utf-8");
21
+ return this.#cachedScript;
22
+ }
23
+ };
24
+ const publicDirURL = new URL("./public/", import.meta.url);
25
+ export { BaseComponent as n, publicDirURL as t };
@@ -0,0 +1,44 @@
1
+ import { n as BaseComponent, t as publicDirURL } from "../../../public_dir-C5bujZKB.js";
2
+ import { t as colors } from "../../../helpers-B9BQYaS6.js";
3
+ import { dump, themes } from "@poppinss/dumper/html";
4
+ import { dump as dump$1 } from "@poppinss/dumper/console";
5
+ var ErrorCause = class extends BaseComponent {
6
+ cssFile = new URL("./error_cause/style.css", publicDirURL);
7
+ async toHTML(props) {
8
+ if (!props.error.cause) return "";
9
+ return `<section>
10
+ <div class="card">
11
+ <div class="card-heading">
12
+ <div>
13
+ <h3 class="card-title">
14
+ Error Cause
15
+ </h3>
16
+ </div>
17
+ </div>
18
+ <div class="card-body">
19
+ <div id="error-cause">
20
+ ${dump(props.error.cause, {
21
+ cspNonce: props.cspNonce,
22
+ styles: themes.cssVariables,
23
+ inspectObjectPrototype: false,
24
+ inspectStaticMembers: false,
25
+ inspectArrayPrototype: false
26
+ })}
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </section>`;
31
+ }
32
+ async toANSI(props) {
33
+ if (!props.error.cause) return "";
34
+ let depth = process.env.YOUCH_CAUSE ? Number(process.env.YOUCH_CAUSE) : 2;
35
+ if (Number.isNaN(depth)) depth = 2;
36
+ return `\n\n${colors.red("[CAUSE]")}\n${dump$1(props.error.cause, {
37
+ depth,
38
+ inspectObjectPrototype: false,
39
+ inspectStaticMembers: false,
40
+ inspectArrayPrototype: false
41
+ })}`;
42
+ }
43
+ };
44
+ export { ErrorCause };
@@ -0,0 +1,72 @@
1
+ import { n as BaseComponent, t as publicDirURL } from "../../../public_dir-C5bujZKB.js";
2
+ import { i as wordWrap, n as htmlEscape, t as colors } from "../../../helpers-B9BQYaS6.js";
3
+ const ERROR_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="24" height="24" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 7v6m0 4.01.01-.011M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"/></svg>`;
4
+ const HINT_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="24" height="24" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m21 2-1 1M3 2l1 1m17 13-1-1M3 16l1-1m5 3h6m-5 3h4M12 3C8 3 5.952 4.95 6 8c.023 1.487.5 2.5 1.5 3.5S9 13 9 15h6c0-2 .5-2.5 1.5-3.5h0c1-1 1.477-2.013 1.5-3.5.048-3.05-2-5-6-5Z"/></svg>`;
5
+ const COPY_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" /><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" /></svg>`;
6
+ function buildErrorWithStacktrace(error) {
7
+ const cwd = process.cwd();
8
+ const lines = [];
9
+ lines.push(`${error.name}: ${error.message}`);
10
+ if (error.hint) lines.push(`Hint: ${error.hint.replace(/(<([^>]+)>)/gi, "")}`);
11
+ if (error.frames.length > 0) {
12
+ lines.push("");
13
+ lines.push("Stack trace:");
14
+ for (const frame of error.frames) {
15
+ const fileName = frame.fileName?.replace(`${cwd}/`, "") || "<anonymous>";
16
+ const func = frame.functionName ? `at ${frame.functionName} ` : "at ";
17
+ lines.push(` ${func}(${fileName}:${frame.lineNumber}:${frame.columnNumber})`);
18
+ }
19
+ }
20
+ return lines.join("\n");
21
+ }
22
+ function htmlAttributeEscape(value) {
23
+ return value.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
24
+ }
25
+ var ErrorInfo = class extends BaseComponent {
26
+ cssFile = new URL("./error_info/style.css", publicDirURL);
27
+ scriptFile = new URL("./error_info/script.js", publicDirURL);
28
+ async toHTML(props) {
29
+ const stacktraceText = buildErrorWithStacktrace(props.error);
30
+ return `<section>
31
+ <h4 id="error-name">${htmlEscape(props.error.name)}</h4>
32
+ <h1 id="error-title">${htmlEscape(props.title)}</h1>
33
+ </section>
34
+ <section>
35
+ <div class="card">
36
+ <div class="card-body">
37
+ <h2 id="error-message">
38
+ <span>${ERROR_ICON_SVG}</span>
39
+ <span>${htmlEscape(props.error.message)}</span>
40
+ <button
41
+ id="copy-error-btn"
42
+ data-error-text="${htmlAttributeEscape(stacktraceText)}"
43
+ onclick="copyErrorMessage(this)"
44
+ title="Copy error with stack trace"
45
+ aria-label="Copy error with stack trace to clipboard"
46
+ >
47
+ ${COPY_ICON_SVG}
48
+ </button>
49
+ </h2>
50
+ ${props.error.hint ? `<div id="error-hint">
51
+ <span>${HINT_ICON_SVG}</span>
52
+ <span>${props.error.hint}</span>
53
+ </div>` : ""}
54
+ </div>
55
+ </div>
56
+ </section>`;
57
+ }
58
+ async toANSI(props) {
59
+ return `${colors.red(`ℹ ${wordWrap(`${props.error.name}: ${props.error.message}`, {
60
+ width: process.stdout.columns,
61
+ indent: " ",
62
+ newLine: "\n",
63
+ escape: (value) => value
64
+ })}`)}${props.error.hint ? `\n\n${colors.blue("◉")} ${colors.dim().italic(wordWrap(props.error.hint.replace(/(<([^>]+)>)/gi, ""), {
65
+ width: process.stdout.columns,
66
+ indent: " ",
67
+ newLine: "\n",
68
+ escape: (value) => value
69
+ }))}` : ""}`;
70
+ }
71
+ };
72
+ export { ErrorInfo };
@@ -0,0 +1,65 @@
1
+ import { n as BaseComponent, t as publicDirURL } from "../../../public_dir-C5bujZKB.js";
2
+ import { n as htmlEscape } from "../../../helpers-B9BQYaS6.js";
3
+ import { dump, themes } from "@poppinss/dumper/html";
4
+ var ErrorMetadata = class extends BaseComponent {
5
+ cssFile = new URL("./error_metadata/style.css", publicDirURL);
6
+ #primitives = [
7
+ "string",
8
+ "boolean",
9
+ "number",
10
+ "undefined"
11
+ ];
12
+ #formatRowValue(value, dumpValue, cspNonce) {
13
+ if (dumpValue === true) return dump(value, {
14
+ styles: themes.cssVariables,
15
+ cspNonce
16
+ });
17
+ if (this.#primitives.includes(typeof value) || value === null) return typeof value === "string" ? htmlEscape(value) : value;
18
+ return dump(value, {
19
+ styles: themes.cssVariables,
20
+ cspNonce
21
+ });
22
+ }
23
+ #renderRows(rows, cspNonce) {
24
+ return `<table class="card-table">
25
+ <tbody>
26
+ ${rows.map((row) => {
27
+ return `<tr>
28
+ <td class="table-key">${row.key}</td>
29
+ <td class="table-value">
30
+ ${this.#formatRowValue(row.value, row.dump, cspNonce)}
31
+ </td>
32
+ </tr>`;
33
+ }).join("\n")}
34
+ </tbody>
35
+ </table>`;
36
+ }
37
+ #renderSection(section, rows, cspNonce) {
38
+ return `<div>
39
+ <h4 class="card-subtitle">${section}</h4>
40
+ ${Array.isArray(rows) ? this.#renderRows(rows, cspNonce) : `<span>${this.#formatRowValue(rows.value, rows.dump, cspNonce)}</span>`}
41
+ </div>`;
42
+ }
43
+ #renderGroup(group, sections, cspNonce) {
44
+ return `<section class="metadata-group">
45
+ <div class="card">
46
+ <div class="card-heading">
47
+ <h3 class="card-title">${group}</h3>
48
+ </div>
49
+ <div class="card-body">
50
+ ${Object.keys(sections).map((section) => this.#renderSection(section, sections[section], cspNonce)).join("\n")}
51
+ </div>
52
+ </div>
53
+ </section>`;
54
+ }
55
+ async toHTML(props) {
56
+ const groups = props.metadata.toJSON();
57
+ const groupsNames = Object.keys(groups);
58
+ if (!groupsNames.length) return "";
59
+ return groupsNames.map((group) => this.#renderGroup(group, groups[group], props.cspNonce)).join("\n");
60
+ }
61
+ async toANSI() {
62
+ return "";
63
+ }
64
+ };
65
+ export { ErrorMetadata };