Commit graph

65 commits

Author SHA1 Message Date
Damien Elmes
48cffca7a9 update js deps; pin marked
marked 2.1.0 fails to run on node 12
2021-06-16 16:47:32 +10:00
Damien Elmes
ce9e1c3370 roll back sass for now to quieten deprecation warnings
https://github.com/twbs/bootstrap/issues/34051
2021-05-26 10:20:34 +10:00
Damien Elmes
3489257f41 update ts deps
- prettier's formatting has changed, so files needed to be reformatted
- dart is spitting out deprecation warnings like:

254 │   2: $spacer / 2,
    │      ^^^^^^^^^^^
    ╵
    bazel-out/darwin-fastbuild/bin/ts/sass/bootstrap/_variables.scss 254:6  @import
    ts/sass/button_mixins.scss 2:9                                          @use
    ts/components/ColorPicker.svelte 2:5                                    root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($grid-gutter-width, 2)
2021-05-26 09:37:40 +10:00
Damien Elmes
87cfd51cfa update rules_nodejs 2021-05-26 09:12:23 +10:00
Damien Elmes
a345ba1347 support markdown in JS tooltips
`marked` adds about 44k to the bundle size unfortunately :-(
2021-05-16 21:43:58 +10:00
Damien Elmes
4d51a13259 roll back bootstrap until 5.0.1 comes out
Modals are currently broken:
https://github.com/twbs/bootstrap/issues/33840
2021-05-11 13:06:03 +10:00
Damien Elmes
7f5972c080 update license checker for security issue in dependency 2021-05-07 18:50:25 +10:00
Damien Elmes
e5264c909b use lodash instead of json in RevertButton 2021-04-25 19:34:07 +10:00
Henrik Giesel
ed602146df Update eslint to 4.22.0 2021-04-22 19:19:39 +02:00
Henrik Giesel
697fa4ed9a Update Typescript to 4.2.4 2021-04-22 18:33:42 +02:00
Damien Elmes
f474803146 switch to full lodash library
Individual packages are going away in v5, and we can rely on tree
shaking to only get what we need.
2021-04-16 20:14:17 +10:00
Henrik Giesel
5c601db45f Fix most of svelte-check issues for editor-toolbar 2021-04-15 13:09:51 +02:00
Henrik Giesel
05affd313f Include Dropdown directly from bootstrap, required installing popperjs 2021-04-15 13:09:50 +02:00
Henrik Giesel
9c19c85f79 Add remaining icons for toolbar 2021-04-15 13:09:49 +02:00
Henrik Giesel
c06d500f0c Include icons directly in ts lib 2021-04-15 13:09:49 +02:00
Damien Elmes
74c917239f remove unused esbuild package, and update rules_nodejs packages 2021-04-15 10:57:19 +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
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