@geekmidas/cli 1.10.21 → 1.10.22
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 +6 -0
- package/bin/gkm.mjs +30 -0
- package/dist/index.cjs +25 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +25 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/dev/index.ts +29 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/cli",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.22",
|
|
4
4
|
"description": "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"bin": {
|
|
35
|
-
"gkm": "./
|
|
35
|
+
"gkm": "./bin/gkm.mjs"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
package/src/dev/index.ts
CHANGED
|
@@ -1288,7 +1288,11 @@ class EntryRunner {
|
|
|
1288
1288
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
1289
1289
|
|
|
1290
1290
|
if (this.isRunning) {
|
|
1291
|
-
logger.log(
|
|
1291
|
+
logger.log('');
|
|
1292
|
+
logger.log(
|
|
1293
|
+
` \x1b[32m✓ Ready\x1b[0m at \x1b[36mhttp://localhost:${this.port}\x1b[0m`,
|
|
1294
|
+
);
|
|
1295
|
+
logger.log('');
|
|
1292
1296
|
}
|
|
1293
1297
|
}
|
|
1294
1298
|
|
|
@@ -1407,6 +1411,7 @@ class DevServer {
|
|
|
1407
1411
|
private serverProcess: ChildProcess | null = null;
|
|
1408
1412
|
private isRunning = false;
|
|
1409
1413
|
private actualPort: number;
|
|
1414
|
+
private startTime = Date.now();
|
|
1410
1415
|
|
|
1411
1416
|
constructor(
|
|
1412
1417
|
private provider: LegacyProvider,
|
|
@@ -1423,6 +1428,7 @@ class DevServer {
|
|
|
1423
1428
|
}
|
|
1424
1429
|
|
|
1425
1430
|
async start(): Promise<void> {
|
|
1431
|
+
this.startTime = Date.now();
|
|
1426
1432
|
if (this.isRunning) {
|
|
1427
1433
|
await this.stop();
|
|
1428
1434
|
}
|
|
@@ -1459,7 +1465,7 @@ class DevServer {
|
|
|
1459
1465
|
// Create server entry file
|
|
1460
1466
|
await this.createServerEntry();
|
|
1461
1467
|
|
|
1462
|
-
logger.log(`\n
|
|
1468
|
+
logger.log(`\n⏳ Starting server...`);
|
|
1463
1469
|
|
|
1464
1470
|
// Start the server using tsx (TypeScript execution)
|
|
1465
1471
|
// Use detached: true so we can kill the entire process tree
|
|
@@ -1490,22 +1496,33 @@ class DevServer {
|
|
|
1490
1496
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
1491
1497
|
|
|
1492
1498
|
if (this.isRunning) {
|
|
1493
|
-
|
|
1499
|
+
const base = `http://localhost:${this.actualPort}`;
|
|
1500
|
+
const lines: string[] = [` Local: ${base}`];
|
|
1494
1501
|
if (this.enableOpenApi) {
|
|
1495
|
-
|
|
1496
|
-
`📚 API Docs available at http://localhost:${this.actualPort}/__docs`,
|
|
1497
|
-
);
|
|
1502
|
+
lines.push(` API Docs: ${base}/__docs`);
|
|
1498
1503
|
}
|
|
1499
1504
|
if (this.telescope) {
|
|
1500
|
-
|
|
1501
|
-
`🔭 Telescope available at http://localhost:${this.actualPort}${this.telescope.path}`,
|
|
1502
|
-
);
|
|
1505
|
+
lines.push(` Telescope: ${base}${this.telescope.path}`);
|
|
1503
1506
|
}
|
|
1504
1507
|
if (this.studio) {
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
+
lines.push(` Studio: ${base}${this.studio.path}`);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
const maxLen = Math.max(...lines.map((l) => l.length));
|
|
1512
|
+
const pad = (s: string) => s.padEnd(maxLen);
|
|
1513
|
+
const border = '─'.repeat(maxLen + 2);
|
|
1514
|
+
|
|
1515
|
+
logger.log('');
|
|
1516
|
+
logger.log(
|
|
1517
|
+
` \x1b[32m✓ Ready\x1b[0m in ${((Date.now() - this.startTime) / 1000).toFixed(1)}s`,
|
|
1518
|
+
);
|
|
1519
|
+
logger.log('');
|
|
1520
|
+
logger.log(` ┌${border}┐`);
|
|
1521
|
+
for (const line of lines) {
|
|
1522
|
+
logger.log(` │ ${pad(line)} │`);
|
|
1508
1523
|
}
|
|
1524
|
+
logger.log(` └${border}┘`);
|
|
1525
|
+
logger.log('');
|
|
1509
1526
|
}
|
|
1510
1527
|
}
|
|
1511
1528
|
|