trigger.dev 3.0.0-beta.37 → 3.0.0-beta.39
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 +20 -14
- package/dist/index.js.map +1 -1
- package/dist/workers/dev/worker-facade.js +19 -3
- package/dist/workers/dev/worker-setup.js +1 -1
- package/dist/workers/prod/entry-point.js +4 -1
- package/dist/workers/prod/worker-facade.js +43 -11
- package/dist/workers/prod/worker-setup.js +3 -2
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -799,7 +799,7 @@ import invariant from "tiny-invariant";
|
|
|
799
799
|
import { z as z4 } from "zod";
|
|
800
800
|
|
|
801
801
|
// package.json
|
|
802
|
-
var version = "3.0.0-beta.
|
|
802
|
+
var version = "3.0.0-beta.39";
|
|
803
803
|
var dependencies = {
|
|
804
804
|
"@anatine/esbuild-decorators": "^0.2.19",
|
|
805
805
|
"@clack/prompts": "^0.7.0",
|
|
@@ -816,7 +816,7 @@ var dependencies = {
|
|
|
816
816
|
"@opentelemetry/sdk-trace-base": "^1.22.0",
|
|
817
817
|
"@opentelemetry/sdk-trace-node": "^1.22.0",
|
|
818
818
|
"@opentelemetry/semantic-conventions": "^1.22.0",
|
|
819
|
-
"@trigger.dev/core": "workspace:3.0.0-beta.
|
|
819
|
+
"@trigger.dev/core": "workspace:3.0.0-beta.39",
|
|
820
820
|
"@types/degit": "^2.8.3",
|
|
821
821
|
chalk: "^5.2.0",
|
|
822
822
|
chokidar: "^3.5.3",
|
|
@@ -913,7 +913,7 @@ var package_default = {
|
|
|
913
913
|
tsup: "^8.0.1",
|
|
914
914
|
"type-fest": "^3.6.0",
|
|
915
915
|
typescript: "^5.3.3",
|
|
916
|
-
vitest: "^
|
|
916
|
+
vitest: "^1.6.0",
|
|
917
917
|
"xdg-app-paths": "^8.3.0"
|
|
918
918
|
},
|
|
919
919
|
scripts: {
|
|
@@ -928,7 +928,8 @@ var package_default = {
|
|
|
928
928
|
"dev:test": "nodemon -w src/Containerfile.prod -x npm run build:prod-containerfile",
|
|
929
929
|
clean: "rimraf dist",
|
|
930
930
|
start: "node dist/index.js",
|
|
931
|
-
test: "vitest"
|
|
931
|
+
test: "vitest",
|
|
932
|
+
"test:e2e": "vitest --run -c e2e/vite.config.js"
|
|
932
933
|
},
|
|
933
934
|
dependencies,
|
|
934
935
|
engines: {
|
|
@@ -1602,8 +1603,8 @@ async function gatherTaskFilesFromDir(dirPath, triggerDir, config) {
|
|
|
1602
1603
|
}
|
|
1603
1604
|
return taskFiles;
|
|
1604
1605
|
}
|
|
1605
|
-
function resolveTriggerDirectories(dirs) {
|
|
1606
|
-
return dirs.map((dir) => resolve(dir));
|
|
1606
|
+
function resolveTriggerDirectories(projectDir, dirs) {
|
|
1607
|
+
return dirs.map((dir) => resolve(projectDir, dir));
|
|
1607
1608
|
}
|
|
1608
1609
|
var IGNORED_DIRS = ["node_modules", ".git", "dist", "build"];
|
|
1609
1610
|
async function findTriggerDirectories(dirPath) {
|
|
@@ -1703,7 +1704,7 @@ async function findFilePath(dir, fileName) {
|
|
|
1703
1704
|
return result;
|
|
1704
1705
|
}
|
|
1705
1706
|
async function readConfig(dir, options) {
|
|
1706
|
-
const absoluteDir = path2.resolve(process.cwd(), dir);
|
|
1707
|
+
const absoluteDir = path2.resolve(options?.cwd || process.cwd(), dir);
|
|
1707
1708
|
const configPath = await getConfigPath(dir, options?.configFile);
|
|
1708
1709
|
if (!configPath) {
|
|
1709
1710
|
if (options?.projectRef) {
|
|
@@ -1776,7 +1777,7 @@ async function resolveConfig(path7, config) {
|
|
|
1776
1777
|
if (!config.triggerDirectories) {
|
|
1777
1778
|
config.triggerDirectories = await findTriggerDirectories(path7);
|
|
1778
1779
|
}
|
|
1779
|
-
config.triggerDirectories = resolveTriggerDirectories(config.triggerDirectories);
|
|
1780
|
+
config.triggerDirectories = resolveTriggerDirectories(path7, config.triggerDirectories);
|
|
1780
1781
|
logger.debug("Resolved trigger directories", { triggerDirectories: config.triggerDirectories });
|
|
1781
1782
|
if (!config.triggerUrl) {
|
|
1782
1783
|
config.triggerUrl = CLOUD_API_URL;
|
|
@@ -2682,7 +2683,7 @@ async function login(options) {
|
|
|
2682
2683
|
if (accessTokenFromEnv) {
|
|
2683
2684
|
const auth = {
|
|
2684
2685
|
accessToken: accessTokenFromEnv,
|
|
2685
|
-
apiUrl: process.env.TRIGGER_API_URL ?? "https://api.trigger.dev"
|
|
2686
|
+
apiUrl: process.env.TRIGGER_API_URL ?? opts.defaultApiUrl ?? "https://api.trigger.dev"
|
|
2686
2687
|
};
|
|
2687
2688
|
const apiClient3 = new CliApiClient(auth.apiUrl, auth.accessToken);
|
|
2688
2689
|
const userData = await apiClient3.whoAmI();
|
|
@@ -4653,7 +4654,7 @@ async function compileProject(config, options, configPath) {
|
|
|
4653
4654
|
return await tracer.startActiveSpan("compileProject", async (span) => {
|
|
4654
4655
|
try {
|
|
4655
4656
|
if (!options.skipTypecheck) {
|
|
4656
|
-
const typecheck = await typecheckProject(config
|
|
4657
|
+
const typecheck = await typecheckProject(config);
|
|
4657
4658
|
if (!typecheck) {
|
|
4658
4659
|
throw new Error("Typecheck failed, aborting deployment");
|
|
4659
4660
|
}
|
|
@@ -4851,8 +4852,7 @@ If this is unexpected you should check your ${terminalLink2(
|
|
|
4851
4852
|
const resolvingDependenciesResult = await resolveDependencies(
|
|
4852
4853
|
tempDir,
|
|
4853
4854
|
packageJsonContents,
|
|
4854
|
-
config
|
|
4855
|
-
options
|
|
4855
|
+
config
|
|
4856
4856
|
);
|
|
4857
4857
|
if (!resolvingDependenciesResult) {
|
|
4858
4858
|
throw new SkipLoggingError("Failed to resolve dependencies");
|
|
@@ -4931,14 +4931,17 @@ async function resolveEnvironmentVariables(config, apiClient2, options) {
|
|
|
4931
4931
|
});
|
|
4932
4932
|
if (uploadResult.success) {
|
|
4933
4933
|
$spinner.stop(`${total} environment variable${total > 1 ? "s" : ""} synced`);
|
|
4934
|
+
return;
|
|
4934
4935
|
} else {
|
|
4935
4936
|
$spinner.stop("Failed to sync environment variables");
|
|
4936
4937
|
throw new Error(uploadResult.error);
|
|
4937
4938
|
}
|
|
4938
4939
|
} else {
|
|
4939
4940
|
$spinner.stop("No environment variables to sync");
|
|
4941
|
+
return;
|
|
4940
4942
|
}
|
|
4941
4943
|
}
|
|
4944
|
+
$spinner.stop("Environment variables resolved");
|
|
4942
4945
|
} catch (e) {
|
|
4943
4946
|
recordSpanException5(span, e);
|
|
4944
4947
|
throw e;
|
|
@@ -4947,7 +4950,7 @@ async function resolveEnvironmentVariables(config, apiClient2, options) {
|
|
|
4947
4950
|
}
|
|
4948
4951
|
});
|
|
4949
4952
|
}
|
|
4950
|
-
async function resolveDependencies(projectDir, packageJsonContents, config
|
|
4953
|
+
async function resolveDependencies(projectDir, packageJsonContents, config) {
|
|
4951
4954
|
return await tracer.startActiveSpan("resolveDependencies", async (span) => {
|
|
4952
4955
|
const resolvingDepsSpinner = spinner();
|
|
4953
4956
|
resolvingDepsSpinner.start("Resolving dependencies");
|
|
@@ -5049,7 +5052,7 @@ ${chalkError("X Error:")} The package ${chalkPurple(
|
|
|
5049
5052
|
}
|
|
5050
5053
|
});
|
|
5051
5054
|
}
|
|
5052
|
-
async function typecheckProject(config
|
|
5055
|
+
async function typecheckProject(config) {
|
|
5053
5056
|
return await tracer.startActiveSpan("typecheckProject", async (span) => {
|
|
5054
5057
|
try {
|
|
5055
5058
|
const typecheckSpinner = spinner();
|
|
@@ -5991,6 +5994,9 @@ var TaskRunProcess = class {
|
|
|
5991
5994
|
switch (message.type) {
|
|
5992
5995
|
case "TASK_RUN_COMPLETED": {
|
|
5993
5996
|
const { result, execution } = message.payload;
|
|
5997
|
+
logger.debug(`[${this.runId}] task run completed`, {
|
|
5998
|
+
result
|
|
5999
|
+
});
|
|
5994
6000
|
const promiseStatus = this._attemptStatuses.get(execution.attempt.id);
|
|
5995
6001
|
if (promiseStatus !== "PENDING") {
|
|
5996
6002
|
return;
|