@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,7 +9,7 @@ const require_identity = require("./identity-CbLfgQNT.cjs");
9
9
  const require_EndpointGenerator = require("./EndpointGenerator-ePscnbwB.cjs");
10
10
  const require_discover = require("./discover-yqeJ2Bx7.cjs");
11
11
  const require_config = require("./config.cjs");
12
- const require_resolve = require("./resolve-BEVVvi13.cjs");
12
+ const require_resolve = require("./resolve-AYtMIgoq.cjs");
13
13
  let node_path = require("node:path");
14
14
  let node_fs = require("node:fs");
15
15
  let node_fs_promises = require("node:fs/promises");
@@ -3209,6 +3209,156 @@ function publicBuildValues(site, manifest, resolve, secrets) {
3209
3209
  return args;
3210
3210
  }
3211
3211
  //#endregion
3212
+ //#region src/build/native.ts
3213
+ /**
3214
+ * The file beside a bundle naming the packages it left out, each at the
3215
+ * version the build resolved: a `package.json` an image installs, for its own
3216
+ * platform, next to the bundle. `server.mjs` → `server.externals.json`.
3217
+ */
3218
+ function externalsManifestName(outfile) {
3219
+ return `${outfile.replace(/\.mjs$/, "")}.externals.json`;
3220
+ }
3221
+ /**
3222
+ * Asked to leave a package out of the bundle, and nothing the app depends on
3223
+ * provides it: there is no version to install in the image.
3224
+ */
3225
+ var ExternalNotInstalled = class extends Error {
3226
+ packageName;
3227
+ root;
3228
+ constructor(packageName, root) {
3229
+ 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.`);
3230
+ this.packageName = packageName;
3231
+ this.root = root;
3232
+ this.name = "ExternalNotInstalled";
3233
+ }
3234
+ };
3235
+ /** Packages whose job is loading a compiled addon. */
3236
+ const NATIVE_LOADERS = /* @__PURE__ */ new Set([
3237
+ "bindings",
3238
+ "node-gyp-build",
3239
+ "node-gyp-build-optional-packages",
3240
+ "node-pre-gyp",
3241
+ "@mapbox/node-pre-gyp",
3242
+ "prebuild-install",
3243
+ "@neon-rs/load"
3244
+ ]);
3245
+ /** A per-platform binary package: `@node-rs/argon2-linux-x64-gnu`, `@img/sharp-darwin-arm64`. */
3246
+ const PLATFORM_PACKAGE = /(?:^|[-/])(?:linux|darwin|win32|freebsd|android)-(?:x64|arm64|arm|ia32)\b/;
3247
+ function readPackage(dir) {
3248
+ try {
3249
+ return JSON.parse((0, node_fs.readFileSync)((0, node_path.join)(dir, "package.json"), "utf-8"));
3250
+ } catch {
3251
+ return;
3252
+ }
3253
+ }
3254
+ /**
3255
+ * Where `name` resolves from `from`, the way Node finds it: the nearest
3256
+ * `node_modules/<name>` walking up. Followed through symlinks, so a pnpm
3257
+ * store package resolves its own dependencies beside it.
3258
+ */
3259
+ function locate(name, from) {
3260
+ let dir = from;
3261
+ for (;;) {
3262
+ const candidate = (0, node_path.join)(dir, "node_modules", name);
3263
+ if ((0, node_fs.existsSync)((0, node_path.join)(candidate, "package.json"))) return (0, node_fs.realpathSync)(candidate);
3264
+ const parent = (0, node_path.dirname)(dir);
3265
+ if (parent === dir) return void 0;
3266
+ dir = parent;
3267
+ }
3268
+ }
3269
+ /**
3270
+ * Whether a package carries compiled code: a `binding.gyp` or prebuilt
3271
+ * binaries of its own, a loader for them, or a binary package per platform.
3272
+ * Such a package cannot be inlined into a bundle — it loads a `.node` file
3273
+ * from beside its own source, for the platform it was installed on.
3274
+ */
3275
+ function isNativePackage(dir, pkg) {
3276
+ if (pkg.gypfile || pkg.binary || pkg.napi) return true;
3277
+ if (Object.keys({
3278
+ ...pkg.dependencies,
3279
+ ...pkg.optionalDependencies
3280
+ }).some((dep) => NATIVE_LOADERS.has(dep))) return true;
3281
+ if (Object.keys(pkg.optionalDependencies ?? {}).some((dep) => PLATFORM_PACKAGE.test(dep))) return true;
3282
+ if ((0, node_fs.existsSync)((0, node_path.join)(dir, "binding.gyp"))) return true;
3283
+ if ((0, node_fs.existsSync)((0, node_path.join)(dir, "prebuilds"))) return true;
3284
+ try {
3285
+ return (0, node_fs.readdirSync)(dir).some((file) => file.endsWith(".node"));
3286
+ } catch {
3287
+ return false;
3288
+ }
3289
+ }
3290
+ /**
3291
+ * The packages with native code an app's bundle would otherwise inline, each
3292
+ * at the version installed for it.
3293
+ *
3294
+ * Walks what the app depends on at runtime — `dependencies`, never
3295
+ * `devDependencies` — through workspace packages and installed ones alike,
3296
+ * since anything reached is bundled. A native package is where the walk
3297
+ * stops: installing it brings what it depends on.
3298
+ */
3299
+ function nativeDependencies(root) {
3300
+ const found = {};
3301
+ const seen = /* @__PURE__ */ new Set();
3302
+ const queue = [(0, node_fs.realpathSync)(root)];
3303
+ while (queue.length > 0) {
3304
+ const dir = queue.shift();
3305
+ if (seen.has(dir)) continue;
3306
+ seen.add(dir);
3307
+ const pkg = readPackage(dir);
3308
+ if (!pkg) continue;
3309
+ const isRoot = seen.size === 1;
3310
+ const installed = dir.split(node_path.sep).includes("node_modules");
3311
+ if (!isRoot && installed && isNativePackage(dir, pkg)) {
3312
+ 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;
3313
+ continue;
3314
+ }
3315
+ for (const dep of Object.keys({
3316
+ ...pkg.dependencies,
3317
+ ...pkg.optionalDependencies
3318
+ })) {
3319
+ const location = locate(dep, dir);
3320
+ if (location && !seen.has(location)) queue.push(location);
3321
+ }
3322
+ }
3323
+ return Object.fromEntries(Object.entries(found).sort(([a], [b]) => a.localeCompare(b)));
3324
+ }
3325
+ /**
3326
+ * What a bundle leaves out, with the version of each to install: the native
3327
+ * packages found under `root`, and any it was asked to leave out besides,
3328
+ * at the version installed for the app.
3329
+ */
3330
+ function bundleExternals(root, declared) {
3331
+ const externals = nativeDependencies(root);
3332
+ for (const name of declared) {
3333
+ if (name in externals) continue;
3334
+ const location = locate(name, root);
3335
+ const version = location ? readPackage(location)?.version : void 0;
3336
+ if (!version) throw new ExternalNotInstalled(name, root);
3337
+ externals[name] = version;
3338
+ }
3339
+ return Object.fromEntries(Object.entries(externals).sort(([a], [b]) => a.localeCompare(b)));
3340
+ }
3341
+ /** The package a bare specifier names: `argon2/lib` → `argon2`, `@a/b/c` → `@a/b`. */
3342
+ function packageOf(specifier) {
3343
+ const parts = specifier.split("/");
3344
+ return specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
3345
+ }
3346
+ /**
3347
+ * The packages a bundle imports at runtime rather than inlining, read from
3348
+ * esbuild's metafile. Nothing when there is no metafile.
3349
+ */
3350
+ function importedPackages(metafile) {
3351
+ let meta;
3352
+ try {
3353
+ meta = JSON.parse((0, node_fs.readFileSync)(metafile, "utf-8"));
3354
+ } catch {
3355
+ return /* @__PURE__ */ new Set();
3356
+ }
3357
+ const imported = /* @__PURE__ */ new Set();
3358
+ 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));
3359
+ return imported;
3360
+ }
3361
+ //#endregion
3212
3362
  //#region src/exec/imageBuild.ts
3213
3363
  /**
3214
3364
  * Set by a site's Dockerfile in its builder stage: this process is building
@@ -3631,53 +3781,25 @@ RUN --mount=type=secret,id=gkm_credentials,required=false \\
3631
3781
  rm -f ${appDir}/.gkm/credentials.enc ${appDir}/.gkm/credentials.iv`;
3632
3782
  }
3633
3783
  /**
3634
- * The externals a backend's bundle leaves out (esbuild `--external`), each
3635
- * installed for Linux at the version the builder resolved, so the runner has
3636
- * exactly those beside `server.mjs`. Nothing when there are none: the runner
3637
- * is the one file.
3784
+ * The packages a bundle left out — its native ones, which load a binary built
3785
+ * for the platform they were installed on — installed for Linux beside it.
3786
+ * `gkm build` records them, at the versions it resolved, in a `package.json`
3787
+ * beside the bundle (`externalsManifestName`), so the image installs exactly
3788
+ * what the build left out: nothing, for most apps.
3638
3789
  */
3639
- function externalsStages(options, appDir) {
3640
- const external = options.external ?? [];
3641
- if (external.length === 0) return {
3642
- stage: "",
3643
- copy: ""
3644
- };
3790
+ function externalsStages(appDir, bundle) {
3645
3791
  return {
3646
3792
  stage: `
3647
- # Stage 4: The packages the bundle leaves external, installed for Linux at the
3648
- # versions the build resolved — and nothing else.
3649
- FROM builder AS externals-manifest
3650
- WORKDIR ${appDir}
3651
- RUN node <<'EOF'
3652
- const { existsSync, readFileSync, writeFileSync } = require('node:fs');
3653
- const { dirname, join } = require('node:path');
3654
- const names = ${JSON.stringify(external)};
3655
- const dependencies = {};
3656
- for (const name of names) {
3657
- let dir = process.cwd();
3658
- for (;;) {
3659
- const manifest = join(dir, 'node_modules', name, 'package.json');
3660
- if (existsSync(manifest)) {
3661
- dependencies[name] = JSON.parse(readFileSync(manifest, 'utf-8')).version;
3662
- break;
3663
- }
3664
- if (dirname(dir) === dir) {
3665
- console.error(name + ' is external to the bundle, and is not installed: add it to the app\\'s dependencies.');
3666
- process.exit(1);
3667
- }
3668
- dir = dirname(dir);
3669
- }
3670
- }
3671
- writeFileSync('/tmp/externals.json', JSON.stringify({ private: true, dependencies }));
3672
- EOF
3673
-
3793
+ # The packages the bundle leaves out, installed for Linux at the versions the
3794
+ # build resolved — and nothing else.
3674
3795
  FROM \${NODE_IMAGE} AS externals
3675
3796
  WORKDIR /externals
3676
- COPY --from=externals-manifest /tmp/externals.json ./package.json
3797
+ COPY --from=builder ${appDir}/.gkm/server/dist/${externalsManifestName(bundle)} ./package.json
3677
3798
  RUN --mount=type=cache,id=npm,target=/root/.npm \\
3678
- npm install --omit=dev --no-package-lock --no-audit --no-fund
3799
+ npm install --omit=dev --no-package-lock --no-audit --no-fund && \\
3800
+ mkdir -p node_modules
3679
3801
  `,
3680
- copy: "\nCOPY --from=externals --chown=hono:nodejs /externals/node_modules ./node_modules"
3802
+ copy: `\nCOPY --from=externals --chown=hono:nodejs /externals/node_modules ./node_modules`
3681
3803
  };
3682
3804
  }
3683
3805
  /**
@@ -3823,7 +3945,8 @@ CMD ["node", "${appPath}/server.js"]
3823
3945
  /**
3824
3946
  * Generate a Dockerfile for a gkm backend: pruned, installed, and bundled by
3825
3947
  * `gkm build --provider server --production` inside the image. The runner is
3826
- * `server.mjs` alone — plus any package the bundle leaves external.
3948
+ * `server.mjs` — plus the packages the bundle leaves out, which is none
3949
+ * unless it uses one with native code.
3827
3950
  * @internal Exported for testing
3828
3951
  */
3829
3952
  function generateBackendDockerfile(options) {
@@ -3857,7 +3980,8 @@ function generateWorkerDockerfile(options) {
3857
3980
  /**
3858
3981
  * A file server's processor unit: its host app's build, and the unit's bundle
3859
3982
  * as the runner. Its native packages — `sharp` — are installed for the image's
3860
- * platform beside the bundle, at the versions the build resolved.
3983
+ * platform beside the bundle, at the versions the build resolved, as for
3984
+ * every bundle.
3861
3985
  */
3862
3986
  function generateProcessorDockerfile(options) {
3863
3987
  return gkmBundleDockerfile(options, {
@@ -3870,7 +3994,7 @@ function generateProcessorDockerfile(options) {
3870
3994
  function gkmBundleDockerfile(options, runner) {
3871
3995
  const { port, healthCheckPath = "/health" } = options;
3872
3996
  const { app } = layout(options);
3873
- const externals = externalsStages(options, app);
3997
+ const externals = externalsStages(app, runner.bundle);
3874
3998
  return `# syntax=docker/dockerfile:1
3875
3999
  # ${runner.title}: a turbo-pruned slice, bundled by gkm build in the image
3876
4000
 
@@ -8260,8 +8384,7 @@ async function workspaceDockerCommand(workspace, manifest, imageNames = {}, back
8260
8384
  logger$1.log(`\n 📄 Generating Dockerfile for ${unit.name} (processors of ${unit.id}, built from ${unit.app})`);
8261
8385
  const dockerfile = processorDockerfile(unit, workspace.apps[unit.app], {
8262
8386
  layout,
8263
- workspaceRoot: workspace.root,
8264
- native: processorNative(manifest, unit.id)
8387
+ workspaceRoot: workspace.root
8265
8388
  });
8266
8389
  const path = workerDockerfileOf(unit.name);
8267
8390
  const dockerfilePath = (0, node_path.join)(workspace.root, path);
@@ -8334,12 +8457,6 @@ function workerDockerfile(worker, host, options) {
8334
8457
  ...options.cache ? { cache: options.cache } : {}
8335
8458
  });
8336
8459
  }
8337
- /** The native packages a file server's processors named, once each. */
8338
- function processorNative(manifest, fileServerId) {
8339
- const server = manifest[fileServerId];
8340
- if (server?.kind !== "file-server") return [];
8341
- return [...new Set((server.processors ?? []).flatMap((p) => p.native ?? []))].sort();
8342
- }
8343
8460
  /**
8344
8461
  * A file server's processor unit's Dockerfile: its host app's build, and the
8345
8462
  * unit's bundle as the runner, with its processors' native packages
@@ -8353,7 +8470,6 @@ function processorDockerfile(unit, host, options) {
8353
8470
  fileServer: unit.id,
8354
8471
  bundle: processorBundleName(unit.id),
8355
8472
  healthCheckPath: "/health",
8356
- ...options.native.length ? { external: [...options.native] } : {},
8357
8473
  ...options.cache ? { cache: options.cache } : {}
8358
8474
  });
8359
8475
  }
@@ -8747,7 +8863,7 @@ async function createDnsProvider(options) {
8747
8863
  });
8748
8864
  }
8749
8865
  if (provider === "godaddy") {
8750
- const { GoDaddyProvider } = await Promise.resolve().then(() => require("./GoDaddyProvider-C-rs22Zv.cjs"));
8866
+ const { GoDaddyProvider } = await Promise.resolve().then(() => require("./GoDaddyProvider-hAc0q5s-.cjs"));
8751
8867
  return new GoDaddyProvider(options.godaddy ?? {});
8752
8868
  }
8753
8869
  if (provider === "cloudflare") throw new DnsProviderNotImplemented("cloudflare");
@@ -9727,6 +9843,12 @@ Object.defineProperty(exports, "bucketPolicies", {
9727
9843
  return bucketPolicies;
9728
9844
  }
9729
9845
  });
9846
+ Object.defineProperty(exports, "bundleExternals", {
9847
+ enumerable: true,
9848
+ get: function() {
9849
+ return bundleExternals;
9850
+ }
9851
+ });
9730
9852
  Object.defineProperty(exports, "cacheBackendFor", {
9731
9853
  enumerable: true,
9732
9854
  get: function() {
@@ -9871,6 +9993,12 @@ Object.defineProperty(exports, "externalServices", {
9871
9993
  return externalServices;
9872
9994
  }
9873
9995
  });
9996
+ Object.defineProperty(exports, "externalsManifestName", {
9997
+ enumerable: true,
9998
+ get: function() {
9999
+ return externalsManifestName;
10000
+ }
10001
+ });
9874
10002
  Object.defineProperty(exports, "extractSubdomain", {
9875
10003
  enumerable: true,
9876
10004
  get: function() {
@@ -9949,6 +10077,12 @@ Object.defineProperty(exports, "imageLayout", {
9949
10077
  return imageLayout;
9950
10078
  }
9951
10079
  });
10080
+ Object.defineProperty(exports, "importedPackages", {
10081
+ enumerable: true,
10082
+ get: function() {
10083
+ return importedPackages;
10084
+ }
10085
+ });
9952
10086
  Object.defineProperty(exports, "initStageSecrets", {
9953
10087
  enumerable: true,
9954
10088
  get: function() {
@@ -10201,12 +10335,6 @@ Object.defineProperty(exports, "processorInfo", {
10201
10335
  return processorInfo;
10202
10336
  }
10203
10337
  });
10204
- Object.defineProperty(exports, "processorNative", {
10205
- enumerable: true,
10206
- get: function() {
10207
- return processorNative;
10208
- }
10209
- });
10210
10338
  Object.defineProperty(exports, "processorOriginHost", {
10211
10339
  enumerable: true,
10212
10340
  get: function() {
@@ -10538,4 +10666,4 @@ Object.defineProperty(exports, "workspace_exports", {
10538
10666
  }
10539
10667
  });
10540
10668
 
10541
- //# sourceMappingURL=seeds-BR_7hJTw.cjs.map
10669
+ //# sourceMappingURL=seeds-DndMeyzm.cjs.map