@mrbryan1502/create-symfony-vue 1.0.1 → 1.0.3

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 (2) hide show
  1. package/bin/index.js +7 -8
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { existsSync, mkdirSync, readdirSync, copyFileSync, readFileSync, writeFileSync, rmSync } from 'fs';
4
- import { join, resolve, dirname, basename } from 'path';
4
+ import { join, resolve, dirname } from 'path';
5
5
  import { fileURLToPath } from 'url';
6
6
  import { execSync } from 'child_process';
7
7
 
@@ -46,10 +46,6 @@ function detectPackageManager() {
46
46
  return 'npm';
47
47
  }
48
48
 
49
- function sanitizeName(name) {
50
- return basename(name).toLowerCase().replace(/[^a-z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '');
51
- }
52
-
53
49
  function printBanner(name) {
54
50
  console.log('');
55
51
  console.log(' \x1b[38;2;74;144;226m\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510');
@@ -101,12 +97,12 @@ console.log(`\n \x1b[90mCreando proyecto\x1b[0m ${projectName} \x1b[90m...\x1b[
101
97
 
102
98
  copyRecursive(TEMPLATE_DIR, projectDir);
103
99
 
104
- // Update composer.json name
100
+ // Remove name from composer.json (create-project does the same)
105
101
  const composerJsonPath = join(projectDir, 'composer.json');
106
102
  try {
107
103
  const content = readFileSync(composerJsonPath, 'utf-8');
108
104
  const json = JSON.parse(content);
109
- json.name = sanitizeName(projectName);
105
+ delete json.name;
110
106
  writeFileSync(composerJsonPath, JSON.stringify(json, null, 4) + '\n');
111
107
  } catch {}
112
108
 
@@ -116,7 +112,10 @@ printBanner(projectName);
116
112
  const hasComposer = hasTool('composer');
117
113
  if (hasComposer) {
118
114
  console.log(' \x1b[90mInstalando dependencias PHP (composer install) ...\x1b[0m');
119
- execSync('composer install --no-interaction', { cwd: projectDir, stdio: 'inherit' });
115
+ execSync('composer install --no-interaction --no-scripts', { cwd: projectDir, stdio: 'inherit' });
116
+ try {
117
+ execSync('composer run-script auto-scripts', { cwd: projectDir, stdio: 'inherit' });
118
+ } catch {}
120
119
  } else {
121
120
  console.log(' \x1b[33m\u26a0\x1b[0m \x1b[90mComposer no est\xe1 instalado. Ejecuta "composer install" manualmente.\x1b[0m');
122
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrbryan1502/create-symfony-vue",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Scaffold a new Symfony 7 + Vue 3 project",
5
5
  "author": "mrbryan1502",
6
6
  "type": "module",