@prisma/compute-sdk 0.46.0 → 0.48.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 (67) hide show
  1. package/README.md +20 -18
  2. package/dist/errors.d.ts +2 -2
  3. package/dist/errors.d.ts.map +1 -1
  4. package/dist/errors.js +1 -1
  5. package/dist/errors.js.map +1 -1
  6. package/dist/service/build/build-service.d.ts +3 -3
  7. package/dist/service/build/build-service.d.ts.map +1 -1
  8. package/dist/service/build/build-service.js +21 -13
  9. package/dist/service/build/build-service.js.map +1 -1
  10. package/dist/service/build/output-directories.d.ts +20 -0
  11. package/dist/service/build/output-directories.d.ts.map +1 -0
  12. package/dist/service/build/{build-output.js → output-directories.js} +45 -9
  13. package/dist/service/build/output-directories.js.map +1 -0
  14. package/dist/service/index.d.ts +3 -3
  15. package/dist/service/index.d.ts.map +1 -1
  16. package/dist/service/index.js +3 -3
  17. package/dist/service/index.js.map +1 -1
  18. package/dist/service/launcher-contract/start-plan.d.ts +3 -3
  19. package/dist/service/launcher-contract/start-plan.d.ts.map +1 -1
  20. package/dist/service/launcher-contract/start-plan.js +3 -3
  21. package/dist/service/launcher-contract/start-plan.js.map +1 -1
  22. package/dist/service/output/exclude.d.ts +6 -0
  23. package/dist/service/output/exclude.d.ts.map +1 -0
  24. package/dist/service/{artifact → output}/exclude.js +2 -2
  25. package/dist/service/output/exclude.js.map +1 -0
  26. package/dist/service/output/launcher-file.d.ts +3 -0
  27. package/dist/service/output/launcher-file.d.ts.map +1 -0
  28. package/dist/service/{artifact → output}/launcher-file.js +1 -1
  29. package/dist/service/output/launcher-file.js.map +1 -0
  30. package/dist/service/{artifact/write-artifact.d.ts → output/write-build-output.d.ts} +6 -6
  31. package/dist/service/output/write-build-output.d.ts.map +1 -0
  32. package/dist/service/{artifact/write-artifact.js → output/write-build-output.js} +7 -7
  33. package/dist/service/output/write-build-output.js.map +1 -0
  34. package/dist/service/settings/index.d.ts +1 -1
  35. package/dist/service/settings/index.d.ts.map +1 -1
  36. package/dist/service/settings/resolve.d.ts +2 -2
  37. package/dist/service/settings/resolve.d.ts.map +1 -1
  38. package/dist/service/settings/resolve.js.map +1 -1
  39. package/dist/service/settings/start-order.d.ts +2 -2
  40. package/dist/service/settings/start-order.d.ts.map +1 -1
  41. package/dist/service/settings/types.d.ts +3 -3
  42. package/dist/service/settings/types.d.ts.map +1 -1
  43. package/package.json +1 -1
  44. package/src/errors.ts +2 -2
  45. package/src/service/build/build-service.ts +34 -19
  46. package/src/service/build/{build-output.ts → output-directories.ts} +65 -13
  47. package/src/service/index.ts +5 -5
  48. package/src/service/launcher/main.ts +2 -2
  49. package/src/service/launcher-contract/start-plan.ts +4 -4
  50. package/src/service/{artifact → output}/exclude.ts +2 -2
  51. package/src/service/{artifact → output}/launcher-file.ts +1 -1
  52. package/src/service/{artifact/write-artifact.ts → output/write-build-output.ts} +9 -9
  53. package/src/service/settings/index.ts +1 -1
  54. package/src/service/settings/resolve.ts +2 -2
  55. package/src/service/settings/start-order.ts +2 -2
  56. package/src/service/settings/types.ts +3 -3
  57. package/dist/service/artifact/exclude.d.ts +0 -6
  58. package/dist/service/artifact/exclude.d.ts.map +0 -1
  59. package/dist/service/artifact/exclude.js.map +0 -1
  60. package/dist/service/artifact/launcher-file.d.ts +0 -3
  61. package/dist/service/artifact/launcher-file.d.ts.map +0 -1
  62. package/dist/service/artifact/launcher-file.js.map +0 -1
  63. package/dist/service/artifact/write-artifact.d.ts.map +0 -1
  64. package/dist/service/artifact/write-artifact.js.map +0 -1
  65. package/dist/service/build/build-output.d.ts +0 -15
  66. package/dist/service/build/build-output.d.ts.map +0 -1
  67. package/dist/service/build/build-output.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-build-output.js","sourceRoot":"","sources":["../../../src/service/output/write-build-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,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AK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3D,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export type { PackageManager } from "../../package-manager.ts";
