routesync 1.0.39 → 1.0.40
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/cli.js +11 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9725,17 +9725,24 @@ echo json_encode($result);
|
|
|
9725
9725
|
annotations = JSON.parse(output);
|
|
9726
9726
|
} catch (e) {
|
|
9727
9727
|
console.error("\u274C PHP execution failed. Make sure PHP is available and database is accessible.");
|
|
9728
|
-
|
|
9729
|
-
|
|
9728
|
+
if (e && typeof e === "object" && "stderr" in e) {
|
|
9729
|
+
console.error("PHP error output:");
|
|
9730
|
+
console.error(e.stderr);
|
|
9731
|
+
}
|
|
9732
|
+
if (e && typeof e === "object" && "stdout" in e) {
|
|
9733
|
+
const stdout = e.stdout;
|
|
9734
|
+
if (stdout) console.error("PHP stdout:", stdout);
|
|
9735
|
+
}
|
|
9736
|
+
console.error("Temp script preserved at:", tmpFile);
|
|
9730
9737
|
process.exit(1);
|
|
9731
9738
|
}
|
|
9732
9739
|
import_fs_extra16.default.removeSync(tmpFile);
|
|
9733
|
-
if (annotations.length === 0) {
|
|
9740
|
+
if (!annotations || annotations.length === 0) {
|
|
9734
9741
|
console.log("\u2714 No methods to annotate \u2014 all routes already annotated or no Resources detected.");
|
|
9735
9742
|
return;
|
|
9736
9743
|
}
|
|
9737
9744
|
const byFile = /* @__PURE__ */ new Map();
|
|
9738
|
-
for (const ann of annotations) {
|
|
9745
|
+
for (const ann of annotations ?? []) {
|
|
9739
9746
|
const existing = byFile.get(ann.controllerFile) ?? [];
|
|
9740
9747
|
if (!existing.find((e) => e.methodName === ann.methodName)) {
|
|
9741
9748
|
existing.push(ann);
|