anki/ts/components
Damien Elmes a3d9f90af5 update to latest rules_nodejs & switch to ts_project
ts_library() is deprecated and will presumably be dropped from a
future rules_nodejs, and it wasn't working with the jest tests
after updating, so we switch over to ts_project().

There are some downsides:

- It's a bit slower, as the worker mode doesn't appear to function
at the moment.
- Getting it working with a mix of source files and generated files
was quite tricky, especially as things behave differently on Windows,
and differently when editing with VS Code. Solved with a small patch
to the rules, and a wrapper script that copies everything into the
bin folder first. To keep VS Code working correctly as well, the built
files are symlinked into the source folder.
- TS libraries are not implicitly linked to node_modules, so they
can't be imported with an absolute name like "lib/proto" - we need
to use relative paths like "../lib/proto" instead. Adjusting "paths"
in tsconfig.json makes it work for TS compilation, but then it fails
at the esbuild stage. We could resolve it by wrapping the TS
libraries in a subsequent js_library() call, but that has the downside
of losing the transient dependencies, meaning they need to be listed
again.  Alternatively we might be able to solve it in the future by
adjusting esbuild, but for now the paths have been made relative to
keep things simple.

Upsides:

- Along with updates to the Svelte tooling, Svelte typing has improved.
All exports made in a Svelte file are now visible to other files that
import them, and we no longer rebuild the Svelte files when TS files
are updated, as the Svelte files do no type checking themselves, and
are just a simple transpilation. Svelte-check now works on Windows again,
and there should be no errors when editing in VS Code after you've
built the project. The only downside seems to be that cmd+clicking
on a Svelte imports jumps to the .d.ts file instead of the original now;
presumably they'll fix that in a future plugin update.
- Each subfolder now has its own tsconfig.json, and tsc can be called
directly for testing purposes (but beware it will place build products
in the source tree): ts/node_modules/.bin/tsc -b ts
- We can drop the custom esbuild_toolchain, as it's included in the
latest rules_nodejs.

Other changes:

- "image_module_support" is moved into lib/, and imported with
<reference types=...>
- Images are now imported directly from their npm package; the
extra copy step has been removed.

Windows users may need to use "bazel clean" before building this,
due to old files lying around in the build folder.
2021-10-01 12:52:53 +10:00
..
Badge.svelte Refer to ./ instead of components/ from within components 2021-09-09 15:38:04 +02:00
BUILD.bazel update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
ButtonDropdown.svelte Prevent hiding handles by clicking on handles 2021-09-15 17:56:56 +02:00
ButtonGroup.svelte Fix Float buttons in rtl 2021-09-06 21:15:37 +10:00
ButtonGroupItem.svelte Refer to ./ instead of components/ from within components 2021-09-09 15:38:04 +02:00
buttons.ts Fix Float buttons in rtl 2021-09-06 21:15:37 +10:00
ButtonToolbar.svelte Do not use overflow-x on ButtonToolbar 2021-09-09 17:50:02 +02:00
ColorPicker.svelte Implement new ColorPicker 2021-05-30 22:58:40 +02:00
Container.svelte Add Container.svelte 2021-06-21 17:01:45 +02:00
context-keys.ts disabledKey => fieldFocusedKey 2021-07-05 18:15:03 +02:00
Detachable.svelte Rename Detachable.detach to detached 2021-05-07 14:31:08 +02:00
dropdown.ts handle changed aria-expanded typing 2021-09-29 12:20:27 +10:00
DropdownDivider.svelte WIP: Use our components in deckoptions sticky bar 2021-05-18 16:32:29 +02:00
DropdownItem.svelte Introduce AutocompleteItem 2021-09-09 15:37:50 +02:00
DropdownMenu.svelte Prevent hiding handles by clicking on handles 2021-09-15 17:56:56 +02:00
helpers.ts Port Focus tags shortcut to webview 2021-09-09 15:37:34 +02:00
IconButton.svelte Better RTL support 2021-09-06 21:15:36 +10:00
identifier.ts Add Section and SectionItem for the deckoptions 2021-06-21 17:01:44 +02:00
Item.svelte Refer to ./ instead of components/ from within components 2021-09-09 15:38:04 +02:00
LabelButton.svelte Uniformly shorten SCSS imports/uses 2021-09-02 23:37:17 +02:00
registration.ts Fix issues with sometimes cause assignment of wrong position value 2021-07-05 17:17:58 +02:00
Section.svelte More uniform file naming 2021-07-01 12:24:16 +02:00
SelectButton.svelte Uniformly shorten SCSS imports/uses 2021-09-02 23:37:17 +02:00
SelectOption.svelte WIP: Use our components in deckoptions sticky bar 2021-05-18 16:32:29 +02:00
Spacer.svelte Space out Sticky Bottom with Spacer component 2021-09-09 15:37:58 +02:00
StickyFooter.svelte Rename StickyBar and StickyBottom to StickyHeader and StickyFooter 2021-09-15 23:15:55 +02:00
StickyHeader.svelte Rename StickyBar and StickyBottom to StickyHeader and StickyFooter 2021-09-15 23:15:55 +02:00
tsconfig.json update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
WithContext.svelte Disable FormatBlock buttons for Codable 2021-06-18 01:17:43 +02:00
WithDropdown.svelte Make the ImageHandle and MathjaxHandle dropdowns perfectly touch the HandleSelection 2021-09-15 22:26:32 +02:00
WithShortcut.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
WithState.svelte Disable Bold button in Codable 2021-06-18 00:27:07 +02:00
WithTheming.svelte update ts deps 2021-05-26 09:37:40 +10:00
WithTooltip.svelte Prevent tooltip expanding body tag in editor 2021-09-15 02:24:09 +02:00