@geekmidas/cli 1.10.1 → 1.10.3

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.3
4
+
5
+ ### Patch Changes
6
+
7
+ - šŸ› [`6a92fa7`](https://github.com/geekmidas/toolbox/commit/6a92fa737057d77178a4d31480505013fbe033af) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix dev scripts and spawns also when canceling prcocess.
8
+
9
+ ## 1.10.2
10
+
11
+ ### Patch Changes
12
+
13
+ - šŸ› [`fefefe0`](https://github.com/geekmidas/toolbox/commit/fefefe0e7825d95c333375ea280e9aba23599bf0) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix issue with env loading on docker during setup
14
+
3
15
  ## 1.10.1
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.0";
38
+ var version = "1.10.2";
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";
@@ -1345,7 +1345,8 @@ async function workspaceDevCommand(workspace, options) {
1345
1345
  ], {
1346
1346
  cwd: workspace.root,
1347
1347
  stdio: "inherit",
1348
- env: turboEnv
1348
+ env: turboEnv,
1349
+ detached: true
1349
1350
  });
1350
1351
  let openApiWatcher = null;
1351
1352
  if (frontendApps.length > 0 && backendApps.length > 0) {
@@ -1391,14 +1392,24 @@ async function workspaceDevCommand(workspace, options) {
1391
1392
  isShuttingDown = true;
1392
1393
  logger$11.log("\nšŸ›‘ Shutting down workspace...");
1393
1394
  if (openApiWatcher) openApiWatcher.close().catch(() => {});
1394
- if (turboProcess.pid) try {
1395
- process.kill(-turboProcess.pid, "SIGTERM");
1395
+ const pid = turboProcess.pid;
1396
+ if (pid) try {
1397
+ process.kill(-pid, "SIGTERM");
1396
1398
  } catch {
1397
- turboProcess.kill("SIGTERM");
1399
+ try {
1400
+ process.kill(pid, "SIGTERM");
1401
+ } catch {}
1398
1402
  }
1399
1403
  setTimeout(() => {
1404
+ if (pid) try {
1405
+ process.kill(-pid, "SIGKILL");
1406
+ } catch {
1407
+ try {
1408
+ process.kill(pid, "SIGKILL");
1409
+ } catch {}
1410
+ }
1400
1411
  process.exit(0);
1401
- }, 2e3);
1412
+ }, 3e3);
1402
1413
  };
1403
1414
  process.on("SIGINT", shutdown);
1404
1415
  process.on("SIGTERM", shutdown);
@@ -6471,7 +6482,7 @@ const GEEKMIDAS_VERSIONS = {
6471
6482
  "@geekmidas/cache": "~1.1.0",
6472
6483
  "@geekmidas/client": "~4.0.0",
6473
6484
  "@geekmidas/cloud": "~1.0.0",
6474
- "@geekmidas/constructs": "~3.0.0",
6485
+ "@geekmidas/constructs": "~3.0.2",
6475
6486
  "@geekmidas/db": "~1.0.0",
6476
6487
  "@geekmidas/emailkit": "~1.0.0",
6477
6488
  "@geekmidas/envkit": "~1.0.3",
@@ -11194,7 +11205,8 @@ async function setupCommand(options = {}) {
11194
11205
  const composeFile = (0, node_path.join)(workspace.root, "docker-compose.yml");
11195
11206
  if ((0, node_fs.existsSync)(composeFile)) {
11196
11207
  logger$1.log("");
11197
- await startWorkspaceServices(workspace);
11208
+ const resolvedPorts = await resolveServicePorts(workspace.root);
11209
+ await startWorkspaceServices(workspace, resolvedPorts.dockerEnv);
11198
11210
  } else logger$1.log("āš ļø No docker-compose.yml found. Skipping Docker services.");
11199
11211
  }
11200
11212
  printSummary(workspace, stage);
@@ -11215,7 +11227,11 @@ async function resolveSecrets(stage, workspace, options) {
11215
11227
  if (require_storage.secretsExist(stage, workspace.root)) {
11216
11228
  logger$1.log("šŸ” Using existing local secrets");
11217
11229
  const secrets = await require_storage.readStageSecrets(stage, workspace.root);
11218
- if (secrets) return secrets;
11230
+ if (secrets) {
11231
+ const reconciled = reconcileSecrets(secrets, workspace);
11232
+ if (reconciled) await require_storage.writeStageSecrets(reconciled, workspace.root);
11233
+ return reconciled ?? secrets;
11234
+ }
11219
11235
  }
11220
11236
  if (require_sync.isSSMConfigured(workspace)) {
11221
11237
  logger$1.log("ā˜ļø Checking for remote secrets in SSM...");
@@ -11235,6 +11251,29 @@ async function resolveSecrets(stage, workspace, options) {
11235
11251
  return generateFreshSecrets(stage, workspace, options);
11236
11252
  }
11237
11253
  /**
11254
+ * Reconcile existing secrets with expected workspace-derived keys.
11255
+ * Adds missing keys (e.g. BETTER_AUTH_*) without overwriting existing values.
11256
+ * Returns the updated secrets if changes were made, or null if no changes needed.
11257
+ * @internal Exported for testing
11258
+ */
11259
+ function reconcileSecrets(secrets, workspace) {
11260
+ const isMultiApp = Object.keys(workspace.apps).length > 1;
11261
+ if (!isMultiApp) return null;
11262
+ const expected = require_fullstack_secrets.generateFullstackCustomSecrets(workspace);
11263
+ const missing = {};
11264
+ for (const [key, value] of Object.entries(expected)) if (!(key in secrets.custom)) missing[key] = value;
11265
+ if (Object.keys(missing).length === 0) return null;
11266
+ logger$1.log(` šŸ”„ Adding missing secrets: ${Object.keys(missing).join(", ")}`);
11267
+ return {
11268
+ ...secrets,
11269
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
11270
+ custom: {
11271
+ ...secrets.custom,
11272
+ ...missing
11273
+ }
11274
+ };
11275
+ }
11276
+ /**
11238
11277
  * Generate fresh secrets for the workspace.
11239
11278
  */
11240
11279
  async function generateFreshSecrets(stage, workspace, options) {