@trigger.dev/core 3.0.0-beta.19 → 3.0.0-beta.20

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/v3/index.mjs CHANGED
@@ -3,7 +3,6 @@ import { fromZodError } from 'zod-validation-error';
3
3
  import { z } from 'zod';
4
4
  import { AsyncLocalStorage } from 'node:async_hooks';
5
5
  import { PreciseDate } from '@google-cloud/precise-date';
6
- import nodePath from 'node:path';
7
6
  import { logs } from '@opentelemetry/api-logs';
8
7
  import humanizeDuration from 'humanize-duration';
9
8
 
@@ -2284,6 +2283,8 @@ var ClockAPI = _ClockAPI;
2284
2283
 
2285
2284
  // src/v3/clock-api.ts
2286
2285
  var clock = ClockAPI.getInstance();
2286
+
2287
+ // src/v3/errors.ts
2287
2288
  function parseError(error) {
2288
2289
  if (error instanceof Error) {
2289
2290
  return {
@@ -2340,23 +2341,23 @@ function correctErrorStackTrace(stackTrace, projectDir, options) {
2340
2341
  ].filter(Boolean).join("\n");
2341
2342
  }
2342
2343
  __name(correctErrorStackTrace, "correctErrorStackTrace");
2344
+ var LINES_TO_IGNORE = [
2345
+ /ConsoleInterceptor/,
2346
+ /TriggerTracer/,
2347
+ /TaskExecutor/,
2348
+ /EXECUTE_TASK_RUN/,
2349
+ /@trigger.dev\/core/,
2350
+ /safeJsonProcess/,
2351
+ /__entryPoint.ts/
2352
+ ];
2343
2353
  function correctStackTraceLine(line, projectDir) {
2344
- const regex = /at (.*?) \(?file:\/\/(\/.*?\.ts):(\d+):(\d+)\)?/;
2345
- const match = regex.exec(line);
2346
- if (!match) {
2347
- return;
2348
- }
2349
- const [_, identifier, path, lineNum, colNum] = match;
2350
- if (!path) {
2351
- return;
2352
- }
2353
- if (nodePath.basename(path) === "__entryPoint.ts") {
2354
+ if (LINES_TO_IGNORE.some((regex) => regex.test(line))) {
2354
2355
  return;
2355
2356
  }
2356
- if (projectDir && !path.includes(projectDir)) {
2357
+ if (projectDir && !line.includes(projectDir)) {
2357
2358
  return;
2358
2359
  }
2359
- return line;
2360
+ return line.trim();
2360
2361
  }
2361
2362
  __name(correctStackTraceLine, "correctStackTraceLine");
2362
2363
  function groupTaskMetadataIssuesByTask(tasks, issues) {