@514labs/moose-lib 0.6.238-ci-6-g1a6f273f → 0.6.239-ci-14-g85f6cfc1

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.
Files changed (35) hide show
  1. package/dist/{browserCompatible-CKgEUuZc.d.ts → browserCompatible-bG7qUssc.d.mts} +2 -26
  2. package/dist/{browserCompatible-DCc9Zd_X.d.mts → browserCompatible-mRmtV1to.d.ts} +2 -26
  3. package/dist/browserCompatible.d.mts +2 -2
  4. package/dist/browserCompatible.d.ts +2 -2
  5. package/dist/browserCompatible.js +43 -25
  6. package/dist/browserCompatible.js.map +1 -1
  7. package/dist/browserCompatible.mjs +43 -25
  8. package/dist/browserCompatible.mjs.map +1 -1
  9. package/dist/compilerPlugin.js +1 -25
  10. package/dist/compilerPlugin.js.map +1 -1
  11. package/dist/compilerPlugin.mjs +1 -25
  12. package/dist/compilerPlugin.mjs.map +1 -1
  13. package/dist/dataModels/toDataModels.js +1 -25
  14. package/dist/dataModels/toDataModels.js.map +1 -1
  15. package/dist/dataModels/toDataModels.mjs +1 -25
  16. package/dist/dataModels/toDataModels.mjs.map +1 -1
  17. package/dist/dmv2/index.d.mts +1 -1
  18. package/dist/dmv2/index.d.ts +1 -1
  19. package/dist/dmv2/index.js +43 -25
  20. package/dist/dmv2/index.js.map +1 -1
  21. package/dist/dmv2/index.mjs +43 -25
  22. package/dist/dmv2/index.mjs.map +1 -1
  23. package/dist/{index-CYFF3a0J.d.mts → index-DtHRzX8Z.d.mts} +12 -1
  24. package/dist/{index-CYFF3a0J.d.ts → index-DtHRzX8Z.d.ts} +12 -1
  25. package/dist/index.d.mts +3 -3
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +43 -25
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +43 -25
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/moose-runner.js +5 -2
  32. package/dist/moose-runner.js.map +1 -1
  33. package/dist/moose-runner.mjs +5 -2
  34. package/dist/moose-runner.mjs.map +1 -1
  35. package/package.json +1 -1
@@ -351,24 +351,39 @@ var init_runtime = __esm({
351
351
  }
352
352
  });
353
353
 
