Skip to content

Commit

Permalink
build(web): update dependencies and migrate tailwindcss config
Browse files Browse the repository at this point in the history
  • Loading branch information
rocka committed Dec 22, 2024
1 parent 3527ae8 commit 5c14b85
Show file tree
Hide file tree
Showing 11 changed files with 2,575 additions and 1,034 deletions.
8 changes: 0 additions & 8 deletions docs/.vitepress/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,4 @@ export default defineConfig({
root: en,
zh,
},

vite: {
css: {
postcss: {
// don't need postcss in docs
}
}
}
});
3,511 changes: 2,536 additions & 975 deletions package-lock.json

Large diffs are not rendered by default.

37 changes: 15 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,25 @@
},
"dependencies": {
"@binbat/whip-whep": "^1.1.1-sdp-trickle-throw",
"@nuintun/qrcode": "^4.1.6",
"@heroicons/react": "^2.1.5",
"preact": "^10.24.3",
"@nuintun/qrcode": "^4.1.12",
"@heroicons/react": "^2.2.0",
"preact": "^10.25.3",
"react-daisyui": "^5.0.5",
"typescript-event-target": "^1.1.1",
"wretch": "^2.11.0"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
"@preact/preset-vite": "^2.9.1",
"@stylistic/eslint-plugin-js": "^2.10.1",
"@types/node": "^22.8.6",
"daisyui": "^4.12.14",
"eslint": "^9.13.0",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3",
"typescript-eslint": "^8.12.2",
"vite": "^5.4.10",
"vitepress": "^1.4.3",
"vitest": "^2.1.4"
},
"postcss": {
"plugins": {
"tailwindcss": {
"config": "./web/tailwind.config.ts"
}
}
"@eslint/js": "^9.17.0",
"@preact/preset-vite": "^2.9.3",
"@stylistic/eslint-plugin-js": "^2.12.1",
"@types/node": "^22.10.2",
"daisyui": "^4.12.22",
"eslint": "^9.17.0",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"typescript-eslint": "^8.18.1",
"vite": "^6.0.5",
"vitepress": "^1.5.0",
"vitest": "^2.1.8"
}
}
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
},
"include": ["web"],
"exclude": [
"./web/**/vite.config.ts",
"./web/tailwind.config.ts"
"./web/**/vite.config.ts"
],
"references": [{ "path": "./tsconfig.node.json" }]
}
3 changes: 1 addition & 2 deletions tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"strict": true
},
"include": [
"./web/**/vite.config.ts",
"./web/tailwind.config.ts"
"./web/**/vite.config.ts"
]
}
3 changes: 1 addition & 2 deletions web/liveion/components/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export function Login({ show, onSuccess }: LoginProps) {
<span>Token</span>
<input class="grow" value={token} onInput={e => setToken(e.currentTarget?.value)} />
</label>
<Button type="submit" color="primary" className="w-full text-base" disabled={loading}>
{/* @ts-expect-error -- size */}
<Button color="primary" className="w-full text-base" disabled={loading}>
{loading ? <Loading size="sm" /> : null}
<span>Login</span>
</Button>
Expand Down
4 changes: 1 addition & 3 deletions web/liveman/components/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export function Login({ show, onSuccess }: LoginProps) {
<Modal.Header className="mb-2">
<h3 className="font-bold">Authorization Required</h3>
</Modal.Header>
{/* @ts-expect-error -- size */}
<Tabs variant="bordered" size="lg" className="my-4">
{Object.values(AuthorizeType).map(t =>
<Tabs.Tab className="text-base" active={t === authType} onClick={() => setAuthType(t)}>{t}</Tabs.Tab>
Expand All @@ -107,8 +106,7 @@ export function Login({ show, onSuccess }: LoginProps) {
{authType === AuthorizeType.Password ? [usernameInput, passwordInput]
: authType === AuthorizeType.Token ? tokenInput
: null}
<Button type="submit" color="primary" className="w-full text-base" disabled={loading}>
{/* @ts-expect-error -- size */}
<Button color="primary" className="w-full text-base" disabled={loading}>
{loading ? <Loading size="sm" /> : null}
<span>Login</span>
</Button>
Expand Down
1 change: 0 additions & 1 deletion web/liveman/components/nodes-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ function NodeStrategyLabel({ strategy }: NodeStrategyLabelProps) {
<EllipsisHorizontalIcon className="size-4" />
</Dropdown.Toggle>
<Dropdown.Menu className="z-10 mx-[-1rem]">
{/* @ts-expect-error -- size */}
<Table size="xs">
<Table.Body>
{entries.map(([k, v]) =>
Expand Down
4 changes: 2 additions & 2 deletions web/shared/tools/debugger/compat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default function DebuggerCompat() {

<section>
<h3>WHIP Video:</h3>
<debug-player controls autoplay id="whip-video-player"></debug-player>
<debug-player id="whip-video-player"></debug-player>
</section>
<section>
<data-channel id="whip-datachannel"></data-channel>
Expand Down Expand Up @@ -202,7 +202,7 @@ export default function DebuggerCompat() {

<section>
<h3>WHEP Video:</h3>
<debug-player controls autoplay id="whep-video-player"></debug-player>
<debug-player id="whep-video-player"></debug-player>
</section>
<section>
<data-channel id="whep-datachannel"></data-channel>
Expand Down
17 changes: 0 additions & 17 deletions web/tailwind.config.ts

This file was deleted.

18 changes: 18 additions & 0 deletions web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { resolve } from 'node:path';

import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import tailwindcss from 'tailwindcss';
import daisyui from 'daisyui';

export const ProjectRoot = resolve(import.meta.dirname, '..');

Expand All @@ -21,5 +23,21 @@ export default defineConfig({
alias: {
'@': resolve(ProjectRoot, 'web')
}
},
css: {
postcss: {
plugins: [
tailwindcss({
content: [
'node_modules/daisyui/dist/**/*.js',
'node_modules/react-daisyui/dist/**/*.js',
'web/**/*.{html,tsx}'
].map(p => resolve(ProjectRoot, p)),
plugins: [
daisyui
],
})
]
}
}
});

0 comments on commit 5c14b85

Please sign in to comment.