Skip to content

Commit 22dab61

Browse files
committed
chore: add import sorting
1 parent cda13df commit 22dab61

28 files changed

+258
-106
lines changed

.prettierrc

+20-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
{
2-
"trailingComma": "all",
3-
"tabWidth": 2,
4-
"printWidth": 100,
5-
"semi": false,
6-
"singleQuote": true,
7-
"useTabs": false,
8-
"arrowParens": "avoid",
9-
"bracketSpacing": true
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"printWidth": 100,
5+
"semi": false,
6+
"singleQuote": true,
7+
"useTabs": false,
8+
"arrowParens": "avoid",
9+
"bracketSpacing": true,
10+
"plugins": ["@trivago/prettier-plugin-sort-imports"],
11+
"importOrder": [
12+
"^solid-js(.*)$",
13+
"^solid-(.*)$",
14+
"^shiki(.*)$",
15+
"^~/components/ui/(.*)$",
16+
"^~/(.*)$",
17+
"^[./]"
18+
],
19+
"importOrderGroupNamespaceSpecifiers": true,
20+
"importOrderSeparation": true,
21+
"importOrderSortSpecifiers": true
1022
}

playgrounds/app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"node": ">=18"
6060
},
6161
"devDependencies": {
62+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
6263
"@types/jsonwebtoken": "^9.0.7",
6364
"drizzle-kit": "^0.26.2",
6465
"tsx": "^4.19.1"

playgrounds/app/src/app.css

+1-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@
102102

103103
body {
104104
@apply bg-background text-foreground;
105-
font-feature-settings:
106-
'rlig' 1,
107-
'calt' 1;
105+
font-feature-settings: 'rlig' 1, 'calt' 1;
108106
}
109107
}
110108

playgrounds/app/src/app.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { Suspense } from 'solid-js'
1+
import '@fontsource/bungee-inline'
2+
import '@fontsource/roboto'
23
import { Router } from '@solidjs/router'
34
import { FileRoutes } from '@solidjs/start/router'
5+
6+
import { Suspense } from 'solid-js'
7+
48
import { Toaster } from 'solid-sonner'
9+
510
import Header from '~/components/Header'
6-
import Footer from './components/Footer'
7-
import '@fontsource/bungee-inline'
8-
import '@fontsource/roboto'
11+
912
import './app.css'
1013

