termcast 1.3.10 → 1.3.18
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/dist/apis/toast.d.ts +1 -5
- package/dist/apis/toast.d.ts.map +1 -1
- package/dist/apis/toast.js +23 -17
- package/dist/apis/toast.js.map +1 -1
- package/dist/build.d.ts +2 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +4 -3
- package/dist/build.js.map +1 -1
- package/dist/cli.js +42 -0
- package/dist/cli.js.map +1 -1
- package/dist/colors.d.ts +8 -1
- package/dist/colors.d.ts.map +1 -1
- package/dist/colors.js +12 -0
- package/dist/colors.js.map +1 -1
- package/dist/compile.d.ts +30 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +156 -0
- package/dist/compile.js.map +1 -0
- package/dist/components/actions.d.ts +1 -0
- package/dist/components/actions.d.ts.map +1 -1
- package/dist/components/actions.js +5 -2
- package/dist/components/actions.js.map +1 -1
- package/dist/components/command-arguments.d.ts +9 -0
- package/dist/components/command-arguments.d.ts.map +1 -0
- package/dist/components/command-arguments.js +21 -0
- package/dist/components/command-arguments.js.map +1 -0
- package/dist/components/detail.d.ts +1 -1
- package/dist/components/detail.d.ts.map +1 -1
- package/dist/components/detail.js +17 -39
- package/dist/components/detail.js.map +1 -1
- package/dist/components/dropdown.d.ts +1 -0
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +77 -21
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/extension-preferences.d.ts.map +1 -1
- package/dist/components/extension-preferences.js +19 -29
- package/dist/components/extension-preferences.js.map +1 -1
- package/dist/components/form/checkbox.d.ts.map +1 -1
- package/dist/components/form/checkbox.js +9 -2
- package/dist/components/form/checkbox.js.map +1 -1
- package/dist/components/form/date-picker.d.ts.map +1 -1
- package/dist/components/form/date-picker.js +15 -28
- package/dist/components/form/date-picker.js.map +1 -1
- package/dist/components/form/description.d.ts +2 -0
- package/dist/components/form/description.d.ts.map +1 -1
- package/dist/components/form/description.js +20 -2
- package/dist/components/form/description.js.map +1 -1
- package/dist/components/form/dropdown.d.ts.map +1 -1
- package/dist/components/form/dropdown.js +13 -28
- package/dist/components/form/dropdown.js.map +1 -1
- package/dist/components/form/file-autocomplete.d.ts +7 -4
- package/dist/components/form/file-autocomplete.d.ts.map +1 -1
- package/dist/components/form/file-autocomplete.js +54 -46
- package/dist/components/form/file-autocomplete.js.map +1 -1
- package/dist/components/form/file-picker.d.ts +5 -0
- package/dist/components/form/file-picker.d.ts.map +1 -1
- package/dist/components/form/file-picker.js +46 -49
- package/dist/components/form/file-picker.js.map +1 -1
- package/dist/components/form/form-ref.d.ts +43 -0
- package/dist/components/form/form-ref.d.ts.map +1 -0
- package/dist/components/form/form-ref.js +53 -0
- package/dist/components/form/form-ref.js.map +1 -0
- package/dist/components/form/index.d.ts +16 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +86 -23
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/password-field.d.ts.map +1 -1
- package/dist/components/form/password-field.js +32 -16
- package/dist/components/form/password-field.js.map +1 -1
- package/dist/components/form/text-area.d.ts.map +1 -1
- package/dist/components/form/text-area.js +32 -15
- package/dist/components/form/text-area.js.map +1 -1
- package/dist/components/form/text-field.d.ts.map +1 -1
- package/dist/components/form/text-field.js +37 -17
- package/dist/components/form/text-field.js.map +1 -1
- package/dist/components/form/use-form-navigation.d.ts +4 -0
- package/dist/components/form/use-form-navigation.d.ts.map +1 -1
- package/dist/components/form/use-form-navigation.js +35 -18
- package/dist/components/form/use-form-navigation.js.map +1 -1
- package/dist/components/form/with-left-border.d.ts.map +1 -1
- package/dist/components/form/with-left-border.js +2 -2
- package/dist/components/form/with-left-border.js.map +1 -1
- package/dist/components/icon.d.ts +3 -1
- package/dist/components/icon.d.ts.map +1 -1
- package/dist/components/icon.js +494 -469
- package/dist/components/icon.js.map +1 -1
- package/dist/components/list.d.ts +11 -7
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +170 -38
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-bar.js +1 -1
- package/dist/components/loading-bar.js.map +1 -1
- package/dist/descendants.d.ts.map +1 -1
- package/dist/descendants.js +8 -5
- package/dist/descendants.js.map +1 -1
- package/dist/examples/action-show-in-finder.js +1 -1
- package/dist/examples/action-show-in-finder.js.map +1 -1
- package/dist/examples/environment-test.js +1 -1
- package/dist/examples/environment-test.js.map +1 -1
- package/dist/examples/error-boundary.js +1 -1
- package/dist/examples/error-boundary.js.map +1 -1
- package/dist/examples/form-basic.d.ts.map +1 -1
- package/dist/examples/form-basic.js +2 -2
- package/dist/examples/form-basic.js.map +1 -1
- package/dist/examples/form-dropdown.js +1 -1
- package/dist/examples/form-dropdown.js.map +1 -1
- package/dist/examples/form-scroll.d.ts +2 -0
- package/dist/examples/form-scroll.d.ts.map +1 -0
- package/dist/examples/form-scroll.js +8 -0
- package/dist/examples/form-scroll.js.map +1 -0
- package/dist/examples/form-tagpicker.js +1 -1
- package/dist/examples/form-tagpicker.js.map +1 -1
- package/dist/examples/internal/descendants-filtering.js +8 -3
- package/dist/examples/internal/descendants-filtering.js.map +1 -1
- package/dist/examples/internal/descendants.js +10 -3
- package/dist/examples/internal/descendants.js.map +1 -1
- package/dist/examples/internal/rhf-custom-ref.d.ts +2 -0
- package/dist/examples/internal/rhf-custom-ref.d.ts.map +1 -0
- package/dist/examples/internal/rhf-custom-ref.js +67 -0
- package/dist/examples/internal/rhf-custom-ref.js.map +1 -0
- package/dist/examples/internal/scrollbox-demo.js +3 -7
- package/dist/examples/internal/scrollbox-demo.js.map +1 -1
- package/dist/examples/internal/scrollbox-with-descendants.d.ts +2 -0
- package/dist/examples/internal/scrollbox-with-descendants.d.ts.map +1 -0
- package/dist/examples/internal/scrollbox-with-descendants.js +63 -0
- package/dist/examples/internal/scrollbox-with-descendants.js.map +1 -0
- package/dist/examples/internal/simple-dialog.js +1 -1
- package/dist/examples/internal/simple-dialog.js.map +1 -1
- package/dist/examples/internal/simple-scrollbox.js +2 -3
- package/dist/examples/internal/simple-scrollbox.js.map +1 -1
- package/dist/examples/internal/text-stacking.js +4 -2
- package/dist/examples/internal/text-stacking.js.map +1 -1
- package/dist/examples/list-dropdown-default.js +1 -1
- package/dist/examples/list-dropdown-default.js.map +1 -1
- package/dist/examples/list-fetch-data.js +1 -1
- package/dist/examples/list-fetch-data.js.map +1 -1
- package/dist/examples/list-scrollbox.d.ts +2 -0
- package/dist/examples/list-scrollbox.d.ts.map +1 -0
- package/dist/examples/list-scrollbox.js +29 -0
- package/dist/examples/list-scrollbox.js.map +1 -0
- package/dist/examples/list-with-detail.js +1 -1
- package/dist/examples/list-with-detail.js.map +1 -1
- package/dist/examples/list-with-dropdown.js +1 -1
- package/dist/examples/list-with-dropdown.js.map +1 -1
- package/dist/examples/list-with-sections.js +3 -3
- package/dist/examples/list-with-sections.js.map +1 -1
- package/dist/examples/miscellaneous.js +1 -1
- package/dist/examples/miscellaneous.js.map +1 -1
- package/dist/examples/nested-navigation.js +4 -2
- package/dist/examples/nested-navigation.js.map +1 -1
- package/dist/examples/preferences-test.js +1 -1
- package/dist/examples/preferences-test.js.map +1 -1
- package/dist/examples/simple-dropdown.js +1 -1
- package/dist/examples/simple-dropdown.js.map +1 -1
- package/dist/examples/simple-file-picker.js +1 -1
- package/dist/examples/simple-file-picker.js.map +1 -1
- package/dist/examples/simple-grid.js +1 -1
- package/dist/examples/simple-grid.js.map +1 -1
- package/dist/examples/simple-hud.js +1 -1
- package/dist/examples/simple-hud.js.map +1 -1
- package/dist/examples/simple-list-search.js +1 -1
- package/dist/examples/simple-list-search.js.map +1 -1
- package/dist/examples/simple-list.js +1 -1
- package/dist/examples/simple-list.js.map +1 -1
- package/dist/examples/simple-navigation.js +4 -2
- package/dist/examples/simple-navigation.js.map +1 -1
- package/dist/examples/store.js +1 -1
- package/dist/examples/store.js.map +1 -1
- package/dist/examples/submodule-diff.d.ts +2 -0
- package/dist/examples/submodule-diff.d.ts.map +1 -0
- package/dist/examples/submodule-diff.js +99 -0
- package/dist/examples/submodule-diff.js.map +1 -0
- package/dist/examples/tanstack-demo.js +1 -1
- package/dist/examples/tanstack-demo.js.map +1 -1
- package/dist/examples/use-promise-demo.js +1 -1
- package/dist/examples/use-promise-demo.js.map +1 -1
- package/dist/extensions/dev.d.ts +8 -0
- package/dist/extensions/dev.d.ts.map +1 -1
- package/dist/extensions/dev.js +53 -28
- package/dist/extensions/dev.js.map +1 -1
- package/dist/extensions/home.d.ts.map +1 -1
- package/dist/extensions/home.js +16 -91
- package/dist/extensions/home.js.map +1 -1
- package/dist/globals.js +1 -1
- package/dist/globals.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/date-picker-widget.d.ts.map +1 -1
- package/dist/internal/date-picker-widget.js +56 -48
- package/dist/internal/date-picker-widget.js.map +1 -1
- package/dist/internal/dialog.d.ts.map +1 -1
- package/dist/internal/dialog.js +7 -7
- package/dist/internal/dialog.js.map +1 -1
- package/dist/internal/scrollbox.d.ts +2 -1
- package/dist/internal/scrollbox.d.ts.map +1 -1
- package/dist/internal/scrollbox.js +13 -7
- package/dist/internal/scrollbox.js.map +1 -1
- package/dist/release.d.ts +11 -0
- package/dist/release.d.ts.map +1 -0
- package/dist/release.js +113 -0
- package/dist/release.js.map +1 -0
- package/dist/state.d.ts +1 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +1 -0
- package/dist/state.js.map +1 -1
- package/dist/theme.d.ts +11 -8
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +31 -8
- package/dist/theme.js.map +1 -1
- package/dist/utils/run-command.d.ts +22 -0
- package/dist/utils/run-command.d.ts.map +1 -0
- package/dist/utils/run-command.js +127 -0
- package/dist/utils/run-command.js.map +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +5 -3
- package/dist/utils.js.map +1 -1
- package/package.json +10 -7
- package/src/apis/toast.tsx +38 -17
- package/src/build.tsx +5 -3
- package/src/cli.tsx +46 -0
- package/src/colors.tsx +22 -1
- package/src/compile.tsx +219 -0
- package/src/components/actions.tsx +7 -1
- package/src/components/command-arguments.tsx +81 -0
- package/src/components/detail.tsx +26 -58
- package/src/components/dropdown.tsx +108 -23
- package/src/components/extension-preferences.tsx +55 -35
- package/src/components/form/checkbox.tsx +13 -5
- package/src/components/form/date-picker.tsx +24 -29
- package/src/components/form/description.tsx +35 -7
- package/src/components/form/dropdown.tsx +16 -30
- package/src/components/form/file-autocomplete.tsx +87 -77
- package/src/components/form/file-picker.tsx +69 -57
- package/src/components/form/form-ref.tsx +68 -0
- package/src/components/form/index.tsx +152 -41
- package/src/components/form/password-field.tsx +35 -22
- package/src/components/form/text-area.tsx +78 -58
- package/src/components/form/text-field.tsx +82 -61
- package/src/components/form/use-form-navigation.tsx +43 -23
- package/src/components/form/with-left-border.tsx +2 -1
- package/src/components/icon.tsx +497 -469
- package/src/components/list.tsx +279 -112
- package/src/components/loading-bar.tsx +1 -1
- package/src/descendants.tsx +15 -5
- package/src/examples/action-show-in-finder.tsx +1 -1
- package/src/examples/environment-test.tsx +1 -1
- package/src/examples/error-boundary.tsx +1 -1
- package/src/examples/file-autocomplete.vitest.tsx +245 -0
- package/src/examples/form-basic.tsx +12 -12
- package/src/examples/form-basic.vitest.tsx +297 -671
- package/src/examples/form-dropdown.tsx +1 -1
- package/src/examples/form-dropdown.vitest.tsx +353 -221
- package/src/examples/form-scroll.tsx +56 -0
- package/src/examples/form-scroll.vitest.tsx +228 -0
- package/src/examples/form-tagpicker.tsx +1 -1
- package/src/examples/form-tagpicker.vitest.tsx +438 -193
- package/src/examples/internal/descendants-filtering.tsx +13 -5
- package/src/examples/internal/descendants.tsx +17 -5
- package/src/examples/internal/rhf-custom-ref.tsx +152 -0
- package/src/examples/internal/scrollbox-demo.tsx +15 -7
- package/src/examples/internal/scrollbox-with-descendants.tsx +94 -0
- package/src/examples/internal/simple-dialog.tsx +1 -1
- package/src/examples/internal/simple-scrollbox.tsx +8 -5
- package/src/examples/internal/simple-scrollbox.vitest.tsx +47 -37
- package/src/examples/internal/text-stacking.tsx +4 -2
- package/src/examples/list-dropdown-default.tsx +1 -1
- package/src/examples/list-dropdown-default.vitest.tsx +136 -71
- package/src/examples/list-fetch-data.tsx +1 -1
- package/src/examples/list-fetch-data.vitest.tsx +42 -33
- package/src/examples/list-scrollbox.tsx +46 -0
- package/src/examples/list-scrollbox.vitest.tsx +103 -0
- package/src/examples/list-with-detail.tsx +1 -1
- package/src/examples/list-with-detail.vitest.tsx +290 -294
- package/src/examples/list-with-dropdown.tsx +1 -1
- package/src/examples/list-with-dropdown.vitest.tsx +190 -150
- package/src/examples/list-with-sections.tsx +12 -1
- package/src/examples/list-with-sections.vitest.tsx +390 -218
- package/src/examples/miscellaneous.tsx +1 -1
- package/src/examples/nested-navigation.tsx +4 -2
- package/src/examples/preferences-test.tsx +1 -1
- package/src/examples/simple-dropdown.tsx +1 -1
- package/src/examples/simple-file-picker.tsx +1 -1
- package/src/examples/simple-file-picker.vitest.tsx +538 -132
- package/src/examples/simple-grid.tsx +1 -1
- package/src/examples/simple-grid.vitest.tsx +258 -234
- package/src/examples/simple-hud.tsx +1 -1
- package/src/examples/simple-list-search.tsx +1 -1
- package/src/examples/simple-list.tsx +1 -1
- package/src/examples/simple-navigation.tsx +4 -2
- package/src/examples/simple-navigation.vitest.tsx +434 -238
- package/src/examples/store.tsx +1 -1
- package/src/examples/store.vitest.tsx +31 -10
- package/src/examples/submodule-diff.tsx +153 -0
- package/src/examples/tanstack-demo.tsx +1 -1
- package/src/examples/use-promise-demo.tsx +1 -1
- package/src/extensions/dev.tsx +74 -36
- package/src/extensions/dev.vitest.tsx +220 -0
- package/src/extensions/home.tsx +17 -118
- package/src/globals.ts +1 -1
- package/src/index.tsx +7 -1
- package/src/internal/date-picker-widget.tsx +56 -46
- package/src/internal/dialog.tsx +6 -6
- package/src/internal/scrollbox.tsx +15 -5
- package/src/release.tsx +159 -0
- package/src/state.tsx +2 -0
- package/src/store-api/search.test.tsx +4 -13
- package/src/theme.tsx +33 -8
- package/src/utils/run-command.tsx +204 -0
- package/src/utils.tsx +5 -3
- package/dist/ai.d.ts +0 -104
- package/dist/ai.d.ts.map +0 -1
- package/dist/ai.js +0 -135
- package/dist/ai.js.map +0 -1
- package/dist/apis/cache.test.d.ts +0 -2
- package/dist/apis/cache.test.d.ts.map +0 -1
- package/dist/apis/cache.test.js +0 -246
- package/dist/apis/cache.test.js.map +0 -1
- package/dist/apis/localstorage.test.d.ts +0 -2
- package/dist/apis/localstorage.test.d.ts.map +0 -1
- package/dist/apis/localstorage.test.js +0 -131
- package/dist/apis/localstorage.test.js.map +0 -1
- package/dist/apis/toast.test.d.ts +0 -2
- package/dist/apis/toast.test.d.ts.map +0 -1
- package/dist/apis/toast.test.js +0 -67
- package/dist/apis/toast.test.js.map +0 -1
- package/dist/build.test.d.ts +0 -2
- package/dist/build.test.d.ts.map +0 -1
- package/dist/build.test.js +0 -73
- package/dist/build.test.js.map +0 -1
- package/dist/cache.d.ts +0 -32
- package/dist/cache.d.ts.map +0 -1
- package/dist/cache.js +0 -205
- package/dist/cache.js.map +0 -1
- package/dist/cache.test.d.ts +0 -2
- package/dist/cache.test.d.ts.map +0 -1
- package/dist/cache.test.js +0 -246
- package/dist/cache.test.js.map +0 -1
- package/dist/clipboard.d.ts +0 -36
- package/dist/clipboard.d.ts.map +0 -1
- package/dist/clipboard.js +0 -154
- package/dist/clipboard.js.map +0 -1
- package/dist/components/form/form-type-only.d.ts +0 -174
- package/dist/components/form/form-type-only.d.ts.map +0 -1
- package/dist/components/form/form-type-only.js +0 -2
- package/dist/components/form/form-type-only.js.map +0 -1
- package/dist/components/form/use-form-handling.d.ts +0 -4
- package/dist/components/form/use-form-handling.d.ts.map +0 -1
- package/dist/components/form/use-form-handling.js +0 -37
- package/dist/components/form/use-form-handling.js.map +0 -1
- package/dist/dev-ui.d.ts +0 -7
- package/dist/dev-ui.d.ts.map +0 -1
- package/dist/dev-ui.js +0 -118
- package/dist/dev-ui.js.map +0 -1
- package/dist/environment.d.ts +0 -63
- package/dist/environment.d.ts.map +0 -1
- package/dist/environment.js +0 -189
- package/dist/environment.js.map +0 -1
- package/dist/examples/datepicker.d.ts +0 -2
- package/dist/examples/datepicker.d.ts.map +0 -1
- package/dist/examples/datepicker.js +0 -344
- package/dist/examples/datepicker.js.map +0 -1
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts +0 -2
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts.map +0 -1
- package/dist/examples/form-basic-arrow-keys.vitest.js +0 -46
- package/dist/examples/form-basic-arrow-keys.vitest.js.map +0 -1
- package/dist/examples/form-basic.vitest.d.ts +0 -2
- package/dist/examples/form-basic.vitest.d.ts.map +0 -1
- package/dist/examples/form-basic.vitest.js +0 -995
- package/dist/examples/form-basic.vitest.js.map +0 -1
- package/dist/examples/form-dropdown-with-sections.d.ts +0 -2
- package/dist/examples/form-dropdown-with-sections.d.ts.map +0 -1
- package/dist/examples/form-dropdown-with-sections.js +0 -13
- package/dist/examples/form-dropdown-with-sections.js.map +0 -1
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts +0 -2
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts.map +0 -1
- package/dist/examples/form-dropdown-with-sections.vitest.js +0 -75
- package/dist/examples/form-dropdown-with-sections.vitest.js.map +0 -1
- package/dist/examples/form-dropdown.vitest.d.ts +0 -2
- package/dist/examples/form-dropdown.vitest.d.ts.map +0 -1
- package/dist/examples/form-dropdown.vitest.js +0 -722
- package/dist/examples/form-dropdown.vitest.js.map +0 -1
- package/dist/examples/form-multiselect-dropdown.d.ts +0 -2
- package/dist/examples/form-multiselect-dropdown.d.ts.map +0 -1
- package/dist/examples/form-multiselect-dropdown.js +0 -13
- package/dist/examples/form-multiselect-dropdown.js.map +0 -1
- package/dist/examples/form-tagpicker.vitest.d.ts +0 -2
- package/dist/examples/form-tagpicker.vitest.d.ts.map +0 -1
- package/dist/examples/form-tagpicker.vitest.js +0 -491
- package/dist/examples/form-tagpicker.vitest.js.map +0 -1
- package/dist/examples/internal/nested-boxes.d.ts +0 -2
- package/dist/examples/internal/nested-boxes.d.ts.map +0 -1
- package/dist/examples/internal/nested-boxes.js +0 -7
- package/dist/examples/internal/nested-boxes.js.map +0 -1
- package/dist/examples/internal/simple-scrollbox.vitest.d.ts +0 -2
- package/dist/examples/internal/simple-scrollbox.vitest.d.ts.map +0 -1
- package/dist/examples/internal/simple-scrollbox.vitest.js +0 -88
- package/dist/examples/internal/simple-scrollbox.vitest.js.map +0 -1
- package/dist/examples/internal/unicode-square-repro.d.ts +0 -2
- package/dist/examples/internal/unicode-square-repro.d.ts.map +0 -1
- package/dist/examples/internal/unicode-square-repro.js +0 -7
- package/dist/examples/internal/unicode-square-repro.js.map +0 -1
- package/dist/examples/list-dropdown-default.vitest.d.ts +0 -2
- package/dist/examples/list-dropdown-default.vitest.d.ts.map +0 -1
- package/dist/examples/list-dropdown-default.vitest.js +0 -164
- package/dist/examples/list-dropdown-default.vitest.js.map +0 -1
- package/dist/examples/list-fetch-data.vitest.d.ts +0 -2
- package/dist/examples/list-fetch-data.vitest.d.ts.map +0 -1
- package/dist/examples/list-fetch-data.vitest.js +0 -103
- package/dist/examples/list-fetch-data.vitest.js.map +0 -1
- package/dist/examples/list-filter-navigation.d.ts +0 -2
- package/dist/examples/list-filter-navigation.d.ts.map +0 -1
- package/dist/examples/list-filter-navigation.js +0 -8
- package/dist/examples/list-filter-navigation.js.map +0 -1
- package/dist/examples/list-with-detail.vitest.d.ts +0 -2
- package/dist/examples/list-with-detail.vitest.d.ts.map +0 -1
- package/dist/examples/list-with-detail.vitest.js +0 -438
- package/dist/examples/list-with-detail.vitest.js.map +0 -1
- package/dist/examples/list-with-dropdown.vitest.d.ts +0 -2
- package/dist/examples/list-with-dropdown.vitest.d.ts.map +0 -1
- package/dist/examples/list-with-dropdown.vitest.js +0 -297
- package/dist/examples/list-with-dropdown.vitest.js.map +0 -1
- package/dist/examples/list-with-sections.vitest.d.ts +0 -2
- package/dist/examples/list-with-sections.vitest.d.ts.map +0 -1
- package/dist/examples/list-with-sections.vitest.js +0 -441
- package/dist/examples/list-with-sections.vitest.js.map +0 -1
- package/dist/examples/simple-file-picker.vitest.d.ts +0 -2
- package/dist/examples/simple-file-picker.vitest.d.ts.map +0 -1
- package/dist/examples/simple-file-picker.vitest.js +0 -277
- package/dist/examples/simple-file-picker.vitest.js.map +0 -1
- package/dist/examples/simple-grid.vitest.d.ts +0 -2
- package/dist/examples/simple-grid.vitest.d.ts.map +0 -1
- package/dist/examples/simple-grid.vitest.js +0 -498
- package/dist/examples/simple-grid.vitest.js.map +0 -1
- package/dist/examples/simple-navigation.vitest.d.ts +0 -2
- package/dist/examples/simple-navigation.vitest.d.ts.map +0 -1
- package/dist/examples/simple-navigation.vitest.js +0 -522
- package/dist/examples/simple-navigation.vitest.js.map +0 -1
- package/dist/examples/store.vitest.d.ts +0 -2
- package/dist/examples/store.vitest.d.ts.map +0 -1
- package/dist/examples/store.vitest.js +0 -48
- package/dist/examples/store.vitest.js.map +0 -1
- package/dist/home-command.d.ts +0 -8
- package/dist/home-command.d.ts.map +0 -1
- package/dist/home-command.js +0 -181
- package/dist/home-command.js.map +0 -1
- package/dist/hooks/hooks.test.d.ts +0 -2
- package/dist/hooks/hooks.test.d.ts.map +0 -1
- package/dist/hooks/hooks.test.js +0 -37
- package/dist/hooks/hooks.test.js.map +0 -1
- package/dist/hover-repro.d.ts +0 -2
- package/dist/hover-repro.d.ts.map +0 -1
- package/dist/hover-repro.js +0 -20
- package/dist/hover-repro.js.map +0 -1
- package/dist/localstorage.d.ts +0 -13
- package/dist/localstorage.d.ts.map +0 -1
- package/dist/localstorage.js +0 -190
- package/dist/localstorage.js.map +0 -1
- package/dist/localstorage.test.d.ts +0 -2
- package/dist/localstorage.test.d.ts.map +0 -1
- package/dist/localstorage.test.js +0 -131
- package/dist/localstorage.test.js.map +0 -1
- package/dist/oauth.d.ts +0 -142
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js +0 -551
- package/dist/oauth.js.map +0 -1
- package/dist/preferences.d.ts +0 -23
- package/dist/preferences.d.ts.map +0 -1
- package/dist/preferences.js +0 -105
- package/dist/preferences.js.map +0 -1
- package/dist/store-api/download.test.d.ts +0 -2
- package/dist/store-api/download.test.d.ts.map +0 -1
- package/dist/store-api/download.test.js +0 -36
- package/dist/store-api/download.test.js.map +0 -1
- package/dist/store-api/extension.test.d.ts +0 -2
- package/dist/store-api/extension.test.d.ts.map +0 -1
- package/dist/store-api/extension.test.js +0 -22
- package/dist/store-api/extension.test.js.map +0 -1
- package/dist/store-api/search.test.d.ts +0 -2
- package/dist/store-api/search.test.d.ts.map +0 -1
- package/dist/store-api/search.test.js +0 -45
- package/dist/store-api/search.test.js.map +0 -1
- package/dist/store.d.ts +0 -21
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js +0 -84
- package/dist/store.js.map +0 -1
- package/dist/toast.d.ts +0 -44
- package/dist/toast.d.ts.map +0 -1
- package/dist/toast.js +0 -221
- package/dist/toast.js.map +0 -1
- package/dist/utils.test.d.ts +0 -2
- package/dist/utils.test.d.ts.map +0 -1
- package/dist/utils.test.js +0 -152
- package/dist/utils.test.js.map +0 -1
- package/dist/window.d.ts +0 -12
- package/dist/window.d.ts.map +0 -1
- package/dist/window.js +0 -48
- package/dist/window.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "termcast",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.18",
|
|
4
4
|
"description": "Raycast for the terminal",
|
|
5
5
|
"repository": "https://github.com/remorses/termcast",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc && bun run binary",
|
|
8
|
+
"prepublishOnly": "tsc",
|
|
8
9
|
"release": "cd .. && bun changeset version && /Users/morse/Documents/GitHub/changesets/packages/cli/bin.js publish # my own fork to support github releases",
|
|
9
10
|
"binary": "bun build ./src/cli.tsx --env-file=\"\" --compile --outfile bin",
|
|
10
11
|
"see-raycast-types": "zed node_modules/@raycast/api/types/index.d.ts",
|
|
@@ -29,8 +30,8 @@
|
|
|
29
30
|
"author": "Tommaso De Rossi, morse <beats.by.morse@gmail.com>",
|
|
30
31
|
"license": "",
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@opentui/core": "0.1.
|
|
33
|
-
"@opentui/react": "0.1.
|
|
33
|
+
"@opentui/core": "0.1.60",
|
|
34
|
+
"@opentui/react": "0.1.60",
|
|
34
35
|
"@tanstack/react-query": "^5.85.5",
|
|
35
36
|
"@tanstack/react-query-persist-client": "^5.85.5",
|
|
36
37
|
"cac": "^6.7.14",
|
|
@@ -40,19 +41,21 @@
|
|
|
40
41
|
"jszip": "^3.10.1",
|
|
41
42
|
"nanoid": "^5.1.5",
|
|
42
43
|
"node-pty": "^1.1.0-beta34",
|
|
43
|
-
"react": "^19.
|
|
44
|
+
"react": "^19.2.0",
|
|
45
|
+
"react-dom": "^19.2.0",
|
|
44
46
|
"react-hook-form": "^7.62.0",
|
|
45
47
|
"string-dedent": "^3.0.2",
|
|
46
48
|
"zustand": "^5.0.8"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
51
|
+
"tuistory": "workspace:*",
|
|
49
52
|
"@types/bun": "^1.2.21",
|
|
50
|
-
"@types/node": "^
|
|
53
|
+
"@types/node": "^25.0.1",
|
|
51
54
|
"@raycast/api": "^1.102.5",
|
|
52
55
|
"@raycast/utils": "^2.2.1",
|
|
53
56
|
"@xterm/addon-serialize": "^0.13.0",
|
|
54
57
|
"@xterm/headless": "^5.5.0",
|
|
55
|
-
"bun-pty": "^0.
|
|
56
|
-
"vitest": "^
|
|
58
|
+
"bun-pty": "^0.4.2",
|
|
59
|
+
"vitest": "^4.0.15"
|
|
57
60
|
}
|
|
58
61
|
}
|
package/src/apis/toast.tsx
CHANGED
|
@@ -121,12 +121,12 @@ export class Toast {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
interface ToastContentProps {
|
|
125
125
|
toast: Toast
|
|
126
126
|
onHide: () => void
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
function ToastContent({ toast, onHide }: ToastContentProps): any {
|
|
130
130
|
const [, forceUpdate] = useState(0)
|
|
131
131
|
const dimensions = useTerminalDimensions()
|
|
132
132
|
const inFocus = useIsInFocus()
|
|
@@ -141,6 +141,18 @@ export function ToastComponent({ toast, onHide }: ToastComponentProps): any {
|
|
|
141
141
|
}
|
|
142
142
|
}, [toast, onHide])
|
|
143
143
|
|
|
144
|
+
useKeyboard((evt) => {
|
|
145
|
+
if (!inFocus) return
|
|
146
|
+
|
|
147
|
+
if (evt.name === 'escape') {
|
|
148
|
+
onHide()
|
|
149
|
+
} else if (toast.primaryAction && evt.name === 'return') {
|
|
150
|
+
toast.primaryAction.onAction(toast)
|
|
151
|
+
} else if (toast.secondaryAction && evt.name === 'tab') {
|
|
152
|
+
toast.secondaryAction.onAction(toast)
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
|
|
144
156
|
const getIcon = () => {
|
|
145
157
|
switch (toast.style) {
|
|
146
158
|
case Toast.Style.Success:
|
|
@@ -180,7 +192,6 @@ export function ToastComponent({ toast, onHide }: ToastComponentProps): any {
|
|
|
180
192
|
|
|
181
193
|
useEffect(() => {
|
|
182
194
|
if (toast.style !== Toast.Style.Animated) {
|
|
183
|
-
// Use longer duration for error toasts
|
|
184
195
|
const duration = toast.style === Toast.Style.Failure ? 8000 : 5000
|
|
185
196
|
const timer = setTimeout(() => {
|
|
186
197
|
onHide()
|
|
@@ -192,19 +203,6 @@ export function ToastComponent({ toast, onHide }: ToastComponentProps): any {
|
|
|
192
203
|
const icon =
|
|
193
204
|
toast.style === Toast.Style.Animated ? getIcon()[animationFrame] : getIcon()
|
|
194
205
|
|
|
195
|
-
useKeyboard((evt) => {
|
|
196
|
-
if (!inFocus) return
|
|
197
|
-
|
|
198
|
-
if (evt.name === 'escape') {
|
|
199
|
-
onHide()
|
|
200
|
-
} else if (toast.primaryAction && evt.name === 'enter') {
|
|
201
|
-
toast.primaryAction.onAction(toast)
|
|
202
|
-
} else if (toast.secondaryAction && evt.name === 'tab') {
|
|
203
|
-
toast.secondaryAction.onAction(toast)
|
|
204
|
-
}
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
// TODO use flexWrap when implemented
|
|
208
206
|
const wrapText = (text: string, maxWidth: number): string[] => {
|
|
209
207
|
if (!text) return []
|
|
210
208
|
|
|
@@ -281,13 +279,36 @@ export function ToastComponent({ toast, onHide }: ToastComponentProps): any {
|
|
|
281
279
|
)
|
|
282
280
|
}
|
|
283
281
|
|
|
282
|
+
export function ToastOverlay(): any {
|
|
283
|
+
const dimensions = useTerminalDimensions()
|
|
284
|
+
const toastElement = useStore((state) => state.toast)
|
|
285
|
+
|
|
286
|
+
if (!toastElement) {
|
|
287
|
+
return null
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return (
|
|
291
|
+
<box
|
|
292
|
+
position='absolute'
|
|
293
|
+
left={0}
|
|
294
|
+
top={dimensions.height - 3}
|
|
295
|
+
width={dimensions.width}
|
|
296
|
+
height={3}
|
|
297
|
+
justifyContent='flex-end'
|
|
298
|
+
alignItems='center'
|
|
299
|
+
>
|
|
300
|
+
{toastElement}
|
|
301
|
+
</box>
|
|
302
|
+
)
|
|
303
|
+
}
|
|
304
|
+
|
|
284
305
|
let currentToastInstance: Toast | null = null
|
|
285
306
|
|
|
286
307
|
export function showToastInternal(toast: Toast): void {
|
|
287
308
|
currentToastInstance = toast
|
|
288
309
|
useStore.setState({
|
|
289
310
|
toast: (
|
|
290
|
-
<
|
|
311
|
+
<ToastContent
|
|
291
312
|
toast={toast}
|
|
292
313
|
onHide={() => {
|
|
293
314
|
useStore.setState({ toast: null })
|
package/src/build.tsx
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
+
import { execSync } from 'node:child_process'
|
|
3
4
|
import type { BunPlugin } from 'bun'
|
|
4
5
|
import { logger } from './logger'
|
|
5
6
|
import { getCommandsWithFiles, CommandWithFile } from './package-json'
|
|
6
|
-
import * as termcastApi from '
|
|
7
|
+
import * as termcastApi from './index'
|
|
7
8
|
import * as opentuiReact from '@opentui/react'
|
|
8
9
|
import * as opentuiCore from '@opentui/core'
|
|
9
10
|
import * as react from 'react'
|
|
10
11
|
|
|
11
12
|
const GLOBALS_NAMESPACE = 'globals'
|
|
13
|
+
const VIRTUAL_ENTRY_NAMESPACE = 'virtual-entry'
|
|
12
14
|
|
|
13
|
-
const aliasPlugin: BunPlugin = {
|
|
15
|
+
export const aliasPlugin: BunPlugin = {
|
|
14
16
|
name: 'alias-raycast-to-termcast',
|
|
15
17
|
async setup(build) {
|
|
16
18
|
// Import packages once at setup time
|
|
@@ -47,7 +49,7 @@ const aliasPlugin: BunPlugin = {
|
|
|
47
49
|
})
|
|
48
50
|
|
|
49
51
|
// Resolve external packages to globals namespace
|
|
50
|
-
build.onResolve({ filter:
|
|
52
|
+
build.onResolve({ filter: /^termcast/ }, (args) => {
|
|
51
53
|
return {
|
|
52
54
|
path: 'termcast',
|
|
53
55
|
namespace: GLOBALS_NAMESPACE,
|
package/src/cli.tsx
CHANGED
|
@@ -8,6 +8,8 @@ import { logger } from './logger'
|
|
|
8
8
|
import { installExtension } from './utils'
|
|
9
9
|
import './globals'
|
|
10
10
|
import { startDevMode, triggerRebuild } from './extensions/dev'
|
|
11
|
+
import { compileExtension } from './compile'
|
|
12
|
+
import { releaseExtension } from './release'
|
|
11
13
|
import { runHomeCommand } from './extensions/home'
|
|
12
14
|
import { showToast, Toast } from './apis/toast'
|
|
13
15
|
import packageJson from '../package.json'
|
|
@@ -176,6 +178,50 @@ cli
|
|
|
176
178
|
}
|
|
177
179
|
})
|
|
178
180
|
|
|
181
|
+
cli
|
|
182
|
+
.command('compile [path]', 'Compile the extension to a standalone executable')
|
|
183
|
+
.option('-o, --outfile <path>', 'Output file path for the executable')
|
|
184
|
+
.option('--minify', 'Minify the output')
|
|
185
|
+
.action(async (extensionPath, options) => {
|
|
186
|
+
extensionPath = path.resolve(extensionPath || process.cwd())
|
|
187
|
+
|
|
188
|
+
console.log('Compiling extension to executable...')
|
|
189
|
+
try {
|
|
190
|
+
const result = await compileExtension({
|
|
191
|
+
extensionPath,
|
|
192
|
+
outfile: options.outfile,
|
|
193
|
+
minify: options.minify,
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
console.log(`\nExecutable created: ${result.outfile}`)
|
|
197
|
+
console.log(`Run it with: ${result.outfile}`)
|
|
198
|
+
} catch (error: any) {
|
|
199
|
+
console.error('Compile failed:', error.message)
|
|
200
|
+
process.exit(1)
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
cli
|
|
205
|
+
.command('release <path>', 'Build and publish extension to GitHub releases')
|
|
206
|
+
.option('--single', 'Only compile for the current platform')
|
|
207
|
+
.action(async (extensionPath: string, options: { single?: boolean }) => {
|
|
208
|
+
extensionPath = path.resolve(extensionPath)
|
|
209
|
+
|
|
210
|
+
console.log('Building and releasing extension...')
|
|
211
|
+
try {
|
|
212
|
+
const result = await releaseExtension({
|
|
213
|
+
extensionPath,
|
|
214
|
+
single: options.single,
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
console.log(`\nRelease complete: v${result.version}`)
|
|
218
|
+
console.log(`Uploaded ${result.uploadedFiles.length} binaries`)
|
|
219
|
+
} catch (error: any) {
|
|
220
|
+
console.error('Release failed:', error.message)
|
|
221
|
+
process.exit(1)
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
|
|
179
225
|
cli
|
|
180
226
|
.command('pr <prNumber>', 'Download extension from a GitHub PR in Raycast extensions repo. To test it with Termcast')
|
|
181
227
|
.action(async (prNumber: string) => {
|
package/src/colors.tsx
CHANGED
|
@@ -11,5 +11,26 @@ export enum Color {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export namespace Color {
|
|
14
|
-
export
|
|
14
|
+
export interface Dynamic {
|
|
15
|
+
light: string
|
|
16
|
+
dark: string
|
|
17
|
+
adjustContrast?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type Raw = string
|
|
21
|
+
|
|
22
|
+
export type ColorLike = Color | Dynamic | Raw
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function resolveColor(color: Color.ColorLike | undefined | null): string | undefined {
|
|
26
|
+
if (!color) {
|
|
27
|
+
return undefined
|
|
28
|
+
}
|
|
29
|
+
if (typeof color === 'string') {
|
|
30
|
+
return color
|
|
31
|
+
}
|
|
32
|
+
if (typeof color === 'object' && 'dark' in color) {
|
|
33
|
+
return color.dark
|
|
34
|
+
}
|
|
35
|
+
return undefined
|
|
15
36
|
}
|
package/src/compile.tsx
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import type { BunPlugin } from 'bun'
|
|
4
|
+
import { logger } from './logger'
|
|
5
|
+
import { getCommandsWithFiles } from './package-json'
|
|
6
|
+
|
|
7
|
+
const raycastAliasPlugin: BunPlugin = {
|
|
8
|
+
name: 'raycast-to-termcast',
|
|
9
|
+
setup(build) {
|
|
10
|
+
build.onResolve({ filter: /@raycast\/api/ }, () => ({
|
|
11
|
+
path: require.resolve('termcast/src/index'),
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
build.onResolve({ filter: /^termcast/ }, (args) => ({
|
|
15
|
+
path: require.resolve(args.path),
|
|
16
|
+
}))
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function generateEntryCode({
|
|
21
|
+
extensionPath,
|
|
22
|
+
commands,
|
|
23
|
+
}: {
|
|
24
|
+
extensionPath: string
|
|
25
|
+
commands: Array<{ name: string; bundledPath: string }>
|
|
26
|
+
}): string {
|
|
27
|
+
const commandImports = commands
|
|
28
|
+
.map(
|
|
29
|
+
(cmd, i) =>
|
|
30
|
+
` const { default: Command${i} } = await import(${JSON.stringify(cmd.bundledPath)});`,
|
|
31
|
+
)
|
|
32
|
+
.join('\n')
|
|
33
|
+
|
|
34
|
+
const commandsArray = commands
|
|
35
|
+
.map(
|
|
36
|
+
(cmd, i) => ` {
|
|
37
|
+
name: ${JSON.stringify(cmd.name)},
|
|
38
|
+
Component: Command${i},
|
|
39
|
+
}`,
|
|
40
|
+
)
|
|
41
|
+
.join(',\n')
|
|
42
|
+
|
|
43
|
+
return `
|
|
44
|
+
async function main() {
|
|
45
|
+
${commandImports}
|
|
46
|
+
|
|
47
|
+
const compiledCommands = [
|
|
48
|
+
${commandsArray}
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const { startCompiledExtension } = await import('termcast/src/extensions/dev');
|
|
52
|
+
|
|
53
|
+
await startCompiledExtension({
|
|
54
|
+
extensionPath: ${JSON.stringify(extensionPath)},
|
|
55
|
+
compiledCommands,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
main().catch((err) => {
|
|
60
|
+
console.error('Failed to start:', err);
|
|
61
|
+
console.error('Stack:', err.stack);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
});
|
|
64
|
+
`
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface CompileTarget {
|
|
68
|
+
os: 'linux' | 'darwin' | 'win32'
|
|
69
|
+
arch: 'arm64' | 'x64'
|
|
70
|
+
abi?: 'musl'
|
|
71
|
+
avx2?: false
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function targetToString(target: CompileTarget): string {
|
|
75
|
+
return [
|
|
76
|
+
'bun',
|
|
77
|
+
target.os === 'win32' ? 'windows' : target.os,
|
|
78
|
+
target.arch,
|
|
79
|
+
target.avx2 === false ? 'baseline' : undefined,
|
|
80
|
+
target.abi,
|
|
81
|
+
]
|
|
82
|
+
.filter(Boolean)
|
|
83
|
+
.join('-')
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function targetToFileSuffix(target: CompileTarget): string {
|
|
87
|
+
const os = target.os === 'win32' ? 'windows' : target.os === 'darwin' ? 'darwin' : 'linux'
|
|
88
|
+
const ext = target.os === 'win32' ? '.exe' : ''
|
|
89
|
+
const parts = [os, target.arch]
|
|
90
|
+
if (target.abi) {
|
|
91
|
+
parts.push(target.abi)
|
|
92
|
+
}
|
|
93
|
+
if (target.avx2 === false) {
|
|
94
|
+
parts.push('baseline')
|
|
95
|
+
}
|
|
96
|
+
return parts.join('-') + ext
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function getArchiveExtension(target: CompileTarget): string {
|
|
100
|
+
return target.os === 'linux' ? '.tar.gz' : '.zip'
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const ALL_TARGETS: CompileTarget[] = [
|
|
104
|
+
{ os: 'linux', arch: 'arm64' },
|
|
105
|
+
{ os: 'linux', arch: 'x64' },
|
|
106
|
+
{ os: 'linux', arch: 'x64', avx2: false },
|
|
107
|
+
{ os: 'linux', arch: 'arm64', abi: 'musl' },
|
|
108
|
+
{ os: 'linux', arch: 'x64', abi: 'musl' },
|
|
109
|
+
{ os: 'linux', arch: 'x64', abi: 'musl', avx2: false },
|
|
110
|
+
{ os: 'darwin', arch: 'arm64' },
|
|
111
|
+
{ os: 'darwin', arch: 'x64' },
|
|
112
|
+
{ os: 'darwin', arch: 'x64', avx2: false },
|
|
113
|
+
{ os: 'win32', arch: 'x64' },
|
|
114
|
+
{ os: 'win32', arch: 'x64', avx2: false },
|
|
115
|
+
]
|
|
116
|
+
|
|
117
|
+
export function getCurrentTarget(): CompileTarget {
|
|
118
|
+
const platform = process.platform as 'linux' | 'darwin' | 'win32'
|
|
119
|
+
const arch = process.arch === 'arm64' ? 'arm64' : 'x64'
|
|
120
|
+
return { os: platform, arch }
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface CompileOptions {
|
|
124
|
+
extensionPath: string
|
|
125
|
+
outfile?: string
|
|
126
|
+
minify?: boolean
|
|
127
|
+
target?: CompileTarget
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface CompileResult {
|
|
131
|
+
success: boolean
|
|
132
|
+
outfile: string
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export async function compileExtension({
|
|
136
|
+
extensionPath,
|
|
137
|
+
outfile,
|
|
138
|
+
minify = false,
|
|
139
|
+
target,
|
|
140
|
+
}: CompileOptions): Promise<CompileResult> {
|
|
141
|
+
const resolvedPath = path.resolve(extensionPath)
|
|
142
|
+
|
|
143
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
144
|
+
throw new Error(`Extension path does not exist: ${resolvedPath}`)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const packageJsonPath = path.join(resolvedPath, 'package.json')
|
|
148
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
149
|
+
throw new Error(`No package.json found at: ${packageJsonPath}`)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const { packageJson, commands } = getCommandsWithFiles({ packageJsonPath })
|
|
153
|
+
|
|
154
|
+
const existingCommands = commands.filter((cmd) => cmd.exists)
|
|
155
|
+
if (existingCommands.length === 0) {
|
|
156
|
+
throw new Error('No command files found to build')
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
logger.log(`Compiling ${existingCommands.length} commands...`)
|
|
160
|
+
|
|
161
|
+
const bundleDir = path.join(resolvedPath, '.termcast-bundle')
|
|
162
|
+
if (!fs.existsSync(bundleDir)) {
|
|
163
|
+
fs.mkdirSync(bundleDir, { recursive: true })
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const entryCode = generateEntryCode({
|
|
167
|
+
extensionPath: resolvedPath,
|
|
168
|
+
commands: existingCommands.map((cmd) => ({
|
|
169
|
+
name: cmd.name,
|
|
170
|
+
bundledPath: cmd.filePath,
|
|
171
|
+
})),
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
const tempEntryPath = path.join(bundleDir, '_entry.tsx')
|
|
175
|
+
fs.writeFileSync(tempEntryPath, entryCode)
|
|
176
|
+
|
|
177
|
+
const bunTarget = target ? targetToString(target) : 'bun'
|
|
178
|
+
const defaultOutfile =
|
|
179
|
+
outfile || path.join(resolvedPath, packageJson.name || 'extension')
|
|
180
|
+
|
|
181
|
+
try {
|
|
182
|
+
const result = await Bun.build({
|
|
183
|
+
entrypoints: [tempEntryPath],
|
|
184
|
+
target: bunTarget as 'bun',
|
|
185
|
+
minify,
|
|
186
|
+
compile: {
|
|
187
|
+
outfile: defaultOutfile,
|
|
188
|
+
},
|
|
189
|
+
plugins: [raycastAliasPlugin],
|
|
190
|
+
throw: false,
|
|
191
|
+
} as Parameters<typeof Bun.build>[0])
|
|
192
|
+
|
|
193
|
+
if (!result.success) {
|
|
194
|
+
const errorMessage = result.logs
|
|
195
|
+
.map((log: any) => log.message || String(log))
|
|
196
|
+
.join('\n')
|
|
197
|
+
throw new Error(`Compile failed: ${errorMessage || 'Unknown error'}`)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
logger.log('Build outputs:', result.outputs?.map((o) => o.path))
|
|
201
|
+
|
|
202
|
+
if (!fs.existsSync(defaultOutfile)) {
|
|
203
|
+
throw new Error(
|
|
204
|
+
`Compiled executable not found at ${defaultOutfile}. Outputs: ${result.outputs?.map((o) => o.path).join(', ')}`,
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
logger.log(`Successfully compiled: ${defaultOutfile}`)
|
|
209
|
+
|
|
210
|
+
return {
|
|
211
|
+
success: true,
|
|
212
|
+
outfile: defaultOutfile,
|
|
213
|
+
}
|
|
214
|
+
} finally {
|
|
215
|
+
if (fs.existsSync(tempEntryPath)) {
|
|
216
|
+
fs.unlinkSync(tempEntryPath)
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -22,7 +22,7 @@ import { useIsInFocus } from 'termcast/src/internal/focus-context'
|
|
|
22
22
|
import { CommonProps } from 'termcast/src/utils'
|
|
23
23
|
import { showToast, Toast } from 'termcast/src/apis/toast'
|
|
24
24
|
import { createDescendants } from 'termcast/src/descendants'
|
|
25
|
-
import { useFormSubmit } from 'termcast'
|
|
25
|
+
import { useFormSubmit } from 'termcast/src/components/form/index'
|
|
26
26
|
import { logger } from '../logger'
|
|
27
27
|
|
|
28
28
|
export enum ActionStyle {
|
|
@@ -54,6 +54,7 @@ export interface ActionPanelSectionProps extends CommonProps {
|
|
|
54
54
|
|
|
55
55
|
interface ActionType {
|
|
56
56
|
(props: ActionProps): any
|
|
57
|
+
Style: typeof ActionStyle
|
|
57
58
|
Push: (props: PushActionProps) => any
|
|
58
59
|
CopyToClipboard: (props: CopyToClipboardProps) => any
|
|
59
60
|
OpenInBrowser: (props: OpenInBrowserProps) => any
|
|
@@ -172,6 +173,8 @@ const Action: ActionType = (props) => {
|
|
|
172
173
|
execute: () => props.onAction?.(),
|
|
173
174
|
})
|
|
174
175
|
|
|
176
|
+
const isDestructive = props.style === ActionStyle.Destructive
|
|
177
|
+
|
|
175
178
|
// Render as Dropdown.Item
|
|
176
179
|
return (
|
|
177
180
|
<Dropdown.Item
|
|
@@ -179,10 +182,13 @@ const Action: ActionType = (props) => {
|
|
|
179
182
|
value={props.title}
|
|
180
183
|
icon={props.icon}
|
|
181
184
|
label={formatShortcut(props.shortcut)}
|
|
185
|
+
color={isDestructive ? Theme.error : undefined}
|
|
182
186
|
/>
|
|
183
187
|
)
|
|
184
188
|
}
|
|
185
189
|
|
|
190
|
+
Action.Style = ActionStyle
|
|
191
|
+
|
|
186
192
|
Action.Push = (props) => {
|
|
187
193
|
const dialog = useDialog()
|
|
188
194
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Form } from './form'
|
|
3
|
+
import { ActionPanel, Action } from './actions'
|
|
4
|
+
import type { RaycastArgument } from 'termcast/src/package-json'
|
|
5
|
+
|
|
6
|
+
interface CommandArgumentsProps {
|
|
7
|
+
arguments: RaycastArgument[]
|
|
8
|
+
commandTitle: string
|
|
9
|
+
onSubmit: (values: Record<string, string>) => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function CommandArguments({
|
|
13
|
+
arguments: args,
|
|
14
|
+
commandTitle,
|
|
15
|
+
onSubmit,
|
|
16
|
+
}: CommandArgumentsProps): any {
|
|
17
|
+
const handleSubmit = (values: Record<string, any>) => {
|
|
18
|
+
onSubmit(values as Record<string, string>)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Form
|
|
23
|
+
actions={
|
|
24
|
+
<ActionPanel>
|
|
25
|
+
<Action.SubmitForm title='Run Command' onSubmit={handleSubmit} />
|
|
26
|
+
</ActionPanel>
|
|
27
|
+
}
|
|
28
|
+
navigationTitle={commandTitle}
|
|
29
|
+
>
|
|
30
|
+
<Form.Description
|
|
31
|
+
title={commandTitle}
|
|
32
|
+
text='Enter the arguments to run this command.'
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
{args.map((arg) => {
|
|
36
|
+
switch (arg.type) {
|
|
37
|
+
case 'text':
|
|
38
|
+
return (
|
|
39
|
+
<Form.TextField
|
|
40
|
+
key={arg.name}
|
|
41
|
+
id={arg.name}
|
|
42
|
+
title={arg.placeholder}
|
|
43
|
+
placeholder={arg.placeholder}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
case 'password':
|
|
48
|
+
return (
|
|
49
|
+
<Form.PasswordField
|
|
50
|
+
key={arg.name}
|
|
51
|
+
id={arg.name}
|
|
52
|
+
title={arg.placeholder}
|
|
53
|
+
placeholder={arg.placeholder}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
case 'dropdown':
|
|
58
|
+
return (
|
|
59
|
+
<Form.Dropdown
|
|
60
|
+
key={arg.name}
|
|
61
|
+
id={arg.name}
|
|
62
|
+
title={arg.placeholder}
|
|
63
|
+
placeholder={arg.placeholder}
|
|
64
|
+
>
|
|
65
|
+
{arg.data?.map((item) => (
|
|
66
|
+
<Form.Dropdown.Item
|
|
67
|
+
key={item.value}
|
|
68
|
+
value={item.value}
|
|
69
|
+
title={item.title}
|
|
70
|
+
/>
|
|
71
|
+
))}
|
|
72
|
+
</Form.Dropdown>
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
default:
|
|
76
|
+
return null
|
|
77
|
+
}
|
|
78
|
+
})}
|
|
79
|
+
</Form>
|
|
80
|
+
)
|
|
81
|
+
}
|