fmt: sort imports
This commit is contained in:
parent
12094316ee
commit
5a49648e64
20 changed files with 89 additions and 102 deletions
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"editor.codeActionsOnSave": {
|
||||
"quickfix.biome": "explicit"
|
||||
"quickfix.biome": "explicit",
|
||||
"source.organizeImports.biome": "explicit"
|
||||
},
|
||||
"typescript.inlayHints.parameterNames.enabled": "all",
|
||||
"[typescript]": {
|
||||
|
|
82
bun.lock
82
bun.lock
|
@ -4,49 +4,49 @@
|
|||
"": {
|
||||
"name": "signalstats",
|
||||
"dependencies": {
|
||||
"@duskflower/signal-decrypt-backup-wasm": "latest",
|
||||
"@kobalte/core": "latest",
|
||||
"@kobalte/tailwindcss": "latest",
|
||||
"@solid-primitives/refs": "latest",
|
||||
"@solid-primitives/storage": "latest",
|
||||
"@solid-primitives/upload": "latest",
|
||||
"@solid-primitives/workers": "latest",
|
||||
"@solidjs/meta": "latest",
|
||||
"@solidjs/router": "latest",
|
||||
"@sqlite.org/sqlite-wasm": "latest",
|
||||
"@tanstack/solid-table": "latest",
|
||||
"@types/umami": "latest",
|
||||
"chart.js": "latest",
|
||||
"chartjs-chart-wordcloud": "latest",
|
||||
"chartjs-plugin-deferred": "latest",
|
||||
"chartjs-plugin-zoom": "latest",
|
||||
"class-variance-authority": "latest",
|
||||
"clsx": "latest",
|
||||
"date-fns": "latest",
|
||||
"kysely": "latest",
|
||||
"kysely-wasm": "latest",
|
||||
"lucide-solid": "latest",
|
||||
"seroval": "latest",
|
||||
"solid-js": "latest",
|
||||
"tailwind-merge": "latest",
|
||||
"tailwindcss-animate": "latest",
|
||||
"zen-mitt": "latest",
|
||||
"@duskflower/signal-decrypt-backup-wasm": "^0.3.0",
|
||||
"@kobalte/core": "^0.13.7",
|
||||
"@kobalte/tailwindcss": "^0.9.0",
|
||||
"@solid-primitives/refs": "^1.1.0",
|
||||
"@solid-primitives/storage": "^4.3.1",
|
||||
"@solid-primitives/upload": "^0.1.0",
|
||||
"@solid-primitives/workers": "^0.4.0",
|
||||
"@solidjs/meta": "^0.29.4",
|
||||
"@solidjs/router": "^0.15.3",
|
||||
"@sqlite.org/sqlite-wasm": "3.48.0-build3",
|
||||
"@tanstack/solid-table": "^8.20.5",
|
||||
"@types/umami": "^2.10.0",
|
||||
"chart.js": "^4.4.7",
|
||||
"chartjs-chart-wordcloud": "^4.4.4",
|
||||
"chartjs-plugin-deferred": "^2.0.0",
|
||||
"chartjs-plugin-zoom": "^2.2.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"date-fns": "^4.1.0",
|
||||
"kysely": "^0.27.5",
|
||||
"kysely-wasm": "^0.7.0",
|
||||
"lucide-solid": "^0.474.0",
|
||||
"seroval": "^1.2.0",
|
||||
"solid-js": "^1.9.4",
|
||||
"tailwind-merge": "^2.6.0",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"zen-mitt": "^3.0.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "latest",
|
||||
"@commitlint/cli": "latest",
|
||||
"@commitlint/config-conventional": "latest",
|
||||
"@tailwindcss/vite": "latest",
|
||||
"@types/node": "latest",
|
||||
"better-sqlite3": "latest",
|
||||
"husky": "latest",
|
||||
"kysely-codegen": "latest",
|
||||
"lint-staged": "latest",
|
||||
"tailwindcss": "latest",
|
||||
"typescript": "latest",
|
||||
"vite": "latest",
|
||||
"vite-plugin-solid": "latest",
|
||||
"vite-plugin-wasm": "latest",
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@commitlint/cli": "^19.6.1",
|
||||
"@commitlint/config-conventional": "^19.6.0",
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"@types/node": "^22.10.10",
|
||||
"better-sqlite3": "^11.8.1",
|
||||
"husky": "^9.1.7",
|
||||
"kysely-codegen": "^0.17.0",
|
||||
"lint-staged": "^15.4.2",
|
||||
"tailwindcss": "^4.0.0",
|
||||
"typescript": "^5.7.3",
|
||||
"vite": "^6.0.11",
|
||||
"vite-plugin-solid": "^2.11.0",
|
||||
"vite-plugin-wasm": "^3.4.1",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
11
src/App.tsx
11
src/App.tsx
|
@ -1,16 +1,15 @@
|
|||
import { A, Route, Router, useNavigate } from "@solidjs/router";
|
||||
import { createEffect, Show, Suspense, type Component } from "solid-js";
|
||||
import { DmId, GroupId, Home, Overview, preloadDmId, Privacy } from "./pages";
|
||||
|
||||
import { type Component, Show, Suspense, createEffect } from "solid-js";
|
||||
import { DmId, GroupId, Home, Overview, Privacy, preloadDmId } from "./pages";
|
||||
import "./app.css";
|
||||
import { ColorModeProvider, ColorModeScript, createLocalStorageManager } from "@kobalte/core";
|
||||
import { MetaProvider } from "@solidjs/meta";
|
||||
import { Portal } from "solid-js/web";
|
||||
import { Callout, CalloutTitle, CalloutContent } from "./components/ui/callout";
|
||||
import { Callout, CalloutContent, CalloutTitle } from "./components/ui/callout";
|
||||
import { ModeToggle } from "./components/ui/mode-toggle";
|
||||
import { dbLoaded } from "./db";
|
||||
import { hasCashedData } from "./lib/db-cache";
|
||||
import { isWasmSupported } from "./lib/utils";
|
||||
import { ColorModeProvider, ColorModeScript, createLocalStorageManager } from "@kobalte/core";
|
||||
import { ModeToggle } from "./components/ui/mode-toggle";
|
||||
|
||||
const NO_DATA_NEEDED_PAGES = ["/", "/privacy"];
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { sql, type NotNull } from "kysely";
|
||||
import { worker, kyselyDb, SELF_ID, DB_FILENAME, setDbLoaded } from "./db";
|
||||
import { cached, clearDbCache } from "../lib/db-cache";
|
||||
import { type NotNull, sql } from "kysely";
|
||||
import type { MainToWorkerMsg, WorkerToMainMsg } from "~/lib/kysely-official-wasm-worker/type";
|
||||
import { cached, clearDbCache } from "../lib/db-cache";
|
||||
import { DB_FILENAME, SELF_ID, kyselyDb, setDbLoaded, worker } from "./db";
|
||||
|
||||
export const loadDb = async (statements: string[], progressCallback?: (percentage: number) => void): Promise<void> => {
|
||||
// try to persist storage, https://web.dev/articles/persistent-storage#request_persistent_storage
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Kysely } from "kysely";
|
||||
import type { DB } from "./db-schema";
|
||||
import { OfficialWasmWorkerDialect } from "~/lib/kysely-official-wasm-worker";
|
||||
import WasmWorker from "./db-worker?worker";
|
||||
import { createSignal } from "solid-js";
|
||||
import { OfficialWasmWorkerDialect } from "~/lib/kysely-official-wasm-worker";
|
||||
import type { DB } from "./db-schema";
|
||||
import WasmWorker from "./db-worker?worker";
|
||||
|
||||
export const SELF_ID = 2;
|
||||
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
import type {
|
||||
DatabaseIntrospector,
|
||||
Dialect,
|
||||
DialectAdapter,
|
||||
Driver,
|
||||
Kysely,
|
||||
QueryCompiler,
|
||||
} from "kysely";
|
||||
import type { DatabaseIntrospector, Dialect, DialectAdapter, Driver, Kysely, QueryCompiler } from "kysely";
|
||||
import { SqliteAdapter, SqliteIntrospector, SqliteQueryCompiler } from "kysely";
|
||||
import { OfficialWasmWorkerDriver } from "./driver";
|
||||
import type { OfficialWasmWorkerDialectConfig } from "./type";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { getHourList, getMonthList, getWeekdayList } from "./date";
|
||||
import type { MessageOverview, MessageStats, Recipients } from "~/types";
|
||||
import { getHourList, getMonthList, getWeekdayList } from "./date";
|
||||
|
||||
const hourNames = getHourList();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { MessageOverview, MessageStats, Recipients } from "~/types";
|
||||
import { cached } from "./db-cache";
|
||||
import { getHourList, getMonthList, getWeekdayList } from "./date";
|
||||
import { cached } from "./db-cache";
|
||||
import MessageStatsWorker from "./messages-worker?worker";
|
||||
|
||||
export const hourNames = getHourList();
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
import { Suspense, type Component } from "solid-js";
|
||||
import { createAsync, type RoutePreloadFunc, type RouteSectionProps } from "@solidjs/router";
|
||||
|
||||
import { dmPartnerRecipientQuery, threadMostUsedWordsQuery, threadSentMessagesOverviewQuery, SELF_ID } from "~/db";
|
||||
import { getNameFromRecipient } from "~/lib/get-name-from-recipient";
|
||||
import { Heading } from "~/components/ui/heading";
|
||||
import { Grid } from "~/components/ui/grid";
|
||||
import { Title } from "@solidjs/meta";
|
||||
import { type RoutePreloadFunc, type RouteSectionProps, createAsync } from "@solidjs/router";
|
||||
import { type Component, Suspense } from "solid-js";
|
||||
import { Flex } from "~/components/ui/flex";
|
||||
import { Grid } from "~/components/ui/grid";
|
||||
import { Heading } from "~/components/ui/heading";
|
||||
import { SELF_ID, dmPartnerRecipientQuery, threadMostUsedWordsQuery, threadSentMessagesOverviewQuery } from "~/db";
|
||||
import { getNameFromRecipient } from "~/lib/get-name-from-recipient";
|
||||
import { createMessageStatsSources } from "~/lib/messages";
|
||||
import type { MessageOverview } from "~/types";
|
||||
import { DmMessagesPerDate } from "./dm-messages-per-date";
|
||||
import { DmOverview } from "./dm-overview";
|
||||
import { DmWordCloud } from "./dm-wordcloud";
|
||||
import { DmMessagesPerMonth } from "./dm-messages-per-month";
|
||||
import { DmMessagesPerDaytime } from "./dm-messages-per-daytime";
|
||||
import { DmMessagesPerMonth } from "./dm-messages-per-month";
|
||||
import { DmMessagesPerRecipient } from "./dm-messages-per-recipients";
|
||||
import { DmMessagesPerWeekday } from "./dm-messages-per-weekday";
|
||||
import type { MessageOverview } from "~/types";
|
||||
import { createMessageStatsSources } from "~/lib/messages";
|
||||
import { Flex } from "~/components/ui/flex";
|
||||
import { DmOverview } from "./dm-overview";
|
||||
import { DmWordCloud } from "./dm-wordcloud";
|
||||
|
||||
const getDmIdData = (dmId: number) => {
|
||||
// the other person in the chat with name and id
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Show, type Accessor, type Component } from "solid-js";
|
||||
import type { ChartData } from "chart.js";
|
||||
import { type Accessor, type Component, Show } from "solid-js";
|
||||
import { LineChart } from "~/components/ui/charts";
|
||||
import type { MessageStats, Recipients } from "~/types";
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Show, type Accessor, type Component } from "solid-js";
|
||||
import type { ChartData } from "chart.js";
|
||||
import { type Accessor, type Component, Show } from "solid-js";
|
||||
import { BarChart } from "~/components/ui/charts";
|
||||
import type { MessageStats, Recipients } from "~/types";
|
||||
import { hourNames } from "~/lib/messages";
|
||||
import type { MessageStats, Recipients } from "~/types";
|
||||
|
||||
export const DmMessagesPerDaytime: Component<{
|
||||
daytimeStats: MessageStats["daytime"] | undefined;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Show, type Accessor, type Component } from "solid-js";
|
||||
import type { ChartData } from "chart.js";
|
||||
import { type Accessor, type Component, Show } from "solid-js";
|
||||
import { RadarChart } from "~/components/ui/charts";
|
||||
import { monthNames } from "~/lib/messages";
|
||||
import type { MessageStats, Recipients } from "~/types";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Show, type Accessor, type Component } from "solid-js";
|
||||
import type { ChartData } from "chart.js";
|
||||
import { type Accessor, type Component, Show } from "solid-js";
|
||||
import { PieChart } from "~/components/ui/charts";
|
||||
import type { MessageStats, Recipients } from "~/types";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Show, type Accessor, type Component } from "solid-js";
|
||||
import type { ChartData } from "chart.js";
|
||||
import { type Accessor, type Component, Show } from "solid-js";
|
||||
import { RadarChart } from "~/components/ui/charts";
|
||||
import { weekdayNames } from "~/lib/messages";
|
||||
import type { MessageStats, Recipients } from "~/types";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Show, type Component } from "solid-js";
|
||||
import { CalendarArrowDown, CalendarArrowUp, CalendarClock, MessagesSquare } from "lucide-solid";
|
||||
import { type Component, Show } from "solid-js";
|
||||
import { Flex } from "~/components/ui/flex";
|
||||
import { Grid } from "~/components/ui/grid";
|
||||
import { CalendarArrowDown, CalendarArrowUp, CalendarClock, MessagesSquare } from "lucide-solid";
|
||||
import { getDistanceBetweenDatesInDays } from "~/lib/date";
|
||||
import type { MessageOverview } from "~/types";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { ChartData } from "chart.js";
|
||||
import { Show, type Accessor, type Component } from "solid-js";
|
||||
import { type Accessor, type Component, Show } from "solid-js";
|
||||
import { WordCloudChart } from "~/components/ui/charts";
|
||||
import type { threadMostUsedWordsQuery } from "~/db";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { Component } from "solid-js";
|
||||
import type { RouteSectionProps } from "@solidjs/router";
|
||||
import type { Component } from "solid-js";
|
||||
|
||||
export const GroupId: Component<RouteSectionProps> = (props) => {
|
||||
const groupId = () => Number(props.params.groupid);
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import type { RouteSectionProps } from "@solidjs/router";
|
||||
import { type Component, createResource, Show } from "solid-js";
|
||||
|
||||
import { allThreadsOverviewQuery, overallSentMessagesQuery, SELF_ID } from "~/db";
|
||||
|
||||
import { Title } from "@solidjs/meta";
|
||||
import type { RouteSectionProps } from "@solidjs/router";
|
||||
import { type Component, Show, createResource } from "solid-js";
|
||||
import { SELF_ID, allThreadsOverviewQuery, overallSentMessagesQuery } from "~/db";
|
||||
import { getNameFromRecipient } from "~/lib/get-name-from-recipient";
|
||||
import { OverviewTable, type RoomOverview } from "./overview-table";
|
||||
|
||||
|
|
|
@ -1,32 +1,29 @@
|
|||
import { type Component, createSignal, For, Match, Show, Switch } from "solid-js";
|
||||
import { useNavigate, usePreloadRoute } from "@solidjs/router";
|
||||
|
||||
import {
|
||||
type ColumnFiltersState,
|
||||
type FilterFn,
|
||||
type SortDirection,
|
||||
type SortingState,
|
||||
createColumnHelper,
|
||||
createSolidTable,
|
||||
type FilterFn,
|
||||
flexRender,
|
||||
getCoreRowModel,
|
||||
getFilteredRowModel,
|
||||
getPaginationRowModel,
|
||||
getSortedRowModel,
|
||||
type SortDirection,
|
||||
type SortingState,
|
||||
} from "@tanstack/solid-table";
|
||||
import { intlFormatDistance } from "date-fns";
|
||||
import { ArrowDown, ArrowUp, ArrowUpDown } from "lucide-solid";
|
||||
|
||||
import { type Component, For, Match, Show, Switch, createSignal } from "solid-js";
|
||||
import { Badge } from "~/components/ui/badge";
|
||||
import { Button } from "~/components/ui/button";
|
||||
import { Checkbox } from "~/components/ui/checkbox";
|
||||
import { Flex } from "~/components/ui/flex";
|
||||
import { Label } from "~/components/ui/label";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "~/components/ui/table";
|
||||
import { TextField, TextFieldInput } from "~/components/ui/text-field";
|
||||
|
||||
import { cn } from "~/lib/utils";
|
||||
import { Flex } from "~/components/ui/flex";
|
||||
import { dbLoaded, threadSentMessagesOverviewQuery } from "~/db";
|
||||
import { cn } from "~/lib/utils";
|
||||
|
||||
export interface RoomOverview {
|
||||
threadId: number;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import path from "path";
|
||||
import tailwind from "@tailwindcss/vite";
|
||||
import { defineConfig } from "vite";
|
||||
import solidPlugin from "vite-plugin-solid";
|
||||
import wasm from "vite-plugin-wasm";
|
||||
import tailwind from "@tailwindcss/vite";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [solidPlugin(), wasm(), tailwind()],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue