@geekmidas/cli 1.10.12 → 1.10.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @geekmidas/cli
2
2
 
3
+ ## 1.10.14
4
+
5
+ ### Patch Changes
6
+
7
+ - 🐛 Fix smtp resolution ports
8
+
9
+ ## 1.10.13
10
+
11
+ ### Patch Changes
12
+
13
+ - ✨ [`a2738e2`](https://github.com/geekmidas/toolbox/commit/a2738e23c47ab4291284d7c1abffb97f9665cfe5) Thanks [@geekmidas](https://github.com/geekmidas)! - Add mailpit credentails to reconsiliation
14
+
3
15
  ## 1.10.12
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -35,7 +35,7 @@ const prompts = require_chunk.__toESM(require("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.13";
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";
@@ -3064,8 +3064,8 @@ services:
3064
3064
  environment:
3065
3065
  MP_SMTP_AUTH: \${SMTP_USER:-${imageName}}:\${SMTP_PASS:-${imageName}}
3066
3066
  ports:
3067
- - "\${MAILPIT_UI_PORT:-8025}:8025" # Web UI
3068
- - "\${MAILPIT_SMTP_PORT:-1025}:1025" # SMTP
3067
+ - "\${MAILPIT_PORT:-8025}:8025" # Web UI / API
3068
+ - "\${SMTP_PORT:-1025}:1025" # SMTP
3069
3069
  healthcheck:
3070
3070
  test: ["CMD", "wget", "-q", "--spider", "http://localhost:8025"]
3071
3071
  interval: 5s
@@ -3199,8 +3199,8 @@ services:
3199
3199
  environment:
3200
3200
  MP_SMTP_AUTH: \${SMTP_USER:-${workspace.name}}:\${SMTP_PASS:-${workspace.name}}
3201
3201
  ports:
3202
- - "\${MAILPIT_UI_PORT:-8025}:8025" # Web UI
3203
- - "\${MAILPIT_SMTP_PORT:-1025}:1025" # SMTP
3202
+ - "\${MAILPIT_PORT:-8025}:8025" # Web UI / API
3203
+ - "\${SMTP_PORT:-1025}:1025" # SMTP
3204
3204
  healthcheck:
3205
3205
  test: ["CMD", "wget", "-q", "--spider", "http://localhost:8025"]
3206
3206
  interval: 5s
@@ -7219,10 +7219,32 @@ function generateDockerFiles(options, template, dbApps) {
7219
7219
  container_name: ${options.name}-mailpit
7220
7220
  restart: unless-stopped
7221
7221
  ports:
7222
- - '\${MAILPIT_SMTP_HOST_PORT:-1025}:1025'
7223
- - '\${MAILPIT_UI_HOST_PORT:-8025}:8025'
7222
+ - '\${SMTP_PORT:-1025}:1025'
7223
+ - '\${MAILPIT_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 = require_fullstack_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
  }