Commit graph

472 commits

Author SHA1 Message Date
Damien Elmes
eb6502bd6e add missing copyright headers to *.svelte 2021-04-13 19:02:41 +10:00
Damien Elmes
1f475a1709 add missing copyright headers to *.ts 2021-04-13 18:57:08 +10:00
Damien Elmes
c6da01c4aa disable Jest tests on Windows again
It looks like the templated_args change only masked the error last time;
Jest seems broken on Windows with both the patched .24 version, latest
stable, and the new beta version too, presumably because symlinks are
being handled differently on Windows somehow. It might be possible to
hack around the issue by patching the following file, but I'm not sure:

https://github.com/facebook/jest/blob/master/packages/jest-haste-map/src/crawlers/node.ts
2021-04-12 15:39:46 +10:00
Damien Elmes
9d03e266e3 add naturalWholeUnit() and basic tests to lib/time.ts
naturalWholeUnit() is not currently used
2021-04-12 14:42:06 +10:00
Damien Elmes
3c3258251d force number in protobuf generation
Anki's object IDs and millisecond timestamps fit within MAX_SAFE_INTEGER.
2021-04-12 14:33:20 +10:00
Damien Elmes
43a8b8fec3 stop Svelte warnings from failing the build
+ check for them at test time
2021-04-12 14:28:09 +10:00
Damien Elmes
8c64cc38d7 fix jest
- templated_args was missing --node_modules= prefix, and was causing
tests to pass unconditionally
- update to beta of jest 27, which introduces an option to fix the
symlink handling, and is approx twice as fast to start up
2021-04-12 09:43:31 +10:00
Damien Elmes
dc8c0a2e73 switch esbuild to a toolchain 2021-04-07 15:19:23 +10:00
Damien Elmes
fb1111623f update to latest esbuild 2021-04-07 14:54:40 +10:00
abdo
a6bdde68db Fix graph labels display in RTL layout 2021-04-02 06:25:38 +03:00
Damien Elmes
188a8891fd add docstring to forEditorField 2021-03-29 18:13:45 +10:00
Damien Elmes
efb8a4e61c Merge pull request #1101 from Arthur-Milchior/TS_type
NF: add type ts
2021-03-29 18:09:56 +10:00
Damien Elmes
2e1104c724 move loader arg into esbuild() invocation
upstream.bzl should be kept as close to upstream as possible, so that
it's easier to send changes upstream and pull in future changes
2021-03-29 17:59:06 +10:00
Arthur Milchior
cfa2ee6774 NF: add type ts 2021-03-28 23:59:16 +02:00
Henrik Giesel
d01aa0de6f Add copy_bootstrap_icons macro 2021-03-28 18:50:37 +02:00
Henrik Giesel
77c396c2a8 Include pin-angle icon via inline SVG 2021-03-28 16:15:30 +02:00
Damien Elmes
fb222149af define file extension in .d.ts so typescript doesn't complain 2021-03-28 16:15:28 +02:00
Henrik Giesel
443ee54f7e Unsuccessfully try to add text loader for .svg files 2021-03-28 16:14:52 +02:00
Henrik Giesel
9d64508bd1 Remove bootstrap-icons from css folder 2021-03-28 16:14:52 +02:00
Damien Elmes
d279ca4cac move back to latest Jest
Patch is no longer required after previous change
2021-03-28 21:44:55 +10:00
Damien Elmes
9a75392f54 fix Jest on Windows 2021-03-28 20:59:51 +10:00
Damien Elmes
e2963e54f8 Revert "disable Jest tests on Windows for now"
This reverts commit 819f87df42.
2021-03-28 20:59:31 +10:00
Damien Elmes
819f87df42 disable Jest tests on Windows for now 2021-03-28 20:34:10 +10:00
Damien Elmes
ad47b68255 add Jest for TS unit tests
@hgiesel the reason no files were being found is because Jest ignores
symlinks by default. The Bazel example includes a patch we can use
to work around it, and Jest plan to add symlink support in a future
update.

https://github.com/bazelbuild/rules_nodejs/blob/stable/examples/jest/patches/jest-haste-map%2B24.9.0.patch

