- 🔁 Dual CLI Entry Points: The project has two different CLI implementations (
index.jsandbin/cli.js) with conflicting logic.index.jsusescreate-react-appwhilebin/cli.jsusescreate-vite. - 🧠 Language Selection Inconsistency: The CLI asks for JavaScript or TypeScript, but the implementation in
index.jsalways uses--template typescriptregardless of user choice. - 📁 Template System Confusion: The project has both
pre-files/(static templates) andsrc/templates/(dynamic templates), creating confusion about which system is active.
- 🎨 Styling Selection Broken: In
index.js,setupSass()is called unconditionally, ignoring user's styling choice. Thesrc/setup/styles.jshas proper logic but isn't being used. - 🧩 CSS Modules Logic Missing: The prompts ask about CSS Modules/styled-components/emotion but there's no implementation for this choice.
- 🎯 UI Framework Integration: UI framework selection works in
src/setup/dependencies.jsbut the actual component setup is missing.
- 🧪 Testing Framework Setup Incomplete:
src/setup/testing.jsonly supports Jest and Mocha, but the mainindex.jshas hardcoded test scripts that don't match. - 🧩 Test Package Installation: The implementation always installs all test-related packages regardless of user selection.
- 🧪 Limited Testing Options: No support for Cypress, Playwright, or Vitest as mentioned in original TODO.
- 🔁 Redux TypeScript Support:
src/setup/redux.jshas proper TypeScript logic butindex.jsdoesn't use it. Store files are always created in JavaScript. - 🧬 Store File Language Mismatch: Store files are created with wrong extensions regardless of selected language.
- 🐚 Husky Configuration Incomplete:
src/setup/husky.jssets up pre-commit hooks butindex.jsdeletes them withdeletePreCommitHook(). - 🔧 Git Setup Logic:
src/setup/gitInit.jsexists but isn't being used in the main flow.
- 📦 Dependency Installation Logic:
src/setup/dependencies.jsandsrc/setup/devDependencies.jsexist but aren't used inindex.js. - 🔄 Package.json Scripts: The main
index.jshas hardcoded package.json updates that conflict with the modular approach.
- 📁 Atomic Design Implementation:
src/templates/atomicStructure.jsexists but the main flow doesn't use it properly. - 🧩 Module Federation:
src/setup/moduleFederation.jsexists but integration is incomplete. - ❌ React Native Support: No detection or blocking for React Native projects as mentioned in original TODO.
- 🔧 Consolidate CLI Entry Points: Choose between
index.js(CRA) orbin/cli.js(Vite) and remove the unused one. Vite is recommended for modern React development. - 🔧 Fix Language Selection: Ensure TypeScript/JavaScript choice is properly passed to the template system and respected throughout the setup.
- 🔧 Unify Template System: Decide between static (
pre-files/) vs dynamic (src/templates/) templates and implement consistently. - 🧼 Replace Legacy Commands: Update package.json scripts to use Vite instead of Webpack:
npm run start→vitenpm run build→vite build
- 🔧 TypeScript Core Logic: Extract core CLI logic into TypeScript for better typing, editor support, and DX while keeping entrypoints in JS for simplicity and npx support.
- 🔧 Multi-Language Plugin Support: Allow plugins or commands to be authored in other languages (e.g., JSON/YAML configs or .ts generators).
- ⚡ Fast CLI Performance: Ensure the CLI runs fast even without a build step (no ts-node dependency unless explicitly supported).
- 🎯 Internal TS, External JS: Keep CLI entrypoints in JS for simplicity + npx support, but use internal core logic in TS for maintainability.
- 🎨 Implement CSS Modules Logic: Add support for CSS Modules, styled-components, and emotion based on user selection.
- 🎯 UI Framework Integration: Create actual component templates and setup for Ant Design, Material UI, Chakra UI, and Radix UI.
- 🎨 Dynamic Style Generation: Generate appropriate style files and imports based on user's styling choice.
- 🎨 Additional UI Libraries: Add support for:
- ✅ Tailwind CSS
- ✅ ShadCN UI
- ✅ TanStack Router
- ✅ TanStack Query
- 🔐 Authentication Setup: Add auth flag or plugin (e.g., setup NextAuth/Auth0 template)
- 📚 Starter Templates: Create example templates under
examples/:crafter-blog- Blog templatecrafter-dashboard- Dashboard templatecrafter-admin- Admin panel template
- 🧪 Testing Framework Separation: Split testing choices into:
- ✅ Unit Testing: Jest, Vitest
- ✅ E2E Testing: Cypress, Playwright
- ✅ None: Allow skipping testing setup entirely
- 🧪 Test Configuration: Generate proper Jest/Vitest config files and sample tests.
- 🧪 Selective Package Installation: Only install test packages for the selected framework.
- 🧪 Sample Component Tests: Add sample tests for generated components to demonstrate testing patterns.
- 🔁 Fix Redux TypeScript Support: Ensure Redux store and slices are properly typed when TypeScript is selected.
- 🧬 Language-Aware File Generation: Generate store files with correct extensions (.ts/.js) based on language choice.
- 🗃️ Enhanced State Setup: Add sample reducers, actions, and selectors for Redux/Zustand.
- 🐚 Complete Husky Setup: Fix pre-commit and pre-push hooks configuration.
- 🔧 Git Integration: Properly integrate
src/setup/gitInit.jsinto the main flow. - 🧹 Linting & Formatting: Ensure ESLint, Prettier, and commitlint are properly configured.
- 📦 Modular Dependency Installation: Use the existing
src/setup/dependencies.jsandsrc/setup/devDependencies.jsin the main flow. - 📦 Dynamic Package.json Updates: Use
src/templates/packageJson.jsinstead of hardcoded updates.
- 📁 Atomic Design Implementation: Properly integrate
src/templates/atomicStructure.jswith sample components. - 🧩 Module Federation: Complete the integration of
src/setup/moduleFederation.js. - 🧰 Config-Driven Setup: Add support for YAML/JSON configuration files:
Example stack.yaml:
react-crafter create-wizard --config stack.yaml
ui: chakra language: typescript styling: scss testing: jest router: react-router
- 📦 Plugin System: Add a plugin system for optional features like Auth, Firebase, CI setup, etc.
- 🏗️ Folder Structure Consistency: Improve folder structure consistency across generated projects.
- 🔧 Environment Setup: Add optional .env setup with common environment variables.
- 📁 Default Folders: Add utils, hooks, and services folders by default (optionally toggle).
- 🎯 Project Layout Options: Let users choose between "Feature-based" vs "Layer-based" project layout.
- 📜 Dynamic README Generation: Generate project-specific README based on selected stack.
- 🚀 Demo Repository: Create a demo repo using react-crafter to showcase production-quality setup.
- 🌐 Online Demos: Launch StackBlitz or Codespaces instant demos.
- 📢 Community Outreach: Write launch blog post and submit to:
- awesome-react
- awesome-nodejs
- Reddit /r/reactjs or Hacker News
- ⚙️ Global Configuration: Support global config file (
~/.reactcrafterrcorcrafter.config.js) to remember default stack preferences. - 👀 Dry Run Mode: Add
--dry-runmode for previewing what files or packages would be created. - 🔇 Silent & Debug Modes: Add
--silentand--debugmodes for different verbosity levels. - 🔍 Git Auto-Detection: Auto-detect if Git repo is missing, and offer to run
git init.
-
🧩 Component Generator: Create a CLI subcommand
gorgeneratefor structured file generation:# Create a new atom component react-crafter g atom Button # Create a new API handler (REST GET) react-crafter g api get /users
Behavior:
-
g atom Buttongenerates:src/components/atoms/Button/Button.tsx(or .jsx based on project language)src/components/atoms/Button/Button.module.scss(or chosen styling)src/components/atoms/Button/index.tsfor exportssrc/components/atoms/Button/Button.test.tsx(if testing is enabled)- Respects atomic structure (atoms, molecules, organisms)
-
g api get /usersgenerates:src/api/getUsers.ts(or .js)- Exports
getUsers()method using Axios or Fetch - Optionally types the response if TypeScript is enabled
- Infers function name from HTTP method + path
File Structure:
src/ components/ atoms/ Button/ Button.tsx Button.module.scss Button.test.tsx index.ts api/ getUsers.tsRequirements:
- Respect language (JS/TS), styling (SCSS/CSS/etc), and testing setup
- Add friendly error message if structure is not found (e.g., project not initialized)
- Should work both from project root and subfolders (optional, nice to have)
Optional Bonuses:
- Support
--dry-runto preview file output - Add
g contextorg hookgenerators - Use template strings or external files to allow community-generated scaffolds
-
- 🪝 Hook Generator:
react-crafter g hook useAuth- Generate custom React hooks - 🧩 Context Generator:
react-crafter g context ThemeContext- Generate React contexts - 📄 Page Generator:
react-crafter g page Home- Generate page components - 🛣️ Route Generator:
react-crafter g route /dashboard- Generate route configurations - 🎨 Customizable Templates: Make generator templates customizable via
templates/folder
Based on my analysis of the codebase, here are the specific technical issues found:
- Dual CLI Implementation:
index.js(496 lines) usescreate-react-appwhilebin/cli.js(28 lines) usescreate-vite - Unused Modular Code:
src/setup/contains well-structured modules that aren't being used by the main flow - Template Confusion: Both static (
pre-files/) and dynamic (src/templates/) template systems exist
- Hardcoded vs Modular:
index.jshas hardcoded logic whilesrc/setup/init.jshas proper modular structure - Missing Integration: Many setup functions exist but aren't called in the main flow
- Inconsistent Language Handling: TypeScript/JavaScript choice isn't properly propagated
- Package.json Scripts: Hardcoded scripts in
index.jsconflict with modular approach - Dependency Installation:
src/setup/dependencies.jshas proper logic but isn't used - Testing Setup:
src/setup/testing.jsonly supports Jest/Mocha, missing modern alternatives - Husky Configuration: Setup and deletion logic conflict with each other