termcast 1.3.9
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/action-utils.d.ts +25 -0
- package/dist/action-utils.d.ts.map +1 -0
- package/dist/action-utils.js +209 -0
- package/dist/action-utils.js.map +1 -0
- package/dist/ai.d.ts +104 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +135 -0
- package/dist/ai.js.map +1 -0
- package/dist/apis/ai.d.ts +104 -0
- package/dist/apis/ai.d.ts.map +1 -0
- package/dist/apis/ai.js +135 -0
- package/dist/apis/ai.js.map +1 -0
- package/dist/apis/cache.d.ts +84 -0
- package/dist/apis/cache.d.ts.map +1 -0
- package/dist/apis/cache.js +307 -0
- package/dist/apis/cache.js.map +1 -0
- package/dist/apis/cache.test.d.ts +2 -0
- package/dist/apis/cache.test.d.ts.map +1 -0
- package/dist/apis/cache.test.js +246 -0
- package/dist/apis/cache.test.js.map +1 -0
- package/dist/apis/clipboard.d.ts +36 -0
- package/dist/apis/clipboard.d.ts.map +1 -0
- package/dist/apis/clipboard.js +154 -0
- package/dist/apis/clipboard.js.map +1 -0
- package/dist/apis/environment.d.ts +63 -0
- package/dist/apis/environment.d.ts.map +1 -0
- package/dist/apis/environment.js +189 -0
- package/dist/apis/environment.js.map +1 -0
- package/dist/apis/hud.d.ts +7 -0
- package/dist/apis/hud.d.ts.map +1 -0
- package/dist/apis/hud.js +45 -0
- package/dist/apis/hud.js.map +1 -0
- package/dist/apis/localstorage.d.ts +13 -0
- package/dist/apis/localstorage.d.ts.map +1 -0
- package/dist/apis/localstorage.js +190 -0
- package/dist/apis/localstorage.js.map +1 -0
- package/dist/apis/localstorage.test.d.ts +2 -0
- package/dist/apis/localstorage.test.d.ts.map +1 -0
- package/dist/apis/localstorage.test.js +131 -0
- package/dist/apis/localstorage.test.js.map +1 -0
- package/dist/apis/oauth.d.ts +142 -0
- package/dist/apis/oauth.d.ts.map +1 -0
- package/dist/apis/oauth.js +551 -0
- package/dist/apis/oauth.js.map +1 -0
- package/dist/apis/preferences.d.ts +23 -0
- package/dist/apis/preferences.d.ts.map +1 -0
- package/dist/apis/preferences.js +105 -0
- package/dist/apis/preferences.js.map +1 -0
- package/dist/apis/toast.d.ts +81 -0
- package/dist/apis/toast.d.ts.map +1 -0
- package/dist/apis/toast.js +275 -0
- package/dist/apis/toast.js.map +1 -0
- package/dist/apis/toast.test.d.ts +2 -0
- package/dist/apis/toast.test.d.ts.map +1 -0
- package/dist/apis/toast.test.js +67 -0
- package/dist/apis/toast.test.js.map +1 -0
- package/dist/apis/window.d.ts +12 -0
- package/dist/apis/window.d.ts.map +1 -0
- package/dist/apis/window.js +47 -0
- package/dist/apis/window.js.map +1 -0
- package/dist/build.d.ts +15 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +213 -0
- package/dist/build.js.map +1 -0
- package/dist/build.test.d.ts +2 -0
- package/dist/build.test.d.ts.map +1 -0
- package/dist/build.test.js +73 -0
- package/dist/build.test.js.map +1 -0
- package/dist/cache.d.ts +32 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +205 -0
- package/dist/cache.js.map +1 -0
- package/dist/cache.test.d.ts +2 -0
- package/dist/cache.test.d.ts.map +1 -0
- package/dist/cache.test.js +246 -0
- package/dist/cache.test.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +278 -0
- package/dist/cli.js.map +1 -0
- package/dist/clipboard.d.ts +36 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +154 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/colors.d.ts +15 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +13 -0
- package/dist/colors.js.map +1 -0
- package/dist/components/actions.d.ts +120 -0
- package/dist/components/actions.d.ts.map +1 -0
- package/dist/components/actions.js +371 -0
- package/dist/components/actions.js.map +1 -0
- package/dist/components/alert.d.ts +25 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +99 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/detail.d.ts +65 -0
- package/dist/components/detail.d.ts.map +1 -0
- package/dist/components/detail.js +147 -0
- package/dist/components/detail.js.map +1 -0
- package/dist/components/dropdown.d.ts +40 -0
- package/dist/components/dropdown.d.ts.map +1 -0
- package/dist/components/dropdown.js +202 -0
- package/dist/components/dropdown.js.map +1 -0
- package/dist/components/extension-preferences.d.ts +8 -0
- package/dist/components/extension-preferences.d.ts.map +1 -0
- package/dist/components/extension-preferences.js +139 -0
- package/dist/components/extension-preferences.js.map +1 -0
- package/dist/components/form/assign-components.d.ts +2 -0
- package/dist/components/form/assign-components.d.ts.map +1 -0
- package/dist/components/form/assign-components.js +22 -0
- package/dist/components/form/assign-components.js.map +1 -0
- package/dist/components/form/checkbox.d.ts +7 -0
- package/dist/components/form/checkbox.d.ts.map +1 -0
- package/dist/components/form/checkbox.js +46 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/date-picker.d.ts +18 -0
- package/dist/components/form/date-picker.d.ts.map +1 -0
- package/dist/components/form/date-picker.js +69 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/description.d.ts +7 -0
- package/dist/components/form/description.d.ts.map +1 -0
- package/dist/components/form/description.js +8 -0
- package/dist/components/form/description.js.map +1 -0
- package/dist/components/form/dropdown.d.ts +25 -0
- package/dist/components/form/dropdown.d.ts.map +1 -0
- package/dist/components/form/dropdown.js +286 -0
- package/dist/components/form/dropdown.js.map +1 -0
- package/dist/components/form/file-autocomplete.d.ts +12 -0
- package/dist/components/form/file-autocomplete.d.ts.map +1 -0
- package/dist/components/form/file-autocomplete.js +84 -0
- package/dist/components/form/file-autocomplete.js.map +1 -0
- package/dist/components/form/file-picker.d.ts +31 -0
- package/dist/components/form/file-picker.d.ts.map +1 -0
- package/dist/components/form/file-picker.js +113 -0
- package/dist/components/form/file-picker.js.map +1 -0
- package/dist/components/form/form-end.d.ts +2 -0
- package/dist/components/form/form-end.d.ts.map +1 -0
- package/dist/components/form/form-end.js +6 -0
- package/dist/components/form/form-end.js.map +1 -0
- package/dist/components/form/form-type-only.d.ts +174 -0
- package/dist/components/form/form-type-only.d.ts.map +1 -0
- package/dist/components/form/form-type-only.js +2 -0
- package/dist/components/form/form-type-only.js.map +1 -0
- package/dist/components/form/index.d.ts +46 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +106 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/form/password-field.d.ts +7 -0
- package/dist/components/form/password-field.d.ts.map +1 -0
- package/dist/components/form/password-field.js +34 -0
- package/dist/components/form/password-field.js.map +1 -0
- package/dist/components/form/separator.d.ts +2 -0
- package/dist/components/form/separator.d.ts.map +1 -0
- package/dist/components/form/separator.js +8 -0
- package/dist/components/form/separator.js.map +1 -0
- package/dist/components/form/tagpicker.d.ts +134 -0
- package/dist/components/form/tagpicker.d.ts.map +1 -0
- package/dist/components/form/tagpicker.js +79 -0
- package/dist/components/form/tagpicker.js.map +1 -0
- package/dist/components/form/text-area.d.ts +8 -0
- package/dist/components/form/text-area.d.ts.map +1 -0
- package/dist/components/form/text-area.js +26 -0
- package/dist/components/form/text-area.js.map +1 -0
- package/dist/components/form/text-field.d.ts +7 -0
- package/dist/components/form/text-field.d.ts.map +1 -0
- package/dist/components/form/text-field.js +28 -0
- package/dist/components/form/text-field.js.map +1 -0
- package/dist/components/form/types.d.ts +43 -0
- package/dist/components/form/types.d.ts.map +1 -0
- package/dist/components/form/types.js +2 -0
- package/dist/components/form/types.js.map +1 -0
- package/dist/components/form/use-form-handling.d.ts +4 -0
- package/dist/components/form/use-form-handling.d.ts.map +1 -0
- package/dist/components/form/use-form-handling.js +37 -0
- package/dist/components/form/use-form-handling.js.map +1 -0
- package/dist/components/form/use-form-navigation.d.ts +8 -0
- package/dist/components/form/use-form-navigation.d.ts.map +1 -0
- package/dist/components/form/use-form-navigation.js +58 -0
- package/dist/components/form/use-form-navigation.js.map +1 -0
- package/dist/components/form/with-left-border.d.ts +17 -0
- package/dist/components/form/with-left-border.d.ts.map +1 -0
- package/dist/components/form/with-left-border.js +10 -0
- package/dist/components/form/with-left-border.js.map +1 -0
- package/dist/components/icon.d.ts +9 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +485 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/image.d.ts +19 -0
- package/dist/components/image.d.ts.map +1 -0
- package/dist/components/image.js +32 -0
- package/dist/components/image.js.map +1 -0
- package/dist/components/list.d.ts +234 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +667 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/loading-bar.d.ts +8 -0
- package/dist/components/loading-bar.d.ts.map +1 -0
- package/dist/components/loading-bar.js +107 -0
- package/dist/components/loading-bar.js.map +1 -0
- package/dist/components/menubar-extra.d.ts +68 -0
- package/dist/components/menubar-extra.d.ts.map +1 -0
- package/dist/components/menubar-extra.js +39 -0
- package/dist/components/menubar-extra.js.map +1 -0
- package/dist/descendants.d.ts +25 -0
- package/dist/descendants.d.ts.map +1 -0
- package/dist/descendants.js +81 -0
- package/dist/descendants.js.map +1 -0
- package/dist/dev-ui.d.ts +7 -0
- package/dist/dev-ui.d.ts.map +1 -0
- package/dist/dev-ui.js +118 -0
- package/dist/dev-ui.js.map +1 -0
- package/dist/e2e-node.d.ts +63 -0
- package/dist/e2e-node.d.ts.map +1 -0
- package/dist/e2e-node.js +255 -0
- package/dist/e2e-node.js.map +1 -0
- package/dist/e2e.d.ts +39 -0
- package/dist/e2e.d.ts.map +1 -0
- package/dist/e2e.js +127 -0
- package/dist/e2e.js.map +1 -0
- package/dist/environment.d.ts +63 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +189 -0
- package/dist/environment.js.map +1 -0
- package/dist/examples/action-show-in-finder.d.ts +2 -0
- package/dist/examples/action-show-in-finder.d.ts.map +1 -0
- package/dist/examples/action-show-in-finder.js +13 -0
- package/dist/examples/action-show-in-finder.js.map +1 -0
- package/dist/examples/datepicker.d.ts +2 -0
- package/dist/examples/datepicker.d.ts.map +1 -0
- package/dist/examples/datepicker.js +344 -0
- package/dist/examples/datepicker.js.map +1 -0
- package/dist/examples/environment-test.d.ts +2 -0
- package/dist/examples/environment-test.d.ts.map +1 -0
- package/dist/examples/environment-test.js +28 -0
- package/dist/examples/environment-test.js.map +1 -0
- package/dist/examples/error-boundary.d.ts +6 -0
- package/dist/examples/error-boundary.d.ts.map +1 -0
- package/dist/examples/error-boundary.js +67 -0
- package/dist/examples/error-boundary.js.map +1 -0
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts +2 -0
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts.map +1 -0
- package/dist/examples/form-basic-arrow-keys.vitest.js +46 -0
- package/dist/examples/form-basic-arrow-keys.vitest.js.map +1 -0
- package/dist/examples/form-basic.d.ts +2 -0
- package/dist/examples/form-basic.d.ts.map +1 -0
- package/dist/examples/form-basic.js +21 -0
- package/dist/examples/form-basic.js.map +1 -0
- package/dist/examples/form-basic.vitest.d.ts +2 -0
- package/dist/examples/form-basic.vitest.d.ts.map +1 -0
- package/dist/examples/form-basic.vitest.js +995 -0
- package/dist/examples/form-basic.vitest.js.map +1 -0
- package/dist/examples/form-dropdown-with-sections.d.ts +2 -0
- package/dist/examples/form-dropdown-with-sections.d.ts.map +1 -0
- package/dist/examples/form-dropdown-with-sections.js +13 -0
- package/dist/examples/form-dropdown-with-sections.js.map +1 -0
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts +2 -0
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts.map +1 -0
- package/dist/examples/form-dropdown-with-sections.vitest.js +75 -0
- package/dist/examples/form-dropdown-with-sections.vitest.js.map +1 -0
- package/dist/examples/form-dropdown.d.ts +2 -0
- package/dist/examples/form-dropdown.d.ts.map +1 -0
- package/dist/examples/form-dropdown.js +13 -0
- package/dist/examples/form-dropdown.js.map +1 -0
- package/dist/examples/form-dropdown.vitest.d.ts +2 -0
- package/dist/examples/form-dropdown.vitest.d.ts.map +1 -0
- package/dist/examples/form-dropdown.vitest.js +722 -0
- package/dist/examples/form-dropdown.vitest.js.map +1 -0
- package/dist/examples/form-multiselect-dropdown.d.ts +2 -0
- package/dist/examples/form-multiselect-dropdown.d.ts.map +1 -0
- package/dist/examples/form-multiselect-dropdown.js +13 -0
- package/dist/examples/form-multiselect-dropdown.js.map +1 -0
- package/dist/examples/form-tagpicker.d.ts +2 -0
- package/dist/examples/form-tagpicker.d.ts.map +1 -0
- package/dist/examples/form-tagpicker.js +13 -0
- package/dist/examples/form-tagpicker.js.map +1 -0
- package/dist/examples/form-tagpicker.vitest.d.ts +2 -0
- package/dist/examples/form-tagpicker.vitest.d.ts.map +1 -0
- package/dist/examples/form-tagpicker.vitest.js +491 -0
- package/dist/examples/form-tagpicker.vitest.js.map +1 -0
- package/dist/examples/internal/descendants-filtering.d.ts +2 -0
- package/dist/examples/internal/descendants-filtering.d.ts.map +1 -0
- package/dist/examples/internal/descendants-filtering.js +144 -0
- package/dist/examples/internal/descendants-filtering.js.map +1 -0
- package/dist/examples/internal/descendants.d.ts +2 -0
- package/dist/examples/internal/descendants.d.ts.map +1 -0
- package/dist/examples/internal/descendants.js +134 -0
- package/dist/examples/internal/descendants.js.map +1 -0
- package/dist/examples/internal/nested-boxes.d.ts +2 -0
- package/dist/examples/internal/nested-boxes.d.ts.map +1 -0
- package/dist/examples/internal/nested-boxes.js +7 -0
- package/dist/examples/internal/nested-boxes.js.map +1 -0
- package/dist/examples/internal/scrollbox-demo.d.ts +2 -0
- package/dist/examples/internal/scrollbox-demo.d.ts.map +1 -0
- package/dist/examples/internal/scrollbox-demo.js +104 -0
- package/dist/examples/internal/scrollbox-demo.js.map +1 -0
- package/dist/examples/internal/simple-dialog.d.ts +2 -0
- package/dist/examples/internal/simple-dialog.d.ts.map +1 -0
- package/dist/examples/internal/simple-dialog.js +43 -0
- package/dist/examples/internal/simple-dialog.js.map +1 -0
- package/dist/examples/internal/text-stacking.d.ts +2 -0
- package/dist/examples/internal/text-stacking.d.ts.map +1 -0
- package/dist/examples/internal/text-stacking.js +53 -0
- package/dist/examples/internal/text-stacking.js.map +1 -0
- package/dist/examples/internal/unicode-square-repro.d.ts +2 -0
- package/dist/examples/internal/unicode-square-repro.d.ts.map +1 -0
- package/dist/examples/internal/unicode-square-repro.js +7 -0
- package/dist/examples/internal/unicode-square-repro.js.map +1 -0
- package/dist/examples/list-dropdown-default.d.ts +2 -0
- package/dist/examples/list-dropdown-default.d.ts.map +1 -0
- package/dist/examples/list-dropdown-default.js +14 -0
- package/dist/examples/list-dropdown-default.js.map +1 -0
- package/dist/examples/list-dropdown-default.vitest.d.ts +2 -0
- package/dist/examples/list-dropdown-default.vitest.d.ts.map +1 -0
- package/dist/examples/list-dropdown-default.vitest.js +164 -0
- package/dist/examples/list-dropdown-default.vitest.js.map +1 -0
- package/dist/examples/list-fetch-data.d.ts +2 -0
- package/dist/examples/list-fetch-data.d.ts.map +1 -0
- package/dist/examples/list-fetch-data.js +87 -0
- package/dist/examples/list-fetch-data.js.map +1 -0
- package/dist/examples/list-fetch-data.vitest.d.ts +2 -0
- package/dist/examples/list-fetch-data.vitest.d.ts.map +1 -0
- package/dist/examples/list-fetch-data.vitest.js +103 -0
- package/dist/examples/list-fetch-data.vitest.js.map +1 -0
- package/dist/examples/list-filter-navigation.d.ts +2 -0
- package/dist/examples/list-filter-navigation.d.ts.map +1 -0
- package/dist/examples/list-filter-navigation.js +8 -0
- package/dist/examples/list-filter-navigation.js.map +1 -0
- package/dist/examples/list-with-detail.d.ts +2 -0
- package/dist/examples/list-with-detail.d.ts.map +1 -0
- package/dist/examples/list-with-detail.js +94 -0
- package/dist/examples/list-with-detail.js.map +1 -0
- package/dist/examples/list-with-detail.vitest.d.ts +2 -0
- package/dist/examples/list-with-detail.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-detail.vitest.js +438 -0
- package/dist/examples/list-with-detail.vitest.js.map +1 -0
- package/dist/examples/list-with-dropdown.d.ts +2 -0
- package/dist/examples/list-with-dropdown.d.ts.map +1 -0
- package/dist/examples/list-with-dropdown.js +43 -0
- package/dist/examples/list-with-dropdown.js.map +1 -0
- package/dist/examples/list-with-dropdown.vitest.d.ts +2 -0
- package/dist/examples/list-with-dropdown.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-dropdown.vitest.js +297 -0
- package/dist/examples/list-with-dropdown.vitest.js.map +1 -0
- package/dist/examples/list-with-sections.d.ts +2 -0
- package/dist/examples/list-with-sections.d.ts.map +1 -0
- package/dist/examples/list-with-sections.js +67 -0
- package/dist/examples/list-with-sections.js.map +1 -0
- package/dist/examples/list-with-sections.vitest.d.ts +2 -0
- package/dist/examples/list-with-sections.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-sections.vitest.js +441 -0
- package/dist/examples/list-with-sections.vitest.js.map +1 -0
- package/dist/examples/miscellaneous.d.ts +2 -0
- package/dist/examples/miscellaneous.d.ts.map +1 -0
- package/dist/examples/miscellaneous.js +313 -0
- package/dist/examples/miscellaneous.js.map +1 -0
- package/dist/examples/nested-navigation.d.ts +2 -0
- package/dist/examples/nested-navigation.d.ts.map +1 -0
- package/dist/examples/nested-navigation.js +35 -0
- package/dist/examples/nested-navigation.js.map +1 -0
- package/dist/examples/preferences-test.d.ts +2 -0
- package/dist/examples/preferences-test.d.ts.map +1 -0
- package/dist/examples/preferences-test.js +43 -0
- package/dist/examples/preferences-test.js.map +1 -0
- package/dist/examples/simple-dropdown.d.ts +2 -0
- package/dist/examples/simple-dropdown.d.ts.map +1 -0
- package/dist/examples/simple-dropdown.js +15 -0
- package/dist/examples/simple-dropdown.js.map +1 -0
- package/dist/examples/simple-file-picker.d.ts +2 -0
- package/dist/examples/simple-file-picker.d.ts.map +1 -0
- package/dist/examples/simple-file-picker.js +21 -0
- package/dist/examples/simple-file-picker.js.map +1 -0
- package/dist/examples/simple-file-picker.vitest.d.ts +2 -0
- package/dist/examples/simple-file-picker.vitest.d.ts.map +1 -0
- package/dist/examples/simple-file-picker.vitest.js +277 -0
- package/dist/examples/simple-file-picker.vitest.js.map +1 -0
- package/dist/examples/simple-grid.d.ts +2 -0
- package/dist/examples/simple-grid.d.ts.map +1 -0
- package/dist/examples/simple-grid.js +51 -0
- package/dist/examples/simple-grid.js.map +1 -0
- package/dist/examples/simple-grid.vitest.d.ts +2 -0
- package/dist/examples/simple-grid.vitest.d.ts.map +1 -0
- package/dist/examples/simple-grid.vitest.js +498 -0
- package/dist/examples/simple-grid.vitest.js.map +1 -0
- package/dist/examples/simple-hud.d.ts +2 -0
- package/dist/examples/simple-hud.d.ts.map +1 -0
- package/dist/examples/simple-hud.js +18 -0
- package/dist/examples/simple-hud.js.map +1 -0
- package/dist/examples/simple-list-search.d.ts +2 -0
- package/dist/examples/simple-list-search.d.ts.map +1 -0
- package/dist/examples/simple-list-search.js +26 -0
- package/dist/examples/simple-list-search.js.map +1 -0
- package/dist/examples/simple-list.d.ts +2 -0
- package/dist/examples/simple-list.d.ts.map +1 -0
- package/dist/examples/simple-list.js +50 -0
- package/dist/examples/simple-list.js.map +1 -0
- package/dist/examples/simple-navigation.d.ts +2 -0
- package/dist/examples/simple-navigation.d.ts.map +1 -0
- package/dist/examples/simple-navigation.js +36 -0
- package/dist/examples/simple-navigation.js.map +1 -0
- package/dist/examples/simple-navigation.vitest.d.ts +2 -0
- package/dist/examples/simple-navigation.vitest.d.ts.map +1 -0
- package/dist/examples/simple-navigation.vitest.js +522 -0
- package/dist/examples/simple-navigation.vitest.js.map +1 -0
- package/dist/examples/store.d.ts +2 -0
- package/dist/examples/store.d.ts.map +1 -0
- package/dist/examples/store.js +5 -0
- package/dist/examples/store.js.map +1 -0
- package/dist/examples/store.vitest.d.ts +2 -0
- package/dist/examples/store.vitest.d.ts.map +1 -0
- package/dist/examples/store.vitest.js +52 -0
- package/dist/examples/store.vitest.js.map +1 -0
- package/dist/examples/tanstack-demo.d.ts +2 -0
- package/dist/examples/tanstack-demo.d.ts.map +1 -0
- package/dist/examples/tanstack-demo.js +51 -0
- package/dist/examples/tanstack-demo.js.map +1 -0
- package/dist/examples/use-promise-demo.d.ts +2 -0
- package/dist/examples/use-promise-demo.d.ts.map +1 -0
- package/dist/examples/use-promise-demo.js +45 -0
- package/dist/examples/use-promise-demo.js.map +1 -0
- package/dist/extensions/dev.d.ts +7 -0
- package/dist/extensions/dev.d.ts.map +1 -0
- package/dist/extensions/dev.js +124 -0
- package/dist/extensions/dev.js.map +1 -0
- package/dist/extensions/home.d.ts +8 -0
- package/dist/extensions/home.d.ts.map +1 -0
- package/dist/extensions/home.js +184 -0
- package/dist/extensions/home.js.map +1 -0
- package/dist/extensions/store.d.ts +6 -0
- package/dist/extensions/store.d.ts.map +1 -0
- package/dist/extensions/store.js +203 -0
- package/dist/extensions/store.js.map +1 -0
- package/dist/globals.d.ts +9 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +21 -0
- package/dist/globals.js.map +1 -0
- package/dist/home-command.d.ts +8 -0
- package/dist/home-command.d.ts.map +1 -0
- package/dist/home-command.js +181 -0
- package/dist/home-command.js.map +1 -0
- package/dist/hooks/hooks.test.d.ts +2 -0
- package/dist/hooks/hooks.test.d.ts.map +1 -0
- package/dist/hooks/hooks.test.js +37 -0
- package/dist/hooks/hooks.test.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-action-panel.d.ts +16 -0
- package/dist/hooks/use-action-panel.d.ts.map +1 -0
- package/dist/hooks/use-action-panel.js +19 -0
- package/dist/hooks/use-action-panel.js.map +1 -0
- package/dist/hooks/use-id.d.ts +9 -0
- package/dist/hooks/use-id.d.ts.map +1 -0
- package/dist/hooks/use-id.js +17 -0
- package/dist/hooks/use-id.js.map +1 -0
- package/dist/hooks/use-unstable-ai.d.ts +9 -0
- package/dist/hooks/use-unstable-ai.d.ts.map +1 -0
- package/dist/hooks/use-unstable-ai.js +13 -0
- package/dist/hooks/use-unstable-ai.js.map +1 -0
- package/dist/hooks.d.ts +10 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +20 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hover-repro.d.ts +2 -0
- package/dist/hover-repro.d.ts.map +1 -0
- package/dist/hover-repro.js +20 -0
- package/dist/hover-repro.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/date-picker-widget.d.ts +9 -0
- package/dist/internal/date-picker-widget.d.ts.map +1 -0
- package/dist/internal/date-picker-widget.js +380 -0
- package/dist/internal/date-picker-widget.js.map +1 -0
- package/dist/internal/dialog.d.ts +21 -0
- package/dist/internal/dialog.d.ts.map +1 -0
- package/dist/internal/dialog.js +122 -0
- package/dist/internal/dialog.js.map +1 -0
- package/dist/internal/error-handler.d.ts +2 -0
- package/dist/internal/error-handler.d.ts.map +1 -0
- package/dist/internal/error-handler.js +29 -0
- package/dist/internal/error-handler.js.map +1 -0
- package/dist/internal/focus-context.d.ts +10 -0
- package/dist/internal/focus-context.d.ts.map +1 -0
- package/dist/internal/focus-context.js +12 -0
- package/dist/internal/focus-context.js.map +1 -0
- package/dist/internal/navigation.d.ts +18 -0
- package/dist/internal/navigation.d.ts.map +1 -0
- package/dist/internal/navigation.js +83 -0
- package/dist/internal/navigation.js.map +1 -0
- package/dist/internal/providers.d.ts +8 -0
- package/dist/internal/providers.d.ts.map +1 -0
- package/dist/internal/providers.js +262 -0
- package/dist/internal/providers.js.map +1 -0
- package/dist/localstorage.d.ts +13 -0
- package/dist/localstorage.d.ts.map +1 -0
- package/dist/localstorage.js +190 -0
- package/dist/localstorage.js.map +1 -0
- package/dist/localstorage.test.d.ts +2 -0
- package/dist/localstorage.test.d.ts.map +1 -0
- package/dist/localstorage.test.js +131 -0
- package/dist/localstorage.test.js.map +1 -0
- package/dist/logger.d.ts +7 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +70 -0
- package/dist/logger.js.map +1 -0
- package/dist/oauth.d.ts +142 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +551 -0
- package/dist/oauth.js.map +1 -0
- package/dist/package-json.d.ts +84 -0
- package/dist/package-json.d.ts.map +1 -0
- package/dist/package-json.js +77 -0
- package/dist/package-json.js.map +1 -0
- package/dist/preferences.d.ts +23 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +105 -0
- package/dist/preferences.js.map +1 -0
- package/dist/preload.d.ts +2 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/preload.js +28 -0
- package/dist/preload.js.map +1 -0
- package/dist/state.d.ts +26 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +18 -0
- package/dist/state.js.map +1 -0
- package/dist/store-api/download.d.ts +8 -0
- package/dist/store-api/download.d.ts.map +1 -0
- package/dist/store-api/download.js +37 -0
- package/dist/store-api/download.js.map +1 -0
- package/dist/store-api/download.test.d.ts +2 -0
- package/dist/store-api/download.test.d.ts.map +1 -0
- package/dist/store-api/download.test.js +36 -0
- package/dist/store-api/download.test.js.map +1 -0
- package/dist/store-api/extension.d.ts +87 -0
- package/dist/store-api/extension.d.ts.map +1 -0
- package/dist/store-api/extension.js +23 -0
- package/dist/store-api/extension.js.map +1 -0
- package/dist/store-api/extension.test.d.ts +2 -0
- package/dist/store-api/extension.test.d.ts.map +1 -0
- package/dist/store-api/extension.test.js +22 -0
- package/dist/store-api/extension.test.js.map +1 -0
- package/dist/store-api/search.d.ts +101 -0
- package/dist/store-api/search.d.ts.map +1 -0
- package/dist/store-api/search.js +29 -0
- package/dist/store-api/search.js.map +1 -0
- package/dist/store-api/search.test.d.ts +2 -0
- package/dist/store-api/search.test.d.ts.map +1 -0
- package/dist/store-api/search.test.js +45 -0
- package/dist/store-api/search.test.js.map +1 -0
- package/dist/store.d.ts +21 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +84 -0
- package/dist/store.js.map +1 -0
- package/dist/theme.d.ts +20 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +26 -0
- package/dist/theme.js.map +1 -0
- package/dist/toast.d.ts +44 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +221 -0
- package/dist/toast.js.map +1 -0
- package/dist/utils/file-system.d.ts +11 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +66 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils.d.ts +234 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +473 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.test.d.ts +2 -0
- package/dist/utils.test.d.ts.map +1 -0
- package/dist/utils.test.js +152 -0
- package/dist/utils.test.js.map +1 -0
- package/dist/window.d.ts +12 -0
- package/dist/window.d.ts.map +1 -0
- package/dist/window.js +48 -0
- package/dist/window.js.map +1 -0
- package/package.json +56 -0
- package/src/action-utils.tsx +207 -0
- package/src/apis/ai.tsx +177 -0
- package/src/apis/cache.test.ts +311 -0
- package/src/apis/cache.tsx +394 -0
- package/src/apis/clipboard.tsx +200 -0
- package/src/apis/environment.tsx +239 -0
- package/src/apis/hud.tsx +86 -0
- package/src/apis/localstorage.test.ts +164 -0
- package/src/apis/localstorage.tsx +215 -0
- package/src/apis/oauth.tsx +744 -0
- package/src/apis/preferences.tsx +140 -0
- package/src/apis/toast.tsx +388 -0
- package/src/apis/window.tsx +61 -0
- package/src/build.test.tsx +78 -0
- package/src/build.tsx +273 -0
- package/src/cli.tsx +328 -0
- package/src/colors.tsx +15 -0
- package/src/components/actions.tsx +718 -0
- package/src/components/alert.tsx +205 -0
- package/src/components/detail.tsx +359 -0
- package/src/components/dropdown.tsx +438 -0
- package/src/components/extension-preferences.tsx +269 -0
- package/src/components/form/assign-components.tsx +22 -0
- package/src/components/form/checkbox.tsx +96 -0
- package/src/components/form/date-picker.tsx +125 -0
- package/src/components/form/description.tsx +30 -0
- package/src/components/form/dropdown.tsx +512 -0
- package/src/components/form/file-autocomplete.tsx +141 -0
- package/src/components/form/file-picker.tsx +233 -0
- package/src/components/form/form-end.tsx +6 -0
- package/src/components/form/index.tsx +242 -0
- package/src/components/form/password-field.tsx +87 -0
- package/src/components/form/separator.tsx +15 -0
- package/src/components/form/tagpicker.tsx +245 -0
- package/src/components/form/text-area.tsx +82 -0
- package/src/components/form/text-field.tsx +82 -0
- package/src/components/form/types.tsx +49 -0
- package/src/components/form/use-form-navigation.tsx +65 -0
- package/src/components/form/with-left-border.tsx +53 -0
- package/src/components/icon.tsx +496 -0
- package/src/components/image.tsx +54 -0
- package/src/components/list.tsx +1564 -0
- package/src/components/loading-bar.tsx +141 -0
- package/src/components/menubar-extra.tsx +181 -0
- package/src/descendants.tsx +134 -0
- package/src/e2e-node.tsx +303 -0
- package/src/e2e.tsx +147 -0
- package/src/examples/action-show-in-finder.tsx +80 -0
- package/src/examples/environment-test.tsx +50 -0
- package/src/examples/error-boundary.tsx +217 -0
- package/src/examples/form-basic.tsx +122 -0
- package/src/examples/form-basic.vitest.tsx +1035 -0
- package/src/examples/form-dropdown.tsx +102 -0
- package/src/examples/form-dropdown.vitest.tsx +758 -0
- package/src/examples/form-tagpicker.tsx +66 -0
- package/src/examples/form-tagpicker.vitest.tsx +523 -0
- package/src/examples/internal/descendants-filtering.tsx +223 -0
- package/src/examples/internal/descendants.tsx +208 -0
- package/src/examples/internal/scrollbox-demo.tsx +149 -0
- package/src/examples/internal/simple-dialog.tsx +124 -0
- package/src/examples/internal/text-stacking.tsx +90 -0
- package/src/examples/list-dropdown-default.tsx +69 -0
- package/src/examples/list-dropdown-default.vitest.tsx +187 -0
- package/src/examples/list-fetch-data.tsx +123 -0
- package/src/examples/list-fetch-data.vitest.tsx +110 -0
- package/src/examples/list-with-detail.tsx +161 -0
- package/src/examples/list-with-detail.vitest.tsx +468 -0
- package/src/examples/list-with-dropdown.tsx +97 -0
- package/src/examples/list-with-dropdown.vitest.tsx +324 -0
- package/src/examples/list-with-sections.tsx +196 -0
- package/src/examples/list-with-sections.vitest.tsx +479 -0
- package/src/examples/miscellaneous.tsx +780 -0
- package/src/examples/nested-navigation.tsx +118 -0
- package/src/examples/preferences-test.tsx +82 -0
- package/src/examples/simple-dropdown.tsx +95 -0
- package/src/examples/simple-file-picker.tsx +75 -0
- package/src/examples/simple-file-picker.vitest.tsx +306 -0
- package/src/examples/simple-grid.tsx +149 -0
- package/src/examples/simple-grid.vitest.tsx +535 -0
- package/src/examples/simple-hud.tsx +60 -0
- package/src/examples/simple-list-search.tsx +93 -0
- package/src/examples/simple-list.tsx +149 -0
- package/src/examples/simple-navigation.tsx +89 -0
- package/src/examples/simple-navigation.vitest.tsx +571 -0
- package/src/examples/store.tsx +4 -0
- package/src/examples/store.vitest.tsx +59 -0
- package/src/examples/tanstack-demo.tsx +104 -0
- package/src/examples/use-promise-demo.tsx +96 -0
- package/src/extensions/dev.tsx +215 -0
- package/src/extensions/home.tsx +332 -0
- package/src/extensions/store.tsx +375 -0
- package/src/globals.ts +34 -0
- package/src/hooks/index.tsx +8 -0
- package/src/hooks/use-action-panel.tsx +28 -0
- package/src/hooks/use-id.tsx +19 -0
- package/src/hooks/use-unstable-ai.tsx +15 -0
- package/src/hooks.tsx +22 -0
- package/src/index.tsx +240 -0
- package/src/internal/date-picker-widget.tsx +500 -0
- package/src/internal/dialog.tsx +202 -0
- package/src/internal/error-handler.tsx +32 -0
- package/src/internal/focus-context.tsx +23 -0
- package/src/internal/navigation.tsx +149 -0
- package/src/internal/providers.tsx +430 -0
- package/src/logger.tsx +84 -0
- package/src/package-json.tsx +197 -0
- package/src/preload.tsx +32 -0
- package/src/state.tsx +49 -0
- package/src/store-api/download.test.tsx +38 -0
- package/src/store-api/download.tsx +52 -0
- package/src/store-api/extension.test.tsx +24 -0
- package/src/store-api/extension.tsx +123 -0
- package/src/store-api/search.test.tsx +50 -0
- package/src/store-api/search.tsx +146 -0
- package/src/theme.tsx +31 -0
- package/src/utils/file-system.ts +87 -0
- package/src/utils.test.tsx +204 -0
- package/src/utils.tsx +657 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAwB,eAAe,EAAE,MAAM,gBAAgB,CAAA;AA8KtE,UAAU,cAAe,SAAQ,eAAe;IAC9C,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,aAAa,EACb,MAAc,EACd,MAAM,GACP,EAAE;IACD,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;CACxB,GAAG,OAAO,CAAC,WAAW,CAAC,CA6EvB"}
|
package/dist/build.js
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { logger } from './logger';
|
|
4
|
+
import { getCommandsWithFiles } from './package-json';
|
|
5
|
+
import * as termcastApi from '@termcast/cli';
|
|
6
|
+
import * as opentuiReact from '@opentui/react';
|
|
7
|
+
import * as opentuiCore from '@opentui/core';
|
|
8
|
+
import * as react from 'react';
|
|
9
|
+
const GLOBALS_NAMESPACE = 'globals';
|
|
10
|
+
const aliasPlugin = {
|
|
11
|
+
name: 'alias-raycast-to-termcast',
|
|
12
|
+
async setup(build) {
|
|
13
|
+
// Import packages once at setup time
|
|
14
|
+
const packages = [
|
|
15
|
+
{
|
|
16
|
+
path: '@termcast/cli',
|
|
17
|
+
module: termcastApi,
|
|
18
|
+
globalName: 'termcastApi',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: '@opentui/react',
|
|
22
|
+
module: opentuiReact,
|
|
23
|
+
globalName: 'opentuiReact',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
path: '@opentui/core',
|
|
27
|
+
module: opentuiCore,
|
|
28
|
+
globalName: 'opentuiCore',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
path: 'react',
|
|
32
|
+
module: react,
|
|
33
|
+
globalName: 'react',
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
// Alias @raycast/api to @termcast/cli using namespace
|
|
37
|
+
build.onResolve({ filter: /@raycast\/api/ }, () => {
|
|
38
|
+
logger.log('Resolving @raycast/api to @termcast/cli');
|
|
39
|
+
return {
|
|
40
|
+
path: '@termcast/cli',
|
|
41
|
+
namespace: GLOBALS_NAMESPACE,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
// Resolve external packages to globals namespace
|
|
45
|
+
build.onResolve({ filter: /^@termcast\/cli/ }, (args) => {
|
|
46
|
+
return {
|
|
47
|
+
path: '@termcast/cli',
|
|
48
|
+
namespace: GLOBALS_NAMESPACE,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
build.onResolve({ filter: /^@opentui\/react/ }, (args) => {
|
|
52
|
+
// Handle @opentui/react/jsx-dev-runtime specifically
|
|
53
|
+
if (args.path.includes('jsx')) {
|
|
54
|
+
return {
|
|
55
|
+
path: 'react/jsx-runtime',
|
|
56
|
+
namespace: GLOBALS_NAMESPACE,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
path: '@opentui/react',
|
|
61
|
+
namespace: GLOBALS_NAMESPACE,
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
build.onResolve({ filter: /^@opentui\/core/ }, () => {
|
|
65
|
+
return {
|
|
66
|
+
path: '@opentui/core',
|
|
67
|
+
namespace: GLOBALS_NAMESPACE,
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
build.onResolve({ filter: /^react\/jsx-runtime/ }, () => {
|
|
71
|
+
return {
|
|
72
|
+
path: 'react/jsx-runtime',
|
|
73
|
+
namespace: GLOBALS_NAMESPACE,
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
build.onResolve({ filter: /^react($|\/|$)/ }, (args) => {
|
|
77
|
+
if (args.path === 'react' || args.path === 'react/') {
|
|
78
|
+
return {
|
|
79
|
+
path: 'react',
|
|
80
|
+
namespace: GLOBALS_NAMESPACE,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// For jsx-dev-runtime
|
|
84
|
+
if (args.path.includes('jsx')) {
|
|
85
|
+
return {
|
|
86
|
+
path: 'react/jsx-runtime',
|
|
87
|
+
namespace: GLOBALS_NAMESPACE,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
});
|
|
92
|
+
// Handle loading from globals namespace
|
|
93
|
+
build.onLoad({ filter: /.*/, namespace: GLOBALS_NAMESPACE }, async (args) => {
|
|
94
|
+
// Handle regular packages
|
|
95
|
+
const pkg = packages.find((p) => p.path === args.path);
|
|
96
|
+
if (pkg) {
|
|
97
|
+
const exports = [];
|
|
98
|
+
for (const key in pkg.module) {
|
|
99
|
+
if (key === 'default') {
|
|
100
|
+
// Special handling for react default export
|
|
101
|
+
if (pkg.path === 'react') {
|
|
102
|
+
exports.push(`export default /* @__PURE__ */ globalThis.${pkg.globalName};`);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
exports.push(`export default /* @__PURE__ */ globalThis.${pkg.globalName}.default;`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
exports.push(`export const ${key} = /* @__PURE__ */ globalThis.${pkg.globalName}.${key};`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
contents: exports.join('\n'),
|
|
114
|
+
loader: 'js',
|
|
115
|
+
pure: true,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
// Special handling for react/jsx-runtime
|
|
119
|
+
if (args.path === 'react/jsx-runtime') {
|
|
120
|
+
const jsxRuntime = await import('react/jsx-runtime');
|
|
121
|
+
const jsxDevRuntime = await import('react/jsx-dev-runtime');
|
|
122
|
+
const exports = [];
|
|
123
|
+
// Export from jsx-runtime
|
|
124
|
+
for (const key in jsxRuntime) {
|
|
125
|
+
if (key === 'default') {
|
|
126
|
+
// Skip default export for jsx-runtime
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
exports.push(`export const ${key} = /* @__PURE__ */ globalThis.reactJsxRuntime.${key};`);
|
|
130
|
+
}
|
|
131
|
+
// Also export jsxDEV from jsx-dev-runtime
|
|
132
|
+
exports.push(`export const jsxDEV = /* @__PURE__ */ (globalThis.reactJsxRuntime.jsxDEV || globalThis.reactJsxRuntime.jsx);`);
|
|
133
|
+
return {
|
|
134
|
+
contents: exports.join('\n'),
|
|
135
|
+
loader: 'js',
|
|
136
|
+
pure: true,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
logger.error(`matched a file that had no handling for exports plugin ${args.path}`);
|
|
140
|
+
return {
|
|
141
|
+
contents: 'export {}',
|
|
142
|
+
loader: 'js',
|
|
143
|
+
pure: true,
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
export async function buildExtensionCommands({ extensionPath, format = 'cjs', target, }) {
|
|
149
|
+
const resolvedPath = path.resolve(extensionPath);
|
|
150
|
+
const bundleDir = path.join(resolvedPath, '.termcast-bundle');
|
|
151
|
+
// Ensure bundle directory exists
|
|
152
|
+
if (!fs.existsSync(bundleDir)) {
|
|
153
|
+
fs.mkdirSync(bundleDir, { recursive: true });
|
|
154
|
+
}
|
|
155
|
+
const commandsData = getCommandsWithFiles({
|
|
156
|
+
packageJsonPath: path.join(resolvedPath, 'package.json'),
|
|
157
|
+
});
|
|
158
|
+
// Filter existing command files as entrypoints
|
|
159
|
+
const entrypoints = commandsData.commands
|
|
160
|
+
.filter((cmd) => cmd.exists)
|
|
161
|
+
.map((cmd) => cmd.filePath);
|
|
162
|
+
if (entrypoints.length === 0) {
|
|
163
|
+
throw new Error('No command files found to build');
|
|
164
|
+
}
|
|
165
|
+
logger.log(`Building ${entrypoints.length} commands...`);
|
|
166
|
+
const result = await Bun.build({
|
|
167
|
+
entrypoints,
|
|
168
|
+
outdir: bundleDir,
|
|
169
|
+
target: target || (format === 'cjs' ? 'node' : 'bun'),
|
|
170
|
+
format,
|
|
171
|
+
// external: [],
|
|
172
|
+
plugins: [aliasPlugin],
|
|
173
|
+
naming: '[name].js',
|
|
174
|
+
throw: false,
|
|
175
|
+
});
|
|
176
|
+
if (!result.success) {
|
|
177
|
+
const errorMessage = result.logs
|
|
178
|
+
.map((log) => log.message || log)
|
|
179
|
+
.join('\n');
|
|
180
|
+
throw new Error(`Build failed: ${errorMessage}`);
|
|
181
|
+
}
|
|
182
|
+
// Map outputs back to commands
|
|
183
|
+
const bundledCommands = commandsData.commands.map((command) => {
|
|
184
|
+
if (!command.exists) {
|
|
185
|
+
return {
|
|
186
|
+
...command,
|
|
187
|
+
bundledPath: '',
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
// Find the corresponding output for this command
|
|
191
|
+
const outputFileName = `${command.name}.js`;
|
|
192
|
+
const output = result.outputs.find((out) => {
|
|
193
|
+
return path.basename(out.path) === outputFileName;
|
|
194
|
+
});
|
|
195
|
+
if (output) {
|
|
196
|
+
const bundledPath = path.join(bundleDir, outputFileName);
|
|
197
|
+
logger.log(`Built ${command.name} -> ${bundledPath}`);
|
|
198
|
+
return {
|
|
199
|
+
...command,
|
|
200
|
+
bundledPath,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
throw new Error(`No output found for command: ${command.name}`);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
logger.log(`Successfully built ${result.outputs.length} files`);
|
|
208
|
+
return {
|
|
209
|
+
commands: bundledCommands,
|
|
210
|
+
bundleDir,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,oBAAoB,EAAmB,MAAM,gBAAgB,CAAA;AACtE,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,iBAAiB,GAAG,SAAS,CAAA;AAEnC,MAAM,WAAW,GAAc;IAC7B,IAAI,EAAE,2BAA2B;IACjC,KAAK,CAAC,KAAK,CAAC,KAAK;QACf,qCAAqC;QACrC,MAAM,QAAQ,GAAG;YACf;gBACE,IAAI,EAAE,eAAe;gBACrB,MAAM,EAAE,WAAW;gBACnB,UAAU,EAAE,aAAa;aAC1B;YACD;gBACE,IAAI,EAAE,gBAAgB;gBACtB,MAAM,EAAE,YAAY;gBACpB,UAAU,EAAE,cAAc;aAC3B;YACD;gBACE,IAAI,EAAE,eAAe;gBACrB,MAAM,EAAE,WAAW;gBACnB,UAAU,EAAE,aAAa;aAC1B;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,KAAK;gBACb,UAAU,EAAE,OAAO;aACpB;SACF,CAAA;QAED,sDAAsD;QACtD,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE;YAChD,MAAM,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAA;YACrD,OAAO;gBACL,IAA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describe, test, expect } from 'bun:test';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { buildExtensionCommands } from './build';
|
|
4
|
+
describe('buildExtensionCommands', () => {
|
|
5
|
+
test('builds a simple extension with multiple commands', async () => {
|
|
6
|
+
const fixtureDir = path.join(process.cwd(), 'fixtures/simple-extension');
|
|
7
|
+
const result = await buildExtensionCommands({
|
|
8
|
+
extensionPath: fixtureDir,
|
|
9
|
+
target: 'node',
|
|
10
|
+
});
|
|
11
|
+
// Replace the user-specific base path with a constant placeholder
|
|
12
|
+
const resultString = JSON.stringify(result, null, 2);
|
|
13
|
+
const normalizedString = resultString.replaceAll(process.cwd(), '/BASE_PATH');
|
|
14
|
+
expect(normalizedString).toMatchInlineSnapshot(`
|
|
15
|
+
"{
|
|
16
|
+
"commands": [
|
|
17
|
+
{
|
|
18
|
+
"name": "list-items",
|
|
19
|
+
"title": "List Items",
|
|
20
|
+
"subtitle": "Shows a list of items",
|
|
21
|
+
"description": "Displays a simple list with some items",
|
|
22
|
+
"mode": "view",
|
|
23
|
+
"filePath": "/BASE_PATH/fixtures/simple-extension/src/list-items.tsx",
|
|
24
|
+
"exists": true,
|
|
25
|
+
"bundledPath": "/BASE_PATH/fixtures/simple-extension/.termcast-bundle/list-items.js"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "search-items",
|
|
29
|
+
"title": "Search Items",
|
|
30
|
+
"subtitle": "Search through items",
|
|
31
|
+
"description": "Search and filter through a list of items",
|
|
32
|
+
"mode": "view",
|
|
33
|
+
"filePath": "/BASE_PATH/fixtures/simple-extension/src/search-items.tsx",
|
|
34
|
+
"exists": true,
|
|
35
|
+
"bundledPath": "/BASE_PATH/fixtures/simple-extension/.termcast-bundle/search-items.js"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "oauth",
|
|
39
|
+
"title": "Google Oauth",
|
|
40
|
+
"subtitle": "auth",
|
|
41
|
+
"description": "",
|
|
42
|
+
"mode": "view",
|
|
43
|
+
"filePath": "/BASE_PATH/fixtures/simple-extension/src/oauth.tsx",
|
|
44
|
+
"exists": true,
|
|
45
|
+
"bundledPath": "/BASE_PATH/fixtures/simple-extension/.termcast-bundle/oauth.js"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "use-promise-demo",
|
|
49
|
+
"title": "usePromise Demo",
|
|
50
|
+
"subtitle": "Demonstrates usePromise hook",
|
|
51
|
+
"description": "Shows how to use the usePromise hook from @raycast/utils",
|
|
52
|
+
"mode": "view",
|
|
53
|
+
"filePath": "/BASE_PATH/fixtures/simple-extension/src/use-promise-demo.tsx",
|
|
54
|
+
"exists": true,
|
|
55
|
+
"bundledPath": "/BASE_PATH/fixtures/simple-extension/.termcast-bundle/use-promise-demo.js"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "show-state",
|
|
59
|
+
"title": "Show State",
|
|
60
|
+
"subtitle": "Display current state as JSON",
|
|
61
|
+
"description": "Shows the current application state in JSON format",
|
|
62
|
+
"mode": "view",
|
|
63
|
+
"filePath": "/BASE_PATH/fixtures/simple-extension/src/show-state.tsx",
|
|
64
|
+
"exists": true,
|
|
65
|
+
"bundledPath": "/BASE_PATH/fixtures/simple-extension/.termcast-bundle/show-state.js"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"bundleDir": "/BASE_PATH/fixtures/simple-extension/.termcast-bundle"
|
|
69
|
+
}"
|
|
70
|
+
`);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=build.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.test.js","sourceRoot":"","sources":["../src/build.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAEhD,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,IAAI,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,2BAA2B,CAAC,CAAA;QACxE,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC;YAC1C,aAAa,EAAE,UAAU;YACzB,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;QAEF,kEAAkE;QAClE,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;QACpD,MAAM,gBAAgB,GAAG,YAAY,CAAC,UAAU,CAC9C,OAAO,CAAC,GAAG,EAAE,EACb,YAAY,CACb,CAAA;QAED,MAAM,CAAC,gBAAgB,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwD9C,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/cache.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare class Cache {
|
|
2
|
+
static get STORAGE_DIRECTORY_NAME(): string;
|
|
3
|
+
static get DEFAULT_CAPACITY(): number;
|
|
4
|
+
private db;
|
|
5
|
+
private capacity;
|
|
6
|
+
private namespace?;
|
|
7
|
+
private tableName;
|
|
8
|
+
private subscribers;
|
|
9
|
+
private currentSize;
|
|
10
|
+
constructor(options?: Cache.Options);
|
|
11
|
+
get storageDirectory(): string;
|
|
12
|
+
get(key: string): string | undefined;
|
|
13
|
+
has(key: string): boolean;
|
|
14
|
+
get isEmpty(): boolean;
|
|
15
|
+
set(key: string, data: string): void;
|
|
16
|
+
remove(key: string): boolean;
|
|
17
|
+
clear(options?: {
|
|
18
|
+
notifySubscribers: boolean;
|
|
19
|
+
}): void;
|
|
20
|
+
subscribe(subscriber: Cache.Subscriber): Cache.Subscription;
|
|
21
|
+
private maintainCapacity;
|
|
22
|
+
private notifySubscribers;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace Cache {
|
|
25
|
+
interface Options {
|
|
26
|
+
namespace?: string;
|
|
27
|
+
capacity?: number;
|
|
28
|
+
}
|
|
29
|
+
type Subscriber = (key: string | undefined, data: string | undefined) => void;
|
|
30
|
+
type Subscription = () => void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.tsx"],"names":[],"mappings":"AAsCA,qBAAa,KAAK;IAChB,MAAM,KAAK,sBAAsB,IAAI,MAAM,CAG1C;IAED,MAAM,KAAK,gBAAgB,IAAI,MAAM,CAEpC;IAED,OAAO,CAAC,EAAE,CAAU;IACpB,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,SAAS,CAAC,CAAQ;IAC1B,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,WAAW,CAAY;gBAEnB,OAAO,CAAC,EAAE,KAAK,CAAC,OAAO;IA0DnC,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IAED,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAuBpC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAOzB,IAAI,OAAO,IAAI,OAAO,CAKrB;IAED,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAyBpC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAkB5B,KAAK,CAAC,OAAO,CAAC,EAAE;QAAE,iBAAiB,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IASrD,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,YAAY;IAU3D,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,iBAAiB;CAY1B;AAED,yBAAiB,KAAK,CAAC;IACrB,UAAiB,OAAO;QACtB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB;IAED,KAAY,UAAU,GAAG,CACvB,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,IAAI,EAAE,MAAM,GAAG,SAAS,KACrB,IAAI,CAAA;IACT,KAAY,YAAY,GAAG,MAAM,IAAI,CAAA;CACtC"}
|
package/dist/cache.js
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Database } from 'bun:sqlite';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as os from 'os';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import { logger } from './logger';
|
|
6
|
+
import { useStore } from './state';
|
|
7
|
+
function getCurrentDatabasePath() {
|
|
8
|
+
const extensionPath = useStore.getState().extensionPath;
|
|
9
|
+
if (extensionPath) {
|
|
10
|
+
// Use same shared database as localstorage
|
|
11
|
+
return path.join(extensionPath, '.termcast-bundle', 'data.db');
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
return path.join(os.homedir(), '.termcast', '.termcast-bundle', 'data.db');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function getCurrentCacheDir(namespace) {
|
|
18
|
+
const extensionPath = useStore.getState().extensionPath;
|
|
19
|
+
if (extensionPath) {
|
|
20
|
+
return namespace
|
|
21
|
+
? path.join(extensionPath, '.termcast-bundle', 'cache', namespace)
|
|
22
|
+
: path.join(extensionPath, '.termcast-bundle', 'cache');
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return namespace
|
|
26
|
+
? path.join(os.homedir(), '.termcast', '.termcast-bundle', 'cache', namespace)
|
|
27
|
+
: path.join(os.homedir(), '.termcast', '.termcast-bundle', 'cache');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export class Cache {
|
|
31
|
+
static get STORAGE_DIRECTORY_NAME() {
|
|
32
|
+
const extensionPath = useStore.getState().extensionPath;
|
|
33
|
+
return extensionPath ? 'cache' : '.termcast-cache';
|
|
34
|
+
}
|
|
35
|
+
static get DEFAULT_CAPACITY() {
|
|
36
|
+
return 10 * 1024 * 1024; // 10 MB
|
|
37
|
+
}
|
|
38
|
+
db;
|
|
39
|
+
capacity;
|
|
40
|
+
namespace;
|
|
41
|
+
tableName;
|
|
42
|
+
subscribers = [];
|
|
43
|
+
currentSize = 0;
|
|
44
|
+
constructor(options) {
|
|
45
|
+
this.capacity = options?.capacity || Cache.DEFAULT_CAPACITY;
|
|
46
|
+
this.namespace = options?.namespace;
|
|
47
|
+
// Replace non-alphanumeric characters with underscores for valid SQL table names
|
|
48
|
+
const safeNamespace = this.namespace?.replace(/[^a-zA-Z0-9]/g, '_');
|
|
49
|
+
this.tableName = safeNamespace ? `cache_${safeNamespace}` : 'cache';
|
|
50
|
+
const dbPath = getCurrentDatabasePath();
|
|
51
|
+
// Ensure parent directory exists
|
|
52
|
+
const dbDir = path.dirname(dbPath);
|
|
53
|
+
if (!fs.existsSync(dbDir)) {
|
|
54
|
+
fs.mkdirSync(dbDir, { recursive: true });
|
|
55
|
+
}
|
|
56
|
+
// Open with options to reduce file usage
|
|
57
|
+
this.db = new Database(dbPath, {
|
|
58
|
+
create: true,
|
|
59
|
+
readwrite: true,
|
|
60
|
+
});
|
|
61
|
+
// Use WAL mode and optimize for single file usage
|
|
62
|
+
this.db.exec('PRAGMA journal_mode = WAL');
|
|
63
|
+
this.db.exec('PRAGMA wal_autocheckpoint = 1000');
|
|
64
|
+
this.db.exec('PRAGMA synchronous = NORMAL');
|
|
65
|
+
// Use rowid for ordering - it auto-increments and provides natural LRU order
|
|
66
|
+
this.db.exec(`
|
|
67
|
+
CREATE TABLE IF NOT EXISTS ${this.tableName} (
|
|
68
|
+
rowid INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
69
|
+
key TEXT UNIQUE NOT NULL,
|
|
70
|
+
data TEXT NOT NULL,
|
|
71
|
+
size INTEGER NOT NULL
|
|
72
|
+
)
|
|
73
|
+
`);
|
|
74
|
+
// Create index on key for fast lookups
|
|
75
|
+
this.db.exec(`
|
|
76
|
+
CREATE INDEX IF NOT EXISTS idx_${this.tableName}_key ON ${this.tableName}(key)
|
|
77
|
+
`);
|
|
78
|
+
// Calculate initial size
|
|
79
|
+
const row = this.db
|
|
80
|
+
.prepare(`SELECT SUM(size) as total FROM ${this.tableName}`)
|
|
81
|
+
.get();
|
|
82
|
+
this.currentSize = row?.total || 0;
|
|
83
|
+
// Bind all methods to this instance
|
|
84
|
+
this.get = this.get.bind(this);
|
|
85
|
+
this.has = this.has.bind(this);
|
|
86
|
+
this.set = this.set.bind(this);
|
|
87
|
+
this.remove = this.remove.bind(this);
|
|
88
|
+
this.clear = this.clear.bind(this);
|
|
89
|
+
this.subscribe = this.subscribe.bind(this);
|
|
90
|
+
this.maintainCapacity = this.maintainCapacity.bind(this);
|
|
91
|
+
this.notifySubscribers = this.notifySubscribers.bind(this);
|
|
92
|
+
}
|
|
93
|
+
get storageDirectory() {
|
|
94
|
+
return getCurrentCacheDir(this.namespace);
|
|
95
|
+
}
|
|
96
|
+
get(key) {
|
|
97
|
+
const row = this.db
|
|
98
|
+
.prepare(`SELECT rowid, data, size FROM ${this.tableName} WHERE key = ?`)
|
|
99
|
+
.get(key);
|
|
100
|
+
if (row) {
|
|
101
|
+
// Move to end of LRU by deleting and reinserting (gets new rowid)
|
|
102
|
+
const tx = this.db.transaction(() => {
|
|
103
|
+
this.db.prepare(`DELETE FROM ${this.tableName} WHERE key = ?`).run(key);
|
|
104
|
+
this.db
|
|
105
|
+
.prepare(`INSERT INTO ${this.tableName} (key, data, size) VALUES (?, ?, ?)`)
|
|
106
|
+
.run(key, row.data, row.size);
|
|
107
|
+
});
|
|
108
|
+
tx();
|
|
109
|
+
return row.data;
|
|
110
|
+
}
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
has(key) {
|
|
114
|
+
const row = this.db
|
|
115
|
+
.prepare(`SELECT 1 FROM ${this.tableName} WHERE key = ?`)
|
|
116
|
+
.get(key);
|
|
117
|
+
return !!row;
|
|
118
|
+
}
|
|
119
|
+
get isEmpty() {
|
|
120
|
+
const row = this.db
|
|
121
|
+
.prepare(`SELECT COUNT(*) as count FROM ${this.tableName}`)
|
|
122
|
+
.get();
|
|
123
|
+
return row.count === 0;
|
|
124
|
+
}
|
|
125
|
+
set(key, data) {
|
|
126
|
+
const dataSize = Buffer.byteLength(data, 'utf8');
|
|
127
|
+
// Get existing size if any
|
|
128
|
+
const existingRow = this.db
|
|
129
|
+
.prepare(`SELECT size FROM ${this.tableName} WHERE key = ?`)
|
|
130
|
+
.get(key);
|
|
131
|
+
const oldSize = existingRow?.size || 0;
|
|
132
|
+
const newTotalSize = this.currentSize - oldSize + dataSize;
|
|
133
|
+
if (newTotalSize > this.capacity) {
|
|
134
|
+
this.maintainCapacity(newTotalSize - this.capacity);
|
|
135
|
+
}
|
|
136
|
+
// Insert or update the cache entry
|
|
137
|
+
this.db
|
|
138
|
+
.prepare(`INSERT OR REPLACE INTO ${this.tableName} (key, data, size) VALUES (?, ?, ?)`)
|
|
139
|
+
.run(key, data, dataSize);
|
|
140
|
+
this.currentSize = this.currentSize - oldSize + dataSize;
|
|
141
|
+
this.notifySubscribers(key, data);
|
|
142
|
+
}
|
|
143
|
+
remove(key) {
|
|
144
|
+
// Check if key exists and get its size
|
|
145
|
+
const row = this.db
|
|
146
|
+
.prepare(`SELECT size FROM ${this.tableName} WHERE key = ?`)
|
|
147
|
+
.get(key);
|
|
148
|
+
if (row) {
|
|
149
|
+
// Delete the key
|
|
150
|
+
this.db.prepare(`DELETE FROM ${this.tableName} WHERE key = ?`).run(key);
|
|
151
|
+
this.currentSize -= row.size;
|
|
152
|
+
this.notifySubscribers(key, undefined);
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
clear(options) {
|
|
158
|
+
this.db.exec(`DELETE FROM ${this.tableName}`);
|
|
159
|
+
this.currentSize = 0;
|
|
160
|
+
if (options?.notifySubscribers !== false) {
|
|
161
|
+
this.notifySubscribers(undefined, undefined);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
subscribe(subscriber) {
|
|
165
|
+
this.subscribers.push(subscriber);
|
|
166
|
+
return () => {
|
|
167
|
+
const index = this.subscribers.indexOf(subscriber);
|
|
168
|
+
if (index > -1) {
|
|
169
|
+
this.subscribers.splice(index, 1);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
maintainCapacity(bytesToFree) {
|
|
174
|
+
// Order by rowid ASC to get oldest entries first
|
|
175
|
+
const rows = this.db
|
|
176
|
+
.prepare(`SELECT key, size FROM ${this.tableName} ORDER BY rowid ASC`)
|
|
177
|
+
.all();
|
|
178
|
+
let freedBytes = 0;
|
|
179
|
+
const keysToRemove = [];
|
|
180
|
+
for (const row of rows) {
|
|
181
|
+
if (freedBytes >= bytesToFree) {
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
keysToRemove.push(row.key);
|
|
185
|
+
freedBytes += row.size;
|
|
186
|
+
}
|
|
187
|
+
if (keysToRemove.length > 0) {
|
|
188
|
+
const placeholders = keysToRemove.map(() => '?').join(',');
|
|
189
|
+
const stmt = this.db.prepare(`DELETE FROM ${this.tableName} WHERE key IN (${placeholders})`);
|
|
190
|
+
stmt.run(...keysToRemove);
|
|
191
|
+
this.currentSize -= freedBytes;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
notifySubscribers(key, data) {
|
|
195
|
+
for (const subscriber of this.subscribers) {
|
|
196
|
+
try {
|
|
197
|
+
subscriber(key, data);
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
logger.error('Cache subscriber error:', error);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
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