https://github.com/facebook/jest/pull/9351
2021-03-28 19:41:20 +10:00
Henrik Giesel
ac46f6cb27 Utilize ts/tsconfig.js from ts/{editor,html-filter} 2021-03-28 19:41:20 +10:00
Henrik Giesel
d346ae6feb No need to explicitly import from index 2021-03-28 19:41:20 +10:00
Henrik Giesel
722adec915 Satisfy formatter 2021-03-28 19:41:20 +10:00
Henrik Giesel
c99d91c283 Avoid using outerHTML + Fix regression 2021-03-28 19:41:20 +10:00
Henrik Giesel
f432da5af7 Change filter logic in html-filter/element: predicate true, means it stays in 2021-03-28 19:41:20 +10:00
Henrik Giesel
1aefab95f8 Move html-filter into its own directory 2021-03-28 19:41:20 +10:00
Henrik Giesel
127b46d240 Insert break statements into switch 2021-03-28 19:41:20 +10:00
Henrik Giesel
4baa87348e Create htmlFilter{Node,Styling} for better separation of concerns 2021-03-28 19:41:20 +10:00
Henrik Giesel
6822c56e53 Put filterElement logic completely into its own file 2021-03-28 19:41:20 +10:00
Henrik Giesel
a9fa7cd0db Move most of tags allowed to its own file 2021-03-28 19:41:20 +10:00
Henrik Giesel
f4e3a9202f Refactor htmlFilter to use function declarations 2021-03-28 19:41:20 +10:00
Damien Elmes
0edbd3fc4b use relative link to sass file
links relative to workspace root break when invoked from an external
repo
2021-03-28 12:37:21 +10:00
Damien Elmes
3761693be2 add links to pending PRs 2021-03-28 12:32:40 +10:00
Damien Elmes
0b2c3e1c3b fix(esbuild): files not being found when building external repo
An esbuild rule that ran fine in a local repo (eg bazel build //:my_esbuild_rule)
fails when built externally (eg bazel build @other_workspace//:my_esbuild_rule).
By prepending the workspace root to the bin path, the resulting base
URL works correctly in both local and remote repo invocations, allowing
esbuild output to be consumed by a different repo.

This change fixes remote repos in Bazel 4.0.0. 3.7.0 seems to require a
workspace_root.replace("external/", "") call first in order
to get the correct location. So while this patch should not break anything
that was not already broken, it only fixes/adds support for remote repos
in 4.0+.
2021-03-28 11:30:15 +10:00
Damien Elmes
061c7e60fc add esbuild/helpers.bzl in from upstream 2021-03-28 11:12:23 +10:00
Damien Elmes
b8b2be3f9f update $(location ...) in esbuild inject lines 2021-03-28 09:35:46 +10:00
Damien Elmes
7500a2765f support expanding locations in esbuild arguments 2021-03-28 09:35:27 +10:00
Damien Elmes
16632c90df update TS deps 2021-03-27 15:02:02 +10:00
Damien Elmes
125dcee811 remove obsolete comment 2021-03-26 21:47:23 +10:00
Damien Elmes
0006a385e1 allow js to request specific i18n modules
Brings the payload on the congrats page with a non-English language
down from about 150k to 15k
2021-03-26 21:43:36 +10:00
Damien Elmes
5ef9282f9b fix handling of variables that don't match ts naming style 2021-03-26 21:34:24 +10:00
Damien Elmes
00eb89c2ec use singleton + free functions for i18n in ts
This allows for tree shaking, and reduces the congrats page from 150k
with the old enum solution to about 80k.
2021-03-26 20:38:44 +10:00
Damien Elmes
b145b04ddf drop legacy enum from ts/ 2021-03-26 19:26:35 +10:00
Damien Elmes
6cde7ff536 update remaining TR references in ts/ 2021-03-26 19:24:48 +10:00
Damien Elmes
7a7cb7402d update most no-arg TR references in *.svelte 2021-03-26 19:13:30 +10:00
Damien Elmes
1ed1902933 update TR references with args in *.svelte 2021-03-26 19:13:30 +10:00