Compare commits

..

No commits in common. "1e013287cf6188dd0c274409ebc07536dc94b757" and "992bddc7692f152dc3efeb2505eff82c9be82f2b" have entirely different histories.

2 changed files with 2 additions and 17 deletions

View File

@ -1,16 +1,7 @@
{
"name": "forge",
"version": "0.1.0",
"module": "src/index.ts",
"type": "module",
"main": "src/index.tsx",
"module": "src/index.tsx",
"types": "src/index.tsx",
"exports": {
".": {
"import": "./src/index.tsx",
"types": "./src/index.tsx"
}
},
"scripts": {
"dev": "bun build:spa && bun run --hot server.tsx",
"test": "bun test",

View File

@ -10,8 +10,6 @@ let registeredThemeKeys: Set<string> = new Set()
// Clear all registered styles
export function clearStyles() {
for (const key in styles) delete styles[key]
for (const key in themes) delete themes[key]
registeredThemeKeys.clear()
}
// Register a theme with CSS custom properties
@ -288,11 +286,7 @@ export function define(nameOrDef: string | TagDef, defIfNamed?: TagDef) {
const def = defIfNamed ?? nameOrDef as TagDef
const name = defIfNamed ? (nameOrDef as string) : anonName(def)
// Clear any existing styles for this component (supports HMR/hot reload)
for (const key in styles) {
if (key === name || key.startsWith(`${name}_`) || key.startsWith(`${name}.`) || key.startsWith(`${name}:`))
delete styles[key]
}
if (styles[name]) throw `${name} is already defined! Must use unique names.`
registerStyles(name, def)
return (props: Record<string, any>) => {