@prisma/cli 3.0.0-beta.8 → 3.0.0-dev.101.1

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.
Files changed (56) hide show
  1. package/README.md +0 -13
  2. package/dist/adapters/mock-api.js +75 -0
  3. package/dist/adapters/token-storage.js +311 -33
  4. package/dist/cli.js +7 -7
  5. package/dist/cli2.js +5 -3
  6. package/dist/commands/app/index.js +65 -52
  7. package/dist/commands/auth/index.js +55 -2
  8. package/dist/commands/database/index.js +159 -0
  9. package/dist/controllers/app-env.js +10 -7
  10. package/dist/controllers/app.js +550 -208
  11. package/dist/controllers/auth.js +211 -2
  12. package/dist/controllers/branch.js +5 -6
  13. package/dist/controllers/database.js +318 -0
  14. package/dist/controllers/project.js +49 -20
  15. package/dist/lib/app/app-interaction.js +5 -0
  16. package/dist/lib/app/{preview-provider.js → app-provider.js} +32 -28
  17. package/dist/lib/app/{preview-branch-database.js → branch-database-api.js} +1 -1
  18. package/dist/lib/app/branch-database-deploy.js +13 -60
  19. package/dist/lib/app/branch-database.js +1 -102
  20. package/dist/lib/app/build-settings.js +93 -0
  21. package/dist/lib/app/build.js +82 -0
  22. package/dist/lib/app/bun-project.js +2 -3
  23. package/dist/lib/app/compute-config.js +147 -0
  24. package/dist/lib/app/deploy-plan.js +58 -0
  25. package/dist/lib/app/{preview-progress.js → deploy-progress.js} +5 -5
  26. package/dist/lib/app/local-dev.js +3 -60
  27. package/dist/lib/app/production-deploy-gate.js +3 -3
  28. package/dist/lib/app/read-branch.js +30 -0
  29. package/dist/lib/auth/auth-ops.js +10 -4
  30. package/dist/lib/auth/guard.js +4 -1
  31. package/dist/lib/auth/login.js +32 -25
  32. package/dist/lib/database/provider.js +167 -0
  33. package/dist/lib/diagnostics.js +1 -1
  34. package/dist/lib/fs/home-path.js +24 -0
  35. package/dist/lib/git/local-branch.js +15 -3
  36. package/dist/lib/project/local-pin.js +170 -40
  37. package/dist/lib/project/resolution.js +166 -61
  38. package/dist/lib/project/setup.js +65 -19
  39. package/dist/output/patterns.js +1 -1
  40. package/dist/presenters/app.js +44 -39
  41. package/dist/presenters/auth.js +98 -1
  42. package/dist/presenters/branch.js +1 -1
  43. package/dist/presenters/database.js +274 -0
  44. package/dist/presenters/project.js +3 -9
  45. package/dist/shell/command-meta.js +153 -2
  46. package/dist/shell/command-runner.js +39 -21
  47. package/dist/shell/diagnostics-output.js +2 -8
  48. package/dist/shell/errors.js +50 -1
  49. package/dist/shell/help.js +30 -20
  50. package/dist/shell/runtime.js +8 -4
  51. package/dist/shell/ui.js +19 -2
  52. package/dist/use-cases/auth.js +68 -1
  53. package/package.json +18 -3
  54. package/dist/lib/app/preview-build-settings.js +0 -385
  55. package/dist/lib/app/preview-build.js +0 -475
  56. package/dist/lib/app/preview-interaction.js +0 -5