2
2
  export { isDevCommand } from "./dev-command.ts";
3
3
  export { resolveServiceBuildSettings, resolveStartAfterBuild, } from "./resolve.ts";
4
- export type { BuildOutput, ReadFile, Resolved, ServiceBuildSettings, ServiceConfig, Source, Start, } from "./types.ts";
4
+ export type { OutputDirectories, ReadFile, Resolved, ServiceBuildSettings, ServiceConfig, Source, Start, } from "./types.ts";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/settings/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,MAAM,EACN,KAAK,GACN,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/settings/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,MAAM,EACN,KAAK,GACN,MAAM,YAAY,CAAC"}
@@ -1,9 +1,9 @@
1
- import type { BuildOutput, ReadFile, Resolved, ServiceBuildSettings, ServiceConfig, Start } from "./types.ts";
1
+ import type { OutputDirectories, ReadFile, Resolved, ServiceBuildSettings, ServiceConfig, Start } from "./types.ts";
2
2
  /**
3
3
  * Resolves the Build settings that can be known before the build runs.
4
4
  * `start` is `"after build"` when only the build output can decide it.
5
5
  */
6
6
  export declare function resolveServiceBuildSettings(read: ReadFile, config?: ServiceConfig, signal?: AbortSignal): Promise<ServiceBuildSettings>;
7
7
  /** Decides the start from the build output and the source. Null means no rule matched. */
8
- export declare function resolveStartAfterBuild(read: ReadFile, output: BuildOutput, signal?: AbortSignal): Promise<Resolved<Start> | null>;
8
+ export declare function resolveStartAfterBuild(read: ReadFile, output: OutputDirectories, signal?: AbortSignal): Promise<Resolved<Start> | null>;
9
9
  //# sourceMappingURL=resolve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/service/settings/resolve.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,QAAQ,EACd,MAAM,GAAE,aAAkB,EAC1B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAoB/B;AAED,0FAA0F;AAC1F,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,WAAW,EACnB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAQjC"}
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/service/settings/resolve.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,QAAQ,EACd,MAA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EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,2BAA2B,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;KACnE,CAAC;AACJ,CAAC;AAED,0FAA0F;AAC1F,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAAc,EACd,MAAyB,EACzB,MAAoB;IAEpB,MAAM,EAAE,cAAc,EAAE,CAAC;IAEzB,OAAO,eAAe,CAAC;QACrB,IAAI;QACJ,MAAM;QACN,WAAW,EAAE,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW;KACvD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,2BAA2B,GAC/B,+CAA+C,CAAC;AAElD,4FAA4F;AAC5F,SAAS,YAAY,CACnB,OAA+B,EAC/B,cAA8B,EAC9B,MAAqB;IAErB,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjD,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,KAAK,EAAE,GAAG,cAAc,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;IACxE,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC1C,CAAC;AAED,0EAA0E;AAC1E,SAAS,WAAW,CAAC,MAAqB;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { PackageManager } from "../../package-manager.ts";
2
- import type { BuildOutput, PackageJson, ReadFile, Resolved, ServiceConfig, Start } from "./types.ts";
2
+ import type { OutputDirectories, PackageJson, ReadFile, Resolved, ServiceConfig, Start } from "./types.ts";
3
3
  /** What a rule may look at before the build runs. */
