@prisma/compute-sdk 0.28.0 → 0.30.0
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/api-client.d.ts +38 -38
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +44 -43
- package/dist/api-client.js.map +1 -1
- package/dist/astro-build.d.ts +2 -0
- package/dist/astro-build.d.ts.map +1 -1
- package/dist/astro-build.js +31 -39
- package/dist/astro-build.js.map +1 -1
- package/dist/build-settings.d.ts +3 -0
- package/dist/build-settings.d.ts.map +1 -1
- package/dist/build-settings.js +13 -0
- package/dist/build-settings.js.map +1 -1
- package/dist/build-strategy.d.ts +20 -0
- package/dist/build-strategy.d.ts.map +1 -1
- package/dist/build-strategy.js +33 -1
- package/dist/build-strategy.js.map +1 -1
- package/dist/build.d.ts +2 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +16 -4
- package/dist/build.js.map +1 -1
- package/dist/bun-build.d.ts +1 -1
- package/dist/bun-build.d.ts.map +1 -1
- package/dist/bun-build.js +25 -9
- package/dist/bun-build.js.map +1 -1
- package/dist/callbacks.d.ts +33 -33
- package/dist/callbacks.d.ts.map +1 -1
- package/dist/compute-client.d.ts +66 -66
- package/dist/compute-client.d.ts.map +1 -1
- package/dist/compute-client.js +274 -272
- package/dist/compute-client.js.map +1 -1
- package/dist/config/frameworks.d.ts +4 -8
- package/dist/config/frameworks.d.ts.map +1 -1
- package/dist/config/frameworks.js +17 -5
- package/dist/config/frameworks.js.map +1 -1
- package/dist/config/normalize.d.ts +6 -0
- package/dist/config/normalize.d.ts.map +1 -1
- package/dist/config/normalize.js +53 -12
- package/dist/config/normalize.js.map +1 -1
- package/dist/config/types.d.ts +3 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +1 -0
- package/dist/config/types.js.map +1 -1
- package/dist/configured-artifact.d.ts +20 -0
- package/dist/configured-artifact.d.ts.map +1 -0
- package/dist/configured-artifact.js +104 -0
- package/dist/configured-artifact.js.map +1 -0
- package/dist/custom-build.d.ts +20 -0
- package/dist/custom-build.d.ts.map +1 -0
- package/dist/custom-build.js +53 -0
- package/dist/custom-build.js.map +1 -0
- package/dist/errors.d.ts +28 -28
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +12 -12
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/log-stream.d.ts +1 -1
- package/dist/log-stream.d.ts.map +1 -1
- package/dist/log-stream.js +1 -1
- package/dist/log-stream.js.map +1 -1
- package/dist/nestjs-build.d.ts.map +1 -1
- package/dist/nestjs-build.js +28 -29
- package/dist/nestjs-build.js.map +1 -1
- package/dist/nextjs-build.d.ts +1 -1
- package/dist/nextjs-build.d.ts.map +1 -1
- package/dist/nextjs-build.js +25 -14
- package/dist/nextjs-build.js.map +1 -1
- package/dist/nuxt-build.d.ts +2 -0
- package/dist/nuxt-build.d.ts.map +1 -1
- package/dist/nuxt-build.js +31 -39
- package/dist/nuxt-build.js.map +1 -1
- package/dist/polling.d.ts +4 -4
- package/dist/polling.d.ts.map +1 -1
- package/dist/polling.js +15 -15
- package/dist/polling.js.map +1 -1
- package/dist/tanstack-start-build.d.ts +1 -1
- package/dist/tanstack-start-build.d.ts.map +1 -1
- package/dist/tanstack-start-build.js +26 -47
- package/dist/tanstack-start-build.js.map +1 -1
- package/dist/types.d.ts +8 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api-client.ts +57 -63
- package/src/astro-build.ts +39 -46
- package/src/build-settings.ts +16 -0
- package/src/build-strategy.ts +56 -1
- package/src/build.ts +16 -4
- package/src/bun-build.ts +39 -10
- package/src/callbacks.ts +34 -34
- package/src/compute-client.ts +433 -413
- package/src/config/frameworks.ts +18 -5
- package/src/config/normalize.ts +74 -13
- package/src/config/types.ts +3 -0
- package/src/configured-artifact.ts +169 -0
- package/src/custom-build.ts +73 -0
- package/src/errors.ts +42 -38
- package/src/index.ts +27 -26
- package/src/log-stream.ts +2 -2
- package/src/nestjs-build.ts +36 -33
- package/src/nextjs-build.ts +31 -14
- package/src/nuxt-build.ts +39 -46
- package/src/polling.ts +19 -18
- package/src/tanstack-start-build.ts +31 -53
- package/src/types.ts +8 -8
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { cp, mkdtemp, realpath, rm, stat } from "node:fs/promises";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { normalizeArtifactSymlinks } from "./artifact-postprocess.js";
|
|
5
|
+
import { defaultHttpPortForBuildType, } from "./config/frameworks.js";
|
|
6
|
+
export async function stageConfiguredArtifact(options) {
|
|
7
|
+
options.signal?.throwIfAborted();
|
|
8
|
+
const outputDir = resolvePathInside(options.appPath, options.outputDirectory, `${options.label} build output directory must be a relative path inside the app directory`);
|
|
9
|
+
const outputStat = await stat(outputDir).catch(() => null);
|
|
10
|
+
if (!outputStat?.isDirectory()) {
|
|
11
|
+
throw new Error(`${options.label} build output directory does not exist: ${options.outputDirectory}`);
|
|
12
|
+
}
|
|
13
|
+
const [realAppPath, realOutputDir] = await Promise.all([
|
|
14
|
+
realpath(path.resolve(options.appPath)),
|
|
15
|
+
realpath(outputDir),
|
|
16
|
+
]);
|
|
17
|
+
if (!isPathWithin(realAppPath, realOutputDir)) {
|
|
18
|
+
throw new Error(`${options.label} build output directory must stay inside the app directory`);
|
|
19
|
+
}
|
|
20
|
+
const entrypoint = await resolveConfiguredArtifactEntrypoint({
|
|
21
|
+
directory: realOutputDir,
|
|
22
|
+
entrypoint: options.entrypoint,
|
|
23
|
+
label: options.label,
|
|
24
|
+
displayDirectory: options.outputDirectory,
|
|
25
|
+
missingEntrypointMessage: options.missingEntrypointMessage,
|
|
26
|
+
});
|
|
27
|
+
const outDir = await mkdtemp(path.join(os.tmpdir(), "compute-build-"));
|
|
28
|
+
try {
|
|
29
|
+
const artifactDir = path.join(outDir, "app");
|
|
30
|
+
await cp(realOutputDir, artifactDir, {
|
|
31
|
+
recursive: true,
|
|
32
|
+
verbatimSymlinks: true,
|
|
33
|
+
});
|
|
34
|
+
await normalizeArtifactSymlinks(artifactDir, options.appPath, options.signal);
|
|
35
|
+
return {
|
|
36
|
+
directory: artifactDir,
|
|
37
|
+
entrypoint,
|
|
38
|
+
defaultPortMapping: {
|
|
39
|
+
http: defaultHttpPortForBuildType(options.buildType),
|
|
40
|
+
},
|
|
41
|
+
cleanup: () => rm(outDir, { recursive: true, force: true }),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
await rm(outDir, { recursive: true, force: true });
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export async function resolveConfiguredArtifactEntrypoint(options) {
|
|
50
|
+
const entrypoint = normalizeConfiguredArtifactEntrypoint(options.entrypoint, options.label);
|
|
51
|
+
const entryPath = path.join(options.directory, entrypoint);
|
|
52
|
+
const entryStat = await stat(entryPath).catch(() => null);
|
|
53
|
+
if (!entryStat?.isFile()) {
|
|
54
|
+
if (options.missingEntrypointMessage) {
|
|
55
|
+
throw new Error(options.missingEntrypointMessage);
|
|
56
|
+
}
|
|
57
|
+
const directory = options.displayDirectory ?? options.directory;
|
|
58
|
+
throw new Error(`${options.label} build entrypoint does not exist: ${directory}/${entrypoint}`);
|
|
59
|
+
}
|
|
60
|
+
return entrypoint;
|
|
61
|
+
}
|
|
62
|
+
export function normalizeConfiguredArtifactEntrypoint(entrypoint, label) {
|
|
63
|
+
const normalized = path.posix.normalize(entrypoint.trim().replace(/\\/g, "/"));
|
|
64
|
+
if (normalized.length === 0 ||
|
|
65
|
+
normalized === "." ||
|
|
66
|
+
normalized === ".." ||
|
|
67
|
+
normalized.startsWith("../") ||
|
|
68
|
+
normalized.includes("/../") ||
|
|
69
|
+
path.win32.isAbsolute(entrypoint) ||
|
|
70
|
+
path.posix.isAbsolute(normalized) ||
|
|
71
|
+
/^[A-Za-z]:/.test(normalized)) {
|
|
72
|
+
throw new Error(`${label} build entrypoint must be a relative path inside the output directory`);
|
|
73
|
+
}
|
|
74
|
+
return normalized;
|
|
75
|
+
}
|
|
76
|
+
function resolvePathInside(root, relativePath, errorMessage) {
|
|
77
|
+
const raw = relativePath.trim().replace(/\\/g, "/");
|
|
78
|
+
const normalized = path.posix.normalize(raw);
|
|
79
|
+
if (raw.length === 0 ||
|
|
80
|
+
normalized === ".." ||
|
|
81
|
+
normalized.startsWith("../") ||
|
|
82
|
+
normalized.includes("/../") ||
|
|
83
|
+
path.win32.isAbsolute(relativePath) ||
|
|
84
|
+
path.posix.isAbsolute(normalized) ||
|
|
85
|
+
/^[A-Za-z]:/.test(normalized)) {
|
|
86
|
+
throw new Error(errorMessage);
|
|
87
|
+
}
|
|
88
|
+
const resolved = path.resolve(root, normalized);
|
|
89
|
+
const relative = path.relative(root, resolved);
|
|
90
|
+
if (relative === ".." ||
|
|
91
|
+
relative.startsWith(`..${path.sep}`) ||
|
|
92
|
+
path.isAbsolute(relative)) {
|
|
93
|
+
throw new Error(errorMessage);
|
|
94
|
+
}
|
|
95
|
+
return resolved;
|
|
96
|
+
}
|
|
97
|
+
function isPathWithin(root, candidate) {
|
|
98
|
+
const relative = path.relative(root, candidate);
|
|
99
|
+
return (relative === "" ||
|
|
100
|
+
(!relative.startsWith(`..${path.sep}`) &&
|
|
101
|
+
relative !== ".." &&
|
|
102
|
+
!path.isAbsolute(relative)));
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=configured-artifact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configured-artifact.js","sourceRoot":"","sources":["../src/configured-artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IA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uildStrategy } from "./build-strategy.ts";
|
|
3
|
+
import type { BuildCommandIo } from "./workspace.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Generic artifact strategy for frameworks the SDK does not know about yet.
|
|
6
|
+
* Runs an optional command, stages a configured output directory as-is, and
|
|
7
|
+
* starts the configured entrypoint from inside that artifact.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CustomBuild implements BuildStrategy {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(options: {
|
|
12
|
+
appPath: string;
|
|
13
|
+
entrypoint?: string;
|
|
14
|
+
buildSettings?: BuildSettings;
|
|
15
|
+
io?: BuildCommandIo;
|
|
16
|
+
});
|
|
17
|
+
canBuild(_signal?: AbortSignal): Promise<boolean>;
|
|
18
|
+
execute(signal?: AbortSignal): Promise<BuildArtifact>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=custom-build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-build.d.ts","sourceRoot":"","sources":["../src/custom-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAwB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;GAIG;AACH,qBAAa,WAAY,YAAW,aAAa;;gBAMnC,OAAO,EAAE;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,EAAE,CAAC,EAAE,cAAc,CAAC;KACrB;IAOK,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjD,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;CAiC5D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { resolveBuildSettings } from "./build-settings.js";
|
|
2
|
+
import { runBuildSettingsCommand, } from "./build-strategy.js";
|
|
3
|
+
import { normalizeConfiguredArtifactEntrypoint, stageConfiguredArtifact, } from "./configured-artifact.js";
|
|
4
|
+
/**
|
|
5
|
+
* Generic artifact strategy for frameworks the SDK does not know about yet.
|
|
6
|
+
* Runs an optional command, stages a configured output directory as-is, and
|
|
7
|
+
* starts the configured entrypoint from inside that artifact.
|
|
8
|
+
*/
|
|
9
|
+
export class CustomBuild {
|
|
10
|
+
#appPath;
|
|
11
|
+
#entrypoint;
|
|
12
|
+
#buildSettings;
|
|
13
|
+
#io;
|
|
14
|
+
constructor(options) {
|
|
15
|
+
this.#appPath = options.appPath;
|
|
16
|
+
this.#entrypoint = options.entrypoint;
|
|
17
|
+
this.#buildSettings = options.buildSettings;
|
|
18
|
+
this.#io = options.io;
|
|
19
|
+
}
|
|
20
|
+
async canBuild(_signal) {
|
|
21
|
+
return Boolean(this.#entrypoint ?? this.#buildSettings?.entrypoint);
|
|
22
|
+
}
|
|
23
|
+
async execute(signal) {
|
|
24
|
+
signal?.throwIfAborted();
|
|
25
|
+
const settings = this.#buildSettings ??
|
|
26
|
+
(await resolveBuildSettings({
|
|
27
|
+
appPath: this.#appPath,
|
|
28
|
+
buildType: "custom",
|
|
29
|
+
signal,
|
|
30
|
+
}));
|
|
31
|
+
const entrypoint = this.#entrypoint ?? settings.entrypoint;
|
|
32
|
+
if (!entrypoint) {
|
|
33
|
+
throw new Error("Custom build entrypoint is required");
|
|
34
|
+
}
|
|
35
|
+
normalizeConfiguredArtifactEntrypoint(entrypoint, "Custom");
|
|
36
|
+
await runBuildSettingsCommand({
|
|
37
|
+
appPath: this.#appPath,
|
|
38
|
+
settings,
|
|
39
|
+
failurePrefix: "Custom",
|
|
40
|
+
io: this.#io,
|
|
41
|
+
signal,
|
|
42
|
+
});
|
|
43
|
+
return stageConfiguredArtifact({
|
|
44
|
+
appPath: this.#appPath,
|
|
45
|
+
outputDirectory: settings.outputDirectory,
|
|
46
|
+
entrypoint,
|
|
47
|
+
buildType: "custom",
|
|
48
|
+
label: "Custom",
|
|
49
|
+
signal,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=custom-build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-build.js","sourceRoot":"","sources":["../src/custom-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAGL,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qCAAqC,EACrC,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAGlC;;;;GAIG;AACH,MAAM,OAAO,WAAW;IACb,QAAQ,CAAS;IACjB,WAAW,CAAU;IACrB,cAAc,CAAiB;IAC/B,GAAG,CAAkB;IAE9B,YAAY,OAKX;QACC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,EAAE,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAqB;QAClC,OAAO,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAoB;QAChC,MAAM,EAAE,cAAc,EAAE,CAAC;QACzB,MAAM,QAAQ,GACZ,IAAI,CAAC,cAAc;YACnB,CAAC,MAAM,oBAAoB,CAAC;gBAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ;gBACtB,SAAS,EAAE,QAAQ;gBACnB,MAAM;aACP,CAAC,CAAC,CAAC;QAEN,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,UAAU,CAAC;QAC3D,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QACD,qCAAqC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE5D,MAAM,uBAAuB,CAAC;YAC5B,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,QAAQ;YACR,aAAa,EAAE,QAAQ;YACvB,EAAE,EAAE,IAAI,CAAC,GAAG;YACZ,MAAM;SACP,CAAC,CAAC;QAEH,OAAO,uBAAuB,CAAC;YAC7B,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,eAAe,EAAE,QAAQ,CAAC,eAAe;YACzC,UAAU;YACV,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,QAAQ;YACf,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -36,43 +36,43 @@ declare const ArtifactError_base: import("better-result").TaggedErrorClass<"Arti
|
|
|
36
36
|
export declare class ArtifactError extends ArtifactError_base {
|
|
37
37
|
}
|
|
38
38
|
declare const TimeoutError_base: import("better-result").TaggedErrorClass<"TimeoutError", {
|
|
39
|
-
|
|
39
|
+
deploymentId: string;
|
|
40
40
|
elapsedMs: number;
|
|
41
41
|
lastStatus: string;
|
|
42
42
|
message: string;
|
|
43
43
|
}>;
|
|
44
44
|
export declare class TimeoutError extends TimeoutError_base {
|
|
45
45
|
constructor(args: {
|
|
46
|
-
|
|
46
|
+
deploymentId: string;
|
|
47
47
|
elapsedMs: number;
|
|
48
48
|
lastStatus: string;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
declare const
|
|
52
|
-
|
|
51
|
+
declare const DeploymentFailedError_base: import("better-result").TaggedErrorClass<"DeploymentFailedError", {
|
|
52
|
+
deploymentId: string;
|
|
53
53
|
message: string;
|
|
54
54
|
}>;
|
|
55
|
-
export declare class
|
|
55
|
+
export declare class DeploymentFailedError extends DeploymentFailedError_base {
|
|
56
56
|
constructor(args: {
|
|
57
|
-
|
|
57
|
+
deploymentId: string;
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
declare const
|
|
61
|
-
|
|
60
|
+
declare const NoExistingDeploymentError_base: import("better-result").TaggedErrorClass<"NoExistingDeploymentError", {
|
|
61
|
+
appId: string;
|
|
62
62
|
message: string;
|
|
63
63
|
}>;
|
|
64
|
-
export declare class
|
|
64
|
+
export declare class NoExistingDeploymentError extends NoExistingDeploymentError_base {
|
|
65
65
|
constructor(args: {
|
|
66
|
-
|
|
66
|
+
appId: string;
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
declare const
|
|
70
|
-
|
|
69
|
+
declare const NoDeploymentsFoundError_base: import("better-result").TaggedErrorClass<"NoDeploymentsFoundError", {
|
|
70
|
+
appId: string;
|
|
71
71
|
message: string;
|
|
72
72
|
}>;
|
|
73
|
-
export declare class
|
|
73
|
+
export declare class NoDeploymentsFoundError extends NoDeploymentsFoundError_base {
|
|
74
74
|
constructor(args: {
|
|
75
|
-
|
|
75
|
+
appId: string;
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
declare const CancelledError_base: import("better-result").TaggedErrorClass<"CancelledError", {
|
|
@@ -85,21 +85,21 @@ export declare class CancelledError extends CancelledError_base {
|
|
|
85
85
|
}
|
|
86
86
|
declare const DestroyAggregateError_base: import("better-result").TaggedErrorClass<"DestroyAggregateError", {
|
|
87
87
|
message: string;
|
|
88
|
-
|
|
88
|
+
succeededDeploymentIds: string[];
|
|
89
89
|
failures: Array<{
|
|
90
|
-
|
|
91
|
-
error:
|
|
90
|
+
deploymentId: string;
|
|
91
|
+
error: DeploymentOperationError;
|
|
92
92
|
}>;
|
|
93
|
-
|
|
93
|
+
appDeleted: boolean;
|
|
94
94
|
}>;
|
|
95
95
|
export declare class DestroyAggregateError extends DestroyAggregateError_base {
|
|
96
96
|
constructor(args: {
|
|
97
|
-
|
|
97
|
+
succeededDeploymentIds: string[];
|
|
98
98
|
failures: Array<{
|
|
99
|
-
|
|
100
|
-
error:
|
|
99
|
+
deploymentId: string;
|
|
100
|
+
error: DeploymentOperationError;
|
|
101
101
|
}>;
|
|
102
|
-
|
|
102
|
+
appDeleted: boolean;
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
declare const InvalidOptionsError_base: import("better-result").TaggedErrorClass<"InvalidOptionsError", {
|
|
@@ -113,12 +113,12 @@ declare const LogStreamError_base: import("better-result").TaggedErrorClass<"Log
|
|
|
113
113
|
}>;
|
|
114
114
|
export declare class LogStreamError extends LogStreamError_base {
|
|
115
115
|
}
|
|
116
|
-
export type DeployError = AuthenticationError | ApiError | MissingArgumentError | InvalidOptionsError | BuildError | ArtifactError | TimeoutError |
|
|
117
|
-
export type UpdateEnvError = AuthenticationError | ApiError | MissingArgumentError | InvalidOptionsError |
|
|
118
|
-
export type
|
|
119
|
-
export type
|
|
120
|
-
export type PromoteError = AuthenticationError | ApiError | MissingArgumentError |
|
|
116
|
+
export type DeployError = AuthenticationError | ApiError | MissingArgumentError | InvalidOptionsError | BuildError | ArtifactError | TimeoutError | DeploymentFailedError | CancelledError;
|
|
117
|
+
export type UpdateEnvError = AuthenticationError | ApiError | MissingArgumentError | InvalidOptionsError | NoExistingDeploymentError | TimeoutError | DeploymentFailedError | CancelledError;
|
|
118
|
+
export type DestroyDeploymentError = CancelledError | MissingArgumentError | NoDeploymentsFoundError | AuthenticationError | ApiError | TimeoutError | DeploymentFailedError;
|
|
119
|
+
export type DestroyAppError = CancelledError | AuthenticationError | ApiError | DestroyAggregateError;
|
|
120
|
+
export type PromoteError = AuthenticationError | ApiError | MissingArgumentError | NoDeploymentsFoundError | TimeoutError | DeploymentFailedError | CancelledError;
|
|
121
121
|
export type ApiRequestError = CancelledError | AuthenticationError | ApiError;
|
|
122
|
-
export type
|
|
122
|
+
export type DeploymentOperationError = CancelledError | AuthenticationError | ApiError | TimeoutError | DeploymentFailedError;
|
|
123
123
|
export {};
|
|
124
124
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";gBAGc,GAAG;aACN,MAAM;;AAFjB,qBAAa,mBAAoB,SAAQ,wBAGrC;CAAG;;gBAGO,MAAM;gBACN,MAAM;WACX,MAAM;aACJ,MAAM;WACR,MAAM;kBACC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;AANtC,qBAAa,QAAS,SAAQ,aAO1B;CAAG;;WAGE,MAAM;aACJ,MAAM;;AAFjB,qBAAa,oBAAqB,SAAQ,yBAGtC;gBACU,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;CAMpC;;aAGU,MAAM;WACR,MAAM,EAAE;;AAFjB,qBAAa,UAAW,SAAQ,eAG5B;CAAG;;aAGI,MAAM;YACP,OAAO;;AAFjB,qBAAa,aAAc,SAAQ,kBAG/B;CAAG;;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";gBAGc,GAAG;aACN,MAAM;;AAFjB,qBAAa,mBAAoB,SAAQ,wBAGrC;CAAG;;gBAGO,MAAM;gBACN,MAAM;WACX,MAAM;aACJ,MAAM;WACR,MAAM;kBACC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;AANtC,qBAAa,QAAS,SAAQ,aAO1B;CAAG;;WAGE,MAAM;aACJ,MAAM;;AAFjB,qBAAa,oBAAqB,SAAQ,yBAGtC;gBACU,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;CAMpC;;aAGU,MAAM;WACR,MAAM,EAAE;;AAFjB,qBAAa,UAAW,SAAQ,eAG5B;CAAG;;aAGI,MAAM;YACP,OAAO;;AAFjB,qBAAa,aAAc,SAAQ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C;CAAG;AAEP,MAAM,MAAM,WAAW,GACnB,mBAAmB,GACnB,QAAQ,GACR,oBAAoB,GACpB,mBAAmB,GACnB,UAAU,GACV,aAAa,GACb,YAAY,GACZ,qBAAqB,GACrB,cAAc,CAAC;AAEnB,MAAM,MAAM,cAAc,GACtB,mBAAmB,GACnB,QAAQ,GACR,oBAAoB,GACpB,mBAAmB,GACnB,yBAAyB,GACzB,YAAY,GACZ,qBAAqB,GACrB,cAAc,CAAC;AAEnB,MAAM,MAAM,sBAAsB,GAC9B,cAAc,GACd,oBAAoB,GACpB,uBAAuB,GACvB,mBAAmB,GACnB,QAAQ,GACR,YAAY,GACZ,qBAAqB,CAAC;AAE1B,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,mBAAmB,GACnB,QAAQ,GACR,qBAAqB,CAAC;AAE1B,MAAM,MAAM,YAAY,GACpB,mBAAmB,GACnB,QAAQ,GACR,oBAAoB,GACpB,uBAAuB,GACvB,YAAY,GACZ,qBAAqB,GACrB,cAAc,CAAC;AAEnB,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,mBAAmB,GAAG,QAAQ,CAAC;AAE9E,MAAM,MAAM,wBAAwB,GAChC,cAAc,GACd,mBAAmB,GACnB,QAAQ,GACR,YAAY,GACZ,qBAAqB,CAAC"}
|
package/dist/errors.js
CHANGED
|
@@ -19,31 +19,31 @@ export class TimeoutError extends TaggedError("TimeoutError")() {
|
|
|
19
19
|
constructor(args) {
|
|
20
20
|
super({
|
|
21
21
|
...args,
|
|
22
|
-
message: `Timed out waiting for
|
|
22
|
+
message: `Timed out waiting for deployment ${args.deploymentId} to reach target state (last status: ${args.lastStatus}, elapsed: ${Math.round(args.elapsedMs / 1000)}s)`,
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
export class
|
|
26
|
+
export class DeploymentFailedError extends TaggedError("DeploymentFailedError")() {
|
|
27
27
|
constructor(args) {
|
|
28
28
|
super({
|
|
29
|
-
|
|
30
|
-
message: `
|
|
29
|
+
deploymentId: args.deploymentId,
|
|
30
|
+
message: `Deployment ${args.deploymentId} transitioned to failed status`,
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
export class
|
|
34
|
+
export class NoExistingDeploymentError extends TaggedError("NoExistingDeploymentError")() {
|
|
35
35
|
constructor(args) {
|
|
36
36
|
super({
|
|
37
|
-
|
|
38
|
-
message: `
|
|
37
|
+
appId: args.appId,
|
|
38
|
+
message: `App ${args.appId} has no existing deployments. Environment-only updates require at least one prior deployment.`,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
export class
|
|
42
|
+
export class NoDeploymentsFoundError extends TaggedError("NoDeploymentsFoundError")() {
|
|
43
43
|
constructor(args) {
|
|
44
44
|
super({
|
|
45
|
-
|
|
46
|
-
message: `
|
|
45
|
+
appId: args.appId,
|
|
46
|
+
message: `App ${args.appId} has no deployments`,
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -54,10 +54,10 @@ export class CancelledError extends TaggedError("CancelledError")() {
|
|
|
54
54
|
}
|
|
55
55
|
export class DestroyAggregateError extends TaggedError("DestroyAggregateError")() {
|
|
56
56
|
constructor(args) {
|
|
57
|
-
const failedIds = args.failures.map((f) => f.
|
|
57
|
+
const failedIds = args.failures.map((f) => f.deploymentId).join(", ");
|
|
58
58
|
super({
|
|
59
59
|
...args,
|
|
60
|
-
message: `Failed to destroy ${args.failures.length}
|
|
60
|
+
message: `Failed to destroy ${args.failures.length} deployment(s): ${failedIds}`,
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
}
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,OAAO,mBAAoB,SAAQ,WAAW,CAAC,qBAAq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C,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtE,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,OAAO,EAAE,qBAAqB,IAAI,CAAC,QAAQ,CAAC,MAAM,mBAAmB,SAAS,EAAE;SACjF,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,WAAW,CAAC,qBAAqB,CAAC,EAEvE;CAAG;AAEP,MAAM,OAAO,cAAe,SAAQ,WAAW,CAAC,gBAAgB,CAAC,EAG7D;CAAG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,20 +11,21 @@ export { type BuildSettings, joinPosix, nextOutputRootFromStandaloneDirectory, r
|
|
|
11
11
|
export type { BuildArtifact, BuildStrategy } from "./build-strategy.ts";
|
|
12
12
|
export { PreBuilt } from "./build-strategy.ts";
|
|
13
13
|
export { BunBuild } from "./bun-build.ts";
|
|
14
|
-
export type { DeployInteraction, DeployProgress,
|
|
15
|
-
export type {
|
|
14
|
+
export type { DeployInteraction, DeployProgress, DestroyAppProgress, DestroyDeploymentInteraction, DestroyDeploymentProgress, PromoteProgress, UpdateEnvProgress, } from "./callbacks.ts";
|
|
15
|
+
export type { CreateAppOptions, CreateProjectOptions, DeleteAppOptions, DeleteDeploymentOptions, DeployOptions, DeployResult, DestroyAppOptions, DestroyAppResult, DestroyDeploymentOptions, DestroyDeploymentResult, ListAppsOptions, ListDeploymentsOptions, ListProjectsOptions, PromoteOptions, PromoteResult, ShowAppOptions, ShowDeploymentOptions, StartDeploymentOptions, StopDeploymentOptions, UpdateEnvOptions, UpdateEnvResult, } from "./compute-client.ts";
|
|
16
16
|
export { ComputeClient } from "./compute-client.ts";
|
|
17
|
+
export { CustomBuild } from "./custom-build.ts";
|
|
17
18
|
export type { DetectedSchema, MigrationCommand, SchemaDetection, SchemaEngine, UnsupportedSchema, UnsupportedSchemaTarget, } from "./detect-schema.ts";
|
|
18
19
|
export { detectAppSchema } from "./detect-schema.ts";
|
|
19
|
-
export type { ApiRequestError, DeployError,
|
|
20
|
-
export { ApiError, ArtifactError, AuthenticationError, BuildError, CancelledError, DestroyAggregateError, InvalidOptionsError, LogStreamError, MissingArgumentError,
|
|
20
|
+
export type { ApiRequestError, DeployError, DeploymentOperationError, DestroyAppError, DestroyDeploymentError, PromoteError, UpdateEnvError, } from "./errors.ts";
|
|
21
|
+
export { ApiError, ArtifactError, AuthenticationError, BuildError, CancelledError, DeploymentFailedError, DestroyAggregateError, InvalidOptionsError, LogStreamError, MissingArgumentError, NoDeploymentsFoundError, NoExistingDeploymentError, TimeoutError, } from "./errors.ts";
|
|
21
22
|
export type { LogRecord, LogStreamOptions, StreamLogsError, StreamRecord, StreamResult, TerminalRecord, } from "./log-stream.ts";
|
|
22
23
|
export { streamLogs } from "./log-stream.ts";
|
|
23
24
|
export { NestjsBuild } from "./nestjs-build.ts";
|
|
24
25
|
export { NextjsBuild } from "./nextjs-build.ts";
|
|
25
26
|
export { NuxtBuild } from "./nuxt-build.ts";
|
|
26
27
|
export { TanstackStartBuild } from "./tanstack-start-build.ts";
|
|
27
|
-
export type {
|
|
28
|
+
export type { AppDetail, AppInfo, CreateProjectResult, DatabaseInfo, DeploymentDetail, DeploymentInfo, PortMapping, ProjectInfo, RegionInfo, ResolvedConfig, } from "./types.ts";
|
|
28
29
|
export { KNOWN_REGION_IDS, REGIONS } from "./types.ts";
|
|
29
30
|
export { uploadArtifact } from "./upload-artifact.ts";
|
|
30
31
|
export { type BuildCommandIo, buildCommandEnv, type PackageManager, type PackageManifest, readBuildScript, readPackageManifest, resolvePackageManager, runBuildCommand, } from "./workspace.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,GAAG,EACH,UAAU,EACV,iBAA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|
package/dist/index.js
CHANGED
|
@@ -11,8 +11,9 @@ export { joinPosix, nextOutputRootFromStandaloneDirectory, readStaticNextConfig,
|
|
|
11
11
|
export { PreBuilt } from "./build-strategy.js";
|
|
12
12
|
export { BunBuild } from "./bun-build.js";
|
|
13
13
|
export { ComputeClient } from "./compute-client.js";
|
|
14
|
+
export { CustomBuild } from "./custom-build.js";
|
|
14
15
|
export { detectAppSchema } from "./detect-schema.js";
|
|
15
|
-
export { ApiError, ArtifactError, AuthenticationError, BuildError, CancelledError, DestroyAggregateError, InvalidOptionsError, LogStreamError, MissingArgumentError,
|
|
16
|
+
export { ApiError, ArtifactError, AuthenticationError, BuildError, CancelledError, DeploymentFailedError, DestroyAggregateError, InvalidOptionsError, LogStreamError, MissingArgumentError, NoDeploymentsFoundError, NoExistingDeploymentError, TimeoutError, } from "./errors.js";
|
|
16
17
|
export { streamLogs } from "./log-stream.js";
|
|
17
18
|
export { NestjsBuild } from "./nestjs-build.js";
|
|
18
19
|
export { NextjsBuild } from "./nextjs-build.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EACL,GAAG,EACH,UAAU,EACV,iBAAiB,EACjB,EAAE,EAEF,WAAW,GACZ,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAGL,mBAAmB,EACnB,oBAAoB,GACr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,OAAO,EACL,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,YAAY,GACb,MAAM,aAAa,CAAC;AASrB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAa/D,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAEL,eAAe,EAGf,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,GAChB,MAAM,gBAAgB,CAAC"}
|
package/dist/log-stream.d.ts
CHANGED
package/dist/log-stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-stream.d.ts","sourceRoot":"","sources":["../src/log-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7D,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;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E,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,cAAc,CAAC;AA6J9D;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GACvC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAUhD"}
|
package/dist/log-stream.js
CHANGED
|
@@ -24,7 +24,7 @@ function toError(value) {
|
|
|
24
24
|
return new Error(String(value));
|
|
25
25
|
}
|
|
26
26
|
function buildWebSocketUrl(options) {
|
|
27
|
-
const httpUrl = new URL(`/v1/
|
|
27
|
+
const httpUrl = new URL(`/v1/deployments/${encodeURIComponent(options.deploymentId)}/logs`, options.baseUrl);
|
|
28
28
|
httpUrl.protocol = httpUrl.protocol === "https:" ? "wss:" : "ws:";
|
|
29
29
|
if (options.tail != null)
|
|
30
30
|
httpUrl.searchParams.set("tail", String(options.tail));
|
package/dist/log-stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-stream.js","sourceRoot":"","sources":["../src/log-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,KAAK,GAAG,KAAK,IAAI,UAAU,CAAC;AAsClC,SAAS,cAAc,CAAC,IAAY,EAAE,UAAkB;IACtD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,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AC;YACnC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACzB,OAAO,IAAI,cAAc,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACvE,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestjs-build.d.ts","sourceRoot":"","sources":["../src/nestjs-build.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQxE,OAAO,
|
|
1
|
+
{"version":3,"file":"nestjs-build.d.ts","sourceRoot":"","sources":["../src/nestjs-build.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQxE,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,gBAAgB,CAAC;AAO1E;;;;;;;;GAQG;AACH,qBAAa,WAAY,YAAW,aAAa;;gBAKnC,OAAO,EAAE;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,EAAE,CAAC,EAAE,cAAc,CAAC;KACrB;IAMK,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAOhD,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;CAuH5D"}
|
package/dist/nestjs-build.js
CHANGED
|
@@ -3,10 +3,10 @@ import os from "node:os";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { nodeFileTrace } from "@vercel/nft";
|
|
5
5
|
import { joinPosix, resolveBuildSettings, } from "./build-settings.js";
|
|
6
|
-
import { hasPackageDependency, hasRootFile,
|
|
6
|
+
import { hasPackageDependency, hasRootFile, runBuildSettingsCommand, } from "./build-strategy.js";
|
|
7
7
|
import { defaultHttpPortForBuildType } from "./config/frameworks.js";
|
|
8
8
|
import { resolveSourceRoot } from "./config/source-root.js";
|
|
9
|
-
import { readPackageManifest
|
|
9
|
+
import { readPackageManifest } from "./workspace.js";
|
|
10
10
|
const NEST_CLI_FILENAME = "nest-cli.json";
|
|
11
11
|
/** Compiled entrypoints probed, in order, when config does not resolve one. */
|
|
12
12
|
const DEFAULT_COMPILED_ENTRYPOINTS = ["dist/src/main.js", "dist/main.js"];
|
|
@@ -40,35 +40,21 @@ export class NestjsBuild {
|
|
|
40
40
|
buildType: "nestjs",
|
|
41
41
|
signal,
|
|
42
42
|
}));
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
await runBuildCommand({
|
|
50
|
-
appPath: this.#appPath,
|
|
51
|
-
command: settings.buildCommand,
|
|
52
|
-
failurePrefix: "NestJS",
|
|
53
|
-
env: this.#io?.env,
|
|
54
|
-
onOutput: this.#io?.onOutput,
|
|
55
|
-
signal,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
await runPackageCli({
|
|
60
|
-
appPath: this.#appPath,
|
|
43
|
+
await runBuildSettingsCommand({
|
|
44
|
+
appPath: this.#appPath,
|
|
45
|
+
settings,
|
|
46
|
+
failurePrefix: "NestJS",
|
|
47
|
+
defaultCli: {
|
|
48
|
+
source: "NestJS default",
|
|
61
49
|
cliName: "nest",
|
|
62
50
|
args: ["build"],
|
|
63
|
-
failurePrefix: "NestJS",
|
|
64
51
|
missingMessage: "Could not find the Nest CLI. Add a `build` script to package.json, install @nestjs/cli, or ensure npx/bunx is available.",
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
52
|
+
},
|
|
53
|
+
io: this.#io,
|
|
54
|
+
signal,
|
|
55
|
+
});
|
|
70
56
|
signal?.throwIfAborted();
|
|
71
|
-
const compiledEntry = await this.#resolveCompiledEntrypoint(signal);
|
|
57
|
+
const compiledEntry = await this.#resolveCompiledEntrypoint(settings, signal);
|
|
72
58
|
const outDir = await mkdtemp(path.join(os.tmpdir(), "compute-build-"));
|
|
73
59
|
try {
|
|
74
60
|
const artifactDir = path.join(outDir, "app");
|
|
@@ -95,8 +81,11 @@ export class NestjsBuild {
|
|
|
95
81
|
* separators. Prefers `package.json` `main`, then the path computed from
|
|
96
82
|
* `nest-cli.json` and the tsconfig `outDir`, then the common defaults.
|
|
97
83
|
*/
|
|
98
|
-
async #resolveCompiledEntrypoint(signal) {
|
|
84
|
+
async #resolveCompiledEntrypoint(settings, signal) {
|
|
99
85
|
const candidates = [];
|
|
86
|
+
if (settings.entrypoint) {
|
|
87
|
+
candidates.push(joinPosix(settings.outputDirectory, settings.entrypoint));
|
|
88
|
+
}
|
|
100
89
|
const fromMain = await this.#mainFieldEntrypoint(signal);
|
|
101
90
|
if (fromMain) {
|
|
102
91
|
candidates.push(fromMain);
|
|
@@ -105,7 +94,7 @@ export class NestjsBuild {
|
|
|
105
94
|
if (fromConfig) {
|
|
106
95
|
candidates.push(fromConfig);
|
|
107
96
|
}
|
|
108
|
-
candidates.push(...
|
|
97
|
+
candidates.push(...compiledEntrypointDefaults(settings.outputDirectory));
|
|
109
98
|
for (const candidate of candidates) {
|
|
110
99
|
signal?.throwIfAborted();
|
|
111
100
|
const normalized = normalizeRelative(candidate);
|
|
@@ -134,6 +123,16 @@ export class NestjsBuild {
|
|
|
134
123
|
return joinPosix(outDir, relativeEntry);
|
|
135
124
|
}
|
|
136
125
|
}
|
|
126
|
+
function compiledEntrypointDefaults(outputDirectory) {
|
|
127
|
+
if (outputDirectory === "dist") {
|
|
128
|
+
return DEFAULT_COMPILED_ENTRYPOINTS;
|
|
129
|
+
}
|
|
130
|
+
return [
|
|
131
|
+
joinPosix(outputDirectory, "src/main.js"),
|
|
132
|
+
joinPosix(outputDirectory, "main.js"),
|
|
133
|
+
...DEFAULT_COMPILED_ENTRYPOINTS,
|
|
134
|
+
];
|
|
135
|
+
}
|
|
137
136
|
async function readNestCliConfig(appPath, signal) {
|
|
138
137
|
signal?.throwIfAborted();
|
|
139
138
|
let content;
|