@geekmidas/cli 10.0.0-alpha.140 → 10.0.0-alpha.141

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 (121) hide show
  1. package/dist/{GoDaddyProvider-BgY6mqoH.mjs → GoDaddyProvider-DxFAueU4.mjs} +2 -2
  2. package/dist/{GoDaddyProvider-BgY6mqoH.mjs.map → GoDaddyProvider-DxFAueU4.mjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-C-rs22Zv.cjs → GoDaddyProvider-hAc0q5s-.cjs} +2 -2
  4. package/dist/{GoDaddyProvider-C-rs22Zv.cjs.map → GoDaddyProvider-hAc0q5s-.cjs.map} +1 -1
  5. package/dist/{LegacyStateStore-Dx65SWE9.mjs → LegacyStateStore-BPY8Acgs.mjs} +3 -3
  6. package/dist/{LegacyStateStore-Dx65SWE9.mjs.map → LegacyStateStore-BPY8Acgs.mjs.map} +1 -1
  7. package/dist/{LegacyStateStore-6xskEtld.cjs → LegacyStateStore-BqSVgWi1.cjs} +3 -3
  8. package/dist/{LegacyStateStore-6xskEtld.cjs.map → LegacyStateStore-BqSVgWi1.cjs.map} +1 -1
  9. package/dist/{LocalStateStore-Dto39TCx.mjs → LocalStateStore-5pVR26KA.mjs} +2 -2
  10. package/dist/{LocalStateStore-Dto39TCx.mjs.map → LocalStateStore-5pVR26KA.mjs.map} +1 -1
  11. package/dist/{LocalStateStore-DFtTtHty.cjs → LocalStateStore-Df4RyGi2.cjs} +2 -2
  12. package/dist/{LocalStateStore-DFtTtHty.cjs.map → LocalStateStore-Df4RyGi2.cjs.map} +1 -1
  13. package/dist/{S3StateStore-C01zMOYm.mjs → S3StateStore-Do1DwEMX.mjs} +2 -2
  14. package/dist/{S3StateStore-C01zMOYm.mjs.map → S3StateStore-Do1DwEMX.mjs.map} +1 -1
  15. package/dist/{S3StateStore-B-9ea-sX.cjs → S3StateStore-uykstvZI.cjs} +2 -2
  16. package/dist/{S3StateStore-B-9ea-sX.cjs.map → S3StateStore-uykstvZI.cjs.map} +1 -1
  17. package/dist/{SSMStateStore-CKArcPUh.cjs → SSMStateStore-DQXFWqkE.cjs} +2 -2
  18. package/dist/{SSMStateStore-CKArcPUh.cjs.map → SSMStateStore-DQXFWqkE.cjs.map} +1 -1
  19. package/dist/{SSMStateStore-k-4XM7mb.mjs → SSMStateStore-xQ-Ce91W.mjs} +2 -2
  20. package/dist/{SSMStateStore-k-4XM7mb.mjs.map → SSMStateStore-xQ-Ce91W.mjs.map} +1 -1
  21. package/dist/{add-CiIrpOb9.mjs → add-DLkN488n.mjs} +3 -3
  22. package/dist/{add-CiIrpOb9.mjs.map → add-DLkN488n.mjs.map} +1 -1
  23. package/dist/{add-BgzsYxUq.cjs → add-Y_nPkjIf.cjs} +3 -3
  24. package/dist/{add-BgzsYxUq.cjs.map → add-Y_nPkjIf.cjs.map} +1 -1
  25. package/dist/{bundler-DKxuDoVL.cjs → bundler-COOvv27I.cjs} +33 -9
  26. package/dist/bundler-COOvv27I.cjs.map +1 -0
  27. package/dist/{bundler-C4uMSy8e.mjs → bundler-DFyrGST-.mjs} +34 -10
  28. package/dist/bundler-DFyrGST-.mjs.map +1 -0
  29. package/dist/{cli-na0npMhC.cjs → cli-DKsV-Myw.cjs} +2 -2
  30. package/dist/{cli-na0npMhC.cjs.map → cli-DKsV-Myw.cjs.map} +1 -1
  31. package/dist/{cli-Bm2is6R_.mjs → cli-iAX4BQ3t.mjs} +2 -2
  32. package/dist/{cli-Bm2is6R_.mjs.map → cli-iAX4BQ3t.mjs.map} +1 -1
  33. package/dist/{compose-D8U9ygdm.cjs → compose-CGXx22Wy.cjs} +3 -5
  34. package/dist/compose-CGXx22Wy.cjs.map +1 -0
  35. package/dist/{compose-CVatM7Cl.mjs → compose-ofZIpp2q.mjs} +3 -5
  36. package/dist/compose-ofZIpp2q.mjs.map +1 -0
  37. package/dist/deploy/public.cjs +6 -6
  38. package/dist/deploy/public.d.cts.map +1 -1
  39. package/dist/deploy/public.d.mts.map +1 -1
  40. package/dist/deploy/public.mjs +6 -6
  41. package/dist/{deploy-DrQB7ytj.cjs → deploy-BibGpDAz.cjs} +5 -5
  42. package/dist/{deploy-DrQB7ytj.cjs.map → deploy-BibGpDAz.cjs.map} +1 -1
  43. package/dist/{deploy-CDcO08Xz.mjs → deploy-C4QQkHK7.mjs} +5 -5
  44. package/dist/{deploy-CDcO08Xz.mjs.map → deploy-C4QQkHK7.mjs.map} +1 -1
  45. package/dist/{dokploy-BKjPDvSN.cjs → dokploy-B_VX3nLM.cjs} +2 -2
  46. package/dist/{dokploy-BKjPDvSN.cjs.map → dokploy-B_VX3nLM.cjs.map} +1 -1
  47. package/dist/{dokploy-k4_ZN8zN.mjs → dokploy-pSrsileA.mjs} +2 -2
  48. package/dist/{dokploy-k4_ZN8zN.mjs.map → dokploy-pSrsileA.mjs.map} +1 -1
  49. package/dist/{eas-B1wBvwPH.mjs → eas-Bou-_M76.mjs} +2 -2
  50. package/dist/{eas-B1wBvwPH.mjs.map → eas-Bou-_M76.mjs.map} +1 -1
  51. package/dist/{eas-Bg4dI6n2.cjs → eas-cSSc8Lex.cjs} +2 -2
  52. package/dist/{eas-Bg4dI6n2.cjs.map → eas-cSSc8Lex.cjs.map} +1 -1
  53. package/dist/{encryption-Bve0PVOo.mjs → encryption-Bps9As2D.mjs} +2 -2
  54. package/dist/{encryption-Bve0PVOo.mjs.map → encryption-Bps9As2D.mjs.map} +1 -1
  55. package/dist/{encryption-DL_y8t6V.cjs → encryption-CElaAwJs.cjs} +2 -2
  56. package/dist/{encryption-DL_y8t6V.cjs.map → encryption-CElaAwJs.cjs.map} +1 -1
  57. package/dist/{engine-HMLf20iZ.mjs → engine-CXE4UOHj.mjs} +3 -3
  58. package/dist/{engine-HMLf20iZ.mjs.map → engine-CXE4UOHj.mjs.map} +1 -1
  59. package/dist/{engine-BhR5lt_V.cjs → engine-CiG7Wfyc.cjs} +3 -3
  60. package/dist/{engine-BhR5lt_V.cjs.map → engine-CiG7Wfyc.cjs.map} +1 -1
  61. package/dist/{github-B2hJVl-n.cjs → github-BzppIvpw.cjs} +4 -4
  62. package/dist/{github-B2hJVl-n.cjs.map → github-BzppIvpw.cjs.map} +1 -1
  63. package/dist/{github-DKn9ACi2.mjs → github-CvFJlFWA.mjs} +4 -4
  64. package/dist/{github-DKn9ACi2.mjs.map → github-CvFJlFWA.mjs.map} +1 -1
  65. package/dist/{googlePlay-DtuN0-7D.cjs → googlePlay-BJnMCWoa.cjs} +3 -3
  66. package/dist/{googlePlay-DtuN0-7D.cjs.map → googlePlay-BJnMCWoa.cjs.map} +1 -1
  67. package/dist/{googlePlay-CWq7ND_X.mjs → googlePlay-RSe9wOfZ.mjs} +3 -3
  68. package/dist/{googlePlay-CWq7ND_X.mjs.map → googlePlay-RSe9wOfZ.mjs.map} +1 -1
  69. package/dist/index.cjs +52 -52
  70. package/dist/index.cjs.map +1 -1
  71. package/dist/index.mjs +52 -52
  72. package/dist/index.mjs.map +1 -1
  73. package/dist/{migrate-W0ruUNb9.mjs → migrate-B0nQra2W.mjs} +2 -2
  74. package/dist/{migrate-W0ruUNb9.mjs.map → migrate-B0nQra2W.mjs.map} +1 -1
  75. package/dist/{migrate-BLVZqHtN.cjs → migrate-BCBs0BMn.cjs} +2 -2
  76. package/dist/{migrate-BLVZqHtN.cjs.map → migrate-BCBs0BMn.cjs.map} +1 -1
  77. package/dist/{migrate-DCvD4RJW.mjs → migrate-BPCJBL7_.mjs} +2 -2
  78. package/dist/{migrate-DCvD4RJW.mjs.map → migrate-BPCJBL7_.mjs.map} +1 -1
  79. package/dist/{migrate-iUui7B4q.cjs → migrate-Dmh5Dbcr.cjs} +2 -2
  80. package/dist/{migrate-iUui7B4q.cjs.map → migrate-Dmh5Dbcr.cjs.map} +1 -1
  81. package/dist/{publish-CqvDA5ry.cjs → publish-DKy3hn8a.cjs} +2 -2
  82. package/dist/{publish-CqvDA5ry.cjs.map → publish-DKy3hn8a.cjs.map} +1 -1
  83. package/dist/{publish-CxIBBD3b.mjs → publish-cthyGGQt.mjs} +2 -2
  84. package/dist/{publish-CxIBBD3b.mjs.map → publish-cthyGGQt.mjs.map} +1 -1
  85. package/dist/{resolve-BEVVvi13.cjs → resolve-AYtMIgoq.cjs} +3 -3
  86. package/dist/{resolve-BEVVvi13.cjs.map → resolve-AYtMIgoq.cjs.map} +1 -1
  87. package/dist/{resolve-CMC0MI0Z.mjs → resolve-BaRqJlqV.mjs} +3 -3
  88. package/dist/{resolve-CMC0MI0Z.mjs.map → resolve-BaRqJlqV.mjs.map} +1 -1
  89. package/dist/{rollback-e0zGkaBx.cjs → rollback-CQ184yFu.cjs} +4 -4
  90. package/dist/{rollback-e0zGkaBx.cjs.map → rollback-CQ184yFu.cjs.map} +1 -1
  91. package/dist/{rollback-CZiQkukY.mjs → rollback-DqV6t9oo.mjs} +4 -4
  92. package/dist/{rollback-CZiQkukY.mjs.map → rollback-DqV6t9oo.mjs.map} +1 -1
  93. package/dist/{seeds-BR_7hJTw.cjs → seeds-DndMeyzm.cjs} +189 -61
  94. package/dist/seeds-DndMeyzm.cjs.map +1 -0
  95. package/dist/{seeds-nCxxlP5h.mjs → seeds-o6x6BTRo.mjs} +173 -57
  96. package/dist/seeds-o6x6BTRo.mjs.map +1 -0
  97. package/dist/{serverSetup-C3Tt9X1R.mjs → serverSetup-AfG0-at8.mjs} +5 -5
  98. package/dist/{serverSetup-C3Tt9X1R.mjs.map → serverSetup-AfG0-at8.mjs.map} +1 -1
  99. package/dist/{serverSetup-D2Xzsp2t.cjs → serverSetup-Dnw9Kdel.cjs} +5 -5
  100. package/dist/{serverSetup-D2Xzsp2t.cjs.map → serverSetup-Dnw9Kdel.cjs.map} +1 -1
  101. package/dist/{sniffer-eEF_fIId.mjs → sniffer-BHhJ8DiC.mjs} +6 -6
  102. package/dist/{sniffer-eEF_fIId.mjs.map → sniffer-BHhJ8DiC.mjs.map} +1 -1
  103. package/dist/{sniffer-BWgXPFAt.cjs → sniffer-taO-AXSk.cjs} +6 -6
  104. package/dist/{sniffer-BWgXPFAt.cjs.map → sniffer-taO-AXSk.cjs.map} +1 -1
  105. package/dist/{snsSubscriptions-Y9declDd.cjs → snsSubscriptions-CC-WM1zC.cjs} +2 -2
  106. package/dist/{snsSubscriptions-Y9declDd.cjs.map → snsSubscriptions-CC-WM1zC.cjs.map} +1 -1
  107. package/dist/{snsSubscriptions-BSoqUgsq.mjs → snsSubscriptions-D_IBKhni.mjs} +2 -2
  108. package/dist/{snsSubscriptions-BSoqUgsq.mjs.map → snsSubscriptions-D_IBKhni.mjs.map} +1 -1
  109. package/dist/{stage-BEcxppsu.cjs → stage-CTibxcpA.cjs} +4 -4
  110. package/dist/{stage-BEcxppsu.cjs.map → stage-CTibxcpA.cjs.map} +1 -1
  111. package/dist/{stage-DhcbcAar.mjs → stage-dd9dtLfh.mjs} +4 -4
  112. package/dist/{stage-DhcbcAar.mjs.map → stage-dd9dtLfh.mjs.map} +1 -1
  113. package/dist/target/public.cjs +1 -1
  114. package/dist/target/public.mjs +1 -1
  115. package/package.json +15 -15
  116. package/dist/bundler-C4uMSy8e.mjs.map +0 -1
  117. package/dist/bundler-DKxuDoVL.cjs.map +0 -1
  118. package/dist/compose-CVatM7Cl.mjs.map +0 -1
  119. package/dist/compose-D8U9ygdm.cjs.map +0 -1
  120. package/dist/seeds-BR_7hJTw.cjs.map +0 -1
  121. package/dist/seeds-nCxxlP5h.mjs.map +0 -1
@@ -9,9 +9,9 @@ import { n as deployIdentity } from "./identity-CBXr4wNi.mjs";
9
9
  import { a as startTelemetryCode, n as runtimeFor, s as writeTelemetryModule, u as telemetryArgs } from "./EndpointGenerator-BMRL04ic.mjs";
10
10
  import { _ as workerEdges, d as ConstructGenerator, f as output, i as discover, m as eventsEdgeBucket } from "./discover-B2m8ytyq.mjs";
11
11
  import { ConfigNotFound, NotInAnApp, loadWorkspaceAppInfo, loadWorkspaceConfig } from "./config.mjs";
12
- import { c as runtimeOf } from "./resolve-CMC0MI0Z.mjs";
12
+ import { c as runtimeOf } from "./resolve-BaRqJlqV.mjs";
13
13
  import { basename, dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
14
- import { constants, existsSync, readFileSync } from "node:fs";
14
+ import { constants, existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
15
15
  import { appendFile, chmod, copyFile, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
16
16
  import { homedir, hostname, networkInterfaces, userInfo } from "node:os";
17
17
  import { execFile, spawn } from "node:child_process";
@@ -3207,6 +3207,156 @@ function publicBuildValues(site, manifest, resolve, secrets) {
3207
3207
  return args;
3208
3208
  }
3209
3209
  //#endregion
3210
+ //#region src/build/native.ts
3211
+ /**
3212
+ * The file beside a bundle naming the packages it left out, each at the
3213
+ * version the build resolved: a `package.json` an image installs, for its own
3214
+ * platform, next to the bundle. `server.mjs` → `server.externals.json`.
3215
+ */
3216
+ function externalsManifestName(outfile) {
3217
+ return `${outfile.replace(/\.mjs$/, "")}.externals.json`;
3218
+ }
3219
+ /**
3220
+ * Asked to leave a package out of the bundle, and nothing the app depends on
3221
+ * provides it: there is no version to install in the image.
3222
+ */
3223
+ var ExternalNotInstalled = class extends Error {
3224
+ packageName;
3225
+ root;
3226
+ constructor(packageName, root) {
3227
+ super(`'${packageName}' is left out of the bundle, to be installed beside it, but it is not installed for the app at ${root}: add it to the app's dependencies.`);
3228
+ this.packageName = packageName;
3229
+ this.root = root;
3230
+ this.name = "ExternalNotInstalled";
3231
+ }
3232
+ };
3233
+ /** Packages whose job is loading a compiled addon. */
3234
+ const NATIVE_LOADERS = /* @__PURE__ */ new Set([
3235
+ "bindings",
3236
+ "node-gyp-build",
3237
+ "node-gyp-build-optional-packages",
3238
+ "node-pre-gyp",
3239
+ "@mapbox/node-pre-gyp",
3240
+ "prebuild-install",
3241
+ "@neon-rs/load"
3242
+ ]);
3243
+ /** A per-platform binary package: `@node-rs/argon2-linux-x64-gnu`, `@img/sharp-darwin-arm64`. */
3244
+ const PLATFORM_PACKAGE = /(?:^|[-/])(?:linux|darwin|win32|freebsd|android)-(?:x64|arm64|arm|ia32)\b/;
3245
+ function readPackage(dir) {
3246
+ try {
3247
+ return JSON.parse(readFileSync(join(dir, "package.json"), "utf-8"));
3248
+ } catch {
3249
+ return;
3250
+ }
3251
+ }
3252
+ /**
3253
+ * Where `name` resolves from `from`, the way Node finds it: the nearest
3254
+ * `node_modules/<name>` walking up. Followed through symlinks, so a pnpm
3255
+ * store package resolves its own dependencies beside it.
3256
+ */
3257
+ function locate(name, from) {
3258
+ let dir = from;
3259
+ for (;;) {
3260
+ const candidate = join(dir, "node_modules", name);
3261
+ if (existsSync(join(candidate, "package.json"))) return realpathSync(candidate);
3262
+ const parent = dirname(dir);
3263
+ if (parent === dir) return void 0;
3264
+ dir = parent;
3265
+ }
3266
+ }
3267
+ /**
3268
+ * Whether a package carries compiled code: a `binding.gyp` or prebuilt
3269
+ * binaries of its own, a loader for them, or a binary package per platform.
3270
+ * Such a package cannot be inlined into a bundle — it loads a `.node` file
3271
+ * from beside its own source, for the platform it was installed on.
3272
+ */
3273
+ function isNativePackage(dir, pkg) {
3274
+ if (pkg.gypfile || pkg.binary || pkg.napi) return true;
3275
+ if (Object.keys({
3276
+ ...pkg.dependencies,
3277
+ ...pkg.optionalDependencies
3278
+ }).some((dep) => NATIVE_LOADERS.has(dep))) return true;
3279
+ if (Object.keys(pkg.optionalDependencies ?? {}).some((dep) => PLATFORM_PACKAGE.test(dep))) return true;
3280
+ if (existsSync(join(dir, "binding.gyp"))) return true;
3281
+ if (existsSync(join(dir, "prebuilds"))) return true;
3282
+ try {
3283
+ return readdirSync(dir).some((file) => file.endsWith(".node"));
3284
+ } catch {
3285
+ return false;
3286
+ }
3287
+ }
3288
+ /**
3289
+ * The packages with native code an app's bundle would otherwise inline, each
3290
+ * at the version installed for it.
3291
+ *
3292
+ * Walks what the app depends on at runtime — `dependencies`, never
3293
+ * `devDependencies` — through workspace packages and installed ones alike,
3294
+ * since anything reached is bundled. A native package is where the walk
3295
+ * stops: installing it brings what it depends on.
3296
+ */
3297
+ function nativeDependencies(root) {
3298
+ const found = {};
3299
+ const seen = /* @__PURE__ */ new Set();
3300
+ const queue = [realpathSync(root)];
3301
+ while (queue.length > 0) {
3302
+ const dir = queue.shift();
3303
+ if (seen.has(dir)) continue;
3304
+ seen.add(dir);
3305
+ const pkg = readPackage(dir);
3306
+ if (!pkg) continue;
3307
+ const isRoot = seen.size === 1;
3308
+ const installed = dir.split(sep).includes("node_modules");
3309
+ if (!isRoot && installed && isNativePackage(dir, pkg)) {
3310
+ if ((!pkg.os || pkg.os.includes("linux") || pkg.os.every((os) => os.startsWith("!")) && !pkg.os.includes("!linux")) && pkg.name && pkg.version && !(pkg.name in found)) found[pkg.name] = pkg.version;
3311
+ continue;
3312
+ }
3313
+ for (const dep of Object.keys({
3314
+ ...pkg.dependencies,
3315
+ ...pkg.optionalDependencies
3316
+ })) {
3317
+ const location = locate(dep, dir);
3318
+ if (location && !seen.has(location)) queue.push(location);
3319
+ }
3320
+ }
3321
+ return Object.fromEntries(Object.entries(found).sort(([a], [b]) => a.localeCompare(b)));
3322
+ }
3323
+ /**
3324
+ * What a bundle leaves out, with the version of each to install: the native
3325
+ * packages found under `root`, and any it was asked to leave out besides,
3326
+ * at the version installed for the app.
3327
+ */
3328
+ function bundleExternals(root, declared) {
3329
+ const externals = nativeDependencies(root);
3330
+ for (const name of declared) {
3331
+ if (name in externals) continue;
3332
+ const location = locate(name, root);
3333
+ const version = location ? readPackage(location)?.version : void 0;
3334
+ if (!version) throw new ExternalNotInstalled(name, root);
3335
+ externals[name] = version;
3336
+ }
3337
+ return Object.fromEntries(Object.entries(externals).sort(([a], [b]) => a.localeCompare(b)));
3338
+ }
3339
+ /** The package a bare specifier names: `argon2/lib` → `argon2`, `@a/b/c` → `@a/b`. */
3340
+ function packageOf(specifier) {
3341
+ const parts = specifier.split("/");
3342
+ return specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
3343
+ }
3344
+ /**
3345
+ * The packages a bundle imports at runtime rather than inlining, read from
3346
+ * esbuild's metafile. Nothing when there is no metafile.
3347
+ */
3348
+ function importedPackages(metafile) {
3349
+ let meta;
3350
+ try {
3351
+ meta = JSON.parse(readFileSync(metafile, "utf-8"));
3352
+ } catch {
3353
+ return /* @__PURE__ */ new Set();
3354
+ }
3355
+ const imported = /* @__PURE__ */ new Set();
3356
+ for (const output of Object.values(meta.outputs ?? {})) for (const { path, external } of output.imports ?? []) if (external && !path.startsWith(".") && !path.startsWith("node:")) imported.add(packageOf(path));
3357
+ return imported;
3358
+ }
3359
+ //#endregion
3210
3360
  //#region src/exec/imageBuild.ts
3211
3361
  /**
3212
3362
  * Set by a site's Dockerfile in its builder stage: this process is building
@@ -3629,53 +3779,25 @@ RUN --mount=type=secret,id=gkm_credentials,required=false \\
3629
3779
  rm -f ${appDir}/.gkm/credentials.enc ${appDir}/.gkm/credentials.iv`;
3630
3780
  }
3631
3781
  /**
3632
- * The externals a backend's bundle leaves out (esbuild `--external`), each
3633
- * installed for Linux at the version the builder resolved, so the runner has
3634
- * exactly those beside `server.mjs`. Nothing when there are none: the runner
3635
- * is the one file.
3782
+ * The packages a bundle left out — its native ones, which load a binary built
3783
+ * for the platform they were installed on — installed for Linux beside it.
3784
+ * `gkm build` records them, at the versions it resolved, in a `package.json`
3785
+ * beside the bundle (`externalsManifestName`), so the image installs exactly
3786
+ * what the build left out: nothing, for most apps.
3636
3787
  */
3637
- function externalsStages(options, appDir) {
3638
- const external = options.external ?? [];
3639
- if (external.length === 0) return {
3640
- stage: "",
3641
- copy: ""
3642
- };
3788
+ function externalsStages(appDir, bundle) {
3643
3789
  return {
3644
3790
  stage: `
3645
- # Stage 4: The packages the bundle leaves external, installed for Linux at the
3646
- # versions the build resolved — and nothing else.
3647
- FROM builder AS externals-manifest
3648
- WORKDIR ${appDir}
3649
- RUN node <<'EOF'
3650
- const { existsSync, readFileSync, writeFileSync } = require('node:fs');
3651
- const { dirname, join } = require('node:path');
3652
- const names = ${JSON.stringify(external)};
3653
- const dependencies = {};
3654
- for (const name of names) {
3655
- let dir = process.cwd();
3656
- for (;;) {
3657
- const manifest = join(dir, 'node_modules', name, 'package.json');
3658
- if (existsSync(manifest)) {
3659
- dependencies[name] = JSON.parse(readFileSync(manifest, 'utf-8')).version;
3660
- break;
3661
- }
3662
- if (dirname(dir) === dir) {
3663
- console.error(name + ' is external to the bundle, and is not installed: add it to the app\\'s dependencies.');
3664
- process.exit(1);
3665
- }
3666
- dir = dirname(dir);
3667
- }
3668
- }
3669
- writeFileSync('/tmp/externals.json', JSON.stringify({ private: true, dependencies }));
3670
- EOF
3671
-
3791
+ # The packages the bundle leaves out, installed for Linux at the versions the
3792
+ # build resolved — and nothing else.
3672
3793
  FROM \${NODE_IMAGE} AS externals
3673
3794
  WORKDIR /externals
3674
- COPY --from=externals-manifest /tmp/externals.json ./package.json
3795
+ COPY --from=builder ${appDir}/.gkm/server/dist/${externalsManifestName(bundle)} ./package.json
3675
3796
  RUN --mount=type=cache,id=npm,target=/root/.npm \\
3676
- npm install --omit=dev --no-package-lock --no-audit --no-fund
3797
+ npm install --omit=dev --no-package-lock --no-audit --no-fund && \\
3798
+ mkdir -p node_modules
3677
3799
  `,
3678
- copy: "\nCOPY --from=externals --chown=hono:nodejs /externals/node_modules ./node_modules"
3800
+ copy: `\nCOPY --from=externals --chown=hono:nodejs /externals/node_modules ./node_modules`
3679
3801
  };
3680
3802
  }
3681
3803
  /**
@@ -3821,7 +3943,8 @@ CMD ["node", "${appPath}/server.js"]
3821
3943
  /**
3822
3944
  * Generate a Dockerfile for a gkm backend: pruned, installed, and bundled by
3823
3945
  * `gkm build --provider server --production` inside the image. The runner is
3824
- * `server.mjs` alone — plus any package the bundle leaves external.
3946
+ * `server.mjs` — plus the packages the bundle leaves out, which is none
3947
+ * unless it uses one with native code.
3825
3948
  * @internal Exported for testing
3826
3949
  */
3827
3950
  function generateBackendDockerfile(options) {
@@ -3855,7 +3978,8 @@ function generateWorkerDockerfile(options) {
3855
3978
  /**
3856
3979
  * A file server's processor unit: its host app's build, and the unit's bundle
3857
3980
  * as the runner. Its native packages — `sharp` — are installed for the image's
3858
- * platform beside the bundle, at the versions the build resolved.
3981
+ * platform beside the bundle, at the versions the build resolved, as for
3982
+ * every bundle.
3859
3983
  */
3860
3984
  function generateProcessorDockerfile(options) {
3861
3985
  return gkmBundleDockerfile(options, {
@@ -3868,7 +3992,7 @@ function generateProcessorDockerfile(options) {
3868
3992
  function gkmBundleDockerfile(options, runner) {
3869
3993
  const { port, healthCheckPath = "/health" } = options;
3870
3994
  const { app } = layout(options);
3871
- const externals = externalsStages(options, app);
3995
+ const externals = externalsStages(app, runner.bundle);
3872
3996
  return `# syntax=docker/dockerfile:1
3873
3997
  # ${runner.title}: a turbo-pruned slice, bundled by gkm build in the image
3874
3998
 
@@ -8258,8 +8382,7 @@ async function workspaceDockerCommand(workspace, manifest, imageNames = {}, back
8258
8382
  logger$1.log(`\n 📄 Generating Dockerfile for ${unit.name} (processors of ${unit.id}, built from ${unit.app})`);
8259
8383
  const dockerfile = processorDockerfile(unit, workspace.apps[unit.app], {
8260
8384
  layout,
8261
- workspaceRoot: workspace.root,
8262
- native: processorNative(manifest, unit.id)
8385
+ workspaceRoot: workspace.root
8263
8386
  });
8264
8387
  const path = workerDockerfileOf(unit.name);
8265
8388
  const dockerfilePath = join(workspace.root, path);
@@ -8332,12 +8455,6 @@ function workerDockerfile(worker, host, options) {
8332
8455
  ...options.cache ? { cache: options.cache } : {}
8333
8456
  });
8334
8457
  }
8335
- /** The native packages a file server's processors named, once each. */
8336
- function processorNative(manifest, fileServerId) {
8337
- const server = manifest[fileServerId];
8338
- if (server?.kind !== "file-server") return [];
8339
- return [...new Set((server.processors ?? []).flatMap((p) => p.native ?? []))].sort();
8340
- }
8341
8458
  /**
8342
8459
  * A file server's processor unit's Dockerfile: its host app's build, and the
8343
8460
  * unit's bundle as the runner, with its processors' native packages
@@ -8351,7 +8468,6 @@ function processorDockerfile(unit, host, options) {
8351
8468
  fileServer: unit.id,
8352
8469
  bundle: processorBundleName(unit.id),
8353
8470
  healthCheckPath: "/health",
8354
- ...options.native.length ? { external: [...options.native] } : {},
8355
8471
  ...options.cache ? { cache: options.cache } : {}
8356
8472
  });
8357
8473
  }
@@ -8733,7 +8849,7 @@ async function createDnsProvider(options) {
8733
8849
  });
8734
8850
  }
8735
8851
  if (provider === "godaddy") {
8736
- const { GoDaddyProvider } = await import("./GoDaddyProvider-BgY6mqoH.mjs");
8852
+ const { GoDaddyProvider } = await import("./GoDaddyProvider-DxFAueU4.mjs");
8737
8853
  return new GoDaddyProvider(options.godaddy ?? {});
8738
8854
  }
8739
8855
  if (provider === "cloudflare") throw new DnsProviderNotImplemented("cloudflare");
@@ -9413,6 +9529,6 @@ function reportPlannedSeeds(planned, log) {
9413
9529
  for (const { folder, seeds } of planned) log(`🌱 ${folder}: would run ${seeds.length} (${seeds.join(", ")})`);
9414
9530
  }
9415
9531
  //#endregion
9416
- export { processorEntryDir as $, isTelemetryKey as $n, store_exports as $t, setGeneratedSecret as A, loadLocalCredentials as An, LOCAL_CA_PATH as At, dockerCommand as B, REDIS_SERVICE as Bn, providerOf as Bt, createEmptyState as C, bucketLifecycles as Cn, resolveHost as Cr, workerEnvKeys as Ct, recordRollback as D, quoteIdentifier as Dn, derivedContainers as Dt, recordRelease as E, postgresStatements as En, constructGlobs as Et, stageProviderNotes as F, getKeyPath as Fn, pgClient as Ft, workerDockerfileOf as G, withRedisPassword as Gn, isPortAvailable as Gt, processorDockerfile as H, redisService as Hn, createCredentialsPreload as Ht, PROVIDER_KINDS as I, keystoreProject as In, CLUSTER_DATABASE as It, workerEntryDir as J, stageEnv as Jn, loadSecretsForApp as Jt, WorkerGenerator as K, envFor as Kn, loadEnvFiles as Kt, DockerBuildFailed as L, projectKey as Ln, composeFor as Lt, StageProviderDisabled as M, postgresSuperuser as Mn, LEGACY_LOCAL_LOGIN as Mt, assertStageProvidersEnabled as N, readLocalCredentials as Nn, ensurePostgresLogin as Nt, setApplicationId as O, mergeLifecycle as On, reconcileWorkspace as Ot, provisionCommand as P, FileSecretsStore as Pn, bucketClient as Pt, processorBundleName as Q, appTelemetry as Qn, storeFromConfig as Qt, DockerPushFailed as R, readKey as Rn, cacheBackendFor as Rt, createComposeState as S, applyPostgres as Sn, isMainFrontendApp as Sr, processorEnvKeys as St, getGeneratedSecret as T, postgresDatabaseNames as Tn, backendsOf as Tt, processorNative as U, runsRedis as Un, createEntryWrapper as Ut, ensureDockerignore as V, STACK_CACHE as Vn, storageBackendFor as Vt, workerDockerfile as W, stackRedis as Wn, findAvailablePort as Wt, CronGenerator as X, planFor as Xn, isRemoteStore as Xt, QueueGenerator as Y, TELEMETRY_CONTAINER as Yn, prepareEntryCredentials as Yt, ProcessorGenerator as Z, resourceName as Zn, secretsStoreFor as Zt, DnsRecordsUnreadable as _, workerUnits as _n, logsAccess as _r, stageServiceDeclarations as _t, dnsResources as a, composeBuildPaths as an, watchedBuckets as ar, processorOriginHost as at, parseMxValue as b, applyNotifications as bn, withLogsPassword as br, dockerfileOf as bt, currentActor as c, TURBO_VERSION as cn, DEFAULT_IMAGES as cr, DEV_SERVICES as ct, DeployJournal as d, findBuildRoot as dn, portKeys as dr, STORAGE_KEY_PAIR as dt, initStageSecrets as en, scopeTelemetryEnv as er, processorInfo as et, extractSubdomain as f, imageBuildCredentials as fn, portsOf as fr, assertDevServicesFlag as ft, verifyDnsRecords as g, processorUnits as gn, LOGS_SERVICE as gr, requiredStageKeys as gt, orchestrateDns as h, isUnder as hn, LOCAL_LOGS_EMAIL as hr, reportDevServices as ht, dnsRecordResource as i, withCustomSecret as in, minioWebhookEnv as ir, originSecretKey as it, setPostgresBackupId as j, postgresRoleSlug as jn, forgetState as jt, setBackupState as k, LOCAL_RABBITMQ_USER as kn, workspace_exports as kt, describeActor as l, WORKER_PORT as ln, describeServices as lr, DevServicesNeedServerTarget as lt, normalizeDnsConfig as m, publicBuildValues as mn, primaryPortKey as mr, externalServices as mt, reportDatabaseRuns as n, storage_exports as nn, telemetryOf as nr, PROCESSOR_ORIGIN_SECRET_ENV as nt, forgetDnsResource as o, imageLayout as on, EMULATOR_ACCESS_KEY_ID as or, validateImageRef as ot, findRootDomain as p, isImageBuild as pn, postgresImage as pr, devServicesUsed as pt, workerBundleName as q, localRolePassword as qn, loadPortState as qt, reportPlannedSeeds as r, toEmbeddableSecrets as rn, usesTelemetry as rr, newOriginSecret as rt, recordDnsChanges as s, PROCESSOR_PORT as sn, hostFor$1 as sr, AllowDevServicesTakesNoValue as st, DeploySeedsFailed as t, maskPassword as tn, surfaceClientTraced as tr, ORIGIN_VERIFY_HEADER as tt, isCi as u, detectPackageManager as un, fakeKey as ur, ExternalServicesNotConfigured as ut, createDnsProvider as v, applyBuckets as vn, logsService as vr, suppliedOnly as vt, getBackupState as w, bucketPolicies as wn, FAKE_ENV as wt, asDokployState as x, applyPolicies as xn, NoDomainForStage as xr, networkEnv as xt, mxValue as y, applyLifecycles as yn, stackLogs as yr, appEnvKeys as yt, appDockerfile as z, withGeneratedSecrets as zn, eventsBackendFor as zt };
9532
+ export { processorInfo as $, resourceName as $n, initStageSecrets as $t, setGeneratedSecret as A, mergeLifecycle as An, forgetState as At, dockerCommand as B, readKey as Bn, storageBackendFor as Bt, createEmptyState as C, applyPolicies as Cn, NoDomainForStage as Cr, FAKE_ENV as Ct, recordRollback as D, postgresDatabaseNames as Dn, reconcileWorkspace as Dt, recordRelease as E, bucketPolicies as En, derivedContainers as Et, stageProviderNotes as F, readLocalCredentials as Fn, CLUSTER_DATABASE as Ft, WorkerGenerator as G, runsRedis as Gn, loadEnvFiles as Gt, processorDockerfile as H, REDIS_SERVICE as Hn, createEntryWrapper as Ht, PROVIDER_KINDS as I, FileSecretsStore as In, composeFor as It, QueueGenerator as J, envFor as Jn, prepareEntryCredentials as Jt, workerBundleName as K, stackRedis as Kn, loadPortState as Kt, DockerBuildFailed as L, getKeyPath as Ln, cacheBackendFor as Lt, StageProviderDisabled as M, loadLocalCredentials as Mn, ensurePostgresLogin as Mt, assertStageProvidersEnabled as N, postgresRoleSlug as Nn, bucketClient as Nt, setApplicationId as O, postgresStatements as On, workspace_exports as Ot, provisionCommand as P, postgresSuperuser as Pn, pgClient as Pt, processorEntryDir as Q, planFor as Qn, store_exports as Qt, DockerPushFailed as R, keystoreProject as Rn, eventsBackendFor as Rt, createComposeState as S, applyNotifications as Sn, withLogsPassword as Sr, workerEnvKeys as St, getGeneratedSecret as T, bucketLifecycles as Tn, resolveHost as Tr, constructGlobs as Tt, workerDockerfile as U, STACK_CACHE as Un, findAvailablePort as Ut, ensureDockerignore as V, withGeneratedSecrets as Vn, createCredentialsPreload as Vt, workerDockerfileOf as W, redisService as Wn, isPortAvailable as Wt, ProcessorGenerator as X, stageEnv as Xn, secretsStoreFor as Xt, CronGenerator as Y, localRolePassword as Yn, isRemoteStore as Yt, processorBundleName as Z, TELEMETRY_CONTAINER as Zn, storeFromConfig as Zt, DnsRecordsUnreadable as _, isUnder as _n, LOCAL_LOGS_EMAIL as _r, suppliedOnly as _t, dnsResources as a, imageLayout as an, usesTelemetry as ar, validateImageRef as at, parseMxValue as b, applyBuckets as bn, logsService as br, networkEnv as bt, currentActor as c, WORKER_PORT as cn, EMULATOR_ACCESS_KEY_ID as cr, DevServicesNeedServerTarget as ct, DeployJournal as d, imageBuildCredentials as dn, describeServices as dr, assertDevServicesFlag as dt, maskPassword as en, appTelemetry as er, ORIGIN_VERIFY_HEADER as et, extractSubdomain as f, isImageBuild as fn, fakeKey as fr, devServicesUsed as ft, verifyDnsRecords as g, publicBuildValues as gn, primaryPortKey as gr, stageServiceDeclarations as gt, orchestrateDns as h, importedPackages as hn, postgresImage as hr, requiredStageKeys as ht, dnsRecordResource as i, composeBuildPaths as in, telemetryOf as ir, processorOriginHost as it, setPostgresBackupId as j, LOCAL_RABBITMQ_USER as jn, LEGACY_LOCAL_LOGIN as jt, setBackupState as k, quoteIdentifier as kn, LOCAL_CA_PATH as kt, describeActor as l, detectPackageManager as ln, hostFor$1 as lr, ExternalServicesNotConfigured as lt, normalizeDnsConfig as m, externalsManifestName as mn, portsOf as mr, reportDevServices as mt, reportDatabaseRuns as n, toEmbeddableSecrets as nn, scopeTelemetryEnv as nr, newOriginSecret as nt, forgetDnsResource as o, PROCESSOR_PORT as on, minioWebhookEnv as or, AllowDevServicesTakesNoValue as ot, findRootDomain as p, bundleExternals as pn, portKeys as pr, externalServices as pt, workerEntryDir as q, withRedisPassword as qn, loadSecretsForApp as qt, reportPlannedSeeds as r, withCustomSecret as rn, surfaceClientTraced as rr, originSecretKey as rt, recordDnsChanges as s, TURBO_VERSION as sn, watchedBuckets as sr, DEV_SERVICES as st, DeploySeedsFailed as t, storage_exports as tn, isTelemetryKey as tr, PROCESSOR_ORIGIN_SECRET_ENV as tt, isCi as u, findBuildRoot as un, DEFAULT_IMAGES as ur, STORAGE_KEY_PAIR as ut, createDnsProvider as v, processorUnits as vn, LOGS_SERVICE as vr, appEnvKeys as vt, getBackupState as w, applyPostgres as wn, isMainFrontendApp as wr, backendsOf as wt, asDokployState as x, applyLifecycles as xn, stackLogs as xr, processorEnvKeys as xt, mxValue as y, workerUnits as yn, logsAccess as yr, dockerfileOf as yt, appDockerfile as z, projectKey as zn, providerOf as zt };
9417
9533
 
9418
- //# sourceMappingURL=seeds-nCxxlP5h.mjs.map
9534
+ //# sourceMappingURL=seeds-o6x6BTRo.mjs.map