@prisma/compute-sdk 0.26.0 → 0.27.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/artifact-stage.d.ts +24 -0
- package/dist/artifact-stage.d.ts.map +1 -0
- package/dist/artifact-stage.js +165 -0
- package/dist/artifact-stage.js.map +1 -0
- package/dist/astro-build.d.ts +2 -0
- package/dist/astro-build.d.ts.map +1 -1
- package/dist/astro-build.js +8 -0
- package/dist/astro-build.js.map +1 -1
- package/dist/auto-build.d.ts +7 -4
- package/dist/auto-build.d.ts.map +1 -1
- package/dist/auto-build.js +25 -33
- package/dist/auto-build.js.map +1 -1
- package/dist/build-settings.d.ts +55 -0
- package/dist/build-settings.d.ts.map +1 -0
- package/dist/build-settings.js +301 -0
- package/dist/build-settings.js.map +1 -0
- package/dist/build-strategy.d.ts +4 -0
- package/dist/build-strategy.d.ts.map +1 -1
- package/dist/build-strategy.js +13 -20
- package/dist/build-strategy.js.map +1 -1
- package/dist/build.d.ts +45 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +86 -0
- package/dist/build.js.map +1 -0
- package/dist/bun-build.d.ts +8 -0
- package/dist/bun-build.d.ts.map +1 -1
- package/dist/bun-build.js +47 -23
- package/dist/bun-build.js.map +1 -1
- package/dist/config/frameworks.d.ts +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/nextjs-build.d.ts +12 -2
- package/dist/nextjs-build.d.ts.map +1 -1
- package/dist/nextjs-build.js +156 -75
- 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 +8 -0
- package/dist/nuxt-build.js.map +1 -1
- package/dist/tanstack-start-build.d.ts +6 -1
- package/dist/tanstack-start-build.d.ts.map +1 -1
- package/dist/tanstack-start-build.js +35 -15
- package/dist/tanstack-start-build.js.map +1 -1
- package/dist/workspace.d.ts +90 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +205 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +4 -3
- package/src/artifact-stage.ts +280 -0
- package/src/astro-build.ts +11 -1
- package/src/auto-build.ts +28 -34
- package/src/build-settings.ts +430 -0
- package/src/build-strategy.ts +22 -29
- package/src/build.ts +124 -0
- package/src/bun-build.ts +60 -27
- package/src/index.ts +28 -0
- package/src/nextjs-build.ts +206 -103
- package/src/nuxt-build.ts +11 -1
- package/src/tanstack-start-build.ts +44 -18
- package/src/workspace.ts +319 -0
package/dist/nuxt-build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt-build.js","sourceRoot":"","sources":["../src/nuxt-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"nuxt-build.js","sourceRoot":"","sources":["../src/nuxt-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AA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C,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,wNAAwN,CACzN,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC;QAEvE,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAC7C,MAAM,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE;gBAC/B,SAAS,EAAE,IAAI;gBACf,gBAAgB,EAAE,IAAI;aACvB,CAAC,CAAC;YACH,sEAAsE;YACtE,sDAAsD;YACtD,MAAM,yBAAyB,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAEpE,OAAO;gBACL,SAAS,EAAE,WAAW;gBACtB,UAAU,EAAE,kBAAkB;gBAC9B,kBAAkB,EAAE,EAAE,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,EAAE;gBACjE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;aAC5D,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACnD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { type BuildSettings } from "./build-settings.ts";
|
|
1
2
|
import type { BuildArtifact, BuildStrategy } from "./build-strategy.ts";
|
|
3
|
+
import { type BuildCommandIo } from "./workspace.ts";
|
|
2
4
|
/**
|
|
3
5
|
* Build strategy for TanStack Start applications targeting the Nitro node
|
|
4
|
-
* preset. Runs
|
|
6
|
+
* preset. Runs the resolved build command (the user's `package.json` build
|
|
7
|
+
* script, or `vite build`) and produces an artifact from its output directory.
|
|
5
8
|
*/
|
|
6
9
|
export declare class TanstackStartBuild implements BuildStrategy {
|
|
7
10
|
#private;
|
|
8
11
|
constructor(options: {
|
|
9
12
|
appPath: string;
|
|
13
|
+
buildSettings?: BuildSettings;
|
|
14
|
+
io?: BuildCommandIo;
|
|
10
15
|
});
|
|
11
16
|
canBuild(signal?: AbortSignal): Promise<boolean>;
|
|
12
17
|
execute(signal?: AbortSignal): Promise<BuildArtifact>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstack-start-build.d.ts","sourceRoot":"","sources":["../src/tanstack-start-build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tanstack-start-build.d.ts","sourceRoot":"","sources":["../src/tanstack-start-build.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,aAAa,EAAwB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGxE,OAAO,EAAE,KAAK,cAAc,EAAmB,MAAM,gBAAgB,CAAC;AAOtE;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,aAAa;;gBAK1C,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;IAIhD,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;CAwD5D"}
|
|
@@ -1,39 +1,56 @@
|
|
|
1
1
|
import { cp, mkdtemp, rm, stat } from "node:fs/promises";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import {
|
|
4
|
+
import { normalizeArtifactSymlinks } from "./artifact-postprocess.js";
|
|
5
|
+
import { resolveBuildSettings } from "./build-settings.js";
|
|
6
|
+
import { hasPackageDependency } from "./build-strategy.js";
|
|
5
7
|
import { defaultHttpPortForBuildType } from "./config/frameworks.js";
|
|
8
|
+
import { runBuildCommand } from "./workspace.js";
|
|
6
9
|
const TANSTACK_START_PACKAGES = [
|
|
7
10
|
"@tanstack/react-start",
|
|
8
11
|
"@tanstack/solid-start",
|
|
9
12
|
];
|
|
10
13
|
/**
|
|
11
14
|
* Build strategy for TanStack Start applications targeting the Nitro node
|
|
12
|
-
* preset. Runs
|
|
15
|
+
* preset. Runs the resolved build command (the user's `package.json` build
|
|
16
|
+
* script, or `vite build`) and produces an artifact from its output directory.
|
|
13
17
|
*/
|
|
14
18
|
export class TanstackStartBuild {
|
|
15
19
|
#appPath;
|
|
20
|
+
#buildSettings;
|
|
21
|
+
#io;
|
|
16
22
|
constructor(options) {
|
|
17
23
|
this.#appPath = options.appPath;
|
|
24
|
+
this.#buildSettings = options.buildSettings;
|
|
25
|
+
this.#io = options.io;
|
|
18
26
|
}
|
|
19
27
|
async canBuild(signal) {
|
|
20
28
|
return hasPackageDependency(this.#appPath, TANSTACK_START_PACKAGES, signal);
|
|
21
29
|
}
|
|
22
30
|
async execute(signal) {
|
|
23
31
|
signal?.throwIfAborted();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const settings = this.#buildSettings ??
|
|
33
|
+
(await resolveBuildSettings({
|
|
34
|
+
appPath: this.#appPath,
|
|
35
|
+
buildType: "tanstack-start",
|
|
36
|
+
signal,
|
|
37
|
+
}));
|
|
38
|
+
if (settings.buildCommand) {
|
|
39
|
+
await runBuildCommand({
|
|
40
|
+
appPath: this.#appPath,
|
|
41
|
+
command: settings.buildCommand,
|
|
42
|
+
failurePrefix: "TanStack Start",
|
|
43
|
+
env: this.#io?.env,
|
|
44
|
+
onOutput: this.#io?.onOutput,
|
|
45
|
+
signal,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const outputDir = path.join(this.#appPath, settings.outputDirectory);
|
|
49
|
+
const entrypoint = "server/index.mjs";
|
|
50
|
+
const entryStat = await stat(path.join(outputDir, entrypoint)).catch(() => null);
|
|
35
51
|
if (!entryStat?.isFile()) {
|
|
36
|
-
throw new Error(
|
|
52
|
+
throw new Error(`TanStack Start build did not produce a Nitro node server entrypoint at ${settings.outputDirectory}/${entrypoint}. ` +
|
|
53
|
+
"Ensure your vite.config includes the tanstackStart() and nitro() plugins with the default node preset.");
|
|
37
54
|
}
|
|
38
55
|
const outDir = await mkdtemp(path.join(os.tmpdir(), "compute-build-"));
|
|
39
56
|
try {
|
|
@@ -42,9 +59,12 @@ export class TanstackStartBuild {
|
|
|
42
59
|
recursive: true,
|
|
43
60
|
verbatimSymlinks: true,
|
|
44
61
|
});
|
|
62
|
+
// Materialize any symlinks into the app/workspace node_modules so the
|
|
63
|
+
// artifact is self-contained once unpacked elsewhere.
|
|
64
|
+
await normalizeArtifactSymlinks(artifactDir, this.#appPath, signal);
|
|
45
65
|
return {
|
|
46
66
|
directory: artifactDir,
|
|
47
|
-
entrypoint
|
|
67
|
+
entrypoint,
|
|
48
68
|
defaultPortMapping: {
|
|
49
69
|
http: defaultHttpPortForBuildType("tanstack-start"),
|
|
50
70
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstack-start-build.js","sourceRoot":"","sources":["../src/tanstack-start-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,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yB,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAEpE,OAAO;gBACL,SAAS,EAAE,WAAW;gBACtB,UAAU;gBACV,kBAAkB,EAAE;oBAClB,IAAI,EAAE,2BAA2B,CAAC,gBAAgB,CAAC;iBACpD;gBACD,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;aAC5D,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACnD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-aware build primitives shared by the framework strategies. These
|
|
3
|
+
* are location-agnostic: they take an explicit app directory and walk up to
|
|
4
|
+
* the source root (the repository or workspace boundary), so a build invoked
|
|
5
|
+
* from inside a monorepo package resolves the same package manager and
|
|
6
|
+
* binaries it would at the workspace root. Nothing here reads `process.cwd()`
|
|
7
|
+
* or prompts.
|
|
8
|
+
*/
|
|
9
|
+
export type PackageManager = "bun" | "pnpm" | "yarn" | "npm";
|
|
10
|
+
/**
|
|
11
|
+
* Build-environment hooks a consumer threads into a strategy: extra `env` for
|
|
12
|
+
* the build child and a per-line output tap. Both are optional, so the CLI
|
|
13
|
+
* keeps today's behavior while a headless consumer (the build-runner) injects
|
|
14
|
+
* deploy vars and streams a live build log.
|
|
15
|
+
*/
|
|
16
|
+
export interface BuildCommandIo {
|
|
17
|
+
env?: NodeJS.ProcessEnv;
|
|
18
|
+
onOutput?: (line: string, source: "stdout" | "stderr") => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Detects the package manager governing `appPath` by walking from the app up
|
|
22
|
+
* to the source root: the nearest `packageManager` field wins, then the
|
|
23
|
+
* nearest lockfile. Workspace repos keep both at the root, so a package
|
|
24
|
+
* deep in a monorepo still resolves correctly. Returns undefined when no
|
|
25
|
+
* signal is found.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolvePackageManager(appPath: string, signal?: AbortSignal): Promise<PackageManager | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* Build environment for `appPath`: every `node_modules/.bin` between the app
|
|
30
|
+
* and its source root, prepended to PATH. Workspace repos hoist binaries like
|
|
31
|
+
* `next` to the workspace root, so a build run from a package directory still
|
|
32
|
+
* finds them. The returned object is suitable as the `env` for a child build
|
|
33
|
+
* process.
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildCommandEnv(appPath: string, baseEnv: NodeJS.ProcessEnv, signal?: AbortSignal): Promise<NodeJS.ProcessEnv>;
|
|
36
|
+
/**
|
|
37
|
+
* Runs a build command string inside `appPath`, with every ancestor
|
|
38
|
+
* `node_modules/.bin` on PATH so workspace-hoisted binaries resolve. Rejects
|
|
39
|
+
* with the framework prefix and captured output on a non-zero exit.
|
|
40
|
+
*/
|
|
41
|
+
export declare function runBuildCommand(options: {
|
|
42
|
+
appPath: string;
|
|
43
|
+
command: string;
|
|
44
|
+
failurePrefix: string;
|
|
45
|
+
/**
|
|
46
|
+
* Extra environment merged over `process.env` for the build child (after
|
|
47
|
+
* the ancestor-bin PATH). A headless consumer (e.g. the build-runner) uses
|
|
48
|
+
* this to inject per-branch deploy vars and build flags; the CLI passes none.
|
|
49
|
+
*/
|
|
50
|
+
env?: NodeJS.ProcessEnv;
|
|
51
|
+
/**
|
|
52
|
+
* Per-line tap for build output, called as each line arrives on stdout or
|
|
53
|
+
* stderr. Lets a consumer stream a live build log instead of waiting for the
|
|
54
|
+
* process to exit; the CLI passes none.
|
|
55
|
+
*/
|
|
56
|
+
onOutput?: (line: string, source: "stdout" | "stderr") => void;
|
|
57
|
+
signal?: AbortSignal;
|
|
58
|
+
}): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Spawns a child build process, streaming each output line to `onOutput` and
|
|
61
|
+
* keeping a bounded tail for the failure message instead of buffering the whole
|
|
62
|
+
* build. Resolves on a zero exit; rejects on a non-zero exit (with the prefix,
|
|
63
|
+
* exit code, and tail) or a spawn error (whose `code`, e.g. ENOENT, is
|
|
64
|
+
* preserved on the rejection so a launcher ladder can branch on it).
|
|
65
|
+
*
|
|
66
|
+
* Shared by `runBuildCommand` (a shell command string) and `runPackageCli`
|
|
67
|
+
* (an explicit binary + args).
|
|
68
|
+
*/
|
|
69
|
+
export declare function runChildProcess(options: {
|
|
70
|
+
command: string;
|
|
71
|
+
args: readonly string[];
|
|
72
|
+
cwd: string;
|
|
73
|
+
env: NodeJS.ProcessEnv;
|
|
74
|
+
shell?: boolean;
|
|
75
|
+
failurePrefix: string;
|
|
76
|
+
onOutput?: (line: string, source: "stdout" | "stderr") => void;
|
|
77
|
+
signal?: AbortSignal;
|
|
78
|
+
}): Promise<void>;
|
|
79
|
+
/** A `package.json`'s build-relevant fields. */
|
|
80
|
+
export interface PackageManifest {
|
|
81
|
+
packageManager?: unknown;
|
|
82
|
+
scripts?: Record<string, unknown>;
|
|
83
|
+
main?: unknown;
|
|
84
|
+
module?: unknown;
|
|
85
|
+
}
|
|
86
|
+
/** Reads and parses `appPath/package.json`, returning null on any failure. */
|
|
87
|
+
export declare function readPackageManifest(appPath: string, signal?: AbortSignal): Promise<PackageManifest | null>;
|
|
88
|
+
/** The trimmed `scripts.build` string, or null when absent or empty. */
|
|
89
|
+
export declare function readBuildScript(manifest: PackageManifest | null): string | null;
|
|
90
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AAEH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CA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AI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,KAAK,IAAI,CAAC;IAC/D,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyChB;AA6DD,gDAAgD;AAChD,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,8EAA8E;AAC9E,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAcjC;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,eAAe,GAAG,IAAI,GAC/B,MAAM,GAAG,IAAI,CAOf"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { readFile, stat } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { sourceRootLineage } from "./config/source-root.js";
|
|
5
|
+
/**
|
|
6
|
+
* Detects the package manager governing `appPath` by walking from the app up
|
|
7
|
+
* to the source root: the nearest `packageManager` field wins, then the
|
|
8
|
+
* nearest lockfile. Workspace repos keep both at the root, so a package
|
|
9
|
+
* deep in a monorepo still resolves correctly. Returns undefined when no
|
|
10
|
+
* signal is found.
|
|
11
|
+
*/
|
|
12
|
+
export async function resolvePackageManager(appPath, signal) {
|
|
13
|
+
for (const directory of await sourceRootLineage(appPath, signal)) {
|
|
14
|
+
const manifest = await readPackageManifest(directory, signal);
|
|
15
|
+
const fromField = packageManagerFromField(manifest?.packageManager);
|
|
16
|
+
if (fromField) {
|
|
17
|
+
return fromField;
|
|
18
|
+
}
|
|
19
|
+
if ((await pathExists(path.join(directory, "bun.lock"), signal)) ||
|
|
20
|
+
(await pathExists(path.join(directory, "bun.lockb"), signal))) {
|
|
21
|
+
return "bun";
|
|
22
|
+
}
|
|
23
|
+
if (await pathExists(path.join(directory, "pnpm-lock.yaml"), signal)) {
|
|
24
|
+
return "pnpm";
|
|
25
|
+
}
|
|
26
|
+
if (await pathExists(path.join(directory, "yarn.lock"), signal)) {
|
|
27
|
+
return "yarn";
|
|
28
|
+
}
|
|
29
|
+
if (await pathExists(path.join(directory, "package-lock.json"), signal)) {
|
|
30
|
+
return "npm";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Build environment for `appPath`: every `node_modules/.bin` between the app
|
|
37
|
+
* and its source root, prepended to PATH. Workspace repos hoist binaries like
|
|
38
|
+
* `next` to the workspace root, so a build run from a package directory still
|
|
39
|
+
* finds them. The returned object is suitable as the `env` for a child build
|
|
40
|
+
* process.
|
|
41
|
+
*/
|
|
42
|
+
export async function buildCommandEnv(appPath, baseEnv, signal) {
|
|
43
|
+
const binDirs = (await sourceRootLineage(appPath, signal)).map((directory) => path.join(directory, "node_modules", ".bin"));
|
|
44
|
+
return {
|
|
45
|
+
...baseEnv,
|
|
46
|
+
PATH: [...binDirs, baseEnv.PATH].filter(Boolean).join(path.delimiter),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Runs a build command string inside `appPath`, with every ancestor
|
|
51
|
+
* `node_modules/.bin` on PATH so workspace-hoisted binaries resolve. Rejects
|
|
52
|
+
* with the framework prefix and captured output on a non-zero exit.
|
|
53
|
+
*/
|
|
54
|
+
export async function runBuildCommand(options) {
|
|
55
|
+
const env = await buildCommandEnv(options.appPath, { ...process.env, ...options.env }, options.signal);
|
|
56
|
+
// `shell: true` preserves the platform shell so a command string like
|
|
57
|
+
// `pnpm run build` works the same as the CLI's previous `exec`.
|
|
58
|
+
await runChildProcess({
|
|
59
|
+
command: options.command,
|
|
60
|
+
args: [],
|
|
61
|
+
cwd: options.appPath,
|
|
62
|
+
env,
|
|
63
|
+
shell: true,
|
|
64
|
+
failurePrefix: options.failurePrefix,
|
|
65
|
+
onOutput: options.onOutput,
|
|
66
|
+
signal: options.signal,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Spawns a child build process, streaming each output line to `onOutput` and
|
|
71
|
+
* keeping a bounded tail for the failure message instead of buffering the whole
|
|
72
|
+
* build. Resolves on a zero exit; rejects on a non-zero exit (with the prefix,
|
|
73
|
+
* exit code, and tail) or a spawn error (whose `code`, e.g. ENOENT, is
|
|
74
|
+
* preserved on the rejection so a launcher ladder can branch on it).
|
|
75
|
+
*
|
|
76
|
+
* Shared by `runBuildCommand` (a shell command string) and `runPackageCli`
|
|
77
|
+
* (an explicit binary + args).
|
|
78
|
+
*/
|
|
79
|
+
export function runChildProcess(options) {
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
81
|
+
const tail = createBoundedTail();
|
|
82
|
+
const child = spawn(options.command, [...options.args], {
|
|
83
|
+
cwd: options.cwd,
|
|
84
|
+
env: options.env,
|
|
85
|
+
signal: options.signal,
|
|
86
|
+
shell: options.shell ?? false,
|
|
87
|
+
});
|
|
88
|
+
const streamed = Promise.all([
|
|
89
|
+
streamLines(child.stdout, "stdout", tail, options.onOutput),
|
|
90
|
+
streamLines(child.stderr, "stderr", tail, options.onOutput),
|
|
91
|
+
]);
|
|
92
|
+
child.on("error", (error) => {
|
|
93
|
+
// Preserve `code` (e.g. ENOENT) so a launcher ladder can fall through.
|
|
94
|
+
reject(Object.assign(new Error(`${options.failurePrefix} build failed:\n${error.message}`), { code: error.code }));
|
|
95
|
+
});
|
|
96
|
+
child.on("close", (code) => {
|
|
97
|
+
streamed.then(() => {
|
|
98
|
+
if (code === 0) {
|
|
99
|
+
resolve();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const detail = tail.text().trim();
|
|
103
|
+
const exit = code != null ? ` (exit code ${code})` : "";
|
|
104
|
+
reject(new Error(`${options.failurePrefix} build failed${exit}${detail ? `:\n${detail}` : "."}`));
|
|
105
|
+
}, reject);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/** Splits a child stream into lines, taps each, and records it in the tail. */
|
|
110
|
+
function streamLines(stream, source, tail, onOutput) {
|
|
111
|
+
return new Promise((resolve) => {
|
|
112
|
+
if (!stream) {
|
|
113
|
+
resolve();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
stream.setEncoding("utf8");
|
|
117
|
+
let buffer = "";
|
|
118
|
+
const emit = (line) => {
|
|
119
|
+
tail.push(line);
|
|
120
|
+
onOutput?.(line, source);
|
|
121
|
+
};
|
|
122
|
+
stream.on("data", (chunk) => {
|
|
123
|
+
buffer += chunk;
|
|
124
|
+
let newline = buffer.indexOf("\n");
|
|
125
|
+
while (newline !== -1) {
|
|
126
|
+
emit(buffer.slice(0, newline));
|
|
127
|
+
buffer = buffer.slice(newline + 1);
|
|
128
|
+
newline = buffer.indexOf("\n");
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
stream.on("end", () => {
|
|
132
|
+
if (buffer.length > 0) {
|
|
133
|
+
emit(buffer);
|
|
134
|
+
}
|
|
135
|
+
resolve();
|
|
136
|
+
});
|
|
137
|
+
// A stream error surfaces through the child's own error/close handlers.
|
|
138
|
+
stream.on("error", () => resolve());
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/** A ring of the most recent output lines, for the failure message. */
|
|
142
|
+
function createBoundedTail(maxLines = 200) {
|
|
143
|
+
const lines = [];
|
|
144
|
+
return {
|
|
145
|
+
push(line) {
|
|
146
|
+
lines.push(line);
|
|
147
|
+
if (lines.length > maxLines) {
|
|
148
|
+
lines.shift();
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
text() {
|
|
152
|
+
return lines.join("\n");
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/** Reads and parses `appPath/package.json`, returning null on any failure. */
|
|
157
|
+
export async function readPackageManifest(appPath, signal) {
|
|
158
|
+
signal?.throwIfAborted();
|
|
159
|
+
try {
|
|
160
|
+
const content = await readFile(path.join(appPath, "package.json"), {
|
|
161
|
+
encoding: "utf-8",
|
|
162
|
+
signal,
|
|
163
|
+
});
|
|
164
|
+
const parsed = JSON.parse(content);
|
|
165
|
+
return isRecord(parsed) ? parsed : null;
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
// A missing file or invalid JSON is expected; an abort must propagate.
|
|
169
|
+
if (signal?.aborted)
|
|
170
|
+
throw error;
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/** The trimmed `scripts.build` string, or null when absent or empty. */
|
|
175
|
+
export function readBuildScript(manifest) {
|
|
176
|
+
const build = manifest?.scripts?.build;
|
|
177
|
+
if (typeof build !== "string") {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
const trimmed = build.trim();
|
|
181
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
182
|
+
}
|
|
183
|
+
function packageManagerFromField(value) {
|
|
184
|
+
if (typeof value !== "string") {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
const name = value.split("@")[0];
|
|
188
|
+
return name === "bun" || name === "pnpm" || name === "yarn" || name === "npm"
|
|
189
|
+
? name
|
|
190
|
+
: null;
|
|
191
|
+
}
|
|
192
|
+
async function pathExists(targetPath, signal) {
|
|
193
|
+
signal?.throwIfAborted();
|
|
194
|
+
try {
|
|
195
|
+
await stat(targetPath);
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function isRecord(value) {
|
|
203
|
+
return typeof value === "object" && value !== null;
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@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K,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/compute-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "TypeScript SDK for deploying and managing applications on Prisma Compute",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "prisma/project-compute",
|
|
@@ -38,10 +38,11 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"better-result": "^2.7.0",
|
|
41
|
+
"jiti": "^2.7.0",
|
|
42
|
+
"magicast": "^0.5.3",
|
|
41
43
|
"tar-stream": "^3.1.8",
|
|
42
44
|
"tiny-invariant": "1.3.3",
|
|
43
|
-
"ws": "^8.20.0"
|
|
44
|
-
"jiti": "^2.7.0"
|
|
45
|
+
"ws": "^8.20.0"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"@prisma/management-api-sdk": ">=1.36.0"
|