2020-06-22 07:00:45 +02:00
|
|
|
{
|
update to latest rules_nodejs & switch to ts_project
ts_library() is deprecated and will presumably be dropped from a
future rules_nodejs, and it wasn't working with the jest tests
after updating, so we switch over to ts_project().
There are some downsides:
- It's a bit slower, as the worker mode doesn't appear to function
at the moment.
- Getting it working with a mix of source files and generated files
was quite tricky, especially as things behave differently on Windows,
and differently when editing with VS Code. Solved with a small patch
to the rules, and a wrapper script that copies everything into the
bin folder first. To keep VS Code working correctly as well, the built
files are symlinked into the source folder.
- TS libraries are not implicitly linked to node_modules, so they
can't be imported with an absolute name like "lib/proto" - we need
to use relative paths like "../lib/proto" instead. Adjusting "paths"
in tsconfig.json makes it work for TS compilation, but then it fails
at the esbuild stage. We could resolve it by wrapping the TS
libraries in a subsequent js_library() call, but that has the downside
of losing the transient dependencies, meaning they need to be listed
again. Alternatively we might be able to solve it in the future by
adjusting esbuild, but for now the paths have been made relative to
keep things simple.
Upsides:
- Along with updates to the Svelte tooling, Svelte typing has improved.
All exports made in a Svelte file are now visible to other files that
import them, and we no longer rebuild the Svelte files when TS files
are updated, as the Svelte files do no type checking themselves, and
are just a simple transpilation. Svelte-check now works on Windows again,
and there should be no errors when editing in VS Code after you've
built the project. The only downside seems to be that cmd+clicking
on a Svelte imports jumps to the .d.ts file instead of the original now;
presumably they'll fix that in a future plugin update.
- Each subfolder now has its own tsconfig.json, and tsc can be called
directly for testing purposes (but beware it will place build products
in the source tree): ts/node_modules/.bin/tsc -b ts
- We can drop the custom esbuild_toolchain, as it's included in the
latest rules_nodejs.
Other changes:
- "image_module_support" is moved into lib/, and imported with
<reference types=...>
- Images are now imported directly from their npm package; the
extra copy step has been removed.
Windows users may need to use "bazel clean" before building this,
due to old files lying around in the build folder.
2021-09-30 14:16:29 +02:00
|
|
|
"include": [],
|
|
|
|
"exclude": ["node_modules"],
|
|
|
|
"references": [
|
|
|
|
{ "path": "components" },
|
|
|
|
{ "path": "congrats" },
|
|
|
|
{ "path": "deck-options" },
|
|
|
|
{ "path": "editable" },
|
|
|
|
{ "path": "editor" },
|
|
|
|
{ "path": "graphs" },
|
|
|
|
{ "path": "html-filter" },
|
|
|
|
{ "path": "reviewer" },
|
2021-11-09 03:53:39 +01:00
|
|
|
{ "path": "lib" },
|
|
|
|
{ "path": "domlib" },
|
2021-11-17 04:49:52 +01:00
|
|
|
{ "path": "sveltelib" }
|
update to latest rules_nodejs & switch to ts_project
ts_library() is deprecated and will presumably be dropped from a
future rules_nodejs, and it wasn't working with the jest tests
after updating, so we switch over to ts_project().
There are some downsides:
- It's a bit slower, as the worker mode doesn't appear to function
at the moment.
- Getting it working with a mix of source files and generated files
was quite tricky, especially as things behave differently on Windows,
and differently when editing with VS Code. Solved with a small patch
to the rules, and a wrapper script that copies everything into the
bin folder first. To keep VS Code working correctly as well, the built
files are symlinked into the source folder.
- TS libraries are not implicitly linked to node_modules, so they
can't be imported with an absolute name like "lib/proto" - we need
to use relative paths like "../lib/proto" instead. Adjusting "paths"
in tsconfig.json makes it work for TS compilation, but then it fails
at the esbuild stage. We could resolve it by wrapping the TS
libraries in a subsequent js_library() call, but that has the downside
of losing the transient dependencies, meaning they need to be listed
again. Alternatively we might be able to solve it in the future by
adjusting esbuild, but for now the paths have been made relative to
keep things simple.
Upsides:
- Along with updates to the Svelte tooling, Svelte typing has improved.
All exports made in a Svelte file are now visible to other files that
import them, and we no longer rebuild the Svelte files when TS files
are updated, as the Svelte files do no type checking themselves, and
are just a simple transpilation. Svelte-check now works on Windows again,
and there should be no errors when editing in VS Code after you've
built the project. The only downside seems to be that cmd+clicking
on a Svelte imports jumps to the .d.ts file instead of the original now;
presumably they'll fix that in a future plugin update.
- Each subfolder now has its own tsconfig.json, and tsc can be called
directly for testing purposes (but beware it will place build products
in the source tree): ts/node_modules/.bin/tsc -b ts
- We can drop the custom esbuild_toolchain, as it's included in the
latest rules_nodejs.
Other changes:
- "image_module_support" is moved into lib/, and imported with
<reference types=...>
- Images are now imported directly from their npm package; the
extra copy step has been removed.
Windows users may need to use "bazel clean" before building this,
due to old files lying around in the build folder.
2021-09-30 14:16:29 +02:00
|
|
|
],
|
2020-06-22 07:00:45 +02:00
|
|
|
"compilerOptions": {
|
update to latest rules_nodejs & switch to ts_project
ts_library() is deprecated and will presumably be dropped from a
future rules_nodejs, and it wasn't working with the jest tests
after updating, so we switch over to ts_project().
There are some downsides:
- It's a bit slower, as the worker mode doesn't appear to function
at the moment.
- Getting it working with a mix of source files and generated files
was quite tricky, especially as things behave differently on Windows,
and differently when editing with VS Code. Solved with a small patch
to the rules, and a wrapper script that copies everything into the
bin folder first. To keep VS Code working correctly as well, the built
files are symlinked into the source folder.
- TS libraries are not implicitly linked to node_modules, so they
can't be imported with an absolute name like "lib/proto" - we need
to use relative paths like "../lib/proto" instead. Adjusting "paths"
in tsconfig.json makes it work for TS compilation, but then it fails
at the esbuild stage. We could resolve it by wrapping the TS
libraries in a subsequent js_library() call, but that has the downside
of losing the transient dependencies, meaning they need to be listed
again. Alternatively we might be able to solve it in the future by
adjusting esbuild, but for now the paths have been made relative to
keep things simple.
Upsides:
- Along with updates to the Svelte tooling, Svelte typing has improved.
All exports made in a Svelte file are now visible to other files that
import them, and we no longer rebuild the Svelte files when TS files
are updated, as the Svelte files do no type checking themselves, and
are just a simple transpilation. Svelte-check now works on Windows again,
and there should be no errors when editing in VS Code after you've
built the project. The only downside seems to be that cmd+clicking
on a Svelte imports jumps to the .d.ts file instead of the original now;
presumably they'll fix that in a future plugin update.
- Each subfolder now has its own tsconfig.json, and tsc can be called
directly for testing purposes (but beware it will place build products
in the source tree): ts/node_modules/.bin/tsc -b ts
- We can drop the custom esbuild_toolchain, as it's included in the
latest rules_nodejs.
Other changes:
- "image_module_support" is moved into lib/, and imported with
<reference types=...>
- Images are now imported directly from their npm package; the
extra copy step has been removed.
Windows users may need to use "bazel clean" before building this,
due to old files lying around in the build folder.
2021-09-30 14:16:29 +02:00
|
|
|
"declaration": true,
|
|
|
|
"composite": true,
|
2020-11-01 05:26:58 +01:00
|
|
|
"target": "es6",
|
2021-10-07 15:31:49 +02:00
|
|
|
"module": "es2020",
|
2021-07-19 01:23:41 +02:00
|
|
|
"lib": [
|
|
|
|
"es2017",
|
2021-09-30 11:18:10 +02:00
|
|
|
"es2018.intl",
|
2021-07-19 01:23:41 +02:00
|
|
|
"es2018.promise",
|
2021-10-07 15:31:49 +02:00
|
|
|
"es2019.array",
|
|
|
|
"es2019.object",
|
2021-06-24 00:12:20 +02:00
|
|
|
"es2019.string",
|
2021-10-07 15:31:49 +02:00
|
|
|
"es2020.promise",
|
2021-07-19 01:23:41 +02:00
|
|
|
"dom",
|
|
|
|
"dom.iterable"
|
|
|
|
],
|
2021-10-01 10:28:38 +02:00
|
|
|
// uncomment for building with tsc directly
|
|
|
|
// "outDir": "dist",
|
2021-10-07 03:34:00 +02:00
|
|
|
"rootDir": "..",
|
2021-10-01 10:28:38 +02:00
|
|
|
"rootDirs": [
|
|
|
|
".",
|
|
|
|
// for VS code
|
2022-01-23 11:17:08 +01:00
|
|
|
"../../bazel/anki/bin/ts"
|
2021-10-01 10:28:38 +02:00
|
|
|
],
|
2020-11-01 05:26:58 +01:00
|
|
|
"baseUrl": ".",
|
update to latest rules_nodejs & switch to ts_project
ts_library() is deprecated and will presumably be dropped from a
future rules_nodejs, and it wasn't working with the jest tests
after updating, so we switch over to ts_project().
There are some downsides:
- It's a bit slower, as the worker mode doesn't appear to function
at the moment.
- Getting it working with a mix of source files and generated files
was quite tricky, especially as things behave differently on Windows,
and differently when editing with VS Code. Solved with a small patch
to the rules, and a wrapper script that copies everything into the
bin folder first. To keep VS Code working correctly as well, the built
files are symlinked into the source folder.
- TS libraries are not implicitly linked to node_modules, so they
can't be imported with an absolute name like "lib/proto" - we need
to use relative paths like "../lib/proto" instead. Adjusting "paths"
in tsconfig.json makes it work for TS compilation, but then it fails
at the esbuild stage. We could resolve it by wrapping the TS
libraries in a subsequent js_library() call, but that has the downside
of losing the transient dependencies, meaning they need to be listed
again. Alternatively we might be able to solve it in the future by
adjusting esbuild, but for now the paths have been made relative to
keep things simple.
Upsides:
- Along with updates to the Svelte tooling, Svelte typing has improved.
All exports made in a Svelte file are now visible to other files that
import them, and we no longer rebuild the Svelte files when TS files
are updated, as the Svelte files do no type checking themselves, and
are just a simple transpilation. Svelte-check now works on Windows again,
and there should be no errors when editing in VS Code after you've
built the project. The only downside seems to be that cmd+clicking
on a Svelte imports jumps to the .d.ts file instead of the original now;
presumably they'll fix that in a future plugin update.
- Each subfolder now has its own tsconfig.json, and tsc can be called
directly for testing purposes (but beware it will place build products
in the source tree): ts/node_modules/.bin/tsc -b ts
- We can drop the custom esbuild_toolchain, as it's included in the
latest rules_nodejs.
Other changes:
- "image_module_support" is moved into lib/, and imported with
<reference types=...>
- Images are now imported directly from their npm package; the
extra copy step has been removed.
Windows users may need to use "bazel clean" before building this,
due to old files lying around in the build folder.
2021-09-30 14:16:29 +02:00
|
|
|
"paths": {},
|
|
|
|
"types": [],
|
2020-11-01 05:26:58 +01:00
|
|
|
"importsNotUsedAsValues": "error",
|
2020-06-22 07:00:45 +02:00
|
|
|
/* Strict Type-Checking Options */
|
|
|
|
"strict": true /* Enable all strict type-checking options. */,
|
|
|
|
"noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */,
|
|
|
|
"strictNullChecks": true /* Enable strict null checks. */,
|
|
|
|
"strictFunctionTypes": true /* Enable strict checking of function types. */,
|
|
|
|
"strictBindCallApply": true /* Enable strict 'bind', 'call', and 'apply' methods on functions. */,
|
|
|
|
"strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */,
|
|
|
|
"noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */,
|
|
|
|
"alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */,
|
|
|
|
/* Module Resolution Options */
|
|
|
|
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
|
|
|
|
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
|
|
|
|
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
|
|
|
"jsx": "react",
|
2020-11-01 05:26:58 +01:00
|
|
|
"noEmitHelpers": true,
|
|
|
|
"importHelpers": true
|
2020-06-22 07:00:45 +02:00
|
|
|
}
|
|
|
|
}
|