Commit graph

49 commits

Author SHA1 Message Date
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
d279ca4cac move back to latest Jest
Patch is no longer required after previous change
2021-03-28 21:44:55 +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
Damien Elmes
460a071fe4 switch from rollup to esbuild
brings the 2+ second bundle on a module like the graphs down to 90ms
2021-03-21 16:06:36 +10:00
Damien Elmes
b025e92d26 switch Svelte compilation to worker model
based on changes from upstream rules_svelte

Their code was using run_node() instead of ctx.actions.run(), which
seems to create a new worker for every CPU core, instead of respecting
the standard limit of 4.
2021-03-20 22:52:35 +10:00
Damien Elmes
7ae6837cfa update Svelte and fix Windows build
Svelte 3.25.0 and onwards bundle compiler.mjs, which seems to be
preferentially used over the .js file. Presumably this is only breaking
on Windows due to the lack of a sandbox. Resolve by explicitly requesting
the .js file.
2021-03-20 16:13:20 +10:00
Damien Elmes
06b0b4d68b vendor Svelte rules
The separate repo made it difficult to update the rules, and made things
more complicated than they needed to be.
2021-03-20 15:04:19 +10:00
Damien Elmes
7840d773ef update rules_nodejs 2021-03-20 10:54:18 +10:00
Damien Elmes
72885bc710 move to new rules_nodejs protobuf example to unblock upgrade
@hgiesel the tag editor will need to add the following to the rollup
deps:

        "//ts/lib:backend_proto",
        "//ts/lib:fluent_proto",
2021-03-20 10:24:32 +10:00
Henrik Giesel
6b444782e9 Remove explicit popperjs again, because it's included in bootstrap.bundle 2021-03-09 13:37:56 +01:00
Henrik Giesel
b7c24a9f98 Add bootstrap, bootstrap-icons, and popperjs 2021-03-09 13:37:56 +01:00
Damien Elmes
33e532166a Revert "sanitize deck description HTML with html-sanitize"
This reverts commit cd37a9ae83.
2021-02-06 13:25:40 +10:00
Damien Elmes
cd37a9ae83 sanitize deck description HTML with html-sanitize
Committing for reference; will roll back afterwards.

This adds approximately 150k to the bundled .js file in release mode.
html-sanitizer might be useful to replace our custom paste filtering
code in the future, but for now I'm not sure it's worth the extra
page load time over doing the filtering in Rust.
2021-02-06 13:25:34 +10:00
Damien Elmes
63ea689636 Restore "Merge pull request #1007 from hgiesel/sveltesass2""
This reverts commit 86b470071f and
points to a new rules_svelte commit.

It looks like we were getting away with not listing the dep on the
rules_svelte end - the failing build turned out to be because we need
to pass sass in to our local svelte_check invocation.
2021-02-06 08:39:36 +10:00
Damien Elmes
9f14240b51 update JS deps 2021-02-03 20:38:41 +10:00
Henrik Giesel
8151156b98 Install types for lodash.throttle 2021-01-30 02:12:44 +01:00
Henrik Giesel
0527beec98 Replace individual d3 libraries with encompassing d3 2021-01-30 00:00:22 +01:00
Damien Elmes
b43515ceff add .sql file formatter
Uses the logic from the sqltools VSCode add-on, with a workaround
for the use of 'type' in some table columns.

By detecting the presence of 'BUILD_WORKSPACE_DIRECTORY' we can tell
if the rule is running in test mode or was run directly, avoiding the
need for separate check and fix rules. It might be nice to extend this
to other formatting rules in the future as well.
2021-01-09 14:22:49 +10:00
Henrik Giesel
7ed80466e9 Add css-browser-selector as bazel rule, and update from 0.4.0 to 0.6.5 2020-12-31 16:27:52 +01:00
Henrik Giesel
0745fe511a Add bazel recipe and update protobufjs to 6.10.2 2020-12-31 16:06:44 +01:00
Henrik Giesel
ff68cd8382 Install jquery-ui-dist 2020-12-30 11:56:49 +01:00
Damien Elmes
9b92d3ce1f Revert "Merge pull request #873 from hgiesel/otherjsdeps"
This reverts commit ad7491a9ae, reversing
changes made to 5a79515f2a.

- Standard graphs render incorrectly on latest version - the wrong number
of days are shown, and the grid lines look wrong. Any version after 0.8.3
seems to suffer from this problem.
- Pie graphs and stack graphs don't render - they are provided in separate
files, and plot.js in previous Anki versions has them included in the one
file. To maintain compatibility with add-ons, we'd need to create a single
file as before, instead of importing multiple files.

