torch-glare 2.5.5 → 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.
- package/README.md +4 -3
- package/dist/bin/index.js +9 -24
- package/dist/bin/index.js.map +1 -1
- package/dist/src/commands/add.d.ts +2 -2
- package/dist/src/commands/add.d.ts.map +1 -1
- package/dist/src/commands/add.js +4 -70
- package/dist/src/commands/add.js.map +1 -1
- package/dist/src/commands/hook.d.ts +5 -4
- package/dist/src/commands/hook.d.ts.map +1 -1
- package/dist/src/commands/hook.js +7 -75
- package/dist/src/commands/hook.js.map +1 -1
- package/dist/src/commands/init.js +1 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/layout.d.ts +5 -4
- package/dist/src/commands/layout.d.ts.map +1 -1
- package/dist/src/commands/layout.js +7 -75
- package/dist/src/commands/layout.js.map +1 -1
- package/dist/src/commands/provider.d.ts +5 -4
- package/dist/src/commands/provider.d.ts.map +1 -1
- package/dist/src/commands/provider.js +7 -75
- package/dist/src/commands/provider.js.map +1 -1
- package/dist/src/commands/update.d.ts.map +1 -1
- package/dist/src/commands/update.js +78 -43
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/utils.d.ts +5 -4
- package/dist/src/commands/utils.d.ts.map +1 -1
- package/dist/src/commands/utils.js +7 -80
- package/dist/src/commands/utils.js.map +1 -1
- package/dist/src/shared/addFromRegistry.d.ts +16 -0
- package/dist/src/shared/addFromRegistry.d.ts.map +1 -0
- package/dist/src/shared/addFromRegistry.js +88 -0
- package/dist/src/shared/addFromRegistry.js.map +1 -0
- package/dist/src/shared/getInstallCommand.d.ts.map +1 -1
- package/dist/src/shared/getInstallCommand.js +5 -0
- package/dist/src/shared/getInstallCommand.js.map +1 -1
- package/dist/src/shared/installDependencies.d.ts +0 -10
- package/dist/src/shared/installDependencies.d.ts.map +1 -1
- package/dist/src/shared/installDependencies.js +0 -17
- package/dist/src/shared/installDependencies.js.map +1 -1
- package/dist/src/shared/installFromPlan.d.ts +7 -5
- package/dist/src/shared/installFromPlan.d.ts.map +1 -1
- package/dist/src/shared/installFromPlan.js +103 -36
- package/dist/src/shared/installFromPlan.js.map +1 -1
- package/dist/src/shared/loadRegistry.d.ts +12 -3
- package/dist/src/shared/loadRegistry.d.ts.map +1 -1
- package/dist/src/shared/loadRegistry.js +19 -20
- package/dist/src/shared/loadRegistry.js.map +1 -1
- package/dist/src/shared/registryClient.d.ts +19 -0
- package/dist/src/shared/registryClient.d.ts.map +1 -0
- package/dist/src/shared/registryClient.js +128 -0
- package/dist/src/shared/registryClient.js.map +1 -0
- package/dist/src/shared/resolveEntry.d.ts +10 -7
- package/dist/src/shared/resolveEntry.d.ts.map +1 -1
- package/dist/src/shared/resolveEntry.js +18 -13
- package/dist/src/shared/resolveEntry.js.map +1 -1
- package/dist/src/shared/suggestOtherCommand.d.ts +7 -1
- package/dist/src/shared/suggestOtherCommand.d.ts.map +1 -1
- package/dist/src/shared/suggestOtherCommand.js +29 -23
- package/dist/src/shared/suggestOtherCommand.js.map +1 -1
- package/dist/src/types/main.d.ts +31 -2
- package/dist/src/types/main.d.ts.map +1 -1
- package/package.json +6 -11
- package/apps/lib/components/ActionButton.tsx +0 -93
- package/apps/lib/components/ActionsGroup.tsx +0 -27
- package/apps/lib/components/AlertDialog.tsx +0 -204
- package/apps/lib/components/Avatar.tsx +0 -46
- package/apps/lib/components/Badge.tsx +0 -250
- package/apps/lib/components/BadgeField.tsx +0 -338
- package/apps/lib/components/Breadcrumb.tsx +0 -280
- package/apps/lib/components/Button.tsx +0 -317
- package/apps/lib/components/ButtonGroup.tsx +0 -190
- package/apps/lib/components/Calendar.tsx +0 -115
- package/apps/lib/components/Card.tsx +0 -95
- package/apps/lib/components/Checkbox.tsx +0 -42
- package/apps/lib/components/ColorPicker.tsx +0 -441
- package/apps/lib/components/ConclusionHeader.tsx +0 -148
- package/apps/lib/components/ContextMenu.tsx +0 -571
- package/apps/lib/components/CountBadge.tsx +0 -52
- package/apps/lib/components/DataTable.tsx +0 -213
- package/apps/lib/components/DataViews/badge.ts +0 -49
- package/apps/lib/components/DataViews/cell.tsx +0 -324
- package/apps/lib/components/DataViews/context.ts +0 -144
- package/apps/lib/components/DataViews/data-views.tsx +0 -383
- package/apps/lib/components/DataViews/filters/children.tsx +0 -98
- package/apps/lib/components/DataViews/filters/custom.tsx +0 -34
- package/apps/lib/components/DataViews/filters/filters.tsx +0 -157
- package/apps/lib/components/DataViews/filters/index.ts +0 -4
- package/apps/lib/components/DataViews/filters/labelled.tsx +0 -20
- package/apps/lib/components/DataViews/filters/presets.tsx +0 -65
- package/apps/lib/components/DataViews/filters/sync.tsx +0 -35
- package/apps/lib/components/DataViews/filters/values.ts +0 -173
- package/apps/lib/components/DataViews/header.tsx +0 -220
- package/apps/lib/components/DataViews/hooks/index.ts +0 -5
- package/apps/lib/components/DataViews/hooks/useActiveRow.ts +0 -22
- package/apps/lib/components/DataViews/hooks/useControllable.ts +0 -52
- package/apps/lib/components/DataViews/index.ts +0 -84
- package/apps/lib/components/DataViews/panel/columns.tsx +0 -153
- package/apps/lib/components/DataViews/panel/controls.tsx +0 -106
- package/apps/lib/components/DataViews/panel/index.ts +0 -3
- package/apps/lib/components/DataViews/panel/panel.tsx +0 -164
- package/apps/lib/components/DataViews/panel/saved-views.tsx +0 -67
- package/apps/lib/components/DataViews/panel/section.tsx +0 -81
- package/apps/lib/components/DataViews/panel/sort.tsx +0 -42
- package/apps/lib/components/DataViews/panel/tab.tsx +0 -31
- package/apps/lib/components/DataViews/slots.ts +0 -63
- package/apps/lib/components/DataViews/states.tsx +0 -38
- package/apps/lib/components/DataViews/types.ts +0 -510
- package/apps/lib/components/DataViews/views/board-view.tsx +0 -381
- package/apps/lib/components/DataViews/views/card-rows.tsx +0 -36
- package/apps/lib/components/DataViews/views/inbox-view.tsx +0 -260
- package/apps/lib/components/DataViews/views/pane-views.tsx +0 -196
- package/apps/lib/components/DataViews/views/table-view.tsx +0 -493
- package/apps/lib/components/DataViews/views/tree-view.tsx +0 -367
- package/apps/lib/components/DatePicker.tsx +0 -232
- package/apps/lib/components/Dialog.tsx +0 -116
- package/apps/lib/components/Divider.tsx +0 -28
- package/apps/lib/components/Drawer.tsx +0 -420
- package/apps/lib/components/DropdownMenu.tsx +0 -540
- package/apps/lib/components/FieldHint.tsx +0 -69
- package/apps/lib/components/Form.tsx +0 -182
- package/apps/lib/components/FormBuilder/context.ts +0 -73
- package/apps/lib/components/FormBuilder/field-kind.ts +0 -28
- package/apps/lib/components/FormBuilder/fields/ChoiceFields.tsx +0 -60
- package/apps/lib/components/FormBuilder/fields/ColorField.tsx +0 -59
- package/apps/lib/components/FormBuilder/fields/CustomField.tsx +0 -11
- package/apps/lib/components/FormBuilder/fields/DateField.tsx +0 -32
- package/apps/lib/components/FormBuilder/fields/FieldArray.tsx +0 -74
- package/apps/lib/components/FormBuilder/fields/FieldShell.tsx +0 -163
- package/apps/lib/components/FormBuilder/fields/FileField.tsx +0 -39
- package/apps/lib/components/FormBuilder/fields/OptionListFields.tsx +0 -132
- package/apps/lib/components/FormBuilder/fields/OtpField.tsx +0 -31
- package/apps/lib/components/FormBuilder/fields/PhoneField.tsx +0 -109
- package/apps/lib/components/FormBuilder/fields/RichTextEditorField.tsx +0 -31
- package/apps/lib/components/FormBuilder/fields/SelectField.tsx +0 -91
- package/apps/lib/components/FormBuilder/fields/SignatureField.tsx +0 -157
- package/apps/lib/components/FormBuilder/fields/SliderField.tsx +0 -67
- package/apps/lib/components/FormBuilder/fields/SwitchBoxField.tsx +0 -41
- package/apps/lib/components/FormBuilder/fields/TableField.tsx +0 -336
- package/apps/lib/components/FormBuilder/fields/TextField.tsx +0 -213
- package/apps/lib/components/FormBuilder/fields/TreeSelectField.tsx +0 -43
- package/apps/lib/components/FormBuilder/fields/countries.ts +0 -303
- package/apps/lib/components/FormBuilder/fields/index.ts +0 -25
- package/apps/lib/components/FormBuilder/form-builder.tsx +0 -198
- package/apps/lib/components/FormBuilder/index.ts +0 -31
- package/apps/lib/components/FormBuilder/numberFormat.ts +0 -16
- package/apps/lib/components/FormBuilder/submit.tsx +0 -47
- package/apps/lib/components/FormBuilder/types.ts +0 -311
- package/apps/lib/components/FormRenderer/FormDrawer.tsx +0 -128
- package/apps/lib/components/FormRenderer/detail.tsx +0 -207
- package/apps/lib/components/FormRenderer/form-renderer.tsx +0 -297
- package/apps/lib/components/FormRenderer/header.tsx +0 -88
- package/apps/lib/components/FormRenderer/index.ts +0 -15
- package/apps/lib/components/FormRenderer/section.tsx +0 -39
- package/apps/lib/components/FormRenderer/stepper.tsx +0 -339
- package/apps/lib/components/FormRenderer/types.ts +0 -78
- package/apps/lib/components/FormSummary.tsx +0 -282
- package/apps/lib/components/HeaderBar.tsx +0 -117
- package/apps/lib/components/ImageAttachment.tsx +0 -209
- package/apps/lib/components/InnerLabelField.tsx +0 -154
- package/apps/lib/components/Input.tsx +0 -224
- package/apps/lib/components/InputField.tsx +0 -147
- package/apps/lib/components/InputOTP.tsx +0 -84
- package/apps/lib/components/Label.tsx +0 -129
- package/apps/lib/components/LabelField.tsx +0 -76
- package/apps/lib/components/LabeledCheckBox.tsx +0 -51
- package/apps/lib/components/LabeledRadio.tsx +0 -51
- package/apps/lib/components/LinkButton.tsx +0 -94
- package/apps/lib/components/LoginButton.tsx +0 -51
- package/apps/lib/components/PasswordLevel.tsx +0 -58
- package/apps/lib/components/Popover.tsx +0 -312
- package/apps/lib/components/ProfileMenu.tsx +0 -85
- package/apps/lib/components/Radio.tsx +0 -59
- package/apps/lib/components/RadioCard.tsx +0 -50
- package/apps/lib/components/ScrollArea.tsx +0 -54
- package/apps/lib/components/SearchField.tsx +0 -62
- package/apps/lib/components/SearchableSelect.tsx +0 -318
- package/apps/lib/components/SearchableTable.tsx +0 -344
- package/apps/lib/components/SearchableTree.tsx +0 -485
- package/apps/lib/components/SearchableTreeDialog.tsx +0 -502
- package/apps/lib/components/SectionBlock.tsx +0 -147
- package/apps/lib/components/Select.tsx +0 -347
- package/apps/lib/components/SimpleSelect.tsx +0 -225
- package/apps/lib/components/Skeleton.tsx +0 -12
- package/apps/lib/components/SlideDatePicker.tsx +0 -253
- package/apps/lib/components/SpinLoading.tsx +0 -174
- package/apps/lib/components/Stepper.tsx +0 -480
- package/apps/lib/components/Switch.tsx +0 -82
- package/apps/lib/components/TabFormItem.tsx +0 -153
- package/apps/lib/components/TabSwitch.tsx +0 -172
- package/apps/lib/components/Table.tsx +0 -610
- package/apps/lib/components/TextEditor/ChartBlockTool.ts +0 -676
- package/apps/lib/components/TextEditor/RichTextField.tsx +0 -46
- package/apps/lib/components/TextEditor/TableDnDWrapper.ts +0 -462
- package/apps/lib/components/TextEditor/TextEditor.tsx +0 -1164
- package/apps/lib/components/TextEditor/TextEditorToolbar.tsx +0 -429
- package/apps/lib/components/TextEditor/editor-tools/AlignmentTune.ts +0 -70
- package/apps/lib/components/TextEditor/editor-tools/ColorInlineTool.ts +0 -50
- package/apps/lib/components/TextEditor/editor-tools/StrikethroughInlineTool.ts +0 -48
- package/apps/lib/components/TextEditor/editor-tools/inlineFormat.ts +0 -98
- package/apps/lib/components/TextEditor/editorjs.d.ts +0 -60
- package/apps/lib/components/TextEditor/index.ts +0 -7
- package/apps/lib/components/TextEditor/markdownParser.ts +0 -346
- package/apps/lib/components/Textarea.tsx +0 -117
- package/apps/lib/components/Timeline.tsx +0 -263
- package/apps/lib/components/Toast.tsx +0 -87
- package/apps/lib/components/Toggle.tsx +0 -125
- package/apps/lib/components/ToggleButton.tsx +0 -140
- package/apps/lib/components/Tooltip.tsx +0 -116
- package/apps/lib/components/TransparentLabel.tsx +0 -71
- package/apps/lib/components/TreeDropDown.tsx +0 -115
- package/apps/lib/components/TreeFolder/TreeFolder.tsx +0 -380
- package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +0 -75
- package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +0 -354
- package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +0 -60
- package/apps/lib/components/TreeFolder/icons.tsx +0 -60
- package/apps/lib/components/TreeFolder/index.ts +0 -24
- package/apps/lib/components/TreeFolder/treeFolderUtils.ts +0 -109
- package/apps/lib/components/TreeFolder/types.ts +0 -77
- package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +0 -118
- package/apps/lib/hooks/useActiveTreeItem.ts +0 -58
- package/apps/lib/hooks/useClickOutside.ts +0 -27
- package/apps/lib/hooks/useDragDrop.tsx +0 -365
- package/apps/lib/hooks/useInfiniteScroll.ts +0 -108
- package/apps/lib/hooks/useIsMobile.ts +0 -21
- package/apps/lib/hooks/useResize.ts +0 -67
- package/apps/lib/hooks/useTagSelection.ts +0 -214
- package/apps/lib/layouts/CNLayout.tsx +0 -372
- package/apps/lib/layouts/DataViewCard.tsx +0 -62
- package/apps/lib/layouts/FieldSection.tsx +0 -91
- package/apps/lib/layouts/TreeSubLayout.tsx +0 -173
- package/apps/lib/providers/ThemeProvider.tsx +0 -84
- package/apps/lib/registry.json +0 -1201
- package/apps/lib/tsconfig.json +0 -9
- package/apps/lib/tsconfig.tsbuildinfo +0 -1
- package/apps/lib/utils/cn.ts +0 -6
- package/apps/lib/utils/color.ts +0 -175
- package/apps/lib/utils/dataViews/path.ts +0 -67
- package/apps/lib/utils/dataViews/query.ts +0 -73
- package/apps/lib/utils/dataViews/types.ts +0 -187
- package/apps/lib/utils/dateFormat.ts +0 -108
- package/apps/lib/utils/resize.ts +0 -31
- package/apps/lib/utils/types.ts +0 -16
- package/docs/BLOCKS.md +0 -129
- package/docs/CHANGELOG-1.1.16.md +0 -108
- package/docs/Cover.png +0 -0
- package/docs/README.md +0 -215
- package/docs/components/action-button.md +0 -638
- package/docs/components/actions-group.md +0 -708
- package/docs/components/alert-dialog.md +0 -920
- package/docs/components/avatar.md +0 -709
- package/docs/components/badge-field.md +0 -712
- package/docs/components/badge.md +0 -301
- package/docs/components/breadcrumb.md +0 -930
- package/docs/components/button-group.md +0 -650
- package/docs/components/button.md +0 -639
- package/docs/components/calendar.md +0 -555
- package/docs/components/card.md +0 -622
- package/docs/components/chart-block-tool.md +0 -129
- package/docs/components/checkbox.md +0 -699
- package/docs/components/cn-layout.md +0 -854
- package/docs/components/color-picker.md +0 -101
- package/docs/components/conclusion-header.md +0 -80
- package/docs/components/context-menu.md +0 -483
- package/docs/components/count-badge.md +0 -560
- package/docs/components/data-table.md +0 -854
- package/docs/components/data-views/backend-response.md +0 -324
- package/docs/components/data-views/examples/a11y-rtl.md +0 -250
- package/docs/components/data-views/examples/api-orders-route.md +0 -130
- package/docs/components/data-views/examples/fields.md +0 -362
- package/docs/components/data-views/examples/filters.md +0 -307
- package/docs/components/data-views/examples/inbox-routing.md +0 -218
- package/docs/components/data-views/examples/index.md +0 -29
- package/docs/components/data-views/examples/overview.md +0 -244
- package/docs/components/data-views/examples/panel.md +0 -212
- package/docs/components/data-views/examples/scale.md +0 -231
- package/docs/components/data-views/examples/server-side.md +0 -210
- package/docs/components/data-views/examples/state.md +0 -250
- package/docs/components/data-views/examples/tree-custom.md +0 -388
- package/docs/components/data-views/examples/view-registry.md +0 -313
- package/docs/components/data-views/examples/views.md +0 -534
- package/docs/components/data-views/guide.md +0 -405
- package/docs/components/data-views/index.md +0 -1495
- package/docs/components/data-views/migration.md +0 -79
- package/docs/components/date-picker.md +0 -857
- package/docs/components/dialog.md +0 -929
- package/docs/components/divider.md +0 -766
- package/docs/components/drawer.md +0 -654
- package/docs/components/dropdown-menu.md +0 -668
- package/docs/components/field-hint.md +0 -898
- package/docs/components/field-section.md +0 -781
- package/docs/components/form-builder.md +0 -276
- package/docs/components/form-renderer.md +0 -326
- package/docs/components/form-summary.md +0 -138
- package/docs/components/form.md +0 -785
- package/docs/components/header-bar.md +0 -188
- package/docs/components/image-attachment.md +0 -906
- package/docs/components/inner-label-field.md +0 -819
- package/docs/components/input-field.md +0 -623
- package/docs/components/input-otp.md +0 -756
- package/docs/components/input.md +0 -634
- package/docs/components/label-field.md +0 -770
- package/docs/components/label.md +0 -761
- package/docs/components/labeled-check-box.md +0 -642
- package/docs/components/labeled-radio.md +0 -796
- package/docs/components/link-button.md +0 -685
- package/docs/components/login-button.md +0 -872
- package/docs/components/password-level.md +0 -803
- package/docs/components/popover.md +0 -649
- package/docs/components/profile-menu.md +0 -656
- package/docs/components/radio-card.md +0 -801
- package/docs/components/radio.md +0 -735
- package/docs/components/scroll-area.md +0 -691
- package/docs/components/search-field.md +0 -702
- package/docs/components/searchable-select.md +0 -368
- package/docs/components/searchable-table.md +0 -438
- package/docs/components/searchable-tree-dialog.md +0 -190
- package/docs/components/searchable-tree.md +0 -200
- package/docs/components/section-block.md +0 -477
- package/docs/components/select.md +0 -709
- package/docs/components/simple-select.md +0 -741
- package/docs/components/skeleton.md +0 -706
- package/docs/components/slide-date-picker.md +0 -837
- package/docs/components/spin-loading.md +0 -696
- package/docs/components/stepper.md +0 -316
- package/docs/components/switch.md +0 -770
- package/docs/components/tab-form-item.md +0 -773
- package/docs/components/tab-switch.md +0 -170
- package/docs/components/table-dnd-wrapper.md +0 -107
- package/docs/components/table.md +0 -1088
- package/docs/components/text-editor.md +0 -735
- package/docs/components/textarea.md +0 -681
- package/docs/components/timeline.md +0 -254
- package/docs/components/toast.md +0 -773
- package/docs/components/toggle-button.md +0 -643
- package/docs/components/toggle.md +0 -882
- package/docs/components/tooltip.md +0 -513
- package/docs/components/transparent-label.md +0 -721
- package/docs/components/tree-drop-down.md +0 -740
- package/docs/components/tree-folder.md +0 -110
- package/docs/components/tree-sub-layout.md +0 -707
- package/docs/explanation/architecture.md +0 -54
- package/docs/explanation/design-system.md +0 -52
- package/docs/how-to/form-and-list-recipes.md +0 -386
- package/docs/how-to/forms-with-form-builder.md +0 -472
- package/docs/how-to/guides.md +0 -1027
- package/docs/migration/changelog.md +0 -54
- package/docs/migration/form-builder-2.5.2.md +0 -113
- package/docs/reference/cli.md +0 -112
- package/docs/reference/components.md +0 -572
- package/docs/reference/hooks.md +0 -1500
- package/docs/reference/providers.md +0 -866
- package/docs/reference/tailwind-plugins.md +0 -942
- package/docs/reference/theme.md +0 -85
- package/docs/reference/types.md +0 -1016
- package/docs/reference/utilities.md +0 -704
- package/docs/tutorials/building-first-form.md +0 -846
- package/docs/tutorials/component-composition.md +0 -882
- package/docs/tutorials/getting-started.md +0 -302
- 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
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
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
|
-
//
|
|
59
|
-
|
|
60
|
-
//
|
|
61
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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,GAAG,QAAQ,CAAC,eAAe,CAAC;QAChC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACzB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;QACjD,EAAE,CAAC,QAAQ,CAAC,qFAAqF,EAAE,CAAC,KAAK,EAAE,EAAE;YACzG,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QAC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,OAAO;QACd,KAAK,EAAE,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
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @param {
|
|
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(
|
|
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":"
|
|
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
|
|
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
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @param {
|
|
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(
|
|
22
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../cli/src/commands/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAa,EAAE,UAAmB,KAAK;IACjE,MAAM,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,2BAA2B,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACX,CAAC;QAED,MAAM,IAAI,GAAG,SAAS,IAAI,CAA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AAc;IAC1D,OAAO,QAAQ,CAAC,KAAK;SAChB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;SACpC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SACxB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,IAAc,EAAE,SAAmB;IAC9D,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACvC;YACI,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,SAAS,aAAa,CAAC,IAAI,CAAC,yBAAyB;YAC9D,OAAO,EAAE,SAAS;SACrB;KACJ,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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":"
|
|
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,
|
|
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,C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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
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
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":"
|
|
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,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA4C/B;AAqFD,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CActF"}
|