@aditokmo/react-setup-cli 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,17 +4,11 @@
4
4
 
5
5
  A React CLI built with Vite that helps you build and structure your projects in seconds. It eliminates manual setup by configuring your favorite tools into a **clean, modular architecture** automatically.
6
6
 
7
- **Note:** This package is a CLI tool. Do not install it via `npm i`. Instead check usage down below.
8
-
9
- ## What it does
10
-
11
- - **Automated Installation:** Installs all selected libraries (listed below) for you.
12
- - **Structuring:** Automatically generates a scalable folder structure based on your choices.
13
- - **Boilerplate Injection:** Pre-configures Providers, Router paths, etc., so you can start coding features immediately
7
+ **Note:** This package is a CLI tool. Do not install it with `npm i`. Instead check `Quick Start` down below.
14
8
 
15
9
  ---
16
10
 
17
- ## Usage
11
+ ## Quick Start
18
12
 
19
13
  Run the following command in your terminal to start CLI
20
14
 
@@ -31,23 +25,57 @@ yarn dlx @aditokmo/react-setup-cli
31
25
 
32
26
  ---
33
27
 
34
- ## Features
28
+ ## How it saves your time
35
29
 
36
- | Category | Options |
37
- | :------------------- | :-------------------------------------- |
38
- | **Folder Structure** | Feature-based |
39
- | **Modules** | Common, Auth |
40
- | **Routing** | React Router, TanStack Router |
41
- | **Data Fetching** | TanStack Query (React Query) & Axios |
42
- | **State Management** | Zustand |
43
- | **Form** | React Hook Form, TanStack Form |
44
- | **Schema** | Zod, Yup |
45
- | **Styling** | CSS, SCSS, Tailwind CSS |
46
- | **UI Components** | Shadcn |
47
- | **Icons** | React Icons, Font Awesome |
48
- | **Toast** | React Toastify, React Hot Toast, Sonner |
49
- | **Custom Hooks** | |
50
- | **Helpers** | |
30
+ - **Minimal Installation:** No more manual `npm install` for 10 different packages. The CLI detects your package manager and handles everything.
31
+ - **Architecture:** Instead of a messy folder structure, you get a **modular (feature-based)** structure that is ready for large-scale production.
32
+ - **Smart Boilerplate Injection:** It doesn't just create files it also wires them. It sets up Axios interceptors, TanStack Query providers, and Router wrappers so you can jump straight into the code that actually matters.
33
+
34
+ ---
35
+
36
+ ## Use Cases when this CLI is useful:
37
+
38
+ - **Starting a Professional Project:** When you need a project that follows "Clean Architecture" and industry standards from the very first commit.
39
+ - **Focusing on a Specific Feature:** When you want to test a new library or a specific piece of logic, but you need a proper environment to do it. This CLI lets you focus on what you are testing instead of wasting time on a setup.
40
+ - **Prototyping & MVP:** When you have a startup idea and want to to build actual features right away without sacrificing code quality.
41
+ - **Hackathons:** When every second counts. You can get all your configuration and setup ready before the competition start.
42
+
43
+ ---
44
+
45
+ ## Decisions About Arhitecture
46
+
47
+ This CLI isn't just a downloader it is architectural choice designed to enforce professional standards.
48
+
49
+ ### Feature-Based Structure
50
+
51
+ This architecture uses a modular approach to help you build large-scale projects. Instead of mixing all components and hooks into global folders, everything is grouped by domain, such as Auth or Dashboard. This method makes it much easier to navigate the codebase and ensures your project remains maintainable as it grows.
52
+
53
+ ### Global State Management (Zustand)
54
+
55
+ Zustand is currently the only option in CLI for global state management. It is the most popular and easiest-to-use library today. I believe Redux is overkill for most modern projects. Most "global state" is now handled as server-state by TanStack Query. Global state should be reserved for things like authentication and UI stuff, and Zustand handles this perfectly with zero boilerplate.
56
+
57
+ ### Axios
58
+
59
+ The CLI generates a pre-configured Axios client that serves as your central API bridge. It includes ready-to-use interceptors for handling authorization tokens and global error responses, saving you from writing the same repetitive setup every time. Axios is set by default beacause it is better choice then fetch, Axios is more user-friendly, has better error handling out of the box, and is overall a safer and more robust choice for production apps.
60
+
61
+ ### TanStack Query
62
+
63
+ TanStack Query is integrated to handle server-state management. It is optional, but if selected, the CLI automatically wires up the necessary providers and configurations so you can start fetching data immediately. If you select to not use react query, you still get a traditional boilerplate for manual data handling.
64
+
65
+ ### Styling
66
+
67
+ You can choose between CSS, SCSS (soon), or Tailwind CSS. While I personally recommend Tailwind for modern and faster development, the CLI ensures that regardless of your choice, the project is configured with a global styles directory and a consistent entry point. If you select TailwindCSS you will also have option to use Shadcn/UI, and with that you will have option to choose components that you want to install instead of doing it manually.
68
+
69
+ ### Routing
70
+
71
+ The CLI offers two powerful options: React Router and TanStack Router.
72
+
73
+ - **React Router** is the industry standard that most developers are familiar with.
74
+ - **TanStack Router** is included for those who want a fully type-safe routing experience with built-in data loading capabilities. Whichever you choose, the CLI doesn't just install the library it will generate a `routes/` directory system to help you easily separate your public pages from protected pages.
75
+
76
+ ### Package Manager Detection
77
+
78
+ To make the workflow even smoother, the tool has an automatic package manager detector. It identifies whether you are using npm, pnpm, or yarn based on the command you used to execute the CLI, and it handles all installations using your preferred package manager to ensure consistency and avoid conflicts.
51
79
 
