tpmjs/packages/ui/tsup.config.ts
Ajax Davis a6753cd8e6 feat: add light/dark theme system and full homepage with comprehensive UI components
Implement theme system:
- Add next-themes for theme management with light mode as default
- Swap CSS variable definitions in globals.css (light in :root, dark in .dark class)
- Create ThemeProvider component wrapping next-themes
- Create ThemeToggle component with sun/moon icons
- Update root layout with ThemeProvider

Build full homepage:
- Add Header component with navigation and theme toggle
- Create hero section with gradient background and search
- Add Featured Tools section with 6 tool cards (icons, badges, usage stats)
- Add Browse by Category section with 12 colored category tiles
- Add Platform Statistics section with 4 metric cards
- Add footer with copyright and links
- Create homePageData.ts with comprehensive mock data

Add Storybook stories:
- Icon.stories.ts (AllIcons, AllSizes, WithColors)
- Badge.stories.ts (Default, AllVariants, AllSizes, WithLongText)
- Input.stories.ts (Default, WithLabel, AllStates, AllSizes, PasswordInput)
- ProgressBar.stories.ts (Default, AllVariants, AllSizes, WithLabel, edge cases)
- CodeBlock.stories.ts (Default, multiple languages, LongCode)
- Tabs.stories.ts (Default, AllSizes, WithCounts, ManyTabs)

Fix production build issues:
- Export IconName type from Icon.ts
- Add sun and moon icons to icons.ts
- Fix Icon prop naming (icon not name)
- Fix Icon size constraints (remove xl, use lg)
- Update ThemeProvider types using ComponentProps
- Add explicit return types where needed
- Remove unused imports
- Replace forEach with for...of in variants system
- Fix template literals in storybook stories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 01:29:28 +10:00

43 lines
1 KiB
TypeScript

import path from "node:path";
import { glob } from "glob";
import { defineConfig } from "tsup";
/**
* Auto-discover all component entry points
* Looks for src/ComponentName/ComponentName.ts files where the folder name matches the file name
*/
const allFiles = glob.sync("src/**/[A-Z]*.ts", {
ignore: [
"**/*.test.ts",
"**/*.stories.ts",
"**/types.ts",
"**/tokens.ts",
"**/variants.ts",
"**/index.ts",
"src/test-setup.ts",
"src/tokens/**",
"src/system/**",
],
});
// Filter to only include files where the folder name matches the file name
// e.g., src/Button/Button.ts is included, but src/Button/helpers.ts is not
const entries = allFiles.filter((file) => {
const dir = path.dirname(file);
const folderName = path.basename(dir);
const fileName = path.basename(file, ".ts");
return folderName === fileName;
});
export default defineConfig({
entry: entries,
format: ["esm"],
dts: true,
clean: true,
treeshake: true,
splitting: false,
external: ["react", "react-dom"],
esbuildOptions(options) {
options.jsx = "automatic";
},
});