vrt-code 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/index.js +42 -0
- package/package.json +12 -0
- package/templates/vrt/eslint.config.js +29 -0
- package/templates/vrt/package-lock.json +3190 -0
- package/templates/vrt/package.json +46 -0
- package/templates/vrt/src/App/App.jsx +11 -0
- package/templates/vrt/src/Assets/website-icon.svg +1 -0
- package/templates/vrt/src/Pages/Home/Home.jsx +89 -0
- package/templates/vrt/src/Pages/Home/Images/react.svg +1 -0
- package/templates/vrt/src/Pages/Home/Images/tailwindcss.svg +1 -0
- package/templates/vrt/src/Pages/Home/Images/vite.svg +1 -0
- package/templates/vrt/src/Routes/Routes.jsx +17 -0
- package/templates/vrt/src/index.css +1 -0
- package/templates/vrt/src/index.html +31 -0
- package/templates/vrt/src/index.jsx +11 -0
- package/templates/vrt/vite.config.js +18 -0
package/index.js
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import fs from "fs-extra";
|
3
|
+
import prompts from "prompts";
|
4
|
+
import { resolve } from "path";
|
5
|
+
|
6
|
+
const templates = ["vrt"];
|
7
|
+
|
8
|
+
async function main() {
|
9
|
+
const { projectName } = await prompts({
|
10
|
+
type: "text",
|
11
|
+
name: "projectName",
|
12
|
+
message: "Nome do projeto:",
|
13
|
+
});
|
14
|
+
|
15
|
+
if (!projectName) {
|
16
|
+
console.error("❌ Nome do projeto é obrigatório.");
|
17
|
+
process.exit(1);
|
18
|
+
}
|
19
|
+
|
20
|
+
const { template } = await prompts({
|
21
|
+
type: "select",
|
22
|
+
name: "template",
|
23
|
+
message: "Escolha um template:",
|
24
|
+
choices: templates.map((t) => ({ title: t, value: t })),
|
25
|
+
});
|
26
|
+
|
27
|
+
const targetDir = resolve(process.cwd(), projectName);
|
28
|
+
const templateDir = resolve(__dirname, "templates", template);
|
29
|
+
|
30
|
+
if (!fs.existsSync(templateDir)) {
|
31
|
+
console.error(`❌ Template "${template}" não encontrado.`);
|
32
|
+
process.exit(1);
|
33
|
+
}
|
34
|
+
|
35
|
+
fs.copySync(templateDir, targetDir);
|
36
|
+
console.log(`✅ Projeto "${projectName}" criado com sucesso!`);
|
37
|
+
}
|
38
|
+
|
39
|
+
main().catch((err) => {
|
40
|
+
console.error("❌ Erro ao criar o projeto:", err);
|
41
|
+
process.exit(1);
|
42
|
+
});
|
package/package.json
ADDED
@@ -0,0 +1,29 @@
|
|
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 { defineConfig, globalIgnores } from "eslint/config";
|
6
|
+
|
7
|
+
export default defineConfig([
|
8
|
+
globalIgnores(["dist"]),
|
9
|
+
{
|
10
|
+
files: ["**/*.{js,jsx}"],
|
11
|
+
extends: [
|
12
|
+
js.configs.recommended,
|
13
|
+
reactHooks.configs["recommended-latest"],
|
14
|
+
reactRefresh.configs.vite,
|
15
|
+
],
|
16
|
+
languageOptions: {
|
17
|
+
ecmaVersion: 2020,
|
18
|
+
globals: globals.browser,
|
19
|
+
parserOptions: {
|
20
|
+
ecmaVersion: "latest",
|
21
|
+
ecmaFeatures: { jsx: true },
|
22
|
+
sourceType: "module",
|
23
|
+
},
|
24
|
+
},
|
25
|
+
rules: {
|
26
|
+
"no-unused-vars": ["error", { varsIgnorePattern: "^[A-Z_]" }],
|
27
|
+
},
|
28
|
+
},
|
29
|
+
]);
|