@open-dy/vibecoding-sdk-taro 0.0.1-beta.4 → 0.0.1

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 (532) hide show
  1. package/dist/build/plugins/vite-tt-components-entry.d.ts +10 -0
  2. package/dist/build/plugins/vite-tt-components-entry.js +32 -0
  3. package/dist/build/plugins/vite-tt-components-entry.js.map +1 -0
  4. package/dist/build/taro.js +3 -1
  5. package/dist/build/taro.js.map +1 -1
  6. package/dist/reference/llms.txt +52 -2
  7. package/dist/reference/sdk-api/build/taro/BuildContext.md +7 -2
  8. package/dist/reference/sdk-api/build/taro/CreateMicroappTaroConfigOptions.md +1 -2
  9. package/dist/reference/sdk-api/build/taro/createMicroappTaroConfig.md +1 -2
  10. package/dist/reference/sdk-api/runtime/CreateMicroappClientOptions.md +7 -2
  11. package/dist/reference/sdk-api/runtime/createMicroappClient.md +7 -2
  12. package/dist/reference/sdk-api/ui/accordion/Accordion.md +114 -0
  13. package/dist/reference/sdk-api/ui/accordion/AccordionContent.md +100 -0
  14. package/dist/reference/sdk-api/ui/accordion/AccordionItem.md +107 -0
  15. package/dist/reference/sdk-api/ui/accordion/AccordionTrigger.md +100 -0
  16. package/dist/reference/sdk-api/ui/accordion/index.md +12 -0
  17. package/dist/reference/sdk-api/ui/alert/Alert.md +106 -0
  18. package/dist/reference/sdk-api/ui/alert/AlertAction.md +100 -0
  19. package/dist/reference/sdk-api/ui/alert/AlertDescription.md +100 -0
  20. package/dist/reference/sdk-api/ui/alert/AlertTitle.md +100 -0
  21. package/dist/reference/sdk-api/ui/alert/index.md +12 -0
  22. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialog.md +58 -0
  23. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogAction.md +107 -0
  24. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogCancel.md +107 -0
  25. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogContent.md +106 -0
  26. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogDescription.md +100 -0
  27. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogFooter.md +100 -0
  28. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogHeader.md +100 -0
  29. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogOverlay.md +100 -0
  30. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogPortal.md +55 -0
  31. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogTitle.md +100 -0
  32. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogTrigger.md +118 -0
  33. package/dist/reference/sdk-api/ui/alert-dialog/index.md +19 -0
  34. package/dist/reference/sdk-api/ui/aspect-ratio/AspectRatio.md +106 -0
  35. package/dist/reference/sdk-api/ui/aspect-ratio/index.md +9 -0
  36. package/dist/reference/sdk-api/ui/avatar/Avatar.md +106 -0
  37. package/dist/reference/sdk-api/ui/avatar/AvatarBadge.md +100 -0
  38. package/dist/reference/sdk-api/ui/avatar/AvatarFallback.md +100 -0
  39. package/dist/reference/sdk-api/ui/avatar/AvatarGroup.md +100 -0
  40. package/dist/reference/sdk-api/ui/avatar/AvatarGroupCount.md +100 -0
  41. package/dist/reference/sdk-api/ui/avatar/AvatarImage.md +108 -0
  42. package/dist/reference/sdk-api/ui/avatar/index.md +14 -0
  43. package/dist/reference/sdk-api/ui/badge/Badge.md +114 -0
  44. package/dist/reference/sdk-api/ui/badge/badgeVariants.md +70 -0
  45. package/dist/reference/sdk-api/ui/badge/index.md +10 -0
  46. package/dist/reference/sdk-api/ui/button/Button.md +210 -0
  47. package/dist/reference/sdk-api/ui/button/ButtonProps.md +188 -0
  48. package/dist/reference/sdk-api/ui/button/buttonVariants.md +84 -0
  49. package/dist/reference/sdk-api/ui/button/index.md +11 -0
  50. package/dist/reference/sdk-api/ui/button-group/ButtonGroup.md +106 -0
  51. package/dist/reference/sdk-api/ui/button-group/ButtonGroupSeparator.md +106 -0
  52. package/dist/reference/sdk-api/ui/button-group/ButtonGroupText.md +106 -0
  53. package/dist/reference/sdk-api/ui/button-group/buttonGroupVariants.md +70 -0
  54. package/dist/reference/sdk-api/ui/button-group/index.md +12 -0
  55. package/dist/reference/sdk-api/ui/calendar/Calendar.md +144 -0
  56. package/dist/reference/sdk-api/ui/calendar/CalendarProps.md +118 -0
  57. package/dist/reference/sdk-api/ui/calendar/index.md +10 -0
  58. package/dist/reference/sdk-api/ui/card/Card.md +106 -0
  59. package/dist/reference/sdk-api/ui/card/CardAction.md +100 -0
  60. package/dist/reference/sdk-api/ui/card/CardContent.md +100 -0
  61. package/dist/reference/sdk-api/ui/card/CardDescription.md +100 -0
  62. package/dist/reference/sdk-api/ui/card/CardFooter.md +100 -0
  63. package/dist/reference/sdk-api/ui/card/CardHeader.md +100 -0
  64. package/dist/reference/sdk-api/ui/card/CardTitle.md +100 -0
  65. package/dist/reference/sdk-api/ui/card/index.md +15 -0
  66. package/dist/reference/sdk-api/ui/carousel/Carousel.md +108 -0
  67. package/dist/reference/sdk-api/ui/carousel/CarouselContent.md +100 -0
  68. package/dist/reference/sdk-api/ui/carousel/CarouselItem.md +100 -0
  69. package/dist/reference/sdk-api/ui/carousel/CarouselNext.md +219 -0
  70. package/dist/reference/sdk-api/ui/carousel/CarouselPrevious.md +219 -0
  71. package/dist/reference/sdk-api/ui/carousel/index.md +14 -0
  72. package/dist/reference/sdk-api/ui/carousel/useCarousel.md +46 -0
  73. package/dist/reference/sdk-api/ui/checkbox/Checkbox.md +109 -0
  74. package/dist/reference/sdk-api/ui/checkbox/index.md +9 -0
  75. package/dist/reference/sdk-api/ui/collapsible/Collapsible.md +108 -0
  76. package/dist/reference/sdk-api/ui/collapsible/CollapsibleContent.md +100 -0
  77. package/dist/reference/sdk-api/ui/collapsible/CollapsibleTrigger.md +119 -0
  78. package/dist/reference/sdk-api/ui/collapsible/index.md +11 -0
  79. package/dist/reference/sdk-api/ui/combobox/Combobox.md +124 -0
  80. package/dist/reference/sdk-api/ui/combobox/ComboboxChip.md +107 -0
  81. package/dist/reference/sdk-api/ui/combobox/ComboboxChips.md +100 -0
  82. package/dist/reference/sdk-api/ui/combobox/ComboboxChipsInput.md +107 -0
  83. package/dist/reference/sdk-api/ui/combobox/ComboboxCollection.md +100 -0
  84. package/dist/reference/sdk-api/ui/combobox/ComboboxContent.md +106 -0
  85. package/dist/reference/sdk-api/ui/combobox/ComboboxEmpty.md +100 -0
  86. package/dist/reference/sdk-api/ui/combobox/ComboboxGroup.md +100 -0
  87. package/dist/reference/sdk-api/ui/combobox/ComboboxInput.md +113 -0
  88. package/dist/reference/sdk-api/ui/combobox/ComboboxItem.md +106 -0
  89. package/dist/reference/sdk-api/ui/combobox/ComboboxLabel.md +100 -0
  90. package/dist/reference/sdk-api/ui/combobox/ComboboxList.md +105 -0
  91. package/dist/reference/sdk-api/ui/combobox/ComboboxSeparator.md +100 -0
  92. package/dist/reference/sdk-api/ui/combobox/ComboboxTrigger.md +100 -0
  93. package/dist/reference/sdk-api/ui/combobox/ComboboxValue.md +105 -0
  94. package/dist/reference/sdk-api/ui/combobox/index.md +24 -0
  95. package/dist/reference/sdk-api/ui/combobox/useComboboxAnchor.md +43 -0
  96. package/dist/reference/sdk-api/ui/dialog/Dialog.md +58 -0
  97. package/dist/reference/sdk-api/ui/dialog/DialogClose.md +100 -0
  98. package/dist/reference/sdk-api/ui/dialog/DialogContent.md +107 -0
  99. package/dist/reference/sdk-api/ui/dialog/DialogDescription.md +100 -0
  100. package/dist/reference/sdk-api/ui/dialog/DialogFooter.md +100 -0
  101. package/dist/reference/sdk-api/ui/dialog/DialogHeader.md +100 -0
  102. package/dist/reference/sdk-api/ui/dialog/DialogOverlay.md +100 -0
  103. package/dist/reference/sdk-api/ui/dialog/DialogPortal.md +55 -0
  104. package/dist/reference/sdk-api/ui/dialog/DialogTitle.md +100 -0
  105. package/dist/reference/sdk-api/ui/dialog/DialogTrigger.md +106 -0
  106. package/dist/reference/sdk-api/ui/dialog/index.md +18 -0
  107. package/dist/reference/sdk-api/ui/drawer/Drawer.md +59 -0
  108. package/dist/reference/sdk-api/ui/drawer/DrawerClose.md +100 -0
  109. package/dist/reference/sdk-api/ui/drawer/DrawerContent.md +100 -0
  110. package/dist/reference/sdk-api/ui/drawer/DrawerDescription.md +100 -0
  111. package/dist/reference/sdk-api/ui/drawer/DrawerFooter.md +100 -0
  112. package/dist/reference/sdk-api/ui/drawer/DrawerHeader.md +100 -0
  113. package/dist/reference/sdk-api/ui/drawer/DrawerOverlay.md +100 -0
  114. package/dist/reference/sdk-api/ui/drawer/DrawerPortal.md +55 -0
  115. package/dist/reference/sdk-api/ui/drawer/DrawerTitle.md +100 -0
  116. package/dist/reference/sdk-api/ui/drawer/DrawerTrigger.md +100 -0
  117. package/dist/reference/sdk-api/ui/drawer/index.md +18 -0
  118. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenu.md +58 -0
  119. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuCheckboxItem.md +107 -0
  120. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuContent.md +106 -0
  121. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuGroup.md +100 -0
  122. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuItem.md +107 -0
  123. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuLabel.md +106 -0
  124. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuPortal.md +55 -0
  125. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuRadioGroup.md +100 -0
  126. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuRadioItem.md +106 -0
  127. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSeparator.md +100 -0
  128. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuShortcut.md +100 -0
  129. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSub.md +58 -0
  130. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSubContent.md +100 -0
  131. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSubTrigger.md +106 -0
  132. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuTrigger.md +119 -0
  133. package/dist/reference/sdk-api/ui/dropdown-menu/index.md +23 -0
  134. package/dist/reference/sdk-api/ui/empty/Empty.md +100 -0
  135. package/dist/reference/sdk-api/ui/empty/EmptyContent.md +100 -0
  136. package/dist/reference/sdk-api/ui/empty/EmptyDescription.md +100 -0
  137. package/dist/reference/sdk-api/ui/empty/EmptyHeader.md +100 -0
  138. package/dist/reference/sdk-api/ui/empty/EmptyMedia.md +106 -0
  139. package/dist/reference/sdk-api/ui/empty/EmptyTitle.md +100 -0
  140. package/dist/reference/sdk-api/ui/empty/index.md +14 -0
  141. package/dist/reference/sdk-api/ui/field/Field.md +106 -0
  142. package/dist/reference/sdk-api/ui/field/FieldContent.md +100 -0
  143. package/dist/reference/sdk-api/ui/field/FieldDescription.md +100 -0
  144. package/dist/reference/sdk-api/ui/field/FieldError.md +112 -0
  145. package/dist/reference/sdk-api/ui/field/FieldGroup.md +100 -0
  146. package/dist/reference/sdk-api/ui/field/FieldLabel.md +85 -0
  147. package/dist/reference/sdk-api/ui/field/FieldLegend.md +106 -0
  148. package/dist/reference/sdk-api/ui/field/FieldSeparator.md +105 -0
  149. package/dist/reference/sdk-api/ui/field/FieldSet.md +100 -0
  150. package/dist/reference/sdk-api/ui/field/FieldTitle.md +100 -0
  151. package/dist/reference/sdk-api/ui/field/index.md +18 -0
  152. package/dist/reference/sdk-api/ui/helpers/collectDataIconState.md +66 -0
  153. package/dist/reference/sdk-api/ui/helpers/index.md +9 -0
  154. package/dist/reference/sdk-api/ui/index.md +57 -0
  155. package/dist/reference/sdk-api/ui/input/Input.md +141 -0
  156. package/dist/reference/sdk-api/ui/input/index.md +9 -0
  157. package/dist/reference/sdk-api/ui/input-group/InputGroup.md +100 -0
  158. package/dist/reference/sdk-api/ui/input-group/InputGroupAddon.md +109 -0
  159. package/dist/reference/sdk-api/ui/input-group/InputGroupButton.md +220 -0
  160. package/dist/reference/sdk-api/ui/input-group/InputGroupInput.md +135 -0
  161. package/dist/reference/sdk-api/ui/input-group/InputGroupText.md +100 -0
  162. package/dist/reference/sdk-api/ui/input-group/InputGroupTextarea.md +126 -0
  163. package/dist/reference/sdk-api/ui/input-group/index.md +14 -0
  164. package/dist/reference/sdk-api/ui/input-otp/InputOTP.md +111 -0
  165. package/dist/reference/sdk-api/ui/input-otp/InputOTPGroup.md +100 -0
  166. package/dist/reference/sdk-api/ui/input-otp/InputOTPSeparator.md +100 -0
  167. package/dist/reference/sdk-api/ui/input-otp/InputOTPSlot.md +107 -0
  168. package/dist/reference/sdk-api/ui/input-otp/index.md +12 -0
  169. package/dist/reference/sdk-api/ui/item/Item.md +115 -0
  170. package/dist/reference/sdk-api/ui/item/ItemActions.md +100 -0
  171. package/dist/reference/sdk-api/ui/item/ItemContent.md +100 -0
  172. package/dist/reference/sdk-api/ui/item/ItemDescription.md +100 -0
  173. package/dist/reference/sdk-api/ui/item/ItemFooter.md +100 -0
  174. package/dist/reference/sdk-api/ui/item/ItemGroup.md +100 -0
  175. package/dist/reference/sdk-api/ui/item/ItemHeader.md +100 -0
  176. package/dist/reference/sdk-api/ui/item/ItemMedia.md +106 -0
  177. package/dist/reference/sdk-api/ui/item/ItemSeparator.md +106 -0
  178. package/dist/reference/sdk-api/ui/item/ItemTitle.md +100 -0
  179. package/dist/reference/sdk-api/ui/item/index.md +18 -0
  180. package/dist/reference/sdk-api/ui/label/Label.md +85 -0
  181. package/dist/reference/sdk-api/ui/label/index.md +9 -0
  182. package/dist/reference/sdk-api/ui/menubar/Menubar.md +100 -0
  183. package/dist/reference/sdk-api/ui/menubar/MenubarCheckboxItem.md +111 -0
  184. package/dist/reference/sdk-api/ui/menubar/MenubarContent.md +108 -0
  185. package/dist/reference/sdk-api/ui/menubar/MenubarGroup.md +100 -0
  186. package/dist/reference/sdk-api/ui/menubar/MenubarItem.md +109 -0
  187. package/dist/reference/sdk-api/ui/menubar/MenubarLabel.md +106 -0
  188. package/dist/reference/sdk-api/ui/menubar/MenubarMenu.md +55 -0
  189. package/dist/reference/sdk-api/ui/menubar/MenubarPortal.md +55 -0
  190. package/dist/reference/sdk-api/ui/menubar/MenubarRadioGroup.md +108 -0
  191. package/dist/reference/sdk-api/ui/menubar/MenubarRadioItem.md +110 -0
  192. package/dist/reference/sdk-api/ui/menubar/MenubarSeparator.md +100 -0
  193. package/dist/reference/sdk-api/ui/menubar/MenubarShortcut.md +100 -0
  194. package/dist/reference/sdk-api/ui/menubar/MenubarSub.md +58 -0
  195. package/dist/reference/sdk-api/ui/menubar/MenubarSubContent.md +108 -0
  196. package/dist/reference/sdk-api/ui/menubar/MenubarSubTrigger.md +107 -0
  197. package/dist/reference/sdk-api/ui/menubar/MenubarTrigger.md +100 -0
  198. package/dist/reference/sdk-api/ui/menubar/index.md +24 -0
  199. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenu.md +100 -0
  200. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuContent.md +106 -0
  201. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuIndicator.md +100 -0
  202. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuItem.md +106 -0
  203. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuLink.md +106 -0
  204. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuList.md +100 -0
  205. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuPositioner.md +100 -0
  206. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuTrigger.md +120 -0
  207. package/dist/reference/sdk-api/ui/navigation-menu/index.md +17 -0
  208. package/dist/reference/sdk-api/ui/navigation-menu/navigationMenuTriggerStyle.md +64 -0
  209. package/dist/reference/sdk-api/ui/pagination/Pagination.md +100 -0
  210. package/dist/reference/sdk-api/ui/pagination/PaginationContent.md +100 -0
  211. package/dist/reference/sdk-api/ui/pagination/PaginationEllipsis.md +100 -0
  212. package/dist/reference/sdk-api/ui/pagination/PaginationItem.md +100 -0
  213. package/dist/reference/sdk-api/ui/pagination/PaginationLink.md +107 -0
  214. package/dist/reference/sdk-api/ui/pagination/PaginationNext.md +121 -0
  215. package/dist/reference/sdk-api/ui/pagination/PaginationPrevious.md +121 -0
  216. package/dist/reference/sdk-api/ui/pagination/index.md +15 -0
  217. package/dist/reference/sdk-api/ui/popover/Popover.md +58 -0
  218. package/dist/reference/sdk-api/ui/popover/PopoverAnchor.md +100 -0
  219. package/dist/reference/sdk-api/ui/popover/PopoverContent.md +108 -0
  220. package/dist/reference/sdk-api/ui/popover/PopoverDescription.md +100 -0
  221. package/dist/reference/sdk-api/ui/popover/PopoverHeader.md +100 -0
  222. package/dist/reference/sdk-api/ui/popover/PopoverTitle.md +100 -0
  223. package/dist/reference/sdk-api/ui/popover/PopoverTrigger.md +119 -0
  224. package/dist/reference/sdk-api/ui/popover/index.md +15 -0
  225. package/dist/reference/sdk-api/ui/portal/Portal.md +55 -0
  226. package/dist/reference/sdk-api/ui/portal/index.md +9 -0
  227. package/dist/reference/sdk-api/ui/progress/Progress.md +109 -0
  228. package/dist/reference/sdk-api/ui/progress/ProgressIndicator.md +107 -0
  229. package/dist/reference/sdk-api/ui/progress/ProgressLabel.md +100 -0
  230. package/dist/reference/sdk-api/ui/progress/ProgressTrack.md +100 -0
  231. package/dist/reference/sdk-api/ui/progress/ProgressValue.md +105 -0
  232. package/dist/reference/sdk-api/ui/progress/index.md +13 -0
  233. package/dist/reference/sdk-api/ui/radio-group/RadioGroup.md +108 -0
  234. package/dist/reference/sdk-api/ui/radio-group/RadioGroupItem.md +107 -0
  235. package/dist/reference/sdk-api/ui/radio-group/index.md +10 -0
  236. package/dist/reference/sdk-api/ui/resizable/ResizableHandle.md +107 -0
  237. package/dist/reference/sdk-api/ui/resizable/ResizablePanel.md +108 -0
  238. package/dist/reference/sdk-api/ui/resizable/ResizablePanelGroup.md +107 -0
  239. package/dist/reference/sdk-api/ui/resizable/index.md +11 -0
  240. package/dist/reference/sdk-api/ui/scroll-area/ScrollArea.md +159 -0
  241. package/dist/reference/sdk-api/ui/scroll-area/ScrollBar.md +106 -0
  242. package/dist/reference/sdk-api/ui/scroll-area/index.md +10 -0
  243. package/dist/reference/sdk-api/ui/select/Select.md +80 -0
  244. package/dist/reference/sdk-api/ui/select/SelectContent.md +106 -0
  245. package/dist/reference/sdk-api/ui/select/SelectGroup.md +100 -0
  246. package/dist/reference/sdk-api/ui/select/SelectItem.md +106 -0
  247. package/dist/reference/sdk-api/ui/select/SelectLabel.md +100 -0
  248. package/dist/reference/sdk-api/ui/select/SelectScrollDownButton.md +100 -0
  249. package/dist/reference/sdk-api/ui/select/SelectScrollUpButton.md +100 -0
  250. package/dist/reference/sdk-api/ui/select/SelectSeparator.md +100 -0
  251. package/dist/reference/sdk-api/ui/select/SelectTrigger.md +106 -0
  252. package/dist/reference/sdk-api/ui/select/SelectValue.md +106 -0
  253. package/dist/reference/sdk-api/ui/select/index.md +18 -0
  254. package/dist/reference/sdk-api/ui/separator/Separator.md +106 -0
  255. package/dist/reference/sdk-api/ui/separator/index.md +9 -0
  256. package/dist/reference/sdk-api/ui/sheet/Sheet.md +58 -0
  257. package/dist/reference/sdk-api/ui/sheet/SheetClose.md +100 -0
  258. package/dist/reference/sdk-api/ui/sheet/SheetContent.md +113 -0
  259. package/dist/reference/sdk-api/ui/sheet/SheetDescription.md +100 -0
  260. package/dist/reference/sdk-api/ui/sheet/SheetFooter.md +100 -0
  261. package/dist/reference/sdk-api/ui/sheet/SheetHeader.md +100 -0
  262. package/dist/reference/sdk-api/ui/sheet/SheetOverlay.md +100 -0
  263. package/dist/reference/sdk-api/ui/sheet/SheetPortal.md +55 -0
  264. package/dist/reference/sdk-api/ui/sheet/SheetTitle.md +100 -0
  265. package/dist/reference/sdk-api/ui/sheet/SheetTrigger.md +100 -0
  266. package/dist/reference/sdk-api/ui/sheet/index.md +18 -0
  267. package/dist/reference/sdk-api/ui/skeleton/Skeleton.md +100 -0
  268. package/dist/reference/sdk-api/ui/skeleton/index.md +9 -0
  269. package/dist/reference/sdk-api/ui/slider/Slider.md +116 -0
  270. package/dist/reference/sdk-api/ui/slider/index.md +9 -0
  271. package/dist/reference/sdk-api/ui/sonner/Toaster.md +43 -0
  272. package/dist/reference/sdk-api/ui/sonner/index.md +10 -0
  273. package/dist/reference/sdk-api/ui/sonner/toast.md +58 -0
  274. package/dist/reference/sdk-api/ui/spinner/Spinner.md +100 -0
  275. package/dist/reference/sdk-api/ui/spinner/index.md +9 -0
  276. package/dist/reference/sdk-api/ui/switch/Switch.md +110 -0
  277. package/dist/reference/sdk-api/ui/switch/index.md +9 -0
  278. package/dist/reference/sdk-api/ui/table/Table.md +100 -0
  279. package/dist/reference/sdk-api/ui/table/TableBody.md +100 -0
  280. package/dist/reference/sdk-api/ui/table/TableCaption.md +100 -0
  281. package/dist/reference/sdk-api/ui/table/TableCell.md +106 -0
  282. package/dist/reference/sdk-api/ui/table/TableFooter.md +100 -0
  283. package/dist/reference/sdk-api/ui/table/TableHead.md +106 -0
  284. package/dist/reference/sdk-api/ui/table/TableHeader.md +100 -0
  285. package/dist/reference/sdk-api/ui/table/TableRow.md +100 -0
  286. package/dist/reference/sdk-api/ui/table/index.md +16 -0
  287. package/dist/reference/sdk-api/ui/tabs/Tabs.md +109 -0
  288. package/dist/reference/sdk-api/ui/tabs/TabsContent.md +106 -0
  289. package/dist/reference/sdk-api/ui/tabs/TabsList.md +106 -0
  290. package/dist/reference/sdk-api/ui/tabs/TabsTrigger.md +107 -0
  291. package/dist/reference/sdk-api/ui/tabs/index.md +13 -0
  292. package/dist/reference/sdk-api/ui/tabs/tabsListVariants.md +70 -0
  293. package/dist/reference/sdk-api/ui/textarea/Textarea.md +126 -0
  294. package/dist/reference/sdk-api/ui/textarea/index.md +9 -0
  295. package/dist/reference/sdk-api/ui/toggle/Toggle.md +118 -0
  296. package/dist/reference/sdk-api/ui/toggle/index.md +10 -0
  297. package/dist/reference/sdk-api/ui/toggle/toggleVariants.md +71 -0
  298. package/dist/reference/sdk-api/ui/toggle-group/ToggleGroup.md +122 -0
  299. package/dist/reference/sdk-api/ui/toggle-group/ToggleGroupItem.md +116 -0
  300. package/dist/reference/sdk-api/ui/toggle-group/index.md +10 -0
  301. package/dist/reference/sdk-api.json +73810 -2
  302. package/dist/reference/sdk-api.md +50 -2
  303. package/dist/ui/accordion.d.ts +48 -0
  304. package/dist/ui/accordion.js +40 -0
  305. package/dist/ui/accordion.js.map +1 -1
  306. package/dist/ui/alert-dialog.d.ts +123 -0
  307. package/dist/ui/alert-dialog.js +114 -0
  308. package/dist/ui/alert-dialog.js.map +1 -1
  309. package/dist/ui/alert.d.ts +41 -0
  310. package/dist/ui/alert.js +41 -0
  311. package/dist/ui/alert.js.map +1 -1
  312. package/dist/ui/aspect-ratio.d.ts +11 -0
  313. package/dist/ui/aspect-ratio.js +10 -0
  314. package/dist/ui/aspect-ratio.js.map +1 -1
  315. package/dist/ui/avatar.d.ts +65 -0
  316. package/dist/ui/avatar.js +63 -0
  317. package/dist/ui/avatar.js.map +1 -1
  318. package/dist/ui/badge.d.ts +22 -0
  319. package/dist/ui/badge.js +22 -0
  320. package/dist/ui/badge.js.map +1 -1
  321. package/dist/ui/button-group.d.ts +45 -0
  322. package/dist/ui/button-group.js +43 -0
  323. package/dist/ui/button-group.js.map +1 -1
  324. package/dist/ui/button.d.ts +52 -0
  325. package/dist/ui/button.js +30 -0
  326. package/dist/ui/button.js.map +1 -1
  327. package/dist/ui/calendar.d.ts +44 -0
  328. package/dist/ui/calendar.js +19 -0
  329. package/dist/ui/calendar.js.map +1 -1
  330. package/dist/ui/card.d.ts +71 -0
  331. package/dist/ui/card.js +70 -0
  332. package/dist/ui/card.js.map +1 -1
  333. package/dist/ui/carousel.d.ts +71 -0
  334. package/dist/ui/carousel.js +66 -0
  335. package/dist/ui/carousel.js.map +1 -1
  336. package/dist/ui/checkbox.d.ts +14 -0
  337. package/dist/ui/checkbox.js +10 -0
  338. package/dist/ui/checkbox.js.map +1 -1
  339. package/dist/ui/collapsible.d.ts +37 -0
  340. package/dist/ui/collapsible.js +30 -0
  341. package/dist/ui/collapsible.js.map +1 -1
  342. package/dist/ui/combobox.d.ts +190 -0
  343. package/dist/ui/combobox.js +167 -0
  344. package/dist/ui/combobox.js.map +1 -1
  345. package/dist/ui/dialog.d.ts +109 -0
  346. package/dist/ui/dialog.js +100 -0
  347. package/dist/ui/dialog.js.map +1 -1
  348. package/dist/ui/drawer.d.ts +106 -0
  349. package/dist/ui/drawer.js +100 -0
  350. package/dist/ui/drawer.js.map +1 -1
  351. package/dist/ui/dropdown-menu.d.ts +171 -0
  352. package/dist/ui/dropdown-menu.js +150 -0
  353. package/dist/ui/dropdown-menu.js.map +1 -1
  354. package/dist/ui/empty.d.ts +61 -0
  355. package/dist/ui/empty.js +61 -0
  356. package/dist/ui/empty.js.map +1 -1
  357. package/dist/ui/field.d.ts +105 -0
  358. package/dist/ui/field.js +101 -0
  359. package/dist/ui/field.js.map +1 -1
  360. package/dist/ui/helpers.d.ts +11 -0
  361. package/dist/ui/helpers.js +11 -0
  362. package/dist/ui/helpers.js.map +1 -1
  363. package/dist/ui/input-group.d.ts +65 -0
  364. package/dist/ui/input-group.js +65 -0
  365. package/dist/ui/input-group.js.map +1 -1
  366. package/dist/ui/input-otp.d.ts +48 -0
  367. package/dist/ui/input-otp.js +40 -0
  368. package/dist/ui/input-otp.js.map +1 -1
  369. package/dist/ui/input.d.ts +24 -2
  370. package/dist/ui/input.js +20 -0
  371. package/dist/ui/input.js.map +1 -1
  372. package/dist/ui/item.d.ts +103 -0
  373. package/dist/ui/item.js +103 -0
  374. package/dist/ui/item.js.map +1 -1
  375. package/dist/ui/label.d.ts +10 -0
  376. package/dist/ui/label.js +10 -0
  377. package/dist/ui/label.js.map +1 -1
  378. package/dist/ui/menubar.d.ts +193 -0
  379. package/dist/ui/menubar.js +160 -0
  380. package/dist/ui/menubar.js.map +1 -1
  381. package/dist/ui/navigation-menu.d.ts +98 -0
  382. package/dist/ui/navigation-menu.js +90 -0
  383. package/dist/ui/navigation-menu.js.map +1 -1
  384. package/dist/ui/pagination.d.ts +76 -0
  385. package/dist/ui/pagination.js +73 -0
  386. package/dist/ui/pagination.js.map +1 -1
  387. package/dist/ui/popover.d.ts +81 -0
  388. package/dist/ui/popover.js +70 -0
  389. package/dist/ui/popover.js.map +1 -1
  390. package/dist/ui/portal.d.ts +11 -0
  391. package/dist/ui/portal.js +10 -0
  392. package/dist/ui/portal.js.map +1 -1
  393. package/dist/ui/progress.d.ts +53 -26
  394. package/dist/ui/progress.js +50 -26
  395. package/dist/ui/progress.js.map +1 -1
  396. package/dist/ui/radio-group.d.ts +25 -0
  397. package/dist/ui/radio-group.js +20 -0
  398. package/dist/ui/radio-group.js.map +1 -1
  399. package/dist/ui/resizable.d.ts +37 -0
  400. package/dist/ui/resizable.js +30 -0
  401. package/dist/ui/resizable.js.map +1 -1
  402. package/dist/ui/scroll-area.d.ts +22 -0
  403. package/dist/ui/scroll-area.js +21 -0
  404. package/dist/ui/scroll-area.js.map +1 -1
  405. package/dist/ui/select.d.ts +122 -0
  406. package/dist/ui/select.js +108 -0
  407. package/dist/ui/select.js.map +1 -1
  408. package/dist/ui/separator.d.ts +11 -0
  409. package/dist/ui/separator.js +10 -0
  410. package/dist/ui/separator.js.map +1 -1
  411. package/dist/ui/sheet.d.ts +107 -0
  412. package/dist/ui/sheet.js +101 -0
  413. package/dist/ui/sheet.js.map +1 -1
  414. package/dist/ui/skeleton.d.ts +10 -0
  415. package/dist/ui/skeleton.js +10 -0
  416. package/dist/ui/skeleton.js.map +1 -1
  417. package/dist/ui/slider.d.ts +21 -0
  418. package/dist/ui/slider.js +14 -0
  419. package/dist/ui/slider.js.map +1 -1
  420. package/dist/ui/sonner.d.ts +23 -0
  421. package/dist/ui/sonner.js +21 -0
  422. package/dist/ui/sonner.js.map +1 -1
  423. package/dist/ui/spinner.d.ts +10 -0
  424. package/dist/ui/spinner.js +10 -0
  425. package/dist/ui/spinner.js.map +1 -1
  426. package/dist/ui/switch.d.ts +15 -0
  427. package/dist/ui/switch.js +10 -0
  428. package/dist/ui/switch.js.map +1 -1
  429. package/dist/ui/table.d.ts +81 -0
  430. package/dist/ui/table.js +80 -0
  431. package/dist/ui/table.js.map +1 -1
  432. package/dist/ui/tabs.d.ts +59 -0
  433. package/dist/ui/tabs.js +51 -0
  434. package/dist/ui/tabs.js.map +1 -1
  435. package/dist/ui/textarea.d.ts +13 -0
  436. package/dist/ui/textarea.js +13 -0
  437. package/dist/ui/textarea.js.map +1 -1
  438. package/dist/ui/toggle-group.d.ts +34 -0
  439. package/dist/ui/toggle-group.js +24 -0
  440. package/dist/ui/toggle-group.js.map +1 -1
  441. package/dist/ui/toggle.d.ts +28 -0
  442. package/dist/ui/toggle.js +24 -0
  443. package/dist/ui/toggle.js.map +1 -1
  444. package/package.json +5 -3
  445. package/release-provenance.json +15 -0
  446. package/src/adapters/interest-card/eslint/eslint-plugin-custom-navigation.mjs +290 -0
  447. package/src/adapters/interest-card/eslint/taro.mjs +55 -0
  448. package/src/adapters/interest-card/runtime/microapp.ts +11 -0
  449. package/src/adapters/interest-card/types/taro.d.ts +28 -0
  450. package/src/build/config-overrides.ts +39 -0
  451. package/src/build/index.ts +5 -0
  452. package/src/build/plugins/app-config.ts +47 -0
  453. package/src/build/plugins/depend-card/analyze.ts +122 -0
  454. package/src/build/plugins/depend-card/source.ts +97 -0
  455. package/src/build/plugins/vite-depend-card.ts +168 -0
  456. package/src/build/plugins/vite-image-asset-import.ts +178 -0
  457. package/src/build/plugins/vite-inline-json.ts +149 -0
  458. package/src/build/plugins/vite-taro-source-location.ts +224 -0
  459. package/src/build/plugins/vite-tt-components-entry.ts +33 -0
  460. package/src/build/taro.ts +830 -0
  461. package/src/components/miniapp-open-card.ts +49 -0
  462. package/src/components/native-miniapp-open-card.ts +7 -0
  463. package/src/eslint/eslint-plugin-microapp-pages.mjs +659 -0
  464. package/src/eslint/server.mjs +69 -0
  465. package/src/eslint/taro.mjs +553 -0
  466. package/src/index.ts +2 -0
  467. package/src/internal/runtime/douyin-open-button.d.ts +29 -0
  468. package/src/internal/runtime/iframe-auth/identity.ts +236 -0
  469. package/src/internal/runtime/iframe-auth/index.ts +2 -0
  470. package/src/internal/runtime/iframe-auth/sync.ts +37 -0
  471. package/src/internal/vendor-modules.d.ts +8 -0
  472. package/src/lib/measure.ts +115 -0
  473. package/src/lib/platform.ts +11 -0
  474. package/src/lib/utils.ts +6 -0
  475. package/src/runtime/client.ts +246 -0
  476. package/src/runtime/default-client.ts +26 -0
  477. package/src/runtime/default-iframe-auth.ts +13 -0
  478. package/src/runtime/douyin-container-request.ts +367 -0
  479. package/src/runtime/douyin-login-request.ts +514 -0
  480. package/src/runtime/globals.d.ts +342 -0
  481. package/src/runtime/index.ts +4 -0
  482. package/src/runtime/network-url.ts +63 -0
  483. package/src/ui/accordion.tsx +226 -0
  484. package/src/ui/alert-dialog.tsx +407 -0
  485. package/src/ui/alert.tsx +149 -0
  486. package/src/ui/aspect-ratio.tsx +37 -0
  487. package/src/ui/avatar.tsx +238 -0
  488. package/src/ui/badge.tsx +77 -0
  489. package/src/ui/button-group.tsx +173 -0
  490. package/src/ui/button.tsx +215 -0
  491. package/src/ui/calendar.tsx +353 -0
  492. package/src/ui/card.tsx +217 -0
  493. package/src/ui/carousel.tsx +259 -0
  494. package/src/ui/checkbox.tsx +62 -0
  495. package/src/ui/collapsible.tsx +148 -0
  496. package/src/ui/combobox.tsx +650 -0
  497. package/src/ui/dialog.tsx +290 -0
  498. package/src/ui/drawer.tsx +272 -0
  499. package/src/ui/dropdown-menu.tsx +547 -0
  500. package/src/ui/empty.tsx +166 -0
  501. package/src/ui/field.tsx +427 -0
  502. package/src/ui/helpers.tsx +39 -0
  503. package/src/ui/index.ts +47 -0
  504. package/src/ui/input-group.tsx +320 -0
  505. package/src/ui/input-otp.tsx +189 -0
  506. package/src/ui/input.tsx +60 -0
  507. package/src/ui/item.tsx +338 -0
  508. package/src/ui/label.tsx +31 -0
  509. package/src/ui/menubar.tsx +835 -0
  510. package/src/ui/navigation-menu.tsx +341 -0
  511. package/src/ui/pagination.tsx +195 -0
  512. package/src/ui/popover.tsx +363 -0
  513. package/src/ui/portal.tsx +31 -0
  514. package/src/ui/progress.tsx +182 -0
  515. package/src/ui/radio-group.tsx +111 -0
  516. package/src/ui/resizable.tsx +410 -0
  517. package/src/ui/scroll-area.tsx +102 -0
  518. package/src/ui/select.tsx +471 -0
  519. package/src/ui/separator.tsx +37 -0
  520. package/src/ui/sheet.tsx +289 -0
  521. package/src/ui/skeleton.tsx +25 -0
  522. package/src/ui/slider.tsx +176 -0
  523. package/src/ui/sonner.tsx +40 -0
  524. package/src/ui/spinner.tsx +23 -0
  525. package/src/ui/switch.tsx +94 -0
  526. package/src/ui/table.tsx +240 -0
  527. package/src/ui/tabs.tsx +233 -0
  528. package/src/ui/tailwind.css +2 -0
  529. package/src/ui/textarea.tsx +49 -0
  530. package/src/ui/theme.css +234 -0
  531. package/src/ui/toggle-group.tsx +215 -0
  532. package/src/ui/toggle.tsx +113 -0
