@prisma/compute-sdk 0.27.0 → 0.29.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.
Files changed (76) hide show
  1. package/dist/astro-build.d.ts +2 -0
  2. package/dist/astro-build.d.ts.map +1 -1
  3. package/dist/astro-build.js +31 -39
  4. package/dist/astro-build.js.map +1 -1
  5. package/dist/build-settings.d.ts +3 -0
  6. package/dist/build-settings.d.ts.map +1 -1
  7. package/dist/build-settings.js +23 -0
  8. package/dist/build-settings.js.map +1 -1
  9. package/dist/build-strategy.d.ts +20 -0
  10. package/dist/build-strategy.d.ts.map +1 -1
  11. package/dist/build-strategy.js +33 -1
  12. package/dist/build-strategy.js.map +1 -1
  13. package/dist/build.d.ts +2 -1
  14. package/dist/build.d.ts.map +1 -1
  15. package/dist/build.js +19 -4
  16. package/dist/build.js.map +1 -1
  17. package/dist/bun-build.d.ts +1 -1
  18. package/dist/bun-build.d.ts.map +1 -1
  19. package/dist/bun-build.js +25 -9
  20. package/dist/bun-build.js.map +1 -1
  21. package/dist/config/frameworks.d.ts +4 -8
  22. package/dist/config/frameworks.d.ts.map +1 -1
  23. package/dist/config/frameworks.js +29 -5
  24. package/dist/config/frameworks.js.map +1 -1
  25. package/dist/config/normalize.d.ts +6 -0
  26. package/dist/config/normalize.d.ts.map +1 -1
  27. package/dist/config/normalize.js +53 -12
  28. package/dist/config/normalize.js.map +1 -1
  29. package/dist/config/types.d.ts +3 -1
  30. package/dist/config/types.d.ts.map +1 -1
  31. package/dist/config/types.js +2 -0
  32. package/dist/config/types.js.map +1 -1
  33. package/dist/configured-artifact.d.ts +20 -0
  34. package/dist/configured-artifact.d.ts.map +1 -0
  35. package/dist/configured-artifact.js +104 -0
  36. package/dist/configured-artifact.js.map +1 -0
  37. package/dist/custom-build.d.ts +20 -0
  38. package/dist/custom-build.d.ts.map +1 -0
  39. package/dist/custom-build.js +53 -0
  40. package/dist/custom-build.js.map +1 -0
  41. package/dist/index.d.ts +2 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +2 -0
  44. package/dist/index.js.map +1 -1
  45. package/dist/nestjs-build.d.ts +23 -0
  46. package/dist/nestjs-build.d.ts.map +1 -0
  47. package/dist/nestjs-build.js +316 -0
  48. package/dist/nestjs-build.js.map +1 -0
  49. package/dist/nextjs-build.d.ts +1 -1
  50. package/dist/nextjs-build.d.ts.map +1 -1
  51. package/dist/nextjs-build.js +25 -14
  52. package/dist/nextjs-build.js.map +1 -1
  53. package/dist/nuxt-build.d.ts +2 -0
  54. package/dist/nuxt-build.d.ts.map +1 -1
  55. package/dist/nuxt-build.js +31 -39
  56. package/dist/nuxt-build.js.map +1 -1
  57. package/dist/tanstack-start-build.d.ts +1 -1
  58. package/dist/tanstack-start-build.d.ts.map +1 -1
  59. package/dist/tanstack-start-build.js +26 -47
  60. package/dist/tanstack-start-build.js.map +1 -1
  61. package/package.json +2 -1
  62. package/src/astro-build.ts +39 -46
  63. package/src/build-settings.ts +34 -0
  64. package/src/build-strategy.ts +56 -1
  65. package/src/build.ts +19 -4
  66. package/src/bun-build.ts +39 -10
  67. package/src/config/frameworks.ts +31 -5
  68. package/src/config/normalize.ts +74 -13
  69. package/src/config/types.ts +4 -0
  70. package/src/configured-artifact.ts +169 -0
  71. package/src/custom-build.ts +73 -0
  72. package/src/index.ts +2 -0
  73. package/src/nestjs-build.ts +428 -0
  74. package/src/nextjs-build.ts +31 -14
  75. package/src/nuxt-build.ts +39 -46
  76. package/src/tanstack-start-build.ts +31 -53
