torch-glare 2.5.6 → 2.6.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 (362) hide show
  1. package/README.md +4 -3
  2. package/dist/bin/index.js +9 -24
  3. package/dist/bin/index.js.map +1 -1
  4. package/dist/src/commands/add.d.ts +2 -2
  5. package/dist/src/commands/add.d.ts.map +1 -1
  6. package/dist/src/commands/add.js +4 -70
  7. package/dist/src/commands/add.js.map +1 -1
  8. package/dist/src/commands/hook.d.ts +5 -4
  9. package/dist/src/commands/hook.d.ts.map +1 -1
  10. package/dist/src/commands/hook.js +7 -75
  11. package/dist/src/commands/hook.js.map +1 -1
  12. package/dist/src/commands/init.js +1 -1
  13. package/dist/src/commands/init.js.map +1 -1
  14. package/dist/src/commands/layout.d.ts +5 -4
  15. package/dist/src/commands/layout.d.ts.map +1 -1
  16. package/dist/src/commands/layout.js +7 -75
  17. package/dist/src/commands/layout.js.map +1 -1
  18. package/dist/src/commands/provider.d.ts +5 -4
  19. package/dist/src/commands/provider.d.ts.map +1 -1
  20. package/dist/src/commands/provider.js +7 -75
  21. package/dist/src/commands/provider.js.map +1 -1
  22. package/dist/src/commands/update.d.ts.map +1 -1
  23. package/dist/src/commands/update.js +78 -43
  24. package/dist/src/commands/update.js.map +1 -1
  25. package/dist/src/commands/utils.d.ts +5 -4
  26. package/dist/src/commands/utils.d.ts.map +1 -1
  27. package/dist/src/commands/utils.js +7 -80
  28. package/dist/src/commands/utils.js.map +1 -1
  29. package/dist/src/shared/addFromRegistry.d.ts +16 -0
  30. package/dist/src/shared/addFromRegistry.d.ts.map +1 -0
  31. package/dist/src/shared/addFromRegistry.js +88 -0
  32. package/dist/src/shared/addFromRegistry.js.map +1 -0
  33. package/dist/src/shared/getInstallCommand.d.ts.map +1 -1
  34. package/dist/src/shared/getInstallCommand.js +5 -0
  35. package/dist/src/shared/getInstallCommand.js.map +1 -1
  36. package/dist/src/shared/installDependencies.d.ts +0 -10
  37. package/dist/src/shared/installDependencies.d.ts.map +1 -1
  38. package/dist/src/shared/installDependencies.js +0 -17
  39. package/dist/src/shared/installDependencies.js.map +1 -1
  40. package/dist/src/shared/installFromPlan.d.ts +7 -5
  41. package/dist/src/shared/installFromPlan.d.ts.map +1 -1
  42. package/dist/src/shared/installFromPlan.js +103 -36
  43. package/dist/src/shared/installFromPlan.js.map +1 -1
  44. package/dist/src/shared/loadRegistry.d.ts +12 -3
  45. package/dist/src/shared/loadRegistry.d.ts.map +1 -1
  46. package/dist/src/shared/loadRegistry.js +19 -20
  47. package/dist/src/shared/loadRegistry.js.map +1 -1
  48. package/dist/src/shared/registryClient.d.ts +19 -0
  49. package/dist/src/shared/registryClient.d.ts.map +1 -0
  50. package/dist/src/shared/registryClient.js +128 -0
  51. package/dist/src/shared/registryClient.js.map +1 -0
  52. package/dist/src/shared/resolveEntry.d.ts +10 -7
  53. package/dist/src/shared/resolveEntry.d.ts.map +1 -1
  54. package/dist/src/shared/resolveEntry.js +18 -13
  55. package/dist/src/shared/resolveEntry.js.map +1 -1
  56. package/dist/src/shared/suggestOtherCommand.d.ts +7 -1
  57. package/dist/src/shared/suggestOtherCommand.d.ts.map +1 -1
  58. package/dist/src/shared/suggestOtherCommand.js +29 -23
  59. package/dist/src/shared/suggestOtherCommand.js.map +1 -1
  60. package/dist/src/types/main.d.ts +31 -2
  61. package/dist/src/types/main.d.ts.map +1 -1
  62. package/package.json +6 -11
  63. package/apps/lib/components/ActionButton.tsx +0 -93
  64. package/apps/lib/components/ActionsGroup.tsx +0 -27
  65. package/apps/lib/components/AlertDialog.tsx +0 -204
  66. package/apps/lib/components/Avatar.tsx +0 -46
  67. package/apps/lib/components/Badge.tsx +0 -250
  68. package/apps/lib/components/BadgeField.tsx +0 -403
  69. package/apps/lib/components/Breadcrumb.tsx +0 -280
  70. package/apps/lib/components/Button.tsx +0 -325
  71. package/apps/lib/components/ButtonGroup.tsx +0 -190
  72. package/apps/lib/components/Calendar.tsx +0 -115
  73. package/apps/lib/components/Card.tsx +0 -95
  74. package/apps/lib/components/Checkbox.tsx +0 -42
  75. package/apps/lib/components/ColorPicker.tsx +0 -441
  76. package/apps/lib/components/ConclusionHeader.tsx +0 -148
  77. package/apps/lib/components/ContextMenu.tsx +0 -571
  78. package/apps/lib/components/CountBadge.tsx +0 -52
  79. package/apps/lib/components/DataTable.tsx +0 -213
  80. package/apps/lib/components/DataViews/badge.ts +0 -49
  81. package/apps/lib/components/DataViews/cell.tsx +0 -324
  82. package/apps/lib/components/DataViews/context.ts +0 -144
  83. package/apps/lib/components/DataViews/data-views.tsx +0 -395
  84. package/apps/lib/components/DataViews/filters/children.tsx +0 -98
  85. package/apps/lib/components/DataViews/filters/custom.tsx +0 -34
  86. package/apps/lib/components/DataViews/filters/filters.tsx +0 -157
  87. package/apps/lib/components/DataViews/filters/index.ts +0 -4
  88. package/apps/lib/components/DataViews/filters/labelled.tsx +0 -20
  89. package/apps/lib/components/DataViews/filters/presets.tsx +0 -65
  90. package/apps/lib/components/DataViews/filters/sync.tsx +0 -35
  91. package/apps/lib/components/DataViews/filters/values.ts +0 -173
  92. package/apps/lib/components/DataViews/header.tsx +0 -220
  93. package/apps/lib/components/DataViews/hooks/index.ts +0 -5
  94. package/apps/lib/components/DataViews/hooks/useActiveRow.ts +0 -22
  95. package/apps/lib/components/DataViews/hooks/useControllable.ts +0 -52
  96. package/apps/lib/components/DataViews/index.ts +0 -88
  97. package/apps/lib/components/DataViews/panel/columns.tsx +0 -153
  98. package/apps/lib/components/DataViews/panel/controls.tsx +0 -106
  99. package/apps/lib/components/DataViews/panel/index.ts +0 -3
  100. package/apps/lib/components/DataViews/panel/panel.tsx +0 -164
  101. package/apps/lib/components/DataViews/panel/saved-views.tsx +0 -67
  102. package/apps/lib/components/DataViews/panel/section.tsx +0 -81
  103. package/apps/lib/components/DataViews/panel/sort.tsx +0 -42
  104. package/apps/lib/components/DataViews/panel/tab.tsx +0 -31
  105. package/apps/lib/components/DataViews/slots.ts +0 -72
  106. package/apps/lib/components/DataViews/states.tsx +0 -73
  107. package/apps/lib/components/DataViews/types.ts +0 -510
  108. package/apps/lib/components/DataViews/views/board-view.tsx +0 -381
  109. package/apps/lib/components/DataViews/views/card-rows.tsx +0 -36
  110. package/apps/lib/components/DataViews/views/inbox-view.tsx +0 -260
  111. package/apps/lib/components/DataViews/views/pane-views.tsx +0 -196
  112. package/apps/lib/components/DataViews/views/table-view.tsx +0 -493
  113. package/apps/lib/components/DataViews/views/tree-view.tsx +0 -367
  114. package/apps/lib/components/DatePicker.tsx +0 -232
  115. package/apps/lib/components/Dialog.tsx +0 -116
  116. package/apps/lib/components/Divider.tsx +0 -28
  117. package/apps/lib/components/Drawer.tsx +0 -451
  118. package/apps/lib/components/DropdownMenu.tsx +0 -554
  119. package/apps/lib/components/FieldHint.tsx +0 -69
  120. package/apps/lib/components/Form.tsx +0 -182
  121. package/apps/lib/components/FormBuilder/context.ts +0 -85
  122. package/apps/lib/components/FormBuilder/field-kind.ts +0 -28
  123. package/apps/lib/components/FormBuilder/fields/ChoiceFields.tsx +0 -60
  124. package/apps/lib/components/FormBuilder/fields/ColorField.tsx +0 -59
  125. package/apps/lib/components/FormBuilder/fields/CustomField.tsx +0 -11
  126. package/apps/lib/components/FormBuilder/fields/DateField.tsx +0 -32
  127. package/apps/lib/components/FormBuilder/fields/FieldArray.tsx +0 -74
  128. package/apps/lib/components/FormBuilder/fields/FieldShell.tsx +0 -168
  129. package/apps/lib/components/FormBuilder/fields/FileField.tsx +0 -39
  130. package/apps/lib/components/FormBuilder/fields/OptionListFields.tsx +0 -132
  131. package/apps/lib/components/FormBuilder/fields/OtpField.tsx +0 -31
  132. package/apps/lib/components/FormBuilder/fields/PhoneField.tsx +0 -109
  133. package/apps/lib/components/FormBuilder/fields/RichTextEditorField.tsx +0 -31
  134. package/apps/lib/components/FormBuilder/fields/SelectField.tsx +0 -114
  135. package/apps/lib/components/FormBuilder/fields/SignatureField.tsx +0 -157
  136. package/apps/lib/components/FormBuilder/fields/SliderField.tsx +0 -67
  137. package/apps/lib/components/FormBuilder/fields/SwitchBoxField.tsx +0 -41
  138. package/apps/lib/components/FormBuilder/fields/TableField.tsx +0 -336
  139. package/apps/lib/components/FormBuilder/fields/TextField.tsx +0 -213
  140. package/apps/lib/components/FormBuilder/fields/TreeSelectField.tsx +0 -43
  141. package/apps/lib/components/FormBuilder/fields/countries.ts +0 -303
  142. package/apps/lib/components/FormBuilder/fields/index.ts +0 -25
  143. package/apps/lib/components/FormBuilder/form-builder.tsx +0 -198
  144. package/apps/lib/components/FormBuilder/index.ts +0 -31
  145. package/apps/lib/components/FormBuilder/numberFormat.ts +0 -16
  146. package/apps/lib/components/FormBuilder/submit.tsx +0 -67
  147. package/apps/lib/components/FormBuilder/types.ts +0 -316
  148. package/apps/lib/components/FormRenderer/FormDrawer.tsx +0 -250
  149. package/apps/lib/components/FormRenderer/detail.tsx +0 -256
  150. package/apps/lib/components/FormRenderer/form-renderer.tsx +0 -358
  151. package/apps/lib/components/FormRenderer/header.tsx +0 -88
  152. package/apps/lib/components/FormRenderer/index.ts +0 -17
  153. package/apps/lib/components/FormRenderer/notch-action.tsx +0 -64
  154. package/apps/lib/components/FormRenderer/section.tsx +0 -39
  155. package/apps/lib/components/FormRenderer/stepper.tsx +0 -393
  156. package/apps/lib/components/FormRenderer/types.ts +0 -115
  157. package/apps/lib/components/FormSummary.tsx +0 -282
  158. package/apps/lib/components/HeaderBar.tsx +0 -117
  159. package/apps/lib/components/ImageAttachment.tsx +0 -209
  160. package/apps/lib/components/InnerLabelField.tsx +0 -154
  161. package/apps/lib/components/Input.tsx +0 -224
  162. package/apps/lib/components/InputField.tsx +0 -147
  163. package/apps/lib/components/InputOTP.tsx +0 -84
  164. package/apps/lib/components/Label.tsx +0 -129
  165. package/apps/lib/components/LabelField.tsx +0 -76
  166. package/apps/lib/components/LabeledCheckBox.tsx +0 -51
  167. package/apps/lib/components/LabeledRadio.tsx +0 -51
  168. package/apps/lib/components/LinkButton.tsx +0 -94
  169. package/apps/lib/components/LoginButton.tsx +0 -51
  170. package/apps/lib/components/PasswordLevel.tsx +0 -58
  171. package/apps/lib/components/Popover.tsx +0 -312
  172. package/apps/lib/components/ProfileMenu.tsx +0 -85
  173. package/apps/lib/components/Radio.tsx +0 -59
  174. package/apps/lib/components/RadioCard.tsx +0 -50
  175. package/apps/lib/components/ScrollArea.tsx +0 -54
  176. package/apps/lib/components/SearchField.tsx +0 -62
  177. package/apps/lib/components/SearchableSelect.tsx +0 -318
  178. package/apps/lib/components/SearchableTable.tsx +0 -344
  179. package/apps/lib/components/SearchableTree.tsx +0 -485
  180. package/apps/lib/components/SearchableTreeDialog.tsx +0 -502
  181. package/apps/lib/components/SectionBlock.tsx +0 -168
  182. package/apps/lib/components/Select.tsx +0 -347
  183. package/apps/lib/components/SimpleSelect.tsx +0 -225
  184. package/apps/lib/components/Skeleton.tsx +0 -12
  185. package/apps/lib/components/SlideDatePicker.tsx +0 -255
  186. package/apps/lib/components/SpinLoading.tsx +0 -174
  187. package/apps/lib/components/Stepper.tsx +0 -480
  188. package/apps/lib/components/Switch.tsx +0 -82
  189. package/apps/lib/components/TabFormItem.tsx +0 -153
  190. package/apps/lib/components/TabSwitch.tsx +0 -172
  191. package/apps/lib/components/Table.tsx +0 -597
  192. package/apps/lib/components/TextEditor/ChartBlockTool.ts +0 -676
  193. package/apps/lib/components/TextEditor/RichTextField.tsx +0 -46
  194. package/apps/lib/components/TextEditor/TableDnDWrapper.ts +0 -462
  195. package/apps/lib/components/TextEditor/TextEditor.tsx +0 -1164
  196. package/apps/lib/components/TextEditor/TextEditorToolbar.tsx +0 -429
  197. package/apps/lib/components/TextEditor/editor-tools/AlignmentTune.ts +0 -70
  198. package/apps/lib/components/TextEditor/editor-tools/ColorInlineTool.ts +0 -50
  199. package/apps/lib/components/TextEditor/editor-tools/StrikethroughInlineTool.ts +0 -48
  200. package/apps/lib/components/TextEditor/editor-tools/inlineFormat.ts +0 -98
  201. package/apps/lib/components/TextEditor/editorjs.d.ts +0 -60
  202. package/apps/lib/components/TextEditor/index.ts +0 -7
  203. package/apps/lib/components/TextEditor/markdownParser.ts +0 -346
  204. package/apps/lib/components/Textarea.tsx +0 -117
  205. package/apps/lib/components/Timeline.tsx +0 -263
  206. package/apps/lib/components/Toast.tsx +0 -87
  207. package/apps/lib/components/Toggle.tsx +0 -125
  208. package/apps/lib/components/ToggleButton.tsx +0 -140
  209. package/apps/lib/components/Tooltip.tsx +0 -116
  210. package/apps/lib/components/TransparentLabel.tsx +0 -71
  211. package/apps/lib/components/TreeDropDown.tsx +0 -115
  212. package/apps/lib/components/TreeFolder/TreeFolder.tsx +0 -380
  213. package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +0 -75
  214. package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +0 -354
  215. package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +0 -60
  216. package/apps/lib/components/TreeFolder/icons.tsx +0 -60
  217. package/apps/lib/components/TreeFolder/index.ts +0 -24
  218. package/apps/lib/components/TreeFolder/treeFolderUtils.ts +0 -109
  219. package/apps/lib/components/TreeFolder/types.ts +0 -77
  220. package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +0 -118
  221. package/apps/lib/hooks/useActiveTreeItem.ts +0 -61
  222. package/apps/lib/hooks/useClickOutside.ts +0 -27
  223. package/apps/lib/hooks/useDragDrop.tsx +0 -365
  224. package/apps/lib/hooks/useHtmlDir.ts +0 -31
  225. package/apps/lib/hooks/useInfiniteScroll.ts +0 -108
  226. package/apps/lib/hooks/useIsMobile.ts +0 -21
  227. package/apps/lib/hooks/useResize.ts +0 -67
  228. package/apps/lib/hooks/useTagSelection.ts +0 -300
  229. package/apps/lib/layouts/CNLayout.tsx +0 -372
  230. package/apps/lib/layouts/DataViewCard.tsx +0 -62
  231. package/apps/lib/layouts/FieldSection.tsx +0 -91
  232. package/apps/lib/layouts/TreeSubLayout.tsx +0 -173
  233. package/apps/lib/providers/ThemeProvider.tsx +0 -84
  234. package/apps/lib/registry.json +0 -1217
  235. package/apps/lib/tsconfig.json +0 -9
  236. package/apps/lib/tsconfig.tsbuildinfo +0 -1
  237. package/apps/lib/utils/cn.ts +0 -6
  238. package/apps/lib/utils/color.ts +0 -175
  239. package/apps/lib/utils/dataViews/path.ts +0 -67
  240. package/apps/lib/utils/dataViews/query.ts +0 -73
  241. package/apps/lib/utils/dataViews/types.ts +0 -187
  242. package/apps/lib/utils/dateFormat.ts +0 -108
  243. package/apps/lib/utils/resize.ts +0 -31
  244. package/apps/lib/utils/scroller.ts +0 -26
  245. package/apps/lib/utils/types.ts +0 -16
  246. package/docs/BLOCKS.md +0 -129
  247. package/docs/CHANGELOG-1.1.16.md +0 -108
  248. package/docs/Cover.png +0 -0
  249. package/docs/README.md +0 -215
  250. package/docs/components/action-button.md +0 -638
  251. package/docs/components/actions-group.md +0 -708
  252. package/docs/components/alert-dialog.md +0 -920
  253. package/docs/components/avatar.md +0 -709
  254. package/docs/components/badge-field.md +0 -738
  255. package/docs/components/badge.md +0 -301
  256. package/docs/components/breadcrumb.md +0 -930
  257. package/docs/components/button-group.md +0 -650
  258. package/docs/components/button.md +0 -639
  259. package/docs/components/calendar.md +0 -555
  260. package/docs/components/card.md +0 -622
  261. package/docs/components/chart-block-tool.md +0 -129
  262. package/docs/components/checkbox.md +0 -699
  263. package/docs/components/cn-layout.md +0 -854
  264. package/docs/components/color-picker.md +0 -101
  265. package/docs/components/conclusion-header.md +0 -80
  266. package/docs/components/context-menu.md +0 -483
  267. package/docs/components/count-badge.md +0 -560
  268. package/docs/components/data-table.md +0 -854
  269. package/docs/components/data-views/backend-response.md +0 -324
  270. package/docs/components/data-views/examples/a11y-rtl.md +0 -250
  271. package/docs/components/data-views/examples/api-orders-route.md +0 -130
  272. package/docs/components/data-views/examples/fields.md +0 -362
  273. package/docs/components/data-views/examples/filters.md +0 -307
  274. package/docs/components/data-views/examples/inbox-routing.md +0 -218
  275. package/docs/components/data-views/examples/index.md +0 -29
  276. package/docs/components/data-views/examples/overview.md +0 -244
  277. package/docs/components/data-views/examples/panel.md +0 -212
  278. package/docs/components/data-views/examples/scale.md +0 -231
  279. package/docs/components/data-views/examples/server-side.md +0 -210
  280. package/docs/components/data-views/examples/state.md +0 -250
  281. package/docs/components/data-views/examples/tree-custom.md +0 -388
  282. package/docs/components/data-views/examples/view-registry.md +0 -313
  283. package/docs/components/data-views/examples/views.md +0 -534
  284. package/docs/components/data-views/guide.md +0 -405
  285. package/docs/components/data-views/index.md +0 -1521
  286. package/docs/components/data-views/migration.md +0 -81
  287. package/docs/components/date-picker.md +0 -857
  288. package/docs/components/dialog.md +0 -929
  289. package/docs/components/divider.md +0 -766
  290. package/docs/components/drawer.md +0 -654
  291. package/docs/components/dropdown-menu.md +0 -668
  292. package/docs/components/field-hint.md +0 -898
  293. package/docs/components/field-section.md +0 -781
  294. package/docs/components/form-builder.md +0 -284
  295. package/docs/components/form-renderer.md +0 -396
  296. package/docs/components/form-summary.md +0 -138
  297. package/docs/components/form.md +0 -785
  298. package/docs/components/header-bar.md +0 -188
  299. package/docs/components/image-attachment.md +0 -906
  300. package/docs/components/inner-label-field.md +0 -819
  301. package/docs/components/input-field.md +0 -623
  302. package/docs/components/input-otp.md +0 -756
  303. package/docs/components/input.md +0 -634
  304. package/docs/components/label-field.md +0 -770
  305. package/docs/components/label.md +0 -761
  306. package/docs/components/labeled-check-box.md +0 -642
  307. package/docs/components/labeled-radio.md +0 -796
  308. package/docs/components/link-button.md +0 -685
  309. package/docs/components/login-button.md +0 -872
  310. package/docs/components/password-level.md +0 -803
  311. package/docs/components/popover.md +0 -649
  312. package/docs/components/profile-menu.md +0 -656
  313. package/docs/components/radio-card.md +0 -801
  314. package/docs/components/radio.md +0 -735
  315. package/docs/components/scroll-area.md +0 -691
  316. package/docs/components/search-field.md +0 -702
  317. package/docs/components/searchable-select.md +0 -368
  318. package/docs/components/searchable-table.md +0 -438
  319. package/docs/components/searchable-tree-dialog.md +0 -190
  320. package/docs/components/searchable-tree.md +0 -200
  321. package/docs/components/section-block.md +0 -483
  322. package/docs/components/select.md +0 -709
  323. package/docs/components/simple-select.md +0 -741
  324. package/docs/components/skeleton.md +0 -706
  325. package/docs/components/slide-date-picker.md +0 -837
  326. package/docs/components/spin-loading.md +0 -696
  327. package/docs/components/stepper.md +0 -316
  328. package/docs/components/switch.md +0 -770
  329. package/docs/components/tab-form-item.md +0 -773
  330. package/docs/components/tab-switch.md +0 -170
  331. package/docs/components/table-dnd-wrapper.md +0 -107
  332. package/docs/components/table.md +0 -1088
  333. package/docs/components/text-editor.md +0 -735
  334. package/docs/components/textarea.md +0 -681
  335. package/docs/components/timeline.md +0 -254
  336. package/docs/components/toast.md +0 -773
  337. package/docs/components/toggle-button.md +0 -643
  338. package/docs/components/toggle.md +0 -882
  339. package/docs/components/tooltip.md +0 -513
  340. package/docs/components/transparent-label.md +0 -721
  341. package/docs/components/tree-drop-down.md +0 -740
  342. package/docs/components/tree-folder.md +0 -110
  343. package/docs/components/tree-sub-layout.md +0 -707
  344. package/docs/explanation/architecture.md +0 -54
  345. package/docs/explanation/design-system.md +0 -52
  346. package/docs/how-to/form-and-list-recipes.md +0 -386
  347. package/docs/how-to/forms-with-form-builder.md +0 -472
  348. package/docs/how-to/guides.md +0 -1027
  349. package/docs/migration/changelog.md +0 -60
  350. package/docs/migration/form-builder-2.5.2.md +0 -113
  351. package/docs/reference/cli.md +0 -112
  352. package/docs/reference/components.md +0 -572
  353. package/docs/reference/hooks.md +0 -1523
  354. package/docs/reference/providers.md +0 -866
  355. package/docs/reference/tailwind-plugins.md +0 -942
  356. package/docs/reference/theme.md +0 -85
  357. package/docs/reference/types.md +0 -1016
  358. package/docs/reference/utilities.md +0 -726
  359. package/docs/tutorials/building-first-form.md +0 -846
  360. package/docs/tutorials/component-composition.md +0 -882
  361. package/docs/tutorials/getting-started.md +0 -302
  362. package/docs/tutorials/theming-basics.md +0 -785
