Commit f12c7de2a3ab
tarball7 files changed+137-6
@@ -298,6 +298,24 @@
298298
{299299
default = self.packages.${system}.default;300300
worker-wasm = self.packages.${system}.web-device;301
+ web = pkgs.stdenvNoCC.mkDerivation {302
+ pname = "malice-web-check";303
+ version = "0.1.0";304
+ src = cleanSrc ./web;305
+ npmDeps = webNodeModules pkgs;306
+ nativeBuildInputs = [307
+ pkgs.nodejs_22308
+ pkgs.importNpmLock.hooks.linkNodeModulesHook309
+ ];310
+ buildPhase = ''311
+ runHook preBuild312
+ export HOME=$TMPDIR313
+ npm run check314
+ npm test315
+ runHook postBuild316
+ '';317
+ installPhase = "touch $out";318
+ };301319
worker-browser = wasmPlatform.buildRustPackage {302320
pname = "malice-worker-browser-check";303321
version = "0.1.0";@@ -19,6 +19,7 @@
1919
"@sveltejs/vite-plugin-svelte": "^4.0.4",2020
"@types/node": "^22.20.5",2121
"storybook": "^10.6.1",22
+ "svelte-check": "^4.7.7",2223
"typescript": "~6.0.3",2324
"vite": "^5.4.11"2425
}@@ -1839,6 +1840,16 @@
18391840
"acorn": "^8.9.0"18401841
}18411842
},1843
+ "node_modules/@sveltejs/load-config": {1844
+ "version": "0.2.3",1845
+ "resolved": "https://registry.npmjs.org/@sveltejs/load-config/-/load-config-0.2.3.tgz",1846
+ "integrity": "sha512-VT3qmUb8pRV2QrZjd8iAmtg8lf4W0TIjZbvXtz5MKei/q96teWZgGJyyidJzOjzZzvdq616eSRVeMYIQChUTAQ==",1847
+ "dev": true,1848
+ "license": "MIT",1849
+ "engines": {1850
+ "node": ">= 18.0.0"1851
+ }1852
+ },18421853
"node_modules/@sveltejs/vite-plugin-svelte": {18431854
"version": "4.0.4",18441855
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-4.0.4.tgz",@@ -2267,6 +2278,22 @@
22672278
"node": ">= 16"22682279
}22692280
},2281
+ "node_modules/chokidar": {2282
+ "version": "4.0.3",2283
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",2284
+ "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",2285
+ "dev": true,2286
+ "license": "MIT",2287
+ "dependencies": {2288
+ "readdirp": "^4.0.1"2289
+ },2290
+ "engines": {2291
+ "node": ">= 14.16.0"2292
+ },2293
+ "funding": {2294
+ "url": "https://paulmillr.com/funding/"2295
+ }2296
+ },22702297
"node_modules/clsx": {22712298
"version": "2.1.1",22722299
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",@@ -2508,6 +2535,24 @@
25082535
}25092536
}25102537
},2538
+ "node_modules/fdir": {2539
+ "version": "6.5.0",2540
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",2541
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",2542
+ "dev": true,2543
+ "license": "MIT",2544
+ "engines": {2545
+ "node": ">=12.0.0"2546
+ },2547
+ "peerDependencies": {2548
+ "picomatch": "^3 || ^4"2549
+ },2550
+ "peerDependenciesMeta": {2551
+ "picomatch": {2552
+ "optional": true2553
+ }2554
+ }2555
+ },25112556
"node_modules/fsevents": {25122557
"version": "2.3.3",25132558
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",@@ -2667,6 +2712,16 @@
26672712
"node": ">=4"26682713
}26692714
},2715
+ "node_modules/mri": {2716
+ "version": "1.2.0",2717
+ "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",2718
+ "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",2719
+ "dev": true,2720
+ "license": "MIT",2721
+ "engines": {2722
+ "node": ">=4"2723
+ }2724
+ },26702725
"node_modules/ms": {26712726
"version": "2.1.3",26722727
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",@@ -2885,6 +2940,20 @@
28852940
"dev": true,28862941
"license": "MIT"28872942
},2943
+ "node_modules/readdirp": {2944
+ "version": "4.1.2",2945
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",2946
+ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",2947
+ "dev": true,2948
+ "license": "MIT",2949
+ "engines": {2950
+ "node": ">= 14.18.0"2951
+ },2952
+ "funding": {2953
+ "type": "individual",2954
+ "url": "https://paulmillr.com/funding/"2955
+ }2956
+ },28882957
"node_modules/recast": {28892958
"version": "0.23.21",28902959
"resolved": "https://registry.npmjs.org/recast/-/recast-0.23.21.tgz",@@ -2975,6 +3044,19 @@
29753044
"url": "https://github.com/sponsors/sindresorhus"29763045
}29773046
},3047
+ "node_modules/sade": {3048
+ "version": "1.8.1",3049
+ "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",3050
+ "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",3051
+ "dev": true,3052
+ "license": "MIT",3053
+ "dependencies": {3054
+ "mri": "^1.1.0"3055
+ },3056
+ "engines": {3057
+ "node": ">=6"3058
+ }3059
+ },29783060
"node_modules/scheduler": {29793061
"version": "0.28.0",29803062
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz",@@ -3117,6 +3199,31 @@
31173199
"node": ">=18"31183200
}31193201
},3202
+ "node_modules/svelte-check": {3203
+ "version": "4.7.7",3204
+ "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.7.7.tgz",3205
+ "integrity": "sha512-Ge2IMdeTpbJuzNFGRiiMg0RWgbScysKQu7xwcyFJ22+DU9F5nPX51+Q3gHmGqRxYQMx2knreVWt5oCtfe0vf2g==",3206
+ "dev": true,3207
+ "license": "MIT",3208
+ "dependencies": {3209
+ "@jridgewell/trace-mapping": "^0.3.25",3210
+ "@sveltejs/load-config": "^0.2.3",3211
+ "chokidar": "^4.0.1",3212
+ "fdir": "^6.2.0",3213
+ "picocolors": "^1.0.0",3214
+ "sade": "^1.7.4"3215
+ },3216
+ "bin": {3217
+ "svelte-check": "bin/svelte-check"3218
+ },3219
+ "engines": {3220
+ "node": ">= 18.0.0"3221
+ },3222
+ "peerDependencies": {3223
+ "svelte": "^4.0.0 || ^5.0.0-next.0",3224
+ "typescript": "^5.0.0 || ^6.0.0"3225
+ }3226
+ },31203227
"node_modules/svelte/node_modules/aria-query": {31213228
"version": "5.3.1",31223229
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz",@@ -8,7 +8,7 @@
88
"build": "vite build",99
"build:device": "vite build --mode device",1010
"preview": "vite preview --host 127.0.0.1 --port 4173",11
- "check": "tsc --noEmit -p tsconfig.json",11
+ "check": "tsc --noEmit -p tsconfig.json && svelte-check --tsconfig ./tsconfig.json --fail-on-warnings",1212
"test": "node --experimental-transform-types --test 'test/**/*.test.ts'",1313
"storybook": "storybook dev -p 6006 --no-open",1414
"build-storybook": "storybook build && chmod -R u+w storybook-static"@@ -25,6 +25,7 @@
2525
"@sveltejs/vite-plugin-svelte": "^4.0.4",2626
"@types/node": "^22.20.5",2727
"storybook": "^10.6.1",28
+ "svelte-check": "^4.7.7",2829
"typescript": "~6.0.3",2930
"vite": "^5.4.11"3031
}@@ -138,7 +138,7 @@
138138
$: selectedSpace = selectedSpaceId ? ($rooms.find((r) => r.room_id === selectedSpaceId) ?? null) : null;139139
// While a space's children load (or fail), show no channels rather than the140140
// full list — listing everything would falsely imply it belongs to the space.141
- $: baseRooms = selectedSpaceId ? (spaceChildIds ? $rooms.filter((r) => spaceChildIds.includes(r.room_id)) : []) : $rooms;141
+ $: baseRooms = selectedSpaceId ? (spaceChildIds ? $rooms.filter((r) => spaceChildIds?.includes(r.room_id)) : []) : $rooms;142142
$: visibleRooms = query143143
? baseRooms.filter(144144
(r) =>@@ -194,7 +194,7 @@
194194
send_state: state,195195
content: {196196
kind: 'Message',197
- message: { kind: 'Text', body: p.body, geo_uri: null, formatted_body: null, edited: false, media: null }197
+ message: { kind: 'Text', body: p.body, geo_uri: null, formatted_body: null, edited: false, media: null, link_previews: [] }198198
},199199
reply_to: p.replyTo,200200
thread_root: null,@@ -31,7 +31,7 @@
3131
3232
{#if $lightbox}3333
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->34
- <div class="lightbox" role="dialog" aria-modal="true" aria-label={$lightbox.filename} on:click|self={close}>34
+ <div class="lightbox" role="dialog" tabindex="-1" aria-modal="true" aria-label={$lightbox.filename} on:click|self={close}>3535
<div class="lightbox-bar">3636
<span class="lightbox-name">{$lightbox.filename}</span>3737
<a class="ghost-btn" href={$lightbox.src} target="_blank" rel="noopener noreferrer">Open original</a>@@ -0,0 +1,5 @@
1
+import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';2
+3
+export default {4
+ preprocess: vitePreprocess()5
+};@@ -2,7 +2,7 @@ import { readdirSync, readFileSync } from 'node:fs';
22
import { join } from 'node:path';33
import { fileURLToPath } from 'node:url';44
import { defineConfig } from 'vite';5
-import { svelte, vitePreprocess } from '@sveltejs/vite-plugin-svelte';5
+import { svelte } from '@sveltejs/vite-plugin-svelte';66
77
/**88
* The page isn't SW-controlled on first launch, so the worker chunk and the@@ -55,7 +55,7 @@ function twemojiPlugin(): import('vite').Plugin {
5555
export default defineConfig(({ mode }) => {5656
const device = mode === 'device';5757
return {58
- plugins: [svelte({ preprocess: vitePreprocess() }), twemojiPlugin(), ...(device ? [precacheManifestPlugin()] : [])],58
+ plugins: [svelte(), twemojiPlugin(), ...(device ? [precacheManifestPlugin()] : [])],5959
assetsInclude: ['**/*.wasm'],6060
resolve: {6161
alias: {