trigger.dev 0.0.0-re2-20250331135028 → 0.0.0-re2-20250331172725
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/esm/apiClient.d.ts +5 -5
- package/dist/esm/build/buildWorker.d.ts +23 -23
- package/dist/esm/cli/common.d.ts +2 -2
- package/dist/esm/commands/dev.d.ts +5 -5
- package/dist/esm/commands/dev.js +3 -0
- package/dist/esm/commands/dev.js.map +1 -1
- package/dist/esm/commands/list-profiles.d.ts +2 -2
- package/dist/esm/commands/login.d.ts +2 -2
- package/dist/esm/commands/logout.d.ts +2 -2
- package/dist/esm/commands/switch.d.ts +2 -2
- package/dist/esm/commands/trigger.d.ts +7 -7
- package/dist/esm/commands/update.d.ts +2 -2
- package/dist/esm/commands/whoami.d.ts +2 -2
- package/dist/esm/dev/lock.d.ts +1 -0
- package/dist/esm/dev/lock.js +80 -0
- package/dist/esm/dev/lock.js.map +1 -0
- package/dist/esm/indexing/indexWorkerManifest.d.ts +3 -3
- package/dist/esm/utilities/logger.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -3
package/dist/esm/apiClient.d.ts
CHANGED
|
@@ -76,14 +76,14 @@ export declare class CliApiClient {
|
|
|
76
76
|
id: string;
|
|
77
77
|
version: string;
|
|
78
78
|
contentHash: string;
|
|
79
|
-
shortCode: string;
|
|
80
79
|
imageTag: string;
|
|
81
|
-
|
|
80
|
+
shortCode: string;
|
|
82
81
|
externalBuildData?: {
|
|
83
82
|
projectId: string;
|
|
84
83
|
buildId: string;
|
|
85
84
|
buildToken: string;
|
|
86
85
|
} | null | undefined;
|
|
86
|
+
registryHost?: string | undefined;
|
|
87
87
|
}>>;
|
|
88
88
|
createDeploymentBackgroundWorker(deploymentId: string, body: CreateBackgroundWorkerRequestBody): Promise<ApiResult<{
|
|
89
89
|
id: string;
|
|
@@ -104,7 +104,7 @@ export declare class CliApiClient {
|
|
|
104
104
|
contentHash: string;
|
|
105
105
|
}>>;
|
|
106
106
|
getDeployment(deploymentId: string): Promise<ApiResult<{
|
|
107
|
-
status: "
|
|
107
|
+
status: "CANCELED" | "FAILED" | "TIMED_OUT" | "PENDING" | "BUILDING" | "DEPLOYING" | "DEPLOYED";
|
|
108
108
|
id: string;
|
|
109
109
|
version: string;
|
|
110
110
|
contentHash: string;
|
|
@@ -145,8 +145,8 @@ export declare class CliApiClient {
|
|
|
145
145
|
list: () => Promise<ApiResult<{
|
|
146
146
|
type: string;
|
|
147
147
|
name: string;
|
|
148
|
-
isDefault: boolean;
|
|
149
148
|
updatedAt: Date;
|
|
149
|
+
isDefault: boolean;
|
|
150
150
|
description?: string | null | undefined;
|
|
151
151
|
latestVersion?: string | null | undefined;
|
|
152
152
|
lastHeartbeatAt?: string | null | undefined;
|
|
@@ -164,7 +164,7 @@ export declare class CliApiClient {
|
|
|
164
164
|
get deployments(): {
|
|
165
165
|
unmanaged: {
|
|
166
166
|
latest: () => Promise<ApiResult<{
|
|
167
|
-
status: "
|
|
167
|
+
status: "CANCELED" | "FAILED" | "TIMED_OUT" | "PENDING" | "BUILDING" | "DEPLOYING" | "DEPLOYED";
|
|
168
168
|
id: string;
|
|
169
169
|
version: string;
|
|
170
170
|
contentHash: string;
|
|
@@ -18,8 +18,6 @@ export type BuildWorkerOptions = {
|
|
|
18
18
|
export declare function buildWorker(options: BuildWorkerOptions): Promise<{
|
|
19
19
|
environment: string;
|
|
20
20
|
contentHash: string;
|
|
21
|
-
configPath: string;
|
|
22
|
-
runtime: "node" | "node-22" | "bun";
|
|
23
21
|
packageVersion: string;
|
|
24
22
|
cliPackageVersion: string;
|
|
25
23
|
deploy: {
|
|
@@ -28,42 +26,44 @@ export declare function buildWorker(options: BuildWorkerOptions): Promise<{
|
|
|
28
26
|
env?: Record<string, string> | undefined;
|
|
29
27
|
} | undefined;
|
|
30
28
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
commands?: string[] | undefined;
|
|
34
|
-
};
|
|
35
|
-
target: "unmanaged" | "dev" | "deploy";
|
|
36
|
-
files: {
|
|
37
|
-
entry: string;
|
|
38
|
-
out: string;
|
|
39
|
-
}[];
|
|
40
|
-
runWorkerEntryPoint: string;
|
|
41
|
-
indexWorkerEntryPoint: string;
|
|
42
|
-
outputPath: string;
|
|
29
|
+
target: "dev" | "deploy" | "unmanaged";
|
|
30
|
+
runtime: "node" | "node-22" | "bun";
|
|
43
31
|
config: {
|
|
44
32
|
project: string;
|
|
45
33
|
dirs: string[];
|
|
46
34
|
};
|
|
35
|
+
files: {
|
|
36
|
+
out: string;
|
|
37
|
+
entry: string;
|
|
38
|
+
}[];
|
|
47
39
|
sources: Record<string, {
|
|
48
40
|
contentHash: string;
|
|
49
41
|
contents: string;
|
|
50
42
|
}>;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
outputPath: string;
|
|
44
|
+
runWorkerEntryPoint: string;
|
|
45
|
+
indexWorkerEntryPoint: string;
|
|
46
|
+
configPath: string;
|
|
47
|
+
build: {
|
|
48
|
+
env?: Record<string, string> | undefined;
|
|
49
|
+
commands?: string[] | undefined;
|
|
50
|
+
};
|
|
58
51
|
image?: {
|
|
59
52
|
pkgs?: string[] | undefined;
|
|
60
53
|
instructions?: string[] | undefined;
|
|
61
54
|
} | undefined;
|
|
55
|
+
runControllerEntryPoint?: string | undefined;
|
|
56
|
+
indexControllerEntryPoint?: string | undefined;
|
|
57
|
+
loaderEntryPoint?: string | undefined;
|
|
58
|
+
initEntryPoint?: string | undefined;
|
|
62
59
|
externals?: {
|
|
63
60
|
name: string;
|
|
64
61
|
version: string;
|
|
65
62
|
}[] | undefined;
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
customConditions?: string[] | undefined;
|
|
64
|
+
otelImportHook?: {
|
|
65
|
+
include?: string[] | undefined;
|
|
66
|
+
exclude?: string[] | undefined;
|
|
67
|
+
} | undefined;
|
|
68
68
|
}>;
|
|
69
69
|
export declare function rewriteBuildManifestPaths(buildManifest: BuildManifest, destinationDir: string): BuildManifest;
|
package/dist/esm/cli/common.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ export declare const CommonCommandOptions: z.ZodObject<{
|
|
|
6
6
|
skipTelemetry: z.ZodDefault<z.ZodBoolean>;
|
|
7
7
|
profile: z.ZodDefault<z.ZodString>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
logLevel: "error" | "
|
|
9
|
+
logLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
10
10
|
skipTelemetry: boolean;
|
|
11
11
|
profile: string;
|
|
12
12
|
apiUrl?: string | undefined;
|
|
13
13
|
}, {
|
|
14
|
+
logLevel?: "error" | "debug" | "info" | "warn" | "none" | "log" | undefined;
|
|
14
15
|
apiUrl?: string | undefined;
|
|
15
|
-
logLevel?: "error" | "none" | "warn" | "info" | "log" | "debug" | undefined;
|
|
16
16
|
skipTelemetry?: boolean | undefined;
|
|
17
17
|
profile?: string | undefined;
|
|
18
18
|
}>;
|
|
@@ -16,7 +16,7 @@ declare const DevCommandOptions: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
16
16
|
mcp: z.ZodDefault<z.ZodBoolean>;
|
|
17
17
|
mcpPort: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
18
18
|
}>, "strip", z.ZodTypeAny, {
|
|
19
|
-
logLevel: "error" | "
|
|
19
|
+
logLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
20
20
|
skipTelemetry: boolean;
|
|
21
21
|
profile: string;
|
|
22
22
|
debugOtel: boolean;
|
|
@@ -24,19 +24,19 @@ declare const DevCommandOptions: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
24
24
|
keepTmpFiles: boolean;
|
|
25
25
|
mcp: boolean;
|
|
26
26
|
mcpPort: number;
|
|
27
|
-
projectRef?: string | undefined;
|
|
28
27
|
apiUrl?: string | undefined;
|
|
29
28
|
maxConcurrentRuns?: number | undefined;
|
|
30
29
|
config?: string | undefined;
|
|
30
|
+
projectRef?: string | undefined;
|
|
31
31
|
envFile?: string | undefined;
|
|
32
32
|
}, {
|
|
33
|
-
|
|
33
|
+
logLevel?: "error" | "debug" | "info" | "warn" | "none" | "log" | undefined;
|
|
34
34
|
apiUrl?: string | undefined;
|
|
35
35
|
maxConcurrentRuns?: number | undefined;
|
|
36
|
-
|
|
36
|
+
config?: string | undefined;
|
|
37
|
+
projectRef?: string | undefined;
|
|
37
38
|
skipTelemetry?: boolean | undefined;
|
|
38
39
|
profile?: string | undefined;
|
|
39
|
-
config?: string | undefined;
|
|
40
40
|
debugOtel?: boolean | undefined;
|
|
41
41
|
skipUpdateCheck?: boolean | undefined;
|
|
42
42
|
envFile?: string | undefined;
|
package/dist/esm/commands/dev.js
CHANGED
|
@@ -9,6 +9,7 @@ import { runtimeChecks } from "../utilities/runtimeCheck.js";
|
|
|
9
9
|
import { getProjectClient } from "../utilities/session.js";
|
|
10
10
|
import { login } from "./login.js";
|
|
11
11
|
import { updateTriggerPackages } from "./update.js";
|
|
12
|
+
import { createLockFile } from "../dev/lock.js";
|
|
12
13
|
const DevCommandOptions = CommonCommandOptions.extend({
|
|
13
14
|
debugOtel: z.boolean().default(false),
|
|
14
15
|
config: z.string().optional(),
|
|
@@ -78,6 +79,7 @@ async function startDev(options) {
|
|
|
78
79
|
if (!options.skipUpdateCheck) {
|
|
79
80
|
displayedUpdateMessage = await updateTriggerPackages(options.cwd, { ...options }, true, true);
|
|
80
81
|
}
|
|
82
|
+
const removeLockFile = await createLockFile(options.cwd);
|
|
81
83
|
let devInstance;
|
|
82
84
|
printDevBanner(displayedUpdateMessage);
|
|
83
85
|
watcher = await watchConfig({
|
|
@@ -125,6 +127,7 @@ async function startDev(options) {
|
|
|
125
127
|
stop: async () => {
|
|
126
128
|
devInstance?.stop();
|
|
127
129
|
await watcher?.stop();
|
|
130
|
+
removeLockFile();
|
|
128
131
|
},
|
|
129
132
|
waitUntilExit,
|
|
130
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/commands/dev.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAsB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAiB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/commands/dev.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAsB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MA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pB,MAAM,OAAO,EAAE,IAAI,EAAE,CAAC;gBACtB,cAAc,EAAE,CAAC;YACnB,CAAC;YACD,aAAa;SACd,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,EAAE,IAAI,EAAE,CAAC;QACtB,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -6,10 +6,10 @@ declare const ListProfilesOptions: z.ZodObject<Pick<{
|
|
|
6
6
|
skipTelemetry: z.ZodDefault<z.ZodBoolean>;
|
|
7
7
|
profile: z.ZodDefault<z.ZodString>;
|
|
8
8
|
}, "logLevel" | "skipTelemetry">, "strip", z.ZodTypeAny, {
|
|
9
|
-
logLevel: "error" | "
|
|
9
|
+
logLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
10
10
|
skipTelemetry: boolean;
|
|
11
11
|
}, {
|
|
12
|
-
logLevel?: "error" | "
|
|
12
|
+
logLevel?: "error" | "debug" | "info" | "warn" | "none" | "log" | undefined;
|
|
13
13
|
skipTelemetry?: boolean | undefined;
|
|
14
14
|
}>;
|
|
15
15
|
type ListProfilesOptions = z.infer<typeof ListProfilesOptions>;
|
|
@@ -9,13 +9,13 @@ export declare const LoginCommandOptions: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
9
9
|
}, {
|
|
10
10
|
apiUrl: z.ZodString;
|
|
11
11
|
}>, "strip", z.ZodTypeAny, {
|
|
12
|
+
logLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
12
13
|
apiUrl: string;
|
|
13
|
-
logLevel: "error" | "none" | "warn" | "info" | "log" | "debug";
|
|
14
14
|
skipTelemetry: boolean;
|
|
15
15
|
profile: string;
|
|
16
16
|
}, {
|
|
17
17
|
apiUrl: string;
|
|
18
|
-
logLevel?: "error" | "
|
|
18
|
+
logLevel?: "error" | "debug" | "info" | "warn" | "none" | "log" | undefined;
|
|
19
19
|
skipTelemetry?: boolean | undefined;
|
|
20
20
|
profile?: string | undefined;
|
|
21
21
|
}>;
|
|
@@ -6,13 +6,13 @@ declare const LogoutCommandOptions: z.ZodObject<{
|
|
|
6
6
|
skipTelemetry: z.ZodDefault<z.ZodBoolean>;
|
|
7
7
|
profile: z.ZodDefault<z.ZodString>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
logLevel: "error" | "
|
|
9
|
+
logLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
10
10
|
skipTelemetry: boolean;
|
|
11
11
|
profile: string;
|
|
12
12
|
apiUrl?: string | undefined;
|
|
13
13
|
}, {
|
|
14
|
+
logLevel?: "error" | "debug" | "info" | "warn" | "none" | "log" | undefined;
|
|
14
15
|
apiUrl?: string | undefined;
|
|
15
|
-
logLevel?: "error" | "none" | "warn" | "info" | "log" | "debug" | undefined;
|
|
16
16
|
skipTelemetry?: boolean | undefined;
|
|
17
17
|
profile?: string | undefined;
|
|
18
18
|
}>;
|
|
@@ -6,10 +6,10 @@ declare const SwitchProfilesOptions: z.ZodObject<Pick<{
|
|
|
6
6
|
skipTelemetry: z.ZodDefault<z.ZodBoolean>;
|
|
7
7
|
profile: z.ZodDefault<z.ZodString>;
|
|
8
8
|
}, "logLevel" | "skipTelemetry">, "strip", z.ZodTypeAny, {
|
|
9
|
-
logLevel: "error" | "
|
|
9
|
+
logLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
10
10
|
skipTelemetry: boolean;
|
|
11
11
|
}, {
|
|
12
|
-
logLevel?: "error" | "
|
|
12
|
+
logLevel?: "error" | "debug" | "info" | "warn" | "none" | "log" | undefined;
|
|
13
13
|
skipTelemetry?: boolean | undefined;
|
|
14
14
|
}>;
|
|
15
15
|
type SwitchProfilesOptions = z.infer<typeof SwitchProfilesOptions>;
|
|
@@ -10,21 +10,21 @@ declare const TriggerTaskOptions: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
10
10
|
config: z.ZodOptional<z.ZodString>;
|
|
11
11
|
projectRef: z.ZodOptional<z.ZodString>;
|
|
12
12
|
}>, "strip", z.ZodTypeAny, {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
logLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
14
|
+
env: "staging" | "prod";
|
|
15
15
|
skipTelemetry: boolean;
|
|
16
16
|
profile: string;
|
|
17
|
-
projectRef?: string | undefined;
|
|
18
17
|
apiUrl?: string | undefined;
|
|
19
18
|
config?: string | undefined;
|
|
20
|
-
}, {
|
|
21
|
-
env: "prod" | "staging";
|
|
22
19
|
projectRef?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
env: "staging" | "prod";
|
|
22
|
+
logLevel?: "error" | "debug" | "info" | "warn" | "none" | "log" | undefined;
|
|
23
23
|
apiUrl?: string | undefined;
|
|
24
|
-
|
|
24
|
+
config?: string | undefined;
|
|
25
|
+
projectRef?: string | undefined;
|
|
25
26
|
skipTelemetry?: boolean | undefined;
|
|
26
27
|
profile?: string | undefined;
|
|
27
|
-
config?: string | undefined;
|
|
28
28
|
}>;
|
|
29
29
|
type TriggerTaskOptions = z.infer<typeof TriggerTaskOptions>;
|
|
30
30
|
export declare function configureTriggerTaskCommand(program: Command): Command;
|
|
@@ -7,10 +7,10 @@ export declare const UpdateCommandOptions: z.ZodObject<Pick<{
|
|
|
7
7
|
skipTelemetry: z.ZodDefault<z.ZodBoolean>;
|
|
8
8
|
profile: z.ZodDefault<z.ZodString>;
|
|
9
9
|
}, "logLevel" | "skipTelemetry">, "strip", z.ZodTypeAny, {
|
|
10
|
-
logLevel: "error" | "
|
|
10
|
+
logLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
11
11
|
skipTelemetry: boolean;
|
|
12
12
|
}, {
|
|
13
|
-
logLevel?: "error" | "
|
|
13
|
+
logLevel?: "error" | "debug" | "info" | "warn" | "none" | "log" | undefined;
|
|
14
14
|
skipTelemetry?: boolean | undefined;
|
|
15
15
|
}>;
|
|
16
16
|
export type UpdateCommandOptions = z.infer<typeof UpdateCommandOptions>;
|
|
@@ -17,13 +17,13 @@ declare const WhoamiCommandOptions: z.ZodObject<{
|
|
|
17
17
|
skipTelemetry: z.ZodDefault<z.ZodBoolean>;
|
|
18
18
|
profile: z.ZodDefault<z.ZodString>;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
logLevel: "error" | "
|
|
20
|
+
logLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
21
21
|
skipTelemetry: boolean;
|
|
22
22
|
profile: string;
|
|
23
23
|
apiUrl?: string | undefined;
|
|
24
24
|
}, {
|
|
25
|
+
logLevel?: "error" | "debug" | "info" | "warn" | "none" | "log" | undefined;
|
|
25
26
|
apiUrl?: string | undefined;
|
|
26
|
-
logLevel?: "error" | "none" | "warn" | "info" | "log" | "debug" | undefined;
|
|
27
27
|
skipTelemetry?: boolean | undefined;
|
|
28
28
|
profile?: string | undefined;
|
|
29
29
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createLockFile(cwd: string): Promise<() => void>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { readFile } from "../utilities/fileSystem.js";
|
|
3
|
+
import { tryCatch } from "@trigger.dev/core/utils";
|
|
4
|
+
import { logger } from "../utilities/logger.js";
|
|
5
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
6
|
+
import { existsSync, unlinkSync } from "node:fs";
|
|
7
|
+
import { onExit } from "signal-exit";
|
|
8
|
+
const LOCK_FILE_NAME = "dev.lock";
|
|
9
|
+
export async function createLockFile(cwd) {
|
|
10
|
+
const currentPid = process.pid;
|
|
11
|
+
const lockFilePath = path.join(cwd, ".trigger", LOCK_FILE_NAME);
|
|
12
|
+
logger.debug("Checking for lockfile", { lockFilePath, currentPid });
|
|
13
|
+
const removeLockFile = () => {
|
|
14
|
+
try {
|
|
15
|
+
logger.debug("Removing lockfile", { lockFilePath });
|
|
16
|
+
return unlinkSync(lockFilePath);
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
// This sometimes fails on Windows with EBUSY
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const removeExitListener = onExit(removeLockFile);
|
|
23
|
+
const [, existingLockfileContents] = await tryCatch(readFile(lockFilePath));
|
|
24
|
+
if (existingLockfileContents) {
|
|
25
|
+
// Read the pid number from the lockfile
|
|
26
|
+
const existingPid = Number(existingLockfileContents);
|
|
27
|
+
logger.debug("Lockfile exists", { lockFilePath, existingPid, currentPid });
|
|
28
|
+
if (existingPid === currentPid) {
|
|
29
|
+
logger.debug("Lockfile exists and is owned by current process", {
|
|
30
|
+
lockFilePath,
|
|
31
|
+
existingPid,
|
|
32
|
+
currentPid,
|
|
33
|
+
});
|
|
34
|
+
return () => {
|
|
35
|
+
removeExitListener();
|
|
36
|
+
removeLockFile();
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// If the pid is different, try and kill the existing pid
|
|
40
|
+
logger.debug("Lockfile exists and is owned by another process, killing it", {
|
|
41
|
+
lockFilePath,
|
|
42
|
+
existingPid,
|
|
43
|
+
currentPid,
|
|
44
|
+
});
|
|
45
|
+
try {
|
|
46
|
+
process.kill(existingPid);
|
|
47
|
+
// If it did kill the process, it will have exited, deleting the lockfile, so let's wait for that to happen
|
|
48
|
+
// But let's not wait forever
|
|
49
|
+
await new Promise((resolve, reject) => {
|
|
50
|
+
const timeout = setTimeout(() => {
|
|
51
|
+
clearInterval(interval);
|
|
52
|
+
reject(new Error("Timed out waiting for lockfile to be deleted"));
|
|
53
|
+
}, 5000);
|
|
54
|
+
const interval = setInterval(() => {
|
|
55
|
+
if (!existsSync(lockFilePath)) {
|
|
56
|
+
clearInterval(interval);
|
|
57
|
+
clearTimeout(timeout);
|
|
58
|
+
resolve(true);
|
|
59
|
+
}
|
|
60
|
+
}, 100);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
logger.debug("Failed to kill existing process, lets assume it's not running", { error });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Now write the current pid to the lockfile
|
|
68
|
+
await writeFileAndEnsureDirExists(lockFilePath, currentPid.toString());
|
|
69
|
+
logger.debug("Lockfile created", { lockFilePath, currentPid });
|
|
70
|
+
return () => {
|
|
71
|
+
removeExitListener();
|
|
72
|
+
removeLockFile();
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
async function writeFileAndEnsureDirExists(filePath, data) {
|
|
76
|
+
const dir = path.dirname(filePath);
|
|
77
|
+
await mkdir(dir, { recursive: true });
|
|
78
|
+
await writeFile(filePath, data);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../src/dev/lock.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,cAAc,GAAG,UAAU,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IAEhE,MAAM,CAAC,KAAK,CAAC,uBAAuB,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,CAAC;IAEpE,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B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8C,CAAC,CAAC,CAAC;gBACpE,CAAC,EAAE,IAAI,CAAC,CAAC;gBAET,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;oBAChC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;wBAC9B,aAAa,CAAC,QAAQ,CAAC,CAAC;wBACxB,YAAY,CAAC,OAAO,CAAC,CAAC;wBACtB,OAAO,CAAC,IAAI,CAAC,CAAC;oBAChB,CAAC;gBACH,CAAC,EAAE,GAAG,CAAC,CAAC;YACV,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,+DAA+D,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;IAED,4CAA4C;IAC5C,MAAM,2BAA2B,CAAC,YAAY,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEvE,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,CAAC;IAE/D,OAAO,GAAG,EAAE;QACV,kBAAkB,EAAE,CAAC;QACrB,cAAc,EAAE,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,2BAA2B,CAAC,QAAgB,EAAE,IAAY;IACvE,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtC,MAAM,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -12,7 +12,6 @@ export type IndexWorkerManifestOptions = {
|
|
|
12
12
|
handleStderr?: (data: string) => void;
|
|
13
13
|
};
|
|
14
14
|
export declare function indexWorkerManifest({ runtime, indexWorkerPath, buildManifestPath, nodeOptions, env: $env, cwd, otelHookInclude, otelHookExclude, handleStderr, handleStdout, }: IndexWorkerManifestOptions): Promise<{
|
|
15
|
-
configPath: string;
|
|
16
15
|
tasks: {
|
|
17
16
|
id: string;
|
|
18
17
|
filePath: string;
|
|
@@ -46,14 +45,14 @@ export declare function indexWorkerManifest({ runtime, indexWorkerPath, buildMan
|
|
|
46
45
|
timezone: string;
|
|
47
46
|
} | undefined;
|
|
48
47
|
}[];
|
|
49
|
-
workerEntryPoint: string;
|
|
50
48
|
runtime: "node" | "node-22" | "bun";
|
|
49
|
+
configPath: string;
|
|
50
|
+
workerEntryPoint: string;
|
|
51
51
|
queues?: {
|
|
52
52
|
name: string;
|
|
53
53
|
concurrencyLimit?: number | null | undefined;
|
|
54
54
|
releaseConcurrencyOnWaitpoint?: boolean | undefined;
|
|
55
55
|
}[] | undefined;
|
|
56
|
-
controllerEntryPoint?: string | undefined;
|
|
57
56
|
loaderEntryPoint?: string | undefined;
|
|
58
57
|
initEntryPoint?: string | undefined;
|
|
59
58
|
customConditions?: string[] | undefined;
|
|
@@ -61,4 +60,5 @@ export declare function indexWorkerManifest({ runtime, indexWorkerPath, buildMan
|
|
|
61
60
|
include?: string[] | undefined;
|
|
62
61
|
exclude?: string[] | undefined;
|
|
63
62
|
} | undefined;
|
|
63
|
+
controllerEntryPoint?: string | undefined;
|
|
64
64
|
}>;
|
|
@@ -11,7 +11,7 @@ export type LoggerLevel = keyof typeof LOGGER_LEVELS;
|
|
|
11
11
|
export type TableRow<Keys extends string> = Record<Keys, string>;
|
|
12
12
|
export declare class Logger {
|
|
13
13
|
constructor();
|
|
14
|
-
loggerLevel: "error" | "
|
|
14
|
+
loggerLevel: "error" | "debug" | "info" | "warn" | "none" | "log";
|
|
15
15
|
columns: number;
|
|
16
16
|
debug: (...args: unknown[]) => void;
|
|
17
17
|
ignore: (...args: unknown[]) => void;
|
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.0.0-re2-
|
|
1
|
+
export const VERSION = "0.0.0-re2-20250331172725";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trigger.dev",
|
|
3
|
-
"version": "0.0.0-re2-
|
|
3
|
+
"version": "0.0.0-re2-20250331172725",
|
|
4
4
|
"description": "A Command-Line Interface for Trigger.dev (v3) projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@opentelemetry/sdk-trace-base": "1.25.1",
|
|
82
82
|
"@opentelemetry/sdk-trace-node": "1.25.1",
|
|
83
83
|
"@opentelemetry/semantic-conventions": "1.25.1",
|
|
84
|
-
"@trigger.dev/build": "0.0.0-re2-
|
|
85
|
-
"@trigger.dev/core": "0.0.0-re2-
|
|
84
|
+
"@trigger.dev/build": "0.0.0-re2-20250331172725",
|
|
85
|
+
"@trigger.dev/core": "0.0.0-re2-20250331172725",
|
|
86
86
|
"c12": "^1.11.1",
|
|
87
87
|
"chalk": "^5.2.0",
|
|
88
88
|
"chokidar": "^3.6.0",
|