@geekmidas/cli 0.35.0 → 0.36.0
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.cjs +18 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +18 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dev/index.ts +23 -10
package/package.json
CHANGED
package/src/dev/index.ts
CHANGED
|
@@ -1312,7 +1312,7 @@ await import('${entryPath}');
|
|
|
1312
1312
|
* Does not require gkm.config.ts.
|
|
1313
1313
|
*/
|
|
1314
1314
|
async function entryDevCommand(options: DevOptions): Promise<void> {
|
|
1315
|
-
const { entry,
|
|
1315
|
+
const { entry, watch = true } = options;
|
|
1316
1316
|
|
|
1317
1317
|
if (!entry) {
|
|
1318
1318
|
throw new Error('--entry requires a file path');
|
|
@@ -1324,24 +1324,37 @@ async function entryDevCommand(options: DevOptions): Promise<void> {
|
|
|
1324
1324
|
throw new Error(`Entry file not found: ${entryPath}`);
|
|
1325
1325
|
}
|
|
1326
1326
|
|
|
1327
|
-
logger.log(`🚀 Starting entry file: ${entry}`);
|
|
1328
|
-
|
|
1329
1327
|
// Load .env files
|
|
1330
1328
|
const defaultEnv = loadEnvFiles('.env');
|
|
1331
1329
|
if (defaultEnv.loaded.length > 0) {
|
|
1332
1330
|
logger.log(`📦 Loaded env: ${defaultEnv.loaded.join(', ')}`);
|
|
1333
1331
|
}
|
|
1334
1332
|
|
|
1335
|
-
//
|
|
1336
|
-
|
|
1337
|
-
|
|
1333
|
+
// Try to get workspace app config for port and secrets
|
|
1334
|
+
let workspaceAppPort: number | undefined;
|
|
1335
|
+
let secretsRoot: string = process.cwd();
|
|
1336
|
+
let appName: string | undefined;
|
|
1338
1337
|
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1338
|
+
try {
|
|
1339
|
+
const appConfig = await loadAppConfig();
|
|
1340
|
+
workspaceAppPort = appConfig.app.port;
|
|
1341
|
+
secretsRoot = appConfig.workspaceRoot;
|
|
1342
|
+
appName = appConfig.appName;
|
|
1343
|
+
logger.log(`📦 App: ${appName} (port ${workspaceAppPort})`);
|
|
1344
|
+
} catch {
|
|
1345
|
+
// Not in a workspace - use defaults
|
|
1346
|
+
secretsRoot = findSecretsRoot(process.cwd());
|
|
1347
|
+
appName = getAppNameFromCwd() ?? undefined;
|
|
1348
|
+
if (appName) {
|
|
1349
|
+
logger.log(`📦 App name: ${appName}`);
|
|
1350
|
+
}
|
|
1343
1351
|
}
|
|
1344
1352
|
|
|
1353
|
+
// Determine port: explicit --port > workspace config > default 3000
|
|
1354
|
+
const port = options.port ?? workspaceAppPort ?? 3000;
|
|
1355
|
+
|
|
1356
|
+
logger.log(`🚀 Starting entry file: ${entry} on port ${port}`);
|
|
1357
|
+
|
|
1345
1358
|
// Load secrets
|
|
1346
1359
|
const appSecrets = await loadSecretsForApp(secretsRoot, appName);
|
|
1347
1360
|
if (Object.keys(appSecrets).length > 0) {
|