- Convert Button, Card, CodeBlock, Container, Input, Label, ProgressBar, Tabs, and Header components to JSX - Convert all test files to JSX syntax with direct element rendering - Replace createElement calls with cleaner JSX syntax for better readability - Update tsup config to handle .tsx files - Maintain all functionality, accessibility, and TypeScript types - All 370 tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.1 KiB
TypeScript
44 lines
1.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.tsx files where the folder name matches the file name
|
|
*/
|
|
const allFiles = glob.sync("src/**/[A-Z]*.{ts,tsx}", {
|
|
ignore: [
|
|
"**/*.test.ts",
|
|
"**/*.test.tsx",
|
|
"**/*.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.tsx 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).replace(/\.(ts|tsx)$/, "");
|
|
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";
|
|
},
|
|
});
|