@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,64 @@
1
+ import { t as NitroDevApp } from "./_dev.mjs";
2
+ import { RunnerMessageListener, RunnerRPCHooks } from "env-runner";
3
+ import { IncomingMessage } from "node:http";
4
+ import { Server, ServerOptions } from "srvx";
5
+ import { LoadConfigOptions, Nitro, NitroBuildInfo, NitroConfig, NitroOptions, TaskEvent, TaskRunnerOptions } from "nitro/types";
6
+ import { Socket } from "node:net";
7
+
8
+ //#region src/nitro.d.ts
9
+ declare function createNitro(config?: NitroConfig, opts?: LoadConfigOptions): Promise<Nitro>;
10
+ //#endregion
11
+ //#region src/config/loader.d.ts
12
+ declare function loadOptions(configOverrides?: NitroConfig, opts?: LoadConfigOptions): Promise<NitroOptions>;
13
+ //#endregion
14
+ //#region src/build/build.d.ts
15
+ declare function build(nitro: Nitro): Promise<void>;
16
+ //#endregion
17
+ //#region src/build/assets.d.ts
18
+ declare function copyPublicAssets(nitro: Nitro): Promise<void>;
19
+ //#endregion
20
+ //#region src/build/prepare.d.ts
21
+ declare function prepare(nitro: Nitro): Promise<void>;
22
+ //#endregion
23
+ //#region src/build/types.d.ts
24
+ declare function writeTypes(nitro: Nitro): Promise<void>;
25
+ //#endregion
26
+ //#region src/build/info.d.ts
27
+ declare function getBuildInfo(root: string): Promise<{
28
+ outputDir?: undefined;
29
+ buildInfo?: undefined;
30
+ } | {
31
+ outputDir: string;
32
+ buildInfo?: NitroBuildInfo;
33
+ }>;
34
+ //#endregion
35
+ //#region src/dev/server.d.ts
36
+ declare function createDevServer(nitro: Nitro): NitroDevServer;
37
+ declare class NitroDevServer extends NitroDevApp implements RunnerRPCHooks {
38
+ #private;
39
+ constructor(nitro: Nitro);
40
+ upgrade(req: IncomingMessage, socket: Socket, head: any): Promise<void>;
41
+ listen(opts?: Partial<Omit<ServerOptions, "fetch">>): Server;
42
+ close(): Promise<void>;
43
+ reload(): void;
44
+ sendMessage(message: unknown): void;
45
+ onMessage(listener: RunnerMessageListener): void;
46
+ offMessage(listener: RunnerMessageListener): void;
47
+ }
48
+ //#endregion
49
+ //#region src/prerender/prerender.d.ts
50
+ declare function prerender(nitro: Nitro): Promise<void>;
51
+ //#endregion
52
+ //#region src/task.d.ts
53
+ /** @experimental */
54
+ declare function runTask(taskEvent: TaskEvent, opts?: TaskRunnerOptions): Promise<{
55
+ result: unknown;
56
+ }>;
57
+ /** @experimental */
58
+ declare function listTasks(opts?: TaskRunnerOptions): Promise<Record<string, {
59
+ meta: {
60
+ description: string;
61
+ };
62
+ }>>;
63
+ //#endregion
64
+ export { build, copyPublicAssets, createDevServer, createNitro, getBuildInfo, listTasks, loadOptions, prepare, prerender, runTask, writeTypes };
@@ -0,0 +1,15 @@
1
+ import "./_libs/c12+rc9.mjs";
2
+ import { D as copyPublicAssets, E as prepare, _ as writeTypes, j as build, m as getBuildInfo } from "./_build/common.mjs";
3
+ import "./_libs/compatx.mjs";
4
+ import "./_libs/klona.mjs";
5
+ import { a as loadOptions, i as createNitro, n as runTask, r as prerender, t as listTasks } from "./_chunks/nitro.mjs";
6
+ import "./_libs/escape-string-regexp.mjs";
7
+ import "./_libs/tsconfck.mjs";
8
+ import "./_chunks/nitro2.mjs";
9
+ import "./_libs/rou3.mjs";
10
+ import "./_libs/readdirp+chokidar.mjs";
11
+ import "./_libs/perfect-debounce.mjs";
12
+ import "./_libs/httpxy.mjs";
13
+ import { n as createDevServer } from "./_dev.mjs";
14
+ import "./_libs/ultrahtml.mjs";
15
+ export { build, copyPublicAssets, createDevServer, createNitro, getBuildInfo, listTasks, loadOptions, prepare, prerender, runTask, writeTypes };
@@ -0,0 +1,47 @@
1
+ import { dt as resolve } from "../../_build/common.mjs";
2
+ import { t as defineCommand } from "../../_libs/citty.mjs";
3
+ import { t as commonArgs } from "./common.mjs";
4
+ import { build, copyPublicAssets, createNitro, prepare, prerender } from "nitro/builder";
5
+ //#region src/cli/commands/build.ts
6
+ const buildArgs = {
7
+ ...commonArgs,
8
+ minify: {
9
+ type: "boolean",
10
+ description: "Minify the output (overrides preset defaults you can also use `--no-minify` to disable)."
11
+ },
12
+ preset: {
13
+ type: "string",
14
+ description: "The build preset to use (you can also use `NITRO_PRESET` environment variable)."
15
+ },
16
+ builder: {
17
+ type: "string",
18
+ description: "The builder to use (you can also use `NITRO_BUILDER` environment variable)."
19
+ },
20
+ compatibilityDate: {
21
+ type: "string",
22
+ description: "The date to use for preset compatibility (you can also use `NITRO_COMPATIBILITY_DATE` environment variable)."
23
+ }
24
+ };
25
+ var build_default = defineCommand({
26
+ meta: {
27
+ name: "build",
28
+ description: "Build nitro project for production"
29
+ },
30
+ args: buildArgs,
31
+ async run({ args }) {
32
+ const nitro = await createNitro({
33
+ rootDir: resolve(args.dir || args._dir || "."),
34
+ dev: false,
35
+ minify: args.minify,
36
+ preset: args.preset,
37
+ builder: args.builder
38
+ }, { compatibilityDate: args.compatibilityDate });
39
+ await prepare(nitro);
40
+ await copyPublicAssets(nitro);
41
+ await prerender(nitro);
42
+ await build(nitro);
43
+ await nitro.close();
44
+ }
45
+ });
46
+ //#endregion
47
+ export { buildArgs, build_default as default };
@@ -0,0 +1,14 @@
1
+ //#region src/cli/common.ts
2
+ const commonArgs = {
3
+ dir: {
4
+ type: "string",
5
+ description: "project root directory"
6
+ },
7
+ _dir: {
8
+ type: "positional",
9
+ default: ".",
10
+ description: "project root directory (prefer using `--dir`)"
11
+ }
12
+ };
13
+ //#endregion
14
+ export { commonArgs as t };
@@ -0,0 +1,40 @@
1
+ import { dt as resolve, m as getBuildInfo, ut as relative } from "../../_build/common.mjs";
2
+ import { t as defineCommand } from "../../_libs/citty.mjs";
3
+ import "./common.mjs";
4
+ import build_default, { buildArgs } from "./build.mjs";
5
+ import consola from "consola";
6
+ import { execSync } from "node:child_process";
7
+ //#region src/cli/commands/deploy.ts
8
+ var deploy_default = defineCommand({
9
+ meta: {
10
+ name: "deploy",
11
+ description: "Build and deploy nitro project for production"
12
+ },
13
+ args: {
14
+ ...buildArgs,
15
+ prebuilt: {
16
+ type: "boolean",
17
+ description: "Skip the build step and deploy the existing build"
18
+ }
19
+ },
20
+ async run(ctx) {
21
+ globalThis.__nitroDeploying__ = true;
22
+ if (!ctx.args.prebuilt) await build_default.run(ctx);
23
+ if (globalThis.__nitroDeployed__) return;
24
+ const { buildInfo, outputDir } = await getBuildInfo(resolve(ctx.args.dir || ctx.args._dir || "."));
25
+ if (!buildInfo) {
26
+ consola.error("No build info found, cannot deploy.");
27
+ process.exit(1);
28
+ }
29
+ if (!buildInfo.commands?.deploy) {
30
+ consola.error(`The \`${buildInfo.preset}\` preset does not have a default deploy command.\n\nTry using a different preset with the \`--preset\` option, or configure a deploy command in the Nitro config, or deploy manually.`);
31
+ process.exit(1);
32
+ }
33
+ const extraArgs = ctx.rawArgs.indexOf("--") !== -1 ? ctx.rawArgs.slice(ctx.rawArgs.indexOf("--") + 1).join(" ") : "";
34
+ const deployCommand = buildInfo.commands.deploy.replace(/([\s:])\.\/(\S*)/g, `$1${relative(process.cwd(), outputDir)}/$2`) + (extraArgs ? ` ${extraArgs}` : "");
35
+ consola.info(`$ ${deployCommand}`);
36
+ execSync(deployCommand, { stdio: "inherit" });
37
+ }
38
+ });
39
+ //#endregion
40
+ export { deploy_default as default };
@@ -0,0 +1,62 @@
1
+ import { dt as resolve } from "../../_build/common.mjs";
2
+ import "../../_libs/readdirp+chokidar.mjs";
3
+ import "../../_libs/perfect-debounce.mjs";
4
+ import "../../_libs/httpxy.mjs";
5
+ import { t as NitroDevServer } from "../../_dev.mjs";
6
+ import { t as defineCommand } from "../../_libs/citty.mjs";
7
+ import { t as commonArgs } from "./common.mjs";
8
+ import { consola as consola$1 } from "consola";
9
+ import { build, createNitro, prepare } from "nitro/builder";
10
+ //#region src/cli/commands/dev.ts
11
+ const hmrKeyRe = /^runtimeConfig\.|routeRules\./;
12
+ var dev_default = defineCommand({
13
+ meta: {
14
+ name: "dev",
15
+ description: "Start the development server"
16
+ },
17
+ args: {
18
+ ...commonArgs,
19
+ port: {
20
+ type: "string",
21
+ description: "specify port"
22
+ },
23
+ host: {
24
+ type: "string",
25
+ description: "specify hostname "
26
+ }
27
+ },
28
+ async run({ args }) {
29
+ const rootDir = resolve(args.dir || args._dir || ".");
30
+ let nitro;
31
+ const reload = async () => {
32
+ if (nitro) {
33
+ consola$1.info("Restarting dev server...");
34
+ if ("unwatch" in nitro.options._c12) await nitro.options._c12.unwatch();
35
+ await nitro.close();
36
+ }
37
+ nitro = await createNitro({
38
+ rootDir,
39
+ dev: true,
40
+ _cli: { command: "dev" }
41
+ }, {
42
+ watch: true,
43
+ c12: { async onUpdate({ getDiff, newConfig }) {
44
+ const diff = getDiff();
45
+ if (diff.length === 0) return;
46
+ consola$1.info("Nitro config updated:\n" + diff.map((entry) => ` ${entry.toString()}`).join("\n"));
47
+ await (diff.every((e) => hmrKeyRe.test(e.key)) ? nitro.updateConfig(newConfig.config || {}) : reload());
48
+ } }
49
+ });
50
+ nitro.hooks.hookOnce("restart", reload);
51
+ await new NitroDevServer(nitro).listen({
52
+ port: args.port || nitro.options.devServer.port,
53
+ hostname: args.host || nitro.options.devServer.hostname
54
+ });
55
+ await prepare(nitro);
56
+ await build(nitro);
57
+ };
58
+ await reload();
59
+ }
60
+ });
61
+ //#endregion
62
+ export { dev_default as default };
@@ -0,0 +1,30 @@
1
+ import { t as defineCommand } from "../../_libs/citty.mjs";
2
+ import { execSync } from "node:child_process";
3
+ //#region src/cli/commands/docs.ts
4
+ var docs_default = defineCommand({
5
+ meta: {
6
+ name: "docs",
7
+ description: "Explore Nitro documentation"
8
+ },
9
+ args: { page: {
10
+ type: "string",
11
+ description: "Page path to open"
12
+ } },
13
+ run({ rawArgs }) {
14
+ const runnerCmd = ([
15
+ ["bun", "x"],
16
+ ["pnpm", "dlx"],
17
+ ["npm", "x"]
18
+ ].find(([pkg]) => {
19
+ try {
20
+ execSync(`${pkg} -v`, { stdio: "ignore" });
21
+ return true;
22
+ } catch {}
23
+ }) || ["npm", "x"]).join(" ");
24
+ const docsDir = new URL("../../../skills/nitro/docs", import.meta.url).pathname;
25
+ const args = rawArgs?.join(" ") || "";
26
+ execSync(`${runnerCmd} mdzilla ${docsDir}${args ? ` ${args}` : ""}`, { stdio: "inherit" });
27
+ }
28
+ });
29
+ //#endregion
30
+ export { docs_default as default };
@@ -0,0 +1,25 @@
1
+ import { dt as resolve } from "../../_build/common.mjs";
2
+ import { t as defineCommand } from "../../_libs/citty.mjs";
3
+ import { consola as consola$1 } from "consola";
4
+ import { listTasks, loadOptions } from "nitro/builder";
5
+ //#region src/cli/commands/task/list.ts
6
+ var list_default = defineCommand({
7
+ meta: {
8
+ name: "run",
9
+ description: "List available tasks (experimental)"
10
+ },
11
+ args: { dir: {
12
+ type: "string",
13
+ description: "project root directory"
14
+ } },
15
+ async run({ args }) {
16
+ const cwd = resolve(args.dir || args.cwd || ".");
17
+ const tasks = await listTasks({
18
+ cwd,
19
+ buildDir: (await loadOptions({ rootDir: cwd }).catch(() => void 0))?.buildDir || ".nitro"
20
+ });
21
+ for (const [name, task] of Object.entries(tasks)) consola$1.log(` - \`${name}\`${task.meta?.description ? ` - ${task.meta.description}` : ""}`);
22
+ }
23
+ });
24
+ //#endregion
25
+ export { list_default as default };
@@ -0,0 +1,17 @@
1
+ import { dt as resolve } from "../../_build/common.mjs";
2
+ import { t as defineCommand } from "../../_libs/citty.mjs";
3
+ import { t as commonArgs } from "./common.mjs";
4
+ import { createNitro, writeTypes } from "nitro/builder";
5
+ //#region src/cli/commands/prepare.ts
6
+ var prepare_default = defineCommand({
7
+ meta: {
8
+ name: "prepare",
9
+ description: "Generate types for the project"
10
+ },
11
+ args: { ...commonArgs },
12
+ async run({ args }) {
13
+ await writeTypes(await createNitro({ rootDir: resolve(args.dir || args._dir || ".") }));
14
+ }
15
+ });
16
+ //#endregion
17
+ export { prepare_default as default };
@@ -0,0 +1,51 @@
1
+ import { dt as resolve } from "../../_build/common.mjs";
2
+ import "../../_libs/httpxy.mjs";
3
+ import { t as defineCommand } from "../../_libs/citty.mjs";
4
+ import { t as startPreview } from "../../_chunks/nitro3.mjs";
5
+ import { t as commonArgs } from "./common.mjs";
6
+ import { serve } from "srvx";
7
+ import { log } from "srvx/log";
8
+ //#region src/cli/commands/preview.ts
9
+ var preview_default = defineCommand({
10
+ meta: {
11
+ name: "preview",
12
+ description: "Start a local server to preview the built server"
13
+ },
14
+ args: {
15
+ ...commonArgs,
16
+ port: {
17
+ type: "string",
18
+ description: "specify port"
19
+ },
20
+ host: {
21
+ type: "string",
22
+ description: "specify hostname"
23
+ }
24
+ },
25
+ async run({ args }) {
26
+ const rootDir = resolve(args.dir || args._dir || ".");
27
+ const server = serve({
28
+ fetch(req) {
29
+ return preview.fetch(req);
30
+ },
31
+ middleware: [log()],
32
+ gracefulShutdown: false,
33
+ port: args.port,
34
+ hostname: args.host
35
+ });
36
+ const preview = await startPreview({
37
+ rootDir,
38
+ loader: { srvxServer: server }
39
+ });
40
+ if (preview.upgrade) server.node?.server?.on("upgrade", (req, socket, head) => {
41
+ preview.upgrade(req, socket, head);
42
+ });
43
+ process.on("SIGINT", async () => {
44
+ await server.close();
45
+ await preview.close();
46
+ process.exit(0);
47
+ });
48
+ }
49
+ });
50
+ //#endregion
51
+ export { preview_default as default };
@@ -0,0 +1,53 @@
1
+ import { dt as resolve } from "../../_build/common.mjs";
2
+ import { t as defineCommand } from "../../_libs/citty.mjs";
3
+ import { consola as consola$1 } from "consola";
4
+ import destr from "destr";
5
+ import { loadOptions, runTask } from "nitro/builder";
6
+ //#region src/cli/commands/task/run.ts
7
+ var run_default = defineCommand({
8
+ meta: {
9
+ name: "run",
10
+ description: "Run a runtime task in the currently running dev server (experimental)"
11
+ },
12
+ args: {
13
+ name: {
14
+ type: "positional",
15
+ description: "task name",
16
+ required: true
17
+ },
18
+ dir: {
19
+ type: "string",
20
+ description: "project root directory"
21
+ },
22
+ payload: {
23
+ type: "string",
24
+ description: "payload json to pass to the task"
25
+ }
26
+ },
27
+ async run({ args }) {
28
+ const cwd = resolve(args.dir || args.cwd || ".");
29
+ const options = await loadOptions({ rootDir: cwd }).catch(() => void 0);
30
+ consola$1.info(`Running task \`${args.name}\`...`);
31
+ let payload = destr(args.payload || "{}");
32
+ if (typeof payload !== "object") {
33
+ consola$1.error(`Invalid payload: \`${args.payload}\` (it should be a valid JSON object)`);
34
+ payload = void 0;
35
+ }
36
+ try {
37
+ const { result } = await runTask({
38
+ name: args.name,
39
+ context: {},
40
+ payload
41
+ }, {
42
+ cwd,
43
+ buildDir: options?.buildDir || ".nitro"
44
+ });
45
+ consola$1.success("Result:", result);
46
+ } catch (error) {
47
+ consola$1.error(`Failed to run task \`${args.name}\`: ${error}`);
48
+ process.exit(1);
49
+ }
50
+ }
51
+ });
52
+ //#endregion
53
+ export { run_default as default };
@@ -0,0 +1,14 @@
1
+ import { t as defineCommand } from "../../_libs/citty.mjs";
2
+ //#region src/cli/commands/task/index.ts
3
+ var task_default = defineCommand({
4
+ meta: {
5
+ name: "task",
6
+ description: "Operate in nitro tasks (experimental)"
7
+ },
8
+ subCommands: {
9
+ list: () => import("./list.mjs").then((r) => r.default),
10
+ run: () => import("./run.mjs").then((r) => r.default)
11
+ }
12
+ });
13
+ //#endregion
14
+ export { task_default as default };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ import { n as runMain, t as defineCommand } from "../_libs/citty.mjs";
3
+ import { version } from "nitro/meta";
4
+ //#region src/cli/index.ts
5
+ runMain(defineCommand({
6
+ meta: {
7
+ name: "nitro",
8
+ description: "Nitro CLI",
9
+ version
10
+ },
11
+ subCommands: {
12
+ dev: () => import("./_chunks/dev.mjs").then((r) => r.default),
13
+ build: () => import("./_chunks/build.mjs").then((r) => r.default),
14
+ deploy: () => import("./_chunks/deploy.mjs").then((r) => r.default),
15
+ prepare: () => import("./_chunks/prepare.mjs").then((r) => r.default),
16
+ task: () => import("./_chunks/task.mjs").then((r) => r.default),
17
+ preview: () => import("./_chunks/preview.mjs").then((r) => r.default),
18
+ docs: () => import("./_chunks/docs.mjs").then((r) => r.default)
19
+ }
20
+ }));
21
+ //#endregion
22
+ export {};
@@ -0,0 +1,139 @@
1
+ import kleur from "kleur";
2
+ var Colors = class {
3
+ black(text) {
4
+ return this.transform("black", text);
5
+ }
6
+ red(text) {
7
+ return this.transform("red", text);
8
+ }
9
+ green(text) {
10
+ return this.transform("green", text);
11
+ }
12
+ yellow(text) {
13
+ return this.transform("yellow", text);
14
+ }
15
+ blue(text) {
16
+ return this.transform("blue", text);
17
+ }
18
+ magenta(text) {
19
+ return this.transform("magenta", text);
20
+ }
21
+ cyan(text) {
22
+ return this.transform("cyan", text);
23
+ }
24
+ white(text) {
25
+ return this.transform("white", text);
26
+ }
27
+ gray(text) {
28
+ return this.transform("gray", text);
29
+ }
30
+ grey(text) {
31
+ return this.transform("grey", text);
32
+ }
33
+ bgBlack(text) {
34
+ return this.transform("bgBlack", text);
35
+ }
36
+ bgRed(text) {
37
+ return this.transform("bgRed", text);
38
+ }
39
+ bgGreen(text) {
40
+ return this.transform("bgGreen", text);
41
+ }
42
+ bgYellow(text) {
43
+ return this.transform("bgYellow", text);
44
+ }
45
+ bgBlue(text) {
46
+ return this.transform("bgBlue", text);
47
+ }
48
+ bgMagenta(text) {
49
+ return this.transform("bgMagenta", text);
50
+ }
51
+ bgCyan(text) {
52
+ return this.transform("bgCyan", text);
53
+ }
54
+ bgWhite(text) {
55
+ return this.transform("bgWhite", text);
56
+ }
57
+ reset(text) {
58
+ return this.transform("reset", text);
59
+ }
60
+ bold(text) {
61
+ return this.transform("bold", text);
62
+ }
63
+ dim(text) {
64
+ return this.transform("dim", text);
65
+ }
66
+ italic(text) {
67
+ return this.transform("italic", text);
68
+ }
69
+ underline(text) {
70
+ return this.transform("underline", text);
71
+ }
72
+ inverse(text) {
73
+ return this.transform("inverse", text);
74
+ }
75
+ hidden(text) {
76
+ return this.transform("hidden", text);
77
+ }
78
+ strikethrough(text) {
79
+ return this.transform("strikethrough", text);
80
+ }
81
+ };
82
+ var Raw = class extends Colors {
83
+ #transformations = [];
84
+ #dispose(value, callback) {
85
+ callback();
86
+ return value;
87
+ }
88
+ transform(transformation, text) {
89
+ this.#transformations.push(transformation);
90
+ if (text !== void 0) {
91
+ const transformations = this.#transformations.concat([text]).join("(");
92
+ const closingWrapping = new Array(this.#transformations.length + 1).join(")");
93
+ return this.#dispose(`${transformations}${closingWrapping}`, () => {
94
+ this.#transformations = [];
95
+ });
96
+ }
97
+ return this;
98
+ }
99
+ };
100
+ var Kleur = class extends Colors {
101
+ #chain;
102
+ constructor() {
103
+ super();
104
+ kleur.enabled = true;
105
+ }
106
+ #dispose(value, callback) {
107
+ callback();
108
+ return value;
109
+ }
110
+ transform(transformation, text) {
111
+ if (text !== void 0) {
112
+ if (this.#chain) return this.#dispose(this.#chain[transformation](text), () => {
113
+ this.#chain = void 0;
114
+ });
115
+ return kleur[transformation](text);
116
+ }
117
+ if (this.#chain) this.#chain = this.#chain[transformation]();
118
+ else this.#chain = kleur[transformation]();
119
+ return this;
120
+ }
121
+ };
122
+ var Silent = class extends Colors {
123
+ transform(_, text) {
124
+ if (text !== void 0) return String(text);
125
+ return this;
126
+ }
127
+ };
128
+ var colors_default = {
129
+ ansi() {
130
+ return new Kleur();
131
+ },
132
+ silent() {
133
+ return new Silent();
134
+ },
135
+ raw() {
136
+ return new Raw();
137
+ }
138
+ };
139
+ export { colors_default as default };