last update

This commit is contained in:
2026-11-12 15:58:44 +01:00
parent 68bb7ff810
commit 3f5438cb92
5 changed files with 721 additions and 141 deletions

View File

@@ -51,14 +51,16 @@ Fertig. Eine Verknüpfung auf dem Desktop legst du wie bei jedem Programm an (Re
### Projekt-Panel (Klick auf ein Projekt) ### Projekt-Panel (Klick auf ein Projekt)
- **Bearbeiten:** Status, Priorität, Tags, Notizen, Aufgaben, eigener Start-Befehl, Vorschaubild. - **Bearbeiten:** Status, Priorität, Tags, Notizen, Aufgaben, eigener Start-Befehl, Vorschaubild.
- **Info:** Git-Details. Remote eintragen (SSH wie `git@github.com:name/projekt.git` oder https), - **Info** (nur lesen): Übersicht (Ordner, Status, letzte Änderung, Backup, Größe), Git-Stand, itch.io-Stand,
**Git einrichten** für Projekte ohne Repository, **Push** bzw. **Commit & Push** mit Nachricht. Technik, Aktivität, vorhandene Release-ZIPs, Generator und App-Icon. Kleine Links springen zur passenden Aktion.
Push läuft in einem sichtbaren Konsolenfenster (dort erscheinen Passwort-/SSH-Abfragen und Fehler). - **Aktionen** (alles, was etwas tut), in Gruppen:
Dein öffentlicher SSH-Schlüssel lässt sich mit einem Klick kopieren. - **Starten:** eigene Programme (exe/HTML, 📌 legt fest, was ▶ startet), Starten · Einrichten · Bauen.
- **Speicher:** Projekt scannen, Größe sehen und Caches/Build-Ordner gezielt löschen. Ordner mit Dateien, - **Sichern & Versionieren:** Git – Remote eintragen (SSH wie `git@github.com:name/projekt.git` oder https),
die in Git sind, werden nie angeboten. **Git einrichten**, **Push** bzw. **Commit & Push** (sichtbares Konsolenfenster für SSH-Abfragen und Fehler),
- **Aktionen:** alle erkannten Programme und Befehle (npm, dotnet, flutter, Gradle, Unity, Python …), SSH-Schlüssel kopieren; dazu **Backup** nur dieses Projekts.
jeweils in einem eigenen Konsolenfenster. - **Veröffentlichen:** Release-ZIP und itch.io-Seite (siehe unten).
- **Aufräumen:** Projekt scannen, Caches/Build-Ordner gezielt löschen. Ordner mit Dateien in Git werden nie angeboten.
- **Werkzeuge / Öffnen:** übrige Befehle (npm, dotnet, flutter, Gradle, Unity, Python …), jeweils in eigener Konsole.
- **Klonen** und **Umbenennen…** (auch in einen anderen Projektordner verschieben). - **Klonen** und **Umbenennen…** (auch in einen anderen Projektordner verschieben).
### Neues Projekt ### Neues Projekt
@@ -115,7 +117,7 @@ Klick auf einen Tag zeigt, woran gearbeitet wurde. Dazu kommen aktive Tage, die
und „Zuletzt aktiv“ (7 / 30 / 90 Tage). Im Projekt unter **Info** steht dieselbe Ansicht für ein halbes Jahr. und „Zuletzt aktiv“ (7 / 30 / 90 Tage). Im Projekt unter **Info** steht dieselbe Ansicht für ein halbes Jahr.
### Release archivieren (ZIP) ### Release archivieren (ZIP)
Im Projekt unter **Info → Release archivieren**: einen Build-Ordner (`dist`, `builds`, `release`, `publish`, Im Projekt unter **Aktionen → Release-ZIP**: einen Build-Ordner (`dist`, `builds`, `release`, `publish`,
`bin\Release` …) oder das ganze Projekt als ZIP mit Datum im Namen nach `<Projekt>\releases\` packen. Beim ganzen `bin\Release` …) oder das ganze Projekt als ZIP mit Datum im Namen nach `<Projekt>\releases\` packen. Beim ganzen
Projekt bleiben `node_modules`, Build-Ordner, `.git` und `releases` draußen. Optional wird ein fertiger Build-Ordner Projekt bleiben `node_modules`, Build-Ordner, `.git` und `releases` draußen. Optional wird ein fertiger Build-Ordner
danach gelöscht, um Platz zu sparen – das ZIP bleibt. danach gelöscht, um Platz zu sparen – das ZIP bleibt.
@@ -124,6 +126,23 @@ danach gelöscht, um Platz zu sparen – das ZIP bleibt.
Trägst du in den Einstellungen dein öffentliches itch.io-Profil ein (`https://name.itch.io`), erkennt das Trägst du in den Einstellungen dein öffentliches itch.io-Profil ein (`https://name.itch.io`), erkennt das
Dashboard, welche Projekte veröffentlicht sind (🚀), und zeigt itch-Spiele, die noch keinem Projekt zugeordnet sind. Dashboard, welche Projekte veröffentlicht sind (🚀), und zeigt itch-Spiele, die noch keinem Projekt zugeordnet sind.
### itch.io-Seite erzeugen
Im Projekt unter **Aktionen → itch.io-Seite**:
- **itch.io-Seite erzeugen** öffnet eine Konsole mit [Claude Code](https://claude.com/claude-code) und dem Skill
`itchiocreater`. Er schreibt Titel, Project URL, Tagline, `description.html`, alle Felder für „Edit game“,
Cover/Banner (ComfyUI) und echte Screenshots nach `<Projekt>\docs\itchio\`. Rückfragen beantwortest du in der
Konsole. Voraussetzung: der Befehl `claude` und der Skill sind installiert.
- **Ansehen & kopieren** zeigt das Paket übersichtlich:
- Title und **Short description** mit Zähler (max. 120 Zeichen). Ist sie länger oder fehlt sie, steht darunter ein
gekürzter Vorschlag.
- Die **Description** als große Vorschau mit Wortzahl. **Formatiert kopieren** lässt sich direkt in den itch-Editor
einfügen.
- **Tags:** die aus dem Paket und dazu Ideen aus Text und Technik (z. B. `idle`, `high-score`, `controller`).
Ein Klick kopiert einen Tag.
- Alle Bilder nach Cover / Banner / Screenshots (Klick zeigt die Datei im Explorer, von dort auf itch.io ziehen) und
die übrigen Felder (Genre, KI-Offenlegung …) einzeln kopierbar.
- Nichts wird automatisch hochgeladen.
--- ---
## Einstellungen ## Einstellungen
@@ -197,6 +216,7 @@ Liegt das Dashboard in `<Projekte>\_Tools\ProjectDashboard`, wird `<Projekte>` a
| `lib\storage.js` | Größen-Scan mit Ordner-Aufteilung (Treemap) und Aufräumen über `cleanup.ps1` | | `lib\storage.js` | Größen-Scan mit Ordner-Aufteilung (Treemap) und Aufräumen über `cleanup.ps1` |
| `lib\scheduler.js` | Automatisches Backup nach Zeitplan (Stand in `auto-backup.json` im Datenordner) | | `lib\scheduler.js` | Automatisches Backup nach Zeitplan (Stand in `auto-backup.json` im Datenordner) |
| `lib\archive.js` | Release-ZIP nach `<Projekt>\releases` (über `tar.exe` von Windows) | | `lib\archive.js` | Release-ZIP nach `<Projekt>\releases` (über `tar.exe` von Windows) |
| `lib\itchpack.js` | itch.io-Paket (`docs\itchio`) lesen, Bilder ausliefern, Claude Code mit Skill `itchiocreater` starten |
| `lib\create.js` | Neu, Klonen, Umbenennen/Verschieben | | `lib\create.js` | Neu, Klonen, Umbenennen/Verschieben |
| `lib\git.js` · `lib\tech.js` · `lib\icons.js` | Git-Status, Technik-Erkennung + Aktionen, App-Icons | | `lib\git.js` · `lib\tech.js` · `lib\icons.js` | Git-Status, Technik-Erkennung + Aktionen, App-Icons |
| `lib\itch.js` · `lib\activity.js` | itch.io-Profil, „zuletzt geändert“ und Aktivität pro Tag | | `lib\itch.js` · `lib\activity.js` | itch.io-Profil, „zuletzt geändert“ und Aktivität pro Tag |

172
lib/itchpack.js Normal file
View File

@@ -0,0 +1,172 @@
// itch.io package of a project: the folder the itchiocreater skill writes
// (<project>\docs\itchio, older projects: <project>\itchio) - read back for the
// dashboard's copy view, and a console that starts Claude Code with the skill.
// Nothing is uploaded anywhere.
const fs = require('fs')
const path = require('path')
const { run, openConsole } = require('./proc')
const CANDIDATES = [['docs', 'itchio'], ['itchio']]
const IMG_RE = /\.(png|jpe?g|gif|webp)$/i
const MAX_HTML = 512 * 1024
function dir(projectPath) {
for (const parts of CANDIDATES) {
const d = path.join(projectPath, ...parts)
try { if (fs.statSync(d).isDirectory()) return d } catch {}
}
return null
}
// newest modification inside the folder (first level) - "created 3 days ago"
function stamp(d) {
let at = 0
try {
for (const e of fs.readdirSync(d, { withFileTypes: true })) {
if (!e.isFile()) continue
try { at = Math.max(at, fs.statSync(path.join(d, e.name)).mtimeMs) } catch {}
}
} catch {}
return at ? new Date(at).toISOString() : null
}
// cheap: for /details
function summary(projectPath) {
const d = dir(projectPath)
return d ? { exists: true, at: stamp(d), rel: path.relative(projectPath, d) } : { exists: false }
}
// "**Tags**" / "`a`, `b` - comment" → shown text and the value worth copying:
// a leading run of `code` items (the answer) without the comment after it,
// otherwise the whole text
function cell(raw) {
const plain = raw.replace(/\*\*/g, '').trim()
const lead = plain.match(/^`[^`]+`(\s*,\s*`[^`]+`)*/)
const text = plain.replace(/`/g, '').trim()
const placeholder = /^_[^_]+_$/.test(text) || text === '–' || text === '-'
const copy = placeholder ? '' : lead ? [...lead[0].matchAll(/`([^`]+)`/g)].map((m) => m[1].trim()).join(', ') : text
return { text, copy, placeholder }
}
// all two+-column markdown tables of the .md files, except file lists
function parseFields(d) {
const fields = []
const seen = new Set()
let files = []
try { files = fs.readdirSync(d).filter((f) => /\.md$/i.test(f)) } catch {}
files.sort((a, b) => (a.toLowerCase() === 'readme.md' ? -1 : b.toLowerCase() === 'readme.md' ? 1 : a.localeCompare(b)))
for (const f of files) {
let text = ''
try { text = fs.readFileSync(path.join(d, f), 'utf-8') } catch { continue }
let header = null
let skip = false
for (const line of text.split(/\r?\n/)) {
if (!line.trim().startsWith('|')) { header = null; continue }
const cells = line.trim().replace(/^\||\|$/g, '').split('|').map((c) => c.trim())
if (cells.length < 2) continue
if (!header) { header = cells; skip = /^(datei|file)/i.test(cells[0].replace(/\*/g, '')); continue }
if (cells.every((c) => /^:?-{2,}:?$/.test(c))) continue
if (skip) continue
const key = cells[0].replace(/\*\*/g, '').replace(/`/g, '').trim()
if (!key || seen.has(key.toLowerCase())) continue
seen.add(key.toLowerCase())
fields.push({ key, ...cell(cells[1]) })
}
}
return fields
}
function kindOf(rel) {
const n = rel.toLowerCase().replace(/\\/g, '/')
const base = n.split('/').pop()
if (/^cover/.test(base)) return 'cover'
if (/^(banner|background|bg)/.test(base)) return 'theme'
if (/^promo\//.test(n) || /^promo/.test(base)) return 'promo'
if (/^(screenshots|screens|shots)\//.test(n) || /^(shot|screen)/.test(base)) return 'screenshot'
return 'other'
}
function images(d) {
const out = []
const add = (rel) => {
try {
const st = fs.statSync(path.join(d, rel))
out.push({ rel, kind: kindOf(rel), mb: Math.round(st.size / 1024 / 1024 * 100) / 100 })
} catch {}
}
let top = []
try { top = fs.readdirSync(d, { withFileTypes: true }) } catch {}
for (const e of top) {
if (e.isFile() && IMG_RE.test(e.name)) add(e.name)
else if (e.isDirectory() && !e.name.startsWith('.')) {
try {
for (const f of fs.readdirSync(path.join(d, e.name))) if (IMG_RE.test(f) && !/^raw_/i.test(f)) add(path.join(e.name, f))
} catch {}
}
}
const order = { cover: 0, theme: 1, promo: 2, screenshot: 3, other: 4 }
return out.sort((a, b) => order[a.kind] - order[b.kind] || a.rel.localeCompare(b.rel))
}
function readHtml(d, name) {
const f = path.join(d, name)
try { if (fs.statSync(f).size <= MAX_HTML) return fs.readFileSync(f, 'utf-8') } catch {}
return null
}
function read(projectPath) {
const d = dir(projectPath)
if (!d) return { exists: false }
const fields = parseFields(d)
const pick = (re) => fields.find((x) => re.test(x.key)) ?? null
let other = []
try { other = fs.readdirSync(d).filter((f) => /\.(mp4|webm|zip|exe)$/i.test(f)) } catch {}
return {
exists: true,
rel: path.relative(projectPath, d),
at: stamp(d),
title: pick(/^title$/i),
url: pick(/^project url$/i),
tagline: pick(/^short description/i),
fields: fields.filter((x) => !/^(title|project url|short description.*)$/i.test(x.key)),
descriptionHtml: readHtml(d, 'description.html'),
installHtml: readHtml(d, 'install.html'),
images: images(d),
media: other,
}
}
// a file inside the package folder (image), or null - guards against ..\
function file(projectPath, rel) {
const d = dir(projectPath)
if (!d || typeof rel !== 'string' || !rel) return null
const f = path.resolve(d, rel)
if (!f.startsWith(d + path.sep)) return null
try { if (fs.statSync(f).isFile()) return f } catch {}
return null
}
let claudeFound = null
async function hasClaude() {
if (claudeFound) return true
try {
const r = await run('where.exe', ['claude'], { timeout: 5000 })
claudeFound = r.code === 0 && /claude/i.test(r.stdout ?? '')
} catch { claudeFound = false }
return claudeFound
}
// Opens a console with Claude Code and the itchiocreater skill in the project.
// Interactive on purpose: the skill asks a few questions (price, kind, …).
async function launch(projectPath, name) {
if (!(await hasClaude())) throw new Error('Claude Code nicht gefunden (Befehl „claude“). Installieren: https://claude.com/claude-code')
const exists = !!dir(projectPath)
// ASCII only: the .cmd file is read in the console's code page
const prompt = exists
? '/itchiocreater Check and complete the itch.io package of this project - do not overwrite anything without asking.'
: '/itchiocreater Create the itch.io package for this project.'
openConsole(`${name} itch.io`, projectPath, `claude "${prompt}"`)
return { ok: true, update: exists }
}
module.exports = { dir, summary, read, file, launch }

View File

@@ -1906,40 +1906,54 @@ function addTaskFromInput() {
// cleanup paths are "<folder>\rest" (relative to the projects folder) → "rest" // cleanup paths are "<folder>\rest" (relative to the projects folder) → "rest"
const inProject = (p) => p.slice(p.indexOf('\\') + 1) const inProject = (p) => p.slice(p.indexOf('\\') + 1)
function section(icon, title, body) { // opts: { id } for jump targets, { right } html at the end of the heading
return `<div class="card-sec"><h4>${ic(icon)}${title}</h4>${body}</div>` function section(icon, title, body, opts = {}) {
return `<div class="card-sec"${opts.id ? ` id="${opts.id}"` : ''}><h4>${ic(icon)}${title}${opts.right ? `<span class="h4r">${opts.right}</span>` : ''}</h4>${body}</div>`
}
// "→ in Aktionen": switches the tab and scrolls to the section
const jumpLink = (id, label = 'Aktionen') => `<a href="#" class="jump" data-jump="${id}">${label}${ic('arrow-right', 'sm')}</a>`
function bindJumps(root) {
for (const a of root.querySelectorAll('.jump')) a.onclick = (e) => {
e.preventDefault()
setSection('actions')
document.getElementById(a.dataset.jump)?.scrollIntoView({ behavior: 'smooth', block: 'start' })
}
} }
/* Info tab: read only - what the project is and how it stands */
function renderInfo(name, d) { function renderInfo(name, d) {
const p = projects.find((x) => x.name === name) ?? editing
const g = d.git const g = d.git
const key = d.sshKey const s = d.storage
const keyHint = key const del = s ? s.deletable.Cache + s.deletable.Release + s.deletable.Output : 0
? `<div class="hint">${ic('key-round', 'sm')} SSH-Schlüssel: <code>${escapeHtml(key.file)}</code> <button class="btn ghost" type="button" id="btnCopyKey" title="Öffentlichen Schlüssel kopieren – bei GitHub/GitLab unter „SSH keys“ einfügen">${ic('copy', 'sm')}kopieren</button></div>` const c = cloudInfo(p)
: `<div class="hint">${ic('key-round', 'sm')} Kein SSH-Schlüssel gefunden. Anlegen mit <code>ssh-keygen -t ed25519</code>, dann den Inhalt von <code>.ssh\\id_ed25519.pub</code> bei GitHub/GitLab eintragen.</div>` const overview = `<div class="kv">
const pushBox = !g.remote ? '' : g.dirty <div>Ordner</div><div><code>${escapeHtml(d.path)}</code></div>
? `<div class="pickrow" style="margin-top:10px"> <div>Status</div><div>${statusHtml(p.status)} <span class="hint">· Priorität ${PRIO_LABEL[p.priority] ?? '–'}</span></div>
<input type="text" id="gMsg" placeholder="Commit-Nachricht (${g.dirty} Änderungen)" maxlength="200"> <div>Geändert</div><div title="${escapeHtml(changeTitle(p))}">${fmtDate(lastActivity(p))} · ${timeAgo(lastActivity(p))}${p.lastChange?.file ? ` <span class="hint">· ${escapeHtml(p.lastChange.file)}</span>` : ''}</div>
<button class="btn primary" type="button" id="btnCommitPush">${ic('cloud-upload')}Commit &amp; Push</button> <div>Backup</div><div title="${escapeHtml(c.label)}"><span class="bk ${c.level}">${ic('hard-drive', 'sm')}${escapeHtml(c.short)}</span>${backupDue(p) ? ' <span class="chip warn">fällig</span>' : ''}</div>
<button class="btn" type="button" id="btnPush" title="Nur bestehende Commits pushen">${ic('upload')}Push</button> <div>Größe</div><div>${s ? `<b>${fmtMB(s.sizeMB)}</b> <span class="hint">· gescannt ${timeAgo(s.at)}${del >= 1 ? ` · ${fmtMB(del)} aufräumbar` : ''}</span>` : '<span class="hint">noch nicht gescannt</span>'}</div>
</div>` </div>`
: `<div style="margin-top:10px"><button class="btn ${g.ahead || !g.upstream ? 'primary' : ''}" type="button" id="btnPush">${ic('cloud-upload')}git push${g.ahead ? ` (${g.ahead})` : ''}</button></div>`
const gitBody = g.isRepo const gitBody = g.isRepo
? `<div class="kv"> ? `<div class="kv">
<div>Status</div><div>${gitHtml(g)}</div> <div>Status</div><div>${gitHtml(g)}${g.dirty ? ` <span class="hint">· ${g.dirty} Änderungen nicht committet</span>` : ''}</div>
<div>Branch</div><div>${ic('git-branch', 'sm')} ${escapeHtml(g.branch)}${g.upstream ? ` → ${escapeHtml(g.upstream)}` : ''}</div> <div>Branch</div><div>${ic('git-branch', 'sm')} ${escapeHtml(g.branch)}${g.upstream ? ` → ${escapeHtml(g.upstream)}` : ''}${g.ahead ? ` <span class="hint">· ${g.ahead} nicht gepusht</span>` : ''}</div>
<div>Remote</div><div>${g.remote ? `<code>${escapeHtml(g.remote)}</code>` : '<span class="hint">keins – liegt nur auf dieser Platte</span>'}</div>
<div>Letzter Commit</div><div>${g.lastCommit ? `${g.lastCommit.date} · ${escapeHtml(g.lastCommit.message)}` : '–'}</div> <div>Letzter Commit</div><div>${g.lastCommit ? `${g.lastCommit.date} · ${escapeHtml(g.lastCommit.message)}` : '–'}</div>
</div> </div>`
<label style="display:flex;gap:6px;align-items:center;font-size:12px;color:var(--muted);margin:12px 0 5px">${ic('link', 'sm')}Remote (origin) – SSH oder https</label> : `<div>${gitHtml(g)}</div><div class="hint">Kein Git-Repository – Änderungen sind nirgends gesichert.</div>`
<div class="pickrow">
<input type="text" id="gRemote" value="${escapeHtml(g.remote ?? '')}" placeholder="git@github.com:name/${escapeHtml(name)}.git"> const ip = d.itchPack ?? { exists: false }
<button class="btn" type="button" id="btnRemote">${ic('save')}Speichern</button> const itchBody = `<div class="kv">
</div> <div>Veröffentlicht</div><div>${p.published ? `<a href="${escapeHtml(p.published.url)}" target="_blank">${escapeHtml(p.published.title || p.published.url)}</a>` : '<span class="hint">nein</span>'}</div>
${g.remote ? '' : '<div class="hint">Noch kein Remote – das Projekt liegt nur auf dieser Platte.</div>'} <div>Seiten-Paket</div><div>${ip.exists ? `<code>${escapeHtml(ip.rel)}</code> <span class="hint">· ${timeAgo(ip.at)}</span>` : '<span class="hint">noch keins</span>'}</div>
${pushBox} </div>`
${keyHint}
<div class="hint">Push läuft in einem eigenen Konsolenfenster (dort erscheinen SSH-Passphrase und Fehler).</div>` const arcs = d.archives ?? []
: `<div>${gitHtml(g)}</div><div class="hint">Kein Git-Repository – Änderungen sind nirgends gesichert.</div> const arcBody = arcs.length
<div style="margin-top:10px"><button class="btn primary" type="button" id="btnGitInit">${ic('git-branch')}Git einrichten</button></div>` ? `<div class="kv">${arcs.slice(0, 8).map((a) => `<div>${new Date(a.at).toLocaleDateString('de-DE')}</div><div>${escapeHtml(a.name)} <span class="hint">· ${fmtMB(a.mb)}</span></div>`).join('')}</div>${arcs.length > 8 ? `<div class="hint">… und ${arcs.length - 8} ältere</div>` : ''}`
: '<div class="hint">Noch keine ZIPs in <code>releases\\</code>.</div>'
const gens = d.tools.generators const gens = d.tools.generators
const genBody = gens.length const genBody = gens.length
@@ -1955,51 +1969,210 @@ function renderInfo(name, d) {
<div class="hint">${genDir ? 'Mit ComfyGen erzeugen (Prompt „icon“ in prompts.py eintragen):' : 'Generator-Vorlage aus _Tools\\ComfyGen\\template kopieren, dann:'}</div> <div class="hint">${genDir ? 'Mit ComfyGen erzeugen (Prompt „icon“ in prompts.py eintragen):' : 'Generator-Vorlage aus _Tools\\ComfyGen\\template kopieren, dann:'}</div>
<code class="cmd">cd "${escapeHtml(d.path)}\\${escapeHtml(genDir ? genDir.rel : 'sprite-generator')}" &amp;&amp; gen generate icon &amp;&amp; gen adopt icon</code>` <code class="cmd">cd "${escapeHtml(d.path)}\\${escapeHtml(genDir ? genDir.rel : 'sprite-generator')}" &amp;&amp; gen generate icon &amp;&amp; gen adopt icon</code>`
const el = document.getElementById('sec-info')
el.innerHTML =
section('info', 'Übersicht', overview, { right: del >= 1 ? jumpLink('act-clean', 'Aufräumen') : '' }) +
section('git-branch', 'Git', gitBody, { right: jumpLink('act-git', g.isRepo ? 'Push &amp; Remote' : 'Einrichten') }) +
(name === '_Tools' ? '' : section('rocket', 'itch.io', itchBody, { right: jumpLink('act-itch', ip.exists ? 'Ansehen' : 'Erzeugen') })) +
section('cpu', 'Technik', `<div class="chips">${techChips(d.tech.types) || '<span class="hint">nicht erkannt</span>'}${d.tech.needsInstall ? `<span class="chip warn">${ic('download', 'sm')}npm install nötig</span>` : ''}</div>`) +
`<div class="card-sec"><h4>${ic('activity')}Aktivität <span class="hint" style="font-weight:400;margin:0 0 0 auto" id="actMiniInfo"></span></h4><div id="actMini" class="hmini"><span class="hint">wird geladen…</span></div></div>` +
section('file-archive', 'Release-Archive', arcBody, { right: jumpLink('act-zip', 'ZIP erstellen') }) +
section('wand-sparkles', 'Generator', genBody) +
section('image', 'App-Icon', iconBody)
bindJumps(el)
loadProjectActivity(name)
}
/* Aktionen tab: everything that does something, grouped */
function gitActionsHtml(name, d) {
const g = d.git
if (!g.isRepo) {
return `<div class="hint" style="margin-top:0">Kein Git-Repository – Änderungen sind nirgends gesichert.</div>
<div style="margin-top:10px"><button class="btn primary" type="button" id="btnGitInit">${ic('git-branch')}Git einrichten</button></div>`
}
const key = d.sshKey
const keyHint = key
? `<div class="hint">${ic('key-round', 'sm')} SSH-Schlüssel: <code>${escapeHtml(key.file)}</code> <button class="btn ghost" type="button" id="btnCopyKey" title="Öffentlichen Schlüssel kopieren – bei GitHub/GitLab unter „SSH keys“ einfügen">${ic('copy', 'sm')}kopieren</button></div>`
: `<div class="hint">${ic('key-round', 'sm')} Kein SSH-Schlüssel gefunden. Anlegen mit <code>ssh-keygen -t ed25519</code>, dann den Inhalt von <code>.ssh\\id_ed25519.pub</code> bei GitHub/GitLab eintragen.</div>`
const pushBox = !g.remote ? '' : g.dirty
? `<div class="pickrow" style="margin-bottom:12px">
<input type="text" id="gMsg" placeholder="Commit-Nachricht (${g.dirty} Änderungen)" maxlength="200">
<button class="btn primary" type="button" id="btnCommitPush">${ic('cloud-upload')}Commit &amp; Push</button>
<button class="btn" type="button" id="btnPush" title="Nur bestehende Commits pushen">${ic('upload')}Push</button>
</div>`
: `<div style="margin-bottom:12px"><button class="btn ${g.ahead || !g.upstream ? 'primary' : ''}" type="button" id="btnPush">${ic('cloud-upload')}git push${g.ahead ? ` (${g.ahead})` : ''}</button> <span class="hint">${g.ahead ? '' : 'nichts Neues zu pushen'}</span></div>`
return `${pushBox}
<label class="flabel">${ic('link', 'sm')}Remote (origin) – SSH oder https</label>
<div class="pickrow">
<input type="text" id="gRemote" value="${escapeHtml(g.remote ?? '')}" placeholder="git@github.com:name/${escapeHtml(name)}.git">
<button class="btn" type="button" id="btnRemote">${ic('save')}Speichern</button>
</div>
${g.remote ? '' : '<div class="hint">Noch kein Remote – erst eintragen, dann erscheint hier „Push“.</div>'}
${keyHint}
<div class="hint">Push läuft in einem eigenen Konsolenfenster (dort erscheinen SSH-Passphrase und Fehler).</div>`
}
function archiveHtml(name, d) {
const s = d.storage const s = d.storage
let storageBody const folder = editing?.folder ?? name
if (!s) storageBody = '<div class="hint">Noch nicht gescannt.</div>' const releaseCands = new Set((s?.candidates ?? []).filter((c) => c.Tier === 'Release' && !c.Skip).map((c) => inProject(c.Path).toLowerCase()))
const rd = d.releaseDirs ?? []
return `
<div class="pickrow">
<select id="arcWhat">${rd.map((r) => `<option value="${escapeHtml(r.rel)}" data-del="${releaseCands.has(r.rel.toLowerCase()) ? 1 : ''}">${escapeHtml(r.rel)} · ${fmtMB(r.mb)} · ${r.files} Dateien</option>`).join('')}
<option value="project">Ganzes Projekt (ohne node_modules, Builds, .git)</option></select>
<button class="btn primary" type="button" id="btnArc">${ic('file-archive')}ZIP erstellen</button>
<button class="btn ghost" type="button" id="btnArcOpen" title="releases-Ordner öffnen">${ic('folder-open')}</button>
</div>
<label class="chk" id="arcDelWrap" style="margin-top:8px;display:flex;gap:6px;align-items:center;font-size:13px"><input type="checkbox" id="arcDel"> Build-Ordner danach löschen (Platz sparen – das ZIP bleibt)</label>
<div class="hint">Landet in <code>${escapeHtml(folder)}\\releases\\</code> mit Datum im Namen${rd.length ? '' : ' – kein Build-Ordner gefunden (dist, builds, release, publish …)'}.</div>`
}
function itchActionHtml(name, d) {
const ip = d.itchPack ?? { exists: false }
const p = projects.find((x) => x.name === name) ?? editing
if (!ip.exists) {
return `<div class="actgroup"><button class="btn primary" type="button" id="btnItchGen">${ic('sparkles')}itch.io-Seite erzeugen</button></div>
<div class="hint">Startet Claude Code mit dem Skill <b>itchiocreater</b> in einer Konsole: Titel, Tagline, Beschreibung, alle Felder, Cover/Banner (ComfyUI) und Screenshots landen in <code>docs\\itchio\\</code>. Rückfragen dort beantworten.</div>`
}
return `<div class="actgroup">
<button class="btn primary" type="button" id="btnItchView">${ic('clipboard-copy')}Ansehen &amp; kopieren</button>
<button class="btn" type="button" id="btnItchGen" title="Claude Code prüft und ergänzt das Paket">${ic('sparkles')}Ergänzen mit Claude</button>
<button class="btn ghost" type="button" id="btnItchOpen" title="Ordner öffnen">${ic('folder-open')}</button>
${p?.published ? `<a class="btn ghost" href="${escapeHtml(p.published.url)}" target="_blank" title="Veröffentlichte Seite öffnen">${ic('external-link')}</a>` : ''}
</div>
<div class="hint"><code>${escapeHtml(ip.rel)}</code> · zuletzt geändert ${timeAgo(ip.at)}</div>`
}
function cleanHtml(d) {
const s = d.storage
let body
if (!s) body = '<div class="hint" style="margin-top:0">Noch nicht gescannt – erst scannen, dann zeigt sich, was weg kann.</div>'
else { else {
const rows = s.candidates.filter((c) => c.MB >= 1 || c.Skip) const rows = s.candidates.filter((c) => c.MB >= 1 || c.Skip)
storageBody = `<div class="kv"><div>Größe</div><div><b>${fmtMB(s.sizeMB)}</b> <span class="hint">· gescannt ${timeAgo(s.at)}</span></div> body = `<div class="kv"><div>Größe</div><div><b>${fmtMB(s.sizeMB)}</b> <span class="hint">· gescannt ${timeAgo(s.at)}</span></div>
<div>Löschbar</div><div>Cache ${fmtMB(s.deletable.Cache)} · Builds ${fmtMB(s.deletable.Release)} · Rohbilder ${fmtMB(s.deletable.Output)}</div></div>` <div>Löschbar</div><div>Cache ${fmtMB(s.deletable.Cache)} · Builds ${fmtMB(s.deletable.Release)} · Rohbilder ${fmtMB(s.deletable.Output)}</div></div>`
storageBody += rows.length body += rows.length
? `<table class="cand">${rows.map((c) => `<tr> ? `<table class="cand">${rows.map((c) => `<tr>
<td><input type="checkbox" class="candcb" data-path="${escapeHtml(c.Path)}" ${c.Skip ? 'disabled' : c.Tier === 'Cache' ? 'checked' : ''}></td> <td><input type="checkbox" class="candcb" data-path="${escapeHtml(c.Path)}" ${c.Skip ? 'disabled' : c.Tier === 'Cache' ? 'checked' : ''}></td>
<td>${escapeHtml(inProject(c.Path))}</td> <td>${escapeHtml(inProject(c.Path))}</td>
<td><span class="chip ${TIER[c.Tier].cls}" title="${TIER[c.Tier].hint}">${ic(TIER[c.Tier].icon, 'sm')}${TIER[c.Tier].label}</span>${c.Skip ? ` <span class="chip bad">${ic('lock', 'sm')}in git</span>` : ''}</td> <td><span class="chip ${TIER[c.Tier].cls}" title="${TIER[c.Tier].hint}">${ic(TIER[c.Tier].icon, 'sm')}${TIER[c.Tier].label}</span>${c.Skip ? ` <span class="chip bad">${ic('lock', 'sm')}in git</span>` : ''}</td>
<td class="mb">${fmtMB(c.MB)}</td></tr>`).join('')}</table> <td class="mb">${fmtMB(c.MB)}</td></tr>`).join('')}</table>
<div style="margin-top:10px;display:flex;gap:8px;flex-wrap:wrap"><button class="btn danger" id="btnClean">${ic('trash')}Ausgewählte löschen</button></div>
<div class="hint">Cache ist vorausgewählt (immer neu erzeugbar). Fertige Builds und Rohbilder nur bewusst anhaken.</div>` <div class="hint">Cache ist vorausgewählt (immer neu erzeugbar). Fertige Builds und Rohbilder nur bewusst anhaken.</div>`
: `<div class="hint">${ic('sparkles', 'sm')} Nichts zum Aufräumen.</div>` : `<div class="hint">${ic('sparkles', 'sm')} Nichts zum Aufräumen.</div>`
} }
storageBody += `<div style="margin-top:10px"><button class="btn" id="btnScanOne" ${!cleanupAvailable || scanState?.running ? 'disabled' : ''}>${ic('scan-search')}${s ? 'Neu scannen' : 'Scannen'}</button></div>` const hasRows = s && s.candidates.some((c) => c.MB >= 1 && !c.Skip)
body += `<div class="actgroup" style="margin-top:10px">
${hasRows ? `<button class="btn danger" id="btnClean">${ic('trash')}Ausgewählte löschen</button>` : ''}
<button class="btn" id="btnScanOne" ${!cleanupAvailable || scanState?.running ? 'disabled' : ''}>${ic('scan-search')}${s ? 'Neu scannen' : 'Scannen'}</button>
</div>`
return body
}
// release archive: ZIP of a build folder (or the whole project) into <project>\releases function renderActions(name, d) {
const folder = editing?.folder ?? name const groups = {}
const releaseCands = new Set((s?.candidates ?? []).filter((c) => c.Tier === 'Release' && !c.Skip).map((c) => inProject(c.Path).toLowerCase())) for (const a of d.actions) (groups[a.group] ??= []).push(a)
const rd = d.releaseDirs ?? [] const ACT_ICON = (a) => a.id === 'vscode' ? 'code-xml' : a.id === 'explorer' ? 'folder-open' : a.id === 'console' ? 'square-terminal'
const arcs = d.archives ?? [] : a.id.startsWith('unity') ? 'box' : a.id.startsWith('exe:') ? 'app-window' : a.id.startsWith('bat:') ? 'file-terminal' : a.id === 'web' ? 'globe' : a.id.startsWith('gen:') ? 'wand-sparkles'
const archiveBody = ` : a.id.startsWith('npm-install') ? 'download' : ACTION_ICON[a.group]
<div class="pickrow">
<select id="arcWhat">${rd.map((r) => `<option value="${escapeHtml(r.rel)}" data-del="${releaseCands.has(r.rel.toLowerCase()) ? 1 : ''}">${escapeHtml(r.rel)} · ${fmtMB(r.mb)} · ${r.files} Dateien</option>`).join('')}
<option value="project">Ganzes Projekt (ohne node_modules, Builds, .git)</option></select>
<button class="btn primary" type="button" id="btnArc">${ic('file-archive')}ZIP erstellen</button>
</div>
<label class="chk" id="arcDelWrap" style="margin-top:8px;display:flex;gap:6px;align-items:center;font-size:13px"><input type="checkbox" id="arcDel"> Build-Ordner danach löschen (Platz sparen – das ZIP bleibt)</label>
<div class="hint">Landet in <code>${escapeHtml(folder)}\\releases\\</code> mit Datum im Namen${rd.length ? '' : ' – kein Build-Ordner gefunden (dist, builds, release, publish …)'}.</div>
${arcs.length ? `<div class="kv" style="margin-top:10px">${arcs.slice(0, 8).map((a) => `<div>${new Date(a.at).toLocaleDateString('de-DE')}</div><div>${escapeHtml(a.name)} <span class="hint">· ${fmtMB(a.mb)}</span></div>`).join('')}</div>` : ''}
<div style="margin-top:10px"><button class="btn" type="button" id="btnArcOpen">${ic('folder-open')}releases-Ordner öffnen</button></div>`
document.getElementById('sec-info').innerHTML = // the project's own programs (exe + html pages) come first, as big start buttons;
section('cloud', 'Git &amp; Backup', gitBody) + // the pin chooses which one the ▶ on the cards starts
section('cpu', 'Technik', `<div class="chips">${techChips(d.tech.types) || '<span class="hint">nicht erkannt</span>'}${d.tech.needsInstall ? `<span class="chip warn">${ic('download', 'sm')}npm install nötig</span>` : ''}</div>`) + const programs = groups['Programm'] ?? []
`<div class="card-sec"><h4>${ic('activity')}Aktivität <span class="hint" style="font-weight:400;margin:0 0 0 auto" id="actMiniInfo"></span></h4><div id="actMini" class="hmini"><span class="hint">wird geladen…</span></div></div>` + const hasBuild = !!groups['Bauen']
section('hard-drive', 'Speicher', storageBody) + const prog = d.program // { rel, missing } or null
section('file-archive', 'Release archivieren (ZIP)', archiveBody) + const progHtml = (programs.length
section('wand-sparkles', 'Generator', genBody) + ? `<div class="progs">${programs.map((a, i) => {
section('image', 'App-Icon', iconBody) const pinned = a.id === 'program'
return `<div class="progwrap">
<button class="prog act ${i === 0 ? 'first' : ''}" data-id="${escapeHtml(a.id)}" title="${escapeHtml(a.detail ?? '')}">
<span class="pico">${ic(a.id.startsWith('html:') || /\.html?$/i.test(a.rel ?? '') ? 'globe' : 'play', 'lg')}</span>
<span class="ptxt"><b>${escapeHtml(a.label)}</b><small>${escapeHtml(a.detail ?? '')}</small></span>
</button>
${a.rel ? `<button class="pin ${pinned ? 'on' : ''}" data-rel="${escapeHtml(pinned ? '' : a.rel)}" title="${pinned ? 'Nicht mehr für ▶ verwenden' : 'Für ▶ auf der Karte verwenden'}">${ic('pin', 'sm')}</button>` : ''}
</div>`
}).join('')}</div>`
: `<div class="hint" style="margin-top:0">Keine fertige exe oder HTML-Seite im Projekt gefunden.${hasBuild ? ' Unter „Bauen“ erzeugen, dann hier starten.' : ''}</div>`)
+ (prog?.missing ? `<div class="hint warn">${ic('triangle-alert', 'sm')} Festgelegte Datei fehlt: <b>${escapeHtml(prog.rel)}</b> – neu wählen oder zurücksetzen.</div>` : '')
+ `<details class="progset"${prog?.missing ? ' open' : ''}>
<summary>${ic('pin', 'sm')}Für ▶ starten festlegen${prog ? `: <b>${escapeHtml(prog.rel)}</b>` : ' (automatisch)'}</summary>
<div class="pickrow">
<input type="text" id="fProgram" placeholder="z. B. release\\Spiel.exe oder game\\index.html" value="${escapeHtml(prog?.rel ?? '')}">
${hasPicker ? `<button class="btn" type="button" id="btnPickProgram">${ic('file-search')}Durchsuchen…</button>` : ''}
<button class="btn primary" type="button" id="btnSetProgram">${ic('check')}Festlegen</button>
${prog ? `<button class="btn ghost" type="button" id="btnClearProgram" title="Automatisch wählen">${ic('rotate-ccw')}</button>` : ''}
</div>
<div class="hint">exe, html, bat oder lnk – Pfad im Projekt.</div>
</details>`
loadProjectActivity(name) const btnGroup = (g) => groups[g]
? section(ACTION_ICON[g], g, `<div class="actgroup">${groups[g].map((a) =>
`<button class="btn act ${g === 'Starten' || g === 'Einrichten' ? 'primary' : ''}" data-id="${escapeHtml(a.id)}" ${a.detail ? `title="${escapeHtml(a.detail)}"` : ''}>${ic(ACT_ICON(a))}${escapeHtml(a.label)}</button>`).join('')}</div>`)
: ''
const head = (icon, title) => `<div class="agroup-h">${ic(icon, 'sm')}${title}</div>`
const tools = name === '_Tools'
projectLastBackup = d.lastBackup ?? null
projectTargets = d.backupTargets ?? []
const el = document.getElementById('sec-actions')
el.innerHTML =
head('play', 'Starten')
+ section('app-window', 'Programm', progHtml)
+ btnGroup('Starten') + btnGroup('Einrichten') + btnGroup('Bauen')
+ head('shield-check', 'Sichern &amp; Versionieren')
+ section('git-branch', 'Git', gitActionsHtml(name, d), { id: 'act-git' })
+ (tools ? '' : section('hard-drive-upload', 'Backup', '<div id="pbackupBody"></div>', { id: 'act-backup' }))
+ head('rocket', 'Veröffentlichen')
+ section('file-archive', 'Release-ZIP', archiveHtml(name, d), { id: 'act-zip' })
+ (tools ? '' : section('rocket', 'itch.io-Seite', itchActionHtml(name, d), { id: 'act-itch' }))
+ head('brush-cleaning', 'Aufräumen')
+ section('hard-drive', 'Speicher', cleanHtml(d), { id: 'act-clean' })
+ (groups['Werkzeuge'] || groups['Öffnen'] ? head('wrench', 'Werkzeuge') + btnGroup('Werkzeuge') + btnGroup('Öffnen') : '')
+ `<div class="hint" style="margin-top:12px">${ic('shield-check', 'sm')} Programme starten direkt, Befehle und .bat laufen sichtbar in einem eigenen Konsolenfenster. Eigenen Start-Befehl unter „Bearbeiten“ festlegen.</div>`
for (const btn of el.querySelectorAll('.act')) btn.onclick = () => runAction(name, btn.dataset.id)
for (const btn of el.querySelectorAll('.pin')) btn.onclick = () => setProgram(name, btn.dataset.rel)
const input = document.getElementById('fProgram')
document.getElementById('btnSetProgram').onclick = () => setProgram(name, input.value)
input.onkeydown = (e) => { if (e.key === 'Enter') setProgram(name, input.value) }
document.getElementById('btnClearProgram')?.addEventListener('click', () => setProgram(name, ''))
document.getElementById('btnPickProgram')?.addEventListener('click', async () => {
const file = await pickFile(`Programm für ${name} wählen`, d.path)
if (file) setProgram(name, file)
})
bindGit(name, d)
bindArchive(name)
bindItch(name)
bindClean(name, d)
renderProjectBackup(name)
if (!backup) loadBackup()
}
function bindGit(name, d) {
const on = (id, fn) => { const el = document.getElementById(id); if (el) el.onclick = fn }
const refreshInfo = () => { load(); loadDetails(name) }
on('btnPush', async () => {
try { await postJson(api(name, 'push')); toast('Push läuft in eigener Konsole', 'cloud-upload') } catch (e) { toast(e.message, 'triangle-alert') }
})
on('btnCommitPush', async () => {
const msg = document.getElementById('gMsg').value.trim()
if (!msg) { document.getElementById('gMsg').focus(); return toast('Bitte eine Commit-Nachricht eingeben', 'info') }
try { await postJson(api(name, 'push'), { message: msg }); toast('Commit & Push läuft in eigener Konsole', 'cloud-upload') } catch (e) { toast(e.message, 'triangle-alert') }
})
on('btnRemote', async () => {
try { await postJson(api(name, 'remote'), { url: document.getElementById('gRemote').value }); toast('Remote gespeichert', 'link'); refreshInfo() } catch (e) { toast(e.message, 'triangle-alert') }
})
const rem = document.getElementById('gRemote')
if (rem) rem.onkeydown = (e) => { if (e.key === 'Enter') document.getElementById('btnRemote').click() }
on('btnGitInit', async () => {
try { await postJson(api(name, 'git-init')); toast('Git eingerichtet (Branch main)', 'git-branch'); refreshInfo() } catch (e) { toast(e.message, 'triangle-alert') }
})
on('btnCopyKey', async () => {
try { await navigator.clipboard.writeText(d.sshKey.key); toast('SSH-Schlüssel kopiert', 'copy') } catch { toast('Kopieren nicht möglich', 'triangle-alert') }
})
}
function bindArchive(name) {
const arcSel = document.getElementById('arcWhat') const arcSel = document.getElementById('arcWhat')
const syncArc = () => { document.getElementById('arcDelWrap').style.display = arcSel.selectedOptions[0]?.dataset.del ? '' : 'none' } const syncArc = () => { document.getElementById('arcDelWrap').style.display = arcSel.selectedOptions[0]?.dataset.del ? '' : 'none' }
arcSel.onchange = syncArc arcSel.onchange = syncArc
@@ -2023,29 +2196,22 @@ function renderInfo(name, d) {
} }
} }
document.getElementById('btnArcOpen').onclick = () => postJson(api(name, 'archive/open')).catch((ex) => toast(ex.message, 'triangle-alert')) document.getElementById('btnArcOpen').onclick = () => postJson(api(name, 'archive/open')).catch((ex) => toast(ex.message, 'triangle-alert'))
}
function bindItch(name) {
document.getElementById('btnItchGen')?.addEventListener('click', async () => {
try {
const r = await postJson(api(name, 'itch/generate'))
toast(r.update ? 'Claude Code prüft das itch.io-Paket – siehe Konsole' : 'Claude Code erstellt das itch.io-Paket – siehe Konsole', 'sparkles')
} catch (e) { toast(e.message, 'triangle-alert') }
})
document.getElementById('btnItchView')?.addEventListener('click', () => openItch(name))
document.getElementById('btnItchOpen')?.addEventListener('click', () => postJson(api(name, 'itch/open')).catch((e) => toast(e.message, 'triangle-alert')))
}
function bindClean(name, d) {
const s = d.storage
document.getElementById('btnScanOne').onclick = () => startScan(name) document.getElementById('btnScanOne').onclick = () => startScan(name)
const on = (id, fn) => { const el = document.getElementById(id); if (el) el.onclick = fn }
const refreshInfo = () => { load(); loadDetails(name) }
on('btnPush', async () => {
try { await postJson(api(name, 'push')); toast('Push läuft in eigener Konsole', 'cloud-upload') } catch (e) { toast(e.message, 'triangle-alert') }
})
on('btnCommitPush', async () => {
const msg = document.getElementById('gMsg').value.trim()
if (!msg) { document.getElementById('gMsg').focus(); return toast('Bitte eine Commit-Nachricht eingeben', 'info') }
try { await postJson(api(name, 'push'), { message: msg }); toast('Commit & Push läuft in eigener Konsole', 'cloud-upload') } catch (e) { toast(e.message, 'triangle-alert') }
})
on('btnRemote', async () => {
try { await postJson(api(name, 'remote'), { url: document.getElementById('gRemote').value }); toast('Remote gespeichert', 'link'); refreshInfo() } catch (e) { toast(e.message, 'triangle-alert') }
})
const rem = document.getElementById('gRemote')
if (rem) rem.onkeydown = (e) => { if (e.key === 'Enter') document.getElementById('btnRemote').click() }
on('btnGitInit', async () => {
try { await postJson(api(name, 'git-init')); toast('Git eingerichtet (Branch main)', 'git-branch'); refreshInfo() } catch (e) { toast(e.message, 'triangle-alert') }
})
on('btnCopyKey', async () => {
try { await navigator.clipboard.writeText(d.sshKey.key); toast('SSH-Schlüssel kopiert', 'copy') } catch { toast('Kopieren nicht möglich', 'triangle-alert') }
})
const clean = document.getElementById('btnClean') const clean = document.getElementById('btnClean')
if (clean) clean.onclick = async () => { if (clean) clean.onclick = async () => {
const paths = [...document.querySelectorAll('.candcb:checked')].map((cb) => cb.dataset.path) const paths = [...document.querySelectorAll('.candcb:checked')].map((cb) => cb.dataset.path)
@@ -2063,62 +2229,195 @@ function renderInfo(name, d) {
} }
} }
function renderActions(name, d) { /* ── itch.io copy view (docs\itchio of the project, lib/itchpack.js) ───── */
const groups = {}
for (const a of d.actions) (groups[a.group] ??= []).push(a)
const order = ['Einrichten', 'Starten', 'Bauen', 'Werkzeuge', 'Öffnen']
const ACT_ICON = (a) => a.id === 'vscode' ? 'code-xml' : a.id === 'explorer' ? 'folder-open' : a.id === 'console' ? 'square-terminal'
: a.id.startsWith('unity') ? 'box' : a.id.startsWith('exe:') ? 'app-window' : a.id.startsWith('bat:') ? 'file-terminal' : a.id === 'web' ? 'globe' : a.id.startsWith('gen:') ? 'wand-sparkles'
: a.id.startsWith('npm-install') ? 'download' : ACTION_ICON[a.group]
// the project's own programs (exe + html pages) come first, as big start buttons; let itchName = null
// the pin chooses which one the ▶ on the cards starts let itchData = null
const programs = groups['Programm'] ?? []
const hasBuild = !!groups['Bauen']
const prog = d.program // { rel, missing } or null
const progHtml = (programs.length
? `<div class="progs">${programs.map((a, i) => {
const pinned = a.id === 'program'
return `<div class="progwrap">
<button class="prog act ${i === 0 ? 'first' : ''}" data-id="${escapeHtml(a.id)}" title="${escapeHtml(a.detail ?? '')}">
<span class="pico">${ic(a.id.startsWith('html:') || /\.html?$/i.test(a.rel ?? '') ? 'globe' : 'play', 'lg')}</span>
<span class="ptxt"><b>${escapeHtml(a.label)}</b><small>${escapeHtml(a.detail ?? '')}</small></span>
</button>
${a.rel ? `<button class="pin ${pinned ? 'on' : ''}" data-rel="${escapeHtml(pinned ? '' : a.rel)}" title="${pinned ? 'Nicht mehr für ▶ verwenden' : 'Für ▶ auf der Karte verwenden'}">${ic('pin', 'sm')}</button>` : ''}
</div>`
}).join('')}</div>`
: `<div class="hint">Keine fertige exe oder HTML-Seite im Projekt gefunden.${hasBuild ? ' Unter „Bauen“ erzeugen, dann hier starten.' : ''}</div>`)
+ (prog?.missing ? `<div class="hint warn">${ic('triangle-alert', 'sm')} Festgelegte Datei fehlt: <b>${escapeHtml(prog.rel)}</b> – neu wählen oder zurücksetzen.</div>` : '')
+ `<div class="progset">
<label>${ic('pin', 'sm')}Für ▶ starten (exe, html, bat, lnk – Pfad im Projekt)</label>
<div class="pickrow">
<input type="text" id="fProgram" placeholder="z. B. release\\Spiel.exe oder game\\index.html" value="${escapeHtml(prog?.rel ?? '')}">
${hasPicker ? `<button class="btn" type="button" id="btnPickProgram">${ic('file-search')}Durchsuchen…</button>` : ''}
<button class="btn primary" type="button" id="btnSetProgram">${ic('check')}Festlegen</button>
${prog ? `<button class="btn ghost" type="button" id="btnClearProgram" title="Automatisch wählen">${ic('rotate-ccw')}</button>` : ''}
</div>
</div>`
projectLastBackup = d.lastBackup ?? null async function copyText(text, what) {
projectTargets = d.backupTargets ?? [] try { await navigator.clipboard.writeText(text); toast(`${what} kopiert`, 'copy') } catch { toast('Kopieren nicht möglich', 'triangle-alert') }
document.getElementById('sec-actions').innerHTML = section('app-window', 'Programm starten', progHtml) }
+ (name === '_Tools' ? '' : section('hard-drive-upload', 'Sichern', '<div id="pbackupBody"></div>')) // formatted: pastes as rich text into itch.io's description editor
+ order.filter((g) => groups[g]).map((g) => async function copyHtml(html, what) {
section(ACTION_ICON[g], g, `<div class="actgroup">${groups[g].map((a) => try {
`<button class="btn act ${g === 'Starten' || g === 'Einrichten' ? 'primary' : ''}" data-id="${escapeHtml(a.id)}" ${a.detail ? `title="${escapeHtml(a.detail)}"` : ''}>${ic(ACT_ICON(a))}${escapeHtml(a.label)}</button>`).join('')}</div>`)).join('') const tmp = document.createElement('div')
+ `<div class="hint" style="margin-top:12px">${ic('shield-check', 'sm')} Programme starten direkt, Befehle und .bat laufen sichtbar in einem eigenen Konsolenfenster. Eigenen Start-Befehl unter „Bearbeiten“ festlegen.</div>` tmp.innerHTML = html
for (const btn of document.querySelectorAll('#sec-actions .act')) btn.onclick = () => runAction(name, btn.dataset.id) await navigator.clipboard.write([new ClipboardItem({
for (const btn of document.querySelectorAll('#sec-actions .pin')) btn.onclick = () => setProgram(name, btn.dataset.rel) 'text/html': new Blob([html], { type: 'text/html' }),
const input = document.getElementById('fProgram') 'text/plain': new Blob([tmp.innerText], { type: 'text/plain' }),
document.getElementById('btnSetProgram').onclick = () => setProgram(name, input.value) })])
input.onkeydown = (e) => { if (e.key === 'Enter') setProgram(name, input.value) } toast(`${what} formatiert kopiert`, 'copy')
document.getElementById('btnClearProgram')?.addEventListener('click', () => setProgram(name, '')) } catch { copyText(html, `${what} (HTML)`) }
document.getElementById('btnPickProgram')?.addEventListener('click', async () => { }
const file = await pickFile(`Programm für ${name} wählen`, d.path)
if (file) setProgram(name, file) async function openItch(name) {
}) itchName = name
renderProjectBackup(name) const dlg = document.getElementById('itchDlg')
if (!backup) loadBackup() document.getElementById('itchTitle').textContent = `itch.io-Seite · ${name}`
document.getElementById('itchBody').innerHTML = `<div class="hint">${ic('loader', 'sm')} Lädt…</div>`
if (!dlg.open) dlg.showModal()
try {
const r = await fetch(api(name, 'itch'))
itchData = await r.json()
if (!r.ok) throw new Error(itchData.error)
renderItch()
} catch (e) {
document.getElementById('itchBody').innerHTML = `<div class="hint">Fehler: ${escapeHtml(e.message)}</div>`
}
}
const ITCH_SHORT_MAX = 120 // itch.io "Short description or tagline"
function htmlText(html) {
const t = document.createElement('template')
t.innerHTML = html
return (t.content.textContent ?? '').replace(/\s+/g, ' ').trim()
}
function firstParagraph(html) {
const t = document.createElement('template')
t.innerHTML = html
const p = [...t.content.querySelectorAll('p')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()).find((x) => x.length > 30)
return p ?? ''
}
// ≤ 120 characters: the first part before " – " / ". " if it fits, else cut at a word
function shorten(s) {
s = String(s ?? '').trim()
if (!s || s.length <= ITCH_SHORT_MAX) return s
for (const sep of [' – ', ' - ', '. ', ': ', ', ']) {
let cut = ''
for (const part of s.split(sep)) {
const next = cut ? cut + sep + part : part
if (next.length > ITCH_SHORT_MAX) break
cut = next
}
if (cut.length >= 40) return cut.replace(/[,:;–-]\s*$/, '').trim() + (sep === '. ' && !/[.!?]$/.test(cut) ? '.' : '')
}
return s.slice(0, ITCH_SHORT_MAX - 1).replace(/\s+\S*$/, '') + '…'
}
// itch.io tag ideas from the texts and the tech (lowercase, hyphenated like on itch)
const TAG_RULES = [
[/\bidle\b/, ['idle', 'incremental']], [/clicker/, ['clicker']], [/incremental/, ['incremental']],
[/puzzle|riddle/, ['puzzle', 'casual']], [/\brpg\b|role[- ]playing/, ['rpg']], [/rogue(like|lite)/, ['roguelike']],
[/platform(er)?/, ['platformer']], [/shoot|bullet/, ['shooter']], [/tower defen[cs]e/, ['tower-defense']],
[/strateg/, ['strategy']], [/simulat|management|manage\b|tycoon/, ['simulation', 'management']],
[/arcade/, ['arcade']], [/high ?score|leaderboard/, ['high-score']], [/retro|8-bit|16-bit/, ['retro']],
[/pixel/, ['pixel-art']], [/\b3d\b/, ['3d']], [/\b2d\b/, ['2d']], [/fantasy|magic|dragon/, ['fantasy']],
[/horror|creepy|scary/, ['horror']], [/sci-?fi|spaceship|outer space|galaxy|alien|robot/, ['sci-fi']],
[/relax|cozy|calm|chill/, ['relaxing', 'cozy']], [/cute/, ['cute']], [/funny|humou?r|silly/, ['funny']],
[/physics|ragdoll/, ['physics']], [/survival/, ['survival']], [/card game|card-game|deck-?build/, ['card-game']],
[/rhythm/, ['rhythm']], [/racing|race car|kart/, ['racing']], [/fight|combat|duel|arena/, ['fighting']],
[/medieval|knight|castle/, ['medieval']], [/roman|rome|gladiator|ancient/, ['historical']],
[/zombie/, ['zombies']], [/ocean|underwater|fish|aquarium/, ['underwater']], [/time attack|timer|speed/, ['time-attack']],
[/multiplayer|co-?op\b/, ['multiplayer']], [/local (co-?op|multiplayer)|split ?screen/, ['local-multiplayer']],
[/gamepad|controller/, ['controller']], [/mouse only|mouse-only/, ['mouse-only']], [/touch|mobile|android/, ['mobile']],
[/short|minutes/, ['short']], [/procedural|random(ly)? generated/, ['procedural-generation']],
[/singleplayer|single-player|solo/, ['singleplayer']], [/\bvr\b|virtual reality|quest/, ['virtual-reality']],
]
function suggestTags(text, techTypes) {
const t = String(text).toLowerCase()
const out = []
const add = (x) => { if (!out.includes(x)) out.push(x) }
for (const [re, tags] of TAG_RULES) if (re.test(t)) tags.forEach(add)
if (techTypes.includes('Unity')) add('unity')
if (techTypes.some((x) => ['Web', 'Vite'].includes(x))) add('html5')
if (!/multiplayer/.test(t)) add('singleplayer')
add('indie')
if (!out.includes('3d') && !out.includes('2d')) add('2d')
if (!out.some((x) => ['rpg', 'horror', 'strategy', 'roguelike'].includes(x))) add('casual')
return out.slice(0, 16)
}
const ITCH_KINDS = [
['cover', 'Cover (Cover image)'], ['theme', 'Banner & Hintergrund (Edit theme)'],
['promo', 'Promo-Bilder'], ['screenshot', 'Screenshots'], ['other', 'Weitere Bilder'],
]
function renderItch() {
const d = itchData
const name = itchName
const body = document.getElementById('itchBody')
if (!d.exists) {
body.innerHTML = `<div class="hint">Noch kein itch.io-Paket im Projekt. „itch.io-Seite erzeugen“ in Aktionen startet Claude Code.</div>`
return
}
const row = (label, f, extra = '') => {
const v = f?.copy ?? ''
return `<div class="copyrow">
<div class="cl">${label}</div>
<div class="cv">${v ? escapeHtml(v) : `<span class="hint">${f?.placeholder ? 'noch offen' : 'nicht gefunden'}</span>`}${extra}</div>
<button class="btn ghost" type="button" data-copy="${escapeHtml(v)}" data-what="${escapeHtml(label)}" ${v ? '' : 'disabled'} title="Kopieren">${ic('copy')}</button>
</div>`
}
// short description: itch.io allows 120 characters; a longer one gets a shortened suggestion
const descText = htmlText(d.descriptionHtml ?? '')
const tl = d.tagline?.copy ?? ''
const tlCount = tl ? ` <span class="chip ${tl.length <= ITCH_SHORT_MAX ? 'ok' : 'warn'}">${tl.length} / ${ITCH_SHORT_MAX}</span>` : ''
const shortSugg = tl.length > ITCH_SHORT_MAX ? shorten(tl) : !tl ? shorten(firstParagraph(d.descriptionHtml ?? '')) : ''
const shortRow = shortSugg
? row(tl ? 'Kürzer (Vorschlag)' : 'Short description (Vorschlag)', { copy: shortSugg }, ` <span class="chip ok">${shortSugg.length} / ${ITCH_SHORT_MAX}</span>`)
: ''
const words = descText ? descText.split(/\s+/).filter(Boolean).length : 0
const htmlBlock = (key, title, html, info = '') => html == null ? '' : `
<div class="isec"><h4>${ic('file-code')}${title}${info ? ` <span class="hint" style="font-weight:400">${info}</span>` : ''}
<span class="h4r"><button class="btn" type="button" data-rich="${key}">${ic('clipboard-copy')}Formatiert kopieren</button>
<button class="btn ghost" type="button" data-raw="${key}">${ic('code-xml')}HTML</button></span></h4>
<iframe class="ipreview${key === 'desc' ? ' big' : ''}" sandbox="" data-html="${key}" title="${title}"></iframe></div>`
const otherFields = d.fields.filter((f) => !/^tags/i.test(f.key))
// tags: the package's own (click = copy one) + suggestions from the texts and the tech
const tagField = d.fields.find((f) => /^tags/i.test(f.key))
const ownTags = (tagField?.copy ?? '').split(/,\s*/).map((t) => t.trim().toLowerCase()).filter(Boolean)
const genre = d.fields.find((f) => /^genre/i.test(f.key))?.text ?? ''
const sugg = suggestTags(`${d.title?.copy ?? ''} ${tl} ${genre} ${descText}`, editing?.tech?.types ?? []).filter((t) => !ownTags.includes(t))
const tagChips = (list, cls) => list.map((t) => `<button type="button" class="tagc ${cls}" data-copy="${escapeHtml(t)}" data-what="Tag „${escapeHtml(t)}“">${escapeHtml(t)}</button>`).join('')
const tagsBlock = `<div class="isec"><h4>${ic('tags')}Tags <span class="hint" style="font-weight:400">itch erlaubt 10 · Klick kopiert einen Tag</span>
<span class="h4r">${ownTags.length ? `<button class="btn ghost" type="button" data-copy="${escapeHtml(ownTags.join(', '))}" data-what="Tags">${ic('copy')}Alle</button>` : ''}</span></h4>
${ownTags.length ? `<div class="tagrow"><span class="cl">Im Paket (${ownTags.length})</span>${tagChips(ownTags, 'own')}</div>` : '<div class="hint">Im Paket stehen noch keine Tags.</div>'}
${sugg.length ? `<div class="tagrow"><span class="cl">Beispiele / Ideen</span>${tagChips(sugg, 'sugg')}</div>` : ''}
</div>`
const imgs = d.images ?? []
const imgUrl = (rel) => `${api(name, 'itch/file')}?f=${encodeURIComponent(rel)}`
const gallery = ITCH_KINDS.map(([k, label]) => {
const list = imgs.filter((i) => i.kind === k)
if (!list.length) return ''
return `<div class="igroup"><div class="agroup-h">${label} <span class="hint">· ${list.length}</span></div><div class="itchgrid">${list.map((i) =>
`<button type="button" class="ishot" data-file="${escapeHtml(i.rel)}" title="${escapeHtml(i.rel)} – im Explorer zeigen">
<img loading="lazy" src="${imgUrl(i.rel)}" alt=""><span>${escapeHtml(i.rel.split(/[\\/]/).pop())}<small>${i.mb < 1 ? '< 1 MB' : fmtMB(i.mb)}</small></span>
</button>`).join('')}</div></div>`
}).join('')
body.innerHTML = `
<div class="isec"><h4>${ic('type')}Texte</h4>
${row('Title', d.title)}
${row('Short description', d.tagline, tlCount)}
${shortRow}
</div>
${d.descriptionHtml == null ? `<div class="isec"><h4>${ic('file-code')}Description</h4><div class="hint">Keine <code>description.html</code> im Paket – „Ergänzen mit Claude“ in Aktionen erzeugt sie.</div></div>` : ''}
${htmlBlock('desc', 'Description', d.descriptionHtml, `${words} Wörter`)}
${tagsBlock}
${htmlBlock('install', 'Install instructions', d.installHtml)}
<div class="isec"><h4>${ic('images')}Bilder <span class="hint" style="font-weight:400">Klick zeigt die Datei im Explorer – von dort in itch.io ziehen</span></h4>
${gallery || '<div class="hint">Keine Bilder im Paket.</div>'}
${d.media?.length ? `<div class="hint">${ic('film', 'sm')} Weitere Dateien: ${d.media.map(escapeHtml).join(', ')}</div>` : ''}
</div>
${otherFields.length ? `<div class="isec"><h4>${ic('list')}Weitere Felder („Edit game“)</h4>
${otherFields.map((f) => `<div class="copyrow">
<div class="cl">${escapeHtml(f.key)}</div>
<div class="cv">${f.placeholder ? '<span class="hint">noch offen</span>' : escapeHtml(f.text)}</div>
<button class="btn ghost" type="button" data-copy="${escapeHtml(f.copy)}" data-what="${escapeHtml(f.key)}" ${f.copy ? '' : 'disabled'} title="${f.copy ? `Kopiert: ${escapeHtml(f.copy)}` : ''}">${ic('copy')}</button>
</div>`).join('')}
</div>` : ''}
<div class="hint">${ic('shield-check', 'sm')} Nichts wird automatisch hochgeladen – Texte kopieren, Bilder aus dem Ordner auf itch.io ziehen.</div>`
const html = { desc: d.descriptionHtml, install: d.installHtml }
for (const f of body.querySelectorAll('iframe[data-html]')) {
f.srcdoc = `<!doctype html><meta charset="utf-8"><style>body{font:14px/1.5 system-ui,sans-serif;margin:12px;color:#222;background:#fff}h2,h3{margin:.8em 0 .3em}img{max-width:100%}</style>${html[f.dataset.html]}`
}
for (const b of body.querySelectorAll('[data-copy]')) b.onclick = () => copyText(b.dataset.copy, b.dataset.what)
for (const b of body.querySelectorAll('[data-rich]')) b.onclick = () => copyHtml(html[b.dataset.rich], b.dataset.rich === 'desc' ? 'Description' : 'Install-Text')
for (const b of body.querySelectorAll('[data-raw]')) b.onclick = () => copyText(html[b.dataset.raw], 'HTML')
for (const b of body.querySelectorAll('.ishot')) b.onclick = () => postJson(api(name, 'itch/open'), { f: b.dataset.file }).catch((e) => toast(e.message, 'triangle-alert'))
} }
// Saves the program the ▶ starts ('' = choose automatically again). // Saves the program the ▶ starts ('' = choose automatically again).
@@ -2508,6 +2807,9 @@ document.getElementById('btnCloseBackup').onclick = closeBackup
document.getElementById('search').addEventListener('input', (e) => { searchTerm = e.target.value; render() }) document.getElementById('search').addEventListener('input', (e) => { searchTerm = e.target.value; render() })
for (const btn of document.querySelectorAll('#tabs button')) btn.onclick = () => { setView(btn.dataset.view); render() } for (const btn of document.querySelectorAll('#tabs button')) btn.onclick = () => { setView(btn.dataset.view); render() }
for (const btn of document.querySelectorAll('#ptabs button')) btn.onclick = () => setSection(btn.dataset.sec) for (const btn of document.querySelectorAll('#ptabs button')) btn.onclick = () => setSection(btn.dataset.sec)
document.getElementById('itchClose').onclick = () => document.getElementById('itchDlg').close()
document.getElementById('itchReload').onclick = () => itchName && openItch(itchName)
document.getElementById('itchOpenDir').onclick = () => itchName && postJson(api(itchName, 'itch/open')).catch((e) => toast(e.message, 'triangle-alert'))
document.getElementById('fltStatus').addEventListener('change', render) document.getElementById('fltStatus').addEventListener('change', render)
document.getElementById('fltSort').addEventListener('change', render) document.getElementById('fltSort').addEventListener('change', render)
document.addEventListener('keydown', (e) => { document.addEventListener('keydown', (e) => {

View File

@@ -547,6 +547,50 @@
.dlg .hint { margin-top: 8px; } .dlg .hint { margin-top: 8px; }
body.no-picker #rdPick { display: none; } body.no-picker #rdPick { display: none; }
.dlgfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; } .dlgfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
/* project panel: action groups, jump links, itch.io copy view */
.agroup-h { display: flex; align-items: center; gap: 6px; margin: 20px 0 -4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.agroup-h::after { content: ""; flex: 1; height: 1px; background: var(--border); }
#sec-actions > .agroup-h:first-child { margin-top: 10px; }
.card-sec h4 .h4r { margin-left: auto; display: flex; gap: 6px; align-items: center; font-weight: 400; }
.card-sec h4 .h4r .i, .isec h4 .h4r .i { color: inherit; }
a.jump { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--accent-text); text-decoration: none; }
a.jump:hover { text-decoration: underline; }
.flabel { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin: 0 0 5px; }
details.progset summary { cursor: pointer; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; list-style: none; }
details.progset summary::-webkit-details-marker { display: none; }
details.progset summary::before { content: "▸"; font-size: 10px; }
details.progset[open] summary::before { content: "▾"; }
details.progset .pickrow { margin-top: 8px; }
.dlg.wide { width: 860px; max-height: calc(100vh - 48px); padding: 0; }
.dlg.wide .ihead { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg.wide .ihead h3 { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 16px; }
.dlg.wide .ihead .sp { flex: 1; }
#itchBody { padding: 4px 20px 20px; }
.isec { margin-top: 16px; }
.isec h4 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.isec h4 > .i { color: var(--accent); }
.isec h4 .h4r { margin-left: auto; display: flex; gap: 6px; }
.copyrow { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.copyrow .cl { color: var(--muted); }
.copyrow .cv { word-break: break-word; }
.copyrow .chip { margin-left: 6px; }
.ipreview { width: 100%; height: 280px; border: 1px solid var(--border); border-radius: 10px; background: #fff; resize: vertical; }
.ipreview.big { height: 520px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.tagrow .cl { flex: 0 0 150px; color: var(--muted); font-size: 13px; }
.tagc { font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.tagc.own { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.tagc.sugg { border-style: dashed; }
.tagc:hover { border-color: var(--accent); }
.igroup { margin-top: 10px; }
.igroup .agroup-h { margin: 0 0 8px; }
.itchgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ishot { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; font: inherit; font-size: 11px; }
.ishot:hover { border-color: var(--accent); }
.ishot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--surface-3); }
.ishot span { display: flex; justify-content: space-between; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ishot small { color: var(--muted); flex: 0 0 auto; }
@media (max-width: 640px) { .copyrow { grid-template-columns: minmax(0, 1fr) auto; } .copyrow .cl { grid-column: 1 / -1; } }
/* settings panel: tabs, lists of folders/targets, chips, footer */ /* settings panel: tabs, lists of folders/targets, chips, footer */
#spanel .phead { padding-bottom: 12px; } #spanel .phead { padding-bottom: 12px; }
.sptabs { padding: 0 20px 12px; border-bottom: 1px solid var(--border); overflow-x: auto; } .sptabs { padding: 0 20px 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
@@ -1063,6 +1107,17 @@
</form> </form>
</dialog> </dialog>
<dialog id="itchDlg" class="dlg wide">
<div class="ihead">
<h3><svg class="i lg"><use href="/icons.svg#rocket"/></svg><span id="itchTitle">itch.io-Seite</span></h3>
<span class="sp"></span>
<button class="btn ghost" type="button" id="itchOpenDir" title="Ordner öffnen"><svg class="i"><use href="/icons.svg#folder-open"/></svg></button>
<button class="btn ghost" type="button" id="itchReload" title="Neu laden"><svg class="i"><use href="/icons.svg#refresh-cw"/></svg></button>
<button class="iconbtn" type="button" id="itchClose" title="Schließen (Esc)"><svg class="i"><use href="/icons.svg#x"/></svg></button>
</div>
<div id="itchBody"></div>
</dialog>
<div id="toast"></div> <div id="toast"></div>
<script src="app.js"></script> <script src="app.js"></script>
</body> </body>

View File

@@ -33,6 +33,7 @@ const activity = require('./lib/activity')
const itch = require('./lib/itch') const itch = require('./lib/itch')
const create = require('./lib/create') const create = require('./lib/create')
const archive = require('./lib/archive') const archive = require('./lib/archive')
const itchpack = require('./lib/itchpack')
const scheduler = require('./lib/scheduler') const scheduler = require('./lib/scheduler')
// The projects folder comes from the settings (lib/settings.js) and can be // The projects folder comes from the settings (lib/settings.js) and can be
@@ -460,6 +461,35 @@ app.post('/api/projects/:name/archive/open', (req, res) => {
openDetached('explorer.exe', [dir]) openDetached('explorer.exe', [dir])
res.json({ ok: true }) res.json({ ok: true })
}) })
// itch.io package (<project>\docs\itchio, lib/itchpack.js): read for the copy
// view, its images, open in Explorer, and Claude Code with the itchiocreater skill.
app.get('/api/projects/:name/itch', (req, res) => {
const projectPath = resolveProject(req.params.name)
if (!projectPath) return res.status(404).json({ error: 'unknown project' })
res.json(itchpack.read(projectPath))
})
app.get('/api/projects/:name/itch/file', (req, res) => {
const projectPath = resolveProject(req.params.name)
const f = projectPath && itchpack.file(projectPath, String(req.query.f ?? ''))
if (!f || !/\.(png|jpe?g|gif|webp)$/i.test(f)) return res.status(404).end()
res.setHeader('Cache-Control', 'no-cache')
res.sendFile(f, (err) => { if (err && !res.headersSent) res.status(404).end() })
})
app.post('/api/projects/:name/itch/open', (req, res) => {
const projectPath = resolveProject(req.params.name)
if (!projectPath) return res.status(404).json({ error: 'unknown project' })
const d = itchpack.dir(projectPath)
if (!d) return res.status(404).json({ error: 'Kein itch.io-Ordner im Projekt' })
const f = req.body?.f ? itchpack.file(projectPath, String(req.body.f)) : null
// explorer wants "/select,<path>" as one argument
openDetached('explorer.exe', f ? [`/select,${f}`] : [d])
res.json({ ok: true })
})
app.post('/api/projects/:name/itch/generate', handle(async (req, res) => {
const projectPath = resolveProject(req.params.name)
if (!projectPath) return res.status(404).json({ error: 'unknown project' })
try { res.json(await itchpack.launch(projectPath, req.params.name)) } catch (e) { res.status(400).json({ error: String(e.message ?? e) }) }
}))
// Rename a project and/or move it into another projects folder (lib/create.js). // Rename a project and/or move it into another projects folder (lib/create.js).
// body: { name, root (folder id, default: its own) } // body: { name, root (folder id, default: its own) }
app.post('/api/projects/:name/move', handle(async (req, res) => { app.post('/api/projects/:name/move', handle(async (req, res) => {
@@ -585,6 +615,7 @@ app.get('/api/projects/:name/details', handle(async (req, res) => {
sshKey: sshKey(), sshKey: sshKey(),
releaseDirs: archive.findReleaseDirs(projectPath), releaseDirs: archive.findReleaseDirs(projectPath),
archives: archive.listArchives(projectPath), archives: archive.listArchives(projectPath),
itchPack: itchpack.summary(projectPath),
}) })
})) }))