create-revo 2.0.0 → 2.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 CHANGED
@@ -1,24 +1,35 @@
1
- # Revo - Fast & Efficient React Project Setup
1
+ # Revo - Fast & Efficient React & Next.js Project Setup
2
2
 
3
- **Revo** is a custom React project setup tool built on top of Vite. Its designed to streamline your workflow by providing a clean project structure, pre-configured with **Tailwind CSS** and **Framer Motion**, so you can focus on building amazing applications.
3
+ **Revo** is a modern project setup tool that supports both **React** and **Next.js** projects. It's designed to streamline your workflow by providing clean project structures, pre-configured with **TypeScript** and **Tailwind CSS**, so you can focus on building amazing applications.
4
4
 
5
5
  ---
6
6
 
7
7
  ## 🚀 Features
8
8
 
9
- - **Powered by Vite**: Enjoy blazing-fast builds and an optimized development experience.
10
- - **Tailwind CSS**: Fully configured for utility-first styling right out of the box.
11
- - **Framer Motion**: Pre-installed for creating stunning animations with ease.
12
- - **Better Project Layout**: Thoughtfully organized file structure to keep your code clean and maintainable.
9
+ - **Two Framework Options**: Choose between React (Vite) or Next.js
10
+ - **TypeScript Ready**: Pre-configured TypeScript for type safety
11
+ - **Tailwind CSS**: Fully configured for utility-first styling right out of the box
12
+ - **Latest Dependencies**: Always uses the latest versions of all packages
13
+ - **Interactive Setup**: Simple CLI with progress indicators
14
+ - **Clean Project Structure**: Thoughtfully organized file structure for maintainable code
13
15
 
14
16
  ---
15
17
 
16
18
  ## 📦 What You Get
17
19
 
18
- 1. **Pre-configured Tailwind CSS** for styling.
19
- 2. **Framer Motion** set up for animations.
20
- 3. **Optimized Vite setup** for fast development and builds.
21
- 4. A clean project directory structure:
20
+ ### React Template (Vite)
21
+ 1. **React 18** with TypeScript
22
+ 2. **Vite** for lightning-fast development
23
+ 3. **Tailwind CSS** for styling
24
+ 4. **ESLint** for code quality
25
+ 5. **Motion** for animations
26
+
27
+ ### Next.js Template
28
+ 1. **Next.js 15** with App Router
29
+ 2. **TypeScript** for type safety
30
+ 3. **Tailwind CSS** for styling
31
+ 4. **ESLint** for code quality
32
+ 5. **Optimized** for production
22
33
 
23
34
  ---
24
35
 
@@ -28,21 +39,29 @@
28
39
  Make sure you have Node.js (>=14.x) and npm/yarn installed.
29
40
 
30
41
  ### Create a New Project
31
- Run the following command to create a new project:
32
42
 
43
+ **Option 1: With project name**
44
+ ```bash
45
+ npx create-revo my-awesome-project
33
46
  ```
34
- npx create-revo [project-name]
47
+
48
+ **Option 2: Interactive mode (will prompt for project name)**
49
+ ```bash
50
+ npx create-revo
35
51
  ```
36
52
 
37
- ### Navigate to Your Project
53
+ ### Choose Your Template
54
+ You'll be prompted to choose between:
55
+ 1. **React.js** - Vite + TypeScript + Tailwind CSS
56
+ 2. **Next.js** - App Router + TypeScript + Tailwind CSS
38
57
 
39
- ```
58
+ ### Navigate to Your Project
59
+ ```bash
40
60
  cd [project-name]
41
61
  ```
42
62
 
43
63
  ### Install Dependencies
44
-
45
- ```
64
+ ```bash
46
65
  npm install
47
66
  ```
48
67
 
@@ -84,6 +103,8 @@ Happy coding with Revo! 🎉
84
103
 
85
104
  Revo is built on top of amazing open-source tools. A big shoutout to:
86
105
 
