quick-scaffolds-cli 1.1.0 → 1.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pramuditha Lakshan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,30 +1,27 @@
1
1
  # quick-scaffolds-cli
2
2
 
3
- A lightweight, interactive CLI tool for rapidly scaffolding new web projects with pre-configured starter templates.
3
+ A lightweight interactive CLI for scaffolding starter web projects quickly.
4
4
 
5
5
  ## Overview
6
6
 
7
- **quick-scaffolds-cli** is an npm package that provides an interactive command-line interface to generate new projects from customizable templates. Get started with a fully structured project in seconds with an intuitive selection menu.
7
+ quick-scaffolds-cli generates a ready-to-use project from templates with a simple prompt flow.
8
8
 
9
- **v1.1.0** - Now with improved interactive selection and project type options!
9
+ Current release: v1.2.1
10
10
 
11
11
  ## Quick Start
12
12
 
13
- ### Global Installation
13
+ ### Global install
14
14
 
15
- Install globally to use the `ct-pro` command anywhere:
15
+ Install once and use the command anywhere:
16
16
 
17
17
  ```bash
18
18
  npm install -g quick-scaffolds-cli
19
- ```
20
-
21
- Then create a new project:
22
-
23
- ```bash
24
19
  ct-pro
25
20
  ```
26
21
 
27
- ### Using npx (No Installation Required)
22
+ ### Use with npx
23
+
24
+ Run without installing globally:
28
25
 
29
26
  ```bash
30
27
  npx quick-scaffolds-cli
@@ -32,28 +29,32 @@ npx quick-scaffolds-cli
32
29
 
33
30
  ## Usage
34
31
 
35
- ### Creating a New Project
36
-
37
- Run the command and follow the interactive prompts:
32
+ Run the CLI and answer two prompts:
38
33
 
39
34
  ```bash
40
35
  ct-pro
41
36
  ? What is your project name? my-awesome-app
42
- ? What do you want to build? (Use arrow keys)
43
- Static HTML/CSS/JS
37
+ ? What do you want to build?
38
+ Static HTML/CSS/JS
39
+ React starter
44
40
  ```
45
41
 
46
- You'll be guided through:
42
+ Prompt details:
47
43
 
48
- 1. **Project Name**: Enter your desired project name (default: `my-new-project`)
49
- 2. **Project Type**: Use arrow keys to select a template type:
50
- - **Static HTML/CSS/JS** - A simple, lightweight static site starter with HTML, CSS, and JavaScript
44
+ 1. Project name (default: my-new-project)
45
+ 2. Project type:
46
+ - Static HTML/CSS/JS
47
+ - React starter
51
48
 
52
- ### Generated Project Structure
49
+ ## Templates
53
50
 
54
- The scaffolded project will include:
51
+ ### 1. Static HTML/CSS/JS
55
52
 
56
- ```
53
+ Creates a simple static site starter.
54
+
55
+ Generated structure:
56
+
57
+ ```text
57
58
  my-awesome-app/
58
59
  ├── index.html
59
60
  ├── css/
@@ -62,45 +63,70 @@ my-awesome-app/
62
63
  └── app.js
63
64
  ```
64
65
 
65
- ## Features
66
+ ### 2. React starter (Vite)
66
67
 
67
- - 🚀 **Interactive CLI** - Modern, intuitive prompts powered by [@inquirer/prompts](https://github.com/SBoudrias/Inquirer.js)
68
- - ⬆️⬇️ **Arrow Key Navigation** - Easy project type selection with arrow keys
69
- - 📁 **Template-Based** - Pre-built, production-ready project templates
70
- - ⚡ **Instant Setup** - Scaffold complete projects in seconds
71
- - 📦 **Lightweight** - Minimal dependencies and fast installation
72
- - 🧩 **Extensible** - Easy to add custom project templates
68
+ Creates a React starter app with Vite and automatically runs npm install.
73
69
 
74
- ## Available Templates
70
+ Generated structure:
75
71
 
76
- - **Static HTML/CSS/JS** - Simple static website starter with basic HTML, CSS, and JavaScript boilerplate
72
+ ```text
73
+ my-awesome-app/
74
+ ├── package.json
75
+ ├── public/
76
+ │ ├── index.html
77
+ │ └── index.css
78
+ └── src/
79
+ ├── App.css
80
+ ├── App.jsx
81
+ ├── index.css
82
+ └── main.jsx
83
+ ```
77
84
 
78
- ## Project Structure
85
+ After scaffolding a React project:
79
86
 
87
+ ```bash
88
+ cd my-awesome-app
89
+ npm run dev
80
90
  ```
81
- quick-scaffolds/
91
+
92
+ ## Features
93
+
94
+ - Interactive CLI powered by @inquirer/prompts
95
+ - Fast project scaffolding from local templates
96
+ - Two starter options: static web or React + Vite
97
+ - Automatic dependency installation for React template
98
+ - Simple command interface via ct-pro
99
+
100
+ ## Project Structure
101
+
102
+ ```text
103
+ quick-scaffolds-cli/
82
104
  ├── bin/
83
- │ └── cli.js # CLI entry point
84
- ├── templates/ # Starter templates
85
- └── html-template/ # Static HTML/CSS/JS template
86
- ├── index.html
87
- ├── css/
88
- │ └── style.css
89
- └── js/
90
- └── app.js
105
+ │ └── cli.js
106
+ ├── templates/
107
+ ├── html-template/
108
+ ├── index.html
109
+ ├── css/
110
+ └── style.css
111
+ └── js/
112
+ └── app.js
113
+ │ └── react-template/
114
+ │ ├── package.json
115
+ │ ├── public/
116
+ │ │ ├── index.css
117
+ │ │ └── index.html
118
+ │ └── src/
119
+ │ ├── App.css
120
+ │ ├── App.jsx
121
+ │ ├── index.css
122
+ │ └── main.jsx
91
123
  ├── package.json
92
124
  └── README.md
93
125
  ```
94
126
 
95
127
  ## Dependencies
96
128
 
97
- - **@inquirer/prompts** (^8.3.2) - Modern, interactive prompt library
98
- - **inquirer** (^13.3.2) - Command-line interface utilities
99
-
100
- ## Version History
101
-
102
- - **v1.1.0** - Improved interactive selection with arrow key navigation, organized template structure
103
- - **v1.0.0** - Initial release with basic scaffolding functionality
129
+ - @inquirer/prompts ^8.3.2
104
130
 
105
131
  ## License
106
132
 
@@ -108,4 +134,4 @@ MIT
108
134
 
109
135
  ## Contributing
110
136
 
111
- Contributions are welcome! Please feel free to submit pull requests or open issues to suggest improvements.
137
+ Issues and pull requests are welcome on github.
package/bin/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
-
2
+ import { execSync } from 'node:child_process';
3
3
  import fs from 'node:fs/promises';
4
4
  import path from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
@@ -23,7 +23,7 @@ async function main() {
23
23
  type: "list",
24
24
  choices: [
25
25
  { name: 'Static HTML/CSS/JS', value: 'static' },
26
-
26
+ { name: 'React starter', value: 'react' }
27
27
  ],
28
28
  });