@@ -5,6 +5,10 @@ import { CONFIG_FILE } from "./init.js";
5
5
  import { tailwindInit } from "../shared/tailwindInit.js";
6
6
  import readline from "readline";
7
7
  import { getAvailableFiles } from "../shared/getAvailableFiles.js";
8
+ import { loadRegistry } from "../shared/loadRegistry.js";
9
+ import { RegistryError } from "../shared/registryClient.js";
10
+ import { resolveEntry } from "../shared/resolveEntry.js";
11
+ import { namesOfType } from "../shared/addFromRegistry.js";
8
12
  import { add } from "./add.js";
9
13
  import { addHook } from "./hook.js";
10
14
  import { addUtil } from "./utils.js";
@@ -30,62 +34,93 @@ export async function updateInstalledComponents() {
30
34
  console.log("Update cancelled.");
31
35
  return;
32
36
  }
33
- // Update components
34
- await updateItems("components", targetFile);
35
- // Update hooks
36
- await updateItems("hooks", targetFile);
37
- // Update utils
38
- await updateItems("utils", targetFile);
39
- // Update providers
40
- await updateItems("providers", targetFile);
41
- // Update layouts
42
- await updateItems("layouts", targetFile);
37
+ // Fetched once, up front: every `updateItems` pass needs it to tell our items apart from
38
+ // yours, and loadRegistry caches per process anyway.
39
+ let registry;
40
+ try {
41
+ registry = await loadRegistry();
42
+ }
43
+ catch (error) {
44
+ if (error instanceof RegistryError) {
45
+ console.error(`❌ ${error.message}`);
46
+ process.exitCode = 1;
47
+ return;
48
+ }
49
+ throw error;
50
+ }
51
+ let untouched = 0;
52
+ for (const type of ["components", "hooks", "utils", "providers", "layouts"]) {
53
+ untouched += await updateItems(type, targetFile, registry);
54
+ }
55
+ // Your own files live in the same folders as ours, so say plainly that they were left alone
56
+ // rather than leaving you to wonder why the counts do not add up.
57
+ if (untouched > 0) {
58
+ console.log(`ℹ️ Left ${untouched} file(s) alone — not TORCH Glare items.`);
59
+ }
43
60
  // Reinitialize Tailwind CSS configuration
