Commit graph

10314 commits

Author SHA1 Message Date
Damien Elmes
c44cf61673 Fix i18n build script not responding to env var changes
Not much use declaring the cargo flag when we bake the env var into
the binary! Also treat an empty variable as missing.
2023-07-04 17:17:41 +10:00
Damien Elmes
e37b7b919e Add nothing to undo/redo
https://forums.ankiweb.net/t/translation-of-nothing-to-undo/31735
2023-07-04 13:41:02 +10:00
Damien Elmes
0ddec0bcb7 Add an improved tool for copying/moving FTL strings 2023-07-04 13:39:01 +10:00
Damien Elmes
3b25c7a109 Update translations 2023-07-04 13:39:00 +10:00
Damien Elmes
39393d3520 Move i18n helpers into ftl/, with a single main.rs
Clap gives us a nice help message and better arg parsing
2023-07-04 10:47:15 +10:00
Damien Elmes
942b3b2eff Fix some ftl args not being passed correctly in TypeScript 2023-07-04 00:47:59 +10:00
Damien Elmes
215bede447 Increase default size of media check screen
https://forums.ankiweb.net/t/text-does-not-fit-in-buttons-of-media-check-window/31731/2
2023-07-03 23:58:24 +10:00
Damien Elmes
6a83f5b022 Avoid :pages prefix on ts/*, so build rule matches folder location 2023-07-03 17:24:27 +10:00
Damien Elmes
4442a73488 Merge the separate editor index files
They're almost the same, and the extra work competes for CPU cores
with the other build steps.
2023-07-03 17:24:27 +10:00
Damien Elmes
d4d154025e Add a script to clean build folder 2023-07-03 17:24:27 +10:00
Damien Elmes
565dddbf29 Move markpure to TypeScript
Combined with the previous changes, this allows the mobile clients to
build the web components without having to set up a Python environment,
and should speed up AnkiDroid CI.
2023-07-03 17:24:27 +10:00
Damien Elmes
c873b28d15 Move .py i18n method generation to Rust 2023-07-03 15:58:46 +10:00
Damien Elmes
c83f577601 Move .ts i18n method generation to Rust
Based on a similar approach I used for AnkiDroid. The separate modules
file has been integrated into ftl.js.
2023-07-03 14:36:09 +10:00
Damien Elmes
c25c00e411 Combine all backend methods into a single js/d.ts file, like in Python
Easier to import from, and allows us to declare the output of the build
action without having to iterate over all the proto filenames. Have
confirmed it doesn't break esbuild's tree shaking.
2023-07-03 13:46:38 +10:00
Damien Elmes
5623523a16 deckconfig.proto -> deck_config.proto
Makes it consistent with our other proto files, and matches the service
name.
2023-07-03 13:44:54 +10:00
Damien Elmes
e868c327f1 Roll prettier plugin back for now
Depends on GLIBC_2.29
2023-07-03 09:53:32 +10:00
Damien Elmes
d513d5efba Add scss formatter 2023-07-03 09:44:38 +10:00
Damien Elmes
daa74e9b8b Update dprint plugins 2023-07-03 09:42:29 +10:00
Damien Elmes
827e3410ad Store field content instead of trying to mutate clipboard data
Hopefully this will finally address the clipboard issues some users
have been experiencing.

Tentatively closes #2349
2023-07-02 22:23:31 +10:00
Damien Elmes
9a26b536db Remove dataChanged workaround on Windows
I believe this should be fixed in 6.4/6.5

https://bugreports.qt.io/browse/QTBUG-102738
2023-07-02 20:37:05 +10:00
Damien Elmes
20a8295175 Only disable specific animations/transitions/shadows
If I've missed any, follow-up PRs would be most appreciated.

Closes #2557
2023-07-02 20:02:14 +10:00
Damien Elmes
19ee3446be Update n2 for Windows console fix; recommend it on Windows as well 2023-07-02 19:03:37 +10:00
Damien Elmes
8f9db6dd48 Fix some Windows path issues
- Don't bake modified PATH in to build.ninja; instead set it at run time.
- Add win audio in build.rs, as doing it in run.bat results in it being
added multiple times when you run multiple times.
2023-07-02 18:22:44 +10:00
Damien Elmes
c00a796a50 Exclude PyOxidizer from recursive checkout 2023-07-02 18:22:44 +10:00
Damien Elmes
03d4f24ff5 Support creating a standalone sync server 2023-07-02 18:22:44 +10:00
Damien Elmes
d7f6a9e972 Fix building outside workspace
rslib/build.rs needs descriptors, even if env var not set
2023-07-02 18:22:44 +10:00
Damien Elmes
ebc24c94c8 Add option to use LTO in release builds
Shrinks rslib.so from about 40MB to about 26MB, at the cost of considerably
higher build time in a release build.
2023-07-02 18:22:44 +10:00
Damien Elmes
d7ef61b8df Fix bundling
PyOxidizer binary is now going into a platform folder, and our Qt
deps moved.
2023-07-02 18:22:44 +10:00
Damien Elmes
e12b007b0e Let ninja/n2 do the configure invocation
I'd introduced maybe_reconfigure_build() after running into issues where
configure was not being invoked, but have discovered why that was happening:
the out folder path must be identical to the canonical path listed in
build.ninja, which it wasn't when a symlink was used. With this change,
we avoid having to invoke ninja twice, and get visibility into the
configure step.

This also makes rsbridge only depend on out/env, which prevents it from
being rebuilt when any reconfigure happens.
2023-07-02 18:22:44 +10:00
Damien Elmes
7956eee8b7 Fix progress not updating after one-way sync 2023-07-02 15:47:09 +10:00
Damien Elmes
11fcceb5e2 Fix Windows build 2023-07-02 15:17:29 +10:00
Damien Elmes
c4eb281112 Fix clean build failure 2023-07-02 14:55:47 +10:00
Damien Elmes
00394761f1 Switch runner to release build 2023-07-02 10:31:07 +10:00
Damien Elmes
3fee83575a Add a shortcut to auto-format before running checks 2023-07-02 09:59:05 +10:00
Damien Elmes
1d79f684bd Fix newly-added image occlusion notetype not syncing
https://forums.ankiweb.net/t/synchronisation-issue/31505/7
2023-07-01 22:10:29 +10:00
Damien Elmes
03ec72ea19 Update Rust and Python deps (#2567)
* Update Python deps

* Update semver-compat Rust deps

* Update most crates to latest semver

* Update to latest axum-client-ip
2023-07-01 18:26:43 +10:00
Damien Elmes
88b13c5026 Update to Svelte 4, and update most other JS deps (#2565)
* eslint-plugin-svelte3 -> eslint-plugin-svelte

The former is deprecated, and blocks an update to Svelte 4.

Also drop unused svelte2tsx and types package.

* Drop unused symbols code for now

It may be added back in the future, but for now dropping it will save
200k from our editor bundle.

* Remove sass and caniuse-lite pins

The latter no longer seems to be required. The former was added to
suppress deprecation warnings when compiling the old bootstrap version
we have pinned. Those are hidden by the build tool now (though we really
need to address them at one point: https://github.com/ankitects/anki/issues/1385)

Also removed unused files section.

* Prevent proto compile from looking in node_modules/@types/sass

When deps are updated, tsc aborts because @types/sass is a dummy package
without an index.d.ts file.

* Filter Svelte warnings out of ./run

* Update to latest Bootstrap

This fixes the deprecation warnings we were getting during build:
bootstrap doesn't accept runtime CSS variables being set in Sass, as
it wants to apply transforms to the colors.

Closes #1385

* Start port to Svelte 4

- svelte-check tests have a bunch of failures; ./run works
- Svelte no longer exposes internals, so we can't use create_in_transition
- Also update esbuild and related components like esbuild-svelte

* Fix test failures

Had to add some more a11y warning ignores - have added
https://github.com/ankitects/anki/issues/2564 to address that in the
future.

* Remove some dependency pins

+ Remove sass, we don't need it directly

* Bump remaining JS deps that have a current semver

* Upgrade dprint/license-checker/marked

The new helper method avoids marked printing deprecation warnings to
the console.

Also remove unused lodash/long types, and move lodahs-es to devdeps

* Upgrade eslint and fluent packages

* Update @floating-ui/dom

The only dependencies remaining are currently blocked:

- Jest 29 gives some error about require vs import; may not be worth
investigating if we switch to Deno for the tests
- CodeMirror 6 is a big API change and will need work.

* Roll dprint back to an earlier version

GitHub dropped support for Ubuntu 18 runners, causing dprint's artifacts
to require a glibc version greater than what Anki CI currently has.
2023-07-01 16:21:53 +10:00
Damien Elmes
4451d00430 Migrate proto build actions to ninja_gen; switch from dyn Error to anyhow 2023-06-30 19:37:02 +10:00
Damien Elmes
8eb19513a7 Use a build input instead of build var for substituted binaries
The vars were not resolved when listed as inputs to other rules, which
was causing problems when using n2, and this approach is simpler.
2023-06-30 19:13:35 +10:00
Damien Elmes
2bea1503c5 Update test for changed translation 2023-06-30 17:08:36 +10:00
Damien Elmes
51e368dbd1 Update translations 2023-06-30 17:06:47 +10:00
Damien Elmes
3e2d71b81a Add must_use annotations to generated protobufs 2023-06-30 17:02:36 +10:00
BenYip
1815e105dc Support more mime types for add_extension_based_on_mime (#2562)
* Support more mime types for add_extension_based_on_mime

* Add myself to CONTRIBUTORS
2023-06-29 15:22:04 +10:00
Abdo
a58dfccb26 Make set_config_help_action work with submodules (#2561) 2023-06-28 11:46:02 +10:00
Damien Elmes
f3802c3f53 Use overriden node/protoc binaries as inputs
https://forums.ankiweb.net/t/getting-error-when-python-protoc-and-node-binary-path-set-in-environment/31615
2023-06-28 10:08:32 +10:00
Abdo
688b8fd605 Fix main window geometry/state not being restored in some cases (#2558)
Introduced by e576baac6d

Report: https://forums.ankiweb.net/t/65-the-size-of-the-main-window-is-reset-every-time-it-is-closed-again/31364
2023-06-27 16:52:34 +10:00
Damien Elmes
b2cf7fbced Use 127.0.0.1 instead of localhost
248c4f007b (commitcomment-119760971)
2023-06-27 16:45:31 +10:00
Damien Elmes
59fd40928a Fix full template render choking on empty fields 2023-06-27 16:30:41 +10:00
Damien Elmes
82f608af24 Rework RenderCardOutput::question/answer
Instead of flattening the output (which was missing FrontSide), alter
the behaviour of render() instead. The non-partial output is now exposed
via Protobuf, so the non-Python clients can take advantage of it.
2023-06-27 00:37:41 +10:00
Damien Elmes
c65361560a Tweaks to web-watch
- Fix warning on Linux about conflicting args
- Use clear instead of printing a control char
- Print the rebuild time
- Perform a rebuild on initial invocation
2023-06-26 15:50:34 +10:00