@geekmidas/cli 1.10.12 → 1.10.13

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.
package/dist/index.mjs CHANGED
@@ -35,7 +35,7 @@ import prompts from "prompts";
35
35
 
36
36
  //#region package.json
37
37
  var name = "@geekmidas/cli";
38
- var version = "1.10.11";
38
+ var version = "1.10.12";
39
39
  var description = "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs";
40
40
  var private$1 = false;
41
41
  var type = "module";
@@ -7223,6 +7223,28 @@ function generateDockerFiles(options, template, dbApps) {
7223
7223
  - '\${MAILPIT_UI_HOST_PORT:-8025}:8025'
7224
7224
  environment:
7225
7225
  MP_SMTP_AUTH: \${SMTP_USER:-${options.name}}:\${SMTP_PASS:-${options.name}}`);
7226
+ if (options.services?.storage) {
7227
+ services.push(` minio:
7228
+ image: minio/minio:latest
7229
+ container_name: ${options.name}-minio
7230
+ restart: unless-stopped
7231
+ entrypoint: sh
7232
+ command: -c 'mkdir -p /data/\${STORAGE_BUCKET:-${options.name}} && /usr/bin/docker-entrypoint.sh server --console-address ":9001" /data'
7233
+ environment:
7234
+ MINIO_ROOT_USER: \${STORAGE_ACCESS_KEY_ID:-${options.name}}
7235
+ MINIO_ROOT_PASSWORD: \${STORAGE_SECRET_ACCESS_KEY:-${options.name}}
7236
+ ports:
7237
+ - '\${MINIO_API_HOST_PORT:-9000}:9000'
7238
+ - '\${MINIO_CONSOLE_HOST_PORT:-9001}:9001'
7239
+ volumes:
7240
+ - minio_data:/data
7241
+ healthcheck:
7242
+ test: ['CMD', 'mc', 'ready', 'local']
7243
+ interval: 10s
7244
+ timeout: 5s
7245
+ retries: 5`);
7246
+ volumes.push(" minio_data:");
7247
+ }
7226
7248
  let dockerCompose = `# Use "gkm dev" or "gkm test" to start services.
7227
7249
  # Running "docker compose up" directly will not inject secrets or resolve ports.
7228
7250
  services:
@@ -8780,6 +8802,11 @@ const servicesChoices = [
8780
8802
  title: "Mailpit",
8781
8803
  value: "mail",
8782
8804
  description: "Email testing service (dev only)"
8805
+ },
8806
+ {
8807
+ title: "MinIO",
8808
+ value: "storage",
8809
+ description: "S3-compatible object storage (dev only)"
8783
8810
  }
8784
8811
  ];
8785
8812
  /**
@@ -10949,12 +10976,14 @@ async function initCommand(projectName, options = {}) {
10949
10976
  const servicesArray = options.yes ? [
10950
10977
  "db",
10951
10978
  "cache",
10952
- "mail"
10979
+ "mail",
10980
+ "storage"
10953
10981
  ] : answers.services || [];
10954
10982
  const services = {
10955
10983
  db: servicesArray.includes("db"),
10956
10984
  cache: servicesArray.includes("cache"),
10957
- mail: servicesArray.includes("mail")
10985
+ mail: servicesArray.includes("mail"),
10986
+ storage: servicesArray.includes("storage")
10958
10987
  };
10959
10988
  const pkgManager = options.pm ? options.pm : options.yes ? "pnpm" : answers.packageManager ?? detectedPkgManager;
10960
10989
  const deployTarget = options.yes ? "dokploy" : answers.deployTarget ?? "dokploy";
@@ -11459,6 +11488,10 @@ function reconcileSecrets(secrets, workspace) {
11459
11488
  {
11460
11489
  key: "storage",
11461
11490
  name: "minio"
11491
+ },
11492
+ {
11493
+ key: "mail",
11494
+ name: "mailpit"
11462
11495
  }
11463
11496
  ];
11464
11497
  for (const { key, name: name$1 } of serviceMap) if (workspace.services[key] && !result.services[name$1]) {
@@ -11509,6 +11542,7 @@ async function generateFreshSecrets(stage, workspace, options) {
11509
11542
  if (workspace.services.db) serviceNames.push("postgres");
11510
11543
  if (workspace.services.cache) serviceNames.push("redis");
11511
11544
  if (workspace.services.storage) serviceNames.push("minio");
11545
+ if (workspace.services.mail) serviceNames.push("mailpit");
11512
11546
  const secrets = createStageSecrets(stage, serviceNames, { projectName: workspace.name });
11513
11547
  const isMultiApp = Object.keys(workspace.apps).length > 1;
11514
11548
  if (isMultiApp) {
@@ -11611,6 +11645,16 @@ async function testCommand(options = {}) {
11611
11645
  if (resolvedPorts.mappings.length > 0) {
11612
11646
  secretsEnv = rewriteUrlsWithPorts(secretsEnv, resolvedPorts);
11613
11647
  console.log(` 🔌 Applied ${Object.keys(resolvedPorts.ports).length} port mapping(s)`);
11648
+ } else {
11649
+ const ports = await loadPortState(cwd);
11650
+ if (Object.keys(ports).length > 0) {
11651
+ secretsEnv = rewriteUrlsWithPorts(secretsEnv, {
11652
+ dockerEnv: {},
11653
+ ports,
11654
+ mappings
11655
+ });
11656
+ console.log(` 🔌 Applied ${Object.keys(ports).length} port mapping(s)`);
11657
+ }
11614
11658
  }
11615
11659
  }
11616
11660
  }