@514labs/moose-lib 0.6.267-ci-5-gfe9b0c33 → 0.6.268
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/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/index.js +27 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -90
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +43 -135
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +43 -135
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -699,96 +699,33 @@ var getMooseInternal = () => globalThis.moose_internal;
|
|
|
699
699
|
if (getMooseInternal() === void 0) {
|
|
700
700
|
globalThis.moose_internal = moose_internal;
|
|
701
701
|
}
|
|
702
|
-
var
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
);
|
|
729
|
-
return indexLoadPromise;
|
|
730
|
-
}
|
|
731
|
-
if (indexLoadState === "loaded") {
|
|
732
|
-
console.log(
|
|
733
|
-
`${workerInfo} loadIndex: loaded by another worker during delay`
|
|
734
|
-
);
|
|
735
|
-
return;
|
|
702
|
+
var loadIndex = () => {
|
|
703
|
+
const registry = getMooseInternal();
|
|
704
|
+
registry.tables.clear();
|
|
705
|
+
registry.streams.clear();
|
|
706
|
+
registry.ingestApis.clear();
|
|
707
|
+
registry.apis.clear();
|
|
708
|
+
registry.sqlResources.clear();
|
|
709
|
+
registry.workflows.clear();
|
|
710
|
+
registry.webApps.clear();
|
|
711
|
+
const appDir = `${process2.cwd()}/${getSourceDir()}`;
|
|
712
|
+
Object.keys(__require.cache).forEach((key) => {
|
|
713
|
+
if (key.startsWith(appDir)) {
|
|
714
|
+
delete __require.cache[key];
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
try {
|
|
718
|
+
__require(`${process2.cwd()}/${getSourceDir()}/index.ts`);
|
|
719
|
+
} catch (error) {
|
|
720
|
+
let hint;
|
|
721
|
+
const details = error instanceof Error ? error.message : String(error);
|
|
722
|
+
if (details.includes("ERR_REQUIRE_ESM") || details.includes("ES Module")) {
|
|
723
|
+
hint = "The file or its dependencies are ESM-only. Switch to packages that dual-support CJS & ESM, or upgrade to Node 22.12+. If you must use Node 20, you may try Node 20.19\n\n";
|
|
724
|
+
}
|
|
725
|
+
const errorMsg = `${hint ?? ""}${details}`;
|
|
726
|
+
const cause = error instanceof Error ? error : void 0;
|
|
727
|
+
throw new Error(errorMsg, { cause });
|
|
736
728
|
}
|
|
737
|
-
indexLoadState = "loading";
|
|
738
|
-
indexLoadPromise = (async () => {
|
|
739
|
-
try {
|
|
740
|
-
console.log(`${workerInfo} loadIndex: clearing registry...`);
|
|
741
|
-
const clearStart = Date.now();
|
|
742
|
-
const registry = getMooseInternal();
|
|
743
|
-
registry.tables.clear();
|
|
744
|
-
registry.streams.clear();
|
|
745
|
-
registry.ingestApis.clear();
|
|
746
|
-
registry.apis.clear();
|
|
747
|
-
registry.sqlResources.clear();
|
|
748
|
-
registry.workflows.clear();
|
|
749
|
-
registry.webApps.clear();
|
|
750
|
-
console.log(
|
|
751
|
-
`${workerInfo} loadIndex: registry cleared in ${Date.now() - clearStart}ms`
|
|
752
|
-
);
|
|
753
|
-
console.log(`${workerInfo} loadIndex: clearing require cache...`);
|
|
754
|
-
const cacheStart = Date.now();
|
|
755
|
-
const appDir = `${process2.cwd()}/${getSourceDir()}`;
|
|
756
|
-
Object.keys(__require.cache).forEach((key) => {
|
|
757
|
-
if (key.startsWith(appDir)) {
|
|
758
|
-
delete __require.cache[key];
|
|
759
|
-
}
|
|
760
|
-
});
|
|
761
|
-
console.log(
|
|
762
|
-
`${workerInfo} loadIndex: require cache cleared in ${Date.now() - cacheStart}ms`
|
|
763
|
-
);
|
|
764
|
-
console.log(`${workerInfo} loadIndex: requiring index.ts...`);
|
|
765
|
-
const requireStart = Date.now();
|
|
766
|
-
__require(`${process2.cwd()}/${getSourceDir()}/index.ts`);
|
|
767
|
-
console.log(
|
|
768
|
-
`${workerInfo} loadIndex: require completed in ${Date.now() - requireStart}ms`
|
|
769
|
-
);
|
|
770
|
-
indexLoadState = "loaded";
|
|
771
|
-
console.log(
|
|
772
|
-
`${workerInfo} loadIndex: total load time ${Date.now() - startTime}ms`
|
|
773
|
-
);
|
|
774
|
-
} catch (error) {
|
|
775
|
-
console.error(
|
|
776
|
-
`${workerInfo} loadIndex: FAILED after ${Date.now() - startTime}ms`,
|
|
777
|
-
error
|
|
778
|
-
);
|
|
779
|
-
indexLoadState = "unloaded";
|
|
780
|
-
indexLoadPromise = null;
|
|
781
|
-
let hint;
|
|
782
|
-
const details = error instanceof Error ? error.message : String(error);
|
|
783
|
-
if (details.includes("ERR_REQUIRE_ESM") || details.includes("ES Module")) {
|
|
784
|
-
hint = "The file or its dependencies are ESM-only. Switch to packages that dual-support CJS & ESM, or upgrade to Node 22.12+. If you must use Node 20, you may try Node 20.19\n\n";
|
|
785
|
-
}
|
|
786
|
-
const errorMsg = `${hint ?? ""}${details}`;
|
|
787
|
-
const cause = error instanceof Error ? error : void 0;
|
|
788
|
-
throw new Error(errorMsg, { cause });
|
|
789
|
-
}
|
|
790
|
-
})();
|
|
791
|
-
return indexLoadPromise;
|
|
792
729
|
};
|
|
793
730
|
var dlqSchema = {
|
|
794
731
|
version: "3.1",
|
|
@@ -910,7 +847,7 @@ var dlqColumns = [
|
|
|
910
847
|
}
|
|
911
848
|
];
|
|
912
849
|
var getWorkflows = async () => {
|
|
913
|
-
|
|
850
|
+
loadIndex();
|
|
914
851
|
const registry = getMooseInternal();
|
|
915
852
|
return registry.workflows;
|
|
916
853
|
};
|