@@ -0,0 +1,830 @@
1
+ import type { UserConfigExport } from "@tarojs/cli";
2
+ import tailwindcss from "@tailwindcss/postcss";
3
+ import path from "path";
4
+ import fs from "fs";
5
+ import { fileURLToPath } from "node:url";
6
+ import type { Plugin } from "vite";
7
+ import { UnifiedViteWeappTailwindcssPlugin } from 'weapp-tailwindcss/vite';
8
+ import { viteImageAssetImportPlugin } from "./plugins/vite-image-asset-import";
9
+ import { viteDependCardPlugin } from "./plugins/vite-depend-card";
10
+ import { viteInlineJsonPlugin } from "./plugins/vite-inline-json";
11
+ import { viteTaroSourceLocationPlugin } from "./plugins/vite-taro-source-location";
12
+ import { viteTtComponentsEntryPlugin } from "./plugins/vite-tt-components-entry";
13
+
14
+ const SDK_DIR = path.dirname(fileURLToPath(import.meta.url));
15
+
16
+ /**
17
+ * @desc Taro 构建阶段共享的编译上下文。
18
+ * @example const context: BuildContext = { isH5: true, isTt: false, mode: 'development', projectRoot }
19
+ * @ai-intent 描述 SDK 构建插件收到的 Taro 编译上下文。
20
+ * @ai-when 需要根据 H5、TT 或开发模式调整构建配置时。
21
+ * @ai-avoid 不要在业务页面中手动伪造该上下文或修改构建产物。
22
+ * @ai-example { isH5: true, isTt: false, mode: 'development', projectRoot }
23
+ */
24
+ export interface BuildContext {
25
+ /** @desc 是否构建 H5 输出。 */
26
+ isH5: boolean
27
+ /** @desc 是否构建 TT 小程序输出。 */
28
+ isTt: boolean
29
+ /** @desc 当前 Taro 构建模式。 */
30
+ mode: string
31
+ /** @desc 工程根目录。 */
32
+ projectRoot: string
33
+ }
34
+
35
+ /**
36
+ * @desc 创建普通小程序 Taro 配置的选项。
37
+ * @params {string} projectRoot 工程根目录。
38
+ * @params {'' | 'ext'} [platformChannel] 平台渠道。
39
+ * @params {string[]} [viteErrorTargets] Vite 错误上报目标。
40
+ * @params {Record<string, any> | Function} [overrides] 配置覆盖项。
41
+ * @example createMicroappTaroConfig({ projectRoot: process.cwd() })
42
+ * @ai-intent 配置普通小程序的 Taro/Vite 构建入口。
43
+ * @ai-when 需要从项目构建脚本创建普通小程序配置时。
44
+ * @ai-avoid 不要在业务代码中直接调用 Taro/Vite 内部构建 API。
45
+ * @ai-example createMicroappTaroConfig({ projectRoot: process.cwd() })
46
+ */
47
+ export interface CreateMicroappTaroConfigOptions {
48
+ /** @desc 工程根目录。 */
49
+ projectRoot: string
50
+ /** @desc 平台渠道。 */
51
+ platformChannel?: '' | 'ext'
52
+ /** @desc Vite 错误上报目标列表。 */
53
+ viteErrorTargets?: string[]
54
+ /** @desc 配置对象或配置变换函数。 */
55
+ overrides?: Record<string, any> | ((config: UserConfigExport, ctx: BuildContext) => UserConfigExport | void)
56
+ }
57
+
58
+ import { applyConfigOverrides } from './config-overrides'
59
+ export { applyConfigOverrides, mergeConfigValue } from './config-overrides'
60
+
61
+ function shouldRewritePreviewRequest(req: any) {
62
+ if (req.method !== "GET" && req.method !== "HEAD") return false;
63
+ if (req.headers.accept && !req.headers.accept.includes("text/html")) {
64
+ return false;
65
+ }
66
+ return true;
67
+ }
68
+
69
+ function isViteOptimizedDepsRequest(url?: string) {
70
+ if (!url) return false;
71
+ const cleanUrl = url.split("?")[0].split("#")[0];
72
+ return (
73
+ cleanUrl.includes("/node_modules/.vite/deps/") ||
74
+ cleanUrl.includes("/@fs/") && cleanUrl.includes("/node_modules/.vite/deps/")
75
+ );
76
+ }
77
+
78
+ interface NetworkCallInfo {
79
+ method: string;
80
+ url: string;
81
+ file: string;
82
+ }
83
+
84
+ type EstreeNode = {
85
+ type: string;
86
+ loc?: { start: { line: number; column: number } };
87
+ [key: string]: any;
88
+ };
89
+
90
+ function extractUrlFromEstree(node: EstreeNode): string {
91
+ if (node.type === "Literal" && typeof node.value === "string")
92
+ return node.value;
93
+ if (node.type === "TemplateLiteral") {
94
+ let result = "";
95
+ for (let i = 0; i < node.quasis.length; i++) {
96
+ result += node.quasis[i].value.cooked ?? node.quasis[i].value.raw;
97
+ if (i < node.expressions.length)
98
+ result += `\${${extractUrlFromEstree(node.expressions[i])}}`;
99
+ }
100
+ return result;
101
+ }
102
+ if (node.type === "BinaryExpression" && node.operator === "+")
103
+ return extractUrlFromEstree(node.left) + extractUrlFromEstree(node.right);
104
+ if (node.type === "Identifier") return `\${${node.name}}`;
105
+ return "<dynamic>";
106
+ }
107
+
108
+ function visitEstree(node: EstreeNode, callback: (node: EstreeNode) => void) {
109
+ callback(node);
110
+ for (const key of Object.keys(node)) {
111
+ const child = node[key];
112
+ if (child && typeof child === "object" && child.type) {
113
+ visitEstree(child, callback);
114
+ } else if (Array.isArray(child)) {
115
+ for (const item of child) {
116
+ if (item && typeof item === "object" && item.type)
117
+ visitEstree(item, callback);
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ const TARGET_METHODS = new Set(["request", "uploadFile", "downloadFile"]);
124
+ const CLIENT_ROUTES_FILE = "/tmp/routes/client-routes.json";
125
+
126
+ function writeRoutes(results: NetworkCallInfo[]) {
127
+ try {
128
+ const outDir = path.dirname(CLIENT_ROUTES_FILE);
129
+ if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });
130
+ fs.writeFileSync(CLIENT_ROUTES_FILE, JSON.stringify(results, null, 2));
131
+ console.log(
132
+ `\n[NetworkUrlAnalyzerPlugin] Collected ${results.length} client route(s) -> ${CLIENT_ROUTES_FILE}\n`,
133
+ );
134
+ } catch {
135
+ // Ignore route dump failures in build-time analysis.
136
+ }
137
+ }
138
+
139
+ function collectNetworkCalls(
140
+ ast: EstreeNode,
141
+ id: string,
142
+ srcDir: string,
143
+ results: NetworkCallInfo[],
144
+ ) {
145
+ visitEstree(ast, (node) => {
146
+ if (
147
+ node.type === "CallExpression" &&
148
+ node.callee?.type === "MemberExpression" &&
149
+ node.callee.object?.type === "Identifier" &&
150
+ node.callee.object.name === "Network" &&
151
+ node.callee.property?.type === "Identifier" &&
152
+ TARGET_METHODS.has(node.callee.property.name)
153
+ ) {
154
+ const arg = node.arguments?.[0];
155
+ if (arg?.type === "ObjectExpression") {
156
+ const urlProp = arg.properties?.find(
157
+ (p: EstreeNode) =>
158
+ p.type === "Property" &&
159
+ ((p.key?.type === "Identifier" && p.key.name === "url") ||
160
+ (p.key?.type === "Literal" && p.key.value === "url")),
161
+ );
162
+ if (urlProp) {
163
+ const urlValue = extractUrlFromEstree(urlProp.value);
164
+ results.push({
165
+ method: node.callee.property.name,
166
+ url: urlValue,
167
+ file: path.relative(path.resolve(srcDir, ".."), id),
168
+ });
169
+ }
170
+ }
171
+ }
172
+ });
173
+ }
174
+
175
+ function networkUrlAnalyzerPlugin(srcDir: string): Plugin {
176
+ const results: NetworkCallInfo[] = [];
177
+ let isBuild = false;
178
+
179
+ return {
180
+ name: "network-url-analyzer",
181
+ buildStart() {
182
+ isBuild = !this.meta.watchMode;
183
+ if (!isBuild) return;
184
+ results.length = 0;
185
+ try {
186
+ fs.unlinkSync(CLIENT_ROUTES_FILE);
187
+ } catch {
188
+ // Ignore missing route snapshot files.
189
+ }
190
+ },
191
+ transform(code, id) {
192
+ if (!isBuild) return;
193
+ try {
194
+ if (!id.startsWith(srcDir) || id.includes("network.ts")) return;
195
+ if (!/\.(ts|tsx|js|jsx)$/.test(id)) return;
196
+
197
+ const ast = this.parse(code) as unknown as EstreeNode;
198
+ collectNetworkCalls(ast, id, srcDir, results);
199
+ } catch {
200
+ // Ignore analyzer failures and avoid blocking builds.
201
+ }
202
+ },
203
+ closeBundle() {
204
+ if (!isBuild) return;
205
+ writeRoutes(results);
206
+ results.length = 0;
207
+ },
208
+ };
209
+ }
210
+
211
+ function createAppEntryMatcher(srcDir: string) {
212
+ const candidateEntries = new Set(
213
+ ["app.ts", "app.tsx", "app.js", "app.jsx"].map((name) =>
214
+ path.normalize(path.join(srcDir, name)),
215
+ ),
216
+ );
217
+
218
+ return (id: string) => {
219
+ if (!id.includes("/app.") && !id.includes("\\app.")) {
220
+ return false;
221
+ }
222
+
223
+ const cleanId = id.split("?")[0];
224
+ return candidateEntries.has(path.normalize(cleanId));
225
+ };
226
+ }
227
+
228
+ function buildInjectedViteErrorReporter(targetOrigins: string[]) {
229
+ return `
230
+ /* Injected vite error reporter */
231
+ if (typeof window !== "undefined" &&
232
+ window !== window.parent &&
233
+ import.meta.hot &&
234
+ !window.__AGI_VITE_ERROR_SYNC__) {
235
+ window.__AGI_VITE_ERROR_SYNC__ = true;
236
+ const viteErrorTargets = ${JSON.stringify(targetOrigins)};
237
+ const postToParent = (message) => {
238
+ viteErrorTargets.forEach((targetOrigin) => {
239
+ try {
240
+ window.parent.postMessage(message, targetOrigin);
241
+ } catch (error) {
242
+ }
243
+ });
244
+ };
245
+ const normalizeError = (err) => {
246
+ if (!err) {
247
+ return null;
248
+ }
249
+ return {
250
+ message: err.message,
251
+ id: err.id,
252
+ };
253
+ };
254
+
255
+ import.meta.hot.on("vite:error", (payload) => {
256
+ const error = normalizeError(payload && payload.err);
257
+ if (!error) {
258
+ return;
259
+ }
260
+ window.__LAST_VITE_ERROR__ = error;
261
+ postToParent({ type: "VITE_ERROR", hasError: true, error });
262
+ });
263
+
264
+ import.meta.hot.on("vite:beforeUpdate", () => {
265
+ window.__LAST_VITE_ERROR__ = null;
266
+ });
267
+ }
268
+ `;
269
+ }
270
+
271
+ // dev-only 路由自愈:app.config 改动重启重载后,若当前 URL 对应页面已从
272
+ // pages 中移除,重定向到新首页。兼容 hash(本地)与 browser(云端 + basename)模式。
273
+ function buildInjectedRouteHealer() {
274
+ return `
275
+ /* Injected dev route healer */
276
+ if (typeof window !== "undefined" && !window.__AGI_ROUTE_HEALER__) {
277
+ window.__AGI_ROUTE_HEALER__ = true;
278
+ var healRoute = function () {
279
+ try {
280
+ var config = window.__taroAppConfig;
281
+ var pages = config && config.pages;
282
+ if (!pages || !pages.length) return;
283
+ var router = config.router || {};
284
+ var mode = router.mode || "hash";
285
+ var basename = router.basename || "";
286
+ var stripBase = function (p) {
287
+ if (basename && p.indexOf(basename) === 0) p = p.slice(basename.length);
288
+ return p.replace(/^\\//, "");
289
+ };
290
+ var currentPath;
291
+ if (mode === "browser" || mode === "multi") {
292
+ currentPath = stripBase(window.location.pathname).split("?")[0];
293
+ } else {
294
+ var hash = window.location.hash || "";
295
+ currentPath = hash.replace(/^#/, "").split("?")[0].replace(/^\\//, "");
296
+ }
297
+ if (!currentPath) return;
298
+ var exists = pages.some(function (p) {
299
+ return p === currentPath || ("/" + p) === ("/" + currentPath);
300
+ });
301
+ if (exists) return;
302
+ var home = pages[0];
303
+ if (mode === "browser" || mode === "multi") {
304
+ var target = (basename ? basename.replace(/\\/$/, "") : "") + "/" + home;
305
+ window.location.replace(target + window.location.search);
306
+ } else {
307
+ window.location.hash = "#/" + home;
308
+ }
309
+ } catch (e) {}
310
+ };
311
+ if (document.readyState === "complete") {
312
+ setTimeout(healRoute, 0);
313
+ } else {
314
+ window.addEventListener("load", function () { setTimeout(healRoute, 0); });
315
+ }
316
+ }
317
+ `;
318
+ }
319
+
320
+ /**
321
+ * @desc 创建普通小程序的 Taro/Vite 构建配置。
322
+ * @params {CreateMicroappTaroConfigOptions} options 构建配置选项。
323
+ * @return {UserConfigExport} Taro 配置工厂函数。
324
+ * @example createMicroappTaroConfig({ projectRoot: process.cwd() })
325
+ * @ai-intent 创建普通小程序的 Taro/Vite 构建配置。
326
+ * @ai-when 构建脚本需要加载普通小程序的 SDK 配置时。
327
+ * @ai-avoid 不要在业务页面调用该构建工厂,也不要绕过 SDK 修改代理配置。
328
+ * @ai-example createMicroappTaroConfig({ projectRoot: process.cwd() })
329
+ */
330
+ export function createMicroappTaroConfig(
331
+ options: CreateMicroappTaroConfigOptions,
332
+ ): UserConfigExport {
333
+ return (async (merge: (...configs: any[]) => UserConfigExport) => {
334
+ const DOUYIN_CLOUD_ENV_ID = process.env.DOUYIN_CLOUD_ENV_ID || "";
335
+ const DOUYIN_CLOUD_DEV_ENV_ID = process.env.DOUYIN_CLOUD_DEV_ENV_ID || "";
336
+ const DOUYIN_CLOUD_SERVICE_ID = process.env.DOUYIN_CLOUD_SERVICE_ID || "";
337
+ const APP_ID = process.env.APP_ID || "";
338
+ const OPEN_CARD_ID = process.env.OPEN_CARD_ID || "";
339
+ const AUDIT_DOUYIN_CLOUD_ENV_ID = process.env.AUDIT_DOUYIN_CLOUD_ENV_ID || "";
340
+ const AUDIT_DOUYIN_CLOUD_SERVICE_ID = process.env.AUDIT_DOUYIN_CLOUD_SERVICE_ID || "";
341
+ if (APP_ID) {
342
+ process.env.TARO_APP_ID = APP_ID;
343
+ }
344
+ const projectRoot = path.resolve(options.projectRoot)
345
+ const srcDir = path.resolve(projectRoot, "src");
346
+ // Keep generated projects using their local icons; SDK-based templates use
347
+ // the scoped package while still accepting legacy `lucide-taro` imports.
348
+ const legacyIconEntry = path.resolve(projectRoot, 'icons/dist/lucide-taro.mjs')
349
+ const isH5 = process.env.TARO_ENV === 'h5';
350
+ const viteErrorTargets = options.viteErrorTargets ?? []
351
+ const cloudDevProjectDomain = viteErrorTargets[0] ?? ''
352
+ let conversationId = ''
353
+ try {
354
+ const meta = JSON.parse(
355
+ fs.readFileSync('/opt/gem/ai_coding_app/.meta/ai_coding_app_meta.json', 'utf8'),
356
+ ) as { conversation_id?: string }
357
+ conversationId = meta.conversation_id ?? ''
358
+ } catch {
359
+ // Local development has no cloud metadata.
360
+ }
361
+ const isCloudEnv = Boolean(conversationId)
362
+ const previewBasePath = isCloudEnv
363
+ ? `/api/apps/open_ai_coding_chat_server/aio_fe/${conversationId}/preview`
364
+ : ''
365
+ const aioServerPath = isCloudEnv
366
+ ? `${cloudDevProjectDomain}/api/apps/open_ai_coding_chat_server/aio_server/${conversationId}/api`
367
+ : 'http://localhost:10086/api'
368
+ const backendUrl = `http://localhost:${process.env.NJS_SERVER_PORT || '3000'}`
369
+ const withProjectDomain = (urlPath: string) => {
370
+ if (isCloudEnv && process.env.NODE_ENV === 'production') {
371
+ return `https://ma.zijieapi.com${urlPath}`
372
+ }
373
+ if (isCloudEnv && process.env.NODE_ENV === 'development') {
374
+ return `${cloudDevProjectDomain}${urlPath}`
375
+ }
376
+ return `http://localhost:10086${urlPath}`
377
+ }
378
+ const aioServerUrl = new URL(aioServerPath)
379
+ const PROJECT_DOMAIN = process.env.PROJECT_DOMAIN || withProjectDomain(aioServerUrl.pathname)
380
+ const UPLOAD_URL = process.env.UPLOAD_URL || withProjectDomain(
381
+ `/api/apps/open_ai_coding_chat_server/aio_server/${conversationId}/v1/file/upload`,
382
+ )
383
+ const DOWNLOAD_URL = process.env.DOWNLOAD_URL || withProjectDomain(
384
+ `/api/apps/open_ai_coding_chat_server/aio_server/${conversationId}/v1/file/download?path=`,
385
+ )
386
+ const proxyConfig = isCloudEnv
387
+ ? {
388
+ [aioServerPath]: {
389
+ target: backendUrl,
390
+ changeOrigin: true,
391
+ secure: false,
392
+ rewrite: (requestPath: string) => {
393
+ const rest = requestPath.replace(aioServerPath, '')
394
+ return rest.startsWith('/api') ? rest : `/api${rest}`
395
+ },
396
+ },
397
+ }
398
+ : {
399
+ '/api': { target: backendUrl, changeOrigin: true, secure: false },
400
+ }
401
+ const devConfig: UserConfigExport<'vite'> = {
402
+ logger: { quiet: false, stats: true },
403
+ mini: {},
404
+ h5: {
405
+ publicPath: isCloudEnv ? `${previewBasePath}/` : '/',
406
+ router: isCloudEnv
407
+ ? { mode: 'browser', basename: previewBasePath }
408
+ : { mode: 'hash' },
409
+ devServer: {
410
+ port: 10086,
411
+ open: false,
412
+ ...({ hmr: false } as Record<string, unknown>),
413
+ proxy: proxyConfig,
414
+ },
415
+ },
416
+ }
417
+ const prodConfig: UserConfigExport = {
418
+ mini: {},
419
+ cache: { enable: true },
420
+ h5: {},
421
+ }
422
+ const appConfigPath = path.join(srcDir, "app.config.ts");
423
+ // 保存 Taro 常驻编译上下文的引用,用于刷新 app/pages 与重置 loaderMeta。
424
+ let taroCompilerContext: any;
425
+ const isAppEntry = createAppEntryMatcher(srcDir);
426
+ const injectedViteErrorReporter = buildInjectedViteErrorReporter(
427
+ viteErrorTargets,
428
+ );
429
+ // dev(watch 模式)下 tt 产物输出到 dist,
430
+ // 与 build:tt(NODE_ENV=production)的 dist-tt 区分开。
431
+ const isDevBuild = process.env.NODE_ENV === 'development';
432
+ const injectedRouteHealer = buildInjectedRouteHealer();
433
+ const isTt = process.env.TARO_ENV === 'tt';
434
+ const shouldRefreshAppConfigOnUpdate = isH5 || isTt;
435
+ let shouldRefreshTtConfig = false;
436
+ const refreshTaroCompilerContext = (
437
+ ctx: any,
438
+ options: { resetLoaderMeta?: boolean } = {},
439
+ ) => {
440
+ if (!ctx) {
441
+ return;
442
+ }
443
+ if (options.resetLoaderMeta) {
444
+ ctx.loaderMeta = undefined;
445
+ }
446
+ // 原地更新,保持 app 对象 / pages 数组引用(下游插件闭包持有)。
447
+ if (typeof ctx.getApp === "function" && ctx.app) {
448
+ Object.assign(ctx.app, ctx.getApp());
449
+ }
450
+ if (typeof ctx.getPages === "function" && Array.isArray(ctx.pages)) {
451
+ ctx.pages.splice(0, ctx.pages.length, ...ctx.getPages());
452
+ }
453
+ };
454
+ const outputRootMap: Record<string, string> = {
455
+ tt: isDevBuild ? 'dist' : 'dist-tt',
456
+ h5: 'dist-web',
457
+ };
458
+ const defaultOutputRoot = outputRootMap[process.env.TARO_ENV || ''] || 'dist';
459
+ const baseConfig: UserConfigExport<"vite"> = {
460
+ projectName: "microapp",
461
+ date: "2026-3-5",
462
+ designWidth: 375,
463
+ deviceRatio: {
464
+ 640: 2.34 / 2,
465
+ 750: 1,
466
+ 375: 2,
467
+ 828: 1.81 / 2,
468
+ },
469
+ sourceRoot: "src",
470
+ outputRoot: defaultOutputRoot,
471
+ alias: {
472
+ "@": srcDir,
473
+ // TT collects used native components from plugin-inject's export barrel.
474
+ // Only replace the internal native entry; preserve the SDK runtime wrapper.
475
+ ...(isTt ? {
476
+ '#miniapp-open-card-native': '@tarojs/plugin-inject/dist/components-react.js',
477
+ } : {}),
478
+ "lucide-taro": fs.existsSync(legacyIconEntry)
479
+ ? legacyIconEntry
480
+ : '@open-dy/lucide-taro',
481
+ },
482
+ plugins: [
483
+ [
484
+ path.resolve(SDK_DIR, "plugins/app-config.cjs"),
485
+ { previewBasePath }
486
+ ],
487
+ [
488
+ "@tarojs/plugin-inject", // 注入抖音小程序的一些原生事件
489
+ {
490
+ components: {
491
+ // Registers the host-side MiniappOpenCard mapping. Business code
492
+ // imports MiniappOpenCard from the Taro SDK; its props,
493
+ // domain rules, and rendering requirements live in the Skill
494
+ // reference rather than in this build-only plugin configuration.
495
+ MiniappOpenCard: {
496
+ 'app-id': JSON.stringify(OPEN_CARD_ID),
497
+ path: '',
498
+ 'init-data': '',
499
+ 'env-version': '',
500
+ bindLoad: '',
501
+ bindError: '',
502
+ },
503
+ Button: {
504
+ 'bindaddshortcut': '', // 注入 bindaddshortcut 事件,当openType为addShortcut时回调触发
505
+ 'data-video-id': '', // 注入 data-video-id 属性,当openType为navigateToVideoView时,指定跳转的视频id
506
+ 'data-video-type': '', // 注入 data-video-type 属性,当openType为navigateToVideoView时,指定跳转的视频类型
507
+ 'bindnavigatetovideoview': '', // 注入 bindnavigatetovideoview 事件,当openType为navigateToVideoView时回调触发
508
+ },
509
+ ChannelVideo: {
510
+ 'item-id': '',
511
+ 'item-id-type': "'raw'",
512
+ autoplay: 'false',
513
+ loop: 'false',
514
+ 'object-fit': "'contain'",
515
+ preload: 'false',
516
+ bindplay: '',
517
+ bindpause: '',
518
+ bindwaiting: '',
519
+ bindstop: '',
520
+ bindend: '',
521
+ bindprogress: '',
522
+ binderror: '',
523
+ },
524
+ },
525
+ componentsMap: {
526
+ MiniappOpenCard: "miniapp-open-card",
527
+ ChannelVideo: 'channel-video',
528
+ },
529
+ voidComponents: ['channel-video'],
530
+ }
531
+ ],
532
+ ],
533
+ defineConstants: {
534
+ PROJECT_DOMAIN: JSON.stringify(PROJECT_DOMAIN),
535
+ DOUYIN_CLOUD_ENV_ID: JSON.stringify(DOUYIN_CLOUD_ENV_ID),
536
+ DOUYIN_CLOUD_DEV_ENV_ID: JSON.stringify(DOUYIN_CLOUD_DEV_ENV_ID),
537
+ DOUYIN_CLOUD_SERVICE_ID: JSON.stringify(DOUYIN_CLOUD_SERVICE_ID),
538
+ OPEN_CARD_ID: JSON.stringify(OPEN_CARD_ID),
539
+ AUDIT_DOUYIN_CLOUD_ENV_ID: JSON.stringify(AUDIT_DOUYIN_CLOUD_ENV_ID),
540
+ AUDIT_DOUYIN_CLOUD_SERVICE_ID: JSON.stringify(AUDIT_DOUYIN_CLOUD_SERVICE_ID),
541
+ UPLOAD_URL: JSON.stringify(UPLOAD_URL),
542
+ DOWNLOAD_URL: JSON.stringify(DOWNLOAD_URL),
543
+ },
544
+ copy: {
545
+ patterns: [],
546
+ options: {},
547
+ },
548
+ jsMinimizer: "esbuild",
549
+ framework: "react",
550
+ compiler: {
551
+ type: "vite",
552
+ vitePlugins: [
553
+ ...(isTt ? [viteTtComponentsEntryPlugin()] : []),
554
+ viteDependCardPlugin(),
555
+ viteTaroSourceLocationPlugin({
556
+ enabled: isDevBuild,
557
+ projectRoot,
558
+ }),
559
+ {
560
+ name: "build-sourcemap",
561
+ config(config) {
562
+ if (!isTt && !isDevBuild) {
563
+ return;
564
+ }
565
+ config.build = config.build ?? {};
566
+ config.build.sourcemap = true;
567
+ if (isDevBuild) {
568
+ config.build.minify = false;
569
+ }
570
+ },
571
+ },
572
+ viteInlineJsonPlugin({
573
+ projectRoot,
574
+ }),
575
+ viteImageAssetImportPlugin({
576
+ projectRoot,
577
+ }),
578
+ ...(isH5
579
+ ? []
580
+ : [
581
+ UnifiedViteWeappTailwindcssPlugin({
582
+ rem2rpx: true,
583
+ cssEntries: [path.resolve(srcDir, "app.css")],
584
+ cssSelectorReplacement: {
585
+ universal: ['view', 'text', 'page'],
586
+ },
587
+ }),
588
+ ]),
589
+ {
590
+ name: "postcss-config-loader-plugin",
591
+ config(config) {
592
+ if (typeof config.css?.postcss === "object") {
593
+ config.css?.postcss.plugins?.unshift(tailwindcss());
594
+ }
595
+ },
596
+ },
597
+ {
598
+ // Avoid a separate pre-bundled lucide-taro chunk in H5 dev.
599
+ name: "lucide-taro-alias-fix",
600
+ config(config) {
601
+ config.optimizeDeps = config.optimizeDeps ?? {};
602
+ config.optimizeDeps.exclude = [...new Set([
603
+ ...(config.optimizeDeps.exclude ?? []),
604
+ "lucide-taro",
605
+ "@open-dy/lucide-taro",
606
+ ])];
607
+ },
608
+ },
609
+ {
610
+ name: "cloud-preview-hmr-path",
611
+ config() {
612
+ if (!isH5 || !previewBasePath) {
613
+ return;
614
+ }
615
+ return {
616
+ server: {
617
+ hmr: {
618
+ path: `/ws`,
619
+ },
620
+ },
621
+ };
622
+ },
623
+ },
624
+ {
625
+ name: "allow-all-hosts",
626
+ configureServer(server) {
627
+ server.config.server.allowedHosts = true;
628
+ },
629
+ },
630
+ {
631
+ name: "vite-optimized-deps-no-cache",
632
+ configureServer(server: any) {
633
+ if (!isH5 || process.env.NODE_ENV === "production") {
634
+ return;
635
+ }
636
+ server.middlewares.use((req: any, res: any, next: any) => {
637
+ if (!isViteOptimizedDepsRequest(req.url)) {
638
+ return next();
639
+ }
640
+ const originalSetHeader = res.setHeader.bind(res);
641
+ res.setHeader = ((name: string, value: string | number | readonly string[]) => {
642
+ if (name.toLowerCase() === "cache-control") {
643
+ return originalSetHeader(name, "no-cache");
644
+ }
645
+ return originalSetHeader(name, value);
646
+ }) as typeof res.setHeader;
647
+ next();
648
+ });
649
+ },
650
+ },
651
+ {
652
+ name: "preview-history-fallback",
653
+ configureServer(server) {
654
+ server.middlewares.use((req, res, next) => {
655
+ if (!shouldRewritePreviewRequest(req)) {
656
+ return next();
657
+ }
658
+ if (
659
+ previewBasePath &&
660
+ req.url?.startsWith(previewBasePath) &&
661
+ !req.url.startsWith(`${previewBasePath}/ws`) &&
662
+ !req.url.includes("/@vite/") &&
663
+ !/\.[a-zA-Z0-9]+($|\?)/.test(req.url)
664
+ ) {
665
+ const urlObj = new URL(req.url, `http://${req.headers.host}`);
666
+ urlObj.pathname = `${previewBasePath}/`;
667
+ req.url = urlObj.pathname + urlObj.search;
668
+ }
669
+ next();
670
+ });
671
+ },
672
+ },
673
+ {
674
+ // app.config 改动需重建路由/入口,普通 HMR 无效。Taro 常驻
675
+ // viteCompilerContext 的 app/pages 在进程启动时定死,因此要在同一
676
+ // context 上原地刷新 app/pages。H5 侧仍触发 dev server 重启,并重置
677
+ // loaderMeta(规避 taro-react 字符串拼接累积导致的 React import 重复)。
678
+ // tt 侧显式 watch app.config.ts,页面配置由 Taro 自身监听。
679
+ // 两者变化时都在下一轮编译前刷新 context,让 JSON 和页面 JS 使用新配置。
680
+ name: "refresh-on-app-config-change",
681
+ async buildStart() {
682
+ if (!shouldRefreshAppConfigOnUpdate) {
683
+ return;
684
+ }
685
+ if (isTt && this.meta.watchMode) {
686
+ this.addWatchFile(appConfigPath);
687
+ }
688
+ try {
689
+ const info = await (this as any).load({ id: "taro:compiler" });
690
+ const ctx = (info?.meta as any)?.viteCompilerContext;
691
+ if (ctx) {
692
+ taroCompilerContext = ctx;
693
+ if (isTt && this.meta.watchMode && shouldRefreshTtConfig) {
694
+ refreshTaroCompilerContext(ctx);
695
+ shouldRefreshTtConfig = false;
696
+ }
697
+ }
698
+ } catch {
699
+ // 取不到时静默降级。
700
+ }
701
+ },
702
+ watchChange(id) {
703
+ if (!isTt || !this.meta.watchMode) {
704
+ return;
705
+ }
706
+ const configPath = path.normalize(id.split("?")[0].split("#")[0]);
707
+ const isPageConfig = taroCompilerContext?.pages?.some(
708
+ (page: { configPath?: string }) =>
709
+ typeof page?.configPath === "string" &&
710
+ path.normalize(page.configPath) === configPath,
711
+ );
712
+ if (configPath === path.normalize(appConfigPath) || isPageConfig) {
713
+ shouldRefreshTtConfig = true;
714
+ }
715
+ },
716
+ handleHotUpdate({ file, server }) {
717
+ if (!isH5) {
718
+ return;
719
+ }
720
+ if (file === appConfigPath) {
721
+ server.config.logger.info(
722
+ "[refresh-on-app-config-change] app.config 变化,重启 dev server...",
723
+ { timestamp: true },
724
+ );
725
+ const ctx = taroCompilerContext;
726
+ if (ctx) {
727
+ try {
728
+ refreshTaroCompilerContext(ctx, { resetLoaderMeta: true });
729
+ } catch {
730
+ // 刷新失败时退回到「仅重启」。
731
+ }
732
+ }
733
+ server.restart();
734
+ return [];
735
+ }
736
+ },
737
+ },
738
+ networkUrlAnalyzerPlugin(srcDir),
739
+ {
740
+ name: "inject-dev-scripts",
741
+ transform(code: string, id: string) {
742
+ if (!isH5 || process.env.NODE_ENV === "production") {
743
+ return null;
744
+ }
745
+ if (!isAppEntry(id)) {
746
+ return null;
747
+ }
748
+ return `${code}\n${injectedViteErrorReporter}\n${injectedRouteHealer}`;
749
+ },
750
+ transformIndexHtml(html: string) {
751
+ if (!isH5 || process.env.NODE_ENV === "production") {
752
+ return html;
753
+ }
754
+ return html.replace(
755
+ "</head>",
756
+ ` <script>window.__CONSOLE_BRIDGE_CONFIG__ = Object.assign({}, window.__CONSOLE_BRIDGE_CONFIG__, { appType: "microapp" });</script>\n <script src="https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_wwhpupt_ylwvslclk/ljhwZthlaukjlkulzlp/vibe-coding-inject/console-proxy.js?t=${Date.now()}"></script>\n <script src="https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_wwhpupt_ylwvslclk/ljhwZthlaukjlkulzlp/vibe-coding-inject/vite-overlay-observer.js?t=${Date.now()}"></script>\n</head>`,
757
+ );
758
+ },
759
+ },
760
+ ],
761
+ },
762
+ cache: {
763
+ enable: true, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
764
+ },
765
+ mini: {
766
+ postcss: {
767
+ pxtransform: {
768
+ enable: true,
769
+ config: {},
770
+ },
771
+ cssModules: {
772
+ enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
773
+ config: {
774
+ namingPattern: "module", // 转换模式,取值为 global/module
775
+ generateScopedName: "[name]__[local]___[hash:base64:5]",
776
+ },
777
+ },
778
+ },
779
+ },
780
+ h5: {
781
+ publicPath: "/",
782
+ staticDirectory: "static",
783
+ miniCssExtractPluginOption: {
784
+ ignoreOrder: true,
785
+ filename: "css/[name].[hash].css",
786
+ chunkFilename: "css/[name].[chunkhash].css",
787
+ },
788
+ postcss: {
789
+ autoprefixer: {
790
+ enable: true,
791
+ config: {},
792
+ },
793
+ cssModules: {
794
+ enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
795
+ config: {
796
+ namingPattern: "module", // 转换模式,取值为 global/module
797
+ generateScopedName: "[name]__[local]___[hash:base64:5]",
798
+ },
799
+ },
800
+ },
801
+ },
802
+ rn: {
803
+ appName: "taroDemo",
804
+ postcss: {
805
+ cssModules: {
806
+ enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
807
+ },
808
+ },
809
+ },
810
+ };
811
+ if (process.env.NODE_ENV === "development") {
812
+ // 本地开发构建配置(不混淆压缩)
813
+ const config = merge({}, baseConfig, devConfig)
814
+ return applyConfigOverrides(config, options.overrides, {
815
+ isH5,
816
+ isTt,
817
+ mode: process.env.NODE_ENV ?? '',
818
+ projectRoot,
819
+ })
820
+ }
821
+ // 生产构建配置(默认开启压缩混淆等)
822
+ const config = merge({}, baseConfig, prodConfig)
823
+ return applyConfigOverrides(config, options.overrides, {
824
+ isH5,
825
+ isTt,
826
+ mode: process.env.NODE_ENV ?? '',
827
+ projectRoot,
828
+ })
829
+ }) as UserConfigExport
830
+ }