Initial screen starter scaffold

This commit is contained in:
zhougf committed 2026-05-29 00:26:43 +08:00
commit d136b9dddc
49 files changed
+2966

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
{
"name": "@dev-screen-starter/debug",
"version": "0.1.0",
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
},
"scripts": {
"build": "tsc --noEmit",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"react": "^19.1.1"
},
"devDependencies": {
"@types/react": "^19.1.16",
"typescript": "^5.9.2"
}
}
+20
View File
@@ -0,0 +1,20 @@
type DebugBadgeProps = {
enabled?: boolean
scale?: number
updatedAt?: string
}
const defaultEnabled = typeof location !== 'undefined' && location.hostname === 'localhost'
export function DebugBadge({ enabled = defaultEnabled, scale, updatedAt }: DebugBadgeProps) {
if (!enabled) {
return null
}
return (
<aside className="debug-badge">
{scale ? <span>scale {scale.toFixed(3)}</span> : null}
{updatedAt ? <span>updated {new Date(updatedAt).toLocaleTimeString()}</span> : null}
</aside>
)
}
+1
View File
@@ -0,0 +1 @@
export * from './DebugBadge'
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"jsx": "react-jsx"
},
"include": ["src"]
}