create-react-zr-architecture 1.0.3 β†’ 1.0.5

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.
Files changed (3) hide show
  1. package/README.md +11 -3
  2. package/bin/cli.js +18 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -18,7 +18,15 @@ Generador CLI para crear proyectos React con **Clean Architecture**, TypeScript,
18
18
  ## πŸ“¦ InstalaciΓ³n
19
19
 
20
20
  ```bash
21
- npx create-react-clean-arch mi-proyecto
21
+ # Con npm
22
+ npm create react-zr-architecture mi-proyecto
23
+
24
+ # Con pnpm
25
+ pnpm create react-zr-architecture mi-proyecto
26
+
27
+ # Con npx
28
+ npx create-react-zr-architecture mi-proyecto
29
+
22
30
  cd mi-proyecto
23
31
  npm run dev
24
32
  ```
@@ -267,8 +275,8 @@ MIT Β© Diego Aguilera
267
275
 
268
276
  ## πŸ”— Enlaces
269
277
 
270
- - [Repositorio](https://github.com/diegoAguilera02/create-react-clean-arch)
271
- - [Issues](https://github.com/diegoAguilera02/create-react-clean-arch/issues)
278
+ - [Repositorio](https://github.com/diegoAguilera02/create-react-zr-architecture)
279
+ - [Issues](https://github.com/diegoAguilera02/create-react-zr-architecture/issues)
272
280
  - [shadcn/ui](https://ui.shadcn.com/)
273
281
  - [Vite](https://vitejs.dev/)
274
282
  - [TanStack Query](https://tanstack.com/query/latest)
package/bin/cli.js CHANGED
@@ -71,12 +71,11 @@ async function main() {
71
71
  // ════════════════════════════════════════════════════════════
72
72
  const spinnerVite = ora('Creando proyecto base con Vite...').start();
73
73
 
74
- // Responder "No" a "Install and start now"
75
74
  const createCommand = pkgManager === 'pnpm'
76
- ? `printf "\\n\\n\\nn\\n" | pnpm create vite@latest ${projectName} --template react-ts`
75
+ ? `pnpm create vite@latest ${projectName} --template react-ts`
77
76
  : pkgManager === 'yarn'
78
- ? `printf "\\n\\n\\nn\\n" | yarn create vite ${projectName} --template react-ts`
79
- : `printf "\\n\\n\\nn\\n" | npm create vite@latest ${projectName} -- --template react-ts`;
77
+ ? `yarn create vite ${projectName} --template react-ts`
78
+ : `npm create vite@latest ${projectName} -- --template react-ts`;
80
79
 
81
80
  const viteSuccess = runCommand(createCommand);
82
81
 
@@ -95,15 +94,27 @@ async function main() {
95
94
  const templatePath = path.join(__dirname, '../template');
96
95
 
97
96
  try {
98
- // Copiar todos los archivos del template
97
+ // Borrar src/ de Vite
98
+ const viteSrcPath = path.join(projectPath, 'src');
99
+ if (fs.existsSync(viteSrcPath)) {
100
+ fs.removeSync(viteSrcPath);
101
+ }
102
+
103
+ // Copiar template
99
104
  fs.copySync(templatePath, projectPath, {
100
105
  overwrite: true,
101
106
  filter: (src) => {
102
- // No copiar node_modules si existe
103
- return !src.includes('node_modules');
107
+ return !src.includes('node_modules') && !src.includes('.sh');
104
108
  }
105
109
  });
106
110
 
111
+ // Copiar src/ del template explΓ­citamente
112
+ const templateSrcPath = path.join(templatePath, 'src');
113
+ const projectSrcPath = path.join(projectPath, 'src');
114
+ if (fs.existsSync(templateSrcPath)) {
115
+ fs.copySync(templateSrcPath, projectSrcPath, { overwrite: true });
116
+ }
117
+
107
118
  // Renombrar archivos con _ prefix
108
119
  const filesToRename = [
109
120
  { from: '_package.json', to: 'package.json' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-react-zr-architecture",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Create React applications with Clean Architecture, TypeScript, Vite, Tailwind CSS, and shadcn/ui",
5
5
  "type": "module",
6
6
  "bin": {