@neat.is/core 0.4.5 → 0.4.6
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/{chunk-6GXBAR3M.js → chunk-NON5AXOR.js} +36 -2
- package/dist/chunk-NON5AXOR.js.map +1 -0
- package/dist/cli.cjs +198 -74
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +187 -64
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +34 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/neatd.cjs +34 -0
- package/dist/neatd.cjs.map +1 -1
- package/dist/neatd.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-6GXBAR3M.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/neatd.cjs
CHANGED
|
@@ -5886,11 +5886,45 @@ async function startDaemon(opts = {}) {
|
|
|
5886
5886
|
});
|
|
5887
5887
|
};
|
|
5888
5888
|
process.on("SIGHUP", sighupHandler);
|
|
5889
|
+
const REGISTRY_RELOAD_DEBOUNCE_MS = 500;
|
|
5890
|
+
let registryWatcher = null;
|
|
5891
|
+
let reloadTimer = null;
|
|
5892
|
+
try {
|
|
5893
|
+
const regDir = import_node_path37.default.dirname(regPath);
|
|
5894
|
+
const regBase = import_node_path37.default.basename(regPath);
|
|
5895
|
+
registryWatcher = (0, import_node_fs22.watch)(regDir, (_eventType, filename) => {
|
|
5896
|
+
if (filename !== null && filename !== regBase) return;
|
|
5897
|
+
if (reloadTimer) clearTimeout(reloadTimer);
|
|
5898
|
+
reloadTimer = setTimeout(() => {
|
|
5899
|
+
reloadTimer = null;
|
|
5900
|
+
void reload().catch((err) => {
|
|
5901
|
+
console.warn(
|
|
5902
|
+
`neatd: registry-watch reload failed \u2014 ${err.message}`
|
|
5903
|
+
);
|
|
5904
|
+
});
|
|
5905
|
+
}, REGISTRY_RELOAD_DEBOUNCE_MS);
|
|
5906
|
+
});
|
|
5907
|
+
} catch (err) {
|
|
5908
|
+
console.warn(
|
|
5909
|
+
`neatd: failed to watch registry at ${regPath} \u2014 ${err.message}. Run \`neatd reload\` (or send SIGHUP) after registering new projects.`
|
|
5910
|
+
);
|
|
5911
|
+
}
|
|
5889
5912
|
let stopped = false;
|
|
5890
5913
|
const stop = async () => {
|
|
5891
5914
|
if (stopped) return;
|
|
5892
5915
|
stopped = true;
|
|
5893
5916
|
process.off("SIGHUP", sighupHandler);
|
|
5917
|
+
if (reloadTimer) {
|
|
5918
|
+
clearTimeout(reloadTimer);
|
|
5919
|
+
reloadTimer = null;
|
|
5920
|
+
}
|
|
5921
|
+
if (registryWatcher) {
|
|
5922
|
+
try {
|
|
5923
|
+
registryWatcher.close();
|
|
5924
|
+
} catch {
|
|
5925
|
+
}
|
|
5926
|
+
registryWatcher = null;
|
|
5927
|
+
}
|
|
5894
5928
|
if (otlpApp) await otlpApp.close().catch(() => {
|
|
5895
5929
|
});
|
|
5896
5930
|
if (restApp) await restApp.close().catch(() => {
|