trigger.dev 3.0.0-beta.35 → 3.0.0-beta.37
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
|
@@ -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.37";
|
|
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.37",
|
|
820
820
|
"@types/degit": "^2.8.3",
|
|
821
821
|
chalk: "^5.2.0",
|
|
822
822
|
chokidar: "^3.5.3",
|
|
@@ -950,10 +950,9 @@ import {
|
|
|
950
950
|
GetProjectsResponseBody,
|
|
951
951
|
GetProjectResponseBody,
|
|
952
952
|
EnvironmentVariableResponseBody,
|
|
953
|
-
TaskRunExecution
|
|
954
|
-
APIError
|
|
953
|
+
TaskRunExecution
|
|
955
954
|
} from "@trigger.dev/core/v3";
|
|
956
|
-
import { zodfetch } from "@trigger.dev/core/v3/zodfetch";
|
|
955
|
+
import { zodfetch, ApiError } from "@trigger.dev/core/v3/zodfetch";
|
|
957
956
|
var CliApiClient = class {
|
|
958
957
|
constructor(apiURL, accessToken) {
|
|
959
958
|
this.accessToken = accessToken;
|
|
@@ -1151,7 +1150,7 @@ async function wrapZodFetch(schema, url, requestInit) {
|
|
|
1151
1150
|
data: response
|
|
1152
1151
|
};
|
|
1153
1152
|
} catch (error) {
|
|
1154
|
-
if (error instanceof
|
|
1153
|
+
if (error instanceof ApiError) {
|
|
1155
1154
|
return {
|
|
1156
1155
|
success: false,
|
|
1157
1156
|
error: error.message
|
|
@@ -1186,55 +1185,6 @@ import {
|
|
|
1186
1185
|
SEMRESATTRS_SERVICE_NAME,
|
|
1187
1186
|
SEMRESATTRS_SERVICE_VERSION
|
|
1188
1187
|
} from "@opentelemetry/semantic-conventions";
|
|
1189
|
-
function initializeTracing() {
|
|
1190
|
-
if (process.argv.includes("--skip-telemetry") || process.env.TRIGGER_DEV_SKIP_TELEMETRY) {
|
|
1191
|
-
return;
|
|
1192
|
-
}
|
|
1193
|
-
if (process.env.OTEL_INTERNAL_DIAG_DEBUG) {
|
|
1194
|
-
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
|
|
1195
|
-
}
|
|
1196
|
-
const resource = detectResourcesSync({
|
|
1197
|
-
detectors: [processDetectorSync]
|
|
1198
|
-
}).merge(
|
|
1199
|
-
new Resource({
|
|
1200
|
-
[SEMRESATTRS_SERVICE_NAME]: "trigger.dev cli v3",
|
|
1201
|
-
[SEMRESATTRS_SERVICE_VERSION]: version
|
|
1202
|
-
})
|
|
1203
|
-
);
|
|
1204
|
-
const traceProvider = new NodeTracerProvider({
|
|
1205
|
-
forceFlushTimeoutMillis: 500,
|
|
1206
|
-
resource,
|
|
1207
|
-
spanLimits: {
|
|
1208
|
-
attributeCountLimit: 1e3,
|
|
1209
|
-
attributeValueLengthLimit: 1e3,
|
|
1210
|
-
eventCountLimit: 100,
|
|
1211
|
-
attributePerEventCountLimit: 100,
|
|
1212
|
-
linkCountLimit: 10,
|
|
1213
|
-
attributePerLinkCountLimit: 100
|
|
1214
|
-
}
|
|
1215
|
-
});
|
|
1216
|
-
const spanExporter = new OTLPTraceExporter({
|
|
1217
|
-
url: "https://otel.baselime.io/v1",
|
|
1218
|
-
timeoutMillis: 5e3,
|
|
1219
|
-
headers: {
|
|
1220
|
-
"x-api-key": "b6e0fbbaf8dc2524773d2152ae2e9eb5c7fbaa52"
|
|
1221
|
-
}
|
|
1222
|
-
});
|
|
1223
|
-
const spanProcessor = new SimpleSpanProcessor(spanExporter);
|
|
1224
|
-
traceProvider.addSpanProcessor(spanProcessor);
|
|
1225
|
-
traceProvider.register();
|
|
1226
|
-
registerInstrumentations({
|
|
1227
|
-
instrumentations: [new FetchInstrumentation()]
|
|
1228
|
-
});
|
|
1229
|
-
return traceProvider;
|
|
1230
|
-
}
|
|
1231
|
-
var provider = initializeTracing();
|
|
1232
|
-
function getTracer() {
|
|
1233
|
-
return trace.getTracer("trigger.dev cli v3", version);
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
// src/cli/common.ts
|
|
1237
|
-
import { fromZodError } from "zod-validation-error";
|
|
1238
1188
|
|
|
1239
1189
|
// src/utilities/logger.ts
|
|
1240
1190
|
import { format } from "node:util";
|
|
@@ -1349,7 +1299,58 @@ var Logger = class {
|
|
|
1349
1299
|
};
|
|
1350
1300
|
var logger = new Logger();
|
|
1351
1301
|
|
|
1302
|
+
// src/telemetry/tracing.ts
|
|
1303
|
+
function initializeTracing() {
|
|
1304
|
+
if (process.argv.includes("--skip-telemetry") || process.env.TRIGGER_DEV_SKIP_TELEMETRY || // only for backwards compat
|
|
1305
|
+
process.env.TRIGGER_TELEMETRY_DISABLED) {
|
|
1306
|
+
logger.debug("\u{1F4C9} Telemetry disabled");
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
if (process.env.OTEL_INTERNAL_DIAG_DEBUG) {
|
|
1310
|
+
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
|
|
1311
|
+
}
|
|
1312
|
+
const resource = detectResourcesSync({
|
|
1313
|
+
detectors: [processDetectorSync]
|
|
1314
|
+
}).merge(
|
|
1315
|
+
new Resource({
|
|
1316
|
+
[SEMRESATTRS_SERVICE_NAME]: "trigger.dev cli v3",
|
|
1317
|
+
[SEMRESATTRS_SERVICE_VERSION]: version
|
|
1318
|
+
})
|
|
1319
|
+
);
|
|
1320
|
+
const traceProvider = new NodeTracerProvider({
|
|
1321
|
+
forceFlushTimeoutMillis: 3e4,
|
|
1322
|
+
resource,
|
|
1323
|
+
spanLimits: {
|
|
1324
|
+
attributeCountLimit: 1e3,
|
|
1325
|
+
attributeValueLengthLimit: 1e3,
|
|
1326
|
+
eventCountLimit: 100,
|
|
1327
|
+
attributePerEventCountLimit: 100,
|
|
1328
|
+
linkCountLimit: 10,
|
|
1329
|
+
attributePerLinkCountLimit: 100
|
|
1330
|
+
}
|
|
1331
|
+
});
|
|
1332
|
+
const spanExporter = new OTLPTraceExporter({
|
|
1333
|
+
url: "https://otel.baselime.io/v1",
|
|
1334
|
+
timeoutMillis: 5e3,
|
|
1335
|
+
headers: {
|
|
1336
|
+
"x-api-key": "b6e0fbbaf8dc2524773d2152ae2e9eb5c7fbaa52"
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
const spanProcessor = new SimpleSpanProcessor(spanExporter);
|
|
1340
|
+
traceProvider.addSpanProcessor(spanProcessor);
|
|
1341
|
+
traceProvider.register();
|
|
1342
|
+
registerInstrumentations({
|
|
1343
|
+
instrumentations: [new FetchInstrumentation()]
|
|
1344
|
+
});
|
|
1345
|
+
return traceProvider;
|
|
1346
|
+
}
|
|
1347
|
+
var provider = initializeTracing();
|
|
1348
|
+
function getTracer() {
|
|
1349
|
+
return trace.getTracer("trigger.dev cli v3", version);
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
1352
|
// src/cli/common.ts
|
|
1353
|
+
import { fromZodError } from "zod-validation-error";
|
|
1353
1354
|
import { outro } from "@clack/prompts";
|
|
1354
1355
|
|
|
1355
1356
|
// src/utilities/cliOutput.ts
|
|
@@ -3942,7 +3943,7 @@ function configureDeployCommand(program2) {
|
|
|
3942
3943
|
).addOption(
|
|
3943
3944
|
new CommandOption(
|
|
3944
3945
|
"--self-hosted",
|
|
3945
|
-
"Build and load the image using your local Docker. Use the --registry option to specify the registry to push the image to when using --self-hosted, or just use --push
|
|
3946
|
+
"Build and load the image using your local Docker. Use the --registry option to specify the registry to push the image to when using --self-hosted, or just use --push to push to the default registry."
|
|
3946
3947
|
).hideHelp()
|
|
3947
3948
|
).addOption(
|
|
3948
3949
|
new CommandOption(
|
|
@@ -4245,6 +4246,10 @@ ${authorization.error}`
|
|
|
4245
4246
|
logESMRequireError(parsedError, resolvedConfig);
|
|
4246
4247
|
}
|
|
4247
4248
|
await preExitTasks();
|
|
4249
|
+
if (finishedDeployment.errorData.stderr) {
|
|
4250
|
+
log5.error(`Error logs:
|
|
4251
|
+
${finishedDeployment.errorData.stderr}`);
|
|
4252
|
+
}
|
|
4248
4253
|
throw new SkipLoggingError(
|
|
4249
4254
|
`Deployment encountered an error: ${finishedDeployment.errorData.name}`
|
|
4250
4255
|
);
|
|
@@ -5498,6 +5503,7 @@ var BackgroundWorker = class {
|
|
|
5498
5503
|
_onClose = new Evt();
|
|
5499
5504
|
tasks = [];
|
|
5500
5505
|
metadata;
|
|
5506
|
+
stderr = [];
|
|
5501
5507
|
_taskRunProcesses = /* @__PURE__ */ new Map();
|
|
5502
5508
|
_taskRunProcessesBeingKilled = /* @__PURE__ */ new Set();
|
|
5503
5509
|
_closed = false;
|
|
@@ -5596,6 +5602,9 @@ var BackgroundWorker = class {
|
|
|
5596
5602
|
child.stdout?.on("data", (data) => {
|
|
5597
5603
|
logger.log(data.toString());
|
|
5598
5604
|
});
|
|
5605
|
+
child.stderr?.on("data", (data) => {
|
|
5606
|
+
this.stderr.push(data.toString());
|
|
5607
|
+
});
|
|
5599
5608
|
});
|
|
5600
5609
|
this._initialized = true;
|
|
5601
5610
|
}
|
|
@@ -6615,7 +6624,8 @@ function useDev({
|
|
|
6615
6624
|
}
|
|
6616
6625
|
const parsedError = parseNpmInstallError(e);
|
|
6617
6626
|
if (typeof parsedError === "string") {
|
|
6618
|
-
logger.log(
|
|
6627
|
+
logger.log(`
|
|
6628
|
+
${chalkError("X Error:")} ${parsedError}`);
|
|
6619
6629
|
} else {
|
|
6620
6630
|
switch (parsedError.type) {
|
|
6621
6631
|
case "package-not-found-error": {
|
|
@@ -6638,6 +6648,12 @@ ${chalkError("X Error:")} The package ${chalkPurple(
|
|
|
6638
6648
|
}
|
|
6639
6649
|
}
|
|
6640
6650
|
}
|
|
6651
|
+
const stderr = backgroundWorker.stderr.map((line) => line.trim()).filter((line) => line.length > 0).join("\n");
|
|
6652
|
+
if (stderr) {
|
|
6653
|
+
logger.log(`
|
|
6654
|
+
${chalkError("X Error logs:")}
|
|
6655
|
+
${stderr}`);
|
|
6656
|
+
}
|
|
6641
6657
|
}
|
|
6642
6658
|
});
|
|
6643
6659
|
}
|
|
@@ -6878,7 +6894,7 @@ function configureInitCommand(program2) {
|
|
|
6878
6894
|
).option(
|
|
6879
6895
|
"-t, --tag <package tag>",
|
|
6880
6896
|
"The version of the @trigger.dev/sdk package to install",
|
|
6881
|
-
|
|
6897
|
+
version
|
|
6882
6898
|
).option("--skip-package-install", "Skip installing the @trigger.dev/sdk package").option("--override-config", "Override the existing config file if it exists")
|
|
6883
6899
|
).action(async (path7, options) => {
|
|
6884
6900
|
await handleTelemetry(async () => {
|
|
@@ -6953,7 +6969,7 @@ async function _initCommand(dir, options) {
|
|
|
6953
6969
|
log6.info("Next steps:");
|
|
6954
6970
|
log6.info(
|
|
6955
6971
|
` 1. To start developing, run ${chalk5.green(
|
|
6956
|
-
`npx trigger.dev@${options.tag} dev`
|
|
6972
|
+
`npx trigger.dev@${options.tag} dev${options.apiUrl === CLOUD_API_URL ? "" : ` -a ${options.apiUrl}`}`
|
|
6957
6973
|
)} in your project directory`
|
|
6958
6974
|
);
|
|
6959
6975
|
log6.info(` 2. Visit your ${projectDashboard} to view your newly created tasks.`);
|
|
@@ -7132,7 +7148,7 @@ async function installPackages2(dir, options) {
|
|
|
7132
7148
|
switch (pkgManager) {
|
|
7133
7149
|
case "npm": {
|
|
7134
7150
|
installSpinner.start(`Running npm install @trigger.dev/sdk@${options.tag}`);
|
|
7135
|
-
await execa3("npm", ["install", `@trigger.dev/sdk@${options.tag}`], {
|
|
7151
|
+
await execa3("npm", ["install", "--save-exact", `@trigger.dev/sdk@${options.tag}`], {
|
|
7136
7152
|
cwd: projectDir,
|
|
7137
7153
|
stdio: options.logLevel === "debug" ? "inherit" : "ignore"
|
|
7138
7154
|
});
|