If the above issues are fixed I'd be happy to merge this in again, but
as the old graphs are on the way out, it's probably not worth the effort.
2020-12-30 14:13:52 +10:00
Henrik Giesel
3a64d47786 Install flot 4.2.1
Old version was 0.8.3
2020-12-29 12:02:41 +01:00
Henrik Giesel
b6fba45ad5 Remove jquery from Anki repo and replace with Bazel BUILD 2020-12-28 13:16:12 +01:00
Damien Elmes
1bdb1b9633 update to rules_nodejs 3.0.0
Seems to fix the rollup issues on Windows.
2020-12-23 16:05:15 +10:00
Henrik Giesel
06bd0376b1 Remove @types/mathjax as it is for MathJax 2 2020-11-14 14:14:25 +01:00
Henrik Giesel
6a29e0cd4d Rip out MathJax 2 and setup MathJax 3 environment 2020-11-14 14:14:25 +01:00
Damien Elmes
f823c442ec relative js package paths 2020-11-12 21:07:59 +10:00
Damien Elmes
db1ed6f01f export runtime js licenses 2020-11-12 20:03:41 +10:00
Damien Elmes
9da61c111e update ts deps 2020-11-12 20:03:41 +10:00
Damien Elmes
ce3b08ac58 initial Bazel conversion
Running and testing should be working on the three platforms, but
there's still a fair bit that needs to be done:

- Wheel building + testing in a venv still needs to be implemented.
- Python requirements still need to be compiled with piptool and pinned;
need to compile on all platforms then merge
- Cargo deps in cargo/ and rslib/ need to be cleaned up, and ideally
unified into one place
- Currently using rustls to work around openssl compilation issues
on Linux, but this will break corporate proxies with custom SSL
authorities; need to conditionally use openssl or use
https://github.com/seanmonstar/reqwest/pull/1058
- Makefiles and docs still need cleaning up
- It may make sense to reparent ts/* to the top level, as we don't
nest the other modules under a specific language.
- rspy and pylib must always be updated in lock-step, so merging
rspy into pylib as a private module would simplify things.
- Merging desktop-ftl and mobile-ftl into the core ftl would make
managing and updating translations easier.
- Obsolete scripts need removing.
- And probably more.
2020-11-01 14:26:58 +10:00
Damien Elmes
3159b66444 "fix" ts failing in CI due to improved upstream type signatures
...by throwing non-null assertions everywhere.
2020-09-29 22:13:25 +10:00
Damien Elmes
9a3a81012a update ts deps to fix svelte-vscode 2020-09-01 10:24:38 +10:00
Damien Elmes
c7b61822cf switch the card counts to a pie graph 2020-08-12 18:58:21 +10:00
Damien Elmes
4967c2571f update svelte-check minimum 2020-07-29 12:06:48 +10:00
Damien Elmes
f1f3832d21 update ts deps 2020-07-28 11:15:49 +10:00
Damien Elmes
35d0dcee5a run svelte-check as part of check 2020-07-22 14:11:35 +10:00
Damien Elmes
6ad4111723 graphs now work in night mode 2020-06-30 16:23:46 +10:00
Damien Elmes
f595f15d77 add basic calendar graph 2020-06-30 15:13:44 +10:00
evandrocoan
58944bad18 Fixed pbjs not working on Windows because package.json runs by
cmd.exe which does not support pipe | and ; semicolons
87f22bd358 (r40232987)
2020-06-29 15:22:36 -03:00
Damien Elmes
1bfee32f90 fixes for Chromium 56 (Qt 5.9) 2020-06-29 15:48:01 +10:00
Damien Elmes
349eca843b get i18n working in typescript 2020-06-29 15:48:01 +10:00
Damien Elmes
0293f2220c qt's js code now shares ts/node_modules; more graph work 2020-06-29 15:48:01 +10:00
Damien Elmes
93e1b907ba add top level component and pass search/day limit back from frontend 2020-06-29 15:48:00 +10:00
Damien Elmes
87f22bd358 add a new ts/ folder with a new graph proof of concept 2020-06-29 15:48:00 +10:00
Damien Elmes
3ca39bfda3 move the separate components back into this monorepo
Earlier today I pushed a change that split this code up into multiple
repos, but that has proved to complicate things too much. So we're
back to a single repo, except the individual submodules are better
separated than they were before.

The README files need updating again; I will push them out soon.

Aside from splitting out the different modules, the sound code has
moved from from anki to aqt.
2020-01-02 19:43:19 +10:00
Damien Elmes
103ad888d6 add prettier, tidy up makefile 2019-12-18 16:12:02 +10:00
Damien Elmes
e7e4e6414d deckbrowser and overview 2019-12-18 13:21:58 +10:00
Damien Elmes
4bf9cc8b5e add typescript to build 2019-12-18 12:53:13 +10:00