Anki/ts
Damien Elmes 1f876cfe39 Svelte build improvements
1. All Svelte files in a package are compiled in one step now, which
ensures that properties that use types from a different Svelte file in the
same package are typed correctly. The single-file svelte() has been removed,
and compile_svelte() may be renamed to svelte() in the future.

2. The .ts files in the same package are included as part of the Svelte
compilation, so that types imported imported from .ts files in the
same package work.

3. Dependencies passed into the rule are now loaded into the TypeScript
compiler, so that properties referencing types from different packages
work. We'll need to update our compile_svelte() lines to list the
dependencies. For example, before this change:

% cat bazel-bin/ts/congrats/CongratsPage.svelte.d.ts
import { SvelteComponentTyped } from "svelte";
declare const __propDef: {
    props: {
        info: any;
    };
...

After adding //ts/lib to the deps of compile_svelte() in ts/congrats:

% cat bazel-bin/ts/congrats/CongratsPage.svelte.d.ts
import { SvelteComponentTyped } from "svelte";
import type { Scheduler } from "../lib/proto";
declare const __propDef: {
    props: {
        info: Scheduler.CongratsInfoResponse;
    };
...
2021-10-18 12:44:29 +10:00
..
card-info pass sole arg to cardStats as a dictionary 2021-10-14 19:28:51 +10:00
change-notetype Put sass into repo directory (#1409) 2021-10-09 10:25:03 +10:00
components declare bootstrap prereq in Svelte compile 2021-10-13 11:48:22 +10:00
congrats Svelte build improvements 2021-10-18 12:44:29 +10:00
deck-options declare bootstrap prereq in Svelte compile 2021-10-13 11:48:22 +10:00
editable Put sass into repo directory (#1409) 2021-10-09 10:25:03 +10:00
editor Put sass into repo directory (#1409) 2021-10-09 10:25:03 +10:00
graphs Put sass into repo directory (#1409) 2021-10-09 10:25:03 +10:00
html-filter use extra rootDir in tsconfig instead of symlinks 2021-10-01 18:36:52 +10:00
lib Switch CardInfoDialog to ts page (#1414) 2021-10-14 19:22:47 +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
svelte Svelte build improvements 2021-10-18 12:44:29 +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
BUILD.bazel Fix prettier after moving node_modules to repo dir (#1413) 2021-10-09 10:13:14 +10:00
compile_sass.bzl Put sass into repo directory (#1409) 2021-10-09 10:25:03 +10: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 Fix prettier after moving node_modules to repo dir (#1413) 2021-10-09 10:13:14 +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 Fix prettier after moving node_modules to repo dir (#1413) 2021-10-09 10:13:14 +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