354
- // src/dmv2/typedBase.ts
355
- function getInstantiationFileInfo(stack) {
354
+ // src/dmv2/utils/stackTrace.ts
355
+ function shouldSkipStackLine(line) {
356
+ return line.includes("node_modules") || // Skip npm installed packages (prod)
357
+ line.includes("internal/modules") || // Skip Node.js internals
358
+ line.includes("ts-node") || // Skip TypeScript execution
359
+ line.includes("/ts-moose-lib/") || // Skip dev/linked moose-lib (Unix)
360
+ line.includes("\\ts-moose-lib\\");
361
+ }
362
+ function parseStackLine(line) {
363
+ const match = line.match(/\((.*):(\d+):(\d+)\)/) || line.match(/at (.*):(\d+):(\d+)/);
364
+ if (match && match[1]) {
365
+ return {
366
+ file: match[1],
367
+ line: match[2]
368
+ };
369
+ }
370
+ return void 0;
371
+ }
372
+ function getSourceFileInfo(stack) {
356
373
  if (!stack) return {};
357
374
  const lines = stack.split("\n");
358
375
  for (const line of lines) {
359
- if (line.includes("node_modules") || line.includes("internal/modules") || line.includes("ts-node"))
360
- continue;
361
- const match = line.match(/\((.*):(\d+):(\d+)\)/) || line.match(/at (.*):(\d+):(\d+)/);
362
- if (match && match[1]) {
363
- return {
364
- file: match[1],
365
- line: match[2]
366
- // Only the line number
367
- };
368
- }
376
+ if (shouldSkipStackLine(line)) continue;
377
+ const info = parseStackLine(line);
378
+ if (info) return info;
369
379
  }
370
380
  return {};
371
381
  }
382
+ function getSourceFileFromStack(stack) {
383
+ return getSourceFileInfo(stack).file;
384
+ }
385
+
386
+ // src/dmv2/typedBase.ts
372
387
  var TypedBase = class {
373
388
  /** The JSON schema representation of type T. Injected by the compiler plugin. */
374
389
  schema;
@@ -412,7 +427,7 @@ var TypedBase = class {
412
427
  this.metadata = config?.metadata ? { ...config.metadata } : {};
413
428
  const stack = new Error().stack;
414
429
  if (stack) {
415
- const info = getInstantiationFileInfo(stack);
430
+ const info = getSourceFileInfo(stack);
416
431
  this.metadata.source = { file: info.file, line: info.line };
417
432
  } else {
418
433
  this.metadata.source = void 0;
@@ -616,8 +631,7 @@ var dlqColumns = [
616
631
  default: null,
617
632
  annotations: [],
618
633
  ttl: null,
619
- codec: null,
620
- materialized: null
634
+ codec: null
621
635
  },
622
636
  {
623
637
  name: "errorMessage",
@@ -628,8 +642,7 @@ var dlqColumns = [
628
642
  default: null,
629
643
  annotations: [],
630
644
  ttl: null,
631
- codec: null,
632
- materialized: null
645
+ codec: null
633
646
  },
634
647
  {
635
648
  name: "errorType",
@@ -640,8 +653,7 @@ var dlqColumns = [
640
653
  default: null,
641
654
  annotations: [],
642
655
  ttl: null,
643
- codec: null,
644
- materialized: null
656
+ codec: null
645
657
  },
646
658
  {
647
659
  name: "failedAt",
@@ -652,8 +664,7 @@ var dlqColumns = [
652
664
  default: null,
653
665
  annotations: [],
654
666
  ttl: null,
655
- codec: null,
656
- materialized: null
667
+ codec: null
657
668
  },
658
669
  {
659
670
  name: "source",
@@ -664,8 +675,7 @@ var dlqColumns = [
664
675
  default: null,
665
676
  annotations: [],
666
677
  ttl: null,
667
- codec: null,
668
- materialized: null
678
+ codec: null
669
679
  }
670
680
  ];
671
681
 
@@ -1552,8 +1562,10 @@ var Stream = class extends TypedBase {
1552
1562
  * @param config Optional configuration for this specific transformation step, like a version.
1553
1563
  */
1554
1564
  addTransform(destination, transformation, config) {
1565
+ const sourceFile = getSourceFileFromStack(new Error().stack);
1555
1566
  const transformConfig = {
1556
- ...config ?? {}
1567
+ ...config ?? {},
1568
+ sourceFile
1557
1569
  };
1558
1570
  if (transformConfig.deadLetterQueue === void 0) {
1559
1571
  transformConfig.deadLetterQueue = this.defaultDeadLetterQueue;
@@ -1580,8 +1592,10 @@ var Stream = class extends TypedBase {
1580
1592
  * @param config Optional configuration for this specific consumer, like a version.
1581
1593
  */
1582
1594
  addConsumer(consumer, config) {
1595
+ const sourceFile = getSourceFileFromStack(new Error().stack);
1583
1596
  const consumerConfig = {
1584
- ...config ?? {}
1597
+ ...config ?? {},
1598
+ sourceFile
1585
1599
  };
1586
1600
  if (consumerConfig.deadLetterQueue === void 0) {
1587
1601
  consumerConfig.deadLetterQueue = this.defaultDeadLetterQueue;
@@ -2168,6 +2182,8 @@ var SqlResource = class {
2168
2182
  pullsDataFrom;
2169
2183
  /** List of OlapTables or Views that this resource writes data to. */
2170
2184
  pushesDataTo;
2185
+ /** @internal Source file path where this resource was defined */
2186
+ sourceFile;
2171
2187
  /**
2172
2188
  * Creates a new SqlResource instance.
2173
2189
  * @param name The name of the resource.
@@ -2192,6 +2208,8 @@ var SqlResource = class {
2192
2208
  );
2193
2209
  this.pullsDataFrom = options?.pullsDataFrom ?? [];
2194
2210
  this.pushesDataTo = options?.pushesDataTo ?? [];
2211
+ const stack = new Error().stack;
2212
+ this.sourceFile = getSourceFileFromStack(stack);
2195
2213
  }
2196
2214
  };
2197
2215