diff --git a/docs/index.html b/docs/index.html index 0d93a4b..6042246 100644 --- a/docs/index.html +++ b/docs/index.html @@ -310,6 +310,17 @@ footer a { color: inherit; }
Any time

Changelog

Picks the next version and drafts the entries, which you edit before Git commits them.

Any time

Git

A board for branches, pull, push and commits that opens on the likely next step.

+ +
+ + + The git board on feature/task-endpoints: the Changes tab, badged 3, opens on a Next step card reading Commit 3 files, above the three changed files ticked for the commit. Branches and Sync tabs and a Done with git button sit beside it. + +
+

The git board

+

Three tabs, Changes, Branches and Sync, and it opens on the one holding your likely next step: commit, pull, push, publish, open a pull request or tidy up branches. That step is one main button. Each tab badges what is waiting on it, a stopped rebase or merge gets one block with every file marked, and nothing is pushed, published or deleted without asking. It never force-pushes.

+
+
diff --git a/docs/screenshots/git-dark.webp b/docs/screenshots/git-dark.webp new file mode 100644 index 0000000..8d7a6c4 Binary files /dev/null and b/docs/screenshots/git-dark.webp differ diff --git a/docs/screenshots/git-light.webp b/docs/screenshots/git-light.webp new file mode 100644 index 0000000..94ff5a3 Binary files /dev/null and b/docs/screenshots/git-light.webp differ diff --git a/scripts/capture-screenshots.mjs b/scripts/capture-screenshots.mjs index 74866c8..808062a 100644 --- a/scripts/capture-screenshots.mjs +++ b/scripts/capture-screenshots.mjs @@ -13,7 +13,7 @@ // The shots use the console's Ocean highlight rather than its default orange: // it is the console's nearest to the Plan2Code blue the site and README use. // -// Shots: dashboard, dashboard-utilities, question, doc, build, signoff, finish, ask. +// Shots: dashboard, dashboard-utilities, question, doc, build, signoff, finish, ask, git. // // Needs puppeteer-core (`npm i --no-save puppeteer-core`, never added to // package.json) and a local Chrome or Edge. Writes nothing outside its temp @@ -67,6 +67,9 @@ const SHOTS = { signoff: { workflow: "implement", posts: ["signoff"] }, finish: { workflow: "implement", posts: ["signoff", "finish"] }, ask: { workflow: "plan", posts: ["question"], ask: "Where are tasks paged?" }, + // The git board draws itself from a real repository, so this shot runs in + // its own git sample project; the post only hands the board back to you. + git: { workflow: "git", posts: ["git"], repo: true }, }; // On Windows the temp dir sits under the user's profile, and the page can @@ -166,6 +169,46 @@ function makeSampleProject() { return project; } +function git(cwd, ...gitArgs) { + const r = spawnSync("git", gitArgs, { cwd, env: ENV, encoding: "utf8" }); + if (r.status !== 0) throw new Error(`git ${gitArgs.join(" ")} failed: ${(r.stderr || "").trim()}`); +} + +// The git shot's project: the same sample in a repository whose feature branch +// is pushed to a local bare "origin" and has three changes to commit, so the +// board opens on Changes with Commit as the next step. It sits in its own +// folder so the other shots never see a repository. +let GIT_PROJECT = null; +function makeGitProject() { + if (GIT_PROJECT) return GIT_PROJECT; + const parent = path.join(SCRATCH, "git"); + fs.mkdirSync(parent, { recursive: true }); + const origin = path.join(parent, "origin.git"); + git(parent, "init", "--bare", "--initial-branch=main", origin); + const prev = SCRATCH; + SCRATCH = parent; + const project = makeSampleProject(); + SCRATCH = prev; + const id = ["-c", "user.name=Sam Rivera", "-c", "user.email=sam@example.com", "-c", "commit.gpgsign=false"]; + git(project, "init", "--initial-branch=main"); + git(project, "remote", "add", "origin", origin); + git(project, "add", "-A"); + git(project, ...id, "commit", "-m", "Scaffold the task API and its specs"); + git(project, "push", "-u", "origin", "main"); + git(project, "switch", "-c", "feature/task-endpoints"); + fs.writeFileSync(path.join(project, "src", "tasks", "routes.js"), "// The /tasks routes.\nexport default async function routes(app) {}\n"); + git(project, "add", "-A"); + git(project, ...id, "commit", "-m", "Register the /tasks routes plugin"); + git(project, "push", "-u", "origin", "feature/task-endpoints"); + // A fetch stamps FETCH_HEAD, so the board says "Last refreshed" rather than "Never". + git(project, "fetch", "origin"); + fs.appendFileSync(path.join(project, "src", "tasks", "paginate.js"), "\nexport const MAX_LIMIT = 50;\n"); + fs.writeFileSync(path.join(project, "src", "tasks", "schema.js"), "// The Zod schema for a task.\nexport const taskSchema = {};\n"); + fs.appendFileSync(path.join(project, "specs", "task-api", "phase-3.md"), "\n\n"); + GIT_PROJECT = project; + return project; +} + function cli(cwd, ...cliArgs) { const r = spawnSync(process.execPath, [CONSOLE_CLI, ...cliArgs], { cwd, env: ENV, encoding: "utf8" }); const line = (r.stdout || "").trim().split("\n").pop() || ""; @@ -194,7 +237,7 @@ function stage(project, shot) { // (the dashboard's wake-up is the longest). async function settle(page) { await page.waitForNetworkIdle({ idleTime: 500, timeout: 15000 }).catch(() => {}); - await page.waitForSelector(".dash-card, .card, .handoff, .ask-pane, .doc", { timeout: 15000 }).catch(() => {}); + await page.waitForSelector(".dash-card, .card, .handoff, .ask-pane, .doc, .git-board", { timeout: 15000 }).catch(() => {}); await sleep(3500); } @@ -348,12 +391,13 @@ async function main() { args: ["--no-first-run", "--no-default-browser-check", "--mute-audio"], }); for (const name of names) { - const { sid, url } = stage(project, name); + const where = SHOTS[name].repo ? makeGitProject() : project; + const { sid, url } = stage(where, name); try { - if (SHOTS[name].ask) await captureAsk(browser, project, sid, url, SHOTS[name].ask); + if (SHOTS[name].ask) await captureAsk(browser, where, sid, url, SHOTS[name].ask); else await capture(browser, url, name, SHOTS[name]); } finally { - cli(project, "stop", "--session", sid); + cli(where, "stop", "--session", sid); } } } finally { diff --git a/scripts/screenshots/README.md b/scripts/screenshots/README.md index 0ec0cde..e57223e 100644 --- a/scripts/screenshots/README.md +++ b/scripts/screenshots/README.md @@ -13,6 +13,7 @@ and dark WebP images in `docs/screenshots/`. | `build.json` | A phase being built: the progress bar, the task list and the current task | | `signoff.json` | The completion report and the sign-off card | | `finish.json` | The finished screen after sign-off (posted after `signoff.json`) | +| `git.json` | The git board, handed back to you in a sample repository with three changes to commit (the script builds the repository) | Refresh every image with `node scripts/capture-screenshots.mjs`, or one with `--only `. diff --git a/scripts/screenshots/git.json b/scripts/screenshots/git.json new file mode 100644 index 0000000..cb78e4b --- /dev/null +++ b/scripts/screenshots/git.json @@ -0,0 +1,5 @@ +{ + "reread": true, + "board": { "describe": "task-schema-and-paging" }, + "agent": { "status": "waiting" } +}