@xuda.io/drive_module 1.1.1491 → 1.1.1492
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/index.mjs +10 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2660,7 +2660,10 @@ export default {
|
|
|
2660
2660
|
dependencies: devDependencies,
|
|
2661
2661
|
},
|
|
2662
2662
|
};
|
|
2663
|
-
|
|
2663
|
+
// return_result: caller owns persistence (e.g. save_prog's strict insert) —
|
|
2664
|
+
// return the build result instead of self-saving. job_id keeps the original
|
|
2665
|
+
// studio-save contract.
|
|
2666
|
+
if (job_id || req.return_result) {
|
|
2664
2667
|
return vite_build_res;
|
|
2665
2668
|
}
|
|
2666
2669
|
|
|
@@ -2669,12 +2672,16 @@ export default {
|
|
|
2669
2672
|
|
|
2670
2673
|
db_module.save_app_couch_doc(app_id, doc);
|
|
2671
2674
|
} catch (err) {
|
|
2675
|
+
// src_hash on the FAILURE result too — the changes-watcher compares it to
|
|
2676
|
+
// decide "source changed since last build"; without it a failing script
|
|
2677
|
+
// recompiled on every self-save, forever.
|
|
2672
2678
|
doc.vite_build_res = {
|
|
2673
2679
|
code: -1,
|
|
2680
|
+
src_hash: js_src_hash(doc.scriptData?.value || ''),
|
|
2674
2681
|
data: err.message,
|
|
2675
2682
|
};
|
|
2676
|
-
console.error(doc);
|
|
2677
|
-
if (job_id) {
|
|
2683
|
+
console.error(doc._id, 'js compile failed:', String(err.message).slice(0, 300));
|
|
2684
|
+
if (job_id || req.return_result) {
|
|
2678
2685
|
return doc.vite_build_res;
|
|
2679
2686
|
}
|
|
2680
2687
|
db_module.save_app_couch_doc(app_id, doc);
|