44
61
  tailwindInit();
45
62
  console.log("✅ All installed items have been updated.");
46
63
  }
47
64
  /**
48
- * Update items (components, hooks, or utils) by syncing them with the latest templates.
49
- * @param {string} type - The type of items to update (e.g., "components", "hooks", "utils").
50
- * @param {object} config - Configuration object.
65
+ * Re-install the registry items of one type that this project already has.
66
+ *
67
+ * The install directory is **yours**, not ours: `src/components` holds your components alongside
68
+ * the ones Glare installed. Updating used to hand every filename in it to `add`, so each of your
69
+ * own files produced a "not found" error — 22 of them in the Glare website, 8 in products-services
70
+ * — and, once `add` started exiting non-zero on a miss, made a successful update look like a
71
+ * failure. Only names the registry actually contains are ours to update.
72
+ *
73
+ * @returns how many local files were left alone.
51
74
  */
52
- async function updateItems(type, config) {
75
+ async function updateItems(type, config, registry) {
53
76
  const installedItemsDir = getInstalledItemsDir(config, type);
54
77
  // Exit if no installed items are found
55
78
  if (!checkIfItemsExist(installedItemsDir, type)) {
56
- return;
79
+ return 0;
57
80
  }
58
- // Get the list of installed items
59
- const installedItems = getAvailableFiles(installedItemsDir);
60
- // Exit if there are no items to update
61
- if (installedItems.length === 0) {
81
+ // Keep only what the registry knows about; the rest of the folder is the project's own.
82
+ //
83
+ // Deduplicated, because several local entries can resolve to one registry item. A project that
84
+ // installed `TextEditor` back when it was a single file, and again after it became a folder,
85
+ // has both `TextEditor.tsx` and `TextEditor/` sitting there — and updating it twice is wasted
86
+ // work and a confusing duplicate line in the output.
87
+ const known = namesOfType(registry, type);
88
+ const present = getAvailableFiles(installedItemsDir);
89
+ const resolved = new Set();
90
+ let untouched = 0;
91
+ for (const entry of present) {
92
+ const match = resolveEntry(entry, known);
93
+ if (match)
94
+ resolved.add(match);
95
+ else
96
+ untouched++;
97
+ }
98
+ const ours = [...resolved];
99
+ if (ours.length === 0) {
62
100
  console.log(`✅ No ${type} to update.`);
63
- return;
101
+ return untouched;
64
102
  }
65
103
  console.log(`🔄 Updating installed ${type}...`);
66
- // Update each installed item
67
- installedItems.forEach((item) => {
68
- switch (type) {
69
- case "components":
70
- add(item, true);
71
- break;
72
- case "hooks":
73
- addHook(item, true);
74
- break;
75
- case "utils":
76
- addUtil(item, true);
77
- break;
78
- case "providers":
79
- addProvider(item, true);
80
- break;
81
- case "layouts":
82
- addLayout(item, true);
83
- break;
84
- default:
85
- console.log(`❌ Unknown item type: ${type}`);
86
- break;
87
- }
88
- });
104
+ const installers = {
105
+ components: add,
106
+ hooks: addHook,
107
+ utils: addUtil,
108
+ providers: addProvider,
109
+ layouts: addLayout,
110
+ };
111
+ const install = installers[type];
112
+ if (!install) {
113
+ console.log(`❌ Unknown item type: ${type}`);
114
+ return untouched;
115
+ }
116
+ // Sequentially, and awaited. This was a `forEach` over async calls with no `await`, so every
117
+ // item installed at once, out of order, with each rejection unhandled. Copying local files
118
+ // mostly survived that; fetching over HTTP would not — it opens one connection per installed
119
+ // item and races several npm invocations against each other in the same project.
120
+ for (const item of ours) {
121
+ await install(item, true);
122
+ }
123
+ return untouched;
89
124
  }
90
125
  /**
91
126
  * Get the directory path for installed items (components, hooks, or utils).
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../cli/src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB;IAC3C,MAAM,UAAU,GAAG,SAAS,CAAC,WAAW,CAAW,CAAC;IAEpD,+CAA+C;IAC/C,MAAM,EAAE,GAA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AAE,OAAO;QACd,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,SAAS;KACrB,CAAC;IAEF,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAC;QAC5C,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,6FAA6F;IAC7F,2FAA2F;IAC3F,6FAA6F;IAC7F,iFAAiF;IACjF,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,MAAW,EAAE,IAAY;IACnD,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,iBAAyB,EAAE,IAAY;IAC9D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,SAAS,CAAC,CAAC;QAC7C,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}
@@ -1,7 +1,8 @@
1
1
  /**
2
- * Main function to add a utility file and its dependencies.
3
- * @param {string} util - The name of the utility file to add.
4
- * @param {boolean} replace - Whether to replace the existing utility file.
2
+ * Add a util and everything it needs.
3
+ *
4
+ * @param {string} name - The name of the util to add.
5
+ * @param {boolean} replace - Overwrite what is already there, dependencies included.
5
6
  */
6
- export declare function addUtil(util?: string, replace?: boolean): Promise<void>;
7
+ export declare function addUtil(name?: string, replace?: boolean): Promise<void>;
7
8
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../cli/src/commands/utils.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA6CpF"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../cli/src/commands/utils.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpF"}
@@ -1,84 +1,11 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { getConfig } from "../shared/getConfig.js";
4
- import { CONFIG_FILE } from "./init.js";
5
- import { fileURLToPath } from "url";
6
- import { ensureDirectoryExists } from "../shared/ensureDirectoryExists.js";
7
- import { getInstallPaths } from "../shared/getInstallPaths.js";
8
- import inquirer from "inquirer";
9
- import { copyComponentsRecursively } from "../shared/copyComponentsRecursively.js";
10
- import { installFromPlan, reportInstall } from "../shared/installFromPlan.js";
11
- import { isInstalled, resolveEntry } from "../shared/resolveEntry.js";
12
- const __filename = fileURLToPath(import.meta.url);
13
- const __dirname = path.dirname(__filename);
14
- // Define the path to the utils templates directory
15
- const utilsTemplatesDir = path.resolve(__dirname, "../../../apps/lib/utils");
1
+ import { addFromRegistry } from "../shared/addFromRegistry.js";
16
2
  /**
17
- * Main function to add a utility file and its dependencies.
18
- * @param {string} util - The name of the utility file to add.
19
- * @param {boolean} replace - Whether to replace the existing utility file.
3
+ * Add a util and everything it needs.
4
+ *
5
+ * @param {string} name - The name of the util to add.
6
+ * @param {boolean} replace - Overwrite what is already there, dependencies included.
20
7
  */
21
- export async function addUtil(util, replace = false) {
22
- const targetFile = getConfig(CONFIG_FILE);
23
- const availableUtils = getAvailableUtils(utilsTemplatesDir);
24
- // If no utility file is provided, prompt the user to select one
25
- if (!util) {
26
- util = await promptUtilSelection(availableUtils);
27
- }
28
- // Resolve user input — accepts "cn", "cn.ts", or a folder name like "dataViews".
29
- const resolved = resolveEntry(util, availableUtils, utilsTemplatesDir);
30
- if (!resolved) {
31
- console.error(`❌ Utility file "${util}" not found.`);
32
- return;
33
- }
34
- util = resolved;
35
- // The registry resolves the whole graph in one pass, so `replace` reaches every item.
36
- const name = resolved.replace(/\.(tsx|ts)$/, "");
37
- const result = installFromPlan("utils", name, targetFile, replace);
38
- if (result) {
39
- reportInstall(resolved, result, targetFile.path);
40
- return;
41
- }
42
- // Not in registry.json — copy it alone, and say why the dependencies were not resolved.
43
- console.warn(`⚠️ "${resolved}" is not in registry.json, so its dependencies cannot be resolved.\n` +
44
- ` Copying the file only. Re-run \`pnpm run registry\` in the library to fix this.`);
45
- const { source, targetDir } = getInstallPaths(util, targetFile, utilsTemplatesDir, "utils");
46
- // Check *before* removing anything. This used to `rmSync` the target first, which made the
47
- // check below permanently false — so every visit re-copied the file and re-printed the success
48
- // line, which is why one `add` reported "cn.ts has been added" five times.
49
- if (isInstalled(targetDir, util) && !replace) {
50
- console.log(`⚠️ Utility file "${util}" already exists.`);
51
- return;
52
- }
53
- const target = path.join(targetDir, util);
54
- if (fs.existsSync(target))
55
- fs.rmSync(target, { recursive: true, force: true });
56
- ensureDirectoryExists(targetDir);
57
- copyComponentsRecursively(source, target);
58
- console.log(`✅ ${util} has been added to ${targetFile.path}!`);
59
- }
60
- /**
61
- * Get a list of available utility files from the utils templates directory.
62
- * @param {string} utilsTemplatesDir - Path to the utils templates directory.
63
- * @returns {string[]} - Array of utility file names.
64
- */
65
- function getAvailableUtils(utilsTemplatesDir) {
66
- return fs.readdirSync(utilsTemplatesDir).map((file) => path.basename(file));
67
- }
68
- /**
69
- * Prompt the user to select a utility file from a list.
70
- * @param {string[]} availableUtils - Array of available utility files.
71
- * @returns {string} - The selected utility file.
72
- */
73
- async function promptUtilSelection(availableUtils) {
74
- const { selectedUtil } = await inquirer.prompt([
75
- {
76
- type: "list",
77
- name: "selectedUtil",
78
- message: "Which utility file would you like to add?",
79
- choices: availableUtils,
80
- },
81
- ]);
82
- return selectedUtil;
8
+ export async function addUtil(name, replace = false) {
9
+ await addFromRegistry("utils", name, replace);
83
10
  }
84
11
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../cli/src/commands/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACtE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,mDAAmD;AACnD,MAAM,iBAAiB,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;AAErF;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,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@
1
+ import type { Registry, RegistryItem } from "../types/main.js";
2
+ type ItemType = RegistryItem["type"];
3
+ /**
4
+ * The body shared by `add`, `hook`, `util`, `layout` and `provider`.
5
+ *
6
+ * These were five near-identical copies of the same six steps, each with its own private
7
+ * `readdirSync` of a templates directory and its own verbatim copy of a ~15-line "not in the
8
+ * registry" fallback. That fallback existed because the CLI listed the filesystem and the registry
9
+ * could disagree with it; the registry is now the only source of truth for what exists, so the
10
+ * disagreement — and the fallback — cannot happen.
11
+ */
12
+ export declare function addFromRegistry(type: ItemType, requested: string | undefined, force: boolean): Promise<void>;
13
+ /** Installable names of one type, sorted for a stable prompt. */
14
+ export declare function namesOfType(registry: Registry, type: ItemType): string[];
15
+ export {};
16
+ //# sourceMappingURL=addFromRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addFromRegistry.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/addFromRegistry.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAU,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEvE,KAAK,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAUrC;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACjC,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,OAAO,GACf,OAAO,CAAC,IAAI,CAAC,CA2Cf;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,CAKxE"}
@@ -0,0 +1,88 @@
1
+ import inquirer from "inquirer";
2
+ import { getConfig } from "./getConfig.js";
3
+ import { installFromPlan, reportInstall } from "./installFromPlan.js";
4
+ import { loadRegistry } from "./loadRegistry.js";
5
+ import { RegistryError } from "./registryClient.js";
6
+ import { resolveEntry } from "./resolveEntry.js";
7
+ import { suggestOtherCommand } from "./suggestOtherCommand.js";
8
+ import { CONFIG_FILE } from "../commands/init.js";
9
+ const NOUN_FOR_TYPE = {
10
+ components: "component",
11
+ hooks: "hook",
12
+ utils: "util",
13
+ layouts: "layout",
14
+ providers: "provider",
15
+ };
16
+ /**
17
+ * The body shared by `add`, `hook`, `util`, `layout` and `provider`.
18
+ *
19
+ * These were five near-identical copies of the same six steps, each with its own private
20
+ * `readdirSync` of a templates directory and its own verbatim copy of a ~15-line "not in the
21
+ * registry" fallback. That fallback existed because the CLI listed the filesystem and the registry
22
+ * could disagree with it; the registry is now the only source of truth for what exists, so the
23
+ * disagreement — and the fallback — cannot happen.
24
+ */
25
+ export async function addFromRegistry(type, requested, force) {
26
+ const config = getConfig(CONFIG_FILE);
27
+ try {
28
+ const registry = await loadRegistry();
29
+ const available = namesOfType(registry, type);
30
+ if (available.length === 0) {
31
+ console.error(`❌ The registry lists no ${NOUN_FOR_TYPE[type]}s.`);
32
+ process.exitCode = 1;
33
+ return;
34
+ }
35
+ const name = requested ?? (await promptSelection(type, available));
36
+ const resolved = resolveEntry(name, available);
37
+ if (!resolved) {
38
+ console.error(`❌ ${capitalize(NOUN_FOR_TYPE[type])} "${name}" not found.`);
39
+ // It may well exist under another type. Say which command to use rather than leaving
40
+ // the caller to guess.
41
+ const hint = suggestOtherCommand(registry, name, type);
42
+ if (hint)
43
+ console.error(` ${hint}`);
44
+ // Non-zero so `torch-glare add Buton && next build` stops rather than building
45
+ // against a component that was never installed.
46
+ process.exitCode = 1;
47
+ return;
48
+ }
49
+ const result = await installFromPlan(type, resolved, config, force);
50
+ if (!result) {
51
+ // resolveEntry matched against this same index, so the item is present by construction.
52
+ console.error(`❌ "${resolved}" is in the registry index but has no entry to install.`);
53
+ process.exitCode = 1;
54
+ return;
55
+ }
56
+ reportInstall(resolved, result, config.path);
57
+ }
58
+ catch (error) {
59
+ if (error instanceof RegistryError) {
60
+ console.error(`❌ ${error.message}`);
61
+ process.exitCode = 1;
62
+ return;
63
+ }
64
+ throw error;
65
+ }
66
+ }
67
+ /** Installable names of one type, sorted for a stable prompt. */
68
+ export function namesOfType(registry, type) {
69
+ return registry.items
70
+ .filter((item) => item.type === type)
71
+ .map((item) => item.name)
72
+ .sort((a, b) => a.localeCompare(b));
73
+ }
74
+ async function promptSelection(type, available) {
75
+ const { selected } = await inquirer.prompt([
76
+ {
77
+ type: "list",
78
+ name: "selected",
79
+ message: `Which ${NOUN_FOR_TYPE[type]} would you like to add?`,
80
+ choices: available,
81
+ },
82
+ ]);
83
+ return selected;
84
+ }
85
+ function capitalize(word) {
86
+ return word.charAt(0).toUpperCase() + word.slice(1);
87
+ }
88
+ //# sourceMappingURL=addFromRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addFromRegistry.js","sourceRoot":"","sources":["../../../cli/src/shared/addFromRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKlD,MAAM,aAAa,GAA6B;IAC5C,UAAU,EAAE,WAAW;IACvB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,UAAU;CACxB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACjC,IAAc,EACd,SAA6B,EAC7B,KAAc;IAEd,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,CAAW,CAAC;IAEhD,IAAI,C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ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAU3F"}
1
+ {"version":3,"file":"getInstallCommand.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/getInstallCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAe3F"}
@@ -11,6 +11,11 @@ export function getInstallCommand(packageManager, dependencies) {
11
11
  return `pnpm add ${deps}`;
12
12
  case "yarn":
13
13
  return `yarn add ${deps}`;
14
+ // `detectPackageManager` recognises bun.lockb but there was no case for it here, so a Bun
15
+ // project silently had its dependencies installed by npm — which writes a package-lock.json
16
+ // beside the bun.lockb and leaves the project with two lockfiles disagreeing.
17
+ case "bun":
18
+ return `bun add ${deps}`;
14
19
  default:
15
20
  return `npm install ${deps}`;
16
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getInstallCommand.js","sourceRoot":"","sources":["../../../cli/src/shared/getInstallCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,cAAsB,EAAE,YAAyB;IAC/E,MAAM,IAAI,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,QAAQ,cAAc,EAAE,CAAC;QACrB,KAAK,MAAM;YACP,OAAO,YAAY,IAAI,EAAE,CAAC;QAC9B,KAAK,MAAM;YACP,OAAO,YAAY,IAAI,EAAE,CAAC;QAC9B;YACI,OAAO,eAAe,IAAI,EAAE,CAAC;IACrC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"getInstallCommand.js","sourceRoot":"","sources":["../../../cli/src/shared/getInstallCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,cAAsB,EAAE,YAAyB;IAC/E,MAAM,IAAI,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,QAAQ,cAAc,EAAE,CAAC;QACrB,KAAK,MAAM;YACP,OAAO,YAAY,IAAI,EAAE,CAAC;QAC9B,KAAK,MAAM;YACP,OAAO,YAAY,IAAI,EAAE,CAAC;QAC9B,0FAA0F;QAC1F,4FAA4F;QAC5F,8EAA8E;QAC9E,KAAK,KAAK;YACN,OAAO,WAAW,IAAI,EAAE,CAAC;QAC7B;YACI,OAAO,eAAe,IAAI,EAAE,CAAC;IACrC,CAAC;AACL,CAAC"}
@@ -8,14 +8,4 @@
8
8
  * @returns the packages actually installed.
9
9
  */
10
10
  export declare function installNpmPackages(packages: Iterable<string>): string[];
11
- /**
12
- * Legacy path: resolve a component's dependencies by scanning its imports.
13
- *
14
- * Only reached now for an item that is **not** in `registry.json` — something added to `apps/lib`
15
- * before `pnpm run registry` was re-run. Everything registered goes through `installFromPlan`,
16
- * which resolves the whole graph up front instead of discovering it one file at a time.
17
- *
18
- * @param {string} componentPath - Path to the component file.
19
- */
20
- export declare function installDependencies(componentPath: string): void;
21
11
  //# sourceMappingURL=installDependencies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installDependencies.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/installDependencies.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CA4BvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAW/D"}
1
+ {"version":3,"file":"installDependencies.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/installDependencies.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CA4BvE"}
@@ -1,7 +1,6 @@
1
1
  import { execSync } from "child_process";
2
2
  import { getCurrentInstalledDependencies } from "./getCurrentInstalledDependencies.js";
3
3
  import { detectPackageManager } from "./detectPackageManager.js";
4
- import { getDependenciesAndInstallNestedComponents } from "./getDependenciesAndInstallNestedComponents.js";
5
4
  import { getInstallCommand } from "./getInstallCommand.js";
6
5
  /**
7
6
  * Install a set of npm packages, skipping any the project already has.
@@ -37,20 +36,4 @@ export function installNpmPackages(packages) {
37
36
  return [];
38
37
  }
39
38
  }
40
- /**
41
- * Legacy path: resolve a component's dependencies by scanning its imports.
42
- *
43
- * Only reached now for an item that is **not** in `registry.json` — something added to `apps/lib`
44
- * before `pnpm run registry` was re-run. Everything registered goes through `installFromPlan`,
45
- * which resolves the whole graph up front instead of discovering it one file at a time.
46
- *
47
- * @param {string} componentPath - Path to the component file.
48
- */
49
- export function installDependencies(componentPath) {
50
- const { depsNames } = getCurrentInstalledDependencies();
51
- const dependenciesToInstall = getDependenciesAndInstallNestedComponents(componentPath, depsNames);
52
- if (dependenciesToInstall.size > 0) {
53
- installNpmPackages(dependenciesToInstall);
54
- }
55
- }
56
39
  //# sourceMappingURL=installDependencies.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"installDependencies.js","sourceRoot":"","sources":["../../../cli/src/shared/installDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,yCAAyC,EAAE,MAAM,gDAAgD,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAA0B;IACzD,MAAM,EAAE,SAAS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AC,GAAG,CACP,iBAAiB,OAAO,CAAC,IAAI,6BAA6B,cAAc,GAAG,EAC3E,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC1B,CAAC;IAEF,IAAI,CAAC;QACD,QAAQ,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QAC5E,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC"}
@@ -4,20 +4,22 @@ export interface InstallResult {
4
4
  skipped: string[];
5
5
  npm: string[];
6
6
  }
7
+ /** Where this project's files live — `<cwd>/<glare.json path>`, with a leading "@/" stripped. */
8
+ export declare function installRoot(config: Config): string;
7
9
  /**
8
10
  * Install one registry item and everything it needs.
9
11
  *
10
- * Dependencies come from `apps/lib/registry.json` — the same generated graph the docs and the MCP
11
- * server read — rather than from scanning import statements as files are copied. The old walker had
12
- * no visited set and no cycle guard, and ran once per copied file, so a 35-file component triggered
13
- * 35 recursive walks; worse, a dependency skipped because its folder already existed was never
12
+ * Dependencies come from the registry index — the same generated graph the docs and the MCP server
13
+ * read — rather than from scanning import statements as files are written. The old walker had no
14
+ * visited set and no cycle guard, and ran once per copied file, so a 35-file component triggered 35
15
+ * recursive walks; worse, a dependency skipped because its folder already existed was never
14
16
  * descended into, which silently truncated the tree (`add DataViews` installed 16 of 55 items and
15
17
  * exited 0).
16
18
  *
17
19
  * Resolving up front also gives `force` a coherent meaning: it applies to **every** item in the
18
20
  * plan, not only the one you named.
19
21
  */
20
- export declare function installFromPlan(type: RegistryItem["type"], name: string, config: Config, force: boolean): InstallResult | null;
22
+ export declare function installFromPlan(type: RegistryItem["type"], name: string, config: Config, force: boolean): Promise<InstallResult | null>;
21
23
  /** `✅ 55 installed, 0 skipped` — truncation has to be visible, not inferred from silence. */
22
24
  export declare function reportInstall(name: string, result: InstallResult, where: string): void;
23
25
  //# sourceMappingURL=installFromPlan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installFromPlan.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/installFromPlan.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAO7D,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC3B,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EAC1B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,GACf,aAAa,GAAG,IAAI,CA2CtB;AAED,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CActF"}
1
+ {"version":3,"file":"installFromPlan.d.ts","sourceRoot":"","sources":["../../../cli/src/shared/installFromPlan.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAuB,MAAM,kBAAkB,CAAC;AAElF,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,iGAAiG;AACjG,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACjC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EAC1B,IAAI,EAAE,MAAM,EACZ,MAA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