@@ -1,475 +0,0 @@
1
- import { readBunPackageJson, resolveBunEntrypoint } from "./bun-project.js";
2
- import { PRISMA_APP_CONFIG_FILENAME, hasAnyPackageDependency, hasPackageDependency, hasRootFile, joinPosix, nextOutputRootFromStandaloneDirectory, resolvePreviewBuildSettings, runResolvedBuildCommand } from "./preview-build-settings.js";
3
- import { chmod, copyFile, cp, lstat, mkdir, mkdtemp, readFile, readdir, readlink, rm, stat } from "node:fs/promises";
4
- import path from "node:path";
5
- import os from "node:os";
6
- import { AstroBuild, BunBuild, NuxtBuild } from "@prisma/compute-sdk";
7
- //#region src/lib/app/preview-build.ts
8
- const PREVIEW_BUILD_TYPES = [
9
- "auto",
10
- "bun",
11
- "nextjs",
12
- "nuxt",
13
- "astro",
14
- "tanstack-start"
15
- ];
16
- const RESOLVED_PREVIEW_BUILD_TYPES = PREVIEW_BUILD_TYPES.filter((buildType) => buildType !== "auto");
17
- var PreviewBuildStrategy = class {
18
- #appPath;
19
- #entrypoint;
20
- #buildType;
21
- #signal;
22
- #buildSettings;
23
- constructor(options) {
24
- this.#appPath = options.appPath;
25
- this.#entrypoint = options.entrypoint;
26
- this.#buildType = options.buildType ?? "auto";
27
- this.#signal = options.signal;
28
- this.#buildSettings = options.buildSettings;
29
- }
30
- async canBuild(signal = this.#signal) {
31
- const { strategy } = await resolvePreviewBuildStrategy({
32
- appPath: this.#appPath,
33
- entrypoint: this.#entrypoint,
34
- buildType: this.#buildType,
35
- signal,
36
- buildSettings: this.#buildSettings
37
- });
38
- return strategy.canBuild(signal);
39
- }
40
- async execute(signal = this.#signal) {
41
- const { artifact } = await executePreviewBuild({
42
- appPath: this.#appPath,
43
- entrypoint: this.#entrypoint,
44
- buildType: this.#buildType,
45
- signal,
46
- buildSettings: this.#buildSettings
47
- });
48
- return artifact;
49
- }
50
- };
51
- async function executePreviewBuild(options) {
52
- const { strategy, buildType } = await resolvePreviewBuildStrategy({
53
- appPath: options.appPath,
54
- entrypoint: options.entrypoint,
55
- buildType: options.buildType ?? "auto",
56
- signal: options.signal,
57
- buildSettings: options.buildSettings
58
- });
59
- const artifact = await strategy.execute(options.signal);
60
- try {
61
- await normalizeArtifactSymlinks(artifact.directory, options.appPath, options.signal);
62
- return {
63
- artifact,
64
- buildType
65
- };
66
- } catch (error) {
67
- await artifact.cleanup?.().catch(() => void 0);
68
- throw error;
69
- }
70
- }
71
- async function resolvePreviewBuildStrategy(options) {
72
- if (options.buildType !== "auto") {
73
- const strategy = await createPreviewBuildStrategy({
74
- appPath: options.appPath,
75
- entrypoint: options.entrypoint,
76
- buildType: options.buildType,
77
- signal: options.signal,
78
- buildSettings: options.buildSettings
79
- });
80
- return {
81
- buildType: options.buildType,
82
- strategy
83
- };
84
- }
85
- for (const buildType of RESOLVED_PREVIEW_BUILD_TYPES) {
86
- if (buildType === "bun") continue;
87
- const strategy = await createPreviewBuildStrategy({
88
- appPath: options.appPath,
89
- entrypoint: options.entrypoint,
90
- buildType,
91
- signal: options.signal,
92
- buildSettings: options.buildSettings
93
- });
94
- if (await strategy.canBuild(options.signal)) return {
95
- buildType,
96
- strategy
97
- };
98
- }
99
- return {
100
- buildType: "bun",
101
- strategy: await createPreviewBuildStrategy({
102
- appPath: options.appPath,
103
- entrypoint: options.entrypoint,
104
- buildType: "bun",
105
- signal: options.signal,
106
- buildSettings: options.buildSettings
107
- })
108
- };
109
- }
110
- async function createPreviewBuildStrategy(options) {
111
- switch (options.buildType) {
112
- case "nextjs": return new PreviewNextjsBuild({
113
- appPath: options.appPath,
114
- buildSettings: options.buildSettings
115
- });
116
- case "nuxt": return new NuxtBuild({ appPath: options.appPath });
117
- case "astro": return new AstroBuild({ appPath: options.appPath });
118
- case "tanstack-start": return new PreviewTanstackStartBuild({
119
- appPath: options.appPath,
120
- buildSettings: options.buildSettings
121
- });
122
- case "bun": {
123
- const entrypoint = await resolveBunEntrypoint(options.appPath, options.entrypoint, options.signal);
124
- return new PreviewBunBuild({
125
- appPath: options.appPath,
126
- strategy: new BunBuild({
127
- appPath: options.appPath,
128
- entrypoint
129
- }),
130
- buildSettings: options.buildSettings
131
- });
132
- }
133
- }
134
- }
135
- var PreviewNextjsBuild = class {
136
- #appPath;
137
- #buildSettings;
138
- constructor(options) {
139
- this.#appPath = options.appPath;
140
- this.#buildSettings = options.buildSettings;
141
- }
142
- async canBuild(signal) {
143
- const packageJson = await readBunPackageJson(this.#appPath, signal);
144
- return await hasRootFile(this.#appPath, NEXT_CONFIG_FILENAMES, signal) || hasPackageDependency(packageJson, "next");
145
- }
146
- async execute(signal) {
147
- const settings = this.#buildSettings ?? await resolvePreviewBuildSettings({
148
- appPath: this.#appPath,
149
- buildType: "nextjs",
150
- signal
151
- });
152
- await runResolvedBuildCommand(this.#appPath, settings, "Next.js", signal);
153
- const standaloneDir = path.join(this.#appPath, settings.outputDirectory);
154
- if (!await directoryExists(standaloneDir, signal)) throw new Error(`Next.js build did not produce standalone output at ${settings.outputDirectory}. Add output: "standalone" to your next.config file, or update ${PRISMA_APP_CONFIG_FILENAME}.`);
155
- const outDir = await unsupportedFilesystemBoundary(signal, () => mkdtemp(path.join(os.tmpdir(), "compute-build-")));
156
- try {
157
- const artifactDir = path.join(outDir, "app");
158
- await stageNextjsStandaloneArtifact({
159
- standaloneDir,
160
- artifactDir,
161
- appPath: this.#appPath,
162
- signal
163
- });
164
- const entrypoint = await findNextStandaloneEntrypoint(artifactDir, signal);
165
- await copyNextjsStaticAssets({
166
- appPath: this.#appPath,
167
- artifactDir,
168
- outputRoot: nextOutputRootFromStandaloneDirectory(settings.outputDirectory),
169
- entrypoint,
170
- signal
171
- });
172
- return {
173
- directory: artifactDir,
174
- entrypoint,
175
- defaultPortMapping: { http: 3e3 },
176
- cleanup: () => rm(outDir, {
177
- recursive: true,
178
- force: true
179
- })
180
- };
181
- } catch (error) {
182
- await rm(outDir, {
183
- recursive: true,
184
- force: true
185
- });
186
- throw error;
187
- }
188
- }
189
- };
190
- var PreviewTanstackStartBuild = class {
191
- #appPath;
192
- #buildSettings;
193
- constructor(options) {
194
- this.#appPath = options.appPath;
195
- this.#buildSettings = options.buildSettings;
196
- }
197
- async canBuild(signal) {
198
- return hasAnyPackageDependency(await readBunPackageJson(this.#appPath, signal), TANSTACK_START_PACKAGES);
199
- }
200
- async execute(signal) {
201
- const settings = this.#buildSettings ?? await resolvePreviewBuildSettings({
202
- appPath: this.#appPath,
203
- buildType: "tanstack-start",
204
- signal
205
- });
206
- await runResolvedBuildCommand(this.#appPath, settings, "TanStack Start", signal);
207
- const outputDir = path.join(this.#appPath, settings.outputDirectory);
208
- const entrypoint = "server/index.mjs";
209
- const entryPath = path.join(outputDir, entrypoint);
210
- if (!(await unsupportedFilesystemBoundary(signal, () => stat(entryPath).catch(() => null)))?.isFile()) throw new Error(`TanStack Start build did not produce a Nitro node server entrypoint at ${joinPosix(settings.outputDirectory, entrypoint)}. Ensure your vite.config includes the tanstackStart() and nitro() plugins with the default node preset, or update ${PRISMA_APP_CONFIG_FILENAME}.`);
211
- const outDir = await unsupportedFilesystemBoundary(signal, () => mkdtemp(path.join(os.tmpdir(), "compute-build-")));
212
- try {
213
- const artifactDir = path.join(outDir, "app");
214
- await unsupportedFilesystemBoundary(signal, () => cp(outputDir, artifactDir, {
215
- recursive: true,
216
- verbatimSymlinks: true
217
- }));
218
- return {
219
- directory: artifactDir,
220
- entrypoint,
221
- defaultPortMapping: { http: 3e3 },
222
- cleanup: () => rm(outDir, {
223
- recursive: true,
224
- force: true
225
- })
226
- };
227
- } catch (error) {
228
- await rm(outDir, {
229
- recursive: true,
230
- force: true
231
- });
232
- throw error;
233
- }
234
- }
235
- };
236
- var PreviewBunBuild = class {
237
- #appPath;
238
- #strategy;
239
- #buildSettings;
240
- constructor(options) {
241
- this.#appPath = options.appPath;
242
- this.#strategy = options.strategy;
243
- this.#buildSettings = options.buildSettings;
244
- }
245
- async canBuild(signal) {
246
- return this.#strategy.canBuild(signal);
247
- }
248
- async execute(signal) {
249
- const settings = this.#buildSettings ?? await resolvePreviewBuildSettings({
250
- appPath: this.#appPath,
251
- buildType: "bun",
252
- signal
253
- });
254
- await runResolvedBuildCommand(this.#appPath, settings, "Bun", signal);
255
- return this.#strategy.execute(signal);
256
- }
257
- };
258
- const NEXT_CONFIG_FILENAMES = [
259
- "next.config.js",
260
- "next.config.mjs",
261
- "next.config.ts",
262
- "next.config.mts"
263
- ];
264
- const TANSTACK_START_PACKAGES = [
265
- "@tanstack/react-start",
266
- "@tanstack/solid-start",
267
- "@tanstack/start"
268
- ];
269
- async function stageNextjsStandaloneArtifact(options) {
270
- const standaloneRoot = path.resolve(options.standaloneDir);
271
- const artifactRoot = path.resolve(options.artifactDir);
272
- const appRoot = path.resolve(options.appPath);
273
- await copyPathMaterializingSymlinks(standaloneRoot, artifactRoot, {
274
- standaloneRoot,
275
- appRoot,
276
- sourceRoot: await resolveSourceRoot(appRoot, options.signal),
277
- signal: options.signal
278
- });
279
- await hoistPnpmDependencies(path.join(artifactRoot, "node_modules"), options.signal);
280
- }
281
- async function copyNextjsStaticAssets(options) {
282
- const serverSubpath = nextjsServerSubpath(options.entrypoint);
283
- const serverDir = serverSubpath ? path.join(options.artifactDir, serverSubpath) : options.artifactDir;
284
- const publicDir = path.join(options.appPath, "public");
285
- if (await directoryExists(publicDir, options.signal)) await unsupportedFilesystemBoundary(options.signal, () => cp(publicDir, path.join(serverDir, "public"), {
286
- recursive: true,
287
- verbatimSymlinks: true
288
- }));
289
- const staticDir = path.join(options.appPath, options.outputRoot, "static");
290
- if (await directoryExists(staticDir, options.signal)) await unsupportedFilesystemBoundary(options.signal, () => cp(staticDir, path.join(serverDir, options.outputRoot, "static"), {
291
- recursive: true,
292
- verbatimSymlinks: true
293
- }));
294
- }
295
- async function findNextStandaloneEntrypoint(artifactDir, signal) {
296
- const rootEntrypoint = path.join(artifactDir, "server.js");
297
- if ((await unsupportedFilesystemBoundary(signal, () => stat(rootEntrypoint).catch(() => null)))?.isFile()) return "server.js";
298
- const candidates = [];
299
- await walk(artifactDir);
300
- candidates.sort((left, right) => left.split("/").length - right.split("/").length || left.localeCompare(right));
301
- const selected = candidates[0];
302
- if (!selected) throw new Error(`Next.js standalone output did not contain server.js in ${artifactDir}`);
303
- return selected;
304
- async function walk(directory) {
305
- const entries = await unsupportedFilesystemBoundary(signal, () => readdir(directory, { withFileTypes: true }));
306
- for (const entry of entries) {
307
- if (entry.name === "node_modules") continue;
308
- const fullPath = path.join(directory, entry.name);
309
- if (entry.isDirectory()) {
310
- await walk(fullPath);
311
- continue;
312
- }
313
- if (entry.isFile() && entry.name === "server.js") candidates.push(path.relative(artifactDir, fullPath).split(path.sep).join("/"));
314
- }
315
- }
316
- }
317
- function nextjsServerSubpath(entrypoint) {
318
- const dir = path.posix.dirname(entrypoint);
319
- return dir === "." ? "" : dir;
320
- }
321
- async function hoistPnpmDependencies(nodeModulesDir, signal) {
322
- const pnpmNodeModulesDir = path.join(nodeModulesDir, ".pnpm", "node_modules");
323
- if (!await directoryExists(pnpmNodeModulesDir, signal)) return;
324
- const entries = await unsupportedFilesystemBoundary(signal, () => readdir(pnpmNodeModulesDir, { withFileTypes: true }));
325
- for (const entry of entries) {
326
- const sourcePath = path.join(pnpmNodeModulesDir, entry.name);
327
- if (entry.name.startsWith("@") && entry.isDirectory()) {
328
- const scopedEntries = await unsupportedFilesystemBoundary(signal, () => readdir(sourcePath, { withFileTypes: true }));
329
- for (const scopedEntry of scopedEntries) {
330
- const scopedDestination = path.join(nodeModulesDir, entry.name, scopedEntry.name);
331
- if (await pathExists(scopedDestination, signal)) continue;
332
- await unsupportedFilesystemBoundary(signal, () => mkdir(path.dirname(scopedDestination), { recursive: true }));
333
- await copyPathMaterializingSymlinks(path.join(sourcePath, scopedEntry.name), scopedDestination, {
334
- standaloneRoot: pnpmNodeModulesDir,
335
- appRoot: nodeModulesDir,
336
- sourceRoot: nodeModulesDir,
337
- signal
338
- });
339
- }
340
- continue;
341
- }
342
- const destinationPath = path.join(nodeModulesDir, entry.name);
343
- if (await pathExists(destinationPath, signal)) continue;
344
- await copyPathMaterializingSymlinks(sourcePath, destinationPath, {
345
- standaloneRoot: pnpmNodeModulesDir,
346
- appRoot: nodeModulesDir,
347
- sourceRoot: nodeModulesDir,
348
- signal
349
- });
350
- }
351
- }
352
- async function normalizeArtifactSymlinks(artifactDir, appPath, signal) {
353
- const normalizedArtifactDir = path.resolve(artifactDir);
354
- const normalizedAppPath = path.resolve(appPath);
355
- await walkDirectory(normalizedArtifactDir);
356
- async function walkDirectory(directory) {
357
- const entries = await unsupportedFilesystemBoundary(signal, () => readdir(directory, { withFileTypes: true }));
358
- for (const entry of entries) {
359
- const fullPath = path.join(directory, entry.name);
360
- if (entry.isDirectory()) {
361
- await walkDirectory(fullPath);
362
- continue;
363
- }
364
- if (!entry.isSymbolicLink()) continue;
365
- const target = await unsupportedFilesystemBoundary(signal, () => readlink(fullPath));
366
- const resolvedTarget = path.resolve(path.dirname(fullPath), target);
367
- if (isPathWithin(normalizedArtifactDir, resolvedTarget)) continue;
368
- if (!isPathWithin(normalizedAppPath, resolvedTarget)) throw new Error(`Build artifact symlink escapes the app directory: ${resolvedTarget}`);
369
- const targetStat = await unsupportedFilesystemBoundary(signal, () => stat(resolvedTarget));
370
- await unsupportedFilesystemBoundary(signal, () => rm(fullPath, {
371
- force: true,
372
- recursive: true
373
- }));
374
- await unsupportedFilesystemBoundary(signal, () => cp(resolvedTarget, fullPath, {
375
- recursive: targetStat.isDirectory(),
376
- dereference: true
377
- }));
378
- if (targetStat.isDirectory()) await walkDirectory(fullPath);
379
- }
380
- }
381
- }
382
- function isPathWithin(rootPath, candidatePath) {
383
- const relativePath = path.relative(rootPath, candidatePath);
384
- return relativePath === "" || !relativePath.startsWith(`..${path.sep}`) && relativePath !== ".." && !path.isAbsolute(relativePath);
385
- }
386
- function isPathWithinWorkspaceDependency(sourceRoot, candidatePath) {
387
- return isPathWithin(path.join(sourceRoot, "node_modules"), candidatePath);
388
- }
389
- async function copyPathMaterializingSymlinks(sourcePath, destinationPath, options) {
390
- const sourceStat = await unsupportedFilesystemBoundary(options.signal, () => lstat(sourcePath));
391
- if (sourceStat.isSymbolicLink()) {
392
- const resolvedTarget = await resolveSymlinkTarget(sourcePath, options);
393
- if (resolvedTarget === null) return;
394
- await copyPathMaterializingSymlinks(resolvedTarget, destinationPath, options);
395
- return;
396
- }
397
- if (sourceStat.isDirectory()) {
398
- await unsupportedFilesystemBoundary(options.signal, () => mkdir(destinationPath, { recursive: true }));
399
- const entries = await unsupportedFilesystemBoundary(options.signal, () => readdir(sourcePath, { withFileTypes: true }));
400
- for (const entry of entries) await copyPathMaterializingSymlinks(path.join(sourcePath, entry.name), path.join(destinationPath, entry.name), options);
401
- return;
402
- }
403
- if (sourceStat.isFile()) {
404
- await unsupportedFilesystemBoundary(options.signal, () => mkdir(path.dirname(destinationPath), { recursive: true }));
405
- await unsupportedFilesystemBoundary(options.signal, () => copyFile(sourcePath, destinationPath));
406
- await unsupportedFilesystemBoundary(options.signal, () => chmod(destinationPath, sourceStat.mode));
407
- }
408
- }
409
- async function resolveSymlinkTarget(symlinkPath, options) {
410
- const linkTarget = await unsupportedFilesystemBoundary(options.signal, () => readlink(symlinkPath));
411
- const resolvedTarget = path.resolve(path.dirname(symlinkPath), linkTarget);
412
- if (await pathExists(resolvedTarget, options.signal)) {
413
- if (!isPathWithin(options.appRoot, resolvedTarget) && !isPathWithinWorkspaceDependency(options.sourceRoot, resolvedTarget)) throw new Error(`Build artifact symlink escapes the app directory: ${resolvedTarget}`);
414
- return resolvedTarget;
415
- }
416
- if (isPathWithin(options.standaloneRoot, resolvedTarget)) {
417
- const fallbackTarget = path.join(options.appRoot, path.relative(options.standaloneRoot, resolvedTarget));
418
- if (await pathExists(fallbackTarget, options.signal)) return fallbackTarget;
419
- }
420
- if (isPnpmHoistLink(symlinkPath)) return null;
421
- throw new Error(`Next.js standalone symlink target is missing: ${symlinkPath} -> ${linkTarget} (resolved to ${resolvedTarget})`);
422
- }
423
- function isPnpmHoistLink(symlinkPath) {
424
- const parts = path.dirname(symlinkPath).split(path.sep);
425
- for (let i = 0; i < parts.length - 1; i++) if (parts[i] === ".pnpm" && parts[i + 1] === "node_modules") return true;
426
- return false;
427
- }
428
- async function pathExists(targetPath, signal) {
429
- try {
430
- await unsupportedFilesystemBoundary(signal, () => stat(targetPath));
431
- return true;
432
- } catch (error) {
433
- if (signal?.aborted) throw error;
434
- return false;
435
- }
436
- }
437
- async function directoryExists(targetPath, signal) {
438
- try {
439
- return (await unsupportedFilesystemBoundary(signal, () => stat(targetPath))).isDirectory();
440
- } catch (error) {
441
- if (signal?.aborted) throw error;
442
- return false;
443
- }
444
- }
445
- async function resolveSourceRoot(appRoot, signal) {
446
- let current = path.resolve(appRoot);
447
- while (true) {
448
- if (await pathExists(path.join(current, ".git"), signal) || await pathExists(path.join(current, "pnpm-workspace.yaml"), signal) || await pathExists(path.join(current, "bun.lock"), signal) || await pathExists(path.join(current, "bun.lockb"), signal) || await packageJsonDeclaresWorkspaces(current, signal)) return current;
449
- const parent = path.dirname(current);
450
- if (parent === current) return path.resolve(appRoot);
451
- current = parent;
452
- }
453
- }
454
- async function packageJsonDeclaresWorkspaces(directory, signal) {
455
- signal?.throwIfAborted();
456
- try {
457
- const content = await readFile(path.join(directory, "package.json"), {
458
- encoding: "utf8",
459
- signal
460
- });
461
- const parsed = JSON.parse(content);
462
- return Boolean(parsed.workspaces);
463
- } catch (error) {
464
- if (signal?.aborted) throw error;
465
- return false;
466
- }
467
- }
468
- async function unsupportedFilesystemBoundary(signal, operation) {
469
- signal?.throwIfAborted();
470
- const result = await operation();
471
- signal?.throwIfAborted();
472
- return result;
473
- }
474
- //#endregion
475
- export { PREVIEW_BUILD_TYPES, PreviewBuildStrategy, RESOLVED_PREVIEW_BUILD_TYPES, executePreviewBuild };
@@ -1,5 +0,0 @@
1
- import "../../shell/prompt.js";
2
- //#region src/lib/app/preview-interaction.ts
3
- const PREVIEW_DEFAULT_REGION = "eu-central-1";
4
- //#endregion
5
- export { PREVIEW_DEFAULT_REGION };