create-prisma-php-app 4.0.0-alpha.14 → 4.0.0-alpha.15

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/dist/index.js +15 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -71,19 +71,28 @@ export async function installComposerDependencies(baseDir, dependencies) {
71
71
  "--version",
72
72
  "1.0.0",
73
73
  ];
74
- const res = spawnSync(cmd, initArgs, { stdio: "inherit", cwd: baseDir });
75
- if (res.status !== 0) throw new Error("Composer init failed");
76
- // Salvaguarda: crear composer.json mínimo si aún no existe
77
- if (!fs.existsSync(composerJsonPath)) {
74
+ const res = spawnSync(cmd, initArgs, { cwd: baseDir });
75
+ if (res.status !== 0) {
76
+ console.error(
77
+ chalk.yellow("⚠ composer init devolvió un código ≠ 0. Salida:")
78
+ );
79
+ if (res.stderr) console.error(res.stderr.toString());
80
+ if (res.error) console.error(res.error.message);
81
+ console.log(
82
+ chalk.yellow(
83
+ "Continuaré creando un composer.json mínimo para no detener la instalación…"
84
+ )
85
+ );
86
+ /* Escribimos un composer.json básico */
78
87
  fs.writeFileSync(
79
88
  composerJsonPath,
80
89
  JSON.stringify(
81
90
  {
82
91
  name: "tsnc/prisma-php-app",
83
- require: { php: "^8.2" },
84
- autoload: { "psr-4": { "": "src/" } },
85
92
  type: "project",
86
93
  version: "1.0.0",
94
+ require: { php: "^8.2" },
95
+ autoload: { "psr-4": { "": "src/" } },
87
96
  },
88
97
  null,
89
98
  2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "4.0.0-alpha.14",
3
+ "version": "4.0.0-alpha.15",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",