@514labs/moose-lib 0.6.249 → 0.6.251

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
@@ -638,6 +638,7 @@ init_commons();
638
638
  function getSourceDir() {
639
639
  return process2.env.MOOSE_SOURCE_DIR || "app";
640
640
  }
641
+ var isClientOnlyMode = () => process2.env.MOOSE_CLIENT_ONLY === "true";
641
642
  var moose_internal = {
642
643
  tables: /* @__PURE__ */ new Map(),
643
644
  streams: /* @__PURE__ */ new Map(),
@@ -839,7 +840,7 @@ var OlapTable = class extends TypedBase {
839
840
  this.name = name;
840
841
  const tables = getMooseInternal().tables;
841
842
  const registryKey = this.config.version ? `${name}_${this.config.version}` : name;
842
- if (tables.has(registryKey)) {
843
+ if (!isClientOnlyMode() && tables.has(registryKey)) {
843
844
  throw new Error(
844
845
  `OlapTable with name ${name} and version ${config?.version ?? "unversioned"} already exists`
845
846
  );
@@ -2321,7 +2322,7 @@ var SqlResource = class {
2321
2322
  */
2322
2323
  constructor(name, setup, teardown, options) {
2323
2324
  const sqlResources = getMooseInternal().sqlResources;
2324
- if (sqlResources.has(name)) {
2325
+ if (!isClientOnlyMode() && sqlResources.has(name)) {
2325
2326
  throw new Error(`SqlResource with name ${name} already exists`);
2326
2327
  }
2327
2328
  sqlResources.set(name, this);