52
80
  ---
53
81
 
@@ -67,6 +95,9 @@ src/
67
95
  │ ├── MainLayout.tsx
68
96
  │ ├── AuthLayout.tsx
69
97
  ├── modules/ # Feature-based modules (The core of your app)
98
+ | ├── common/ # Shared components & pages (404 Page, Navbar, Sidebar)
99
+ │ │ ├── pages/
100
+ │ │ └── components/
70
101
  │ └── auth/ # Example: Auth module
71
102
  │ ├── components/
72
103
  │ ├── hooks/
@@ -81,6 +112,41 @@ src/
81
112
 
82
113
  ---
83
114
 
115
+ ## Features
116
+
117
+ | Category | Options |
118
+ | :------------------- | :-------------------------------------- |
119
+ | **Folder Structure** | Feature-based |
120
+ | **Modules** | Common, Auth |
121
+ | **Routing** | React Router, TanStack Router |
122
+ | **Data Fetching** | TanStack Query (React Query) & Axios |
123
+ | **State Management** | Zustand |
124
+ | **Form** | React Hook Form, TanStack Form |
125
+ | **Schema** | Zod, Yup |
126
+ | **Styling** | CSS, SCSS, Tailwind CSS |
127
+ | **UI Components** | Shadcn |
128
+ | **Icons** | React Icons, Font Awesome |
129
+ | **Toast** | React Toastify, React Hot Toast, Sonner |
130
+ | **Custom Hooks** | |
131
+ | **Helpers** | |
132
+
133
+ ---
134
+
135
+ ## Future of CLI
136
+
137
+ Some of my ideas
138
+
139
+ - Options to choose between React, Next.js and TanStack Start
140
+ - Testing tools
141
+ - i18next pre-setup.
142
+ - Supabase & Firebase integration templates
143
+ - Global custom hooks & helper functions
144
+ - Pre-commit linters
145
+ - Github Action workflow
146
+ - TanStack Table (if your app has some kind of tables)
147
+
148
+ ---
149
+
84
150
  ## Local Setup
85
151
 
86
152
  To do your own changes and use this CLI locally:
@@ -128,7 +194,3 @@ react-setup-cli
128
194
  - `templates/` - Pre-defined boilerplates and configurations.
129
195
 
130
196
  ---
131
-
132
- <p align="center">
133
- Developed with ❤️ by <a href="https://github.com/aditokmo">aditokmo</a>
134
- </p>
@@ -4,7 +4,7 @@ export function collectDependencies(answers, packageManager) {
4
4
  const dependency = new Set();
5
5
  const devDependency = new Set();
6
6
  const cmd = [];
7
- const dlx = packageManager === 'npm' ? 'npx --yes' : `${packageManager} dlx --yes`;
7
+ const dlx = packageManager === 'npm' ? 'npx --yes' : `${packageManager} dlx`;
8
8
  // Default base packages
9
9
  axiosInstaller.dependency?.forEach(d => dependency.add(d));
10
10
  // Packages from answers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aditokmo/react-setup-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A fast React CLI to jumpstart your projects. It sets up your libraries and organizes a scalable folder structure so you can skip the configuration and go straight to coding.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",