create-prisma-php-app 4.0.0-alpha.15 → 4.0.0-alpha.16
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/dist/index.js +6 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ export async function installComposerDependencies(baseDir, dependencies) {
|
|
|
55
55
|
)
|
|
56
56
|
);
|
|
57
57
|
/* ------------------------------------------------------------------ */
|
|
58
|
-
/* 1.
|
|
58
|
+
/* 1. Try composer init (quietly fall back if it fails) */
|
|
59
59
|
/* ------------------------------------------------------------------ */
|
|
60
60
|
if (!existsAlready) {
|
|
61
61
|
const initArgs = [
|
|
@@ -73,17 +73,7 @@ export async function installComposerDependencies(baseDir, dependencies) {
|
|
|
73
73
|
];
|
|
74
74
|
const res = spawnSync(cmd, initArgs, { cwd: baseDir });
|
|
75
75
|
if (res.status !== 0) {
|
|
76
|
-
|
|
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 */
|
|
76
|
+
// Silent fallback: no logs, just write a minimal composer.json
|
|
87
77
|
fs.writeFileSync(
|
|
88
78
|
composerJsonPath,
|
|
89
79
|
JSON.stringify(
|
|
@@ -100,17 +90,13 @@ export async function installComposerDependencies(baseDir, dependencies) {
|
|
|
100
90
|
);
|
|
101
91
|
}
|
|
102
92
|
}
|
|
103
|
-
/*
|
|
104
|
-
/* 2. Garantizar autoload PSR-4 */
|
|
105
|
-
/* ------------------------------------------------------------------ */
|
|
93
|
+
/* 2. Ensure PSR-4 autoload entry ---------------------------------- */
|
|
106
94
|
const json = JSON.parse(fs.readFileSync(composerJsonPath, "utf8"));
|
|
107
95
|
json.autoload ??= {};
|
|
108
96
|
json.autoload["psr-4"] ??= {};
|
|
109
97
|
json.autoload["psr-4"][""] ??= "src/";
|
|
110
98
|
fs.writeFileSync(composerJsonPath, JSON.stringify(json, null, 2));
|
|
111
|
-
/*
|
|
112
|
-
/* 3. Instalar dependencias */
|
|
113
|
-
/* ------------------------------------------------------------------ */
|
|
99
|
+
/* 3. Install dependencies ----------------------------------------- */
|
|
114
100
|
if (dependencies.length) {
|
|
115
101
|
console.log("Installing Composer dependencies:");
|
|
116
102
|
dependencies.forEach((d) => console.log(`- ${chalk.blue(d)}`));
|
|
@@ -124,9 +110,7 @@ export async function installComposerDependencies(baseDir, dependencies) {
|
|
|
124
110
|
{ stdio: "inherit", cwd: baseDir }
|
|
125
111
|
);
|
|
126
112
|
}
|
|
127
|
-
/*
|
|
128
|
-
/* 4. Refrescar lock (solo modo update) */
|
|
129
|
-
/* ------------------------------------------------------------------ */
|
|
113
|
+
/* 4. Refresh lock when updating ----------------------------------- */
|
|
130
114
|
if (existsAlready) {
|
|
131
115
|
execSync(
|
|
132
116
|
`${cmd} ${[
|
|
@@ -139,9 +123,7 @@ export async function installComposerDependencies(baseDir, dependencies) {
|
|
|
139
123
|
{ stdio: "inherit", cwd: baseDir }
|
|
140
124
|
);
|
|
141
125
|
}
|
|
142
|
-
/*
|
|
143
|
-
/* 5. Regenerar autoloader */
|
|
144
|
-
/* ------------------------------------------------------------------ */
|
|
126
|
+
/* 5. Regenerate autoloader ---------------------------------------- */
|
|
145
127
|
execSync(`${cmd} ${[...baseArgs, "dump-autoload", "--quiet"].join(" ")}`, {
|
|
146
128
|
stdio: "inherit",
|
|
147
129
|
cwd: baseDir,
|