trigger.dev 0.0.0-v3-prerelease-20240708165959 → 0.0.0-v3-prerelease-20240717092755
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/Containerfile.prod
CHANGED
|
@@ -43,12 +43,14 @@ ARG TRIGGER_DEPLOYMENT_ID
|
|
|
43
43
|
ARG TRIGGER_DEPLOYMENT_VERSION
|
|
44
44
|
ARG TRIGGER_CONTENT_HASH
|
|
45
45
|
ARG TRIGGER_PROJECT_REF
|
|
46
|
+
ARG NODE_EXTRA_CA_CERTS
|
|
46
47
|
|
|
47
48
|
ENV TRIGGER_PROJECT_ID=${TRIGGER_PROJECT_ID} \
|
|
48
49
|
TRIGGER_DEPLOYMENT_ID=${TRIGGER_DEPLOYMENT_ID} \
|
|
49
50
|
TRIGGER_DEPLOYMENT_VERSION=${TRIGGER_DEPLOYMENT_VERSION} \
|
|
50
51
|
TRIGGER_CONTENT_HASH=${TRIGGER_CONTENT_HASH} \
|
|
51
52
|
TRIGGER_PROJECT_REF=${TRIGGER_PROJECT_REF} \
|
|
53
|
+
NODE_EXTRA_CA_CERTS=${NODE_EXTRA_CA_CERTS} \
|
|
52
54
|
NODE_ENV=production
|
|
53
55
|
|
|
54
56
|
USER node
|
package/dist/index.js
CHANGED
|
@@ -798,11 +798,11 @@ 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-20240717092755";
|
|
802
802
|
var dependencies = {
|
|
803
803
|
"@anatine/esbuild-decorators": "^0.2.19",
|
|
804
804
|
"@clack/prompts": "^0.7.0",
|
|
805
|
-
"@depot/cli": "0.0.1-cli.2.
|
|
805
|
+
"@depot/cli": "0.0.1-cli.2.71.0",
|
|
806
806
|
"@opentelemetry/api": "^1.8.0",
|
|
807
807
|
"@opentelemetry/api-logs": "^0.49.1",
|
|
808
808
|
"@opentelemetry/exporter-logs-otlp-http": "^0.49.1",
|
|
@@ -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-20240717092755",
|
|
819
819
|
"@types/degit": "^2.8.3",
|
|
820
820
|
chalk: "^5.2.0",
|
|
821
821
|
chokidar: "^3.5.3",
|
|
@@ -1321,7 +1321,7 @@ function initializeTracing() {
|
|
|
1321
1321
|
resource,
|
|
1322
1322
|
spanLimits: {
|
|
1323
1323
|
attributeCountLimit: 1e3,
|
|
1324
|
-
attributeValueLengthLimit:
|
|
1324
|
+
attributeValueLengthLimit: 2048,
|
|
1325
1325
|
eventCountLimit: 100,
|
|
1326
1326
|
attributePerEventCountLimit: 100,
|
|
1327
1327
|
linkCountLimit: 10,
|
|
@@ -1793,6 +1793,13 @@ async function resolveConfig(path7, config) {
|
|
|
1793
1793
|
if (!config.tsconfigPath) {
|
|
1794
1794
|
config.tsconfigPath = await findFilePath(path7, "tsconfig.json");
|
|
1795
1795
|
}
|
|
1796
|
+
if (!config.additionalFiles) {
|
|
1797
|
+
config.additionalFiles = [];
|
|
1798
|
+
}
|
|
1799
|
+
if (config.extraCACerts) {
|
|
1800
|
+
config.additionalFiles.push(config.extraCACerts);
|
|
1801
|
+
config.extraCACerts = config.extraCACerts.replace(/^(\.[.]?\/)+/, "");
|
|
1802
|
+
}
|
|
1796
1803
|
return config;
|
|
1797
1804
|
}
|
|
1798
1805
|
async function normalizeConfig(config, overrides) {
|
|
@@ -4202,7 +4209,8 @@ ${authorization.error}`
|
|
|
4202
4209
|
buildPlatform: options.buildPlatform,
|
|
4203
4210
|
pushImage: options.push,
|
|
4204
4211
|
selfHostedRegistry: !!options.registry,
|
|
4205
|
-
noCache: options.noCache
|
|
4212
|
+
noCache: options.noCache,
|
|
4213
|
+
extraCACerts: resolvedConfig.config.extraCACerts
|
|
4206
4214
|
});
|
|
4207
4215
|
}
|
|
4208
4216
|
if (!deploymentResponse.data.externalBuildData) {
|
|
@@ -4226,7 +4234,8 @@ ${authorization.error}`
|
|
|
4226
4234
|
projectRef: resolvedConfig.config.project,
|
|
4227
4235
|
loadImage: options.loadImage,
|
|
4228
4236
|
buildPlatform: options.buildPlatform,
|
|
4229
|
-
noCache: options.noCache
|
|
4237
|
+
noCache: options.noCache,
|
|
4238
|
+
extraCACerts: resolvedConfig.config.extraCACerts
|
|
4230
4239
|
},
|
|
4231
4240
|
deploymentSpinner
|
|
4232
4241
|
);
|
|
@@ -4443,6 +4452,14 @@ Did you include it in config.additionalFiles? ${cliLink(
|
|
|
4443
4452
|
docs.config.prisma
|
|
4444
4453
|
)}`
|
|
4445
4454
|
},
|
|
4455
|
+
{
|
|
4456
|
+
regex: /@prisma\/client did not initialize yet/,
|
|
4457
|
+
message: `Prisma client not initialized yet.
|
|
4458
|
+
Did you forget to add the postinstall script? ${cliLink(
|
|
4459
|
+
"Config docs",
|
|
4460
|
+
docs.config.prisma
|
|
4461
|
+
)}`
|
|
4462
|
+
},
|
|
4446
4463
|
{
|
|
4447
4464
|
regex: /sh: 1: (?<packageOrBinary>.*): not found/,
|
|
4448
4465
|
message: `$packageOrBinary not found
|
|
@@ -4563,6 +4580,7 @@ async function buildAndPushImage(options, updater) {
|
|
|
4563
4580
|
`TRIGGER_CONTENT_HASH=${options.contentHash}`,
|
|
4564
4581
|
"--build-arg",
|
|
4565
4582
|
`TRIGGER_PROJECT_REF=${options.projectRef}`,
|
|
4583
|
+
...options.extraCACerts ? ["--build-arg", `NODE_EXTRA_CA_CERTS=${options.extraCACerts}`] : [],
|
|
4566
4584
|
"-t",
|
|
4567
4585
|
`${options.registryHost}/${options.imageTag}`,
|
|
4568
4586
|
".",
|
|
@@ -4653,6 +4671,7 @@ async function buildAndPushSelfHostedImage(options) {
|
|
|
4653
4671
|
`TRIGGER_CONTENT_HASH=${options.contentHash}`,
|
|
4654
4672
|
"--build-arg",
|
|
4655
4673
|
`TRIGGER_PROJECT_REF=${options.projectRef}`,
|
|
4674
|
+
...options.extraCACerts ? ["--build-arg", `NODE_EXTRA_CA_CERTS=${options.extraCACerts}`] : [],
|
|
4656
4675
|
"-t",
|
|
4657
4676
|
imageRef,
|
|
4658
4677
|
"."
|
|
@@ -5707,20 +5726,31 @@ var BackgroundWorker = class {
|
|
|
5707
5726
|
}, 2e4);
|
|
5708
5727
|
child.on("message", async (msg) => {
|
|
5709
5728
|
const message = this._handler.parseMessage(msg);
|
|
5710
|
-
if (message.
|
|
5729
|
+
if (!message.success) {
|
|
5711
5730
|
clearTimeout(timeout);
|
|
5712
5731
|
resolved = true;
|
|
5713
|
-
|
|
5732
|
+
reject(new Error(`Failed to parse message: ${message.error}`));
|
|
5714
5733
|
child.kill();
|
|
5715
|
-
|
|
5734
|
+
return;
|
|
5735
|
+
}
|
|
5736
|
+
if (message.data.type === "TASKS_READY" && !resolved) {
|
|
5716
5737
|
clearTimeout(timeout);
|
|
5717
5738
|
resolved = true;
|
|
5718
|
-
|
|
5739
|
+
resolve6(message.data.payload.tasks);
|
|
5719
5740
|
child.kill();
|
|
5720
|
-
} else if (message.type === "
|
|
5741
|
+
} else if (message.data.type === "UNCAUGHT_EXCEPTION") {
|
|
5721
5742
|
clearTimeout(timeout);
|
|
5722
5743
|
resolved = true;
|
|
5723
|
-
reject(
|
|
5744
|
+
reject(
|
|
5745
|
+
new UncaughtExceptionError(message.data.payload.error, message.data.payload.origin)
|
|
5746
|
+
);
|
|
5747
|
+
child.kill();
|
|
5748
|
+
} else if (message.data.type === "TASKS_FAILED_TO_PARSE") {
|
|
5749
|
+
clearTimeout(timeout);
|
|
5750
|
+
resolved = true;
|
|
5751
|
+
reject(
|
|
5752
|
+
new TaskMetadataParseError(message.data.payload.zodIssues, message.data.payload.tasks)
|
|
5753
|
+
);
|
|
5724
5754
|
child.kill();
|
|
5725
5755
|
}
|
|
5726
5756
|
});
|
|
@@ -6123,9 +6153,13 @@ var TaskRunProcess = class {
|
|
|
6123
6153
|
}
|
|
6124
6154
|
async #handleMessage(msg) {
|
|
6125
6155
|
const message = this._handler.parseMessage(msg);
|
|
6126
|
-
|
|
6156
|
+
if (!message.success) {
|
|
6157
|
+
logger.error(`Dropping message: ${message.error}`, { message });
|
|
6158
|
+
return;
|
|
6159
|
+
}
|
|
6160
|
+
switch (message.data.type) {
|
|
6127
6161
|
case "TASK_RUN_COMPLETED": {
|
|
6128
|
-
const { result, execution } = message.payload;
|
|
6162
|
+
const { result, execution } = message.data.payload;
|
|
6129
6163
|
logger.debug(`[${this.runId}] task run completed`, {
|
|
6130
6164
|
result
|
|
6131
6165
|
});
|
|
@@ -6151,7 +6185,7 @@ var TaskRunProcess = class {
|
|
|
6151
6185
|
if (this.messageId) {
|
|
6152
6186
|
this.onTaskRunHeartbeat.post(this.messageId);
|
|
6153
6187
|
} else {
|
|
6154
|
-
this.onTaskHeartbeat.post(message.payload.id);
|
|
6188
|
+
this.onTaskHeartbeat.post(message.data.payload.id);
|
|
6155
6189
|
}
|
|
6156
6190
|
break;
|
|
6157
6191
|
}
|
|
@@ -6460,10 +6494,14 @@ function useDev({
|
|
|
6460
6494
|
`${dashboardUrl}/projects/v3/${config.project}`
|
|
6461
6495
|
);
|
|
6462
6496
|
websocket.addEventListener("open", async (event) => {
|
|
6497
|
+
logger.debug("WebSocket opened", { event });
|
|
6463
6498
|
});
|
|
6464
6499
|
websocket.addEventListener("close", (event) => {
|
|
6500
|
+
logger.debug("WebSocket closed", { event });
|
|
6465
6501
|
});
|
|
6466
6502
|
websocket.addEventListener("error", (event) => {
|
|
6503
|
+
logger.log(`${chalkError("WebSocketError:")} ${event.error.message}`);
|
|
6504
|
+
logger.debug("WebSocket error", { event, rawError: event.error });
|
|
6467
6505
|
});
|
|
6468
6506
|
backgroundWorkerCoordinator.onWorkerTaskHeartbeat.attach(
|
|
6469
6507
|
async ({ worker, backgroundWorkerId, id }) => {
|
|
@@ -6521,29 +6559,40 @@ function useDev({
|
|
|
6521
6559
|
});
|
|
6522
6560
|
});
|
|
6523
6561
|
websocket.addEventListener("message", async (event) => {
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6562
|
+
try {
|
|
6563
|
+
const data = JSON.parse(
|
|
6564
|
+
typeof event.data === "string" ? event.data : new TextDecoder("utf-8").decode(event.data)
|
|
6565
|
+
);
|
|
6566
|
+
const messageHandler = new ZodMessageHandler2({
|
|
6567
|
+
schema: serverWebsocketMessages,
|
|
6568
|
+
messages: {
|
|
6569
|
+
SERVER_READY: async (payload) => {
|
|
6570
|
+
for (const worker of backgroundWorkerCoordinator.currentWorkers) {
|
|
6571
|
+
await sender.send("READY_FOR_TASKS", {
|
|
6572
|
+
backgroundWorkerId: worker.id,
|
|
6573
|
+
inProgressRuns: worker.worker.inProgressRuns
|
|
6574
|
+
});
|
|
6575
|
+
}
|
|
6576
|
+
},
|
|
6577
|
+
BACKGROUND_WORKER_MESSAGE: async (payload) => {
|
|
6578
|
+
await backgroundWorkerCoordinator.handleMessage(
|
|
6579
|
+
payload.backgroundWorkerId,
|
|
6580
|
+
payload.data
|
|
6581
|
+
);
|
|
6536
6582
|
}
|
|
6537
|
-
},
|
|
6538
|
-
BACKGROUND_WORKER_MESSAGE: async (payload) => {
|
|
6539
|
-
await backgroundWorkerCoordinator.handleMessage(
|
|
6540
|
-
payload.backgroundWorkerId,
|
|
6541
|
-
payload.data
|
|
6542
|
-
);
|
|
6543
6583
|
}
|
|
6584
|
+
});
|
|
6585
|
+
await messageHandler.handleMessage(data);
|
|
6586
|
+
} catch (error) {
|
|
6587
|
+
if (error instanceof Error) {
|
|
6588
|
+
logger.error("Error while handling websocket message", { error: error.message });
|
|
6589
|
+
} else {
|
|
6590
|
+
logger.error(
|
|
6591
|
+
"Unkown error while handling websocket message, use `-l debug` for additional output"
|
|
6592
|
+
);
|
|
6593
|
+
logger.debug("Error while handling websocket message", { error });
|
|
6544
6594
|
}
|
|
6545
|
-
}
|
|
6546
|
-
await messageHandler.handleMessage(data);
|
|
6595
|
+
}
|
|
6547
6596
|
});
|
|
6548
6597
|
let ctx;
|
|
6549
6598
|
let firstBuild = true;
|