quick-scaffolds-cli 1.0.0 → 1.1.0
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
|
@@ -1,55 +1,60 @@
|
|
|
1
|
-
# quick-scaffolds
|
|
1
|
+
# quick-scaffolds-cli
|
|
2
2
|
|
|
3
|
-
A lightweight CLI tool for
|
|
3
|
+
A lightweight, interactive CLI tool for rapidly scaffolding new web projects with pre-configured starter templates.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
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.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**v1.1.0** - Now with improved interactive selection and project type options!
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Quick Start
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
npm install -g quick-scaffolds
|
|
15
|
-
```
|
|
13
|
+
### Global Installation
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
Install globally to use the `ct-pro` command anywhere:
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
|
-
|
|
18
|
+
npm install -g quick-scaffolds-cli
|
|
21
19
|
```
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
Then create a new project:
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
```bash
|
|
24
|
+
ct-pro
|
|
25
|
+
```
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
### Using npx (No Installation Required)
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
|
|
30
|
+
npx quick-scaffolds-cli
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
1. **Project Name**: Enter the name of your project (default: `my-new-project`)
|
|
36
|
-
2. **Project Type**: Select the type of project to scaffold (currently: `Static HTML/CSS/JS`)
|
|
33
|
+
## Usage
|
|
37
34
|
|
|
38
|
-
|
|
35
|
+
### Creating a New Project
|
|
39
36
|
|
|
40
|
-
|
|
37
|
+
Run the command and follow the interactive prompts:
|
|
41
38
|
|
|
42
39
|
```bash
|
|
43
|
-
|
|
44
|
-
? What is your project name? my-awesome-
|
|
45
|
-
? What do you want to build?
|
|
46
|
-
|
|
40
|
+
ct-pro
|
|
41
|
+
? What is your project name? my-awesome-app
|
|
42
|
+
? What do you want to build? (Use arrow keys)
|
|
43
|
+
❯ Static HTML/CSS/JS
|
|
47
44
|
```
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
You'll be guided through:
|
|
47
|
+
|
|
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
|
|
51
|
+
|
|
52
|
+
### Generated Project Structure
|
|
53
|
+
|
|
54
|
+
The scaffolded project will include:
|
|
50
55
|
|
|
51
56
|
```
|
|
52
|
-
my-awesome-
|
|
57
|
+
my-awesome-app/
|
|
53
58
|
├── index.html
|
|
54
59
|
├── css/
|
|
55
60
|
│ └── style.css
|
|
@@ -59,31 +64,43 @@ my-awesome-website/
|
|
|
59
64
|
|
|
60
65
|
## Features
|
|
61
66
|
|
|
62
|
-
- 🚀 **Interactive CLI
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
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
|
|
73
|
+
|
|
74
|
+
## Available Templates
|
|
75
|
+
|
|
76
|
+
- **Static HTML/CSS/JS** - Simple static website starter with basic HTML, CSS, and JavaScript boilerplate
|
|
67
77
|
|
|
68
78
|
## Project Structure
|
|
69
79
|
|
|
70
80
|
```
|
|
71
81
|
quick-scaffolds/
|
|
72
82
|
├── bin/
|
|
73
|
-
│ └── cli.js
|
|
74
|
-
├── templates/
|
|
75
|
-
│
|
|
76
|
-
│
|
|
77
|
-
│
|
|
78
|
-
│ └──
|
|
79
|
-
│ └──
|
|
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
|
|
80
91
|
├── package.json
|
|
81
92
|
└── README.md
|
|
82
93
|
```
|
|
83
94
|
|
|
84
95
|
## Dependencies
|
|
85
96
|
|
|
86
|
-
-
|
|
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
|
|
87
104
|
|
|
88
105
|
## License
|
|
89
106
|
|
|
@@ -91,4 +108,4 @@ MIT
|
|
|
91
108
|
|
|
92
109
|
## Contributing
|
|
93
110
|
|
|
94
|
-
Contributions are welcome!
|
|
111
|
+
Contributions are welcome! Please feel free to submit pull requests or open issues to suggest improvements.
|
package/bin/cli.js
CHANGED
|
@@ -3,39 +3,44 @@
|
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import
|
|
6
|
+
import { input, select } from '@inquirer/prompts';
|
|
7
7
|
|
|
8
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
9
|
const __dirname = path.dirname(__filename);
|
|
10
10
|
|
|
11
11
|
async function main() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
try {
|
|
13
|
+
const name = await input(
|
|
14
|
+
{
|
|
15
|
+
name: 'projectName',
|
|
16
|
+
message: 'What is your project name?',
|
|
17
|
+
type: 'input',
|
|
18
|
+
default: 'my-new-project'
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
const projectType = await select({
|
|
22
22
|
message: 'What do you want to build?',
|
|
23
|
-
|
|
24
|
-
choices: [
|
|
23
|
+
type: "list",
|
|
24
|
+
choices: [
|
|
25
|
+
{ name: 'Static HTML/CSS/JS', value: 'static' },
|
|
26
|
+
|
|
25
27
|
],
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
+
});
|
|
29
|
+
let templateFolder = '';
|
|
30
|
+
if (projectType === 'static') {
|
|
31
|
+
templateFolder = 'html-template';
|
|
32
|
+
}
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const templatePath = path.join(__dirname, '../templates');
|
|
34
|
+
const projectName = name;
|
|
35
|
+
const targetPath = path.join(process.cwd(), projectName);
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
const templatePath = path.join(__dirname, '../templates', templateFolder);
|
|
34
38
|
await fs.mkdir(targetPath, { recursive: true });
|
|
35
39
|
await fs.cp(templatePath, targetPath, { recursive: true });
|
|
36
|
-
console.log(
|
|
40
|
+
console.log(`Successfully scaffolded the project ${projectName}`)
|
|
41
|
+
|
|
37
42
|
} catch (err) {
|
|
38
|
-
console.error(
|
|
43
|
+
console.error(`Error - ${err.message}`)
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
46
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quick-scaffolds-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ct-pro": "bin/cli.js"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"templates"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@inquirer/prompts": "^8.3.2",
|
|
13
14
|
"inquirer": "^13.3.2"
|
|
14
15
|
}
|
|
15
16
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|