trigger.dev 0.0.0-v3-prerelease-20240628145956 → 0.0.0-v3-prerelease-20240629184757
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
|
@@ -798,7 +798,7 @@ import invariant from "tiny-invariant";
|
|
|
798
798
|
import { z as z4 } from "zod";
|
|
799
799
|
|
|
800
800
|
// package.json
|
|
801
|
-
var version = "0.0.0-v3-prerelease-
|
|
801
|
+
var version = "0.0.0-v3-prerelease-20240629184757";
|
|
802
802
|
var dependencies = {
|
|
803
803
|
"@anatine/esbuild-decorators": "^0.2.19",
|
|
804
804
|
"@clack/prompts": "^0.7.0",
|
|
@@ -815,7 +815,7 @@ var dependencies = {
|
|
|
815
815
|
"@opentelemetry/sdk-trace-base": "^1.22.0",
|
|
816
816
|
"@opentelemetry/sdk-trace-node": "^1.22.0",
|
|
817
817
|
"@opentelemetry/semantic-conventions": "^1.22.0",
|
|
818
|
-
"@trigger.dev/core": "workspace:0.0.0-v3-prerelease-
|
|
818
|
+
"@trigger.dev/core": "workspace:0.0.0-v3-prerelease-20240629184757",
|
|
819
819
|
"@types/degit": "^2.8.3",
|
|
820
820
|
chalk: "^5.2.0",
|
|
821
821
|
chokidar: "^3.5.3",
|
|
@@ -3348,6 +3348,7 @@ async function detectPackageManagerFromArtifacts(path7) {
|
|
|
3348
3348
|
case LOCKFILES.npm:
|
|
3349
3349
|
case LOCKFILES.npmShrinkwrap:
|
|
3350
3350
|
logger.debug("Found npm artifact", { foundPath });
|
|
3351
|
+
return "npm";
|
|
3351
3352
|
case LOCKFILES.bun:
|
|
3352
3353
|
logger.debug("Found bun artifact", { foundPath });
|
|
3353
3354
|
return "npm";
|
|
@@ -3377,10 +3378,53 @@ var JavascriptProject = class {
|
|
|
3377
3378
|
}
|
|
3378
3379
|
return this._packageJson;
|
|
3379
3380
|
}
|
|
3381
|
+
get allowedPackageJson() {
|
|
3382
|
+
const disallowedKeys = [
|
|
3383
|
+
"scripts",
|
|
3384
|
+
"devDependencies",
|
|
3385
|
+
"dependencies",
|
|
3386
|
+
"peerDependencies",
|
|
3387
|
+
"author",
|
|
3388
|
+
"contributors",
|
|
3389
|
+
"funding",
|
|
3390
|
+
"bugs",
|
|
3391
|
+
"files",
|
|
3392
|
+
"keywords",
|
|
3393
|
+
"main",
|
|
3394
|
+
"module",
|
|
3395
|
+
"type",
|
|
3396
|
+
"bin",
|
|
3397
|
+
"browser",
|
|
3398
|
+
"man",
|
|
3399
|
+
"directories",
|
|
3400
|
+
"repository",
|
|
3401
|
+
"peerDependenciesMeta",
|
|
3402
|
+
"optionalDependencies",
|
|
3403
|
+
"engines",
|
|
3404
|
+
"os",
|
|
3405
|
+
"cpu",
|
|
3406
|
+
"private",
|
|
3407
|
+
"publishConfig",
|
|
3408
|
+
"workspaces"
|
|
3409
|
+
];
|
|
3410
|
+
return Object.keys(this.packageJson).reduce(
|
|
3411
|
+
(acc, key) => {
|
|
3412
|
+
if (!disallowedKeys.includes(key)) {
|
|
3413
|
+
acc[key] = this.packageJson[key];
|
|
3414
|
+
}
|
|
3415
|
+
return acc;
|
|
3416
|
+
},
|
|
3417
|
+
{}
|
|
3418
|
+
);
|
|
3419
|
+
}
|
|
3380
3420
|
get scripts() {
|
|
3381
|
-
return
|
|
3382
|
-
|
|
3383
|
-
|
|
3421
|
+
return this.#filterScripts();
|
|
3422
|
+
}
|
|
3423
|
+
#filterScripts() {
|
|
3424
|
+
if (!this.packageJson.scripts || typeof this.packageJson.scripts !== "object") {
|
|
3425
|
+
return {};
|
|
3426
|
+
}
|
|
3427
|
+
return this.packageJson.scripts;
|
|
3384
3428
|
}
|
|
3385
3429
|
async install() {
|
|
3386
3430
|
const command = await this.#getCommand();
|
|
@@ -4263,6 +4307,10 @@ ${authorization.error}`
|
|
|
4263
4307
|
"View deployment",
|
|
4264
4308
|
`${authorization.dashboardUrl}/projects/v3/${resolvedConfig.config.project}/deployments/${finishedDeployment.shortCode}`
|
|
4265
4309
|
);
|
|
4310
|
+
const testLink = cliLink(
|
|
4311
|
+
"Test tasks",
|
|
4312
|
+
`${authorization.dashboardUrl}/projects/v3/${resolvedConfig.config.project}/test?environment=${options.env === "prod" ? "prod" : "stg"}`
|
|
4313
|
+
);
|
|
4266
4314
|
switch (finishedDeployment.status) {
|
|
4267
4315
|
case "DEPLOYED": {
|
|
4268
4316
|
if (warnings.warnings.length > 0) {
|
|
@@ -4278,7 +4326,7 @@ ${authorization.error}`
|
|
|
4278
4326
|
);
|
|
4279
4327
|
} else {
|
|
4280
4328
|
outro5(
|
|
4281
|
-
`Version ${version2} deployed with ${taskCount} detected task${taskCount === 1 ? "" : "s"} ${deploymentLink}`
|
|
4329
|
+
`Version ${version2} deployed with ${taskCount} detected task${taskCount === 1 ? "" : "s"} | ${deploymentLink} | ${testLink}`
|
|
4282
4330
|
);
|
|
4283
4331
|
}
|
|
4284
4332
|
break;
|
|
@@ -4882,9 +4930,7 @@ async function compileProject(config, options, configPath) {
|
|
|
4882
4930
|
const dependencies2 = await resolveRequiredDependencies(allImports, config, javascriptProject);
|
|
4883
4931
|
logger.debug("gatherRequiredDependencies()", { dependencies: dependencies2 });
|
|
4884
4932
|
const packageJsonContents = {
|
|
4885
|
-
|
|
4886
|
-
version: "0.0.0",
|
|
4887
|
-
description: "",
|
|
4933
|
+
...javascriptProject.allowedPackageJson,
|
|
4888
4934
|
dependencies: dependencies2,
|
|
4889
4935
|
scripts: {
|
|
4890
4936
|
...javascriptProject.scripts,
|
|
@@ -5379,7 +5425,7 @@ var SigKillTimeoutProcessError = class extends Error {
|
|
|
5379
5425
|
this.name = "SigKillTimeoutProcessError";
|
|
5380
5426
|
}
|
|
5381
5427
|
};
|
|
5382
|
-
function getFriendlyErrorMessage(code, signal, stderr) {
|
|
5428
|
+
function getFriendlyErrorMessage(code, signal, stderr, dockerMode = true) {
|
|
5383
5429
|
const message = (text3) => {
|
|
5384
5430
|
if (signal) {
|
|
5385
5431
|
return `[${signal}] ${text3}`;
|
|
@@ -5387,7 +5433,18 @@ function getFriendlyErrorMessage(code, signal, stderr) {
|
|
|
5387
5433
|
return text3;
|
|
5388
5434
|
}
|
|
5389
5435
|
};
|
|
5390
|
-
if (code === 137
|
|
5436
|
+
if (code === 137) {
|
|
5437
|
+
if (dockerMode) {
|
|
5438
|
+
return message(
|
|
5439
|
+
"Process ran out of memory! Try choosing a machine preset with more memory for this task."
|
|
5440
|
+
);
|
|
5441
|
+
} else {
|
|
5442
|
+
return message(
|
|
5443
|
+
"Process most likely ran out of memory, but we can't be certain. Try choosing a machine preset with more memory for this task."
|
|
5444
|
+
);
|
|
5445
|
+
}
|
|
5446
|
+
}
|
|
5447
|
+
if (stderr?.includes("OOMErrorHandler")) {
|
|
5391
5448
|
return message(
|
|
5392
5449
|
"Process ran out of memory! Try choosing a machine preset with more memory for this task."
|
|
5393
5450
|
);
|
|
@@ -6782,13 +6839,18 @@ ${stderr}`);
|
|
|
6782
6839
|
logger.error(error);
|
|
6783
6840
|
});
|
|
6784
6841
|
return () => {
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6842
|
+
const cleanup = async () => {
|
|
6843
|
+
logger.debug(`Shutting down dev session for ${config.project}`);
|
|
6844
|
+
const start = Date.now();
|
|
6845
|
+
await taskFileWatcher.close();
|
|
6846
|
+
websocket?.close();
|
|
6847
|
+
backgroundWorkerCoordinator.close();
|
|
6848
|
+
ctx?.dispose().catch((error) => {
|
|
6849
|
+
console.error(error);
|
|
6850
|
+
});
|
|
6851
|
+
logger.debug(`Shutdown completed in ${Date.now() - start}ms`);
|
|
6852
|
+
};
|
|
6853
|
+
cleanup();
|
|
6792
6854
|
};
|
|
6793
6855
|
}, [config, apiUrl, apiKey, environmentClient]);
|
|
6794
6856
|
}
|