trigger.dev 0.0.0-v3-canary-20240321162743 → 0.0.0-v3-canary-20240321164857

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
@@ -800,7 +800,7 @@ import invariant from "tiny-invariant";
800
800
  import { z as z4 } from "zod";
801
801
 
802
802
  // package.json
803
- var version = "0.0.0-v3-canary-20240321162743";
803
+ var version = "0.0.0-v3-canary-20240321164857";
804
804
  var dependencies = {
805
805
  "@baselime/node-opentelemetry": "^0.4.6",
806
806
  "@clack/prompts": "^0.7.0",
@@ -821,7 +821,7 @@ var dependencies = {
821
821
  "@opentelemetry/sdk-trace-node": "^1.21.0",
822
822
  "@opentelemetry/semantic-conventions": "^1.21.0",
823
823
  "@traceloop/instrumentation-openai": "^0.3.9",
824
- "@trigger.dev/core": "workspace:0.0.0-v3-canary-20240321162743",
824
+ "@trigger.dev/core": "workspace:0.0.0-v3-canary-20240321164857",
825
825
  "@types/degit": "^2.8.3",
826
826
  chalk: "^5.2.0",
827
827
  chokidar: "^3.5.3",
@@ -2626,6 +2626,7 @@ ${authorizationCodeResult.error}`
2626
2626
  }
2627
2627
 
2628
2628
  // src/utilities/build.ts
2629
+ import { createRequire } from "node:module";
2629
2630
  function bundleDependenciesPlugin(config) {
2630
2631
  return {
2631
2632
  name: "bundle-dependencies",
@@ -2636,12 +2637,17 @@ function bundleDependenciesPlugin(config) {
2636
2637
  }
2637
2638
  for (let pattern of config.dependenciesToBundle ?? []) {
2638
2639
  if (typeof pattern === "string" ? args.path === pattern : pattern.test(args.path)) {
2639
- const resolvedPath = __require.resolve(args.path);
2640
- logger.debug(`Bundling ${args.path} as ${resolvedPath}`);
2641
- return {
2642
- path: resolvedPath,
2643
- external: false
2644
- };
2640
+ try {
2641
+ const resolvedPath = resolvePath(args.path);
2642
+ logger.debug(`Bundling ${args.path} as ${resolvedPath}`);
2643
+ return {
2644
+ path: resolvedPath,
2645
+ external: false
2646
+ };
2647
+ } catch (error) {
2648
+ logger.error(`Failed to resolve path ${args.path}`, error);
2649
+ return void 0;
2650
+ }
2645
2651
  }
2646
2652
  }
2647
2653
  return void 0;
@@ -2649,6 +2655,21 @@ function bundleDependenciesPlugin(config) {
2649
2655
  }
2650
2656
  };
2651
2657
  }
2658
+ function resolvePath(path6) {
2659
+ try {
2660
+ logger.debug("[bundle-dependencies] Attempting to resolve path using ESM resolver", {
2661
+ path: path6,
2662
+ importMetaUrl: import.meta.url
2663
+ });
2664
+ return createRequire(import.meta.url).resolve(path6);
2665
+ } catch (error) {
2666
+ logger.debug("[bundle-dependencies] Failed. Falling back to require.resolve", {
2667
+ path: path6,
2668
+ error
2669
+ });
2670
+ return __require.resolve(path6);
2671
+ }
2672
+ }
2652
2673
 
2653
2674
  // src/commands/deploy.ts
2654
2675
  var DeployCommandOptions = CommonCommandOptions.extend({