1114
export default function App() {

playgrounds/app/src/components/Editor.tsx

+52-57
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,57 @@
1-
import { interpolate, interpolateColors, Easing } from 'remotion'
1+
import wasmURL from '@ffmpeg/core/wasm?url'
2+
import coreURL from '@ffmpeg/core?url'
3+
import { FFmpeg } from '@ffmpeg/ffmpeg'
4+
import { fetchFile, toBlobURL } from '@ffmpeg/util'
5+
import { useNavigate } from '@solidjs/router'
6+
import clsx from 'clsx'
7+
import { openDB } from 'idb'
28
import { encode } from 'modern-gif'
39
import workerUrl from 'modern-gif/worker?url'
10+
import { Easing, interpolate, interpolateColors } from 'remotion'
11+
12+
import { Show, createEffect, createMemo, createSignal, onCleanup, onMount } from 'solid-js'
13+
import { SetStoreFunction } from 'solid-js/store'
14+
15+
import { FaSolidCaretDown, FaSolidCaretUp } from 'solid-icons/fa'
16+
import { HiOutlineCog } from 'solid-icons/hi'
17+
import { toast } from 'solid-sonner'
18+
19+
import type { HighlighterGeneric } from 'shiki'
20+
import { bundledLanguages, bundledThemes, createHighlighter } from 'shiki'
421
import 'shiki-magic-move/dist/style.css'
22+
import { ShikiMagicMove } from 'shiki-magic-move/solid'
23+
import { MagicMoveElement } from 'shiki-magic-move/types'
24+
525
import {
6-
ComboboxItem,
7-
ComboboxItemLabel,
8-
ComboboxItemIndicator,
26+
Accordion,
27+
AccordionContent,
28+
AccordionItem,
29+
AccordionTrigger,
30+
} from '~/components/ui/accordion'
31+
import { Button } from '~/components/ui/button'
32+
import { Checkbox } from '~/components/ui/checkbox'
33+
import { Collapsible, CollapsibleContent } from '~/components/ui/collapsible'
34+
import {
35+
Combobox,
36+
ComboboxContent,
937
ComboboxControl,
1038
ComboboxInput,
39+
ComboboxItem,
40+
ComboboxItemIndicator,
41+
ComboboxItemLabel,
1142
ComboboxTrigger,
12-
ComboboxContent,
13-
Combobox,
1443
} from '~/components/ui/combobox'
15-
import { Button } from '~/components/ui/button'
16-
import { Tabs, TabsContent, TabsList, TabsTrigger } from '~/components/ui/tabs'
17-
import { TextField, TextFieldInput } from '~/components/ui/text-field'
18-
import { MagicMoveElement } from 'shiki-magic-move/types'
44+
import { Dialog, DialogContent, DialogFooter } from '~/components/ui/dialog'
45+
import { Label } from '~/components/ui/label'
46+
import { ProgressCircle } from '~/components/ui/progress-circle'
47+
import {
48+
Select,
49+
SelectContent,
50+
SelectItem,
51+
SelectTrigger,
52+
SelectValue,
53+
} from '~/components/ui/select'
54+
import { Separator } from '~/components/ui/separator'
1955
import {
2056
Slider,
2157
SliderFill,
@@ -24,55 +60,14 @@ import {
2460
SliderTrack,
2561
SliderValueLabel,
2662
} from '~/components/ui/slider'
27-
import clsx from 'clsx'
28-
import { Checkbox } from '~/components/ui/checkbox'
29-
import { Label } from '~/components/ui/label'
30-
import {
31-
Dialog,
32-
DialogContent,
33-
DialogDescription,
34-
DialogFooter,
35-
DialogHeader,
36-
DialogTitle,
37-
} from '~/components/ui/dialog'
38-
import {
39-
createEffect,
40-
createMemo,
41-
createResource,
42-
createSignal,
43-
onCleanup,
44-
Setter,
45-
Show,
46-
onMount,
47-
} from 'solid-js'
48-
import type { HighlighterGeneric } from 'shiki'
49-
import { createHighlighter, bundledThemes, bundledLanguages } from 'shiki'
50-
import { ShikiMagicMove } from 'shiki-magic-move/solid'
51-
import { AnimationFrameConfig, SnippetSettings } from '~/types'
52-
import { authFetch } from '~/lib/utils'
53-
import { useNavigate } from '@solidjs/router'
63+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '~/components/ui/tabs'
64+
import { TextField, TextFieldInput } from '~/components/ui/text-field'
65+
5466
import { authToken } from '~/lib/store'
55-
import { toast } from 'solid-sonner'
56-
import { Separator } from './ui/separator'
57-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select'
58-
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './ui/accordion'
59-
import {
60-
DropdownMenu,
61-
DropdownMenuContent,
62-
DropdownMenuItem,
63-
DropdownMenuTrigger,
64-
} from './ui/dropdown-menu'
67+
import { authFetch } from '~/lib/utils'
68+
import { AnimationFrameConfig, SnippetSettings } from '~/types'
69+
6570
import { ShikiCodeBlock } from './ShikiCodeBlock'
66-
import { SetStoreFunction } from 'solid-js/store'
67-
import { FFmpeg } from '@ffmpeg/ffmpeg'
68-
import { fetchFile, toBlobURL } from '@ffmpeg/util'
69-
import coreURL from '@ffmpeg/core?url'
70-
import wasmURL from '@ffmpeg/core/wasm?url'
71-
import { openDB } from 'idb'
72-
import { ProgressCircle } from './ui/progress-circle'
73-
import { Collapsible, CollapsibleContent } from './ui/collapsible'
74-
import { FaSolidCaretDown, FaSolidCaretUp } from 'solid-icons/fa'
75-
import { HiOutlineCog } from 'solid-icons/hi'
7671

7772
const animationSeconds = 1
7873
const animationFPS = 30

playgrounds/app/src/components/Footer.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { A } from '@solidjs/router'
2+
23
import { linkStyles } from '~/lib/styles'
34

45
export default function Footer() {

playgrounds/app/src/components/Header.tsx

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
1+
import { makePersisted } from '@solid-primitives/storage'
12
import { A } from '@solidjs/router'
2-
import { Button } from './ui/button'
3+
4+
import { Show, createSignal } from 'solid-js'
5+
6+
import { FaSolidMoon, FaSolidSun } from 'solid-icons/fa'
37
import { OcMarkgithub2, OcQuestion2 } from 'solid-icons/oc'
4-
import { FaSolidSun, FaSolidMoon } from 'solid-icons/fa'
5-
import { createThemeSwitcher } from '~/components/theme-switcher'
6-
import { authToken } from '~/lib/store'
7-
import { createSignal, Show } from 'solid-js'
8-
import {
9-
DropdownMenu,
10-
DropdownMenuContent,
11-
DropdownMenuItem,
12-
DropdownMenuTrigger,
13-
} from '~/components/ui/dropdown-menu'
14-
import { user } from '~/lib/store'
158
import { TbCode, TbDoorExit, TbQuestionMark } from 'solid-icons/tb'
16-
import { linkStyles } from '~/lib/styles'
9+
10+
import { Button } from '~/components/ui/button'
1711
import {
1812
Dialog,
1913
DialogContent,
2014
DialogDescription,
21-
DialogFooter,
2215
DialogHeader,
2316
DialogTitle,
24-
DialogTrigger,
2517
} from '~/components/ui/dialog'
26-
import { makePersisted } from '@solid-primitives/storage'
18+
import {
19+
DropdownMenu,
20+
DropdownMenuContent,
21+
DropdownMenuItem,
22+
DropdownMenuTrigger,
23+
} from '~/components/ui/dropdown-menu'
24+
25+
import { createThemeSwitcher } from '~/components/theme-switcher'
26+
import { authToken } from '~/lib/store'
27+
import { user } from '~/lib/store'
28+
import { linkStyles } from '~/lib/styles'
2729

2830
export default function Header() {
2931
const [isShowingHelpDialog, setIsShowingHelpDialog] = makePersisted(createSignal(true), {

playgrounds/app/src/components/ShikiCodeBlock.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { createSignal, onMount, createEffect } from 'solid-js'
1+
import { createEffect, createSignal, onMount } from 'solid-js'
2+
23
import { createHighlighter } from 'shiki'
3-
import { autoload, hookClosingPairs, hookTab, ShikiCode } from 'shikicode/plugins'
44
import { shikiCode } from 'shikicode'
5+
import { ShikiCode, autoload, hookClosingPairs, hookTab } from 'shikicode/plugins'
56

67
import { cn } from '~/lib/utils'
78

playgrounds/app/src/components/SnippetPreview.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Highlighter } from 'shiki'
22
import { ShikiMagicMove } from 'shiki-magic-move/solid'
3+
34
import { Snippet } from '~/types'
45

56
interface SnippetPreviewProps {

playgrounds/app/src/components/theme-switcher.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { createSignal, createEffect } from 'solid-js'
21
import { makePersisted } from '@solid-primitives/storage'
32

3+
import { createEffect, createSignal } from 'solid-js'
4+
45
export function createThemeSwitcher() {
56
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)')
67
const [isDarkMode, setIsDarkMode] = makePersisted(createSignal(prefersDarkScheme.matches), {

playgrounds/app/src/db/client.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dotenv/config'
22
import { drizzle } from 'drizzle-orm/libsql'
3+
34
import { schema } from './schema'
45

56
export const db = drizzle({

playgrounds/app/src/db/schema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { int, sqliteTable, text, real } from 'drizzle-orm/sqlite-core'
1+
import { int, real, sqliteTable, text } from 'drizzle-orm/sqlite-core'
22

33
export const usersTable = sqliteTable('users_table', {
44
id: text().primaryKey(),

playgrounds/app/src/entry-client.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// @refresh reload
2-
import { mount, StartClient } from '@solidjs/start/client'
2+
import { StartClient, mount } from '@solidjs/start/client'
33

44
mount(() => <StartClient />, document.getElementById('app')!)

playgrounds/app/src/entry-server.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @refresh reload
2-
import { createHandler, StartServer } from '@solidjs/start/server'
2+
import { StartServer, createHandler } from '@solidjs/start/server'
33

44
export default createHandler(() => (
55
<StartServer

playgrounds/app/src/lib/ids.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
import { customAlphabet } from 'nanoid'
2+
23
export const customNanoid = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 24)

playgrounds/app/src/lib/middleware.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import type { APIEvent } from '@solidjs/start/server'
2+
import { eq } from 'drizzle-orm'
3+
4+
import { db } from '~/db/client'
15
import { usersTable } from '~/db/schema'
6+
27
import { decodeToken } from './jwt'
3-
import { db } from '~/db/client'
4-
import { eq } from 'drizzle-orm'
5-
import type { APIEvent } from '@solidjs/start/server'
68

79
export async function getUser({ request }: APIEvent) {
810
const token = request.headers.get('Authorization')?.replace('Bearer ', '')

playgrounds/app/src/lib/store.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { makePersisted } from '@solid-primitives/storage'
2+
23
import { createSignal } from 'solid-js'
4+
35
import { User } from '~/types'
46

57
export const [authToken, setAuthToken] = makePersisted(createSignal(''), {

playgrounds/app/src/lib/utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type ClassValue, clsx } from 'clsx'
22
import { twMerge } from 'tailwind-merge'
3+
34
import { authToken } from './store'
45

56
export function cn(...inputs: ClassValue[]) {

playgrounds/app/src/routes/about.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { A } from '@solidjs/router'
2+
23
import { createResource } from 'solid-js'
4+
35
import { linkStyles } from '~/lib/styles'
46
import { getGithubContributors } from '~/lib/utils'
57

playgrounds/app/src/routes/api/oauth.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { APIEvent } from '@solidjs/start/server'
22
import 'dotenv/config'
33
import { eq } from 'drizzle-orm'
4+
45
import { db } from '~/db/client'
56
import { usersTable } from '~/db/schema'
67
import { customNanoid } from '~/lib/ids'

playgrounds/app/src/routes/api/snippets.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import type { APIEvent } from '@solidjs/start/server'
22
import { eq } from 'drizzle-orm'
3+
34
import { db } from '~/db/client'
45
import { snippetsTable } from '~/db/schema'
6+
import { customNanoid } from '~/lib/ids'
57
import { getUser } from '~/lib/middleware'
68
import { snippetValidator } from '~/lib/validators'
7-
import { customNanoid } from '~/lib/ids'
89

910
export async function GET(event: APIEvent): Promise<Response> {
1011
const user = await getUser(event)

playgrounds/app/src/routes/api/snippets/[snippetId].ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { APIEvent } from '@solidjs/start/server'
22
import { and, eq } from 'drizzle-orm'
3+
34
import { db } from '~/db/client'
45
import { snippetsTable } from '~/db/schema'
56
import { getUser } from '~/lib/middleware'

playgrounds/app/src/routes/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { createSignal } from 'solid-js'
21
import { makePersisted } from '@solid-primitives/storage'
2+
3+
import { createStore } from 'solid-js/store'
4+
35
import Editor from '~/components/Editor'
46
import { SnippetSettings } from '~/types'
5-
import { createStore } from 'solid-js/store'
67

78
const left = `
89
import { render } from "solid-js/web";

playgrounds/app/src/routes/logged-out.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
import { Button } from '~/components/ui/button'
2-
import { OcMarkgithub2 } from 'solid-icons/oc'
31
import { onMount } from 'solid-js'
2+
3+
import { OcMarkgithub2 } from 'solid-icons/oc'
4+
5+
import { Button } from '~/components/ui/button'
6+
47
import { setAuthToken } from '~/lib/store'
58

69
export default function LoggedOut() {

0 commit comments

Comments
 (0)