tlc-claude-code 0.9.4 → 0.9.6
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/README.md +1 -1
- package/bin/init.js +94 -39
- package/docker-compose.dev.yml +7 -7
- package/package.json +1 -1
- package/server/dashboard/index.html +2 -2
- package/server.md +1 -1
- package/start-dev.ps1 +1 -1
- package/start-dev.sh +1 -1
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ tlc init
|
|
|
154
154
|
| URL | Service |
|
|
155
155
|
|-----|---------|
|
|
156
156
|
| http://localhost:3147 | Dashboard — Live preview, logs, tasks |
|
|
157
|
-
| http://localhost:
|
|
157
|
+
| http://localhost:5001 | App — Your running application |
|
|
158
158
|
| http://localhost:8080 | DB Admin — Database GUI (Adminer) |
|
|
159
159
|
| localhost:5433 | Database — PostgreSQL |
|
|
160
160
|
|
package/bin/init.js
CHANGED
|
@@ -18,7 +18,7 @@ const batContent = `@echo off
|
|
|
18
18
|
:: Double-click to start your dev environment
|
|
19
19
|
::
|
|
20
20
|
:: Dashboard: http://localhost:3147
|
|
21
|
-
:: App: http://localhost:
|
|
21
|
+
:: App: http://localhost:5001
|
|
22
22
|
:: DB Admin: http://localhost:8080
|
|
23
23
|
:: Database: localhost:5433
|
|
24
24
|
:: ========================================
|
|
@@ -63,53 +63,60 @@ const shContent = `#!/bin/bash
|
|
|
63
63
|
# TLC Dev Server Launcher
|
|
64
64
|
# ========================================
|
|
65
65
|
# Dashboard: http://localhost:3147
|
|
66
|
-
# App: http://localhost:
|
|
66
|
+
# App: http://localhost:5001
|
|
67
67
|
# DB Admin: http://localhost:8080
|
|
68
68
|
# Database: localhost:5433
|
|
69
69
|
# ========================================
|
|
70
70
|
|
|
71
71
|
set -e
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
TLC_DIR=""
|
|
75
|
-
LOCATIONS=(
|
|
76
|
-
"$HOME/.nvm/versions/node/*/lib/node_modules/tlc-claude-code"
|
|
77
|
-
"/usr/local/lib/node_modules/tlc-claude-code"
|
|
78
|
-
"/usr/lib/node_modules/tlc-claude-code"
|
|
79
|
-
"$HOME/.npm-global/lib/node_modules/tlc-claude-code"
|
|
80
|
-
)
|
|
73
|
+
PROJECT_PATH="$(cd "$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
|
|
74
|
+
TLC_DIR="$PROJECT_PATH/.tlc"
|
|
81
75
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
TLC_DIR="$NPM_ROOT/tlc-claude-code"
|
|
76
|
+
if [ ! -f "$TLC_DIR/docker-compose.dev.yml" ]; then
|
|
77
|
+
echo "[TLC] ERROR: .tlc folder not found. Run: tlc init"
|
|
78
|
+
exit 1
|
|
86
79
|
fi
|
|
87
80
|
|
|
88
|
-
# Check
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
81
|
+
# Check Docker
|
|
82
|
+
echo "[TLC] Checking Docker..."
|
|
83
|
+
if ! docker info >/dev/null 2>&1; then
|
|
84
|
+
echo "[TLC] Starting Docker..."
|
|
85
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
86
|
+
open -a Docker
|
|
87
|
+
fi
|
|
88
|
+
echo "[TLC] Waiting for Docker..."
|
|
89
|
+
for i in {1..30}; do
|
|
90
|
+
sleep 2
|
|
91
|
+
docker info >/dev/null 2>&1 && break
|
|
92
|
+
printf "."
|
|
97
93
|
done
|
|
94
|
+
echo ""
|
|
98
95
|
fi
|
|
99
96
|
|
|
100
|
-
if
|
|
101
|
-
echo "[TLC] ERROR:
|
|
102
|
-
echo "[TLC] Install with: npm install -g tlc-claude-code"
|
|
97
|
+
if ! docker info >/dev/null 2>&1; then
|
|
98
|
+
echo "[TLC] ERROR: Docker not running"
|
|
103
99
|
exit 1
|
|
104
100
|
fi
|
|
105
101
|
|
|
106
|
-
|
|
102
|
+
echo "[TLC] Docker ready!"
|
|
103
|
+
|
|
104
|
+
PROJECT_NAME=$(basename "$PROJECT_PATH" | tr '[:upper:]' '[:lower:]' | tr -cd 'a-z0-9')
|
|
105
|
+
export PROJECT_DIR="$PROJECT_PATH"
|
|
106
|
+
export COMPOSE_PROJECT_NAME="\${PROJECT_NAME:-dev}"
|
|
107
107
|
|
|
108
|
-
echo "[TLC]
|
|
109
|
-
echo "
|
|
108
|
+
echo "[TLC] Project: $PROJECT_PATH"
|
|
109
|
+
echo ""
|
|
110
|
+
echo "[TLC] Starting services..."
|
|
111
|
+
echo " Dashboard: http://localhost:3147"
|
|
112
|
+
echo " App: http://localhost:5001"
|
|
113
|
+
echo " DB Admin: http://localhost:8080"
|
|
114
|
+
echo ""
|
|
115
|
+
echo "[TLC] Press Ctrl+C to stop"
|
|
110
116
|
echo ""
|
|
111
117
|
|
|
112
|
-
|
|
118
|
+
cd "$TLC_DIR"
|
|
119
|
+
docker-compose -f docker-compose.dev.yml up --build
|
|
113
120
|
`;
|
|
114
121
|
|
|
115
122
|
// Detect OS - WSL counts as Windows since user will double-click .bat from Explorer
|
|
@@ -118,10 +125,11 @@ const isWindows = process.platform === 'win32' || isWSL;
|
|
|
118
125
|
const launcherFile = isWindows ? 'tlc-start.bat' : 'tlc-start.sh';
|
|
119
126
|
const launcherPath = path.join(projectDir, launcherFile);
|
|
120
127
|
|
|
121
|
-
// FAST PATH: If launcher
|
|
122
|
-
|
|
128
|
+
// FAST PATH: If launcher and .tlc folder exist, just confirm and exit
|
|
129
|
+
const tlcFolderExists = fs.existsSync(path.join(projectDir, '.tlc', 'docker-compose.dev.yml'));
|
|
130
|
+
if (fs.existsSync(launcherPath) && tlcFolderExists) {
|
|
123
131
|
console.log('');
|
|
124
|
-
console.log(`[TLC] Already initialized
|
|
132
|
+
console.log(`[TLC] Already initialized.`);
|
|
125
133
|
console.log('');
|
|
126
134
|
if (isWindows) {
|
|
127
135
|
console.log('[TLC] To start: Double-click ' + launcherFile);
|
|
@@ -160,19 +168,66 @@ if (isWindows) {
|
|
|
160
168
|
console.log('[TLC] Note: Full macOS/Linux support coming soon!');
|
|
161
169
|
}
|
|
162
170
|
|
|
171
|
+
// Copy TLC files to project's .tlc/ directory for Docker access
|
|
172
|
+
const tlcLocalDir = path.join(projectDir, '.tlc');
|
|
173
|
+
const tlcInstallDir = path.join(__dirname, '..');
|
|
174
|
+
|
|
175
|
+
if (!fs.existsSync(tlcLocalDir)) {
|
|
176
|
+
fs.mkdirSync(tlcLocalDir, { recursive: true });
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Copy server folder
|
|
180
|
+
const serverSrc = path.join(tlcInstallDir, 'server');
|
|
181
|
+
const serverDest = path.join(tlcLocalDir, 'server');
|
|
182
|
+
if (fs.existsSync(serverSrc)) {
|
|
183
|
+
copyDirSync(serverSrc, serverDest);
|
|
184
|
+
console.log('[TLC] Copied server to .tlc/server');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Copy docker-compose.dev.yml
|
|
188
|
+
const composeSrc = path.join(tlcInstallDir, 'docker-compose.dev.yml');
|
|
189
|
+
const composeDest = path.join(tlcLocalDir, 'docker-compose.dev.yml');
|
|
190
|
+
if (fs.existsSync(composeSrc)) {
|
|
191
|
+
fs.copyFileSync(composeSrc, composeDest);
|
|
192
|
+
console.log('[TLC] Copied docker-compose.dev.yml to .tlc/');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Helper to copy directory recursively
|
|
196
|
+
function copyDirSync(src, dest) {
|
|
197
|
+
if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
|
|
198
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
199
|
+
const srcPath = path.join(src, entry.name);
|
|
200
|
+
const destPath = path.join(dest, entry.name);
|
|
201
|
+
if (entry.name === 'node_modules') continue; // Skip node_modules
|
|
202
|
+
if (entry.isDirectory()) {
|
|
203
|
+
copyDirSync(srcPath, destPath);
|
|
204
|
+
} else {
|
|
205
|
+
fs.copyFileSync(srcPath, destPath);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
163
210
|
// Add to .gitignore if not already there
|
|
164
211
|
const gitignorePath = path.join(projectDir, '.gitignore');
|
|
165
212
|
|
|
166
213
|
if (fs.existsSync(gitignorePath)) {
|
|
167
214
|
let gitignore = fs.readFileSync(gitignorePath, 'utf-8');
|
|
215
|
+
let updated = false;
|
|
168
216
|
if (!gitignore.includes('tlc-start')) {
|
|
169
|
-
gitignore += '
|
|
217
|
+
gitignore += '\n# TLC dev server (local only)\ntlc-start.*\n';
|
|
218
|
+
updated = true;
|
|
219
|
+
}
|
|
220
|
+
if (!gitignore.includes('.tlc/')) {
|
|
221
|
+
gitignore += '.tlc/\n';
|
|
222
|
+
updated = true;
|
|
223
|
+
}
|
|
224
|
+
if (updated) {
|
|
170
225
|
fs.writeFileSync(gitignorePath, gitignore);
|
|
171
|
-
console.log('[TLC]
|
|
226
|
+
console.log('[TLC] Updated .gitignore');
|
|
172
227
|
}
|
|
173
228
|
} else {
|
|
174
|
-
fs.writeFileSync(gitignorePath, '# TLC dev server
|
|
175
|
-
console.log('[TLC] Created .gitignore
|
|
229
|
+
fs.writeFileSync(gitignorePath, '# TLC dev server (local only)\ntlc-start.*\n.tlc/\n');
|
|
230
|
+
console.log('[TLC] Created .gitignore');
|
|
176
231
|
}
|
|
177
232
|
|
|
178
233
|
// Create/update .tlc.json if it doesn't exist
|
|
@@ -191,7 +246,7 @@ if (!fs.existsSync(tlcConfigPath)) {
|
|
|
191
246
|
const match = pkg.scripts.dev.match(/--port[=\\s]+(\\d+)/);
|
|
192
247
|
if (match) appPort = parseInt(match[1]);
|
|
193
248
|
}
|
|
194
|
-
if (pkg.scripts?.dev?.includes('
|
|
249
|
+
if (pkg.scripts?.dev?.includes('5001')) appPort = 5001;
|
|
195
250
|
if (pkg.scripts?.dev?.includes('3000')) appPort = 3000;
|
|
196
251
|
if (pkg.scripts?.dev?.includes('5173')) appPort = 5173;
|
|
197
252
|
} catch (e) {
|
|
@@ -228,7 +283,7 @@ if (isWindows) {
|
|
|
228
283
|
console.log('');
|
|
229
284
|
console.log('[TLC] Services when running:');
|
|
230
285
|
console.log(' Dashboard: http://localhost:3147');
|
|
231
|
-
console.log(' App: http://localhost:
|
|
286
|
+
console.log(' App: http://localhost:5001');
|
|
232
287
|
console.log(' DB Admin: http://localhost:8080');
|
|
233
288
|
console.log(' Database: localhost:5433');
|
|
234
289
|
console.log('');
|
package/docker-compose.dev.yml
CHANGED
|
@@ -36,11 +36,11 @@ services:
|
|
|
36
36
|
environment:
|
|
37
37
|
- NODE_ENV=development
|
|
38
38
|
- DATABASE_URL=postgres://postgres:postgres@db:5432/app
|
|
39
|
-
- PORT=
|
|
39
|
+
- PORT=5001
|
|
40
40
|
ports:
|
|
41
|
-
- "${APP_PORT:-
|
|
41
|
+
- "${APP_PORT:-5001}:5001"
|
|
42
42
|
volumes:
|
|
43
|
-
-
|
|
43
|
+
- ..:/app
|
|
44
44
|
- /app/node_modules
|
|
45
45
|
depends_on:
|
|
46
46
|
db:
|
|
@@ -69,12 +69,12 @@ services:
|
|
|
69
69
|
environment:
|
|
70
70
|
- TLC_PORT=3147
|
|
71
71
|
- TLC_PROXY_ONLY=true
|
|
72
|
-
- TLC_APP_PORT=
|
|
72
|
+
- TLC_APP_PORT=5001
|
|
73
73
|
ports:
|
|
74
74
|
- "${DASHBOARD_PORT:-3147}:3147"
|
|
75
75
|
volumes:
|
|
76
76
|
- ./server:/tlc/server
|
|
77
|
-
-
|
|
77
|
+
- ..:/project
|
|
78
78
|
depends_on:
|
|
79
79
|
- app
|
|
80
80
|
restart: on-failure
|
|
@@ -88,10 +88,10 @@ services:
|
|
|
88
88
|
- test
|
|
89
89
|
command: npx playwright test
|
|
90
90
|
environment:
|
|
91
|
-
- BASE_URL=http://app:
|
|
91
|
+
- BASE_URL=http://app:5001
|
|
92
92
|
- CI=true
|
|
93
93
|
volumes:
|
|
94
|
-
-
|
|
94
|
+
- ..:/app
|
|
95
95
|
depends_on:
|
|
96
96
|
- app
|
|
97
97
|
|
package/package.json
CHANGED
|
@@ -589,9 +589,9 @@
|
|
|
589
589
|
<div class="sidebar-section">
|
|
590
590
|
<h3>Links</h3>
|
|
591
591
|
<div class="links">
|
|
592
|
-
<a class="link" href="http://localhost:
|
|
592
|
+
<a class="link" href="http://localhost:5001" target="_blank">
|
|
593
593
|
<span>App</span>
|
|
594
|
-
<span class="url">:
|
|
594
|
+
<span class="url">:5001</span>
|
|
595
595
|
</a>
|
|
596
596
|
<a class="link" href="http://localhost:8080" target="_blank">
|
|
597
597
|
<span>Database Admin</span>
|
package/server.md
CHANGED
package/start-dev.ps1
CHANGED
|
@@ -81,7 +81,7 @@ Set-Location $scriptDir
|
|
|
81
81
|
Write-Host ""
|
|
82
82
|
Write-Host "[TLC] Starting services..." -ForegroundColor Yellow
|
|
83
83
|
Write-Host " Dashboard: http://localhost:3147" -ForegroundColor White
|
|
84
|
-
Write-Host " App: http://localhost:
|
|
84
|
+
Write-Host " App: http://localhost:5001" -ForegroundColor White
|
|
85
85
|
Write-Host " DB Admin: http://localhost:8080" -ForegroundColor White
|
|
86
86
|
Write-Host " Database: localhost:5433 (postgres/postgres)" -ForegroundColor Gray
|
|
87
87
|
Write-Host ""
|
package/start-dev.sh
CHANGED
|
@@ -76,7 +76,7 @@ cd "$SCRIPT_DIR"
|
|
|
76
76
|
echo ""
|
|
77
77
|
echo "[TLC] Starting services..."
|
|
78
78
|
echo " Dashboard: http://localhost:3147"
|
|
79
|
-
echo " App: http://localhost:
|
|
79
|
+
echo " App: http://localhost:5001"
|
|
80
80
|
echo " DB Admin: http://localhost:8080"
|
|
81
81
|
echo " Database: localhost:5433 (postgres/postgres)"
|
|
82
82
|
echo ""
|