Skip to content

Commit

Permalink
Update deps and fix lint/fmt issues
Browse files Browse the repository at this point in the history
Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com>
  • Loading branch information
M4RC3L05 committed Apr 2, 2024
1 parent f2d16c3 commit 8281463
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 98 deletions.
20 changes: 14 additions & 6 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
98 changes: 17 additions & 81 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/actions.ts
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -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" };
Expand Down
10 changes: 8 additions & 2 deletions src/public/src/app.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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 = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/public/src/components/edit-audio-metadata-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion src/public/src/components/edit-audio-metdata-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion src/public/src/components/remote-audio-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string | number>;
Expand Down
2 changes: 1 addition & 1 deletion src/public/src/components/show-audio-metadata-modal.tsx
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions src/public/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
Expand All @@ -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());
Expand Down

0 comments on commit 8281463

Please sign in to comment.