mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-20 23:16:48 +00:00
refactor: migrate to Tailwind CSS v4 and TypeScript
Replaces PostCSS-based styling with Tailwind CSS v4 via Vite plugin Converts all .js files to .ts with proper type annotations Adds comprehensive type definitions for Telegram data structures Extracts reusable UI components and standardizes class utilities Improves maintainability by eliminating custom CSS in favor of Tailwind utilities and design tokens Enhances type safety across Telegram parsing, env access, and API routes Centralizes agent guidelines in AGENTS.md following repository standards Upgrades iconography to astro-icon with Remix Icon integration Expands accessible HTML patterns including ARIA labels, semantic navigation, and keyboard interaction support Refactors static proxy logic into shared utility functions Consolidates modal and image preview markup for consistency
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import { GET } from '../../src/pages/static/[...url]'
|
||||
|
||||
export const config = {
|
||||
runtime: 'edge',
|
||||
}
|
||||
|
||||
export default function handler(request) {
|
||||
const url = request.url?.split('/static/')?.[1]
|
||||
|
||||
if (!url) {
|
||||
return new Response('Not Found', { status: 404 })
|
||||
}
|
||||
|
||||
const target = new URL(url)
|
||||
target.searchParams.delete('path')
|
||||
|
||||
return GET({
|
||||
request,
|
||||
params: {
|
||||
url: target.origin + target.pathname,
|
||||
},
|
||||
url: {
|
||||
search: target.search,
|
||||
},
|
||||
})
|
||||
}
|
||||
25
api/static/index.ts
Normal file
25
api/static/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { createStaticProxyResponse } from '../../src/lib/static-proxy'
|
||||
|
||||
export const config = {
|
||||
runtime: 'edge',
|
||||
}
|
||||
|
||||
export default async function handler(request: Request): Promise<Response> {
|
||||
try {
|
||||
const urlStr = request.url?.split('/static/')?.[1]
|
||||
|
||||
if (!urlStr) {
|
||||
return new Response('Not Found', { status: 404 })
|
||||
}
|
||||
|
||||
const parsed = new URL(urlStr)
|
||||
parsed.searchParams.delete('path')
|
||||
|
||||
const rawTarget = parsed.origin + parsed.pathname + parsed.search
|
||||
return await createStaticProxyResponse(request, rawTarget)
|
||||
}
|
||||
catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error)
|
||||
return new Response(message, { status: 500 })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user