Anki/ts
Henrik Giesel dec0fbe845
Refactor i18n (#1405)
Merging note: the typing changes were fixed in a separate PR.

* Put rootDirs into subprojects

- typings do not work for any ts or svelte files
- if we set the 'rootDirs' in ts/tsconfig.json to '../bazel-bin/ts' and then inherit
  them from e.g. editor, the root will be changed to '../../bazel-bin/ts',
  however editor needs look in '../../bazel-bin/ts/editor' instead.

* Rename i18n and i18n_helpers to i18n-generated and i18n

- This way, we can restrict the awkwardness of importing files outside
  the ts directory within lib

* Fix missing typing of i18n and backend_proto by adding back symlinks

* Split up i18n-generated into i18n-{translate,modules}

* Change i18n from singleton to functions

* Revert "Put rootDirs into subprojects"

This partially reverts commit e1d4292ce3.

It seems like this might not be necessary after all.
However some other change made on this branch seems to have fixed
the .svelte.d.ts imports

* Introduce i18n-bundles to remove circular import

There was a circular import i18n.ts <-> i18n-translate.ts

* Create own directory for i18n

* Move lib/i18n/translate to lib/translate

* This restores tree shaking

* Update tsconfig libs and module

* es2018-2020 have wide support on all modern browsers including

* Switch bundles and langs inside i18n to variables again

* Add missing copyright header

* Rename translate.ts to ftl.ts

* Remove the symlinks again

I added them to fix to have completion for tr, however this would have
also have meant to abandon the tree shaking.
As we want to have tree shaking, it's also not necessary to have the
symlinks anymore

* Revert "Update tsconfig libs and module"

This reverts commit 0a96776a47.

* move withCollapsedWhitespace back to i18n/utils

* Add back /ts as in rootDirs
2021-10-07 23:31:49 +10:00
..
change-notetype Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
components use extra rootDir in tsconfig instead of symlinks 2021-10-01 18:36:52 +10:00
congrats Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
deck-options Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
editable use extra rootDir in tsconfig instead of symlinks 2021-10-01 18:36:52 +10:00
editor Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
graphs Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
html-filter use extra rootDir in tsconfig instead of symlinks 2021-10-01 18:36:52 +10:00
lib Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
patches update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
reviewer use extra rootDir in tsconfig instead of symlinks 2021-10-01 18:36:52 +10:00
sass yarn upgrade --latest 2021-10-01 12:52:53 +10:00
svelte svelte needs its shims to generate prop typing 2021-10-07 21:33:21 +10:00
sveltelib use extra rootDir in tsconfig instead of symlinks 2021-10-01 18:36:52 +10:00
.eslintrc.js update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
.gitignore Update eslint to 4.22.0 2021-04-22 19:19:39 +02:00
.prettierignore Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
.prettierrc initial Bazel conversion 2020-11-01 14:26:58 +10:00
BUILD.bazel update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
compile_sass.bzl Directly include CSS from bootstrap and codemirror packages 2021-09-02 23:37:16 +02:00
copy.bzl include sourcemaps for pages/* in dev builds 2021-04-20 17:33:46 +10:00
esbuild.bzl update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
eslint.bzl use extra rootDir in tsconfig instead of symlinks 2021-10-01 18:36:52 +10:00
format.sh make 'bazel run ts:format' work 2020-11-12 20:49:00 +10:00
jest.bzl update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
jest.config.js update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
licenses.json yarn upgrade --latest 2021-10-01 12:52:53 +10:00
prettier.bzl use extra rootDir in tsconfig instead of symlinks 2021-10-01 18:36:52 +10:00
proto.bzl update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
protobuf-no-long.js add a hack to avoid Long.js in Jest tests 2021-04-17 17:05:48 +10:00
protobuf.bzl force number in protobuf generation 2021-04-12 14:33:20 +10:00
README.md add add.sh helper for adding dependency and updating licenses 2020-12-31 12:20:51 +10:00
sql_format.bzl update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
sql_format.ts fix case of fields table 2021-09-07 10:22:22 +10:00
tsconfig.json Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
typescript.bzl Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
update-licenses.sh move node_modules into root folder [action required] 2021-10-07 11:42:27 +10:00
update.sh add add.sh helper for adding dependency and updating licenses 2020-12-31 12:20:51 +10:00
vendor.bzl add workaround for protobufjs requiring uppercase package names 2021-07-10 15:24:01 +10:00
yarn.sh Replace individual d3 libraries with encompassing d3 2021-01-30 00:00:22 +01:00

Anki's TypeScript and Sass dependencies. Some TS/JS code is also stored separately in ../qt/aqt/data/web/.

To update all dependencies:

./update.sh

To add a new dev dependency, use something like:

./add.sh -D @rollup/plugin-alias