loseta 0.19.0 → 0.21.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 +91 -20
- package/dist/cli.js +69 -16
- package/dist/cli.js.map +1 -1
- package/dist/colors.d.ts +9 -0
- package/dist/colors.js +25 -0
- package/dist/colors.js.map +1 -0
- package/dist/command-context.d.ts +20 -0
- package/dist/command-context.js +26 -0
- package/dist/command-context.js.map +1 -0
- package/dist/command-errors.d.ts +2 -0
- package/dist/command-errors.js +42 -0
- package/dist/command-errors.js.map +1 -0
- package/dist/command.d.ts +45 -0
- package/dist/command.js +72 -0
- package/dist/command.js.map +1 -0
- package/dist/commands/add.d.ts +9 -1
- package/dist/commands/add.js +190 -62
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/init.d.ts +9 -1
- package/dist/commands/init.js +72 -29
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.d.ts +9 -1
- package/dist/commands/list.js +44 -5
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/style.d.ts +10 -1
- package/dist/commands/style.js +60 -12
- package/dist/commands/style.js.map +1 -1
- package/dist/constants.d.ts +9 -0
- package/dist/constants.js +10 -0
- package/dist/constants.js.map +1 -0
- package/dist/fetch.d.ts +28 -0
- package/dist/fetch.js +135 -0
- package/dist/fetch.js.map +1 -0
- package/dist/imports.d.ts +6 -6
- package/dist/imports.js +42 -32
- package/dist/imports.js.map +1 -1
- package/dist/install.d.ts +17 -14
- package/dist/install.js +67 -41
- package/dist/install.js.map +1 -1
- package/dist/local-registry.d.ts +20 -0
- package/dist/local-registry.js +58 -0
- package/dist/local-registry.js.map +1 -0
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +14 -2
- package/dist/manifest.js.map +1 -1
- package/dist/package-info.d.ts +2 -0
- package/dist/package-info.js +5 -0
- package/dist/package-info.js.map +1 -0
- package/dist/payload.d.ts +31 -0
- package/dist/payload.js +155 -0
- package/dist/payload.js.map +1 -0
- package/dist/prompts.d.ts +35 -0
- package/dist/prompts.js +105 -0
- package/dist/prompts.js.map +1 -0
- package/dist/registry-url.d.ts +14 -0
- package/dist/registry-url.js +63 -0
- package/dist/registry-url.js.map +1 -0
- package/dist/remote-registry.d.ts +36 -0
- package/dist/remote-registry.js +232 -0
- package/dist/remote-registry.js.map +1 -0
- package/dist/resolve.d.ts +23 -0
- package/dist/resolve.js +106 -0
- package/dist/resolve.js.map +1 -0
- package/{registry/schema.json → dist/schema-catalog.json} +31 -9
- package/dist/schema-item.json +119 -0
- package/dist/source-types.d.ts +15 -0
- package/dist/source-types.js +2 -0
- package/dist/source-types.js.map +1 -0
- package/dist/style-selection.d.ts +1 -1
- package/dist/style-switch.d.ts +4 -1
- package/dist/style-switch.js +12 -2
- package/dist/style-switch.js.map +1 -1
- package/dist/types.d.ts +55 -3
- package/dist/ui.js +1 -1
- package/dist/ui.js.map +1 -1
- package/dist/validate-content.d.ts +20 -0
- package/dist/validate-content.js +385 -0
- package/dist/validate-content.js.map +1 -0
- package/dist/validation-rules.json +121 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.js +26 -0
- package/dist/version.js.map +1 -0
- package/package.json +9 -9
- package/registry/base.css +0 -20
- package/registry/behaviors/calendar.js +0 -855
- package/registry/behaviors/carousel.js +0 -280
- package/registry/behaviors/code-block.js +0 -106
- package/registry/behaviors/combobox.js +0 -237
- package/registry/behaviors/command.js +0 -105
- package/registry/behaviors/core.js +0 -302
- package/registry/behaviors/dialog.js +0 -97
- package/registry/behaviors/hover-overlay.js +0 -180
- package/registry/behaviors/listbox.js +0 -135
- package/registry/behaviors/menu.js +0 -586
- package/registry/behaviors/message-scroller.js +0 -147
- package/registry/behaviors/popover.js +0 -127
- package/registry/behaviors/questionnaire.js +0 -91
- package/registry/behaviors/resizable.js +0 -463
- package/registry/behaviors/select.js +0 -196
- package/registry/behaviors/tabs.js +0 -95
- package/registry/behaviors/toast.js +0 -137
- package/registry/components/accordion.css +0 -65
- package/registry/components/alert-dialog.css +0 -104
- package/registry/components/alert.css +0 -41
- package/registry/components/aspect-ratio.css +0 -25
- package/registry/components/attachment.css +0 -84
- package/registry/components/avatar.css +0 -63
- package/registry/components/badge.css +0 -22
- package/registry/components/breadcrumb.css +0 -65
- package/registry/components/bubble.css +0 -92
- package/registry/components/button-group.css +0 -98
- package/registry/components/button.css +0 -32
- package/registry/components/calendar.css +0 -96
- package/registry/components/card.css +0 -51
- package/registry/components/carousel.css +0 -96
- package/registry/components/chart.css +0 -65
- package/registry/components/checkbox.css +0 -39
- package/registry/components/code-block.css +0 -192
- package/registry/components/collapsible.css +0 -57
- package/registry/components/combobox.css +0 -42
- package/registry/components/command.css +0 -27
- package/registry/components/context-menu.css +0 -37
- package/registry/components/dialog.css +0 -87
- package/registry/components/drawer.css +0 -30
- package/registry/components/dropdown-menu.css +0 -14
- package/registry/components/empty.css +0 -66
- package/registry/components/field.css +0 -169
- package/registry/components/hover-card.css +0 -18
- package/registry/components/input-group.css +0 -56
- package/registry/components/input-otp.css +0 -119
- package/registry/components/input.css +0 -31
- package/registry/components/item.css +0 -102
- package/registry/components/kbd.css +0 -19
- package/registry/components/label.css +0 -31
- package/registry/components/marker.css +0 -47
- package/registry/components/menubar.css +0 -52
- package/registry/components/message-scroller.css +0 -56
- package/registry/components/message.css +0 -61
- package/registry/components/native-select.css +0 -27
- package/registry/components/navigation-menu.css +0 -52
- package/registry/components/pagination.css +0 -49
- package/registry/components/popover.css +0 -7
- package/registry/components/progress.css +0 -13
- package/registry/components/questionnaire.css +0 -92
- package/registry/components/radio.css +0 -40
- package/registry/components/resizable.css +0 -100
- package/registry/components/scroll-area.css +0 -16
- package/registry/components/select.css +0 -50
- package/registry/components/separator.css +0 -12
- package/registry/components/sheet.css +0 -31
- package/registry/components/sidebar.css +0 -107
- package/registry/components/skeleton.css +0 -11
- package/registry/components/slider.css +0 -13
- package/registry/components/spinner.css +0 -8
- package/registry/components/switch.css +0 -41
- package/registry/components/table.css +0 -73
- package/registry/components/tabs.css +0 -61
- package/registry/components/textarea.css +0 -25
- package/registry/components/toast.css +0 -47
- package/registry/components/toggle-group.css +0 -25
- package/registry/components/toggle.css +0 -31
- package/registry/components/tooltip.css +0 -437
- package/registry/components/trace.css +0 -78
- package/registry/examples/accordion.html +0 -56
- package/registry/examples/alert-dialog.html +0 -146
- package/registry/examples/alert.html +0 -62
- package/registry/examples/aspect-ratio.html +0 -14
- package/registry/examples/attachment.html +0 -53
- package/registry/examples/avatar.html +0 -66
- package/registry/examples/badge.html +0 -49
- package/registry/examples/breadcrumb.html +0 -103
- package/registry/examples/bubble.html +0 -26
- package/registry/examples/button-group.html +0 -141
- package/registry/examples/button.html +0 -66
- package/registry/examples/calendar.html +0 -757
- package/registry/examples/card.html +0 -204
- package/registry/examples/carousel.html +0 -127
- package/registry/examples/chart.html +0 -39
- package/registry/examples/checkbox.html +0 -111
- package/registry/examples/code-block.html +0 -84
- package/registry/examples/collapsible.html +0 -22
- package/registry/examples/combobox.html +0 -43
- package/registry/examples/command.html +0 -365
- package/registry/examples/context-menu.html +0 -179
- package/registry/examples/dialog.html +0 -187
- package/registry/examples/drawer.html +0 -234
- package/registry/examples/dropdown-menu.html +0 -272
- package/registry/examples/empty.html +0 -117
- package/registry/examples/field.html +0 -247
- package/registry/examples/hover-card.html +0 -13
- package/registry/examples/input-group.html +0 -110
- package/registry/examples/input-otp.html +0 -182
- package/registry/examples/input.html +0 -80
- package/registry/examples/item.html +0 -32
- package/registry/examples/kbd.html +0 -94
- package/registry/examples/label.html +0 -5
- package/registry/examples/marker.html +0 -20
- package/registry/examples/menubar.html +0 -372
- package/registry/examples/message-scroller.html +0 -54
- package/registry/examples/message.html +0 -47
- package/registry/examples/native-select.html +0 -91
- package/registry/examples/navigation-menu.html +0 -207
- package/registry/examples/pagination.html +0 -39
- package/registry/examples/popover.html +0 -163
- package/registry/examples/progress.html +0 -68
- package/registry/examples/questionnaire.html +0 -99
- package/registry/examples/radio.html +0 -127
- package/registry/examples/resizable.html +0 -107
- package/registry/examples/scroll-area.html +0 -34
- package/registry/examples/select.html +0 -250
- package/registry/examples/separator.html +0 -18
- package/registry/examples/sheet.html +0 -240
- package/registry/examples/sidebar.html +0 -407
- package/registry/examples/skeleton.html +0 -6
- package/registry/examples/slider.html +0 -56
- package/registry/examples/spinner.html +0 -15
- package/registry/examples/switch.html +0 -73
- package/registry/examples/table.html +0 -218
- package/registry/examples/tabs.html +0 -27
- package/registry/examples/textarea.html +0 -36
- package/registry/examples/toast.html +0 -28
- package/registry/examples/toggle-group.html +0 -73
- package/registry/examples/toggle.html +0 -40
- package/registry/examples/tooltip.html +0 -106
- package/registry/examples/trace.html +0 -54
- package/registry/primitives/dialog-shell.css +0 -129
- package/registry/primitives/listbox.css +0 -82
- package/registry/primitives/menu.css +0 -109
- package/registry/primitives/popover.css +0 -162
- package/registry/registry.json +0 -5349
- package/registry/reset.css +0 -400
- package/registry/styles/luma/accordion.css +0 -59
- package/registry/styles/luma/alert-dialog.css +0 -82
- package/registry/styles/luma/alert.css +0 -98
- package/registry/styles/luma/aspect-ratio.css +0 -6
- package/registry/styles/luma/attachment.css +0 -176
- package/registry/styles/luma/avatar.css +0 -132
- package/registry/styles/luma/badge.css +0 -112
- package/registry/styles/luma/breadcrumb.css +0 -62
- package/registry/styles/luma/bubble.css +0 -147
- package/registry/styles/luma/button-group.css +0 -63
- package/registry/styles/luma/button.css +0 -222
- package/registry/styles/luma/calendar.css +0 -140
- package/registry/styles/luma/card.css +0 -82
- package/registry/styles/luma/carousel.css +0 -63
- package/registry/styles/luma/chart.css +0 -51
- package/registry/styles/luma/checkbox.css +0 -58
- package/registry/styles/luma/code-block.css +0 -186
- package/registry/styles/luma/collapsible.css +0 -50
- package/registry/styles/luma/combobox.css +0 -59
- package/registry/styles/luma/command.css +0 -27
- package/registry/styles/luma/context-menu.css +0 -19
- package/registry/styles/luma/dialog.css +0 -64
- package/registry/styles/luma/drawer.css +0 -68
- package/registry/styles/luma/dropdown-menu.css +0 -8
- package/registry/styles/luma/empty.css +0 -52
- package/registry/styles/luma/field.css +0 -120
- package/registry/styles/luma/hover-card.css +0 -22
- package/registry/styles/luma/input-group.css +0 -98
- package/registry/styles/luma/input-otp.css +0 -102
- package/registry/styles/luma/input.css +0 -61
- package/registry/styles/luma/item.css +0 -133
- package/registry/styles/luma/kbd.css +0 -22
- package/registry/styles/luma/label.css +0 -74
- package/registry/styles/luma/marker.css +0 -35
- package/registry/styles/luma/menubar.css +0 -48
- package/registry/styles/luma/message-scroller.css +0 -47
- package/registry/styles/luma/message.css +0 -39
- package/registry/styles/luma/native-select.css +0 -80
- package/registry/styles/luma/navigation-menu.css +0 -90
- package/registry/styles/luma/pagination.css +0 -46
- package/registry/styles/luma/popover.css +0 -25
- package/registry/styles/luma/primitives/dialog-shell.css +0 -19
- package/registry/styles/luma/primitives/listbox.css +0 -79
- package/registry/styles/luma/primitives/menu.css +0 -108
- package/registry/styles/luma/primitives/popover.css +0 -16
- package/registry/styles/luma/progress.css +0 -92
- package/registry/styles/luma/questionnaire.css +0 -141
- package/registry/styles/luma/radio.css +0 -48
- package/registry/styles/luma/resizable.css +0 -44
- package/registry/styles/luma/scroll-area.css +0 -30
- package/registry/styles/luma/select.css +0 -80
- package/registry/styles/luma/separator.css +0 -14
- package/registry/styles/luma/sheet.css +0 -74
- package/registry/styles/luma/sidebar.css +0 -211
- package/registry/styles/luma/skeleton.css +0 -7
- package/registry/styles/luma/slider.css +0 -15
- package/registry/styles/luma/spinner.css +0 -35
- package/registry/styles/luma/switch.css +0 -110
- package/registry/styles/luma/table.css +0 -91
- package/registry/styles/luma/tabs.css +0 -133
- package/registry/styles/luma/textarea.css +0 -53
- package/registry/styles/luma/toast.css +0 -62
- package/registry/styles/luma/toggle-group.css +0 -59
- package/registry/styles/luma/toggle.css +0 -128
- package/registry/styles/luma/tooltip.css +0 -35
- package/registry/styles/luma/trace.css +0 -85
- package/registry/styles/lyra/accordion.css +0 -59
- package/registry/styles/lyra/alert-dialog.css +0 -82
- package/registry/styles/lyra/alert.css +0 -98
- package/registry/styles/lyra/aspect-ratio.css +0 -6
- package/registry/styles/lyra/attachment.css +0 -176
- package/registry/styles/lyra/avatar.css +0 -132
- package/registry/styles/lyra/badge.css +0 -112
- package/registry/styles/lyra/breadcrumb.css +0 -62
- package/registry/styles/lyra/bubble.css +0 -147
- package/registry/styles/lyra/button-group.css +0 -62
- package/registry/styles/lyra/button.css +0 -221
- package/registry/styles/lyra/calendar.css +0 -140
- package/registry/styles/lyra/card.css +0 -81
- package/registry/styles/lyra/carousel.css +0 -63
- package/registry/styles/lyra/chart.css +0 -51
- package/registry/styles/lyra/checkbox.css +0 -58
- package/registry/styles/lyra/code-block.css +0 -186
- package/registry/styles/lyra/collapsible.css +0 -50
- package/registry/styles/lyra/combobox.css +0 -59
- package/registry/styles/lyra/command.css +0 -27
- package/registry/styles/lyra/context-menu.css +0 -19
- package/registry/styles/lyra/dialog.css +0 -64
- package/registry/styles/lyra/drawer.css +0 -68
- package/registry/styles/lyra/dropdown-menu.css +0 -8
- package/registry/styles/lyra/empty.css +0 -52
- package/registry/styles/lyra/field.css +0 -120
- package/registry/styles/lyra/hover-card.css +0 -22
- package/registry/styles/lyra/input-group.css +0 -98
- package/registry/styles/lyra/input-otp.css +0 -102
- package/registry/styles/lyra/input.css +0 -62
- package/registry/styles/lyra/item.css +0 -133
- package/registry/styles/lyra/kbd.css +0 -22
- package/registry/styles/lyra/label.css +0 -74
- package/registry/styles/lyra/marker.css +0 -35
- package/registry/styles/lyra/menubar.css +0 -48
- package/registry/styles/lyra/message-scroller.css +0 -47
- package/registry/styles/lyra/message.css +0 -39
- package/registry/styles/lyra/native-select.css +0 -79
- package/registry/styles/lyra/navigation-menu.css +0 -90
- package/registry/styles/lyra/pagination.css +0 -46
- package/registry/styles/lyra/popover.css +0 -25
- package/registry/styles/lyra/primitives/dialog-shell.css +0 -19
- package/registry/styles/lyra/primitives/listbox.css +0 -79
- package/registry/styles/lyra/primitives/menu.css +0 -108
- package/registry/styles/lyra/primitives/popover.css +0 -16
- package/registry/styles/lyra/progress.css +0 -92
- package/registry/styles/lyra/questionnaire.css +0 -141
- package/registry/styles/lyra/radio.css +0 -48
- package/registry/styles/lyra/resizable.css +0 -44
- package/registry/styles/lyra/scroll-area.css +0 -30
- package/registry/styles/lyra/select.css +0 -80
- package/registry/styles/lyra/separator.css +0 -14
- package/registry/styles/lyra/sheet.css +0 -74
- package/registry/styles/lyra/sidebar.css +0 -211
- package/registry/styles/lyra/skeleton.css +0 -7
- package/registry/styles/lyra/slider.css +0 -15
- package/registry/styles/lyra/spinner.css +0 -35
- package/registry/styles/lyra/switch.css +0 -110
- package/registry/styles/lyra/table.css +0 -91
- package/registry/styles/lyra/tabs.css +0 -133
- package/registry/styles/lyra/textarea.css +0 -53
- package/registry/styles/lyra/toast.css +0 -62
- package/registry/styles/lyra/toggle-group.css +0 -48
- package/registry/styles/lyra/toggle.css +0 -126
- package/registry/styles/lyra/tooltip.css +0 -35
- package/registry/styles/lyra/trace.css +0 -85
- package/registry/styles/maia/accordion.css +0 -59
- package/registry/styles/maia/alert-dialog.css +0 -82
- package/registry/styles/maia/alert.css +0 -98
- package/registry/styles/maia/aspect-ratio.css +0 -6
- package/registry/styles/maia/attachment.css +0 -176
- package/registry/styles/maia/avatar.css +0 -132
- package/registry/styles/maia/badge.css +0 -113
- package/registry/styles/maia/breadcrumb.css +0 -62
- package/registry/styles/maia/bubble.css +0 -147
- package/registry/styles/maia/button-group.css +0 -63
- package/registry/styles/maia/button.css +0 -222
- package/registry/styles/maia/calendar.css +0 -140
- package/registry/styles/maia/card.css +0 -81
- package/registry/styles/maia/carousel.css +0 -63
- package/registry/styles/maia/chart.css +0 -51
- package/registry/styles/maia/checkbox.css +0 -58
- package/registry/styles/maia/code-block.css +0 -186
- package/registry/styles/maia/collapsible.css +0 -50
- package/registry/styles/maia/combobox.css +0 -59
- package/registry/styles/maia/command.css +0 -27
- package/registry/styles/maia/context-menu.css +0 -19
- package/registry/styles/maia/dialog.css +0 -64
- package/registry/styles/maia/drawer.css +0 -68
- package/registry/styles/maia/dropdown-menu.css +0 -8
- package/registry/styles/maia/empty.css +0 -52
- package/registry/styles/maia/field.css +0 -120
- package/registry/styles/maia/hover-card.css +0 -22
- package/registry/styles/maia/input-group.css +0 -98
- package/registry/styles/maia/input-otp.css +0 -102
- package/registry/styles/maia/input.css +0 -61
- package/registry/styles/maia/item.css +0 -133
- package/registry/styles/maia/kbd.css +0 -22
- package/registry/styles/maia/label.css +0 -74
- package/registry/styles/maia/marker.css +0 -35
- package/registry/styles/maia/menubar.css +0 -48
- package/registry/styles/maia/message-scroller.css +0 -47
- package/registry/styles/maia/message.css +0 -39
- package/registry/styles/maia/native-select.css +0 -80
- package/registry/styles/maia/navigation-menu.css +0 -90
- package/registry/styles/maia/pagination.css +0 -46
- package/registry/styles/maia/popover.css +0 -25
- package/registry/styles/maia/primitives/dialog-shell.css +0 -19
- package/registry/styles/maia/primitives/listbox.css +0 -79
- package/registry/styles/maia/primitives/menu.css +0 -108
- package/registry/styles/maia/primitives/popover.css +0 -16
- package/registry/styles/maia/progress.css +0 -92
- package/registry/styles/maia/questionnaire.css +0 -141
- package/registry/styles/maia/radio.css +0 -48
- package/registry/styles/maia/resizable.css +0 -44
- package/registry/styles/maia/scroll-area.css +0 -30
- package/registry/styles/maia/select.css +0 -80
- package/registry/styles/maia/separator.css +0 -14
- package/registry/styles/maia/sheet.css +0 -74
- package/registry/styles/maia/sidebar.css +0 -211
- package/registry/styles/maia/skeleton.css +0 -7
- package/registry/styles/maia/slider.css +0 -15
- package/registry/styles/maia/spinner.css +0 -35
- package/registry/styles/maia/switch.css +0 -110
- package/registry/styles/maia/table.css +0 -91
- package/registry/styles/maia/tabs.css +0 -133
- package/registry/styles/maia/textarea.css +0 -53
- package/registry/styles/maia/toast.css +0 -62
- package/registry/styles/maia/toggle-group.css +0 -59
- package/registry/styles/maia/toggle.css +0 -128
- package/registry/styles/maia/tooltip.css +0 -35
- package/registry/styles/maia/trace.css +0 -85
- package/registry/styles/mira/accordion.css +0 -59
- package/registry/styles/mira/alert-dialog.css +0 -82
- package/registry/styles/mira/alert.css +0 -98
- package/registry/styles/mira/aspect-ratio.css +0 -6
- package/registry/styles/mira/attachment.css +0 -176
- package/registry/styles/mira/avatar.css +0 -132
- package/registry/styles/mira/badge.css +0 -116
- package/registry/styles/mira/breadcrumb.css +0 -62
- package/registry/styles/mira/bubble.css +0 -147
- package/registry/styles/mira/button-group.css +0 -63
- package/registry/styles/mira/button.css +0 -222
- package/registry/styles/mira/calendar.css +0 -140
- package/registry/styles/mira/card.css +0 -81
- package/registry/styles/mira/carousel.css +0 -63
- package/registry/styles/mira/chart.css +0 -51
- package/registry/styles/mira/checkbox.css +0 -58
- package/registry/styles/mira/code-block.css +0 -186
- package/registry/styles/mira/collapsible.css +0 -50
- package/registry/styles/mira/combobox.css +0 -59
- package/registry/styles/mira/command.css +0 -27
- package/registry/styles/mira/context-menu.css +0 -19
- package/registry/styles/mira/dialog.css +0 -64
- package/registry/styles/mira/drawer.css +0 -68
- package/registry/styles/mira/dropdown-menu.css +0 -8
- package/registry/styles/mira/empty.css +0 -52
- package/registry/styles/mira/field.css +0 -120
- package/registry/styles/mira/hover-card.css +0 -22
- package/registry/styles/mira/input-group.css +0 -98
- package/registry/styles/mira/input-otp.css +0 -102
- package/registry/styles/mira/input.css +0 -62
- package/registry/styles/mira/item.css +0 -133
- package/registry/styles/mira/kbd.css +0 -22
- package/registry/styles/mira/label.css +0 -74
- package/registry/styles/mira/marker.css +0 -35
- package/registry/styles/mira/menubar.css +0 -48
- package/registry/styles/mira/message-scroller.css +0 -47
- package/registry/styles/mira/message.css +0 -39
- package/registry/styles/mira/native-select.css +0 -80
- package/registry/styles/mira/navigation-menu.css +0 -90
- package/registry/styles/mira/pagination.css +0 -46
- package/registry/styles/mira/popover.css +0 -25
- package/registry/styles/mira/primitives/dialog-shell.css +0 -19
- package/registry/styles/mira/primitives/listbox.css +0 -79
- package/registry/styles/mira/primitives/menu.css +0 -109
- package/registry/styles/mira/primitives/popover.css +0 -16
- package/registry/styles/mira/progress.css +0 -92
- package/registry/styles/mira/questionnaire.css +0 -141
- package/registry/styles/mira/radio.css +0 -48
- package/registry/styles/mira/resizable.css +0 -44
- package/registry/styles/mira/scroll-area.css +0 -30
- package/registry/styles/mira/select.css +0 -80
- package/registry/styles/mira/separator.css +0 -14
- package/registry/styles/mira/sheet.css +0 -74
- package/registry/styles/mira/sidebar.css +0 -211
- package/registry/styles/mira/skeleton.css +0 -7
- package/registry/styles/mira/slider.css +0 -15
- package/registry/styles/mira/spinner.css +0 -35
- package/registry/styles/mira/switch.css +0 -110
- package/registry/styles/mira/table.css +0 -91
- package/registry/styles/mira/tabs.css +0 -133
- package/registry/styles/mira/textarea.css +0 -53
- package/registry/styles/mira/toast.css +0 -62
- package/registry/styles/mira/toggle-group.css +0 -59
- package/registry/styles/mira/toggle.css +0 -128
- package/registry/styles/mira/tooltip.css +0 -35
- package/registry/styles/mira/trace.css +0 -85
- package/registry/styles/nova/accordion.css +0 -59
- package/registry/styles/nova/alert-dialog.css +0 -82
- package/registry/styles/nova/alert.css +0 -98
- package/registry/styles/nova/aspect-ratio.css +0 -6
- package/registry/styles/nova/attachment.css +0 -176
- package/registry/styles/nova/avatar.css +0 -132
- package/registry/styles/nova/badge.css +0 -112
- package/registry/styles/nova/breadcrumb.css +0 -62
- package/registry/styles/nova/bubble.css +0 -147
- package/registry/styles/nova/button-group.css +0 -62
- package/registry/styles/nova/button.css +0 -221
- package/registry/styles/nova/calendar.css +0 -140
- package/registry/styles/nova/card.css +0 -84
- package/registry/styles/nova/carousel.css +0 -55
- package/registry/styles/nova/chart.css +0 -42
- package/registry/styles/nova/checkbox.css +0 -58
- package/registry/styles/nova/code-block.css +0 -186
- package/registry/styles/nova/collapsible.css +0 -50
- package/registry/styles/nova/combobox.css +0 -59
- package/registry/styles/nova/command.css +0 -27
- package/registry/styles/nova/context-menu.css +0 -19
- package/registry/styles/nova/dialog.css +0 -64
- package/registry/styles/nova/drawer.css +0 -68
- package/registry/styles/nova/dropdown-menu.css +0 -8
- package/registry/styles/nova/empty.css +0 -52
- package/registry/styles/nova/field.css +0 -120
- package/registry/styles/nova/hover-card.css +0 -22
- package/registry/styles/nova/input-group.css +0 -98
- package/registry/styles/nova/input-otp.css +0 -102
- package/registry/styles/nova/input.css +0 -61
- package/registry/styles/nova/item.css +0 -133
- package/registry/styles/nova/kbd.css +0 -22
- package/registry/styles/nova/label.css +0 -74
- package/registry/styles/nova/marker.css +0 -35
- package/registry/styles/nova/menubar.css +0 -48
- package/registry/styles/nova/message-scroller.css +0 -47
- package/registry/styles/nova/message.css +0 -39
- package/registry/styles/nova/native-select.css +0 -82
- package/registry/styles/nova/navigation-menu.css +0 -90
- package/registry/styles/nova/pagination.css +0 -46
- package/registry/styles/nova/popover.css +0 -25
- package/registry/styles/nova/primitives/dialog-shell.css +0 -23
- package/registry/styles/nova/primitives/listbox.css +0 -79
- package/registry/styles/nova/primitives/menu.css +0 -108
- package/registry/styles/nova/primitives/popover.css +0 -16
- package/registry/styles/nova/progress.css +0 -92
- package/registry/styles/nova/questionnaire.css +0 -141
- package/registry/styles/nova/radio.css +0 -48
- package/registry/styles/nova/resizable.css +0 -43
- package/registry/styles/nova/scroll-area.css +0 -30
- package/registry/styles/nova/select.css +0 -80
- package/registry/styles/nova/separator.css +0 -14
- package/registry/styles/nova/sheet.css +0 -74
- package/registry/styles/nova/sidebar.css +0 -211
- package/registry/styles/nova/skeleton.css +0 -7
- package/registry/styles/nova/slider.css +0 -15
- package/registry/styles/nova/spinner.css +0 -35
- package/registry/styles/nova/switch.css +0 -110
- package/registry/styles/nova/table.css +0 -91
- package/registry/styles/nova/tabs.css +0 -133
- package/registry/styles/nova/textarea.css +0 -53
- package/registry/styles/nova/toast.css +0 -62
- package/registry/styles/nova/toggle-group.css +0 -48
- package/registry/styles/nova/toggle.css +0 -124
- package/registry/styles/nova/tooltip.css +0 -35
- package/registry/styles/nova/trace.css +0 -85
- package/registry/styles/rhea/accordion.css +0 -59
- package/registry/styles/rhea/alert-dialog.css +0 -82
- package/registry/styles/rhea/alert.css +0 -98
- package/registry/styles/rhea/aspect-ratio.css +0 -6
- package/registry/styles/rhea/attachment.css +0 -176
- package/registry/styles/rhea/avatar.css +0 -132
- package/registry/styles/rhea/badge.css +0 -112
- package/registry/styles/rhea/breadcrumb.css +0 -62
- package/registry/styles/rhea/bubble.css +0 -147
- package/registry/styles/rhea/button-group.css +0 -63
- package/registry/styles/rhea/button.css +0 -222
- package/registry/styles/rhea/calendar.css +0 -140
- package/registry/styles/rhea/card.css +0 -82
- package/registry/styles/rhea/carousel.css +0 -63
- package/registry/styles/rhea/chart.css +0 -51
- package/registry/styles/rhea/checkbox.css +0 -58
- package/registry/styles/rhea/code-block.css +0 -186
- package/registry/styles/rhea/collapsible.css +0 -50
- package/registry/styles/rhea/combobox.css +0 -59
- package/registry/styles/rhea/command.css +0 -27
- package/registry/styles/rhea/context-menu.css +0 -19
- package/registry/styles/rhea/dialog.css +0 -64
- package/registry/styles/rhea/drawer.css +0 -68
- package/registry/styles/rhea/dropdown-menu.css +0 -8
- package/registry/styles/rhea/empty.css +0 -52
- package/registry/styles/rhea/field.css +0 -120
- package/registry/styles/rhea/hover-card.css +0 -22
- package/registry/styles/rhea/input-group.css +0 -98
- package/registry/styles/rhea/input-otp.css +0 -102
- package/registry/styles/rhea/input.css +0 -61
- package/registry/styles/rhea/item.css +0 -133
- package/registry/styles/rhea/kbd.css +0 -22
- package/registry/styles/rhea/label.css +0 -74
- package/registry/styles/rhea/marker.css +0 -35
- package/registry/styles/rhea/menubar.css +0 -48
- package/registry/styles/rhea/message-scroller.css +0 -47
- package/registry/styles/rhea/message.css +0 -39
- package/registry/styles/rhea/native-select.css +0 -80
- package/registry/styles/rhea/navigation-menu.css +0 -90
- package/registry/styles/rhea/pagination.css +0 -46
- package/registry/styles/rhea/popover.css +0 -25
- package/registry/styles/rhea/primitives/dialog-shell.css +0 -19
- package/registry/styles/rhea/primitives/listbox.css +0 -79
- package/registry/styles/rhea/primitives/menu.css +0 -109
- package/registry/styles/rhea/primitives/popover.css +0 -16
- package/registry/styles/rhea/progress.css +0 -92
- package/registry/styles/rhea/questionnaire.css +0 -141
- package/registry/styles/rhea/radio.css +0 -48
- package/registry/styles/rhea/resizable.css +0 -44
- package/registry/styles/rhea/scroll-area.css +0 -30
- package/registry/styles/rhea/select.css +0 -80
- package/registry/styles/rhea/separator.css +0 -14
- package/registry/styles/rhea/sheet.css +0 -74
- package/registry/styles/rhea/sidebar.css +0 -211
- package/registry/styles/rhea/skeleton.css +0 -7
- package/registry/styles/rhea/slider.css +0 -15
- package/registry/styles/rhea/spinner.css +0 -35
- package/registry/styles/rhea/switch.css +0 -110
- package/registry/styles/rhea/table.css +0 -91
- package/registry/styles/rhea/tabs.css +0 -133
- package/registry/styles/rhea/textarea.css +0 -53
- package/registry/styles/rhea/toast.css +0 -62
- package/registry/styles/rhea/toggle-group.css +0 -59
- package/registry/styles/rhea/toggle.css +0 -128
- package/registry/styles/rhea/tooltip.css +0 -35
- package/registry/styles/rhea/trace.css +0 -85
- package/registry/styles/sera/accordion.css +0 -59
- package/registry/styles/sera/alert-dialog.css +0 -84
- package/registry/styles/sera/alert.css +0 -98
- package/registry/styles/sera/aspect-ratio.css +0 -6
- package/registry/styles/sera/attachment.css +0 -176
- package/registry/styles/sera/avatar.css +0 -132
- package/registry/styles/sera/badge.css +0 -143
- package/registry/styles/sera/breadcrumb.css +0 -62
- package/registry/styles/sera/bubble.css +0 -147
- package/registry/styles/sera/button-group.css +0 -63
- package/registry/styles/sera/button.css +0 -222
- package/registry/styles/sera/calendar.css +0 -148
- package/registry/styles/sera/card.css +0 -84
- package/registry/styles/sera/carousel.css +0 -63
- package/registry/styles/sera/chart.css +0 -51
- package/registry/styles/sera/checkbox.css +0 -58
- package/registry/styles/sera/code-block.css +0 -186
- package/registry/styles/sera/collapsible.css +0 -50
- package/registry/styles/sera/combobox.css +0 -60
- package/registry/styles/sera/command.css +0 -27
- package/registry/styles/sera/context-menu.css +0 -19
- package/registry/styles/sera/dialog.css +0 -67
- package/registry/styles/sera/drawer.css +0 -70
- package/registry/styles/sera/dropdown-menu.css +0 -8
- package/registry/styles/sera/empty.css +0 -52
- package/registry/styles/sera/field.css +0 -120
- package/registry/styles/sera/hover-card.css +0 -22
- package/registry/styles/sera/input-group.css +0 -99
- package/registry/styles/sera/input-otp.css +0 -103
- package/registry/styles/sera/input.css +0 -62
- package/registry/styles/sera/item.css +0 -133
- package/registry/styles/sera/kbd.css +0 -22
- package/registry/styles/sera/label.css +0 -74
- package/registry/styles/sera/marker.css +0 -35
- package/registry/styles/sera/menubar.css +0 -48
- package/registry/styles/sera/message-scroller.css +0 -47
- package/registry/styles/sera/message.css +0 -39
- package/registry/styles/sera/native-select.css +0 -81
- package/registry/styles/sera/navigation-menu.css +0 -90
- package/registry/styles/sera/pagination.css +0 -46
- package/registry/styles/sera/popover.css +0 -25
- package/registry/styles/sera/primitives/dialog-shell.css +0 -19
- package/registry/styles/sera/primitives/listbox.css +0 -79
- package/registry/styles/sera/primitives/menu.css +0 -108
- package/registry/styles/sera/primitives/popover.css +0 -16
- package/registry/styles/sera/progress.css +0 -92
- package/registry/styles/sera/questionnaire.css +0 -147
- package/registry/styles/sera/radio.css +0 -48
- package/registry/styles/sera/resizable.css +0 -44
- package/registry/styles/sera/scroll-area.css +0 -30
- package/registry/styles/sera/select.css +0 -81
- package/registry/styles/sera/separator.css +0 -14
- package/registry/styles/sera/sheet.css +0 -76
- package/registry/styles/sera/sidebar.css +0 -217
- package/registry/styles/sera/skeleton.css +0 -7
- package/registry/styles/sera/slider.css +0 -15
- package/registry/styles/sera/spinner.css +0 -35
- package/registry/styles/sera/switch.css +0 -111
- package/registry/styles/sera/table.css +0 -92
- package/registry/styles/sera/tabs.css +0 -133
- package/registry/styles/sera/textarea.css +0 -54
- package/registry/styles/sera/toast.css +0 -64
- package/registry/styles/sera/toggle-group.css +0 -58
- package/registry/styles/sera/toggle.css +0 -128
- package/registry/styles/sera/tooltip.css +0 -35
- package/registry/styles/sera/trace.css +0 -87
- package/registry/styles/vega/accordion.css +0 -59
- package/registry/styles/vega/alert-dialog.css +0 -82
- package/registry/styles/vega/alert.css +0 -98
- package/registry/styles/vega/aspect-ratio.css +0 -6
- package/registry/styles/vega/attachment.css +0 -176
- package/registry/styles/vega/avatar.css +0 -132
- package/registry/styles/vega/badge.css +0 -112
- package/registry/styles/vega/breadcrumb.css +0 -62
- package/registry/styles/vega/bubble.css +0 -147
- package/registry/styles/vega/button-group.css +0 -63
- package/registry/styles/vega/button.css +0 -222
- package/registry/styles/vega/calendar.css +0 -140
- package/registry/styles/vega/card.css +0 -82
- package/registry/styles/vega/carousel.css +0 -63
- package/registry/styles/vega/chart.css +0 -51
- package/registry/styles/vega/checkbox.css +0 -59
- package/registry/styles/vega/code-block.css +0 -186
- package/registry/styles/vega/collapsible.css +0 -50
- package/registry/styles/vega/combobox.css +0 -59
- package/registry/styles/vega/command.css +0 -27
- package/registry/styles/vega/context-menu.css +0 -19
- package/registry/styles/vega/dialog.css +0 -64
- package/registry/styles/vega/drawer.css +0 -68
- package/registry/styles/vega/dropdown-menu.css +0 -8
- package/registry/styles/vega/empty.css +0 -52
- package/registry/styles/vega/field.css +0 -120
- package/registry/styles/vega/hover-card.css +0 -22
- package/registry/styles/vega/input-group.css +0 -98
- package/registry/styles/vega/input-otp.css +0 -102
- package/registry/styles/vega/input.css +0 -62
- package/registry/styles/vega/item.css +0 -133
- package/registry/styles/vega/kbd.css +0 -22
- package/registry/styles/vega/label.css +0 -74
- package/registry/styles/vega/marker.css +0 -35
- package/registry/styles/vega/menubar.css +0 -48
- package/registry/styles/vega/message-scroller.css +0 -47
- package/registry/styles/vega/message.css +0 -39
- package/registry/styles/vega/native-select.css +0 -81
- package/registry/styles/vega/navigation-menu.css +0 -90
- package/registry/styles/vega/pagination.css +0 -46
- package/registry/styles/vega/popover.css +0 -25
- package/registry/styles/vega/primitives/dialog-shell.css +0 -19
- package/registry/styles/vega/primitives/listbox.css +0 -79
- package/registry/styles/vega/primitives/menu.css +0 -108
- package/registry/styles/vega/primitives/popover.css +0 -16
- package/registry/styles/vega/progress.css +0 -92
- package/registry/styles/vega/questionnaire.css +0 -141
- package/registry/styles/vega/radio.css +0 -48
- package/registry/styles/vega/resizable.css +0 -44
- package/registry/styles/vega/scroll-area.css +0 -30
- package/registry/styles/vega/select.css +0 -80
- package/registry/styles/vega/separator.css +0 -14
- package/registry/styles/vega/sheet.css +0 -74
- package/registry/styles/vega/sidebar.css +0 -211
- package/registry/styles/vega/skeleton.css +0 -7
- package/registry/styles/vega/slider.css +0 -15
- package/registry/styles/vega/spinner.css +0 -35
- package/registry/styles/vega/switch.css +0 -111
- package/registry/styles/vega/table.css +0 -91
- package/registry/styles/vega/tabs.css +0 -133
- package/registry/styles/vega/textarea.css +0 -54
- package/registry/styles/vega/toast.css +0 -62
- package/registry/styles/vega/toggle-group.css +0 -59
- package/registry/styles/vega/toggle.css +0 -128
- package/registry/styles/vega/tooltip.css +0 -35
- package/registry/styles/vega/trace.css +0 -85
- package/registry/tokens.css +0 -125
- package/registry/utilities.css +0 -14
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { posix } from "node:path";
|
|
3
|
+
import { parse as parseModule } from "acorn";
|
|
4
|
+
import Ajv2020Import from "ajv/dist/2020.js";
|
|
5
|
+
import { SCHEMA_VERSION } from "./constants.js";
|
|
6
|
+
import { compareVersions } from "./version.js";
|
|
7
|
+
export class RegistryValidationError extends Error {
|
|
8
|
+
errors;
|
|
9
|
+
constructor(message, errors = []) {
|
|
10
|
+
super([message, ...errors].map((line) => `- ${line}`).join("\n"));
|
|
11
|
+
this.name = "RegistryValidationError";
|
|
12
|
+
this.errors = errors;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function readAsset(name) {
|
|
16
|
+
const candidates = [
|
|
17
|
+
new URL(`./${name}`, import.meta.url),
|
|
18
|
+
new URL(`../registry/${name}`, import.meta.url)
|
|
19
|
+
];
|
|
20
|
+
for (const candidate of candidates) {
|
|
21
|
+
if (existsSync(candidate)) {
|
|
22
|
+
return JSON.parse(readFileSync(candidate, "utf8"));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
throw new Error(`Missing loseta registry asset: ${name}`);
|
|
26
|
+
}
|
|
27
|
+
function compileRules(definitions) {
|
|
28
|
+
return definitions.map((definition) => ({
|
|
29
|
+
regex: new RegExp(definition.pattern, definition.flags),
|
|
30
|
+
message: definition.message
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
function loadRules() {
|
|
34
|
+
const raw = readAsset("validation-rules.json");
|
|
35
|
+
return {
|
|
36
|
+
forbiddenEverywhere: compileRules(raw.forbiddenEverywhere),
|
|
37
|
+
forbiddenInBase: compileRules(raw.forbiddenInBase),
|
|
38
|
+
forbiddenInStyle: compileRules(raw.forbiddenInStyle),
|
|
39
|
+
forbiddenInBaseColor: compileRules(raw.forbiddenInBaseColor),
|
|
40
|
+
forbiddenOutsideTokens: compileRules(raw.forbiddenOutsideTokens),
|
|
41
|
+
promotionScaffold: new RegExp(raw.promotionScaffold),
|
|
42
|
+
behaviorImportPattern: new RegExp(raw.behaviorImportPattern, "g"),
|
|
43
|
+
forbiddenInBehaviors: compileRules(raw.forbiddenInBehaviors)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const itemSchema = readAsset("schema-item.json");
|
|
47
|
+
const catalogSchema = readAsset("schema-catalog.json");
|
|
48
|
+
const rules = loadRules();
|
|
49
|
+
const ajv = new Ajv2020Import({
|
|
50
|
+
allErrors: true,
|
|
51
|
+
strict: false
|
|
52
|
+
});
|
|
53
|
+
const validateItemSchema = ajv.compile(itemSchema);
|
|
54
|
+
const validateCatalogSchema = ajv.compile(catalogSchema);
|
|
55
|
+
function formatSchemaErrors(errors) {
|
|
56
|
+
return (errors ?? []).map((error) => `${error.instancePath || "/"} ${error.message ?? "is invalid"}`);
|
|
57
|
+
}
|
|
58
|
+
function isSafeRelativePath(value) {
|
|
59
|
+
if (!value || value.startsWith("/") || value.startsWith("\\"))
|
|
60
|
+
return false;
|
|
61
|
+
if (/^[A-Za-z]:[\\/]/.test(value))
|
|
62
|
+
return false;
|
|
63
|
+
if (value.includes("\\"))
|
|
64
|
+
return false;
|
|
65
|
+
const segments = value.split("/");
|
|
66
|
+
return segments.every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
67
|
+
}
|
|
68
|
+
function checkRelativePath(label, value, errors) {
|
|
69
|
+
if (!isSafeRelativePath(value)) {
|
|
70
|
+
errors.push(`${label}: unsafe path ${JSON.stringify(value)}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function testRules(source, definitions, label, errors) {
|
|
74
|
+
for (const rule of definitions) {
|
|
75
|
+
rule.regex.lastIndex = 0;
|
|
76
|
+
if (rule.regex.test(source)) {
|
|
77
|
+
errors.push(`${label}: ${rule.message}`);
|
|
78
|
+
}
|
|
79
|
+
rule.regex.lastIndex = 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function escapeRegExp(value) {
|
|
83
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
84
|
+
}
|
|
85
|
+
function hasLayer(content, layer) {
|
|
86
|
+
return new RegExp(`@layer\\s+${escapeRegExp(layer)}\\s*\\{`).test(content);
|
|
87
|
+
}
|
|
88
|
+
function checkBehaviorImports(source, behaviorPath, behaviorPaths, errors) {
|
|
89
|
+
rules.behaviorImportPattern.lastIndex = 0;
|
|
90
|
+
for (const match of source.matchAll(rules.behaviorImportPattern)) {
|
|
91
|
+
const specifier = match[1];
|
|
92
|
+
if (!specifier)
|
|
93
|
+
continue;
|
|
94
|
+
if (!specifier.startsWith("./") && !specifier.startsWith("../")) {
|
|
95
|
+
errors.push(`${behaviorPath}: behavior imports must be relative: ${specifier}`);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const resolved = posix.normalize(posix.join(posix.dirname(behaviorPath), specifier));
|
|
99
|
+
if (resolved.startsWith("../") ||
|
|
100
|
+
resolved === ".." ||
|
|
101
|
+
resolved.startsWith("/") ||
|
|
102
|
+
!resolved.startsWith("behaviors/")) {
|
|
103
|
+
errors.push(`${behaviorPath}: import escapes behaviors/: ${specifier}`);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (!behaviorPaths.has(resolved)) {
|
|
107
|
+
errors.push(`${behaviorPath}: imported module is not included in the payload: ${specifier}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function checkExample(example, itemName, errors) {
|
|
112
|
+
if (!example.title.trim()) {
|
|
113
|
+
errors.push(`${itemName}: example title must not be empty`);
|
|
114
|
+
}
|
|
115
|
+
if (!example.html.trim()) {
|
|
116
|
+
errors.push(`${itemName}: example HTML must not be empty`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function validateFiles(item, style, errors) {
|
|
120
|
+
const stylePrefix = `styles/${style}/`;
|
|
121
|
+
const targets = new Set();
|
|
122
|
+
let baseFiles = 0;
|
|
123
|
+
let styleFiles = 0;
|
|
124
|
+
for (const file of item.files) {
|
|
125
|
+
const label = `${item.name}: ${file.path}`;
|
|
126
|
+
if (targets.has(file.target)) {
|
|
127
|
+
errors.push(`${label}: duplicate file target ${file.target}`);
|
|
128
|
+
}
|
|
129
|
+
targets.add(file.target);
|
|
130
|
+
checkRelativePath(`${label}: path`, file.path, errors);
|
|
131
|
+
checkRelativePath(`${label}: target`, file.target, errors);
|
|
132
|
+
if (file.role === "base") {
|
|
133
|
+
baseFiles += 1;
|
|
134
|
+
if (file.target.startsWith("styles/")) {
|
|
135
|
+
errors.push(`${label}: base file target must not live under styles/: ${file.target}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
styleFiles += 1;
|
|
140
|
+
if (!file.path.startsWith(stylePrefix)) {
|
|
141
|
+
errors.push(`${label}: style file must live under ${stylePrefix}`);
|
|
142
|
+
}
|
|
143
|
+
if (!file.target.startsWith(stylePrefix)) {
|
|
144
|
+
errors.push(`${label}: style target must start with ${stylePrefix}: ${file.target}`);
|
|
145
|
+
}
|
|
146
|
+
if (item.status === "stable" && rules.promotionScaffold.test(file.content)) {
|
|
147
|
+
errors.push(`${label}: remove the promotion scaffold before promoting`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (!hasLayer(file.content, file.layer)) {
|
|
151
|
+
errors.push(`${label}: is not wrapped in @layer ${file.layer}`);
|
|
152
|
+
}
|
|
153
|
+
testRules(file.content, rules.forbiddenEverywhere, label, errors);
|
|
154
|
+
if (file.role === "base") {
|
|
155
|
+
testRules(file.content, rules.forbiddenInBase, label, errors);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
testRules(file.content, rules.forbiddenInStyle, label, errors);
|
|
159
|
+
}
|
|
160
|
+
if (file.layer !== "loseta.tokens") {
|
|
161
|
+
testRules(file.content, rules.forbiddenOutsideTokens, label, errors);
|
|
162
|
+
}
|
|
163
|
+
if (file.role === "base" && file.layer !== "loseta.tokens") {
|
|
164
|
+
testRules(file.content, rules.forbiddenInBaseColor, label, errors);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (item.type === "component" || item.type === "primitive") {
|
|
168
|
+
if (baseFiles === 0)
|
|
169
|
+
errors.push(`${item.name}: expected a base file`);
|
|
170
|
+
if (styleFiles === 0) {
|
|
171
|
+
errors.push(`${item.name}: expected a ${style} style file`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (item.type === "foundation") {
|
|
175
|
+
if (styleFiles > 0) {
|
|
176
|
+
errors.push(`${item.name}: foundation items do not have style files`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function validateBehaviors(item, errors) {
|
|
181
|
+
const targets = new Set();
|
|
182
|
+
const behaviorPaths = new Set((item.behaviors ?? []).map((behavior) => behavior.path));
|
|
183
|
+
let hasCore = false;
|
|
184
|
+
for (const behavior of item.behaviors ?? []) {
|
|
185
|
+
const label = `${item.name}: ${behavior.path}`;
|
|
186
|
+
checkRelativePath(`${label}: path`, behavior.path, errors);
|
|
187
|
+
checkRelativePath(`${label}: target`, behavior.target, errors);
|
|
188
|
+
if (!behavior.path.startsWith("behaviors/")) {
|
|
189
|
+
errors.push(`${label}: behavior source must start with behaviors/: ${behavior.path}`);
|
|
190
|
+
}
|
|
191
|
+
if (!behavior.target.startsWith("behaviors/")) {
|
|
192
|
+
errors.push(`${label}: behavior target must start with behaviors/: ${behavior.target}`);
|
|
193
|
+
}
|
|
194
|
+
if (behavior.path !== behavior.target) {
|
|
195
|
+
errors.push(`${label}: behavior source and target must match so relative imports keep working`);
|
|
196
|
+
}
|
|
197
|
+
if (targets.has(behavior.target)) {
|
|
198
|
+
errors.push(`${label}: duplicate behavior target ${behavior.target}`);
|
|
199
|
+
}
|
|
200
|
+
targets.add(behavior.target);
|
|
201
|
+
if (behavior.path === "behaviors/core.js" && behavior.kind === "support") {
|
|
202
|
+
hasCore = true;
|
|
203
|
+
}
|
|
204
|
+
testRules(behavior.content, rules.forbiddenInBehaviors, label, errors);
|
|
205
|
+
try {
|
|
206
|
+
parseModule(behavior.content, {
|
|
207
|
+
ecmaVersion: "latest",
|
|
208
|
+
sourceType: "module",
|
|
209
|
+
allowHashBang: true
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
errors.push(`${label}: ESM parse error: ${error.message}`);
|
|
214
|
+
}
|
|
215
|
+
checkBehaviorImports(behavior.content, behavior.path, behaviorPaths, errors);
|
|
216
|
+
}
|
|
217
|
+
if ((item.behaviors ?? []).length > 0 && !hasCore) {
|
|
218
|
+
errors.push(`${item.name}: behavior items must include behaviors/core.js as a support entry`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function checkDependencies(item, urlSource, errors) {
|
|
222
|
+
for (const dependency of item.registryDependencies ?? []) {
|
|
223
|
+
if (!dependency.trim()) {
|
|
224
|
+
errors.push(`${item.name}: empty registry dependency`);
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
if (urlSource) {
|
|
228
|
+
let parsed;
|
|
229
|
+
try {
|
|
230
|
+
parsed = new URL(dependency);
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
parsed = undefined;
|
|
234
|
+
}
|
|
235
|
+
if (parsed) {
|
|
236
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") {
|
|
237
|
+
errors.push(`${item.name}: unsupported dependency URL: ${dependency}`);
|
|
238
|
+
}
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
if (!/^[a-z][a-z0-9-]*$/.test(dependency)) {
|
|
242
|
+
errors.push(`${item.name}: URL installs require official names or absolute URLs for dependencies: ${dependency}`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
export function assertCompatible(meta, cliVersion) {
|
|
248
|
+
if (meta.schemaVersion !== SCHEMA_VERSION) {
|
|
249
|
+
throw new RegistryValidationError(`Unsupported registry schema version ${meta.schemaVersion}; this CLI supports ${SCHEMA_VERSION}. Run \`npx loseta@latest\`.`);
|
|
250
|
+
}
|
|
251
|
+
if (compareVersions(cliVersion, meta.minCliVersion) < 0) {
|
|
252
|
+
throw new RegistryValidationError(`This registry requires loseta ${meta.minCliVersion} or newer; this CLI is ${cliVersion}. Run \`npx loseta@latest\`.`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
export function validateCatalog(value) {
|
|
256
|
+
if (!validateCatalogSchema(value)) {
|
|
257
|
+
throw new RegistryValidationError("Invalid registry catalog", formatSchemaErrors(validateCatalogSchema.errors));
|
|
258
|
+
}
|
|
259
|
+
const catalog = value;
|
|
260
|
+
const errors = [];
|
|
261
|
+
const styleNames = new Set();
|
|
262
|
+
for (const style of catalog.styles) {
|
|
263
|
+
if (styleNames.has(style.name)) {
|
|
264
|
+
errors.push(`duplicate style: ${style.name}`);
|
|
265
|
+
}
|
|
266
|
+
styleNames.add(style.name);
|
|
267
|
+
}
|
|
268
|
+
if (!styleNames.has("nova")) {
|
|
269
|
+
errors.push('styles: the default "nova" style is not declared');
|
|
270
|
+
}
|
|
271
|
+
const itemNames = new Set();
|
|
272
|
+
for (const item of catalog.items) {
|
|
273
|
+
if (itemNames.has(item.name)) {
|
|
274
|
+
errors.push(`duplicate item: ${item.name}`);
|
|
275
|
+
}
|
|
276
|
+
itemNames.add(item.name);
|
|
277
|
+
for (const file of item.files) {
|
|
278
|
+
const label = `${item.name}: ${file.path}`;
|
|
279
|
+
checkRelativePath(`${label}: path`, file.path, errors);
|
|
280
|
+
checkRelativePath(`${label}: target`, file.target, errors);
|
|
281
|
+
if (file.role === "style") {
|
|
282
|
+
const match = /^styles\/([^/]+)\//.exec(file.path);
|
|
283
|
+
if (!match) {
|
|
284
|
+
errors.push(`${label}: style file must live under styles/<style>/`);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
if (!styleNames.has(match[1] ?? "")) {
|
|
288
|
+
errors.push(`${label}: undeclared style ${match[1]}`);
|
|
289
|
+
}
|
|
290
|
+
if (!file.target.startsWith(`styles/${match[1]}/`)) {
|
|
291
|
+
errors.push(`${label}: style target does not match ${match[1]}: ${file.target}`);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else if (file.target.startsWith("styles/") || file.path.startsWith("styles/")) {
|
|
296
|
+
errors.push(`${label}: base file must not live under styles/`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
for (const behavior of item.behaviors ?? []) {
|
|
300
|
+
checkRelativePath(`${item.name}: ${behavior.path}`, behavior.path, errors);
|
|
301
|
+
checkRelativePath(`${item.name}: ${behavior.target}`, behavior.target, errors);
|
|
302
|
+
if (!behavior.target.startsWith("behaviors/")) {
|
|
303
|
+
errors.push(`${item.name}: behavior target must start with behaviors/: ${behavior.target}`);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (item.type === "component" || item.type === "primitive") {
|
|
307
|
+
for (const style of styleNames) {
|
|
308
|
+
if (item.status === "stable" && !item.hashes?.[style]) {
|
|
309
|
+
errors.push(`${item.name}: missing ${style} hash`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (item.status === "experimental") {
|
|
313
|
+
if (!item.hashes?.nova) {
|
|
314
|
+
errors.push(`${item.name}: experimental items need a nova hash`);
|
|
315
|
+
}
|
|
316
|
+
for (const style of Object.keys(item.hashes ?? {})) {
|
|
317
|
+
if (style !== "nova") {
|
|
318
|
+
errors.push(`${item.name}: experimental items are Nova-only; found ${style} hash`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (item.type === "foundation" && !item.hash) {
|
|
324
|
+
errors.push(`${item.name}: foundation items need a hash`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (catalog.schemaVersion !== SCHEMA_VERSION) {
|
|
328
|
+
errors.push(`catalog schema version ${catalog.schemaVersion} is not ${SCHEMA_VERSION}`);
|
|
329
|
+
}
|
|
330
|
+
if (errors.length > 0) {
|
|
331
|
+
throw new RegistryValidationError("Invalid registry catalog", errors);
|
|
332
|
+
}
|
|
333
|
+
return catalog;
|
|
334
|
+
}
|
|
335
|
+
export function validateItemPayload(value, options) {
|
|
336
|
+
if (!validateItemSchema(value)) {
|
|
337
|
+
throw new RegistryValidationError("Invalid registry item payload", formatSchemaErrors(validateItemSchema.errors));
|
|
338
|
+
}
|
|
339
|
+
const item = value;
|
|
340
|
+
const errors = [];
|
|
341
|
+
if (options.schemaVersion !== undefined && item.schemaVersion !== options.schemaVersion) {
|
|
342
|
+
errors.push(`schema version ${item.schemaVersion} does not match ${options.schemaVersion}`);
|
|
343
|
+
}
|
|
344
|
+
if (options.cliVersion !== undefined) {
|
|
345
|
+
try {
|
|
346
|
+
assertCompatible(item, options.cliVersion);
|
|
347
|
+
}
|
|
348
|
+
catch (error) {
|
|
349
|
+
errors.push(error.message.replace(/^- /gm, ""));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (item.type === "style") {
|
|
353
|
+
errors.push(`${item.name}: style items cannot be installed`);
|
|
354
|
+
}
|
|
355
|
+
if (options.urlSource && item.type !== "component" && item.type !== "primitive") {
|
|
356
|
+
errors.push(`${item.name}: URL installs only accept component and primitive items`);
|
|
357
|
+
}
|
|
358
|
+
if (item.type === "component" || item.type === "primitive") {
|
|
359
|
+
if (item.style !== options.style) {
|
|
360
|
+
errors.push(`${item.name}: payload style ${item.style ?? "(none)"} does not match the project style ${options.style}`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
else if (item.style !== undefined) {
|
|
364
|
+
errors.push(`${item.name}: ${item.type} items must not declare a style`);
|
|
365
|
+
}
|
|
366
|
+
if (item.status === "experimental") {
|
|
367
|
+
if (options.style !== "nova") {
|
|
368
|
+
errors.push(`${item.name}: experimental items are Nova-only`);
|
|
369
|
+
}
|
|
370
|
+
if (options.urlSource && !options.experimental) {
|
|
371
|
+
errors.push(`${item.name}: experimental items require --experimental`);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
checkDependencies(item, Boolean(options.urlSource), errors);
|
|
375
|
+
validateFiles(item, options.style, errors);
|
|
376
|
+
validateBehaviors(item, errors);
|
|
377
|
+
for (const example of item.examples ?? []) {
|
|
378
|
+
checkExample(example, item.name, errors);
|
|
379
|
+
}
|
|
380
|
+
if (errors.length > 0) {
|
|
381
|
+
throw new RegistryValidationError(`Invalid registry item payload: ${item.name}`, errors);
|
|
382
|
+
}
|
|
383
|
+
return item;
|
|
384
|
+
}
|
|
385
|
+
//# sourceMappingURL=validate-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-content.js","sourceRoot":"","sources":["../src/validate-content.ts"],"names":[],"mapp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YAC/C,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,6CAA6C,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5D,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3C,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;QAC1C,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,uBAAuB,CAC/B,kCAAkC,IAAI,CAAC,IAAI,EAAE,EAC7C,MAAM,CACP,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"forbiddenEverywhere": [
|
|
3
|
+
{ "pattern": "!important", "flags": "g", "message": "!important is not allowed" },
|
|
4
|
+
{
|
|
5
|
+
"pattern": "html\\.dark",
|
|
6
|
+
"flags": "g",
|
|
7
|
+
"message": "use .dark / .light on any container; html.dark blocks scoped overrides"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"forbiddenInBase": [
|
|
11
|
+
{
|
|
12
|
+
"pattern": "\\[class\\*='size-'\\]",
|
|
13
|
+
"flags": "g",
|
|
14
|
+
"message": "Tailwind size-* sniffing is not allowed"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"pattern": "\\.border-[bt]\\b",
|
|
18
|
+
"flags": "g",
|
|
19
|
+
"message": "Tailwind border utilities are not allowed"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"pattern": "\\.peer\\b",
|
|
23
|
+
"flags": "g",
|
|
24
|
+
"message": ".peer is a Tailwind dependency"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"pattern": "\\.active\\b",
|
|
28
|
+
"flags": "g",
|
|
29
|
+
"message": ".active is replaced by data-highlighted / ARIA state"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"pattern": "@layer components",
|
|
33
|
+
"flags": "g",
|
|
34
|
+
"message": "use loseta.* layers"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"pattern": "\\[data-state=['\"]selected['\"]\\]",
|
|
38
|
+
"flags": "g",
|
|
39
|
+
"message": "use aria-selected"
|
|
40
|
+
},
|
|
41
|
+
{ "pattern": "\\[data-invalid\\]", "flags": "g", "message": "use aria-invalid" },
|
|
42
|
+
{
|
|
43
|
+
"pattern": "\\[data-disabled",
|
|
44
|
+
"flags": "g",
|
|
45
|
+
"message": "use :disabled or aria-disabled"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"pattern": "\\[data-selected",
|
|
49
|
+
"flags": "g",
|
|
50
|
+
"message": "use aria-selected"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"pattern": "\\[data-title\\]",
|
|
54
|
+
"flags": "g",
|
|
55
|
+
"message": "use data-slot=\"title\""
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"pattern": "\\[data-description\\]",
|
|
59
|
+
"flags": "g",
|
|
60
|
+
"message": "use data-slot=\"description\""
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"pattern": "\\[data-shortcut\\]",
|
|
64
|
+
"flags": "g",
|
|
65
|
+
"message": "use data-slot=\"shortcut\""
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"pattern": "\\[data-indicator\\]",
|
|
69
|
+
"flags": "g",
|
|
70
|
+
"message": "use data-slot=\"indicator\""
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"forbiddenInStyle": [
|
|
74
|
+
{
|
|
75
|
+
"pattern": "(?:padding|margin|border)-(?:left|right)\\b",
|
|
76
|
+
"flags": "g",
|
|
77
|
+
"message": "use logical properties (padding-inline-start/-end, margin-inline-start/-end, border-inline-start/-end)"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"forbiddenInBaseColor": [
|
|
81
|
+
{ "pattern": "light-dark\\(", "flags": "g", "message": "dark values belong in the style layer" }
|
|
82
|
+
],
|
|
83
|
+
"forbiddenOutsideTokens": [
|
|
84
|
+
{
|
|
85
|
+
"pattern": "@media \\(prefers-color-scheme",
|
|
86
|
+
"flags": "g",
|
|
87
|
+
"message": "the OS color scheme belongs in the tokens layer"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"promotionScaffold": "/\\*\\s*loseta:promotion-scaffold\\s*\\*/",
|
|
91
|
+
"behaviorImportPattern": "\\bimport\\s+(?:[^'\"]*?\\s+from\\s+)?[\"']([^\"']+)[\"']",
|
|
92
|
+
"forbiddenInBehaviors": [
|
|
93
|
+
{ "pattern": "data-state", "flags": "g", "message": "use the documented ARIA or data-* state" },
|
|
94
|
+
{
|
|
95
|
+
"pattern": "data-demo-",
|
|
96
|
+
"flags": "g",
|
|
97
|
+
"message": "demo hooks must not ship in behavior modules"
|
|
98
|
+
},
|
|
99
|
+
{ "pattern": "\\beval\\s*\\(", "flags": "g", "message": "eval is not allowed" },
|
|
100
|
+
{
|
|
101
|
+
"pattern": "new\\s+Function\\s*\\(",
|
|
102
|
+
"flags": "g",
|
|
103
|
+
"message": "new Function is not allowed"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"pattern": "\\.innerHTML\\b",
|
|
107
|
+
"flags": "g",
|
|
108
|
+
"message": "use DOM APIs instead of innerHTML"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"pattern": "\\.outerHTML\\b",
|
|
112
|
+
"flags": "g",
|
|
113
|
+
"message": "use DOM APIs instead of outerHTML"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"pattern": "document\\.write\\b",
|
|
117
|
+
"flags": "g",
|
|
118
|
+
"message": "document.write is not allowed"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares two dotted numeric versions. Prerelease suffixes are ignored so
|
|
3
|
+
* `0.20.0-beta.1` compares as `0.20.0`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function compareVersions(left: string, right: string): number;
|
|
6
|
+
export declare function isVersionAtLeast(version: string, minimum: string): boolean;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares two dotted numeric versions. Prerelease suffixes are ignored so
|
|
3
|
+
* `0.20.0-beta.1` compares as `0.20.0`.
|
|
4
|
+
*/
|
|
5
|
+
export function compareVersions(left, right) {
|
|
6
|
+
const parse = (value) => value
|
|
7
|
+
.trim()
|
|
8
|
+
.replace(/^v/, "")
|
|
9
|
+
.split(/[.+-]/)
|
|
10
|
+
.map((part) => {
|
|
11
|
+
const match = /^\d+/.exec(part);
|
|
12
|
+
return match ? Number(match[0]) : 0;
|
|
13
|
+
});
|
|
14
|
+
const a = parse(left);
|
|
15
|
+
const b = parse(right);
|
|
16
|
+
for (let index = 0; index < Math.max(a.length, b.length); index += 1) {
|
|
17
|
+
const difference = (a[index] ?? 0) - (b[index] ?? 0);
|
|
18
|
+
if (difference !== 0)
|
|
19
|
+
return difference;
|
|
20
|
+
}
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
23
|
+
export function isVersionAtLeast(version, minimum) {
|
|
24
|
+
return compareVersions(version, minimum) >= 0;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,KAAa;IACzD,MAAM,KAAK,GAAG,CAAC,KAAa,EAAY,EAAE,CACxC,KAAK;SACF,IAAI,EAAE;SACN,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;SACjB,KAAK,CAAC,OAAO,CAAC;SACd,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEP,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IACtB,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACrE,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACrD,IAAI,UAAU,KAAK,CAAC;YAAE,OAAO,UAAU,CAAC;IAC1C,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,OAAe;IAC/D,OAAO,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loseta",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Native CSS component scaffolds with the shadcn feel.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,32 +29,32 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"bin",
|
|
31
31
|
"dist",
|
|
32
|
-
"registry",
|
|
33
32
|
"NOTICE"
|
|
34
33
|
],
|
|
35
34
|
"engines": {
|
|
36
|
-
"node": ">=20"
|
|
35
|
+
"node": ">=20.12.0"
|
|
37
36
|
},
|
|
38
37
|
"scripts": {
|
|
39
|
-
"build": "tsc -p tsconfig.json",
|
|
38
|
+
"build": "tsc -p tsconfig.json && node scripts/copy-assets.mjs",
|
|
40
39
|
"dev": "tsx src/cli.ts",
|
|
40
|
+
"deps:check": "node scripts/check-dependencies.mjs",
|
|
41
|
+
"deps:report": "node scripts/check-dependencies.mjs --report",
|
|
41
42
|
"smoke": "bash scripts/smoke-init.sh",
|
|
42
43
|
"validate": "node scripts/validate-registry.mjs",
|
|
43
44
|
"examples": "tsx scripts/generate-examples.ts",
|
|
44
|
-
"check": "pnpm build && pnpm validate && pnpm behaviors:check",
|
|
45
|
+
"check": "pnpm build && pnpm validate && pnpm deps:check && pnpm behaviors:check",
|
|
45
46
|
"test": "tsx --test test/*.test.ts",
|
|
46
47
|
"prepack": "pnpm build",
|
|
47
48
|
"prepublishOnly": "pnpm validate",
|
|
48
49
|
"behaviors:check": "tsc -p tsconfig.behaviors.json"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
|
-
"@
|
|
52
|
-
"
|
|
53
|
-
"
|
|
52
|
+
"@topcli/prompts": "^2.4.1",
|
|
53
|
+
"acorn": "^8.15.0",
|
|
54
|
+
"ajv": "^8.20.0"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@types/node": "^26.6.6",
|
|
57
|
-
"ajv": "^8.20.0",
|
|
58
58
|
"lightningcss": "^1.33.0",
|
|
59
59
|
"tsx": "^4.23.15",
|
|
60
60
|
"typescript": "^5.9.3"
|
package/registry/base.css
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* Element defaults. Structural only: visual decisions live in the style layer. */
|
|
2
|
-
@layer loseta.base {
|
|
3
|
-
body {
|
|
4
|
-
background-color: var(--background);
|
|
5
|
-
color: var(--foreground);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
* {
|
|
9
|
-
outline-color: color-mix(in oklab, var(--ring) 50%, transparent);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
button:not(:disabled),
|
|
13
|
-
[role='button']:not(:disabled) {
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
::selection {
|
|
18
|
-
background-color: color-mix(in oklab, var(--primary) 20%, transparent);
|
|
19
|
-
}
|
|
20
|
-
}
|