@maizzle/framework 6.0.0-8 → 6.0.0-rc.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 (614) hide show
  1. package/bin/maizzle.mjs +10 -0
  2. package/dist/build.d.mts +19 -0
  3. package/dist/build.d.mts.map +1 -0
  4. package/dist/build.mjs +121 -0
  5. package/dist/build.mjs.map +1 -0
  6. package/dist/components/Button.vue +141 -0
  7. package/dist/components/Divider.vue +105 -0
  8. package/dist/components/NoWidows.vue +123 -0
  9. package/dist/components/NotOutlook.vue +17 -0
  10. package/dist/components/Outlook.vue +74 -0
  11. package/dist/components/Spacer.vue +36 -0
  12. package/dist/components/Vml.vue +89 -0
  13. package/dist/components/WithUrl.vue +190 -0
  14. package/dist/components/utils.d.mts +5 -0
  15. package/dist/components/utils.d.mts.map +1 -0
  16. package/dist/components/utils.mjs +9 -0
  17. package/dist/components/utils.mjs.map +1 -0
  18. package/dist/components/utils.ts +6 -0
  19. package/dist/composables/defineConfig.d.mts +14 -0
  20. package/dist/composables/defineConfig.d.mts.map +1 -0
  21. package/dist/composables/defineConfig.mjs +34 -0
  22. package/dist/composables/defineConfig.mjs.map +1 -0
  23. package/dist/composables/renderContext.d.mts +19 -0
  24. package/dist/composables/renderContext.d.mts.map +1 -0
  25. package/dist/composables/renderContext.mjs +6 -0
  26. package/dist/composables/renderContext.mjs.map +1 -0
  27. package/dist/composables/useConfig.d.mts +9 -0
  28. package/dist/composables/useConfig.d.mts.map +1 -0
  29. package/dist/composables/useConfig.mjs +13 -0
  30. package/dist/composables/useConfig.mjs.map +1 -0
  31. package/dist/composables/useDoctype.d.mts +13 -0
  32. package/dist/composables/useDoctype.d.mts.map +1 -0
  33. package/dist/composables/useDoctype.mjs +20 -0
  34. package/dist/composables/useDoctype.mjs.map +1 -0
  35. package/dist/composables/useEvent.d.mts +17 -0
  36. package/dist/composables/useEvent.d.mts.map +1 -0
  37. package/dist/composables/useEvent.mjs +25 -0
  38. package/dist/composables/useEvent.mjs.map +1 -0
  39. package/dist/composables/usePlaintext.d.mts +19 -0
  40. package/dist/composables/usePlaintext.d.mts.map +1 -0
  41. package/dist/composables/usePlaintext.mjs +22 -0
  42. package/dist/composables/usePlaintext.mjs.map +1 -0
  43. package/dist/config/defaults.d.mts +6 -0
  44. package/dist/config/defaults.d.mts.map +1 -0
  45. package/dist/config/defaults.mjs +28 -0
  46. package/dist/config/defaults.mjs.map +1 -0
  47. package/dist/config/index.d.mts +15 -0
  48. package/dist/config/index.d.mts.map +1 -0
  49. package/dist/config/index.mjs +47 -0
  50. package/dist/config/index.mjs.map +1 -0
  51. package/dist/events/index.d.mts +91 -0
  52. package/dist/events/index.d.mts.map +1 -0
  53. package/dist/events/index.mjs +110 -0
  54. package/dist/events/index.mjs.map +1 -0
  55. package/dist/index.d.mts +29 -0
  56. package/dist/index.mjs +29 -0
  57. package/dist/plaintext.d.mts +5 -0
  58. package/dist/plaintext.d.mts.map +1 -0
  59. package/dist/plaintext.mjs +15 -0
  60. package/dist/plaintext.mjs.map +1 -0
  61. package/dist/plugin.d.mts +17 -0
  62. package/dist/plugin.d.mts.map +1 -0
  63. package/dist/plugin.mjs +41 -0
  64. package/dist/plugin.mjs.map +1 -0
  65. package/dist/plugins/postcss/mergeMediaQueries.d.mts +18 -0
  66. package/dist/plugins/postcss/mergeMediaQueries.d.mts.map +1 -0
  67. package/dist/plugins/postcss/mergeMediaQueries.mjs +22 -0
  68. package/dist/plugins/postcss/mergeMediaQueries.mjs.map +1 -0
  69. package/dist/plugins/postcss/pruneVars.d.mts +8 -0
  70. package/dist/plugins/postcss/pruneVars.d.mts.map +1 -0
  71. package/dist/plugins/postcss/pruneVars.mjs +49 -0
  72. package/dist/plugins/postcss/pruneVars.mjs.map +1 -0
  73. package/dist/plugins/postcss/removeDeclarations.d.mts +12 -0
  74. package/dist/plugins/postcss/removeDeclarations.d.mts.map +1 -0
  75. package/dist/plugins/postcss/removeDeclarations.mjs +45 -0
  76. package/dist/plugins/postcss/removeDeclarations.mjs.map +1 -0
  77. package/dist/plugins/postcss/tailwindCleanup.d.mts +18 -0
  78. package/dist/plugins/postcss/tailwindCleanup.d.mts.map +1 -0
  79. package/dist/plugins/postcss/tailwindCleanup.mjs +35 -0
  80. package/dist/plugins/postcss/tailwindCleanup.mjs.map +1 -0
  81. package/dist/render/createRenderer.d.mts +34 -0
  82. package/dist/render/createRenderer.d.mts.map +1 -0
  83. package/dist/render/createRenderer.mjs +149 -0
  84. package/dist/render/createRenderer.mjs.map +1 -0
  85. package/dist/render/index.d.mts +26 -0
  86. package/dist/render/index.d.mts.map +1 -0
  87. package/dist/render/index.mjs +40 -0
  88. package/dist/render/index.mjs.map +1 -0
  89. package/dist/serve.d.mts +25 -0
  90. package/dist/serve.d.mts.map +1 -0
  91. package/dist/serve.mjs +402 -0
  92. package/dist/serve.mjs.map +1 -0
  93. package/dist/server/compatibility.d.mts +6 -0
  94. package/dist/server/compatibility.d.mts.map +1 -0
  95. package/dist/server/compatibility.mjs +83 -0
  96. package/dist/server/compatibility.mjs.map +1 -0
  97. package/dist/server/linter.d.mts +6 -0
  98. package/dist/server/linter.d.mts.map +1 -0
  99. package/dist/server/linter.mjs +200 -0
  100. package/dist/server/linter.mjs.map +1 -0
  101. package/dist/server/ui/App.vue +360 -0
  102. package/dist/server/ui/components/ui/button/Button.vue +31 -0
  103. package/dist/server/ui/components/ui/button/index.ts +38 -0
  104. package/dist/server/ui/components/ui/command/Command.vue +87 -0
  105. package/dist/server/ui/components/ui/command/CommandDialog.vue +31 -0
  106. package/dist/server/ui/components/ui/command/CommandEmpty.vue +27 -0
  107. package/dist/server/ui/components/ui/command/CommandGroup.vue +45 -0
  108. package/dist/server/ui/components/ui/command/CommandInput.vue +39 -0
  109. package/dist/server/ui/components/ui/command/CommandItem.vue +76 -0
  110. package/dist/server/ui/components/ui/command/CommandList.vue +25 -0
  111. package/dist/server/ui/components/ui/command/CommandSeparator.vue +21 -0
  112. package/dist/server/ui/components/ui/command/CommandShortcut.vue +17 -0
  113. package/dist/server/ui/components/ui/command/index.ts +25 -0
  114. package/dist/server/ui/components/ui/dialog/Dialog.vue +19 -0
  115. package/dist/server/ui/components/ui/dialog/DialogClose.vue +15 -0
  116. package/dist/server/ui/components/ui/dialog/DialogContent.vue +53 -0
  117. package/dist/server/ui/components/ui/dialog/DialogDescription.vue +23 -0
  118. package/dist/server/ui/components/ui/dialog/DialogFooter.vue +27 -0
  119. package/dist/server/ui/components/ui/dialog/DialogHeader.vue +17 -0
  120. package/dist/server/ui/components/ui/dialog/DialogOverlay.vue +21 -0
  121. package/dist/server/ui/components/ui/dialog/DialogScrollContent.vue +59 -0
  122. package/dist/server/ui/components/ui/dialog/DialogTitle.vue +23 -0
  123. package/dist/server/ui/components/ui/dialog/DialogTrigger.vue +15 -0
  124. package/dist/server/ui/components/ui/dialog/index.ts +10 -0
  125. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
  126. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
  127. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
  128. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
  129. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
  130. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
  131. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
  132. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
  133. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
  134. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
  135. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
  136. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
  137. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
  138. package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
  139. package/dist/server/ui/components/ui/dropdown-menu/index.ts +16 -0
  140. package/dist/server/ui/components/ui/empty/Empty.vue +20 -0
  141. package/dist/server/ui/components/ui/empty/EmptyContent.vue +20 -0
  142. package/dist/server/ui/components/ui/empty/EmptyDescription.vue +20 -0
  143. package/dist/server/ui/components/ui/empty/EmptyHeader.vue +20 -0
  144. package/dist/server/ui/components/ui/empty/EmptyMedia.vue +21 -0
  145. package/dist/server/ui/components/ui/empty/EmptyTitle.vue +17 -0
  146. package/dist/server/ui/components/ui/empty/index.ts +26 -0
  147. package/dist/server/ui/components/ui/input/Input.vue +33 -0
  148. package/dist/server/ui/components/ui/input/index.ts +1 -0
  149. package/dist/server/ui/components/ui/kbd/Kbd.vue +20 -0
  150. package/dist/server/ui/components/ui/kbd/KbdGroup.vue +17 -0
  151. package/dist/server/ui/components/ui/kbd/index.ts +2 -0
  152. package/dist/server/ui/components/ui/resizable/ResizableHandle.vue +30 -0
  153. package/dist/server/ui/components/ui/resizable/ResizablePanel.vue +21 -0
  154. package/dist/server/ui/components/ui/resizable/ResizablePanelGroup.vue +25 -0
  155. package/dist/server/ui/components/ui/resizable/index.ts +3 -0
  156. package/dist/server/ui/components/ui/scroll-area/ScrollArea.vue +33 -0
  157. package/dist/server/ui/components/ui/scroll-area/ScrollBar.vue +32 -0
  158. package/dist/server/ui/components/ui/scroll-area/index.ts +2 -0
  159. package/dist/server/ui/components/ui/separator/Separator.vue +29 -0
  160. package/dist/server/ui/components/ui/separator/index.ts +1 -0
  161. package/dist/server/ui/components/ui/sheet/Sheet.vue +19 -0
  162. package/dist/server/ui/components/ui/sheet/SheetClose.vue +15 -0
  163. package/dist/server/ui/components/ui/sheet/SheetContent.vue +62 -0
  164. package/dist/server/ui/components/ui/sheet/SheetDescription.vue +21 -0
  165. package/dist/server/ui/components/ui/sheet/SheetFooter.vue +16 -0
  166. package/dist/server/ui/components/ui/sheet/SheetHeader.vue +15 -0
  167. package/dist/server/ui/components/ui/sheet/SheetOverlay.vue +21 -0
  168. package/dist/server/ui/components/ui/sheet/SheetTitle.vue +21 -0
  169. package/dist/server/ui/components/ui/sheet/SheetTrigger.vue +15 -0
  170. package/dist/server/ui/components/ui/sheet/index.ts +8 -0
  171. package/dist/server/ui/components/ui/sidebar/Sidebar.vue +96 -0
  172. package/dist/server/ui/components/ui/sidebar/SidebarContent.vue +18 -0
  173. package/dist/server/ui/components/ui/sidebar/SidebarFooter.vue +18 -0
  174. package/dist/server/ui/components/ui/sidebar/SidebarGroup.vue +18 -0
  175. package/dist/server/ui/components/ui/sidebar/SidebarGroupAction.vue +27 -0
  176. package/dist/server/ui/components/ui/sidebar/SidebarGroupContent.vue +18 -0
  177. package/dist/server/ui/components/ui/sidebar/SidebarGroupLabel.vue +25 -0
  178. package/dist/server/ui/components/ui/sidebar/SidebarHeader.vue +18 -0
  179. package/dist/server/ui/components/ui/sidebar/SidebarInput.vue +31 -0
  180. package/dist/server/ui/components/ui/sidebar/SidebarInset.vue +21 -0
  181. package/dist/server/ui/components/ui/sidebar/SidebarMenu.vue +18 -0
  182. package/dist/server/ui/components/ui/sidebar/SidebarMenuAction.vue +35 -0
  183. package/dist/server/ui/components/ui/sidebar/SidebarMenuBadge.vue +26 -0
  184. package/dist/server/ui/components/ui/sidebar/SidebarMenuButton.vue +48 -0
  185. package/dist/server/ui/components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
  186. package/dist/server/ui/components/ui/sidebar/SidebarMenuItem.vue +18 -0
  187. package/dist/server/ui/components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
  188. package/dist/server/ui/components/ui/sidebar/SidebarMenuSub.vue +22 -0
  189. package/dist/server/ui/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
  190. package/dist/server/ui/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
  191. package/dist/server/ui/components/ui/sidebar/SidebarProvider.vue +82 -0
  192. package/dist/server/ui/components/ui/sidebar/SidebarRail.vue +33 -0
  193. package/dist/server/ui/components/ui/sidebar/SidebarSeparator.vue +19 -0
  194. package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +28 -0
  195. package/dist/server/ui/components/ui/sidebar/index.ts +60 -0
  196. package/dist/server/ui/components/ui/sidebar/utils.ts +19 -0
  197. package/dist/server/ui/components/ui/skeleton/Skeleton.vue +17 -0
  198. package/dist/server/ui/components/ui/skeleton/index.ts +1 -0
  199. package/dist/server/ui/components/ui/tabs/Tabs.vue +24 -0
  200. package/dist/server/ui/components/ui/tabs/TabsContent.vue +21 -0
  201. package/dist/server/ui/components/ui/tabs/TabsList.vue +24 -0
  202. package/dist/server/ui/components/ui/tabs/TabsTrigger.vue +26 -0
  203. package/dist/server/ui/components/ui/tabs/index.ts +4 -0
  204. package/dist/server/ui/components/ui/toggle/Toggle.vue +35 -0
  205. package/dist/server/ui/components/ui/toggle/index.ts +28 -0
  206. package/dist/server/ui/components/ui/toggle-group/ToggleGroup.vue +49 -0
  207. package/dist/server/ui/components/ui/toggle-group/ToggleGroupItem.vue +46 -0
  208. package/dist/server/ui/components/ui/toggle-group/index.ts +2 -0
  209. package/dist/server/ui/components/ui/tooltip/Tooltip.vue +19 -0
  210. package/dist/server/ui/components/ui/tooltip/TooltipContent.vue +34 -0
  211. package/dist/server/ui/components/ui/tooltip/TooltipProvider.vue +14 -0
  212. package/dist/server/ui/components/ui/tooltip/TooltipTrigger.vue +15 -0
  213. package/dist/server/ui/components/ui/tooltip/index.ts +4 -0
  214. package/dist/server/ui/favicon.svg +1 -0
  215. package/dist/server/ui/index.html +13 -0
  216. package/dist/server/ui/lib/utils.ts +7 -0
  217. package/dist/server/ui/logo-gradient.svg +1 -0
  218. package/dist/server/ui/logo.svg +1 -0
  219. package/dist/server/ui/main.css +129 -0
  220. package/dist/server/ui/main.ts +16 -0
  221. package/dist/server/ui/mark-gradient.svg +1 -0
  222. package/dist/server/ui/mark.svg +1 -0
  223. package/dist/server/ui/pages/Home.vue +39 -0
  224. package/dist/server/ui/pages/Preview.vue +609 -0
  225. package/dist/server/ui/stripes.svg +174 -0
  226. package/dist/transformers/addAttributes.d.mts +32 -0
  227. package/dist/transformers/addAttributes.d.mts.map +1 -0
  228. package/dist/transformers/addAttributes.mjs +101 -0
  229. package/dist/transformers/addAttributes.mjs.map +1 -0
  230. package/dist/transformers/attributeToStyle.d.mts +25 -0
  231. package/dist/transformers/attributeToStyle.d.mts.map +1 -0
  232. package/dist/transformers/attributeToStyle.mjs +80 -0
  233. package/dist/transformers/attributeToStyle.mjs.map +1 -0
  234. package/dist/transformers/base.d.mts +8 -0
  235. package/dist/transformers/base.d.mts.map +1 -0
  236. package/dist/transformers/base.mjs +160 -0
  237. package/dist/transformers/base.mjs.map +1 -0
  238. package/dist/transformers/entities.d.mts +8 -0
  239. package/dist/transformers/entities.d.mts.map +1 -0
  240. package/dist/transformers/entities.mjs +38 -0
  241. package/dist/transformers/entities.mjs.map +1 -0
  242. package/dist/transformers/format.d.mts +15 -0
  243. package/dist/transformers/format.d.mts.map +1 -0
  244. package/dist/transformers/format.mjs +26 -0
  245. package/dist/transformers/format.mjs.map +1 -0
  246. package/dist/transformers/index.d.mts +35 -0
  247. package/dist/transformers/index.d.mts.map +1 -0
  248. package/dist/transformers/index.mjs +73 -0
  249. package/dist/transformers/index.mjs.map +1 -0
  250. package/dist/transformers/inlineCSS.d.mts +30 -0
  251. package/dist/transformers/inlineCSS.d.mts.map +1 -0
  252. package/dist/transformers/inlineCSS.mjs +79 -0
  253. package/dist/transformers/inlineCSS.mjs.map +1 -0
  254. package/dist/transformers/inlineLink.d.mts +14 -0
  255. package/dist/transformers/inlineLink.d.mts.map +1 -0
  256. package/dist/transformers/inlineLink.mjs +76 -0
  257. package/dist/transformers/inlineLink.mjs.map +1 -0
  258. package/dist/transformers/minify.d.mts +17 -0
  259. package/dist/transformers/minify.d.mts.map +1 -0
  260. package/dist/transformers/minify.mjs +24 -0
  261. package/dist/transformers/minify.mjs.map +1 -0
  262. package/dist/transformers/purgeCSS.d.mts +23 -0
  263. package/dist/transformers/purgeCSS.d.mts.map +1 -0
  264. package/dist/transformers/purgeCSS.mjs +66 -0
  265. package/dist/transformers/purgeCSS.mjs.map +1 -0
  266. package/dist/transformers/removeAttributes.d.mts +31 -0
  267. package/dist/transformers/removeAttributes.d.mts.map +1 -0
  268. package/dist/transformers/removeAttributes.mjs +63 -0
  269. package/dist/transformers/removeAttributes.mjs.map +1 -0
  270. package/dist/transformers/replaceStrings.d.mts +16 -0
  271. package/dist/transformers/replaceStrings.d.mts.map +1 -0
  272. package/dist/transformers/replaceStrings.mjs +19 -0
  273. package/dist/transformers/replaceStrings.mjs.map +1 -0
  274. package/dist/transformers/safeClassNames.d.mts +22 -0
  275. package/dist/transformers/safeClassNames.d.mts.map +1 -0
  276. package/dist/transformers/safeClassNames.mjs +103 -0
  277. package/dist/transformers/safeClassNames.mjs.map +1 -0
  278. package/dist/transformers/shorthandCSS.d.mts +24 -0
  279. package/dist/transformers/shorthandCSS.d.mts.map +1 -0
  280. package/dist/transformers/shorthandCSS.mjs +48 -0
  281. package/dist/transformers/shorthandCSS.mjs.map +1 -0
  282. package/dist/transformers/tailwindcss.d.mts +20 -0
  283. package/dist/transformers/tailwindcss.d.mts.map +1 -0
  284. package/dist/transformers/tailwindcss.mjs +136 -0
  285. package/dist/transformers/tailwindcss.mjs.map +1 -0
  286. package/dist/transformers/urlQuery.d.mts +24 -0
  287. package/dist/transformers/urlQuery.d.mts.map +1 -0
  288. package/dist/transformers/urlQuery.mjs +65 -0
  289. package/dist/transformers/urlQuery.mjs.map +1 -0
  290. package/dist/types/config.d.mts +129 -0
  291. package/dist/types/config.d.mts.map +1 -0
  292. package/dist/types/config.mjs +1 -0
  293. package/dist/types/index.d.mts +2 -0
  294. package/dist/types/index.mjs +1 -0
  295. package/dist/utils/ast/index.d.mts +4 -0
  296. package/dist/utils/ast/index.mjs +5 -0
  297. package/dist/utils/ast/parser.d.mts +7 -0
  298. package/dist/utils/ast/parser.d.mts.map +1 -0
  299. package/dist/utils/ast/parser.mjs +15 -0
  300. package/dist/utils/ast/parser.mjs.map +1 -0
  301. package/dist/utils/ast/serializer.d.mts +7 -0
  302. package/dist/utils/ast/serializer.d.mts.map +1 -0
  303. package/dist/utils/ast/serializer.mjs +13 -0
  304. package/dist/utils/ast/serializer.mjs.map +1 -0
  305. package/dist/utils/ast/walker.d.mts +7 -0
  306. package/dist/utils/ast/walker.d.mts.map +1 -0
  307. package/dist/utils/ast/walker.mjs +12 -0
  308. package/dist/utils/ast/walker.mjs.map +1 -0
  309. package/dist/utils/url.d.mts +8 -0
  310. package/dist/utils/url.d.mts.map +1 -0
  311. package/dist/utils/url.mjs +32 -0
  312. package/dist/utils/url.mjs.map +1 -0
  313. package/node_modules/@clack/core/CHANGELOG.md +257 -0
  314. package/node_modules/@clack/core/LICENSE +9 -0
  315. package/node_modules/@clack/core/README.md +22 -0
  316. package/node_modules/@clack/core/dist/index.cjs +15 -0
  317. package/node_modules/@clack/core/dist/index.cjs.map +1 -0
  318. package/node_modules/@clack/core/dist/index.d.cts +211 -0
  319. package/node_modules/@clack/core/dist/index.d.mts +211 -0
  320. package/node_modules/@clack/core/dist/index.d.ts +211 -0
  321. package/node_modules/@clack/core/dist/index.mjs +15 -0
  322. package/node_modules/@clack/core/dist/index.mjs.map +1 -0
  323. package/node_modules/@clack/core/package.json +62 -0
  324. package/node_modules/@clack/prompts/CHANGELOG.md +412 -0
  325. package/node_modules/@clack/prompts/LICENSE +9 -0
  326. package/node_modules/@clack/prompts/README.md +207 -0
  327. package/node_modules/@clack/prompts/dist/index.cjs +87 -0
  328. package/node_modules/@clack/prompts/dist/index.cjs.map +1 -0
  329. package/node_modules/@clack/prompts/dist/index.d.cts +165 -0
  330. package/node_modules/@clack/prompts/dist/index.d.mts +165 -0
  331. package/node_modules/@clack/prompts/dist/index.d.ts +165 -0
  332. package/node_modules/@clack/prompts/dist/index.mjs +87 -0
  333. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
  334. package/node_modules/@clack/prompts/package.json +61 -0
  335. package/node_modules/@maizzle/cli/LICENSE +21 -0
  336. package/node_modules/@maizzle/cli/README.md +58 -0
  337. package/node_modules/@maizzle/cli/dist/commands/make/component.d.mts +4 -0
  338. package/node_modules/@maizzle/cli/dist/commands/make/component.mjs +31 -0
  339. package/node_modules/@maizzle/cli/dist/commands/make/config.d.mts +4 -0
  340. package/node_modules/@maizzle/cli/dist/commands/make/config.mjs +21 -0
  341. package/node_modules/@maizzle/cli/dist/commands/make/layout.d.mts +4 -0
  342. package/node_modules/@maizzle/cli/dist/commands/make/layout.mjs +31 -0
  343. package/node_modules/@maizzle/cli/dist/commands/make/scaffold.d.mts +5 -0
  344. package/node_modules/@maizzle/cli/dist/commands/make/scaffold.mjs +28 -0
  345. package/node_modules/@maizzle/cli/dist/commands/make/stubs/component.vue +9 -0
  346. package/node_modules/@maizzle/cli/dist/commands/make/stubs/config.ts +9 -0
  347. package/node_modules/@maizzle/cli/dist/commands/make/stubs/layout.vue +39 -0
  348. package/node_modules/@maizzle/cli/dist/commands/make/stubs/template.vue +8 -0
  349. package/node_modules/@maizzle/cli/dist/commands/make/template.d.mts +4 -0
  350. package/node_modules/@maizzle/cli/dist/commands/make/template.mjs +31 -0
  351. package/node_modules/@maizzle/cli/dist/index.d.mts +8 -0
  352. package/node_modules/@maizzle/cli/dist/index.mjs +42 -0
  353. package/node_modules/@maizzle/cli/package.json +59 -0
  354. package/node_modules/citty/LICENSE +36 -0
  355. package/node_modules/citty/README.md +134 -0
  356. package/node_modules/citty/dist/index.cjs +475 -0
  357. package/node_modules/citty/dist/index.d.cts +80 -0
  358. package/node_modules/citty/dist/index.d.mts +80 -0
  359. package/node_modules/citty/dist/index.d.ts +80 -0
  360. package/node_modules/citty/dist/index.mjs +463 -0
  361. package/node_modules/citty/package.json +49 -0
  362. package/node_modules/commander/LICENSE +22 -0
  363. package/node_modules/commander/Readme.md +1149 -0
  364. package/node_modules/commander/esm.mjs +16 -0
  365. package/node_modules/commander/index.js +24 -0
  366. package/node_modules/commander/lib/argument.js +149 -0
  367. package/node_modules/commander/lib/command.js +2662 -0
  368. package/node_modules/commander/lib/error.js +39 -0
  369. package/node_modules/commander/lib/help.js +709 -0
  370. package/node_modules/commander/lib/option.js +367 -0
  371. package/node_modules/commander/lib/suggestSimilar.js +101 -0
  372. package/node_modules/commander/package-support.json +16 -0
  373. package/node_modules/commander/package.json +82 -0
  374. package/node_modules/commander/typings/esm.d.mts +3 -0
  375. package/node_modules/commander/typings/index.d.ts +1045 -0
  376. package/node_modules/consola/LICENSE +47 -0
  377. package/node_modules/consola/README.md +352 -0
  378. package/node_modules/consola/basic.d.ts +1 -0
  379. package/node_modules/consola/browser.d.ts +1 -0
  380. package/node_modules/consola/core.d.ts +1 -0
  381. package/node_modules/consola/dist/basic.cjs +32 -0
  382. package/node_modules/consola/dist/basic.d.cts +23 -0
  383. package/node_modules/consola/dist/basic.d.mts +21 -0
  384. package/node_modules/consola/dist/basic.d.ts +23 -0
  385. package/node_modules/consola/dist/basic.mjs +24 -0
  386. package/node_modules/consola/dist/browser.cjs +84 -0
  387. package/node_modules/consola/dist/browser.d.cts +23 -0
  388. package/node_modules/consola/dist/browser.d.mts +21 -0
  389. package/node_modules/consola/dist/browser.d.ts +23 -0
  390. package/node_modules/consola/dist/browser.mjs +76 -0
  391. package/node_modules/consola/dist/chunks/prompt.cjs +288 -0
  392. package/node_modules/consola/dist/chunks/prompt.mjs +280 -0
  393. package/node_modules/consola/dist/core.cjs +517 -0
  394. package/node_modules/consola/dist/core.d.cts +459 -0
  395. package/node_modules/consola/dist/core.d.mts +459 -0
  396. package/node_modules/consola/dist/core.d.ts +459 -0
  397. package/node_modules/consola/dist/core.mjs +512 -0
  398. package/node_modules/consola/dist/index.cjs +663 -0
  399. package/node_modules/consola/dist/index.d.cts +24 -0
  400. package/node_modules/consola/dist/index.d.mts +22 -0
  401. package/node_modules/consola/dist/index.d.ts +24 -0
  402. package/node_modules/consola/dist/index.mjs +651 -0
  403. package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +75 -0
  404. package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
  405. package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
  406. package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +312 -0
  407. package/node_modules/consola/dist/utils.cjs +64 -0
  408. package/node_modules/consola/dist/utils.d.cts +286 -0
  409. package/node_modules/consola/dist/utils.d.mts +286 -0
  410. package/node_modules/consola/dist/utils.d.ts +286 -0
  411. package/node_modules/consola/dist/utils.mjs +54 -0
  412. package/node_modules/consola/lib/index.cjs +10 -0
  413. package/node_modules/consola/package.json +136 -0
  414. package/node_modules/consola/utils.d.ts +1 -0
  415. package/node_modules/create-maizzle/README.md +86 -0
  416. package/node_modules/create-maizzle/bin/create-maizzle.mjs +4 -0
  417. package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +340 -0
  418. package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +9 -0
  419. package/node_modules/create-maizzle/node_modules/@clack/core/README.md +22 -0
  420. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +349 -0
  421. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +11 -0
  422. package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +1 -0
  423. package/node_modules/create-maizzle/node_modules/@clack/core/package.json +60 -0
  424. package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +576 -0
  425. package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +9 -0
  426. package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +270 -0
  427. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +391 -0
  428. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +137 -0
  429. package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
  430. package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +65 -0
  431. package/node_modules/create-maizzle/package.json +47 -0
  432. package/node_modules/create-maizzle/src/index.js +242 -0
  433. package/node_modules/defu/LICENSE +21 -0
  434. package/node_modules/defu/README.md +171 -0
  435. package/node_modules/defu/dist/defu.cjs +77 -0
  436. package/node_modules/defu/dist/defu.d.cts +31 -0
  437. package/node_modules/defu/dist/defu.d.mts +29 -0
  438. package/node_modules/defu/dist/defu.d.ts +31 -0
  439. package/node_modules/defu/dist/defu.mjs +69 -0
  440. package/node_modules/defu/lib/defu.cjs +10 -0
  441. package/node_modules/defu/lib/defu.d.cts +12 -0
  442. package/node_modules/defu/package.json +48 -0
  443. package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  444. package/node_modules/fast-string-truncated-width/dist/index.js +171 -0
  445. package/node_modules/fast-string-truncated-width/dist/types.d.ts +22 -0
  446. package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  447. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  448. package/node_modules/fast-string-truncated-width/dist/utils.js +15 -0
  449. package/node_modules/fast-string-truncated-width/license +21 -0
  450. package/node_modules/fast-string-truncated-width/package.json +35 -0
  451. package/node_modules/fast-string-truncated-width/readme.md +60 -0
  452. package/node_modules/fast-string-width/dist/index.d.ts +4 -0
  453. package/node_modules/fast-string-width/dist/index.js +14 -0
  454. package/node_modules/fast-string-width/license +21 -0
  455. package/node_modules/fast-string-width/package.json +34 -0
  456. package/node_modules/fast-string-width/readme.md +45 -0
  457. package/node_modules/fast-wrap-ansi/LICENSE +23 -0
  458. package/node_modules/fast-wrap-ansi/README.md +26 -0
  459. package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  460. package/node_modules/fast-wrap-ansi/lib/main.js +216 -0
  461. package/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
  462. package/node_modules/fast-wrap-ansi/package.json +51 -0
  463. package/node_modules/giget/LICENSE +184 -0
  464. package/node_modules/giget/README.md +248 -0
  465. package/node_modules/giget/dist/cli.mjs +112 -0
  466. package/node_modules/giget/dist/index.d.mts +49 -0
  467. package/node_modules/giget/dist/index.mjs +22 -0
  468. package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +468 -0
  469. package/node_modules/giget/package.json +62 -0
  470. package/node_modules/node-fetch-native/LICENSE +114 -0
  471. package/node_modules/node-fetch-native/README.md +225 -0
  472. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +2 -0
  473. package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -0
  474. package/node_modules/node-fetch-native/dist/index.cjs +1 -0
  475. package/node_modules/node-fetch-native/dist/index.mjs +1 -0
  476. package/node_modules/node-fetch-native/dist/native.cjs +1 -0
  477. package/node_modules/node-fetch-native/dist/native.mjs +1 -0
  478. package/node_modules/node-fetch-native/dist/node.cjs +19 -0
  479. package/node_modules/node-fetch-native/dist/node.mjs +19 -0
  480. package/node_modules/node-fetch-native/dist/polyfill.cjs +1 -0
  481. package/node_modules/node-fetch-native/dist/polyfill.mjs +1 -0
  482. package/node_modules/node-fetch-native/dist/proxy-stub.cjs +1 -0
  483. package/node_modules/node-fetch-native/dist/proxy-stub.mjs +1 -0
  484. package/node_modules/node-fetch-native/dist/proxy.cjs +58 -0
  485. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +1 -0
  486. package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +1 -0
  487. package/node_modules/node-fetch-native/index.d.ts +1 -0
  488. package/node_modules/node-fetch-native/lib/empty.cjs +0 -0
  489. package/node_modules/node-fetch-native/lib/empty.mjs +0 -0
  490. package/node_modules/node-fetch-native/lib/index.cjs +11 -0
  491. package/node_modules/node-fetch-native/lib/index.d.cts +10 -0
  492. package/node_modules/node-fetch-native/lib/index.d.mts +10 -0
  493. package/node_modules/node-fetch-native/lib/index.d.ts +10 -0
  494. package/node_modules/node-fetch-native/lib/native.cjs +11 -0
  495. package/node_modules/node-fetch-native/lib/polyfill.d.cts +1 -0
  496. package/node_modules/node-fetch-native/lib/polyfill.d.mts +1 -0
  497. package/node_modules/node-fetch-native/lib/polyfill.d.ts +1 -0
  498. package/node_modules/node-fetch-native/lib/proxy.d.ts +32 -0
  499. package/node_modules/node-fetch-native/node.d.ts +1 -0
  500. package/node_modules/node-fetch-native/package.json +138 -0
  501. package/node_modules/node-fetch-native/polyfill.d.ts +1 -0
  502. package/node_modules/node-fetch-native/proxy.d.ts +1 -0
  503. package/node_modules/nypm/LICENSE +21 -0
  504. package/node_modules/nypm/README.md +152 -0
  505. package/node_modules/nypm/dist/cli.d.mts +1 -0
  506. package/node_modules/nypm/dist/cli.mjs +460 -0
  507. package/node_modules/nypm/dist/index.d.mts +209 -0
  508. package/node_modules/nypm/dist/index.mjs +423 -0
  509. package/node_modules/nypm/node_modules/citty/LICENSE +21 -0
  510. package/node_modules/nypm/node_modules/citty/README.md +231 -0
  511. package/node_modules/nypm/node_modules/citty/dist/THIRD-PARTY-LICENSES.md +33 -0
  512. package/node_modules/nypm/node_modules/citty/dist/_chunks/libs/scule.mjs +70 -0
  513. package/node_modules/nypm/node_modules/citty/dist/index.d.mts +112 -0
  514. package/node_modules/nypm/node_modules/citty/dist/index.mjs +425 -0
  515. package/node_modules/nypm/node_modules/citty/package.json +42 -0
  516. package/node_modules/nypm/package.json +54 -0
  517. package/node_modules/pathe/LICENSE +70 -0
  518. package/node_modules/pathe/README.md +73 -0
  519. package/node_modules/pathe/dist/index.cjs +39 -0
  520. package/node_modules/pathe/dist/index.d.cts +47 -0
  521. package/node_modules/pathe/dist/index.d.mts +47 -0
  522. package/node_modules/pathe/dist/index.d.ts +47 -0
  523. package/node_modules/pathe/dist/index.mjs +19 -0
  524. package/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs +266 -0
  525. package/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +249 -0
  526. package/node_modules/pathe/dist/utils.cjs +82 -0
  527. package/node_modules/pathe/dist/utils.d.cts +32 -0
  528. package/node_modules/pathe/dist/utils.d.mts +32 -0
  529. package/node_modules/pathe/dist/utils.d.ts +32 -0
  530. package/node_modules/pathe/dist/utils.mjs +77 -0
  531. package/node_modules/pathe/package.json +61 -0
  532. package/node_modules/pathe/utils.d.ts +1 -0
  533. package/node_modules/picocolors/LICENSE +15 -0
  534. package/node_modules/picocolors/README.md +21 -0
  535. package/node_modules/picocolors/package.json +25 -0
  536. package/node_modules/picocolors/picocolors.browser.js +4 -0
  537. package/node_modules/picocolors/picocolors.d.ts +5 -0
  538. package/node_modules/picocolors/picocolors.js +75 -0
  539. package/node_modules/picocolors/types.d.ts +51 -0
  540. package/node_modules/sisteransi/license +21 -0
  541. package/node_modules/sisteransi/package.json +34 -0
  542. package/node_modules/sisteransi/readme.md +113 -0
  543. package/node_modules/sisteransi/src/index.js +58 -0
  544. package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  545. package/node_modules/tinyexec/LICENSE +21 -0
  546. package/node_modules/tinyexec/README.md +269 -0
  547. package/node_modules/tinyexec/dist/LICENSES.txt +83 -0
  548. package/node_modules/tinyexec/dist/main.d.mts +71 -0
  549. package/node_modules/tinyexec/dist/main.mjs +642 -0
  550. package/node_modules/tinyexec/package.json +62 -0
  551. package/package.json +74 -74
  552. package/CHANGELOG.md +0 -764
  553. package/bin/maizzle +0 -5
  554. package/src/commands/build.js +0 -348
  555. package/src/commands/serve.js +0 -3
  556. package/src/generators/plaintext.js +0 -222
  557. package/src/generators/render.js +0 -129
  558. package/src/index.js +0 -49
  559. package/src/posthtml/defaultComponentsConfig.js +0 -19
  560. package/src/posthtml/defaultConfig.js +0 -14
  561. package/src/posthtml/index.js +0 -102
  562. package/src/posthtml/plugins/combineMediaQueries.js +0 -42
  563. package/src/posthtml/plugins/envAttributes.js +0 -32
  564. package/src/posthtml/plugins/envTags.js +0 -33
  565. package/src/posthtml/plugins/expandLinkTag.js +0 -59
  566. package/src/posthtml/plugins/postcss/compileCss.js +0 -129
  567. package/src/posthtml/plugins/removeRawStyleAttributes.js +0 -30
  568. package/src/server/client.js +0 -182
  569. package/src/server/index.js +0 -464
  570. package/src/server/routes/hmr.js +0 -26
  571. package/src/server/routes/index.js +0 -77
  572. package/src/server/views/404.html +0 -59
  573. package/src/server/views/error.html +0 -83
  574. package/src/server/views/index.html +0 -172
  575. package/src/server/websockets.js +0 -27
  576. package/src/transformers/addAttributes.js +0 -29
  577. package/src/transformers/attributeToStyle.js +0 -90
  578. package/src/transformers/baseUrl.js +0 -154
  579. package/src/transformers/core.js +0 -32
  580. package/src/transformers/filters/defaultFilters.js +0 -146
  581. package/src/transformers/filters/index.js +0 -18
  582. package/src/transformers/index.js +0 -259
  583. package/src/transformers/inline.js +0 -306
  584. package/src/transformers/markdown.js +0 -26
  585. package/src/transformers/minify.js +0 -27
  586. package/src/transformers/posthtmlMso.js +0 -14
  587. package/src/transformers/prettify.js +0 -29
  588. package/src/transformers/preventWidows.js +0 -37
  589. package/src/transformers/purge.js +0 -56
  590. package/src/transformers/removeAttributes.js +0 -55
  591. package/src/transformers/replaceStrings.js +0 -37
  592. package/src/transformers/safeClassNames.js +0 -29
  593. package/src/transformers/shorthandCss.js +0 -20
  594. package/src/transformers/sixHex.js +0 -30
  595. package/src/transformers/template.js +0 -26
  596. package/src/transformers/urlParameters.js +0 -20
  597. package/src/transformers/useAttributeSizes.js +0 -63
  598. package/src/utils/getConfigByFilePath.js +0 -143
  599. package/src/utils/node.js +0 -68
  600. package/src/utils/string.js +0 -186
  601. package/types/build.d.ts +0 -166
  602. package/types/config.d.ts +0 -638
  603. package/types/css/combineMediaQueries.d.ts +0 -90
  604. package/types/css/inline.d.ts +0 -218
  605. package/types/css/purge.d.ts +0 -125
  606. package/types/events.d.ts +0 -153
  607. package/types/index.d.ts +0 -232
  608. package/types/markdown.d.ts +0 -33
  609. package/types/minify.d.ts +0 -138
  610. package/types/plaintext.d.ts +0 -56
  611. package/types/posthtml.d.ts +0 -162
  612. package/types/render.d.ts +0 -13
  613. package/types/urlParameters.d.ts +0 -40
  614. package/types/widowWords.d.ts +0 -38
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "giget",
3
+ "version": "2.0.0",
4
+ "description": "Download templates and git repositories with pleasure!",
5
+ "repository": "unjs/giget",
6
+ "license": "MIT",
7
+ "sideEffects": false,
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.mts",
12
+ "default": "./dist/index.mjs"
13
+ }
14
+ },
15
+ "types": "./dist/index.d.mts",
16
+ "bin": {
17
+ "giget": "./dist/cli.mjs"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "scripts": {
23
+ "build": "unbuild",
24
+ "dev": "vitest dev",
25
+ "giget": "jiti ./src/cli.ts",
26
+ "lint": "eslint . && prettier -c src test",
27
+ "lint:fix": "eslint . --fix && prettier -w src test",
28
+ "prepack": "unbuild",
29
+ "play": "pnpm giget --force-clean --verbose unjs .tmp/clone",
30
+ "release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
31
+ "test": "pnpm lint && vitest run --coverage"
32
+ },
33
+ "dependencies": {
34
+ "citty": "^0.1.6",
35
+ "consola": "^3.4.0",
36
+ "defu": "^6.1.4",
37
+ "node-fetch-native": "^1.6.6",
38
+ "nypm": "^0.6.0",
39
+ "pathe": "^2.0.3"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^22.13.5",
43
+ "@types/tar": "^6.1.13",
44
+ "@vitest/coverage-v8": "^3.0.7",
45
+ "changelogen": "^0.5.7",
46
+ "esbuild": "^0.25.0",
47
+ "eslint": "^9.21.0",
48
+ "eslint-config-unjs": "^0.4.2",
49
+ "jiti": "^2.4.2",
50
+ "prettier": "^3.5.2",
51
+ "tar": "^6.2.1",
52
+ "typescript": "^5.7.3",
53
+ "unbuild": "^3.3.1",
54
+ "vitest": "^3.0.7"
55
+ },
56
+ "packageManager": "pnpm@10.5.0",
57
+ "pnpm": {
58
+ "patchedDependencies": {
59
+ "tar": "patches/tar.patch"
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,114 @@
1
+ MIT License
2
+
3
+ Copyright (c) Pooya Parsa <pooya@pi0.io>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ https://github.com/node-fetch/node-fetch
26
+
27
+ The MIT License (MIT)
28
+
29
+ Copyright (c) 2016 - 2020 Node Fetch Team
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
32
+
33
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36
+
37
+ ---
38
+
39
+ https://github.com/mysticatea/abort-controller
40
+
41
+ MIT License
42
+
43
+ Copyright (c) 2017 Toru Nagashima
44
+
45
+ Permission is hereby granted, free of charge, to any person obtaining a copy
46
+ of this software and associated documentation files (the "Software"), to deal
47
+ in the Software without restriction, including without limitation the rights
48
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
49
+ copies of the Software, and to permit persons to whom the Software is
50
+ furnished to do so, subject to the following conditions:
51
+
52
+ The above copyright notice and this permission notice shall be included in all
53
+ copies or substantial portions of the Software.
54
+
55
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
56
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
57
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
58
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
59
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
60
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
61
+ SOFTWARE.
62
+
63
+ ---
64
+
65
+ https://github.com/TooTallNate/proxy-agents
66
+
67
+ (The MIT License)
68
+
69
+ Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
70
+
71
+ Permission is hereby granted, free of charge, to any person obtaining
72
+ a copy of this software and associated documentation files (the
73
+ 'Software'), to deal in the Software without restriction, including
74
+ without limitation the rights to use, copy, modify, merge, publish,
75
+ distribute, sublicense, and/or sell copies of the Software, and to
76
+ permit persons to whom the Software is furnished to do so, subject to
77
+ the following conditions:
78
+
79
+ The above copyright notice and this permission notice shall be
80
+ included in all copies or substantial portions of the Software.
81
+
82
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
83
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
84
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
85
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
86
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
87
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
88
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
89
+
90
+ ---
91
+
92
+ https://github.com/nodejs/undici
93
+
94
+ MIT License
95
+
96
+ Copyright (c) Matteo Collina and Undici contributors
97
+
98
+ Permission is hereby granted, free of charge, to any person obtaining a copy
99
+ of this software and associated documentation files (the "Software"), to deal
100
+ in the Software without restriction, including without limitation the rights
101
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
102
+ copies of the Software, and to permit persons to whom the Software is
103
+ furnished to do so, subject to the following conditions:
104
+
105
+ The above copyright notice and this permission notice shall be included in all
106
+ copies or substantial portions of the Software.
107
+
108
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
109
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
110
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
111
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
112
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
113
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
114
+ SOFTWARE.
@@ -0,0 +1,225 @@
1
+ # node-fetch-native
2
+
3
+ [![][npm-version-src]][npm-version-href]
4
+ [![][github-actions-src]][github-actions-href]
5
+ [![][packagephobia-src]][packagephobia-href]
6
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
7
+
8
+ <!-- [![Codecov][codecov-src]][codecov-href] -->
9
+
10
+ A redistribution of [node-fetch v3](https://github.com/node-fetch/node-fetch) (+ more!) for better backward and forward compatibility.
11
+
12
+ **Why this package?**
13
+
14
+ - We can no longer `require('node-fetch')` with the latest version. This stopped popular libraries from upgrading and dependency conflicts between `node-fetch@2` and `node-fetch@3`.
15
+ - With upcoming versions of Node.js, native `fetch` is being supported. We are prepared for native fetch support using this package yet keep supporting older Node versions.
16
+ - With the introduction of native fetch to Node.js via [undici](https://github.com/nodejs/undici) there is no easy way to support http proxies!
17
+
18
+ **Features:**
19
+
20
+ ✅ Prefer to **native globals** when available (See Node.js [experimental fetch](https://nodejs.org/dist/latest-v17.x/docs/api/cli.html#--experimental-fetch)).
21
+
22
+ ✅ Compact build and less install size with **zero dependencies** [![][packagephobia-s-src]][packagephobia-s-href] <sup>vs</sup> [![][packagephobia-s-alt-src]][packagephobia-s-alt-href]
23
+
24
+ ✅ Support both **CommonJS** (`require`) and **ESM** (`import`) usage
25
+
26
+ ✅ Use native version if imported without `node` condition using [conditional exports](https://nodejs.org/api/packages.html#packages_conditional_exports) with **zero bundle overhead**
27
+
28
+ ✅ Polyfill support for Node.js
29
+
30
+ ✅ Compact and simple proxy supporting both Node.js versions without native fetch using [HTTP Agent](https://github.com/TooTallNate/proxy-agents/tree/main/packages/proxy-agent) and versions with native fetch using [Undici Proxy Agent](https://undici.nodejs.org/#/docs/api/ProxyAgent)
31
+
32
+ ## Usage
33
+
34
+ Install `node-fetch-native` dependency:
35
+
36
+ ```sh
37
+ # npm
38
+ npm i node-fetch-native
39
+
40
+ # yarn
41
+ yarn add node-fetch-native
42
+
43
+ # pnpm
44
+ pnpm i node-fetch-native
45
+ ```
46
+
47
+ You can now either import or require the dependency:
48
+
49
+ ```js
50
+ // ESM
51
+ import fetch from "node-fetch-native";
52
+
53
+ // CommonJS
54
+ const fetch = require("node-fetch-native");
55
+ ```
56
+
57
+ More named exports:
58
+
59
+ ```js
60
+ // ESM
61
+ import {
62
+ fetch,
63
+ Blob,
64
+ FormData,
65
+ Headers,
66
+ Request,
67
+ Response,
68
+ AbortController,
69
+ } from "node-fetch-native";
70
+
71
+ // CommonJS
72
+ const {
73
+ fetch,
74
+ Blob,
75
+ FormData,
76
+ Headers,
77
+ Request,
78
+ Response,
79
+ AbortController,
80
+ } = require("node-fetch-native");
81
+ ```
82
+
83
+ ## Force using non-native version
84
+
85
+ Sometimes you want to explicitly use none native (`node-fetch`) implementation of `fetch` in case of issues with the native/polyfill version of `globalThis.fetch` with Node.js or runtime environment.
86
+
87
+ You have two ways to do this:
88
+
89
+ - Set the `FORCE_NODE_FETCH` environment variable before starting the application.
90
+ - Import from `node-fetch-native/node`
91
+
92
+ ## Disable runtime check
93
+
94
+ Once the `node-fetch-native/node` module is loaded, it pushes a log warning if the current runtime differs from the Node.js. Set the `DISABLE_NODE_FETCH_NATIVE_WARN` environment variable to turn this check off.
95
+
96
+ ## Polyfill support
97
+
98
+ Using the polyfill method, we can ensure global fetch is available in the environment and all files. Natives are always preferred.
99
+
100
+ **Note:** I don't recommend this if you are authoring a library! Please prefer the explicit methods.
101
+
102
+ ```js
103
+ // ESM
104
+ import "node-fetch-native/polyfill";
105
+
106
+ // CJS
107
+ require("node-fetch-native/polyfill");
108
+
109
+ // You can now use fetch() without any import!
110
+ ```
111
+
112
+ ## Proxy Support
113
+
114
+ Node.js has no built-in support for HTTP Proxies for fetch (see [nodejs/undici#1650](https://github.com/nodejs/undici/issues/1650) and [nodejs/node#8381](https://github.com/nodejs/node/issues/8381))
115
+
116
+ This package bundles a compact and simple proxy-supported solution for both Node.js versions without native fetch using [HTTP Agent](https://github.com/TooTallNate/proxy-agents/tree/main/packages/proxy-agent) and versions with native fetch using [Undici Proxy Agent](https://undici.nodejs.org/#/docs/api/ProxyAgent).
117
+
118
+ By default, `https_proxy`, `http_proxy`, `HTTPS_PROXY`, and `HTTP_PROXY` environment variables will be checked and used (in order) for the proxy and if not any of them are set, the proxy will be disabled. You can override it using the `url` option passed to `createFetch` and `createProxy` utils.
119
+
120
+ By default, `no_proxy` and `NO_PROXY` environment variables will be checked and used for the (comma-separated) list of hosts to ignore the proxy for. You can override it using the `noProxy` option passed to `createFetch` and `createProxy` utils. The entries starting with a dot will be used to check the domain and also any subdomain.
121
+
122
+ > [!NOTE]
123
+ > Using export conditions, this utility adds proxy support for Node.js and for other runtimes, it will simply return native fetch.
124
+
125
+ ### `fetch` with proxy support
126
+
127
+ You can simply import `{ fetch }` from `node-fetch-native/proxy` with a preconfigured `fetch` function that has proxy support.
128
+
129
+ ```ts
130
+ import { fetch } from "node-fetch-native/proxy";
131
+
132
+ console.log(await fetch("https://icanhazip.com").then((r) => r.text()));
133
+ ```
134
+
135
+ ### `createFetch` utility
136
+
137
+ You can use the `createFetch` utility to instantiate a `fetch` instance with custom proxy options.
138
+
139
+ ```ts
140
+ import { createFetch } from "node-fetch-native/proxy";
141
+
142
+ const fetch = createFetch({ url: "http://localhost:9080" });
143
+
144
+ console.log(await fetch("https://icanhazip.com").then((r) => r.text()));
145
+ ```
146
+
147
+ ### `createProxy` utility
148
+
149
+ `createProxy` returns an object with `agent` and `dispatcher` keys that can be passed as fetch options.
150
+
151
+ ```ts
152
+ import { fetch } from "node-fetch-native";
153
+ import { createProxy } from "node-fetch-native/proxy";
154
+
155
+ const proxy = createProxy();
156
+ // const proxy = createProxy({ url: "http://localhost:8080" });
157
+
158
+ console.log(
159
+ await fetch("https://icanhazip.com", { ...proxy }).then((r) => r.text()),
160
+ );
161
+ ```
162
+
163
+ ## Alias to `node-fetch`
164
+
165
+ Using this method, you can ensure all project dependencies and usages of `node-fetch` can benefit from improved `node-fetch-native` and won't conflict between `node-fetch@2` and `node-fetch@3`.
166
+
167
+ ### npm
168
+
169
+ Using npm [overrides](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides):
170
+
171
+ ```jsonc
172
+ // package.json
173
+ {
174
+ "overrides": {
175
+ "node-fetch": "npm:node-fetch-native@latest",
176
+ },
177
+ }
178
+ ```
179
+
180
+ ### yarn
181
+
182
+ Using yarn [selective dependency resolutions](https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/):
183
+
184
+ ```jsonc
185
+ // package.json
186
+ {
187
+ "resolutions": {
188
+ "node-fetch": "npm:node-fetch-native@latest",
189
+ },
190
+ }
191
+ ```
192
+
193
+ ### pnpm
194
+
195
+ Using [pnpm.overrides](https://pnpm.io/package_json#pnpmoverrides):
196
+
197
+ ```jsonc
198
+ // package.json
199
+ {
200
+ "pnpm": {
201
+ "overrides": {
202
+ "node-fetch": "npm:node-fetch-native@latest",
203
+ },
204
+ },
205
+ }
206
+ ```
207
+
208
+ ## License
209
+
210
+ Made with 💛 Published under the [MIT](./LICENSE) license.
211
+
212
+ <!-- Badges -->
213
+
214
+ [npm-version-src]: https://flat.badgen.net/npm/v/node-fetch-native
215
+ [npm-version-href]: https://npmjs.com/package/node-fetch-native
216
+ [npm-downloads-src]: https://flat.badgen.net/npm/dm/node-fetch-native
217
+ [npm-downloads-href]: https://npmjs.com/package/node-fetch-native
218
+ [github-actions-src]: https://flat.badgen.net/github/checks/unjs/node-fetch-native
219
+ [github-actions-href]: https://github.com/unjs/node-fetch-native/actions?query=workflow%3Aci
220
+ [packagephobia-src]: https://flat.badgen.net/packagephobia/install/node-fetch-native
221
+ [packagephobia-href]: https://packagephobia.com/result?p=node-fetch-native
222
+ [packagephobia-s-src]: https://flat.badgen.net/packagephobia/install/node-fetch-native?label=node-fetch-native&scale=.9
223
+ [packagephobia-s-href]: https://packagephobia.com/result?p=node-fetch-native
224
+ [packagephobia-s-alt-src]: https://flat.badgen.net/packagephobia/install/node-fetch?label=node-fetch&scale=.9
225
+ [packagephobia-s-alt-href]: https://packagephobia.com/result?p=node-fetch
@@ -0,0 +1,2 @@
1
+ "use strict";var y=Object.defineProperty;var c=(R,o)=>y(R,"name",{value:o,configurable:!0});const node=require("../node.cjs");require("node:http"),require("node:https"),require("node:zlib"),require("node:stream"),require("node:buffer"),require("node:util"),require("../shared/node-fetch-native.DhEqb06g.cjs"),require("node:url"),require("node:net"),require("node:fs"),require("node:path");let s=0;const S={START_BOUNDARY:s++,HEADER_FIELD_START:s++,HEADER_FIELD:s++,HEADER_VALUE_START:s++,HEADER_VALUE:s++,HEADER_VALUE_ALMOST_DONE:s++,HEADERS_ALMOST_DONE:s++,PART_DATA_START:s++,PART_DATA:s++,END:s++};let f=1;const F={PART_BOUNDARY:f,LAST_BOUNDARY:f*=2},LF=10,CR=13,SPACE=32,HYPHEN=45,COLON=58,A=97,Z=122,lower=c(R=>R|32,"lower"),noop=c(()=>{},"noop"),g=class g{constructor(o){this.index=0,this.flags=0,this.onHeaderEnd=noop,this.onHeaderField=noop,this.onHeadersEnd=noop,this.onHeaderValue=noop,this.onPartBegin=noop,this.onPartData=noop,this.onPartEnd=noop,this.boundaryChars={},o=`\r
2
+ --`+o;const t=new Uint8Array(o.length);for(let n=0;n<o.length;n++)t[n]=o.charCodeAt(n),this.boundaryChars[t[n]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=S.START_BOUNDARY}write(o){let t=0;const n=o.length;let E=this.index,{lookbehind:l,boundary:h,boundaryChars:H,index:e,state:a,flags:d}=this;const b=this.boundary.length,m=b-1,O=o.length;let r,P;const u=c(D=>{this[D+"Mark"]=t},"mark"),i=c(D=>{delete this[D+"Mark"]},"clear"),T=c((D,p,_,N)=>{(p===void 0||p!==_)&&this[D](N&&N.subarray(p,_))},"callback"),L=c((D,p)=>{const _=D+"Mark";_ in this&&(p?(T(D,this[_],t,o),delete this[_]):(T(D,this[_],o.length,o),this[_]=0))},"dataCallback");for(t=0;t<n;t++)switch(r=o[t],a){case S.START_BOUNDARY:if(e===h.length-2){if(r===HYPHEN)d|=F.LAST_BOUNDARY;else if(r!==CR)return;e++;break}else if(e-1===h.length-2){if(d&F.LAST_BOUNDARY&&r===HYPHEN)a=S.END,d=0;else if(!(d&F.LAST_BOUNDARY)&&r===LF)e=0,T("onPartBegin"),a=S.HEADER_FIELD_START;else return;break}r!==h[e+2]&&(e=-2),r===h[e+2]&&e++;break;case S.HEADER_FIELD_START:a=S.HEADER_FIELD,u("onHeaderField"),e=0;case S.HEADER_FIELD:if(r===CR){i("onHeaderField"),a=S.HEADERS_ALMOST_DONE;break}if(e++,r===HYPHEN)break;if(r===COLON){if(e===1)return;L("onHeaderField",!0),a=S.HEADER_VALUE_START;break}if(P=lower(r),P<A||P>Z)return;break;case S.HEADER_VALUE_START:if(r===SPACE)break;u("onHeaderValue"),a=S.HEADER_VALUE;case S.HEADER_VALUE:r===CR&&(L("onHeaderValue",!0),T("onHeaderEnd"),a=S.HEADER_VALUE_ALMOST_DONE);break;case S.HEADER_VALUE_ALMOST_DONE:if(r!==LF)return;a=S.HEADER_FIELD_START;break;case S.HEADERS_ALMOST_DONE:if(r!==LF)return;T("onHeadersEnd"),a=S.PART_DATA_START;break;case S.PART_DATA_START:a=S.PART_DATA,u("onPartData");case S.PART_DATA:if(E=e,e===0){for(t+=m;t<O&&!(o[t]in H);)t+=b;t-=m,r=o[t]}if(e<h.length)h[e]===r?(e===0&&L("onPartData",!0),e++):e=0;else if(e===h.length)e++,r===CR?d|=F.PART_BOUNDARY:r===HYPHEN?d|=F.LAST_BOUNDARY:e=0;else if(e-1===h.length)if(d&F.PART_BOUNDARY){if(e=0,r===LF){d&=~F.PART_BOUNDARY,T("onPartEnd"),T("onPartBegin"),a=S.HEADER_FIELD_START;break}}else d&F.LAST_BOUNDARY&&r===HYPHEN?(T("onPartEnd"),a=S.END,d=0):e=0;if(e>0)l[e-1]=r;else if(E>0){const D=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);T("onPartData",0,E,D),E=0,u("onPartData"),t--}break;case S.END:break;default:throw new Error(`Unexpected state entered: ${a}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=e,this.state=a,this.flags=d}end(){if(this.state===S.HEADER_FIELD_START&&this.index===0||this.state===S.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==S.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};c(g,"MultipartParser");let MultipartParser=g;function _fileName(R){const o=R.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!o)return;const t=o[2]||o[3]||"";let n=t.slice(t.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(E,l)=>String.fromCharCode(l)),n}c(_fileName,"_fileName");async function toFormData(R,o){if(!/multipart/i.test(o))throw new TypeError("Failed to fetch");const t=o.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!t)throw new TypeError("no or bad content-type header, no multipart boundary");const n=new MultipartParser(t[1]||t[2]);let E,l,h,H,e,a;const d=[],b=new node.FormData,m=c(i=>{h+=u.decode(i,{stream:!0})},"onPartData"),O=c(i=>{d.push(i)},"appendToFile"),r=c(()=>{const i=new node.File(d,a,{type:e});b.append(H,i)},"appendFileToFormData"),P=c(()=>{b.append(H,h)},"appendEntryToFormData"),u=new TextDecoder("utf-8");u.decode(),n.onPartBegin=function(){n.onPartData=m,n.onPartEnd=P,E="",l="",h="",H="",e="",a=null,d.length=0},n.onHeaderField=function(i){E+=u.decode(i,{stream:!0})},n.onHeaderValue=function(i){l+=u.decode(i,{stream:!0})},n.onHeaderEnd=function(){if(l+=u.decode(),E=E.toLowerCase(),E==="content-disposition"){const i=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);i&&(H=i[2]||i[3]||""),a=_fileName(l),a&&(n.onPartData=O,n.onPartEnd=r)}else E==="content-type"&&(e=l);l="",E=""};for await(const i of R)n.write(i);return n.end(),b}c(toFormData,"toFormData"),exports.toFormData=toFormData;
@@ -0,0 +1,2 @@
1
+ var B=Object.defineProperty;var E=(u,a)=>B(u,"name",{value:a,configurable:!0});import{FormData as V,File as Y}from"../node.mjs";import"node:http";import"node:https";import"node:zlib";import"node:stream";import"node:buffer";import"node:util";import"../shared/node-fetch-native.DfbY2q-x.mjs";import"node:url";import"node:net";import"node:fs";import"node:path";let D=0;const t={START_BOUNDARY:D++,HEADER_FIELD_START:D++,HEADER_FIELD:D++,HEADER_VALUE_START:D++,HEADER_VALUE:D++,HEADER_VALUE_ALMOST_DONE:D++,HEADERS_ALMOST_DONE:D++,PART_DATA_START:D++,PART_DATA:D++,END:D++};let w=1;const R={PART_BOUNDARY:w,LAST_BOUNDARY:w*=2},g=10,N=13,x=32,P=45,C=58,I=97,M=122,$=E(u=>u|32,"lower"),m=E(()=>{},"noop"),F=class F{constructor(a){this.index=0,this.flags=0,this.onHeaderEnd=m,this.onHeaderField=m,this.onHeadersEnd=m,this.onHeaderValue=m,this.onPartBegin=m,this.onPartData=m,this.onPartEnd=m,this.boundaryChars={},a=`\r
2
+ --`+a;const n=new Uint8Array(a.length);for(let r=0;r<a.length;r++)n[r]=a.charCodeAt(r),this.boundaryChars[n[r]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=t.START_BOUNDARY}write(a){let n=0;const r=a.length;let d=this.index,{lookbehind:l,boundary:c,boundaryChars:p,index:e,state:i,flags:A}=this;const H=this.boundary.length,O=H-1,y=a.length;let o,L;const f=E(h=>{this[h+"Mark"]=n},"mark"),s=E(h=>{delete this[h+"Mark"]},"clear"),T=E((h,S,_,U)=>{(S===void 0||S!==_)&&this[h](U&&U.subarray(S,_))},"callback"),b=E((h,S)=>{const _=h+"Mark";_ in this&&(S?(T(h,this[_],n,a),delete this[_]):(T(h,this[_],a.length,a),this[_]=0))},"dataCallback");for(n=0;n<r;n++)switch(o=a[n],i){case t.START_BOUNDARY:if(e===c.length-2){if(o===P)A|=R.LAST_BOUNDARY;else if(o!==N)return;e++;break}else if(e-1===c.length-2){if(A&R.LAST_BOUNDARY&&o===P)i=t.END,A=0;else if(!(A&R.LAST_BOUNDARY)&&o===g)e=0,T("onPartBegin"),i=t.HEADER_FIELD_START;else return;break}o!==c[e+2]&&(e=-2),o===c[e+2]&&e++;break;case t.HEADER_FIELD_START:i=t.HEADER_FIELD,f("onHeaderField"),e=0;case t.HEADER_FIELD:if(o===N){s("onHeaderField"),i=t.HEADERS_ALMOST_DONE;break}if(e++,o===P)break;if(o===C){if(e===1)return;b("onHeaderField",!0),i=t.HEADER_VALUE_START;break}if(L=$(o),L<I||L>M)return;break;case t.HEADER_VALUE_START:if(o===x)break;f("onHeaderValue"),i=t.HEADER_VALUE;case t.HEADER_VALUE:o===N&&(b("onHeaderValue",!0),T("onHeaderEnd"),i=t.HEADER_VALUE_ALMOST_DONE);break;case t.HEADER_VALUE_ALMOST_DONE:if(o!==g)return;i=t.HEADER_FIELD_START;break;case t.HEADERS_ALMOST_DONE:if(o!==g)return;T("onHeadersEnd"),i=t.PART_DATA_START;break;case t.PART_DATA_START:i=t.PART_DATA,f("onPartData");case t.PART_DATA:if(d=e,e===0){for(n+=O;n<y&&!(a[n]in p);)n+=H;n-=O,o=a[n]}if(e<c.length)c[e]===o?(e===0&&b("onPartData",!0),e++):e=0;else if(e===c.length)e++,o===N?A|=R.PART_BOUNDARY:o===P?A|=R.LAST_BOUNDARY:e=0;else if(e-1===c.length)if(A&R.PART_BOUNDARY){if(e=0,o===g){A&=~R.PART_BOUNDARY,T("onPartEnd"),T("onPartBegin"),i=t.HEADER_FIELD_START;break}}else A&R.LAST_BOUNDARY&&o===P?(T("onPartEnd"),i=t.END,A=0):e=0;if(e>0)l[e-1]=o;else if(d>0){const h=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);T("onPartData",0,d,h),d=0,f("onPartData"),n--}break;case t.END:break;default:throw new Error(`Unexpected state entered: ${i}`)}b("onHeaderField"),b("onHeaderValue"),b("onPartData"),this.index=e,this.state=i,this.flags=A}end(){if(this.state===t.HEADER_FIELD_START&&this.index===0||this.state===t.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==t.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};E(F,"MultipartParser");let k=F;function v(u){const a=u.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!a)return;const n=a[2]||a[3]||"";let r=n.slice(n.lastIndexOf("\\")+1);return r=r.replace(/%22/g,'"'),r=r.replace(/&#(\d{4});/g,(d,l)=>String.fromCharCode(l)),r}E(v,"_fileName");async function Z(u,a){if(!/multipart/i.test(a))throw new TypeError("Failed to fetch");const n=a.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");const r=new k(n[1]||n[2]);let d,l,c,p,e,i;const A=[],H=new V,O=E(s=>{c+=f.decode(s,{stream:!0})},"onPartData"),y=E(s=>{A.push(s)},"appendToFile"),o=E(()=>{const s=new Y(A,i,{type:e});H.append(p,s)},"appendFileToFormData"),L=E(()=>{H.append(p,c)},"appendEntryToFormData"),f=new TextDecoder("utf-8");f.decode(),r.onPartBegin=function(){r.onPartData=O,r.onPartEnd=L,d="",l="",c="",p="",e="",i=null,A.length=0},r.onHeaderField=function(s){d+=f.decode(s,{stream:!0})},r.onHeaderValue=function(s){l+=f.decode(s,{stream:!0})},r.onHeaderEnd=function(){if(l+=f.decode(),d=d.toLowerCase(),d==="content-disposition"){const s=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);s&&(p=s[2]||s[3]||""),i=v(l),i&&(r.onPartData=y,r.onPartEnd=o)}else d==="content-type"&&(e=l);l="",d=""};for await(const s of u)r.write(s);return r.end(),H}E(Z,"toFormData");export{Z as toFormData};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const node=require("./node.cjs");require("node:http"),require("node:https"),require("node:zlib"),require("node:stream"),require("node:buffer"),require("node:util"),require("./shared/node-fetch-native.DhEqb06g.cjs"),require("node:url"),require("node:net"),require("node:fs"),require("node:path");const o=!!globalThis.process?.env?.FORCE_NODE_FETCH,fetch=!o&&globalThis.fetch||node.fetch,Blob=!o&&globalThis.Blob||node.Blob,File=!o&&globalThis.File||node.File,FormData=!o&&globalThis.FormData||node.FormData,Headers=!o&&globalThis.Headers||node.Headers,Request=!o&&globalThis.Request||node.Request,Response=!o&&globalThis.Response||node.Response,AbortController=!o&&globalThis.AbortController||node.AbortController;exports.AbortError=node.AbortError,exports.FetchError=node.FetchError,exports.blobFrom=node.blobFrom,exports.blobFromSync=node.blobFromSync,exports.fileFrom=node.fileFrom,exports.fileFromSync=node.fileFromSync,exports.isRedirect=node.isRedirect,exports.AbortController=AbortController,exports.Blob=Blob,exports.File=File,exports.FormData=FormData,exports.Headers=Headers,exports.Request=Request,exports.Response=Response,exports.default=fetch,exports.fetch=fetch;
@@ -0,0 +1 @@
1
+ import{fetch as e,Blob as t,File as s,FormData as l,Headers as a,Request as i,Response as b,AbortController as m}from"./node.mjs";export{AbortError,FetchError,blobFrom,blobFromSync,fileFrom,fileFromSync,isRedirect}from"./node.mjs";import"node:http";import"node:https";import"node:zlib";import"node:stream";import"node:buffer";import"node:util";import"./shared/node-fetch-native.DfbY2q-x.mjs";import"node:url";import"node:net";import"node:fs";import"node:path";const o=!!globalThis.process?.env?.FORCE_NODE_FETCH,r=!o&&globalThis.fetch||e,p=!o&&globalThis.Blob||t,F=!o&&globalThis.File||s,h=!o&&globalThis.FormData||l,n=!o&&globalThis.Headers||a,c=!o&&globalThis.Request||i,R=!o&&globalThis.Response||b,T=!o&&globalThis.AbortController||m;export{T as AbortController,p as Blob,F as File,h as FormData,n as Headers,c as Request,R as Response,r as default,r as fetch};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const Blob=globalThis.Blob,File=globalThis.File,FormData=globalThis.FormData,Headers=globalThis.Headers,Request=globalThis.Request,Response=globalThis.Response,AbortController=globalThis.AbortController,fetch=globalThis.fetch||(()=>{throw new Error("[node-fetch-native] Failed to fetch: `globalThis.fetch` is not available!")});exports.AbortController=AbortController,exports.Blob=Blob,exports.File=File,exports.FormData=FormData,exports.Headers=Headers,exports.Request=Request,exports.Response=Response,exports.default=fetch,exports.fetch=fetch;
@@ -0,0 +1 @@
1
+ const e=globalThis.Blob,o=globalThis.File,a=globalThis.FormData,s=globalThis.Headers,t=globalThis.Request,h=globalThis.Response,i=globalThis.AbortController,l=globalThis.fetch||(()=>{throw new Error("[node-fetch-native] Failed to fetch: `globalThis.fetch` is not available!")});export{i as AbortController,e as Blob,o as File,a as FormData,s as Headers,t as Request,h as Response,l as default,l as fetch};