@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stages a framework's standalone output (e.g. Next.js `.next/standalone`)
|
|
3
|
+
* into a deployable artifact directory, materializing the symlinks the output
|
|
4
|
+
* carries into the workspace `node_modules` and hoisting isolated-store
|
|
5
|
+
* dependencies (pnpm `.pnpm`, bun `.bun`) so Node resolution works once the
|
|
6
|
+
* artifact is unpacked elsewhere.
|
|
7
|
+
*
|
|
8
|
+
* Location-agnostic: the workspace boundary is resolved from `appPath`, not
|
|
9
|
+
* the current working directory.
|
|
10
|
+
*/
|
|
11
|
+
export declare function stageStandaloneArtifact(options: {
|
|
12
|
+
standaloneDir: string;
|
|
13
|
+
artifactDir: string;
|
|
14
|
+
appPath: string;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* pnpm and bun (isolated linker) both keep packages in a virtual store with a
|
|
19
|
+
* shared symlink farm (`.pnpm/node_modules`, `.bun/node_modules`). Hoist the
|
|
20
|
+
* farm entries to the artifact's `node_modules` root so Node-style resolution
|
|
21
|
+
* works after symlinks are materialized.
|
|
22
|
+
*/
|
|
23
|
+
export declare function hoistIsolatedStoreDependencies(nodeModulesDir: string, signal?: AbortSignal): Promise<void>;
|
|
24
|
+
//# sourceMappingURL=artifact-stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-stage.d.ts","sourceRoot":"","sources":["../src/artifact-stage.ts"],"names":[],"mappings":"AAaA;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB;AAaD;;;;;GAKG;AACH,wBAAsB,8BAA8B,CAClD,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { chmod, copyFile, lstat, mkdir, readdir, readlink, stat, } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { resolveSourceRoot } from "./config/source-root.js";
|
|
4
|
+
/**
|
|
5
|
+
* Stages a framework's standalone output (e.g. Next.js `.next/standalone`)
|
|
6
|
+
* into a deployable artifact directory, materializing the symlinks the output
|
|
7
|
+
* carries into the workspace `node_modules` and hoisting isolated-store
|
|
8
|
+
* dependencies (pnpm `.pnpm`, bun `.bun`) so Node resolution works once the
|
|
9
|
+
* artifact is unpacked elsewhere.
|
|
10
|
+
*
|
|
11
|
+
* Location-agnostic: the workspace boundary is resolved from `appPath`, not
|
|
12
|
+
* the current working directory.
|
|
13
|
+
*/
|
|
14
|
+
export async function stageStandaloneArtifact(options) {
|
|
15
|
+
const standaloneRoot = path.resolve(options.standaloneDir);
|
|
16
|
+
const artifactRoot = path.resolve(options.artifactDir);
|
|
17
|
+
const appRoot = path.resolve(options.appPath);
|
|
18
|
+
const sourceRoot = await resolveSourceRoot(appRoot, options.signal);
|
|
19
|
+
await copyPathMaterializingSymlinks(standaloneRoot, artifactRoot, {
|
|
20
|
+
standaloneRoot,
|
|
21
|
+
appRoot,
|
|
22
|
+
sourceRoot,
|
|
23
|
+
signal: options.signal,
|
|
24
|
+
});
|
|
25
|
+
await hoistIsolatedStoreDependencies(path.join(artifactRoot, "node_modules"), options.signal);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* pnpm and bun (isolated linker) both keep packages in a virtual store with a
|
|
29
|
+
* shared symlink farm (`.pnpm/node_modules`, `.bun/node_modules`). Hoist the
|
|
30
|
+
* farm entries to the artifact's `node_modules` root so Node-style resolution
|
|
31
|
+
* works after symlinks are materialized.
|
|
32
|
+
*/
|
|
33
|
+
export async function hoistIsolatedStoreDependencies(nodeModulesDir, signal) {
|
|
34
|
+
await hoistStoreDependencies(nodeModulesDir, path.join(nodeModulesDir, ".pnpm", "node_modules"), signal);
|
|
35
|
+
await hoistStoreDependencies(nodeModulesDir, path.join(nodeModulesDir, ".bun", "node_modules"), signal);
|
|
36
|
+
}
|
|
37
|
+
async function hoistStoreDependencies(nodeModulesDir, storeNodeModulesDir, signal) {
|
|
38
|
+
if (!(await directoryExists(storeNodeModulesDir, signal))) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const entries = await readEntries(storeNodeModulesDir, signal);
|
|
42
|
+
for (const entry of entries) {
|
|
43
|
+
const sourcePath = path.join(storeNodeModulesDir, entry.name);
|
|
44
|
+
if (entry.name.startsWith("@") && entry.isDirectory()) {
|
|
45
|
+
const scopedEntries = await readEntries(sourcePath, signal);
|
|
46
|
+
for (const scopedEntry of scopedEntries) {
|
|
47
|
+
const scopedDestination = path.join(nodeModulesDir, entry.name, scopedEntry.name);
|
|
48
|
+
if (await pathExists(scopedDestination, signal)) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
signal?.throwIfAborted();
|
|
52
|
+
await mkdir(path.dirname(scopedDestination), { recursive: true });
|
|
53
|
+
await copyPathMaterializingSymlinks(path.join(sourcePath, scopedEntry.name), scopedDestination, storeMaterializeOptions(storeNodeModulesDir, nodeModulesDir, signal));
|
|
54
|
+
}
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const destinationPath = path.join(nodeModulesDir, entry.name);
|
|
58
|
+
if (await pathExists(destinationPath, signal)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
await copyPathMaterializingSymlinks(sourcePath, destinationPath, storeMaterializeOptions(storeNodeModulesDir, nodeModulesDir, signal));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function storeMaterializeOptions(storeNodeModulesDir, nodeModulesDir, signal) {
|
|
65
|
+
return {
|
|
66
|
+
standaloneRoot: storeNodeModulesDir,
|
|
67
|
+
appRoot: nodeModulesDir,
|
|
68
|
+
sourceRoot: nodeModulesDir,
|
|
69
|
+
signal,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
async function copyPathMaterializingSymlinks(sourcePath, destinationPath, options) {
|
|
73
|
+
options.signal?.throwIfAborted();
|
|
74
|
+
const sourceStat = await lstat(sourcePath);
|
|
75
|
+
if (sourceStat.isSymbolicLink()) {
|
|
76
|
+
const resolvedTarget = await resolveSymlinkTarget(sourcePath, options);
|
|
77
|
+
if (resolvedTarget === null) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
await copyPathMaterializingSymlinks(resolvedTarget, destinationPath, options);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (sourceStat.isDirectory()) {
|
|
84
|
+
await mkdir(destinationPath, { recursive: true });
|
|
85
|
+
const entries = await readEntries(sourcePath, options.signal);
|
|
86
|
+
for (const entry of entries) {
|
|
87
|
+
await copyPathMaterializingSymlinks(path.join(sourcePath, entry.name), path.join(destinationPath, entry.name), options);
|
|
88
|
+
}
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (sourceStat.isFile()) {
|
|
92
|
+
await mkdir(path.dirname(destinationPath), { recursive: true });
|
|
93
|
+
await copyFile(sourcePath, destinationPath);
|
|
94
|
+
await chmod(destinationPath, sourceStat.mode);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function resolveSymlinkTarget(symlinkPath, options) {
|
|
98
|
+
options.signal?.throwIfAborted();
|
|
99
|
+
const linkTarget = await readlink(symlinkPath);
|
|
100
|
+
const resolvedTarget = path.resolve(path.dirname(symlinkPath), linkTarget);
|
|
101
|
+
if (await pathExists(resolvedTarget, options.signal)) {
|
|
102
|
+
if (!isPathWithin(options.appRoot, resolvedTarget) &&
|
|
103
|
+
!isPathWithinWorkspaceDependency(options.sourceRoot, resolvedTarget)) {
|
|
104
|
+
throw new Error(`Build artifact symlink escapes the app directory: ${resolvedTarget}`);
|
|
105
|
+
}
|
|
106
|
+
return resolvedTarget;
|
|
107
|
+
}
|
|
108
|
+
if (isPathWithin(options.standaloneRoot, resolvedTarget)) {
|
|
109
|
+
const fallbackTarget = path.join(options.appRoot, path.relative(options.standaloneRoot, resolvedTarget));
|
|
110
|
+
if (await pathExists(fallbackTarget, options.signal)) {
|
|
111
|
+
return fallbackTarget;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// pnpm's hoist layer (.pnpm/node_modules/*) contains speculative links that
|
|
115
|
+
// are routinely dangling — Next's tracer doesn't always align with what pnpm
|
|
116
|
+
// populated. Drop these silently. Dangling links elsewhere still throw so a
|
|
117
|
+
// real missing dep doesn't get masked.
|
|
118
|
+
if (isPnpmHoistLink(symlinkPath)) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
throw new Error(`Standalone symlink target is missing: ${symlinkPath} -> ${linkTarget} (resolved to ${resolvedTarget})`);
|
|
122
|
+
}
|
|
123
|
+
function isPnpmHoistLink(symlinkPath) {
|
|
124
|
+
const parts = path.dirname(symlinkPath).split(path.sep);
|
|
125
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
126
|
+
if (parts[i] === ".pnpm" && parts[i + 1] === "node_modules") {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
function isPathWithin(rootPath, candidatePath) {
|
|
133
|
+
const relativePath = path.relative(rootPath, candidatePath);
|
|
134
|
+
return (relativePath === "" ||
|
|
135
|
+
(!relativePath.startsWith(`..${path.sep}`) &&
|
|
136
|
+
relativePath !== ".." &&
|
|
137
|
+
!path.isAbsolute(relativePath)));
|
|
138
|
+
}
|
|
139
|
+
function isPathWithinWorkspaceDependency(sourceRoot, candidatePath) {
|
|
140
|
+
return isPathWithin(path.join(sourceRoot, "node_modules"), candidatePath);
|
|
141
|
+
}
|
|
142
|
+
async function readEntries(directory, signal) {
|
|
143
|
+
signal?.throwIfAborted();
|
|
144
|
+
return readdir(directory, { withFileTypes: true });
|
|
145
|
+
}
|
|
146
|
+
async function pathExists(targetPath, signal) {
|
|
147
|
+
signal?.throwIfAborted();
|
|
148
|
+
try {
|
|
149
|
+
await stat(targetPath);
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async function directoryExists(targetPath, signal) {
|
|
157
|
+
signal?.throwIfAborted();
|
|
158
|
+
try {
|
|
159
|
+
return (await stat(targetPath)).isDirectory();
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=artifact-stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-stage.js","sourceRoot":"","sources":["../src/artifact-stage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAA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U,UAAU,CACvB,UAAkB,EAClB,MAAoB;IAEpB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,KAAK,UAAU,eAAe,CAC5B,UAAkB,EAClB,MAAoB;IAEpB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/astro-build.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BuildArtifact, BuildStrategy } from "./build-strategy.ts";
|
|
2
|
+
import type { BuildCommandIo } from "./workspace.ts";
|
|
2
3
|
/**
|
|
3
4
|
* Build strategy for Astro applications using the @astrojs/node adapter
|
|
4
5
|
* in standalone mode. Runs `astro build` and produces an artifact from `dist/`.
|
|
@@ -7,6 +8,7 @@ export declare class AstroBuild implements BuildStrategy {
|
|
|
7
8
|
#private;
|
|
8
9
|
constructor(options: {
|
|
9
10
|
appPath: string;
|
|
11
|
+
io?: BuildCommandIo;
|
|
10
12
|
});
|
|
11
13
|
canBuild(signal?: AbortSignal): Promise<boolean>;
|
|
12
14
|
execute(signal?: AbortSignal): Promise<BuildArtifact>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro-build.d.ts","sourceRoot":"","sources":["../src/astro-build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"astro-build.d.ts","sourceRoot":"","sources":["../src/astro-build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAUrD;;;GAGG;AACH,qBAAa,UAAW,YAAW,aAAa;;gBAIlC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,cAAc,CAAA;KAAE;IAKvD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAOhD,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;CA8C5D"}
|
package/dist/astro-build.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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 { normalizeArtifactSymlinks } from "./artifact-postprocess.js";
|
|
4
5
|
import { hasPackageDependency, hasRootFile, runPackageCli, } from "./build-strategy.js";
|
|
5
6
|
import { defaultHttpPortForBuildType } from "./config/frameworks.js";
|
|
6
7
|
const ASTRO_CONFIG_FILENAMES = [
|
|
@@ -16,8 +17,10 @@ const ASTRO_CONFIG_FILENAMES = [
|
|
|
16
17
|
*/
|
|
17
18
|
export class AstroBuild {
|
|
18
19
|
#appPath;
|
|
20
|
+
#io;
|
|
19
21
|
constructor(options) {
|
|
20
22
|
this.#appPath = options.appPath;
|
|
23
|
+
this.#io = options.io;
|
|
21
24
|
}
|
|
22
25
|
async canBuild(signal) {
|
|
23
26
|
return ((await hasRootFile(this.#appPath, ASTRO_CONFIG_FILENAMES, signal)) ||
|
|
@@ -31,6 +34,8 @@ export class AstroBuild {
|
|
|
31
34
|
args: ["build"],
|
|
32
35
|
failurePrefix: "Astro",
|
|
33
36
|
missingMessage: "Could not find the Astro CLI. Install it with `npm install astro` or ensure npx/bunx is available.",
|
|
37
|
+
env: this.#io?.env,
|
|
38
|
+
onOutput: this.#io?.onOutput,
|
|
34
39
|
signal,
|
|
35
40
|
});
|
|
36
41
|
const distDir = path.join(this.#appPath, "dist");
|
|
@@ -46,6 +51,9 @@ export class AstroBuild {
|
|
|
46
51
|
recursive: true,
|
|
47
52
|
verbatimSymlinks: true,
|
|
48
53
|
});
|
|
54
|
+
// Materialize any symlinks into the app/workspace node_modules so the
|
|
55
|
+
// artifact is self-contained once unpacked elsewhere.
|
|
56
|
+
await normalizeArtifactSymlinks(artifactDir, this.#appPath, signal);
|
|
49
57
|
return {
|
|
50
58
|
directory: artifactDir,
|
|
51
59
|
entrypoint: "server/entry.mjs",
|
package/dist/astro-build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro-build.js","sourceRoot":"","sources":["../src/astro-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":"astro-build.js","sourceRoot":"","sources":["../src/astro-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;AAGrE,MAAM,sBAAsB,GAAG;IAC7B,iBAAiB;IACjB,kBAAkB;I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AM,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,0KAA0K,CAC3K,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,OAAO,EAAE,WAAW,EAAE;gBAC7B,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,OAAO,CAAC,EAAE;gBAClE,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"}
|
package/dist/auto-build.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { type BuildStrategyHooks } from "./build.ts";
|
|
1
2
|
import type { BuildArtifact, BuildStrategy } from "./build-strategy.ts";
|
|
2
3
|
/**
|
|
3
|
-
* Meta-strategy that auto-detects the appropriate build strategy
|
|
4
|
-
*
|
|
4
|
+
* Meta-strategy that auto-detects the appropriate framework build strategy and
|
|
5
|
+
* delegates to it. Detection runs in registry order with bun as the universal
|
|
6
|
+
* fallback, so a buildable strategy always resolves. Use `resolveBuildStrategy`
|
|
7
|
+
* directly when the resolved build type is also needed.
|
|
5
8
|
*/
|
|
6
9
|
export declare class AutoBuild implements BuildStrategy {
|
|
7
10
|
#private;
|
|
8
11
|
constructor(options: {
|
|
9
12
|
appPath: string;
|
|
10
13
|
entrypoint?: string;
|
|
11
|
-
});
|
|
12
|
-
canBuild(
|
|
14
|
+
} & BuildStrategyHooks);
|
|
15
|
+
canBuild(_signal?: AbortSignal): Promise<boolean>;
|
|
13
16
|
execute(signal?: AbortSignal): Promise<BuildArtifact>;
|
|
14
17
|
}
|
|
15
18
|
//# sourceMappingURL=auto-build.d.ts.map
|
package/dist/auto-build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-build.d.ts","sourceRoot":"","sources":["../src/auto-build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auto-build.d.ts","sourceRoot":"","sources":["../src/auto-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAwB,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAExE;;;;;GAKG;AACH,qBAAa,SAAU,YAAW,aAAa;;gBAM3C,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,kBAAkB;IAUlE,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjD,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;CAU5D"}
|
package/dist/auto-build.js
CHANGED
|
@@ -1,43 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BunBuild } from "./bun-build.js";
|
|
3
|
-
import { NextjsBuild } from "./nextjs-build.js";
|
|
4
|
-
import { NuxtBuild } from "./nuxt-build.js";
|
|
5
|
-
import { TanstackStartBuild } from "./tanstack-start-build.js";
|
|
1
|
+
import { resolveBuildStrategy } from "./build.js";
|
|
6
2
|
/**
|
|
7
|
-
* Meta-strategy that auto-detects the appropriate build strategy
|
|
8
|
-
*
|
|
3
|
+
* Meta-strategy that auto-detects the appropriate framework build strategy and
|
|
4
|
+
* delegates to it. Detection runs in registry order with bun as the universal
|
|
5
|
+
* fallback, so a buildable strategy always resolves. Use `resolveBuildStrategy`
|
|
6
|
+
* directly when the resolved build type is also needed.
|
|
9
7
|
*/
|
|
10
8
|
export class AutoBuild {
|
|
11
|
-
#
|
|
9
|
+
#appPath;
|
|
10
|
+
#entrypoint;
|
|
11
|
+
#hooks;
|
|
12
12
|
constructor(options) {
|
|
13
|
-
this.#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
appPath: options.appPath,
|
|
20
|
-
entrypoint: options.entrypoint,
|
|
21
|
-
}),
|
|
22
|
-
];
|
|
13
|
+
this.#appPath = options.appPath;
|
|
14
|
+
this.#entrypoint = options.entrypoint;
|
|
15
|
+
this.#hooks = {
|
|
16
|
+
io: options.io,
|
|
17
|
+
requireStandalone: options.requireStandalone,
|
|
18
|
+
};
|
|
23
19
|
}
|
|
24
|
-
async canBuild(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (await strategy.canBuild(signal)) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
20
|
+
async canBuild(_signal) {
|
|
21
|
+
// Detection always resolves (bun is the universal fallback).
|
|
22
|
+
return true;
|
|
32
23
|
}
|
|
33
24
|
async execute(signal) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
const { strategy } = await resolveBuildStrategy({
|
|
26
|
+
appPath: this.#appPath,
|
|
27
|
+
entrypoint: this.#entrypoint,
|
|
28
|
+
buildType: "auto",
|
|
29
|
+
signal,
|
|
30
|
+
...this.#hooks,
|
|
31
|
+
});
|
|
32
|
+
return strategy.execute(signal);
|
|
41
33
|
}
|
|
42
34
|
}
|
|
43
35
|
//# sourceMappingURL=auto-build.js.map
|
package/dist/auto-build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-build.js","sourceRoot":"","sources":["../src/auto-build.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"auto-build.js","sourceRoot":"","sources":["../src/auto-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAG3E;;;;;GAKG;AACH,MAAM,OAAO,SAAS;IACX,QAAQ,CAAS;IACjB,WAAW,CAAU;IACrB,MAAM,CAAqB;IAEpC,YACE,OAAsE;QAEtE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG;YACZ,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;SAC7C,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAqB;QAClC,6DAA6D;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAoB;QAChC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,oBAAoB,CAAC;YAC9C,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,SAAS,EAAE,MAAM;YACjB,MAAM;YACN,GAAG,IAAI,CAAC,MAAM;SACf,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { FrameworkBuildType } from "./config/frameworks.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The build command and output directory for a framework build, with a
|
|
4
|
+
* human-readable source for each value (for display by a consumer). Resolving
|
|
5
|
+
* settings is location-agnostic: package manager and binaries come from the
|
|
6
|
+
* app's workspace, not the current working directory.
|
|
7
|
+
*/
|
|
8
|
+
export interface BuildSettings {
|
|
9
|
+
buildCommand: string | null;
|
|
10
|
+
buildCommandSource: string | null;
|
|
11
|
+
outputDirectory: string;
|
|
12
|
+
outputDirectorySource: string | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolves build settings from framework inference: the user's
|
|
16
|
+
* `package.json` build script (run via the detected package manager) over the
|
|
17
|
+
* framework default, plus the framework's output directory (reading
|
|
18
|
+
* `next.config` `distDir` for Next.js).
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveBuildSettings(options: {
|
|
21
|
+
appPath: string;
|
|
22
|
+
buildType: FrameworkBuildType;
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}): Promise<BuildSettings>;
|
|
25
|
+
/**
|
|
26
|
+
* Build settings when committed config owns them: configured fields win,
|
|
27
|
+
* omitted fields fall back to framework inference. `source` labels configured
|
|
28
|
+
* values with the config filename so a consumer can show provenance.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveConfiguredBuildSettings(options: {
|
|
31
|
+
appPath: string;
|
|
32
|
+
buildType: FrameworkBuildType;
|
|
33
|
+
configured: {
|
|
34
|
+
command: string | null | undefined;
|
|
35
|
+
outputDirectory: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
/** Label for configured values, e.g. the config file basename. */
|
|
38
|
+
source: string;
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
}): Promise<BuildSettings>;
|
|
41
|
+
/** Joins posix-style path segments, collapsing duplicate separators. */
|
|
42
|
+
export declare function joinPosix(...parts: string[]): string;
|
|
43
|
+
/**
|
|
44
|
+
* Maps a Next.js standalone output directory (e.g. ".next/standalone") back to
|
|
45
|
+
* its output root (".next"), so static assets can be staged alongside it.
|
|
46
|
+
*/
|
|
47
|
+
export declare function nextOutputRootFromStandaloneDirectory(outputDirectory: string): string;
|
|
48
|
+
interface StaticNextConfig {
|
|
49
|
+
distDir?: string;
|
|
50
|
+
output?: "standalone" | "export";
|
|
51
|
+
}
|
|
52
|
+
/** Best-effort static read of `distDir`/`output` from a next.config source. */
|
|
53
|
+
export declare function readStaticNextConfig(content: string): StaticNextConfig;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=build-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-settings.d.ts","sourceRoot":"","sources":["../src/build-settings.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQjE;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,aAAa,CAAC,CA8EzB;AAED;;;;GAIG;AACH,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,UAAU,EAAE;QACV,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACnC,eAAe,EAAE,MAAM,GAAG,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