mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Clean up file naming by removing -new suffixes
- Renamed server-new.ts → server.ts - Renamed app-new.ts → app.ts - Renamed app-new-entry.ts → app-entry.ts - Updated package.json scripts to remove all -new references - Updated custom element name from vibetunnel-app-new to vibetunnel-app - Updated index.html to reference cleaned up files - Added CLAUDE.md with development notes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
19b428a879
commit
179d0db754
12 changed files with 59 additions and 26 deletions
11
web/CLAUDE.md
Normal file
11
web/CLAUDE.md
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Claude Development Notes
|
||||||
|
|
||||||
|
## Build Process
|
||||||
|
- **Never run build commands** - the user has `npm run dev` running which handles automatic rebuilds
|
||||||
|
- Changes to TypeScript files are automatically compiled and watched
|
||||||
|
- Do not run `npm run build:client` or similar build commands
|
||||||
|
|
||||||
|
## Development Workflow
|
||||||
|
- Make changes to source files in `src/`
|
||||||
|
- The dev server automatically rebuilds and reloads
|
||||||
|
- Focus on editing source files, not built artifacts
|
||||||
|
|
@ -4,20 +4,15 @@
|
||||||
"description": "Web frontend for terminal multiplexer",
|
"description": "Web frontend for terminal multiplexer",
|
||||||
"main": "dist/server.js",
|
"main": "dist/server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run build:css && concurrently --kill-others-on-fail \"npm run watch:css\" \"npm run watch:client\" \"npm run watch:server-new\"",
|
"dev": "npm run build:css && concurrently --kill-others-on-fail \"npm run watch:css\" \"npm run watch:client\" \"npm run watch:server\"",
|
||||||
"dev:new": "npm run build:css && concurrently --kill-others-on-fail \"npm run watch:css\" \"npm run watch:client\" \"npm run watch:server-new\"",
|
"watch:server": "tsx watch src/server.ts",
|
||||||
"watch:server": "tsx watch src/server-new.ts",
|
|
||||||
"watch:server-new": "tsx watch src/server-new.ts",
|
|
||||||
"watch:client": "tsc -p tsconfig.client.json --watch --preserveWatchOutput",
|
"watch:client": "tsc -p tsconfig.client.json --watch --preserveWatchOutput",
|
||||||
"watch:css": "tailwindcss -i ./src/input.css -o ./public/output.css --watch",
|
"watch:css": "tailwindcss -i ./src/input.css -o ./public/output.css --watch",
|
||||||
"build": "npm run build:css && npm run build:client && npm run build:server",
|
"build": "npm run build:css && npm run build:client && npm run build:server",
|
||||||
"build:new": "npm run build:css && npm run build:client && npm run build:server-new",
|
|
||||||
"build:server": "tsc",
|
"build:server": "tsc",
|
||||||
"build:server-new": "tsc src/server-new.ts --outDir dist --target ES2020 --module commonjs --moduleResolution node --esModuleInterop --allowSyntheticDefaultImports --strict --skipLibCheck",
|
|
||||||
"build:client": "tsc -p tsconfig.client.json",
|
"build:client": "tsc -p tsconfig.client.json",
|
||||||
"build:css": "tailwindcss -i ./src/input.css -o ./public/output.css --minify",
|
"build:css": "tailwindcss -i ./src/input.css -o ./public/output.css --minify",
|
||||||
"start": "node dist/server.js",
|
"start": "node dist/server.js",
|
||||||
"start:new": "node dist/server-new.js",
|
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:watch": "jest --watch"
|
"test:watch": "jest --watch"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
3
web/public/app-entry.js
Normal file
3
web/public/app-entry.js
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
// Entry point for the app
|
||||||
|
import './app.js';
|
||||||
|
//# sourceMappingURL=app-entry.js.map
|
||||||
1
web/public/app-entry.js.map
Normal file
1
web/public/app-entry.js.map
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"app-entry.js","sourceRoot":"","sources":["../src/client/app-entry.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,OAAO,UAAU,CAAC","sourcesContent":["// Entry point for the app\nimport './app.js';"]}
|
||||||
|
|
@ -18,6 +18,7 @@ let SessionList = class SessionList extends LitElement {
|
||||||
this.hideExited = true;
|
this.hideExited = true;
|
||||||
this.showCreateModal = false;
|
this.showCreateModal = false;
|
||||||
this.cleaningExited = false;
|
this.cleaningExited = false;
|
||||||
|
this.newSessionIds = new Set();
|
||||||
}
|
}
|
||||||
// Disable shadow DOM to use Tailwind
|
// Disable shadow DOM to use Tailwind
|
||||||
createRenderRoot() {
|
createRenderRoot() {
|
||||||
|
|
@ -57,17 +58,23 @@ let SessionList = class SessionList extends LitElement {
|
||||||
if (changedProperties.has('sessions')) {
|
if (changedProperties.has('sessions')) {
|
||||||
// Auto-load snapshots for existing sessions immediately, but delay for new ones
|
// Auto-load snapshots for existing sessions immediately, but delay for new ones
|
||||||
const prevSessions = changedProperties.get('sessions') || [];
|
const prevSessions = changedProperties.get('sessions') || [];
|
||||||
const newSessionIds = this.sessions
|
const newSessionIdsList = this.sessions
|
||||||
.filter(session => !prevSessions.find((prev) => prev.id === session.id))
|
.filter(session => !prevSessions.find((prev) => prev.id === session.id))
|
||||||
.map(session => session.id);
|
.map(session => session.id);
|
||||||
|
// Track new sessions
|
||||||
|
newSessionIdsList.forEach(id => this.newSessionIds.add(id));
|
||||||
// Load existing sessions immediately
|
// Load existing sessions immediately
|
||||||
const existingSessions = this.sessions.filter(session => !newSessionIds.includes(session.id));
|
const existingSessions = this.sessions.filter(session => !newSessionIdsList.includes(session.id));
|
||||||
existingSessions.forEach(session => this.loadSnapshot(session.id));
|
existingSessions.forEach(session => this.loadSnapshot(session.id));
|
||||||
// Load new sessions after a delay to let them generate some output
|
// Load new sessions after a delay to let them generate some output
|
||||||
if (newSessionIds.length > 0) {
|
if (newSessionIdsList.length > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
newSessionIds.forEach(sessionId => this.loadSnapshot(sessionId));
|
newSessionIdsList.forEach(sessionId => {
|
||||||
}, 3000); // Wait 3 seconds for new sessions
|
this.newSessionIds.delete(sessionId); // Remove from new sessions set
|
||||||
|
this.loadSnapshot(sessionId);
|
||||||
|
});
|
||||||
|
this.requestUpdate(); // Update UI to show the players
|
||||||
|
}, 500); // Wait 500ms for new sessions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -275,7 +282,9 @@ let SessionList = class SessionList extends LitElement {
|
||||||
<div id="player-${session.id}" class="w-full h-full" style="overflow: hidden;"></div>
|
<div id="player-${session.id}" class="w-full h-full" style="overflow: hidden;"></div>
|
||||||
` : html `
|
` : html `
|
||||||
<div class="text-vs-muted text-xs">
|
<div class="text-vs-muted text-xs">
|
||||||
${this.loadingSnapshots.has(session.id) ? 'Loading...' : 'Loading...'}
|
${this.newSessionIds.has(session.id)
|
||||||
|
? 'Starting session...'
|
||||||
|
: (this.loadingSnapshots.has(session.id) ? 'Loading...' : 'Loading...')}
|
||||||
</div>
|
</div>
|
||||||
`}
|
`}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -329,6 +338,9 @@ __decorate([
|
||||||
__decorate([
|
__decorate([
|
||||||
state()
|
state()
|
||||||
], SessionList.prototype, "cleaningExited", void 0);
|
], SessionList.prototype, "cleaningExited", void 0);
|
||||||
|
__decorate([
|
||||||
|
state()
|
||||||
|
], SessionList.prototype, "newSessionIds", void 0);
|
||||||
SessionList = __decorate([
|
SessionList = __decorate([
|
||||||
customElement('session-list')
|
customElement('session-list')
|
||||||
], SessionList);
|
], SessionList);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -16,8 +16,8 @@
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-vs-bg m-0 p-0">
|
<body class="bg-vs-bg m-0 p-0">
|
||||||
<vibetunnel-app-new></vibetunnel-app-new>
|
<vibetunnel-app></vibetunnel-app>
|
||||||
<script src="https://unpkg.com/asciinema-player@3.7.0/dist/bundle/asciinema-player.min.js"></script>
|
<script src="https://unpkg.com/asciinema-player@3.7.0/dist/bundle/asciinema-player.min.js"></script>
|
||||||
<script type="module" src="app-new-entry.js"></script>
|
<script type="module" src="app-entry.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
2
web/src/client/app-entry.ts
Normal file
2
web/src/client/app-entry.ts
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
// Entry point for the app
|
||||||
|
import './app.js';
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
// Entry point for the new app
|
|
||||||
import './app-new.js';
|
|
||||||
|
|
@ -8,8 +8,8 @@ import './components/session-list.js';
|
||||||
|
|
||||||
import type { Session } from './components/session-list.js';
|
import type { Session } from './components/session-list.js';
|
||||||
|
|
||||||
@customElement('vibetunnel-app-new')
|
@customElement('vibetunnel-app')
|
||||||
export class VibeTunnelAppNew extends LitElement {
|
export class VibeTunnelApp extends LitElement {
|
||||||
// Disable shadow DOM to use Tailwind
|
// Disable shadow DOM to use Tailwind
|
||||||
createRenderRoot() {
|
createRenderRoot() {
|
||||||
return this;
|
return this;
|
||||||
|
|
@ -29,6 +29,7 @@ export class SessionList extends LitElement {
|
||||||
@state() private hideExited = true;
|
@state() private hideExited = true;
|
||||||
@state() private showCreateModal = false;
|
@state() private showCreateModal = false;
|
||||||
@state() private cleaningExited = false;
|
@state() private cleaningExited = false;
|
||||||
|
@state() private newSessionIds = new Set<string>();
|
||||||
|
|
||||||
private handleRefresh() {
|
private handleRefresh() {
|
||||||
this.dispatchEvent(new CustomEvent('refresh'));
|
this.dispatchEvent(new CustomEvent('refresh'));
|
||||||
|
|
@ -68,21 +69,28 @@ export class SessionList extends LitElement {
|
||||||
if (changedProperties.has('sessions')) {
|
if (changedProperties.has('sessions')) {
|
||||||
// Auto-load snapshots for existing sessions immediately, but delay for new ones
|
// Auto-load snapshots for existing sessions immediately, but delay for new ones
|
||||||
const prevSessions = changedProperties.get('sessions') || [];
|
const prevSessions = changedProperties.get('sessions') || [];
|
||||||
const newSessionIds = this.sessions
|
const newSessionIdsList = this.sessions
|
||||||
.filter(session => !prevSessions.find((prev: Session) => prev.id === session.id))
|
.filter(session => !prevSessions.find((prev: Session) => prev.id === session.id))
|
||||||
.map(session => session.id);
|
.map(session => session.id);
|
||||||
|
|
||||||
|
// Track new sessions
|
||||||
|
newSessionIdsList.forEach(id => this.newSessionIds.add(id));
|
||||||
|
|
||||||
// Load existing sessions immediately
|
// Load existing sessions immediately
|
||||||
const existingSessions = this.sessions.filter(session =>
|
const existingSessions = this.sessions.filter(session =>
|
||||||
!newSessionIds.includes(session.id)
|
!newSessionIdsList.includes(session.id)
|
||||||
);
|
);
|
||||||
existingSessions.forEach(session => this.loadSnapshot(session.id));
|
existingSessions.forEach(session => this.loadSnapshot(session.id));
|
||||||
|
|
||||||
// Load new sessions after a delay to let them generate some output
|
// Load new sessions after a delay to let them generate some output
|
||||||
if (newSessionIds.length > 0) {
|
if (newSessionIdsList.length > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
newSessionIds.forEach(sessionId => this.loadSnapshot(sessionId));
|
newSessionIdsList.forEach(sessionId => {
|
||||||
}, 3000); // Wait 3 seconds for new sessions
|
this.newSessionIds.delete(sessionId); // Remove from new sessions set
|
||||||
|
this.loadSnapshot(sessionId);
|
||||||
|
});
|
||||||
|
this.requestUpdate(); // Update UI to show the players
|
||||||
|
}, 500); // Wait 500ms for new sessions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -309,7 +317,10 @@ export class SessionList extends LitElement {
|
||||||
<div id="player-${session.id}" class="w-full h-full" style="overflow: hidden;"></div>
|
<div id="player-${session.id}" class="w-full h-full" style="overflow: hidden;"></div>
|
||||||
` : html`
|
` : html`
|
||||||
<div class="text-vs-muted text-xs">
|
<div class="text-vs-muted text-xs">
|
||||||
${this.loadingSnapshots.has(session.id) ? 'Loading...' : 'Loading...'}
|
${this.newSessionIds.has(session.id)
|
||||||
|
? 'Starting session...'
|
||||||
|
: (this.loadingSnapshots.has(session.id) ? 'Loading...' : 'Loading...')
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
`}
|
`}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue