tlc-claude-code 1.8.3 → 1.8.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlc-claude-code",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "TLC - Test Led Coding for Claude Code",
5
5
  "bin": {
6
6
  "tlc": "./bin/tlc.js",
package/server/index.js CHANGED
@@ -57,6 +57,7 @@ const EXTERNAL_APP_PORT = parseInt(process.env.TLC_APP_PORT || '5000');
57
57
  // State
58
58
  let appProcess = null;
59
59
  let appPort = 3000;
60
+ let appIsDocker = false; // true when app is Docker-managed (no local process)
60
61
  let wsClients = new Set();
61
62
  const logs = { app: [], test: [], git: [] };
62
63
  const commandHistory = [];
@@ -485,6 +486,19 @@ async function startApp() {
485
486
 
486
487
  appPort = project.port;
487
488
  addLog('app', `Detected: ${project.name}`, 'info');
489
+
490
+ // Docker-managed apps: don't spawn, just proxy
491
+ if (project.type === 'docker') {
492
+ appIsDocker = true;
493
+ addLog('app', `App is Docker-managed — proxying to port ${appPort}`, 'info');
494
+ if (project.url) {
495
+ addLog('app', `App URL: ${project.url}`, 'info');
496
+ }
497
+ addLog('app', 'TLC will not spawn the app. Use Docker to manage it.', 'info');
498
+ broadcast('app-start', { port: appPort });
499
+ return;
500
+ }
501
+
488
502
  addLog('app', `Command: ${project.cmd} ${project.args.join(' ')}`, 'info');
489
503
  addLog('app', `Port: ${appPort}`, 'info');
490
504
 
@@ -673,7 +687,7 @@ app.get('/api/status', (req, res) => {
673
687
  const plan = parsePlan(PROJECT_DIR);
674
688
 
675
689
  res.json({
676
- appRunning: appProcess !== null,
690
+ appRunning: appProcess !== null || appIsDocker,
677
691
  appPort,
678
692
  testsPass: plan.testsPass || 0,
679
693
  testsFail: plan.testsFail || 0,
@@ -1087,7 +1101,7 @@ app.get('/api/health', (req, res) => {
1087
1101
  heapUsed: memUsage.heapUsed,
1088
1102
  heapTotal: memUsage.heapTotal,
1089
1103
  },
1090
- appRunning: appProcess !== null,
1104
+ appRunning: appProcess !== null || appIsDocker,
1091
1105
  appPort,
1092
1106
  });
1093
1107
  });
@@ -1486,7 +1500,7 @@ function getHealthData() {
1486
1500
  memory: memUsed,
1487
1501
  cpu: Math.min(cpuPercent, 100),
1488
1502
  uptime: process.uptime(),
1489
- appRunning: appProcess !== null,
1503
+ appRunning: appProcess !== null || appIsDocker,
1490
1504
  appPort: appPort
1491
1505
  };
1492
1506
  }
@@ -10,6 +10,33 @@ function detectProject(projectDir) {
10
10
  if (fs.existsSync(tlcConfigPath)) {
11
11
  try {
12
12
  const config = JSON.parse(fs.readFileSync(tlcConfigPath, 'utf-8'));
13
+
14
+ // Check devServer config (Docker-managed apps)
15
+ if (config.devServer) {
16
+ if (config.devServer.type === 'docker') {
17
+ return {
18
+ name: 'Docker-managed (' + (config.devServer.containerName || 'docker') + ')',
19
+ type: 'docker',
20
+ cmd: null,
21
+ args: [],
22
+ port: config.devServer.port || config.devServer.internalPort || 5000,
23
+ healthCheck: config.devServer.healthCheck || null,
24
+ url: config.devServer.url || null
25
+ };
26
+ }
27
+ // Non-docker devServer with explicit start command
28
+ if (config.devServer.startCommand) {
29
+ const parts = config.devServer.startCommand.split(' ');
30
+ return {
31
+ name: 'Custom (.tlc.json devServer)',
32
+ cmd: parts[0],
33
+ args: parts.slice(1),
34
+ port: config.devServer.port || 3000
35
+ };
36
+ }
37
+ }
38
+
39
+ // Legacy: check server config
13
40
  if (config.server?.startCommand) {
14
41
  const parts = config.server.startCommand.split(' ');
15
42
  return {