@geekmidas/cli 10.0.0-alpha.111 → 10.0.0-alpha.113

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 (37) hide show
  1. package/dist/{cli-Br5ApIgR.mjs → cli-DDY3jfTt.mjs} +3 -3
  2. package/dist/{cli-Br5ApIgR.mjs.map → cli-DDY3jfTt.mjs.map} +1 -1
  3. package/dist/{eas-BkLA60P2.cjs → eas-Cne743nQ.cjs} +21 -3
  4. package/dist/eas-Cne743nQ.cjs.map +1 -0
  5. package/dist/{eas-6ezdJtry.mjs → eas-DEpwISrQ.mjs} +25 -7
  6. package/dist/eas-DEpwISrQ.mjs.map +1 -0
  7. package/dist/{github-D2eABlxM.mjs → github-BMakI-k3.mjs} +5 -4
  8. package/dist/github-BMakI-k3.mjs.map +1 -0
  9. package/dist/{github-DDOHjdS9.cjs → github-C3gblUvr.cjs} +5 -3
  10. package/dist/github-C3gblUvr.cjs.map +1 -0
  11. package/dist/{googlePlay-DNgybe5t.cjs → googlePlay-B6uiHi65.cjs} +2 -2
  12. package/dist/{googlePlay-DNgybe5t.cjs.map → googlePlay-B6uiHi65.cjs.map} +1 -1
  13. package/dist/{googlePlay-DY9vZQ1p.mjs → googlePlay-BYZ-J5sC.mjs} +4 -4
  14. package/dist/{googlePlay-DY9vZQ1p.mjs.map → googlePlay-BYZ-J5sC.mjs.map} +1 -1
  15. package/dist/index.cjs +167 -74
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.mjs +176 -85
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/{migrate-B9GswIAr.mjs → migrate-xHYaeBkd.mjs} +2 -2
  20. package/dist/{migrate-B9GswIAr.mjs.map → migrate-xHYaeBkd.mjs.map} +1 -1
  21. package/dist/{publish-B-EIjfQ0.mjs → publish-CSctCNf4.mjs} +2 -2
  22. package/dist/{publish-B-EIjfQ0.mjs.map → publish-CSctCNf4.mjs.map} +1 -1
  23. package/dist/{publish-CPgSbtcs.cjs → publish-SDG1WfYn.cjs} +2 -2
  24. package/dist/{publish-CPgSbtcs.cjs.map → publish-SDG1WfYn.cjs.map} +1 -1
  25. package/dist/serverSetup--O61SRvg.mjs +558 -0
  26. package/dist/serverSetup--O61SRvg.mjs.map +1 -0
  27. package/dist/serverSetup-BCbD8ksJ.cjs +558 -0
  28. package/dist/serverSetup-BCbD8ksJ.cjs.map +1 -0
  29. package/dist/{stage-DjxR_7C0.mjs → stage-ClKTHQoM.mjs} +2 -2
  30. package/dist/{stage-DjxR_7C0.mjs.map → stage-ClKTHQoM.mjs.map} +1 -1
  31. package/dist/{terminal-mXM-Lqc6.mjs → terminal-CybB-cjk.mjs} +2 -2
  32. package/dist/{terminal-mXM-Lqc6.mjs.map → terminal-CybB-cjk.mjs.map} +1 -1
  33. package/package.json +15 -15
  34. package/dist/eas-6ezdJtry.mjs.map +0 -1
  35. package/dist/eas-BkLA60P2.cjs.map +0 -1
  36. package/dist/github-D2eABlxM.mjs.map +0 -1
  37. package/dist/github-DDOHjdS9.cjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -39,7 +39,7 @@ import { canonicalId, dependenciesOf, kebabCase, migrationFolder, provideKey, sc
39
39
  import { pathToFileURL } from "node:url";
40
40
  import { promisify } from "node:util";
41
41
  import fg from "fast-glob";
42
- import { parseDocument } from "yaml";
42
+ import { parseDocument, stringify } from "yaml";
43
43
  import chokidar from "chokidar";
44
44
  import prompts from "prompts";
45
45
  import { createServer as createServer$1 } from "node:http";
@@ -51,7 +51,7 @@ import crypto from "crypto";
51
51
  import { Function } from "@geekmidas/constructs/functions";
52
52
  import { Topic } from "@geekmidas/constructs/topic";
53
53
  //#region package.json
54
- var version = "10.0.0-alpha.111";
54
+ var version = "10.0.0-alpha.113";
55
55
  //#endregion
56
56
  //#region src/prompt.ts
57
57
  /**
@@ -2174,7 +2174,7 @@ async function execCommand(commandArgs, options = {}, stageDeps) {
2174
2174
  const cwd = options.cwd ?? process.cwd();
2175
2175
  if (!commandArgs[0]) throw new NoCommandSpecified();
2176
2176
  if (options.stage && !isImageBuild()) {
2177
- const { execOnStage } = await import("./stage-DjxR_7C0.mjs").then((n) => n.n);
2177
+ const { execOnStage } = await import("./stage-ClKTHQoM.mjs").then((n) => n.n);
2178
2178
  const { loadWorkspaceConfig } = await import("./config.mjs");
2179
2179
  const { workspace } = await loadWorkspaceConfig(cwd);
2180
2180
  if (options.stage !== workspace.stages.local) {
@@ -2747,9 +2747,9 @@ async function workspaceDevCommand(configured, options) {
2747
2747
  for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
2748
2748
  logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
2749
2749
  if (options.migrate || options.seed) {
2750
- const { prepareDevDatabases } = await import("./migrate-B9GswIAr.mjs");
2750
+ const { prepareDevDatabases } = await import("./migrate-xHYaeBkd.mjs");
2751
2751
  await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
2752
- } else await import("./migrate-B9GswIAr.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2752
+ } else await import("./migrate-xHYaeBkd.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2753
2753
  logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
2754
2754
  });
2755
2755
  const appUrls = {};
@@ -5943,25 +5943,25 @@ function loadPackageJson() {
5943
5943
  * Run: pnpm --filter @geekmidas/cli sync-versions
5944
5944
  */
5945
5945
  const GEEKMIDAS_VERSIONS = {
5946
- "@geekmidas/audit": "~10.0.0-alpha.111",
5947
- "@geekmidas/auth": "~10.0.0-alpha.111",
5948
- "@geekmidas/cache": "~10.0.0-alpha.111",
5949
- "@geekmidas/client": "~10.0.0-alpha.111",
5950
- "@geekmidas/cloud": "~10.0.0-alpha.111",
5951
- "@geekmidas/constructs": "~10.0.0-alpha.111",
5952
- "@geekmidas/db": "~10.0.0-alpha.111",
5953
- "@geekmidas/emailkit": "~10.0.0-alpha.111",
5954
- "@geekmidas/envkit": "~10.0.0-alpha.111",
5955
- "@geekmidas/errors": "~10.0.0-alpha.111",
5956
- "@geekmidas/events": "~10.0.0-alpha.111",
5957
- "@geekmidas/logger": "~10.0.0-alpha.111",
5958
- "@geekmidas/manifest": "~10.0.0-alpha.111",
5959
- "@geekmidas/rate-limit": "~10.0.0-alpha.111",
5960
- "@geekmidas/schema": "~10.0.0-alpha.111",
5961
- "@geekmidas/services": "~10.0.0-alpha.111",
5962
- "@geekmidas/storage": "~10.0.0-alpha.111",
5963
- "@geekmidas/telescope": "~10.0.0-alpha.111",
5964
- "@geekmidas/testkit": "~10.0.0-alpha.111",
5946
+ "@geekmidas/audit": "~10.0.0-alpha.113",
5947
+ "@geekmidas/auth": "~10.0.0-alpha.113",
5948
+ "@geekmidas/cache": "~10.0.0-alpha.113",
5949
+ "@geekmidas/client": "~10.0.0-alpha.113",
5950
+ "@geekmidas/cloud": "~10.0.0-alpha.113",
5951
+ "@geekmidas/constructs": "~10.0.0-alpha.113",
5952
+ "@geekmidas/db": "~10.0.0-alpha.113",
5953
+ "@geekmidas/emailkit": "~10.0.0-alpha.113",
5954
+ "@geekmidas/envkit": "~10.0.0-alpha.113",
5955
+ "@geekmidas/errors": "~10.0.0-alpha.113",
5956
+ "@geekmidas/events": "~10.0.0-alpha.113",
5957
+ "@geekmidas/logger": "~10.0.0-alpha.113",
5958
+ "@geekmidas/manifest": "~10.0.0-alpha.113",
5959
+ "@geekmidas/rate-limit": "~10.0.0-alpha.113",
5960
+ "@geekmidas/schema": "~10.0.0-alpha.113",
5961
+ "@geekmidas/services": "~10.0.0-alpha.113",
5962
+ "@geekmidas/storage": "~10.0.0-alpha.113",
5963
+ "@geekmidas/telescope": "~10.0.0-alpha.113",
5964
+ "@geekmidas/testkit": "~10.0.0-alpha.113",
5965
5965
  "@geekmidas/cli": `~${loadPackageJson().version}`
5966
5966
  };
5967
5967
  //#endregion
@@ -7154,7 +7154,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
7154
7154
  * The `uses:` value for the stages action, with a comment saying which CLI
7155
7155
  * release the pinned commit is.
7156
7156
  */
7157
- function stagesActionUses(commit = "8a63c47fd347367a03f2dfe1c3ea031556ede424", version = cliVersion()) {
7157
+ function stagesActionUses(commit = "18d6b7860652d3db231d361933ee2d5ec10f0941", version = cliVersion()) {
7158
7158
  return commit && COMMIT.test(commit) ? `${STAGES_ACTION}@${commit} # @geekmidas/cli ${version}` : `${STAGES_ACTION}@main # pin to a commit SHA: see the action's README`;
7159
7159
  }
7160
7160
  //#endregion
@@ -7621,6 +7621,7 @@ ${registryLogin(registry)}
7621
7621
  # pinned host key (DEPLOY_KNOWN_HOSTS, a variable) on each environment:
7622
7622
  # never accepted on first sight. The server — user and host — is
7623
7623
  # deploy.compose.server in gkm.config.ts and the stage's GKM_SERVER_IPV4.
7624
+ # \`gkm compose:server --stage <stage>\` sets the server up and gives both.
7624
7625
  - name: SSH to the server
7625
7626
  run: |
7626
7627
  mkdir -p ~/.ssh && chmod 700 ~/.ssh
@@ -7653,26 +7654,6 @@ ${registryLogin(registry)}
7653
7654
  SHA: \${{ steps.commit.outputs.sha }}
7654
7655
  GODADDY_API_TOKEN: \${{ secrets.GODADDY_API_TOKEN }}
7655
7656
  HOSTINGER_API_TOKEN: \${{ secrets.HOSTINGER_API_TOKEN }}
7656
- ${options.mobileApp ? publishMobile(pm.exec) : ""}`;
7657
- }
7658
- /**
7659
- * The phone app, once its stage's servers run this release: its values
7660
- * synced to the stage's EAS environment, then an update on the stage's
7661
- * channel when a store build has its native code, or a store build
7662
- * submitted to the stores when none does (\`gkm publish\`). The build runs
7663
- * on EAS; this step only starts it.
7664
- */
7665
- function publishMobile(exec) {
7666
- return `
7667
- # The phone app, after its servers: an update when a store build has
7668
- # this native code, a store build submitted to the stores when none
7669
- # does. EXPO_TOKEN is a secret on the stage's environment (an EAS
7670
- # access token); the build runs on EAS, not here.
7671
- - name: Publish the app
7672
- run: ${exec} gkm publish --stage "$STAGE"
7673
- env:
7674
- STAGE: \${{ matrix.stage }}
7675
- EXPO_TOKEN: \${{ secrets.EXPO_TOKEN }}
7676
7657
  `;
7677
7658
  }
7678
7659
  /**
@@ -7778,6 +7759,97 @@ function generateGithubFiles(options) {
7778
7759
  return files;
7779
7760
  }
7780
7761
  //#endregion
7762
+ //#region src/mobile/easWorkflow.ts
7763
+ /**
7764
+ * A stage's EAS workflow (`.eas/workflows/publish-<stage>.yml`): what
7765
+ * `gkm publish` does, run by EAS itself — so shipping the app needs no CI
7766
+ * of the project's own, no runner and no token in GitHub.
7767
+ *
7768
+ * Per platform: the native code's fingerprint, read with the stage's EAS
7769
+ * environment; a finished store build of the stage's profile with that
7770
+ * fingerprint; then an update on the stage's channel when there is one, or
7771
+ * a store build, submitted with the stage's submit profile, when there is
7772
+ * not. iOS is submitted once `submit.<stage>.ios.ascAppId` is set — until
7773
+ * then it is built and not submitted.
7774
+ *
7775
+ * It runs when the stage is deployed: the protected stage on a release tag
7776
+ * (`v*`), every other deployed stage on a push to `main` — and on demand,
7777
+ * `eas workflow:run .eas/workflows/publish-<stage>.yml`. The values a build
7778
+ * reads are the stage's EAS environment, which `gkm eas:sync` keeps.
7779
+ *
7780
+ * Generated: written by `gkm eas:sync`, and overwritten by the next one.
7781
+ */
7782
+ /** Where a stage's workflow is written, relative to the app. */
7783
+ function easWorkflowPath(stage) {
7784
+ return `.eas/workflows/publish-${stage}.yml`;
7785
+ }
7786
+ /** The stage's EAS workflow, as YAML. */
7787
+ function easWorkflow(stage, options) {
7788
+ const profile = stage.stage;
7789
+ const jobs = { fingerprint: {
7790
+ name: "Fingerprint",
7791
+ type: "fingerprint",
7792
+ environment: stage.environment
7793
+ } };
7794
+ for (const platform of ["android", "ios"]) {
7795
+ const existing = `get_${platform}_build`;
7796
+ const build = `build_${platform}`;
7797
+ const name = platform === "ios" ? "iOS" : "Android";
7798
+ jobs[existing] = {
7799
+ name: `Find an ${name} store build with this native code`,
7800
+ needs: ["fingerprint"],
7801
+ type: "get-build",
7802
+ params: {
7803
+ fingerprint_hash: `\${{ needs.fingerprint.outputs.${platform}_fingerprint_hash }}`,
7804
+ profile,
7805
+ platform,
7806
+ distribution: "store"
7807
+ }
7808
+ };
7809
+ jobs[build] = {
7810
+ name: `Build ${name}`,
7811
+ needs: [existing],
7812
+ if: `\${{ !needs.${existing}.outputs.build_id }}`,
7813
+ type: "build",
7814
+ params: {
7815
+ platform,
7816
+ profile
7817
+ }
7818
+ };
7819
+ if (platform === "android" || options.iosSubmits) jobs[`submit_${platform}`] = {
7820
+ name: `Submit ${name}`,
7821
+ needs: [build],
7822
+ type: "submit",
7823
+ params: {
7824
+ build_id: `\${{ needs.${build}.outputs.build_id }}`,
7825
+ profile
7826
+ }
7827
+ };
7828
+ jobs[`update_${platform}`] = {
7829
+ name: `Update ${name} on '${stage.channel}'`,
7830
+ needs: [existing],
7831
+ if: `\${{ needs.${existing}.outputs.build_id }}`,
7832
+ type: "update",
7833
+ environment: stage.environment,
7834
+ params: {
7835
+ platform,
7836
+ channel: stage.channel
7837
+ }
7838
+ };
7839
+ }
7840
+ return `${[
7841
+ `# Generated by \`gkm eas:sync --stage ${stage.stage}\`: run it again rather than`,
7842
+ "# editing this file. An update when a store build has this native code,",
7843
+ `# a store build submitted to the stores when none does. Run by hand:`,
7844
+ `# eas workflow:run ${easWorkflowPath(stage.stage)}`,
7845
+ ""
7846
+ ].join("\n")}${stringify({
7847
+ name: `Publish to ${stage.stage}`,
7848
+ on: options.release ? { push: { tags: ["v*"] } } : { push: { branches: ["main"] } },
7849
+ jobs
7850
+ }, { lineWidth: 0 })}`;
7851
+ }
7852
+ //#endregion
7781
7853
  //#region src/mobile/stage.ts
7782
7854
  /** A `MobileApp`'s `stages` names a stage the project does not deploy. */
7783
7855
  var MobileAppStageUndeclared = class extends GkmError {
@@ -8696,6 +8768,35 @@ export default function SigningInScreen() {
8696
8768
  </SafeAreaView>
8697
8769
  );
8698
8770
  }
8771
+ `;
8772
+ const appConstructTs = `import { MobileApp } from '@geekmidas/constructs/mobile-app';
8773
+ import { api } from './api.ts';
8774
+ import { auth } from './auth.ts';
8775
+ import { email } from './email.ts';
8776
+
8777
+ /**
8778
+ * The mobile app — a construct like a site, which is what makes it an app.
8779
+ *
8780
+ * \`.dependsOn()\` is the single fact behind what a mobile app otherwise has
8781
+ * written down by hand: its API and auth URLs, its URL scheme, the scheme in
8782
+ * the auth server's trusted origins, Better Auth's Expo plugin, sign-in links
8783
+ * a phone can open — and, on a local stage, the mailer's inbox, so a link sent
8784
+ * in development is read on the device.
8785
+ */
8786
+ export const app = new MobileApp('App', { path: 'apps/app' }).dependsOn([
8787
+ api,
8788
+ auth,
8789
+ email,
8790
+ ]);
8791
+ `;
8792
+ const gitignore = `node_modules/
8793
+ .expo/
8794
+ dist/
8795
+ *.log
8796
+ .env*.local
8797
+ ios/
8798
+ android/
8799
+ .eas/
8699
8800
  `;
8700
8801
  return [
8701
8802
  {
@@ -8710,6 +8811,13 @@ export default function SigningInScreen() {
8710
8811
  path: "apps/app/eas.json",
8711
8812
  content: `${JSON.stringify(easJson, null, 2)}\n`
8712
8813
  },
8814
+ ...stages.map((stage) => ({
8815
+ path: `apps/app/${easWorkflowPath(stage.stage)}`,
8816
+ content: easWorkflow(stage, {
8817
+ release: options.stages.protected?.includes(stage.stage) ?? false,
8818
+ iosSubmits: false
8819
+ })
8820
+ })),
8713
8821
  {
8714
8822
  path: "apps/app/babel.config.js",
8715
8823
  content: babelConfig
@@ -8800,38 +8908,11 @@ export default function SigningInScreen() {
8800
8908
  },
8801
8909
  {
8802
8910
  path: "apps/app/.gitignore",
8803
- content: `node_modules/
8804
- .expo/
8805
- dist/
8806
- *.log
8807
- .env*.local
8808
- ios/
8809
- android/
8810
- .eas/
8811
- `
8911
+ content: gitignore
8812
8912
  },
8813
8913
  {
8814
8914
  path: "constructs/app.ts",
8815
- content: `import { MobileApp } from '@geekmidas/constructs/mobile-app';
8816
- import { api } from './api.ts';
8817
- import { auth } from './auth.ts';
8818
- import { email } from './email.ts';
8819
-
8820
- /**
8821
- * The mobile app — a construct like a site, which is what makes it an app.
8822
- *
8823
- * \`.dependsOn()\` is the single fact behind what a mobile app otherwise has
8824
- * written down by hand: its API and auth URLs, its URL scheme, the scheme in
8825
- * the auth server's trusted origins, Better Auth's Expo plugin, sign-in links
8826
- * a phone can open — and, on a local stage, the mailer's inbox, so a link sent
8827
- * in development is read on the device.
8828
- */
8829
- export const app = new MobileApp('App', { path: 'apps/app' }).dependsOn([
8830
- api,
8831
- auth,
8832
- email,
8833
- ]);
8834
- `
8915
+ content: appConstructTs
8835
8916
  }
8836
8917
  ];
8837
8918
  }
@@ -15909,7 +15990,7 @@ function testDatabases(reconciled) {
15909
15990
  * starts without the reference data the app needs.
15910
15991
  */
15911
15992
  async function migrateTestStage(workspace, env) {
15912
- const { migrateAndSeed } = await import("./migrate-B9GswIAr.mjs");
15993
+ const { migrateAndSeed } = await import("./migrate-xHYaeBkd.mjs");
15913
15994
  const { discover } = await import("./discover-Ca8U75dl.mjs").then((n) => n.a);
15914
15995
  const sources = {};
15915
15996
  const manifest = await discover({
@@ -16333,7 +16414,7 @@ program.command("eas:sync").description("Set up a mobile app's EAS project for a
16333
16414
  try {
16334
16415
  const globalOptions = program.opts();
16335
16416
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16336
- const { easSync } = await import("./eas-6ezdJtry.mjs");
16417
+ const { easSync } = await import("./eas-DEpwISrQ.mjs");
16337
16418
  await easSync(options);
16338
16419
  } catch (error) {
16339
16420
  exitWithError(error);
@@ -16343,7 +16424,7 @@ program.command("publish").description("Ship a mobile app for a deployed stage:
16343
16424
  try {
16344
16425
  const globalOptions = program.opts();
16345
16426
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16346
- const { publish, PublishModeConflict } = await import("./publish-B-EIjfQ0.mjs");
16427
+ const { publish, PublishModeConflict } = await import("./publish-CSctCNf4.mjs");
16347
16428
  if (options.build && options.update) throw new PublishModeConflict();
16348
16429
  const { build, update, ...rest } = options;
16349
16430
  await publish({
@@ -16359,7 +16440,7 @@ program.command("deploy:google-play").description("Let EAS Submit publish a mobi
16359
16440
  try {
16360
16441
  const globalOptions = program.opts();
16361
16442
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16362
- const { deployGooglePlay } = await import("./googlePlay-DY9vZQ1p.mjs");
16443
+ const { deployGooglePlay } = await import("./googlePlay-BYZ-J5sC.mjs");
16363
16444
  await deployGooglePlay(options);
16364
16445
  } catch (error) {
16365
16446
  exitWithError(error);
@@ -16381,7 +16462,7 @@ program.command("migrate").description("Apply each database construct's migratio
16381
16462
  try {
16382
16463
  const globalOptions = program.opts();
16383
16464
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16384
- const { migrateCommand } = await import("./migrate-B9GswIAr.mjs");
16465
+ const { migrateCommand } = await import("./migrate-xHYaeBkd.mjs");
16385
16466
  await migrateCommand({
16386
16467
  ...options,
16387
16468
  ...construct ? { construct } : {}
@@ -16394,7 +16475,7 @@ program.command("seed").description("Migrate, then run each database construct's
16394
16475
  try {
16395
16476
  const globalOptions = program.opts();
16396
16477
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16397
- const { seedCommand } = await import("./migrate-B9GswIAr.mjs");
16478
+ const { seedCommand } = await import("./migrate-xHYaeBkd.mjs");
16398
16479
  await seedCommand({
16399
16480
  ...options,
16400
16481
  ...construct ? { construct } : {}
@@ -16407,7 +16488,7 @@ program.command("migration").description("Write a construct's next migration: an
16407
16488
  try {
16408
16489
  const globalOptions = program.opts();
16409
16490
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16410
- const { migrationCommand } = await import("./migrate-B9GswIAr.mjs");
16491
+ const { migrationCommand } = await import("./migrate-xHYaeBkd.mjs");
16411
16492
  await migrationCommand({
16412
16493
  construct,
16413
16494
  ...name ? { name } : {}
@@ -16599,7 +16680,7 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
16599
16680
  }
16600
16681
  });
16601
16682
  program.command("deploy").description("Deploy a stage through its target").option("--target <name>", "Deploy target: dokploy, compose, sst, or one named in deploy.targets (default: deploy.default)").option("--provider <provider>", "[DEPRECATED] Use --target instead").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--tag <tag>", "Image tag (default: stage-timestamp; compose: the commit). Compose pulls a given tag").option("--skip-push", "Skip pushing image to registry").option("--skip-build", "Skip build step (use existing build)").option("--json", "Write events as JSON lines instead of progress; never prompts").option("--dry-run", "Show what would be created or reused; change, build and push nothing").option("--atomic", "If the release fails, roll back every app it released, not only the failed ones").option("--allow-dev-services", "Server targets: run the dev service (MinIO, Mailpit) for every bucket and mail the stage doesn't account for. Not production-grade").option("--skip-dns", "Compose: neither write the public hosts' DNS records nor check they point at GKM_SERVER_IPV4 (a CDN or proxy in front, or records written elsewhere)").option("--rotate-keys", "Deployed stage: each provider issues its runtime keys a successor (the old one is deleted by the next deploy)").option("--retire-old-keys", "Deployed stage: delete a rotated-out key now instead of on the next deploy").action(async (options) => {
16602
- const { deployCli } = await import("./cli-Br5ApIgR.mjs");
16683
+ const { deployCli } = await import("./cli-DDY3jfTt.mjs");
16603
16684
  const globalOptions = program.opts();
16604
16685
  const code = await deployCli({
16605
16686
  cwd: resolve(globalOptions.cwd ?? process.cwd()),
@@ -16620,7 +16701,7 @@ program.command("deploy").description("Deploy a stage through its target").optio
16620
16701
  program.command("deploy:rollback").description("Put a stage's app back on its previous release (Dokploy): one app with --app, every app with --atomic").requiredOption("--stage <stage>", "A deployed stage").option("--app <app>", "The app to roll back").option("--atomic", "Roll back every app that has an earlier release").action(async (options) => {
16621
16702
  try {
16622
16703
  const { rollbackStage } = await import("./rollback-BQgEdr_p.mjs").then((n) => n.a);
16623
- const { terminalCredentials } = await import("./terminal-mXM-Lqc6.mjs");
16704
+ const { terminalCredentials } = await import("./terminal-CybB-cjk.mjs");
16624
16705
  const globalOptions = program.opts();
16625
16706
  await rollbackStage({
16626
16707
  cwd: resolve(globalOptions.cwd ?? process.cwd()),
@@ -16634,6 +16715,16 @@ program.command("deploy:rollback").description("Put a stage's app back on its pr
16634
16715
  exitWithError(error);
16635
16716
  }
16636
16717
  });
16718
+ program.command("compose:server").description("Set up a stage's server for compose deploys: harden it (SSH keys only, no root login, firewall, security updates, fail2ban), install Docker, create the deploy user, and give its key to GitHub").requiredOption("--stage <stage>", "A deployed stage from gkm.config.ts").option("--admin <user>", "The sudo user you log in to the server as — never root (asked when absent)").option("--key-file <path>", "The deploy key pair (default: ~/.ssh/gkm-<project>-<stage>)").option("--repo <owner/name>", "GitHub repository (default: this one)").option("--no-github", "Leave the GitHub environment's key and host alone").option("--yes", "Set the server up without asking first").option("--dry-run", "Print the plan and the script; connect to nothing").action(async (options) => {
16719
+ try {
16720
+ const globalOptions = program.opts();
16721
+ if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16722
+ const { composeServerCommand } = await import("./serverSetup--O61SRvg.mjs");
16723
+ await composeServerCommand(options);
16724
+ } catch (error) {
16725
+ exitWithError(error);
16726
+ }
16727
+ });
16637
16728
  program.command("deploy:init").description("Initialize Dokploy deployment (create project and application)").option("--endpoint <url>", "Dokploy server URL (uses stored credentials if logged in)").requiredOption("--project <name>", "Project name (creates if not exists)").requiredOption("--app <name>", "Application name").option("--project-id <id>", "Use existing project ID instead of creating").option("--registry-id <id>", "Configure registry for the application").action(async (options) => {
16638
16729
  try {
16639
16730
  const globalOptions = program.opts();
@@ -16653,7 +16744,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
16653
16744
  try {
16654
16745
  const globalOptions = program.opts();
16655
16746
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16656
- const { deployGithubCommand } = await import("./github-D2eABlxM.mjs");
16747
+ const { deployGithubCommand } = await import("./github-BMakI-k3.mjs");
16657
16748
  await deployGithubCommand(options);
16658
16749
  } catch (error) {
16659
16750
  exitWithError(error);
@@ -16832,6 +16923,6 @@ try {
16832
16923
  }
16833
16924
  program.parse();
16834
16925
  //#endregion
16835
- export { formatError as a, prompt as c, stamp as i, mobileStage as n, validateDokployToken as o, slug as r, canPrompt as s, generateFullstackCustomSecrets as t };
16926
+ export { slug as a, validateDokployToken as c, easWorkflowPath as i, canPrompt as l, mobileStage as n, stamp as o, easWorkflow as r, formatError as s, generateFullstackCustomSecrets as t, prompt as u };
16836
16927
 
16837
16928
  //# sourceMappingURL=index.mjs.map