87
- - [Vite](https://vitejs.dev/) - The lightning-fast frontend build tool.
88
- - [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework for rapid UI development.
89
- - [Framer Motion](https://www.framer.com/motion/) - The library for creating smooth and delightful animations.
106
+ - [React](https://react.dev/) - The library for building user interfaces
107
+ - [Next.js](https://nextjs.org/) - The React framework for production
108
+ - [Vite](https://vitejs.dev/) - The lightning-fast frontend build tool
109
+ - [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework for rapid UI development
110
+ - [TypeScript](https://www.typescriptlang.org/) - Typed JavaScript at any scale
package/cli.js CHANGED
@@ -64,6 +64,20 @@ function replacePlaceholders(content, placeholderValues) {
64
64
  return content;
65
65
  }
66
66
 
67
+ function updateProgress(percentage, message) {
68
+ const barLength = 20;
69
+ const filledLength = Math.round((percentage / 100) * barLength);
70
+ const bar = '█'.repeat(filledLength) + '░'.repeat(barLength - filledLength);
71
+
72
+ // Clear the current line and move cursor to beginning
73
+ process.stdout.write('\r\x1b[K');
74
+ process.stdout.write(`[${bar}] ${percentage}% - ${message}`);
75
+
76
+ if (percentage === 100) {
77
+ process.stdout.write('\n');
78
+ }
79
+ }
80
+
67
81
  function copyTemplateFiles(templateType, projectName, targetDir) {
68
82
  const templateDir = path.join(__dirname, `template-${templateType}`);
69
83
 
@@ -73,14 +87,27 @@ function copyTemplateFiles(templateType, projectName, targetDir) {
73
87
  process.exit(1);
74
88
  }
75
89
 
90
+ console.log("\nSetting up project...");
91
+
92
+ // Step 1: Create directory
93
+ updateProgress(10, "Creating project directory...");
76
94
  fs.mkdirSync(targetDir, { recursive: true });
77
95
 
96
+ // Step 2: Copy template files
97
+ updateProgress(30, "Copying template files...");
78
98
  copyRecursive(templateDir, targetDir);
79
99
 
100
+ // Step 3: Replace placeholders
101
+ updateProgress(60, "Configuring project files...");
80
102
  replacePlaceholdersInDirectory(targetDir, { projectName });
81
103
 
82
- // Create .gitignore file
104
+ // Step 4: Create .gitignore file
105
+ updateProgress(80, "Creating .gitignore file...");
83
106
  createGitignoreFile(targetDir);
107
+
108
+ // Step 5: Finalizing
109
+ updateProgress(100, "Project setup complete!");
110
+ console.log(""); // New line after progress
84
111
  }
85
112
 
86
113
  function createGitignoreFile(projectDir) {
@@ -140,6 +167,11 @@ function copyRecursive(source, target) {
140
167
  const files = fs.readdirSync(source);
141
168
 
142
169
  for (const file of files) {
170
+ // Skip node_modules and other system directories
171
+ if (file === 'node_modules' || file === '.git' || file === 'dist' || file === 'build' || file === '.next') {
172
+ continue;
173
+ }
174
+
143
175
  const sourcePath = path.join(source, file);
144
176
  const targetPath = path.join(target, file);
145
177
  copyRecursive(sourcePath, targetPath);
@@ -168,6 +200,11 @@ function replacePlaceholdersInDirectory(directory, placeholderValues) {
168
200
  for (const file of files) {
169
201
  const filePath = path.join(directory, file);
170
202
 
203
+ // Skip node_modules and other system directories
204
+ if (file === 'node_modules' || file === '.git' || file === 'dist' || file === 'build' || file === '.next') {
205
+ continue;
206
+ }
207
+
171
208
  if (fs.statSync(filePath).isDirectory()) {
172
209
  replacePlaceholdersInDirectory(filePath, placeholderValues);
173
210
  } else {
@@ -252,7 +289,6 @@ async function main() {
252
289
  console.log(`Project created successfully at ${finalTargetDir}`);
253
290
  process.chdir(finalTargetDir);
254
291
 
255
- console.log("\nProject setup complete!");
256
292
  console.log("\nNext steps:");
257
293
  console.log("1. Run: npm install");
258
294
  console.log("2. Run: npm run dev");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-revo",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Project setup tool for ReactJS and NextJS",
5
5
  "main": "cli.js",
6
6
  "bin": {
package/test/README.md ADDED
@@ -0,0 +1,36 @@
1
+ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-revo`](https://www.npmjs.com/package/create-revo) for {{projectName}}.
2
+
3
+ ## Getting Started
4
+
5
+ First, run the development server:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ # or
12
+ pnpm dev
13
+ # or
14
+ bun dev
15
+ ```
16
+
17
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
+
19
+ You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20
+
21
+ This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22
+
23
+ ## Learn More
24
+
25
+ To learn more about Next.js, take a look at the following resources:
26
+
27
+ - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
+ - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
+
30
+ You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31
+
32
+ ## Deploy on Vercel
33
+
34
+ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
+
36
+ Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
@@ -0,0 +1,25 @@
1
+ import { dirname } from "path";
2
+ import { fileURLToPath } from "url";
3
+ import { FlatCompat } from "@eslint/eslintrc";
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+
8
+ const compat = new FlatCompat({
9
+ baseDirectory: __dirname,
10
+ });
11
+
12
+ const eslintConfig = [
13
+ ...compat.extends("next/core-web-vitals", "next/typescript"),
14
+ {
15
+ ignores: [
16
+ "node_modules/**",
17
+ ".next/**",
18
+ "out/**",
19
+ "build/**",
20
+ "next-env.d.ts",
21
+ ],
22
+ },
23
+ ];
24
+
25
+ export default eslintConfig;
@@ -0,0 +1,7 @@
1
+ import type { NextConfig } from "next";
2
+
3
+ const nextConfig: NextConfig = {
4
+ /* config options here */
5
+ };
6
+
7
+ export default nextConfig;