@@ -1,13 +1,11 @@
1
- import { cp, mkdtemp, rm, stat } from "node:fs/promises";
2
- import os from "node:os";
3
- import path from "node:path";
4
-
5
- import { normalizeArtifactSymlinks } from "./artifact-postprocess.ts";
6
1
  import { type BuildSettings, resolveBuildSettings } from "./build-settings.ts";
7
2
  import type { BuildArtifact, BuildStrategy } from "./build-strategy.ts";
8
- import { hasPackageDependency } from "./build-strategy.ts";
9
- import { defaultHttpPortForBuildType } from "./config/frameworks.ts";
10
- import { type BuildCommandIo, runBuildCommand } from "./workspace.ts";
3
+ import {
4
+ hasPackageDependency,
5
+ runBuildSettingsCommand,
6
+ } from "./build-strategy.ts";
7
+ import { stageConfiguredArtifact } from "./configured-artifact.ts";
8
+ import type { BuildCommandIo } from "./workspace.ts";
11
9
 
12
10
  const TANSTACK_START_PACKAGES = [
13
11
  "@tanstack/react-start",
@@ -47,51 +45,31 @@ export class TanstackStartBuild implements BuildStrategy {
47
45
  buildType: "tanstack-start",
48
46
  signal,
49
47
  }));
50
- if (settings.buildCommand) {
51
- await runBuildCommand({
52
- appPath: this.#appPath,
53
- command: settings.buildCommand,
54
- failurePrefix: "TanStack Start",
55
- env: this.#io?.env,
56
- onOutput: this.#io?.onOutput,
57
- signal,
58
- });
59
- }
60
-
61
- const outputDir = path.join(this.#appPath, settings.outputDirectory);
62
- const entrypoint = "server/index.mjs";
63
- const entryStat = await stat(path.join(outputDir, entrypoint)).catch(
64
- () => null,
65
- );
66
- if (!entryStat?.isFile()) {
67
- throw new Error(
68
- `TanStack Start build did not produce a Nitro node server entrypoint at ${settings.outputDirectory}/${entrypoint}. ` +
69
- "Ensure your vite.config includes the tanstackStart() and nitro() plugins with the default node preset.",
70
- );
71
- }
72
-
73
- const outDir = await mkdtemp(path.join(os.tmpdir(), "compute-build-"));
74
- try {
75
- const artifactDir = path.join(outDir, "app");
76
- await cp(outputDir, artifactDir, {
77
- recursive: true,
78
- verbatimSymlinks: true,
79
- });
80
- // Materialize any symlinks into the app/workspace node_modules so the
81
- // artifact is self-contained once unpacked elsewhere.
82
- await normalizeArtifactSymlinks(artifactDir, this.#appPath, signal);
48
+ await runBuildSettingsCommand({
49
+ appPath: this.#appPath,
50
+ settings,
51
+ failurePrefix: "TanStack Start",
52
+ defaultCli: {
53
+ source: "TanStack Start default",
54
+ cliName: "vite",
55
+ args: ["build"],
56
+ missingMessage:
57
+ "Could not find the Vite CLI. Install it with `npm install vite` or ensure npx/bunx is available.",
58
+ },
59
+ io: this.#io,
60
+ signal,
61
+ });
83
62
 
84
- return {
85
- directory: artifactDir,
86
- entrypoint,
87
- defaultPortMapping: {
88
- http: defaultHttpPortForBuildType("tanstack-start"),
89
- },
90
- cleanup: () => rm(outDir, { recursive: true, force: true }),
91
- };
92
- } catch (error) {
93
- await rm(outDir, { recursive: true, force: true });
94
- throw error;
95
- }
63
+ return stageConfiguredArtifact({
64
+ appPath: this.#appPath,
65
+ outputDirectory: settings.outputDirectory,
66
+ entrypoint: settings.entrypoint ?? "server/index.mjs",
67
+ buildType: "tanstack-start",
68
+ label: "TanStack Start",
69
+ missingEntrypointMessage: settings.entrypoint
70
+ ? undefined
71
+ : `TanStack Start build did not produce a Nitro node server entrypoint at ${settings.outputDirectory}/server/index.mjs. Ensure your vite.config includes the tanstackStart() and nitro() plugins with the default node preset.`,
72
+ signal,
73
+ });
96
74
  }
97
75
  }