Commit Graph

21 Commits

Author SHA1 Message Date
Damien Elmes
84e2cfbe3f add a hack to handle sass resolution in svelte in external workspace 2021-05-20 15:32:06 +10:00
Damien Elmes
a564399414 disable svelte-check on Windows for now 2021-05-19 11:45:02 +10:00
Damien Elmes
220e14bf0f disable broken svelte_check test on Windows for now
Likely caused by a lack of sandboxing on Windows, causing the generated
.d.ts files to be visible to svelte_check, and being picked up in
preference over the .svelte file.
2021-05-08 12:15:49 +10:00
Damien Elmes
4951ef12c9 fix properties missing from generated Svelte .d.ts files
They're currently being set to 'any', as we're not providing the dependencies
to the tsc invocation. Older Anki versions had the same issue, and we'll
want to fix that as well, but for now this at least restores the missing
props.
2021-05-04 18:55:58 +10:00
Henrik Giesel
a7c3aec5dc Update Typescript to 4.2.4 2021-04-22 18:33:42 +02:00
Henrik Giesel
b1de095162 Include editor-toolbar as a library in editor 2021-04-20 13:44:44 +02:00
Damien Elmes
a6ed8e90ce support passing @types/... into svelte-check 2021-04-16 23:18:33 +10:00
Damien Elmes
6cee43631a allow passing sass deps to svelte compile/check 2021-04-15 14:27:53 +10:00
Damien Elmes
e520e8df02 add missing copyright headers to *.ts 2021-04-13 18:57:08 +10:00
Damien Elmes
6e4cdc52a6 stop Svelte warnings from failing the build
+ check for them at test time
2021-04-12 14:28:09 +10:00
Henrik Giesel
7655f14859 Satisfy svelte_check 2021-03-22 15:41:43 +01:00
Damien Elmes
dbe5d43ba0 bundle all Svelte css into separate file
- svelte compilation outputs a separate .css file for each component
- compilation also adds an "import foo.css" to the top of each generated
.mjs file
- when the .mjs files are bundled into app.js, esbuild creates an app.css
as well
- graphs.scss was renamed to graphs_shared.scss and imported in the
top level GraphsPage. Henrik's style refactoring would be a better path
forward, but I needed to make this change for now, as the filenames were
conflicting.
2021-03-21 16:06:36 +10:00
Damien Elmes
5403f704d0 ESM import issue on Windows came back again
Not sure if I just missed this in the previous change, or whether
the patch_resolver change broke things again.

Previous issue:
e60eb27184
2021-03-21 16:06:07 +10:00
Damien Elmes
e857aa2ea9 output embedded Svelte css into separate .css file for bundling 2021-03-21 16:06:01 +10:00
Damien Elmes
2658d9992e fixes for Svelte compilation
- enable resolver patch on worker binary to ensure js imports work
on subsequent worker requests
- cache ts library content, and use unified interface for cache
- prepare for separate css outputs
2021-03-21 16:05:46 +10:00
Damien Elmes
e0b85865f4 avoid temporary .ts file due to lack of sandbox on Windows
Just a quick hack for now to store it in memory, as the temp file
conflicts on Windows due to the lack of a sandbox, and we don't really
have a need to write it to the filesystem anyway.
2021-03-21 00:17:09 +10:00
Damien Elmes
aabcc8a7db use ts language service for much faster Svelte compiles 2021-03-20 23:49:10 +10:00
Damien Elmes
554081cee3 convert svelte worker to ts
Should make it easier to maintain, and ironically it also fixes
the issue with .mjs files from this morning.
2021-03-20 23:13:27 +10:00
Damien Elmes
0cc06ad03b 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
e60eb27184 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
ea7611d8cc 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