create-react-scaffold-cli 0.1.2 → 1.0.1
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
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# create-react-scaffold-cli
|
|
2
|
+
|
|
3
|
+
A CLI to scaffold a **feature-first React application** with clear boundaries and long-term maintainability.
|
|
4
|
+
|
|
5
|
+
This scaffold enforces a simple rule:
|
|
6
|
+
|
|
7
|
+
> **Business logic lives in features.
|
|
8
|
+
> Reusable primitives live in shared.
|
|
9
|
+
> App only wires things together.**
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Why this exists
|
|
14
|
+
|
|
15
|
+
Most React projects slowly degrade into:
|
|
16
|
+
|
|
17
|
+
- unclear ownership
|
|
18
|
+
- massive `components/` folders
|
|
19
|
+
- bloated `shared/` directories
|
|
20
|
+
- fragile cross-feature imports
|
|
21
|
+
|
|
22
|
+
This scaffold exists to:
|
|
23
|
+
|
|
24
|
+
- enforce **feature ownership**
|
|
25
|
+
- make refactoring safe
|
|
26
|
+
- allow deleting features without breaking the app
|
|
27
|
+
- keep architecture understandable as the app grows
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx create-react-scaffold-cli
|
|
35
|
+
```
|
package/package.json
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-react-scaffold-cli",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
},
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"commander": "^14.0.2",
|
|
10
|
-
"execa": "^9.6.1",
|
|
11
|
-
"fs-extra": "^11.3.3",
|
|
12
|
-
"prompts": "^2.4.2"
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
7
|
},
|
|
14
8
|
"keywords": [
|
|
15
|
-
"npx",
|
|
16
9
|
"cli",
|
|
17
10
|
"react",
|
|
18
11
|
"scaffold",
|
|
19
12
|
"boilerplate",
|
|
13
|
+
"vite",
|
|
14
|
+
"frontend",
|
|
20
15
|
"create-app",
|
|
21
|
-
"
|
|
16
|
+
"react-architecture"
|
|
17
|
+
],
|
|
18
|
+
"author": "Muhammad Arsalan",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"description": "A CLI to scaffold a feature-first React application with clear boundaries and long-term maintainability.",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"commander": "^14.0.2",
|
|
23
|
+
"execa": "^9.6.1",
|
|
24
|
+
"fs-extra": "^11.3.3",
|
|
25
|
+
"prompts": "^2.4.2"
|
|
26
|
+
},
|
|
27
|
+
"bin": {
|
|
28
|
+
"create-react-scaffold-cli": "bin/index.js"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin",
|
|
32
|
+
"scripts",
|
|
33
|
+
"templates"
|
|
22
34
|
]
|
|
23
35
|
}
|
package/scripts/createProject.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
3
|
import { execa } from 'execa';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
|
|
@@ -13,6 +13,7 @@ export async function createProject(name, options) {
|
|
|
13
13
|
const templateDir = path.resolve(__dirname, '../templates/base');
|
|
14
14
|
|
|
15
15
|
console.log(`📁 Creating project: ${name}`);
|
|
16
|
+
|
|
16
17
|
await fs.copy(templateDir, targetDir);
|
|
17
18
|
|
|
18
19
|
if (installDeps) {
|
|
@@ -23,7 +24,7 @@ export async function createProject(name, options) {
|
|
|
23
24
|
});
|
|
24
25
|
} else {
|
|
25
26
|
console.log('⏭ Skipped dependency installation');
|
|
26
|
-
console.log(`➡ Run 'npm install' inside ${name}
|
|
27
|
+
console.log(`➡ Run 'npm install' inside ${name}`);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
console.log('✅ Project ready!');
|
package/templates/base/readme.md
CHANGED
|
@@ -65,13 +65,11 @@ Each top-level folder has **its own README** explaining rules and responsibiliti
|
|
|
65
65
|
|
|
66
66
|
## Installation (WIP)
|
|
67
67
|
|
|
68
|
-
> CLI installation instructions
|
|
69
|
-
|
|
70
|
-
For now:
|
|
68
|
+
> CLI installation instructions.
|
|
71
69
|
|
|
72
70
|
```bash
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
npx create-react-scaffold-cli
|
|
72
|
+
|
|
75
73
|
```
|
|
76
74
|
|
|
77
75
|
---
|
package/templates/base/.env
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VITE_BACKEND_URL=""
|