@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.js CHANGED
@@ -741,6 +741,7 @@ init_commons();
741
741
  function getSourceDir() {
742
742
  return import_process.default.env.MOOSE_SOURCE_DIR || "app";
743
743
  }
744
+ var isClientOnlyMode = () => import_process.default.env.MOOSE_CLIENT_ONLY === "true";
744
745
  var moose_internal = {
745
746
  tables: /* @__PURE__ */ new Map(),
746
747
  streams: /* @__PURE__ */ new Map(),
@@ -942,7 +943,7 @@ var OlapTable = class extends TypedBase {
942
943
  this.name = name;
943
944
  const tables = getMooseInternal().tables;
944
945
  const registryKey = this.config.version ? `${name}_${this.config.version}` : name;
945
- if (tables.has(registryKey)) {
946
+ if (!isClientOnlyMode() && tables.has(registryKey)) {
946
947
  throw new Error(
947
948
  `OlapTable with name ${name} and version ${config?.version ?? "unversioned"} already exists`
948
949
  );
@@ -2424,7 +2425,7 @@ var SqlResource = class {
2424
2425
  */
2425
2426
  constructor(name, setup, teardown, options) {
2426
2427
  const sqlResources = getMooseInternal().sqlResources;
2427
- if (sqlResources.has(name)) {
2428
+ if (!isClientOnlyMode() && sqlResources.has(name)) {
2428
2429
  throw new Error(`SqlResource with name ${name} already exists`);
2429
2430
  }
2430
2431
  sqlResources.set(name, this);