@514labs/moose-lib 0.6.268-ci-2-g822d274c → 0.6.268-ci-2-gc52b4048

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.mjs CHANGED
@@ -685,7 +685,6 @@ function getSourceDir() {
685
685
  return process2.env.MOOSE_SOURCE_DIR || "app";
686
686
  }
687
687
  var isClientOnlyMode = () => process2.env.MOOSE_CLIENT_ONLY === "true";
688
- var isProductionMode = () => process2.env.NODE_ENV === "production";
689
688
  var moose_internal = {
690
689
  tables: /* @__PURE__ */ new Map(),
691
690
  streams: /* @__PURE__ */ new Map(),
@@ -700,11 +699,7 @@ var getMooseInternal = () => globalThis.moose_internal;
700
699
  if (getMooseInternal() === void 0) {
701
700
  globalThis.moose_internal = moose_internal;
702
701
  }
703
- var isRegistryEmpty = () => {
704
- const registry = getMooseInternal();
705
- return registry.tables.size === 0 && registry.streams.size === 0 && registry.ingestApis.size === 0 && registry.apis.size === 0 && registry.sqlResources.size === 0 && registry.workflows.size === 0 && registry.webApps.size === 0;
706
- };
707
- var reloadIndex = () => {
702
+ var loadIndex = () => {
708
703
  const registry = getMooseInternal();
709
704
  registry.tables.clear();
710
705
  registry.streams.clear();
@@ -713,14 +708,12 @@ var reloadIndex = () => {
713
708
  registry.sqlResources.clear();
714
709
  registry.workflows.clear();
715
710
  registry.webApps.clear();
716
- if (!isProductionMode()) {
717
- const appDir = `${process2.cwd()}/${getSourceDir()}`;
718
- Object.keys(__require.cache).forEach((key) => {
719
- if (key.startsWith(appDir)) {
720
- delete __require.cache[key];
721
- }
722
- });
723
- }
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
+ });
724
717
  try {
725
718
  __require(`${process2.cwd()}/${getSourceDir()}/index.ts`);
726
719
  } catch (error) {
@@ -734,11 +727,6 @@ var reloadIndex = () => {
734
727
  throw new Error(errorMsg, { cause });
735
728
  }
736
729
  };
737
- var ensureIndexLoaded = () => {
738
- if (isRegistryEmpty()) {
739
- reloadIndex();
740
- }
741
- };
742
730
  var dlqSchema = {
743
731
  version: "3.1",
744
732
  components: {
@@ -859,7 +847,7 @@ var dlqColumns = [
859
847
  }
860
848
  ];
861
849
  var getWorkflows = async () => {
862
- ensureIndexLoaded();
850
+ loadIndex();
863
851
  const registry = getMooseInternal();
864
852
  return registry.workflows;
865
853
  };