From 828146324bd3f0d6c70a3432fc1faef93bfbf7f9 Mon Sep 17 00:00:00 2001 From: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com> Date: Tue, 2 Apr 2024 22:18:53 +0100 Subject: [PATCH] Update deps and fix lint/fmt issues Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com> --- deno.json | 20 ++-- deno.lock | 98 ++++--------------- src/actions.ts | 4 +- src/main.ts | 2 +- src/public/src/app.tsx | 10 +- .../components/edit-audio-metadata-modal.tsx | 2 +- .../components/edit-audio-metdata-form.tsx | 2 +- .../src/components/remote-audio-info.tsx | 2 +- .../components/show-audio-metadata-modal.tsx | 2 +- src/public/src/main.tsx | 4 +- 10 files changed, 48 insertions(+), 98 deletions(-) diff --git a/deno.json b/deno.json index 22a1a7f..912270e 100644 --- a/deno.json +++ b/deno.json @@ -2,18 +2,26 @@ "name": "@m4rc3l05/denotag", "version": "3.5.0", "tasks": { - "run": "deno run -A --unstable-ffi --cached-only --lock=deno.lock ./bin/public-to-json.ts && deno run -A --unstable-ffi --cached-only --lock=deno.lock src/main.ts", - "compile": "deno run -A --unstable-ffi --cached-only --lock=deno.lock ./bin/public-to-json.ts && deno compile -A --unstable-ffi --include ./src/public.json --cached-only --lock=deno.lock -o ./bin/denotag ./src/main.ts", - "compile:windows": "deno run -A --unstable-ffi --cached-only --lock=deno.lock ./bin/public-to-json.ts && deno compile -A --unstable-ffi --target x86_64-pc-windows-msvc --include ./src/public.json --cached-only --lock=deno.lock -o ./bin/denotag ./src/main.ts", - "lock-deps": "deno cache --lock=deno.lock --lock-write src/*.ts src/**/*.ts src/**/*.tsx", - "deps": "deno cache --reload --lock=deno.lock src/*.ts src/**/*.ts src/**/*.tsx" + "run": "./.bin/public-to-json.ts && deno run -A --unstable-ffi --cached-only --lock=deno.lock src/main.ts", + "compile": "./.bin/public-to-json.ts && deno compile -A --unstable-ffi --include ./src/public.json --cached-only --lock=deno.lock -o ./.bin/denotag ./src/main.ts", + "deps:lock": "deno cache --lock=deno.lock --lock-write src/*.ts src/**/*.ts src/**/*.tsx ./.bin/*.ts", + "deps": "deno cache --reload --lock=deno.lock src/*.ts src/**/*.ts src/**/*.tsx ./.bin/*.ts" }, "compilerOptions": { "lib": ["DOM", "deno.ns"], "jsx": "react-jsx" }, + "lint": { + "rules": { + "include": ["verbatim-module-syntax"] + } + }, + "fmt": { + "exclude": [".cache/"] + }, "imports": { - "@deno/std/": "https://deno.land/std@0.221.0/", + "@std/encoding": "jsr:@std/encoding@0.221.0", + "@std/path": "jsr:@std/path@0.221.0", "@webview/webview": "jsr:@webview/webview@^0.8.0", "cliffy": "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts", "esbuild": "https://deno.land/x/esbuild@v0.20.2/mod.js", diff --git a/deno.lock b/deno.lock index 6c9e2cb..0865d44 100644 --- a/deno.lock +++ b/deno.lock @@ -4,10 +4,13 @@ "specifiers": { "jsr:@denosaurs/plug@^1.0.5": "jsr:@denosaurs/plug@1.0.5", "jsr:@std/assert@^0.214.0": "jsr:@std/assert@0.214.0", + "jsr:@std/assert@^0.221.0": "jsr:@std/assert@0.221.0", "jsr:@std/encoding@0.214": "jsr:@std/encoding@0.214.0", + "jsr:@std/encoding@0.221.0": "jsr:@std/encoding@0.221.0", "jsr:@std/fmt@0.214": "jsr:@std/fmt@0.214.0", "jsr:@std/fs@0.214": "jsr:@std/fs@0.214.0", "jsr:@std/path@0.214": "jsr:@std/path@0.214.0", + "jsr:@std/path@0.221.0": "jsr:@std/path@0.221.0", "jsr:@std/path@^0.214.0": "jsr:@std/path@0.214.0", "jsr:@webview/webview@^0.8.0": "jsr:@webview/webview@0.8.0", "npm:esbuild-plugin-cache@0.2.10": "npm:esbuild-plugin-cache@0.2.10", @@ -26,9 +29,15 @@ "@std/assert@0.214.0": { "integrity": "55d398de76a9828fd3b1aa653f4dba3eee4c6985d90c514865d2be9bd082b140" }, + "@std/assert@0.221.0": { + "integrity": "a5f1aa6e7909dbea271754fd4ab3f4e687aeff4873b4cef9a320af813adb489a" + }, "@std/encoding@0.214.0": { "integrity": "30a8713e1db22986c7e780555ffd2fefd1d4f9374d734bb41f5970f6c3352af5" }, + "@std/encoding@0.221.0": { + "integrity": "d1dd76ef0dc5d14088411e6dc1dede53bf8308c95d1537df1214c97137208e45" + }, "@std/fmt@0.214.0": { "integrity": "40382cff88a0783b347b4d69b94cf931ab8e549a733916718cb866c08efac4d4" }, @@ -45,6 +54,12 @@ "jsr:@std/assert@^0.214.0" ] }, + "@std/path@0.221.0": { + "integrity": "0a36f6b17314ef653a3a1649740cc8db51b25a133ecfe838f20b79a56ebe0095", + "dependencies": [ + "jsr:@std/assert@^0.221.0" + ] + }, "@webview/webview@0.8.0": { "integrity": "5fc571eac35026e8b5efd2bb6f483c2b4e3925e2244e9a9a66b0bc90bdef4983", "dependencies": [ @@ -336,87 +351,6 @@ "https://deno.land/std@0.196.0/console/_rle.ts": "56668d5c44f964f1b4ff93f21c9896df42d6ee4394e814db52d6d13f5bb247c7", "https://deno.land/std@0.196.0/console/unicode_width.ts": "10661c0f2eeab802d16b8b85ed8825bbc573991bbfb6affed32dc1ff994f54f9", "https://deno.land/std@0.196.0/fmt/colors.ts": "a7eecffdf3d1d54db890723b303847b6e0a1ab4b528ba6958b8f2e754cf1b3bc", - "https://deno.land/std@0.221.0/assert/assert.ts": "bec068b2fccdd434c138a555b19a2c2393b71dfaada02b7d568a01541e67cdc5", - "https://deno.land/std@0.221.0/assert/assertion_error.ts": "9f689a101ee586c4ce92f52fa7ddd362e86434ffdf1f848e45987dc7689976b8", - "https://deno.land/std@0.221.0/encoding/_util.ts": "beacef316c1255da9bc8e95afb1fa56ed69baef919c88dc06ae6cb7a6103d376", - "https://deno.land/std@0.221.0/encoding/base64.ts": "8ccae67a1227b875340a8582ff707f37b131df435b07080d3bb58e07f5f97807", - "https://deno.land/std@0.221.0/path/_common/assert_path.ts": "dbdd757a465b690b2cc72fc5fb7698c51507dec6bfafce4ca500c46b76ff7bd8", - "https://deno.land/std@0.221.0/path/_common/basename.ts": "569744855bc8445f3a56087fd2aed56bdad39da971a8d92b138c9913aecc5fa2", - "https://deno.land/std@0.221.0/path/_common/common.ts": "ef73c2860694775fe8ffcbcdd387f9f97c7a656febf0daa8c73b56f4d8a7bd4c", - "https://deno.land/std@0.221.0/path/_common/constants.ts": "dc5f8057159f4b48cd304eb3027e42f1148cf4df1fb4240774d3492b5d12ac0c", - "https://deno.land/std@0.221.0/path/_common/dirname.ts": "684df4aa71a04bbcc346c692c8485594fc8a90b9408dfbc26ff32cf3e0c98cc8", - "https://deno.land/std@0.221.0/path/_common/format.ts": "92500e91ea5de21c97f5fe91e178bae62af524b72d5fcd246d6d60ae4bcada8b", - "https://deno.land/std@0.221.0/path/_common/from_file_url.ts": "d672bdeebc11bf80e99bf266f886c70963107bdd31134c4e249eef51133ceccf", - "https://deno.land/std@0.221.0/path/_common/glob_to_reg_exp.ts": "6cac16d5c2dc23af7d66348a7ce430e5de4e70b0eede074bdbcf4903f4374d8d", - "https://deno.land/std@0.221.0/path/_common/normalize.ts": "684df4aa71a04bbcc346c692c8485594fc8a90b9408dfbc26ff32cf3e0c98cc8", - "https://deno.land/std@0.221.0/path/_common/normalize_string.ts": "33edef773c2a8e242761f731adeb2bd6d683e9c69e4e3d0092985bede74f4ac3", - "https://deno.land/std@0.221.0/path/_common/relative.ts": "faa2753d9b32320ed4ada0733261e3357c186e5705678d9dd08b97527deae607", - "https://deno.land/std@0.221.0/path/_common/strip_trailing_separators.ts": "7024a93447efcdcfeaa9339a98fa63ef9d53de363f1fbe9858970f1bba02655a", - "https://deno.land/std@0.221.0/path/_common/to_file_url.ts": "7f76adbc83ece1bba173e6e98a27c647712cab773d3f8cbe0398b74afc817883", - "https://deno.land/std@0.221.0/path/_interface.ts": "8dfeb930ca4a772c458a8c7bbe1e33216fe91c253411338ad80c5b6fa93ddba0", - "https://deno.land/std@0.221.0/path/_os.ts": "8fb9b90fb6b753bd8c77cfd8a33c2ff6c5f5bc185f50de8ca4ac6a05710b2c15", - "https://deno.land/std@0.221.0/path/basename.ts": "7ee495c2d1ee516ffff48fb9a93267ba928b5a3486b550be73071bc14f8cc63e", - "https://deno.land/std@0.221.0/path/common.ts": "03e52e22882402c986fe97ca3b5bb4263c2aa811c515ce84584b23bac4cc2643", - "https://deno.land/std@0.221.0/path/constants.ts": "0c206169ca104938ede9da48ac952de288f23343304a1c3cb6ec7625e7325f36", - "https://deno.land/std@0.221.0/path/dirname.ts": "85bd955bf31d62c9aafdd7ff561c4b5fb587d11a9a5a45e2b01aedffa4238a7c", - "https://deno.land/std@0.221.0/path/extname.ts": "593303db8ae8c865cbd9ceec6e55d4b9ac5410c1e276bfd3131916591b954441", - "https://deno.land/std@0.221.0/path/format.ts": "6ce1779b0980296cf2bc20d66436b12792102b831fd281ab9eb08fa8a3e6f6ac", - "https://deno.land/std@0.221.0/path/from_file_url.ts": "911833ae4fd10a1c84f6271f36151ab785955849117dc48c6e43b929504ee069", - "https://deno.land/std@0.221.0/path/glob_to_regexp.ts": "7f30f0a21439cadfdae1be1bf370880b415e676097fda584a63ce319053b5972", - "https://deno.land/std@0.221.0/path/is_absolute.ts": "4791afc8bfd0c87f0526eaa616b0d16e7b3ab6a65b62942e50eac68de4ef67d7", - "https://deno.land/std@0.221.0/path/is_glob.ts": "a65f6195d3058c3050ab905705891b412ff942a292bcbaa1a807a74439a14141", - "https://deno.land/std@0.221.0/path/join.ts": "ae2ec5ca44c7e84a235fd532e4a0116bfb1f2368b394db1c4fb75e3c0f26a33a", - "https://deno.land/std@0.221.0/path/join_globs.ts": "5b3bf248b93247194f94fa6947b612ab9d3abd571ca8386cf7789038545e54a0", - "https://deno.land/std@0.221.0/path/mod.ts": "2821a1bb3a4148a0ffe79c92aa41aa9319fef73c6d6f5178f52b2c720d3eb02d", - "https://deno.land/std@0.221.0/path/normalize.ts": "4155743ccceeed319b350c1e62e931600272fad8ad00c417b91df093867a8352", - "https://deno.land/std@0.221.0/path/normalize_glob.ts": "cc89a77a7d3b1d01053b9dcd59462b75482b11e9068ae6c754b5cf5d794b374f", - "https://deno.land/std@0.221.0/path/parse.ts": "3e172974e3c71025f5fbd2bd9db4307acb9cc2de14cf6f4464bf40957663cabe", - "https://deno.land/std@0.221.0/path/posix/_util.ts": "1e3937da30f080bfc99fe45d7ed23c47dd8585c5e473b2d771380d3a6937cf9d", - "https://deno.land/std@0.221.0/path/posix/basename.ts": "d2fa5fbbb1c5a3ab8b9326458a8d4ceac77580961b3739cd5bfd1d3541a3e5f0", - "https://deno.land/std@0.221.0/path/posix/common.ts": "26f60ccc8b2cac3e1613000c23ac5a7d392715d479e5be413473a37903a2b5d4", - "https://deno.land/std@0.221.0/path/posix/constants.ts": "93481efb98cdffa4c719c22a0182b994e5a6aed3047e1962f6c2c75b7592bef1", - "https://deno.land/std@0.221.0/path/posix/dirname.ts": "76cd348ffe92345711409f88d4d8561d8645353ac215c8e9c80140069bf42f00", - "https://deno.land/std@0.221.0/path/posix/extname.ts": "e398c1d9d1908d3756a7ed94199fcd169e79466dd88feffd2f47ce0abf9d61d2", - "https://deno.land/std@0.221.0/path/posix/format.ts": "185e9ee2091a42dd39e2a3b8e4925370ee8407572cee1ae52838aed96310c5c1", - "https://deno.land/std@0.221.0/path/posix/from_file_url.ts": "951aee3a2c46fd0ed488899d024c6352b59154c70552e90885ed0c2ab699bc40", - "https://deno.land/std@0.221.0/path/posix/glob_to_regexp.ts": "76f012fcdb22c04b633f536c0b9644d100861bea36e9da56a94b9c589a742e8f", - "https://deno.land/std@0.221.0/path/posix/is_absolute.ts": "cebe561ad0ae294f0ce0365a1879dcfca8abd872821519b4fcc8d8967f888ede", - "https://deno.land/std@0.221.0/path/posix/is_glob.ts": "8a8b08c08bf731acf2c1232218f1f45a11131bc01de81e5f803450a5914434b9", - "https://deno.land/std@0.221.0/path/posix/join.ts": "7fc2cb3716aa1b863e990baf30b101d768db479e70b7313b4866a088db016f63", - "https://deno.land/std@0.221.0/path/posix/join_globs.ts": "a9475b44645feddceb484ee0498e456f4add112e181cb94042cdc6d47d1cdd25", - "https://deno.land/std@0.221.0/path/posix/mod.ts": "2301fc1c54a28b349e20656f68a85f75befa0ee9b6cd75bfac3da5aca9c3f604", - "https://deno.land/std@0.221.0/path/posix/normalize.ts": "baeb49816a8299f90a0237d214cef46f00ba3e95c0d2ceb74205a6a584b58a91", - "https://deno.land/std@0.221.0/path/posix/normalize_glob.ts": "9c87a829b6c0f445d03b3ecadc14492e2864c3ebb966f4cea41e98326e4435c6", - "https://deno.land/std@0.221.0/path/posix/parse.ts": "0b1fc4cb890dbb699ec1d2c232d274843b4a7142e1ad976b69fe51c954eb6080", - "https://deno.land/std@0.221.0/path/posix/relative.ts": "3907d6eda41f0ff723d336125a1ad4349112cd4d48f693859980314d5b9da31c", - "https://deno.land/std@0.221.0/path/posix/resolve.ts": "08b699cfeee10cb6857ccab38fa4b2ec703b0ea33e8e69964f29d02a2d5257cf", - "https://deno.land/std@0.221.0/path/posix/to_file_url.ts": "7aa752ba66a35049e0e4a4be5a0a31ac6b645257d2e031142abb1854de250aaf", - "https://deno.land/std@0.221.0/path/posix/to_namespaced_path.ts": "28b216b3c76f892a4dca9734ff1cc0045d135532bfd9c435ae4858bfa5a2ebf0", - "https://deno.land/std@0.221.0/path/relative.ts": "ab739d727180ed8727e34ed71d976912461d98e2b76de3d3de834c1066667add", - "https://deno.land/std@0.221.0/path/resolve.ts": "a6f977bdb4272e79d8d0ed4333e3d71367cc3926acf15ac271f1d059c8494d8d", - "https://deno.land/std@0.221.0/path/to_file_url.ts": "88f049b769bce411e2d2db5bd9e6fd9a185a5fbd6b9f5ad8f52bef517c4ece1b", - "https://deno.land/std@0.221.0/path/to_namespaced_path.ts": "b706a4103b104cfadc09600a5f838c2ba94dbcdb642344557122dda444526e40", - "https://deno.land/std@0.221.0/path/windows/_util.ts": "d5f47363e5293fced22c984550d5e70e98e266cc3f31769e1710511803d04808", - "https://deno.land/std@0.221.0/path/windows/basename.ts": "6bbc57bac9df2cec43288c8c5334919418d784243a00bc10de67d392ab36d660", - "https://deno.land/std@0.221.0/path/windows/common.ts": "26f60ccc8b2cac3e1613000c23ac5a7d392715d479e5be413473a37903a2b5d4", - "https://deno.land/std@0.221.0/path/windows/constants.ts": "5afaac0a1f67b68b0a380a4ef391bf59feb55856aa8c60dfc01bd3b6abb813f5", - "https://deno.land/std@0.221.0/path/windows/dirname.ts": "33e421be5a5558a1346a48e74c330b8e560be7424ed7684ea03c12c21b627bc9", - "https://deno.land/std@0.221.0/path/windows/extname.ts": "165a61b00d781257fda1e9606a48c78b06815385e7d703232548dbfc95346bef", - "https://deno.land/std@0.221.0/path/windows/format.ts": "bbb5ecf379305b472b1082cd2fdc010e44a0020030414974d6029be9ad52aeb6", - "https://deno.land/std@0.221.0/path/windows/from_file_url.ts": "ced2d587b6dff18f963f269d745c4a599cf82b0c4007356bd957cb4cb52efc01", - "https://deno.land/std@0.221.0/path/windows/glob_to_regexp.ts": "e45f1f89bf3fc36f94ab7b3b9d0026729829fabc486c77f414caebef3b7304f8", - "https://deno.land/std@0.221.0/path/windows/is_absolute.ts": "4a8f6853f8598cf91a835f41abed42112cebab09478b072e4beb00ec81f8ca8a", - "https://deno.land/std@0.221.0/path/windows/is_glob.ts": "8a8b08c08bf731acf2c1232218f1f45a11131bc01de81e5f803450a5914434b9", - "https://deno.land/std@0.221.0/path/windows/join.ts": "8d03530ab89195185103b7da9dfc6327af13eabdcd44c7c63e42e27808f50ecf", - "https://deno.land/std@0.221.0/path/windows/join_globs.ts": "a9475b44645feddceb484ee0498e456f4add112e181cb94042cdc6d47d1cdd25", - "https://deno.land/std@0.221.0/path/windows/mod.ts": "2301fc1c54a28b349e20656f68a85f75befa0ee9b6cd75bfac3da5aca9c3f604", - "https://deno.land/std@0.221.0/path/windows/normalize.ts": "78126170ab917f0ca355a9af9e65ad6bfa5be14d574c5fb09bb1920f52577780", - "https://deno.land/std@0.221.0/path/windows/normalize_glob.ts": "9c87a829b6c0f445d03b3ecadc14492e2864c3ebb966f4cea41e98326e4435c6", - "https://deno.land/std@0.221.0/path/windows/parse.ts": "dbdfe2bc6db482d755b5f63f7207cd019240fcac02ad2efa582adf67ff10553a", - "https://deno.land/std@0.221.0/path/windows/relative.ts": "3e1abc7977ee6cc0db2730d1f9cb38be87b0ce4806759d271a70e4997fc638d7", - "https://deno.land/std@0.221.0/path/windows/resolve.ts": "8dae1dadfed9d46ff46cc337c9525c0c7d959fb400a6308f34595c45bdca1972", - "https://deno.land/std@0.221.0/path/windows/to_file_url.ts": "40e560ee4854fe5a3d4d12976cef2f4e8914125c81b11f1108e127934ced502e", - "https://deno.land/std@0.221.0/path/windows/to_namespaced_path.ts": "4ffa4fb6fae321448d5fe810b3ca741d84df4d7897e61ee29be961a6aac89a4c", "https://deno.land/x/cliffy@v1.0.0-rc.3/_utils/distance.ts": "02af166952c7c358ac83beae397aa2fbca4ad630aecfcd38d92edb1ea429f004", "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_argument_types.ts": "ab269dacea2030f865a07c2a1e953ec437a64419a05bad1f1ddaab3f99752ead", "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_errors.ts": "12d513ff401020287a344e0830e1297ce1c80c077ecb91e0ac5db44d04a6019c", @@ -539,6 +473,8 @@ }, "workspace": { "dependencies": [ + "jsr:@std/encoding@0.221.0", + "jsr:@std/path@0.221.0", "jsr:@webview/webview@^0.8.0", "npm:esbuild-plugin-cache@0.2.10", "npm:node-taglib-sharp@5.2.3" diff --git a/src/actions.ts b/src/actions.ts index 659a05b..fbeb19a 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -1,6 +1,6 @@ import { ByteVector, File, OggTag, PictureType } from "node-taglib-sharp"; -import { join } from "@deno/std/path/join.ts"; -import { decodeBase64 } from "@deno/std/encoding/base64.ts"; +import { join } from "@std/path"; +import { decodeBase64 } from "@std/encoding/base64"; class ActionError extends Error { toJSON() { diff --git a/src/main.ts b/src/main.ts index 0308c82..5a85832 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,5 @@ import { Command, CompletionsCommand, HelpCommand } from "cliffy"; -import { join } from "@deno/std/path/mod.ts"; +import { join } from "@std/path"; import { SizeHint, Webview } from "@webview/webview"; import * as actions from "./actions.ts"; import embed from "./public.json" with { type: "json" }; diff --git a/src/public/src/app.tsx b/src/public/src/app.tsx index 8a3d2bb..685fd5f 100644 --- a/src/public/src/app.tsx +++ b/src/public/src/app.tsx @@ -1,4 +1,10 @@ -import { ChangeEvent, useCallback, useEffect, useRef, useState } from "react"; +import { + type ChangeEvent, + useCallback, + useEffect, + useRef, + useState, +} from "react"; import Button from "react-bootstrap/Button"; import Container from "react-bootstrap/Container"; import Row from "react-bootstrap/Row"; @@ -7,7 +13,7 @@ import Col from "react-bootstrap/Col"; import MusicFiles from "./components/music-files.tsx"; import { useHotkeys } from "react-hotkeys-hook"; import { debounce } from "./utils.ts"; -import Alert, { AlertProps } from "./components/alert.tsx"; +import Alert, { type AlertProps } from "./components/alert.tsx"; import { getFiles } from "./actions.ts"; const App = () => { diff --git a/src/public/src/components/edit-audio-metadata-modal.tsx b/src/public/src/components/edit-audio-metadata-modal.tsx index 9654a8d..9465927 100644 --- a/src/public/src/components/edit-audio-metadata-modal.tsx +++ b/src/public/src/components/edit-audio-metadata-modal.tsx @@ -5,7 +5,7 @@ import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; import EditAudioMetadataForm from "./edit-audio-metdata-form.tsx"; import RemoteAudioInfo from "./remote-audio-info.tsx"; -import Alert, { AlertProps } from "./alert.tsx"; +import Alert, { type AlertProps } from "./alert.tsx"; import { getMusicFileMetadata } from "../actions.ts"; type EditAudioFileMetadataModalPorps = { diff --git a/src/public/src/components/edit-audio-metdata-form.tsx b/src/public/src/components/edit-audio-metdata-form.tsx index 2c44145..3e72976 100644 --- a/src/public/src/components/edit-audio-metdata-form.tsx +++ b/src/public/src/components/edit-audio-metdata-form.tsx @@ -4,7 +4,7 @@ import Image from "react-bootstrap/Image"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; import Button from "react-bootstrap/Button"; -import Alert, { AlertProps } from "./alert.tsx"; +import Alert, { type AlertProps } from "./alert.tsx"; import { setMusicFileMetadata } from "../actions.ts"; type EditAudioMetadataFormProps = { diff --git a/src/public/src/components/remote-audio-info.tsx b/src/public/src/components/remote-audio-info.tsx index b15a380..f59113e 100644 --- a/src/public/src/components/remote-audio-info.tsx +++ b/src/public/src/components/remote-audio-info.tsx @@ -5,7 +5,7 @@ import Card from "react-bootstrap/Card"; import Form from "react-bootstrap/Form"; import Button from "react-bootstrap/Button"; import { makeRequester } from "../utils.ts"; -import Alert, { AlertProps } from "./alert.tsx"; +import Alert, { type AlertProps } from "./alert.tsx"; type DisplayMetadataProps = { metadata: Record; diff --git a/src/public/src/components/show-audio-metadata-modal.tsx b/src/public/src/components/show-audio-metadata-modal.tsx index c2808b2..f2b58a0 100644 --- a/src/public/src/components/show-audio-metadata-modal.tsx +++ b/src/public/src/components/show-audio-metadata-modal.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import Modal from "react-bootstrap/Modal"; import Image from "react-bootstrap/Image"; -import Alert, { AlertProps } from "./alert.tsx"; +import Alert, { type AlertProps } from "./alert.tsx"; import { getMusicFileMetadata } from "../actions.ts"; type ShowAudioFileMetadataModalProps = { diff --git a/src/public/src/main.tsx b/src/public/src/main.tsx index 5660a1b..1964d1e 100644 --- a/src/public/src/main.tsx +++ b/src/public/src/main.tsx @@ -4,7 +4,7 @@ import App from "./app.tsx"; (() => { const getPreferredTheme = () => { - return window.matchMedia("(prefers-color-scheme: dark)").matches + return globalThis.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; }; @@ -15,7 +15,7 @@ import App from "./app.tsx"; setTheme(getPreferredTheme()); - window.matchMedia("(prefers-color-scheme: dark)").addEventListener( + globalThis.matchMedia("(prefers-color-scheme: dark)").addEventListener( "change", () => { setTheme(getPreferredTheme());