4
4
  interface ServiceBeforeBuild {
5
5
  config: ServiceConfig;
@@ -10,7 +10,7 @@ interface ServiceBeforeBuild {
10
10
  interface ServiceAfterBuild {
11
11
  read: ReadFile;
12
12
  packageJson: PackageJson;
13
- output: BuildOutput;
13
+ output: OutputDirectories;
14
14
  }
15
15
  /** The start, when a rule that needs no build output decides it, and the notes for the user. */
16
16
  export declare function startBeforeBuild(service: ServiceBeforeBuild): {
@@ -1 +1 @@
1
- {"version":3,"file":"start-order.d.ts","sourceRoot":"","sources":["../../../src/service/settings/start-order.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,aAAa,EAEb,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB,qDAAqD;AACrD,UAAU,kBAAkB;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,sDAAsD;AACtD,UAAU,iBAAiB;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,WAAW,CAAC;CACrB;AA6CD,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG;IAC7D,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC;IACvC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CASA;AAED,2FAA2F;AAC3F,wBAAsB,eAAe,CACnC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CASjC"}
1
+ {"version":3,"file":"start-order.d.ts","sourceRoot":"","sources":["../../../src/service/settings/start-order.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,aAAa,EAEb,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB,qDAAqD;AACrD,UAAU,kBAAkB;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,sDAAsD;AACtD,UAAU,iBAAiB;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AA6CD,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,GAAG;IAC7D,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC;IACvC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CASA;AAED,2FAA2F;AAC3F,wBAAsB,eAAe,CACnC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CASjC"}
@@ -45,10 +45,10 @@ export interface ServiceBuildSettings {
45
45
  notes: string[];
46
46
  }
47
47
  /** What the build step wrote, as far as the start order needs it. */
48
- export interface BuildOutput {
49
- /** Top-level folders the build created, such as `dist` or `.output`. */
48
+ export interface OutputDirectories {
49
+ /** Top-level folders the build created or wrote to, such as `dist` or `.output`. */
50
50
  newDirs: string[];
51
- /** Folders the build created that hold a self-contained `index.html`, shallowest first. */
51
+ /** Folders that hold a self-contained `index.html` the build wrote, shallowest first. */
52
52
  newStaticDirs: string[];
53
53
  }
54
54
  /** The fields of `package.json` that the Build rules read. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot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AAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/compute-sdk",
3
- "version": "0.46.0",
3
+ "version": "0.48.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",
package/src/errors.ts CHANGED
@@ -190,7 +190,7 @@ export type DeploymentOperationError =
190
190
  | TimeoutError
191
191
  | DeploymentFailedError;
192
192
 
193
- /** A build of one Service that produced no Artifact. `code` is stable across releases. */
193
+ /** A build of one Service that produced no build output. `code` is stable across releases. */
194
194
  export class ServiceBuildError extends TaggedError("ServiceBuildError")<{
195
195
  code: "install_failed" | "build_failed" | "no_start";
196
196
  /** For the user. */
@@ -198,5 +198,5 @@ export class ServiceBuildError extends TaggedError("ServiceBuildError")<{
198
198
  settings: ServiceBuildSettings;
199
199
  steps: BuildStep[];
200
200
  /** The end of the failed command's output, under a line that gives its exit code. */
201
- output?: string;
201
+ commandOutput?: string;
202
202
  }>() {}
@@ -1,26 +1,29 @@
1
- // Builds one Service folder into an Artifact. Runs on the Build runner: it needs a shell,
1
+ // Builds one Service folder and writes its build output. Runs on the Build runner: it needs a shell,
2
2
  // the repository's package manager, and the checkout. It never starts the Service.
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { Result } from "better-result";
6
6
  import { ServiceBuildError } from "../../errors.ts";
7
7
  import {
8
- type ServiceArtifact,
9
- writeArtifact,
10
- } from "../artifact/write-artifact.ts";
8
+ type BuildOutput,
9
+ writeBuildOutput,
10
+ } from "../output/write-build-output.ts";
11
11
  import {
12
12
  resolveServiceBuildSettings,
13
13
  resolveStartAfterBuild,
14
14
  } from "../settings/resolve.ts";
15
15
  import type {
16
- BuildOutput,
16
+ OutputDirectories,
17
17
  ReadFile,
18
18
  Resolved,
19
19
  ServiceBuildSettings,
20
20
  ServiceConfig,
21
21
  Start,
22
22
  } from "../settings/types.ts";
23
- import { buildOutputSince, snapshotFolders } from "./build-output.ts";
23
+ import {
24
+ outputDirectoriesSince,
25
+ snapshotFolders,
26
+ } from "./output-directories.ts";
24
27
  import {
25
28
  type BuildStep,
26
29
  runStep,
@@ -44,11 +47,11 @@ export interface BuiltService {
44
47
  settings: ServiceBuildSettings;
45
48
  start: Resolved<Start>;
46
49
  steps: BuildStep[];
47
- artifact: ServiceArtifact;
50
+ output: BuildOutput;
48
51
  }
49
52
 
50
53
  /** What makes a `ServiceBuildError`, beside the Build settings and the steps. */
51
- type Failure = Pick<ServiceBuildError, "code" | "message" | "output">;
54
+ type Failure = Pick<ServiceBuildError, "code" | "message" | "commandOutput">;
52
55
 
53
56
  /** The build failures have stable codes: the CLI, Console and the fix task key on them. */
54
57
  const STEP_FAILURES = {
@@ -63,7 +66,7 @@ const NO_START: Failure = {
63
66
  };
64
67
 
65
68
  /**
66
- * Runs the Service's install and build commands, decides how the Service starts, and writes the Artifact.
69
+ * Runs the Service's install and build commands, decides how the Service starts, and writes the build output.
67
70
  *
68
71
  * A failed install, a failed build and a missing start are expected outcomes:
69
72
  * they come back as a `ServiceBuildError`, not as a thrown error.
@@ -82,27 +85,35 @@ export async function buildService(
82
85
  const fail = (failure: Failure) =>
83
86
  Result.err(new ServiceBuildError({ ...failure, settings, steps }));
84
87
 
85
- const output = await installAndBuild(settings, options, steps);
86
- if (output.isErr()) {
87
- return fail(output.error);
88
+ const outputDirectories = await installAndBuild(settings, options, steps);
89
+ if (outputDirectories.isErr()) {
90
+ return fail(outputDirectories.error);
88
91
  }
89
92
 
90
93
  const start =
91
94
  settings.start === "after build"
92
- ? await resolveStartAfterBuild(read, output.value, options.signal)
95
+ ? await resolveStartAfterBuild(
96
+ read,
97
+ outputDirectories.value,
98
+ options.signal,
99
+ )
93
100
  : settings.start;
94
101
  if (start === null) {
95
102
  return fail(NO_START);
96
103
  }
97
104
 
98
105
  const port = settings.port?.value ?? null;
99
- const artifact = writeArtifact({ serviceDir: dir, start: start.value, port });
106
+ const output = writeBuildOutput({
107
+ serviceDir: dir,
108
+ start: start.value,
109
+ port,
110
+ });
100
111
 
101
112
  return Result.ok({
102
113
  settings: { ...settings, start },
103
114
  start,
104
115
  steps,
105
- artifact,
116
+ output,
106
117
  });
107
118
  }
108
119
 
@@ -111,7 +122,7 @@ async function installAndBuild(
111
122
  settings: ServiceBuildSettings,
112
123
  options: BuildServiceOptions,
113
124
  steps: BuildStep[],
114
- ): Promise<Result<BuildOutput, Failure>> {
125
+ ): Promise<Result<OutputDirectories, Failure>> {
115
126
  const { dir, env, signal } = options;
116
127
  const run: StepRun = { dir, steps, log: options.log ?? (() => {}), signal };
117
128
 
@@ -128,7 +139,7 @@ async function installAndBuild(
128
139
  return Result.err(stepFailed(build, built.output));
129
140
  }
130
141
 
131
- return Result.ok(buildOutputSince(dir, beforeBuild));
142
+ return Result.ok(outputDirectoriesSince(dir, beforeBuild));
132
143
  }
133
144
 
134
145
  /** The build runs in production mode. The caller's variables win over these. */
@@ -158,10 +169,14 @@ function installStep(
158
169
  };
159
170
  }
160
171
 
161
- function stepFailed(step: StepToRun, output: string): Failure {
172
+ function stepFailed(step: StepToRun, commandOutput: string): Failure {
162
173
  const { code, label } = STEP_FAILURES[step.name];
163
174
 
164
- return { code, message: `${label} failed: ${step.command}`, output };
175
+ return {
176
+ code,
177
+ message: `${label} failed: ${step.command}`,
178
+ commandOutput,
179
+ };
165
180
  }
166
181
 
167
182
  /** Reads the files of the Service folder for the Build rules. */
@@ -1,13 +1,15 @@
1
- // Finds what the build created by comparing the Service folder before and after the build.
1
+ // Finds what the build wrote by comparing the Service folder before and after the build.
2
2
  // The Build rules must not guess output folders by framework.
3
- import { existsSync, readdirSync, readFileSync } from "node:fs";
3
+ import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
4
4
  import { join } from "node:path";
5
- import type { BuildOutput } from "../settings/types.ts";
5
+ import type { OutputDirectories } from "../settings/types.ts";
6
6
 
7
- /** The folders of the Service folder at one moment. Taken before the build, it tells what the build created. */
7
+ /** The folders of the Service folder at one moment. Taken before the build, it tells what the build wrote. */
8
8
  export interface FolderSnapshot {
9
- topLevelDirs: Set<string>;
10
- staticDirs: Set<string>;
9
+ /** Each top-level folder, with the time of the newest change to a file in it. */
10
+ topLevelDirs: Map<string, number>;
11
+ /** Each folder that holds an `index.html`, with the time that file last changed. */
12
+ staticDirs: Map<string, number>;
11
13
  }
12
14
 
13
15
  /** Folders that never hold build output. */
@@ -25,22 +27,41 @@ const LOCAL_SCRIPT_OR_STYLE =
25
27
 
26
28
  export function snapshotFolders(serviceDir: string): FolderSnapshot {
27
29
  return {
28
- topLevelDirs: new Set(topLevelDirs(serviceDir)),
29
- staticDirs: new Set(dirsWithIndexHtml(serviceDir, STATIC_SITE_DEPTH)),
30
+ topLevelDirs: new Map(
31
+ topLevelDirs(serviceDir).map((dir) => [
32
+ dir,
33
+ newestFileChange(join(serviceDir, dir)),
34
+ ]),
35
+ ),
36
+ staticDirs: new Map(
37
+ dirsWithIndexHtml(serviceDir, STATIC_SITE_DEPTH).map((dir) => [
38
+ dir,
39
+ indexHtmlChange(serviceDir, dir),
40
+ ]),
41
+ ),
30
42
  };
31
43
  }
32
44
 
33
- /** What the build created: the folders that are in the Service folder now and were not in the snapshot. */
34
- export function buildOutputSince(
45
+ /**
46
+ * What the build wrote: the folders that were not in the snapshot, and the folders that the build wrote to again.
47
+ * The second kind is the output of an earlier build in the same folder. Without it a second build would find no output.
48
+ */
49
+ export function outputDirectoriesSince(
35
50
  serviceDir: string,
36
51
  before: FolderSnapshot,
37
- ): BuildOutput {
52
+ ): OutputDirectories {
38
53
  return {
39
54
  newDirs: topLevelDirs(serviceDir).filter(
40
- (dir) => !before.topLevelDirs.has(dir),
55
+ (dir) =>
56
+ newestFileChange(join(serviceDir, dir)) >
57
+ (before.topLevelDirs.get(dir) ?? Number.NEGATIVE_INFINITY),
41
58
  ),
42
59
  newStaticDirs: dirsWithIndexHtml(serviceDir, STATIC_SITE_DEPTH)
43
- .filter((dir) => !before.staticDirs.has(dir))
60
+ .filter(
61
+ (dir) =>
62
+ indexHtmlChange(serviceDir, dir) >
63
+ (before.staticDirs.get(dir) ?? Number.NEGATIVE_INFINITY),
64
+ )
44
65
  .filter((dir) => isSelfContained(join(serviceDir, dir)))
45
66
  .sort(shallowestFirst),
46
67
  };
@@ -59,6 +80,37 @@ export function isSelfContained(dir: string): boolean {
59
80
  return links.every((link) => existsSync(join(dir, link)));
60
81
  }
61
82
 
83
+ function indexHtmlChange(serviceDir: string, dir: string): number {
84
+ return changeTime(join(serviceDir, dir, "index.html"));
85
+ }
86
+
87
+ /**
88
+ * When the file was last written. A tool that restores a file from a cache can give it its old modification time,
89
+ * so the time the file system recorded the write counts too.
90
+ */
91
+ function changeTime(file: string): number {
92
+ const stats = statSync(file);
93
+
94
+ return Math.max(stats.mtimeMs, stats.ctimeMs);
95
+ }
96
+
97
+ /** The time of the newest change to a file in `dir`, at any depth. A folder with no file gives 0. */
98
+ function newestFileChange(dir: string): number {
99
+ let newest = 0;
100
+
101
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
102
+ const entryPath = join(dir, entry.name);
103
+
104
+ if (entry.isDirectory() && !SKIPPED_DIRS.has(entry.name)) {
105
+ newest = Math.max(newest, newestFileChange(entryPath));
106
+ } else if (entry.isFile()) {
107
+ newest = Math.max(newest, changeTime(entryPath));
108
+ }
109
+ }
110
+
111
+ return newest;
112
+ }
113
+
62
114
  function topLevelDirs(serviceDir: string): string[] {
63
115
  return readdirSync(serviceDir, { withFileTypes: true })
64
116
  .filter((entry) => entry.isDirectory() && !SKIPPED_DIRS.has(entry.name))
@@ -1,17 +1,17 @@
1
- // The public API of `@prisma/compute-sdk/service`: resolve the Build settings of one Service and build it into an Artifact.
2
- // Nothing here deploys the Artifact. The caller does that.
1
+ // The public API of `@prisma/compute-sdk/service`: resolve the Build settings of one Service, build it, and write its build output.
2
+ // Nothing here deploys the build output. The caller does that.
3
3
  export { ServiceBuildError } from "../errors.ts";
4
- export { excludedFromArtifact } from "./artifact/exclude.ts";
5
- export type { ServiceArtifact } from "./artifact/write-artifact.ts";
6
4
  export {
7
5
  type BuildServiceOptions,
8
6
  type BuiltService,
9
7
  buildService,
10
8
  } from "./build/build-service.ts";
11
9
  export type { BuildStep } from "./build/run-step.ts";
10
+ export { excludedFromBuildOutput } from "./output/exclude.ts";
11
+ export type { BuildOutput } from "./output/write-build-output.ts";
12
12
  export {
13
- type BuildOutput,
14
13
  isDevCommand,
14
+ type OutputDirectories,
15
15
  type PackageManager,
16
16
  type ReadFile,
17
17
  type Resolved,
@@ -1,4 +1,4 @@
1
- // The Launcher: the file Compute starts from an Artifact. It starts the Service.
1
+ // The Launcher: the file Compute starts from a build output. It starts the Service.
2
2
  // It exists because the Runtime has no /bin/sh and no /usr/bin/env, so `bun run start` cannot work there.
3
3
  import { readFileSync } from "node:fs";
4
4
  import { dirname, join, resolve } from "node:path";
@@ -33,7 +33,7 @@ if (shim === null) {
33
33
  * A stop signal goes on to the Service. In static mode it stops the server.
34
34
  */
35
35
  async function startService(): Promise<void> {
36
- // The Launcher is at .prisma/launcher.mjs in the Artifact, so the Service's folder is one level up.
36
+ // The Launcher is at .prisma/launcher.mjs in the build output, so the Service's folder is one level up.
37
37
  const serviceDir = resolve(dirname(launcherFile), "..");
38
38
  const plan = readStartPlan(serviceDir);
39
39
  const port = routedPort(plan);
@@ -1,11 +1,11 @@
1
1
  // The Start plan: what the Build runner tells the Launcher to do on the Runtime.
2
- // The build writes it into the Artifact beside the Launcher, and the Launcher reads it at every start.
2
+ // The build writes it into the build output beside the Launcher, and the Launcher reads it at every start.
3
3
  // Both files come from the same SDK version, so the format needs no version field.
4
4
 
5
- /** The Launcher, relative to the Artifact folder. Compute starts this file. */
5
+ /** The Launcher, relative to the build output folder. Compute starts this file. */
6
6
  export const LAUNCHER_FILE = ".prisma/launcher.mjs";
7
7
 
8
- /** The Start plan, relative to the Artifact folder. */
8
+ /** The Start plan, relative to the build output folder. */
9
9
  export const START_PLAN_FILE = ".prisma/plan.json";
10
10
 
11
11
  /** The port the Service gets as `PORT` when Compute sets none and the user stated none. */
@@ -14,5 +14,5 @@ export const DEFAULT_PORT = 8080;
14
14
  export type StartPlan =
15
15
  /** Run the Service's own start command. `port` is the port the user stated, or null. */
16
16
  | { kind: "command"; command: string; port: number | null }
17
- /** Serve a folder of static files. `dir` is relative to the Artifact folder. */
17
+ /** Serve a folder of static files. `dir` is relative to the build output folder. */
18
18
  | { kind: "static"; dir: string; port: number | null };
@@ -1,7 +1,7 @@
1
1
  /**
2
- * True for a file or folder that never goes into an Artifact, at any depth.
2
+ * True for a file or folder that never goes into a build output, at any depth.
3
3
  * A CI checkout keeps a token in `.git`, and dotenv files hold local secrets.
4
4
  */
5
- export function excludedFromArtifact(name: string): boolean {
5
+ export function excludedFromBuildOutput(name: string): boolean {
6
6
  return name === ".git" || name === ".env" || name.startsWith(".env.");
7
7
  }
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
4
4
  /** The one-file Launcher, relative to this folder. `src/` and `dist/` hold this folder at the same depth, so one path fits both. */
5
5
  const BUNDLED_LAUNCHER = "../../../dist/service/launcher.mjs";
6
6
 
7
- /** The path of the Launcher as one file, ready to copy into an Artifact. */
7
+ /** The path of the Launcher as one file, ready to copy into a build output. */
8
8
  export function launcherFile(): string {
9
9
  const file = fileURLToPath(new URL(BUNDLED_LAUNCHER, import.meta.url));
10
10
 
@@ -9,21 +9,21 @@ import type { Start } from "../settings/types.ts";
9
9
  import { launcherFile } from "./launcher-file.ts";
10
10
 
11
11
  /** What a build hands to the caller: a folder and the file Compute starts in it. */
12
- export interface ServiceArtifact {
13
- /** The folder to copy or upload, without what `excludedFromArtifact` names. */
12
+ export interface BuildOutput {
13
+ /** The folder to copy or upload, without what `excludedFromBuildOutput` names. */
14
14
  dir: string;
15
15
  /** The file Compute starts, relative to `dir`. */
16
16
  entrypoint: string;
17
17
  }
18
18
 
19
- /** Picks the Artifact folder, and writes the Launcher and the Start plan into it. */
20
- export function writeArtifact(options: {
19
+ /** Picks the build output folder, and writes the Launcher and the Start plan into it. */
20
+ export function writeBuildOutput(options: {
21
21
  serviceDir: string;
22
22
  start: Start;
23
23
  /** The port the user stated, or null. */
24
24
  port: number | null;
25
- }): ServiceArtifact {
26
- const dir = artifactDir(options.serviceDir, options.start);
25
+ }): BuildOutput {
26
+ const dir = outputDir(options.serviceDir, options.start);
27
27
 
28
28
  mkdirSync(join(dir, dirname(LAUNCHER_FILE)), { recursive: true });
29
29
  copyFileSync(launcherFile(), join(dir, LAUNCHER_FILE));
@@ -35,14 +35,14 @@ export function writeArtifact(options: {
35
35
  return { dir, entrypoint: LAUNCHER_FILE };
36
36
  }
37
37
 
38
- /** A static site needs no source and no `node_modules`, so its Artifact is the built folder alone. */
39
- function artifactDir(serviceDir: string, start: Start): string {
38
+ /** A static site needs no source and no `node_modules`, so its build output is the built folder alone. */
39
+ function outputDir(serviceDir: string, start: Start): string {
40
40
  return start.kind === "static" ? join(serviceDir, start.dir) : serviceDir;
41
41
  }
42
42
 
43
43
  function startPlan(start: Start, port: number | null): StartPlan {
44
44
  if (start.kind === "static") {
45
- // The Artifact of a static site is the site's own folder, so the plan serves the Artifact folder itself.
45
+ // The build output of a static site is the site's own folder, so the plan serves the build output folder itself.
46
46
  return { kind: "static", dir: ".", port };
47
47
  }
48
48
 
@@ -7,7 +7,7 @@ export {
7
7
  resolveStartAfterBuild,
8
8
  } from "./resolve.ts";
9
9
  export type {
10
- BuildOutput,
10
+ OutputDirectories,
11
11
  ReadFile,
12
12
  Resolved,
13
13
  ServiceBuildSettings,
@@ -5,7 +5,7 @@ import { pinnedNodeVersion } from "./node-version.ts";
5
5
  import { readPackageJson } from "./package-json.ts";
6
6
  import { startAfterBuild, startBeforeBuild } from "./start-order.ts";
7
7
  import type {
8
- BuildOutput,
8
+ OutputDirectories,
9
9
  ReadFile,
10
10
  Resolved,
11
11
  ServiceBuildSettings,
@@ -46,7 +46,7 @@ export async function resolveServiceBuildSettings(
46
46
  /** Decides the start from the build output and the source. Null means no rule matched. */
47
47
  export async function resolveStartAfterBuild(
48
48
  read: ReadFile,
49
- output: BuildOutput,
49
+ output: OutputDirectories,
50
50
  signal?: AbortSignal,
51
51
  ): Promise<Resolved<Start> | null> {
52
52
  signal?.throwIfAborted();
@@ -3,7 +3,7 @@
3
3
  import type { PackageManager } from "../../package-manager.ts";
4
4
  import { isDevCommand } from "./dev-command.ts";
5
5
  import type {
6
- BuildOutput,
6
+ OutputDirectories,
7
7
  PackageJson,
8
8
  ReadFile,
9
9
  Resolved,
@@ -23,7 +23,7 @@ interface ServiceBeforeBuild {
23
23
  interface ServiceAfterBuild {
24
24
  read: ReadFile;
25
25
  packageJson: PackageJson;
26
- output: BuildOutput;
26
+ output: OutputDirectories;
27
27
  }
28
28
 
29
29
  /** A rule returns the start it found, or null when it does not match. */
@@ -54,10 +54,10 @@ export interface ServiceBuildSettings {
54
54
  }
55
55
 
56
56
  /** What the build step wrote, as far as the start order needs it. */
57
- export interface BuildOutput {
58
- /** Top-level folders the build created, such as `dist` or `.output`. */
57
+ export interface OutputDirectories {
58
+ /** Top-level folders the build created or wrote to, such as `dist` or `.output`. */
59
59
  newDirs: string[];
60
- /** Folders the build created that hold a self-contained `index.html`, shallowest first. */
60
+ /** Folders that hold a self-contained `index.html` the build wrote, shallowest first. */
61
61
  newStaticDirs: string[];
62
62
  }
63
63
 
@@ -1,6 +0,0 @@
1
- /**
2
- * True for a file or folder that never goes into an Artifact, at any depth.
3
- * A CI checkout keeps a token in `.git`, and dotenv files hold local secrets.
4
- */
5
- export declare function excludedFromArtifact(name: string): boolean;
6
- //# sourceMappingURL=exclude.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exclude.d.ts","sourceRoot":"","sources":["../../../src/service/artifact/exclude.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"exclude.js","sourceRoot":"","sources":["../../../src/service/artifact/exclude.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACxE,CAAC"}
@@ -1,3 +0,0 @@
1
- /** The path of the Launcher as one file, ready to copy into an Artifact. */
2
- export declare function launcherFile(): string;
3
- //# sourceMappingURL=launcher-file.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"launcher-file.d.ts","sourceRoot":"","sources":["../../../src/service/artifact/launcher-file.ts"],"names":[],"mappings":"AAMA,4EAA4E;AAC5E,wBAAgB,YAAY,IAAI,MAAM,CAUrC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"launcher-file.js","sourceRoot":"","sources":["../../../src/service/artifact/launcher-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,oIAAoI;AACpI,MAAM,gBAAgB,GAAG,oCAAoC,CAAC;AAE9D,4EAA4E;AAC5E,MAAM,UAAU,YAAY;IAC1B,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEvE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,8BAA8B,IAAI,uFAAuF,CAC1H,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"write-artifact.d.ts","sourceRoot":"","sources":["../../../src/service/artifact/write-artifact.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAGlD,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,OAAO,EAAE;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,yCAAyC;IACzC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,GAAG,eAAe,CAWlB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"write-artifact.js","sourceRoot":"","sources":["../../../src/service/artifact/write-artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,aAAa,EACb,eAAe,GAEhB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUlD,qFAAqF;AACrF,MAAM,UAAU,aAAa,CAAC,OAK7B;IACC,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAE3D,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,YAAY,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC;IACvD,aAAa,CACX,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,EAC1B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CACvD,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AAC5C,CAAC;AAED,sGAAsG;AACtG,SAAS,WAAW,CAAC,UAAkB,EAAE,KAAY;IACnD,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;AAC5E,CAAC;AAED,SAAS,SAAS,CAAC,KAAY,EAAE,IAAmB;IAClD,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC5B,yGAAyG;QACzG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IAC5C,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3D,CAAC"}
@@ -1,15 +0,0 @@
1
- import type { BuildOutput } from "../settings/types.ts";
2
- /** The folders of the Service folder at one moment. Taken before the build, it tells what the build created. */
3
- export interface FolderSnapshot {
4
- topLevelDirs: Set<string>;
5
- staticDirs: Set<string>;
6
- }
7
- export declare function snapshotFolders(serviceDir: string): FolderSnapshot;
8
- /** What the build created: the folders that are in the Service folder now and were not in the snapshot. */
9
- export declare function buildOutputSince(serviceDir: string, before: FolderSnapshot): BuildOutput;
10
- /**
11
- * True when the site in `dir` holds the first scripts and styles its `index.html` links to.
12
- * A page copied out of a server build does not, and cannot be served alone.
13
- */
14
- export declare function isSelfContained(dir: string): boolean;
15
- //# sourceMappingURL=build-output.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-output.d.ts","sourceRoot":"","sources":["../../../src/service/build/build-output.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,gHAAgH;AAChH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACzB;AAeD,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAKlE;AAED,2GAA2G;AAC3G,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,GACrB,WAAW,CAUb;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAOpD"}