create-revo 1.0.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/LICENSE +21 -0
- package/README.md +5 -0
- package/cli.js +74 -0
- package/package.json +19 -0
- package/template/README.md +2 -0
- package/template/eslint.config.js +28 -0
- package/template/index.html +19 -0
- package/template/package-lock.json +4144 -0
- package/template/package.json +33 -0
- package/template/postcss.config.js +6 -0
- package/template/public/revo.png +0 -0
- package/template/src/App.tsx +15 -0
- package/template/src/assets/revo.png +0 -0
- package/template/src/components/dltme +0 -0
- package/template/src/index.css +17 -0
- package/template/src/main.tsx +15 -0
- package/template/src/vite-env.d.ts +1 -0
- package/template/tailwind.config.js +11 -0
- package/template/tsconfig.app.json +24 -0
- package/template/tsconfig.json +7 -0
- package/template/tsconfig.node.json +24 -0
- package/template/vite.config.ts +10 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Tarun Gupta
|
|
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
ADDED
package/cli.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { execSync } from 'child_process';
|
|
6
|
+
|
|
7
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
8
|
+
|
|
9
|
+
const projectName = process.argv[2];
|
|
10
|
+
|
|
11
|
+
if (!projectName) {
|
|
12
|
+
console.error('Please provide a project name: npx create-revo [project-name]');
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const targetDir = path.join(process.cwd(), projectName);
|
|
17
|
+
|
|
18
|
+
function replacePlaceholders(content, placeholderValues) {
|
|
19
|
+
Object.keys(placeholderValues).forEach((key) => {
|
|
20
|
+
const placeholder = `{{${key}}}`;
|
|
21
|
+
content = content.replace(new RegExp(placeholder, 'g'), placeholderValues[key]);
|
|
22
|
+
});
|
|
23
|
+
return content;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function copyTemplateFiles() {
|
|
27
|
+
const templateDir = path.join(__dirname, 'template');
|
|
28
|
+
|
|
29
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
30
|
+
|
|
31
|
+
copyRecursive(templateDir, targetDir);
|
|
32
|
+
|
|
33
|
+
replacePlaceholders(targetDir, { projectName });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function copyRecursive(source, target) {
|
|
37
|
+
if (fs.statSync(source).isDirectory()) {
|
|
38
|
+
fs.mkdirSync(target, { recursive: true });
|
|
39
|
+
fs.readdirSync(source).forEach((file) => {
|
|
40
|
+
copyRecursive(path.join(source, file), path.join(target, file));
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
fs.copyFileSync(source, target);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function replacePlaceholders(directory, placeholderValues) {
|
|
48
|
+
fs.readdirSync(directory).forEach((file) => {
|
|
49
|
+
const filePath = path.join(directory, file);
|
|
50
|
+
if (fs.statSync(filePath).isDirectory()) {
|
|
51
|
+
replacePlaceholders(filePath, placeholderValues);
|
|
52
|
+
} else {
|
|
53
|
+
let content = fs.readFileSync(filePath, 'utf8');
|
|
54
|
+
Object.keys(placeholderValues).forEach((key) => {
|
|
55
|
+
const placeholder = `{{${key}}}`;
|
|
56
|
+
content = content.replace(new RegExp(placeholder, 'g'), placeholderValues[key]);
|
|
57
|
+
});
|
|
58
|
+
fs.writeFileSync(filePath, content);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
copyTemplateFiles();
|
|
65
|
+
console.log(`Project created at ${targetDir}`);
|
|
66
|
+
|
|
67
|
+
process.chdir(targetDir);
|
|
68
|
+
execSync('npm install');
|
|
69
|
+
// execSync('git init');
|
|
70
|
+
console.log('Project setup complete!');
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error('Error creating project:', error);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-revo",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React Typescript Tailwind Framer Build Tool",
|
|
5
|
+
"main": "cli.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"build",
|
|
11
|
+
"tool",
|
|
12
|
+
"bread",
|
|
13
|
+
"react",
|
|
14
|
+
"project",
|
|
15
|
+
"maybetarun"
|
|
16
|
+
],
|
|
17
|
+
"author": "Tarun Gupta",
|
|
18
|
+
"license": "MIT"
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
+
import tseslint from 'typescript-eslint'
|
|
6
|
+
|
|
7
|
+
export default tseslint.config(
|
|
8
|
+
{ ignores: ['dist'] },
|
|
9
|
+
{
|
|
10
|
+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
11
|
+
files: ['**/*.{ts,tsx}'],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
ecmaVersion: 2020,
|
|
14
|
+
globals: globals.browser,
|
|
15
|
+
},
|
|
16
|
+
plugins: {
|
|
17
|
+
'react-hooks': reactHooks,
|
|
18
|
+
'react-refresh': reactRefresh,
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
...reactHooks.configs.recommended.rules,
|
|
22
|
+
'react-refresh/only-export-components': [
|
|
23
|
+
'warn',
|
|
24
|
+
{ allowConstantExport: true },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/revo.png" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Revo</title>
|
|
8
|
+
<meta name="author" content="Tarun Gupta" />
|
|
9
|
+
<!-- <meta name="keywords" content="" />
|
|
10
|
+
<meta name="description" content=""/>
|
|
11
|
+
<meta property="og:image" content="" />
|
|
12
|
+
<meta property="og:title" content="" />
|
|
13
|
+
<meta property="og:description" content="" /> -->
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="root"></div>
|
|
17
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|