29
29
  let templateFolder = '';
@@ -31,17 +31,64 @@ async function main() {
31
31
  templateFolder = 'html-template';
32
32
  }
33
33
 
34
+ if (projectType === 'react') {
35
+ templateFolder = 'react-template';
36
+ await reactApp(name, templateFolder);
37
+ return;
38
+ }
39
+
34
40
  const projectName = name;
35
41
  const targetPath = path.join(process.cwd(), projectName);
36
42
 
37
43
  const templatePath = path.join(__dirname, '../templates', templateFolder);
38
44
  await fs.mkdir(targetPath, { recursive: true });
39
45
  await fs.cp(templatePath, targetPath, { recursive: true });
40
- console.log(`Successfully scaffolded the project ${projectName}`)
46
+ console.log(`Successfully scaffolded the HTMl project - ${projectName}`)
41
47
 
42
48
  } catch (err) {
43
49
  console.error(`Error - ${err.message}`)
44
50
  }
45
51
  }
46
52
 
53
+ async function reactApp(projectName, templateFolder) {
54
+ try {
55
+ const targetPath = path.join(process.cwd(), projectName);
56
+ const templatePath = path.join(__dirname, '../templates', templateFolder);
57
+ await fs.mkdir(targetPath, { recursive: true });
58
+ await fs.cp(templatePath, targetPath, { recursive: true })
59
+
60
+ const filesToUpdate = [
61
+ path.join(targetPath, 'package.json'),
62
+ path.join(targetPath, 'public','index.html')
63
+ ];
64
+ for (const filePath of filesToUpdate) {
65
+ try {
66
+ const content = await fs.readFile(filePath, 'utf-8');
67
+ const updateContent = content.replaceAll('{{PROJECT_NAME}}', projectName);
68
+ await fs.writeFile(filePath, updateContent);
69
+ } catch (err) {
70
+ console.error(err);
71
+ console.error(`File path ${path.basename(filePath)} not found`);
72
+ }
73
+ }
74
+
75
+ console.log(`Successfully scaffolded the React starter project - ${projectName}`)
76
+ console.log('📦 Installing dependencies... This may take a minute.');
77
+ try {
78
+ execSync('npm install', {
79
+ cwd: targetPath,
80
+ stdio: 'inherit'
81
+ });
82
+ console.log('✅ Dependencies installed successfully!');
83
+ } catch (err){
84
+ console.error(err);
85
+ console.log('⚠️ Could not install dependencies automatically.');
86
+ console.log('Please run "npm install" manually inside your project folder.');
87
+ }
88
+
89
+ } catch (err) {
90
+ console.error(`Error - ${err.message}`);
91
+ }
92
+ }
93
+
47
94
  main();
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "quick-scaffolds-cli",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "ct-pro": "bin/cli.js"
7
7
  },
8
+ "license": "MIT",
8
9
  "files": [
9
10
  "bin",
10
11
  "templates"
11
12
  ],
12
13
  "dependencies": {
13
- "@inquirer/prompts": "^8.3.2",
14
- "inquirer": "^13.3.2"
14
+ "@inquirer/prompts": "^8.3.2"
15
15
  }
16
16
  }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "{{PROJECT_NAME}}",
3
+ "private": true,
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "react": "^19.0.0",
13
+ "react-dom": "^19.0.0"
14
+ },
15
+ "devDependencies": {
16
+ "@vitejs/plugin-react": "^4.3.4",
17
+ "vite": "^6.0.0"
18
+ }
19
+ }
File without changes
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>{{PROJECT_NAME}}</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+
11
+ <script type="module" src="/src/main.jsx"></script>
12
+ </body>
13
+ </html>
File without changes
@@ -0,0 +1,12 @@
1
+ import './App.css';
2
+
3
+ function App(){
4
+ return(
5
+ <div className="container">
6
+ <h1>Welcome to your React App!</h1>
7
+ <p>Start building something amazing.</p>
8
+ </div>
9
+ )
10
+ }
11
+
12
+ export default App
File without changes
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App.jsx';
4
+
5
+ ReactDOM.createRoot(document.getElementById('root')).render(
6
+ <React.StrictMode>
7
+ <App />
8
+ </React.StrictMode>
9
+ )