Skip to content

Commit 4901de8

Browse files
committed
fix type strictness conflicts in qoi-fu dependency
1 parent 2e028cd commit 4901de8

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"devDependencies": {
1212
"puppeteer": "^24.36.0",
1313
"typescript": "~5.9.3",
14-
"vite": "^7.2.4"
14+
"vite": "^7.2.4",
15+
"vite-tsconfig-paths": "^6.0.5"
1516
},
1617
"dependencies": {
1718
"@ffmpeg/core": "^0.12.10",

src/handlers/qoi-fu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { FileData, FileFormat, FormatHandler } from "../FormatHandler.ts";
22

3-
import { QOIDecoder, QOIEncoder } from "./qoi-fu/transpiled/QOI.ts";
3+
import { QOIDecoder, QOIEncoder } from "qoi-fu";
44

55
class qoiFuHandler implements FormatHandler {
66

tsconfig.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,22 @@
2525
"noUnusedParameters": true,
2626
"erasableSyntaxOnly": true,
2727
"noFallthroughCasesInSwitch": true,
28-
"noUncheckedSideEffectImports": true
28+
"noUncheckedSideEffectImports": true,
29+
/**
30+
* The TS transpilation of the qoi-fu dependency isn't compabile with
31+
* our settings. They do provide a JS file, but tsc _really_ wants to
32+
* import the TS file instead. We define a custom path to steer it
33+
* away from the TS file.
34+
*/
35+
"baseUrl": ".",
36+
"paths": {
37+
"qoi-fu": ["./src/handlers/qoi-fu/transpiled/QOI.js"]
38+
}
2939
},
3040
"include": [
3141
"src"
42+
],
43+
"exclude": [
44+
"src/handlers/qoi-fu/**/*"
3245
]
3346
}

vite.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineConfig } from "vite";
22
import { viteStaticCopy } from "vite-plugin-static-copy";
3+
import tsconfigPaths from "vite-tsconfig-paths";
34

45
export default defineConfig({
56
optimizeDeps: {
@@ -20,6 +21,7 @@ export default defineConfig({
2021
dest: "wasm"
2122
}
2223
]
23-
})
24+
}),
25+
tsconfigPaths()
2426
]
2527
});

0 commit comments

Comments
 (0)