mirror of
https://github.com/bmad-code-org/BMAD-METHOD.git
synced 2026-09-19 08:11:52 +08:00
5247108ba3
* fix(installer): submit the path shown and retire WDS from the picker Directory prompt The installation-directory prompt was a clack AutocompletePrompt whose render() drew only the text line. The candidate list existed but was never shown, and Enter returns the focused option rather than the typed text. Focus was sticky: it only reset when the previously focused value left the list, so a subdirectory selected while narrowing survived deleting back to the parent. Typing /path/to/workspace could install to /path/to/workspace/some-child with no sign of it on screen. Rebuilt on TextPrompt so the input line is the value: - the candidate list is visible, windowed, with an active-row marker - arrow keys and Tab write the highlighted candidate onto the input line - the list is frozen against the last typed text while browsing, so arrows walk siblings instead of descending (this also unsticks Tab cycling) - index -1 is the typed text, so backing out of the list restores it - Tab completes to real directories only, skipping "Create/use:" entries - directory() takes optional input/output streams so it is testable Module registry - WDS is marked deprecated: hidden from the picker unless already installed, shown with a notice when it is, never removed and still resolvable from its source so existing installs keep updating - deprecation notices now reach the CLI paths (--modules, --yes) and quick-update, which never render the picker's option hints - picker order is now bmm, bmb, cis, tea, bmad-loop, gds - the core row is hidden; it was a locked always-on checkbox. core is still added to the result, and the picker no longer requires a selection so a core-only install stays possible * fix(installer): replace the whole line when browsing directories _clearUserInput() sends readline ctrl+u, which deletes only what is left of the cursor, and _setUserInput() inserts at the cursor. Browsing after an arrow-key edit therefore left the surviving tail appended to the selected candidate: typing a path, pressing left three times, then down twice submitted ".../workspaceace" instead of ".../workspace/alpha". validateDirectorySync accepts that path when its parent exists, so the install went somewhere the user never typed - the same silent-divergence class this prompt was rebuilt to prevent. replaceLine() now moves to end of line (ctrl+e) before clearing. This also fixes the pre-existing instance of the bug on Tab. Alongside it: - shift+tab steps back through completions instead of acting as tab - the "... N more" counter counts only entries below the window, not every off-window entry, which overstated it once scrolled - an empty line resolves the default through expandHome/path.resolve, and seeds the candidate list from the same place, so the list always describes what Enter would submit - selectAllModules JSDoc no longer claims core is excluded - test escape sequences are written as escapes rather than raw bytes, and the keystroke driver has wider timing margins for CI * refactor(installer): make the directory prompt a plain text entry The candidate list, key hints and completion cycling were noise for the common case: people run the installer from the directory they want to install into, or one under it. Enter on an empty line already accepts that, so the list mostly served to push the actual question off screen. Removed the list rendering, the hint line, arrow/Tab browsing and the helpers that fed them (listDirectoryOptions, directoryWindow and the directory-probing utilities). What remains is a clack TextPrompt with a placeholder showing the default. The original defect stays fixed by construction rather than by bookkeeping: TextPrompt's value is the text on the input line, so there is no hidden selection that Enter could submit instead. Net effect on prompts.js versus main is -66 lines. * docs(installer): shorten module descriptions in the picker The hint beside a highlighted module ran long enough to wrap, which made the list harder to scan than the module names alone. Each description is now a single short phrase: - bmm Agile AI driven development - bmb Skill, workflow, and agent builder - cis Brainstorming, ideation, and creative problem solving - tea Enterprise testing BMM add-on - loop Builds, verifies, and retros a whole epic unattended - gds Ideate, design, and build games in any framework TEA is the only module that depends on BMM, and its description now says so. The others no longer imply it. "Loop" means nothing to a new user, so that description leads with what the module does rather than its name, and gds no longer enumerates engines. * feat(installer): pre-fill the directory prompt with the current directory The default was shown as dim placeholder text, so choosing anything near it meant typing the whole path by hand. It is now the real starting value on the input line: press Enter to take it, append to install one level down, or backspace to move up. Clearing the line and pressing Enter still accepts the default, and the placeholder remains for that case. * docs: reposition on Agile Ai Driven Development The tagline was absent from the installer and the README, and the slot under the wordmark where a tagline belongs was carrying the company line instead. AiDD is the category BMad Method operates in; the agile part is what BMad adds to it. Installer: - the banner reads tagline, then positioning, then company credit, in descending weight - bmm and cis picker descriptions match, with cis short enough that its row no longer wraps and shifts the list as you arrow onto it README: - the opening states the phrase, defines AiDD on first use, and drops the rhetorical "heard BMad means heavyweight process?" framing while keeping what it was defending - greenfield lean corrected: the opening now states the range, "add BMad to an existing codebase" is a CTA above the fold rather than a link at line 57, and a bullet names working from verified context on inherited code. Everything above the fold previously scaled by change size and nothing by codebase maturity, so a brownfield reader had no answer. - the module table matches the installer descriptions, uses full module names instead of letter codes, and adds BMad Loop, which was missing * docs: carry the module descriptions into the translated READMEs Game Dev Studio was the last picker row wide enough to wrap an 80-column terminal, which shifts the list as you arrow onto it. The engine list stays in the README tables, where there is room for it. The Chinese and Vietnamese READMEs have their own structure rather than being a translation of the current English one, so this only touches the two parts that had gone stale against the installer: the opening positioning line and the module table. Both tables now match the English one - installer descriptions, full module names instead of letter codes, and BMad Loop, which none of the three had. The translated prose needs a native reviewer before release.
58 lines
3.6 KiB
JavaScript
58 lines
3.6 KiB
JavaScript
const prompts = require('./prompts');
|
|
|
|
const CLIUtils = {
|
|
/**
|
|
* Display BMAD logo and version using @clack intro + box
|
|
*/
|
|
async displayLogo() {
|
|
const color = await prompts.getColor();
|
|
const termWidth = process.stdout.columns || 80;
|
|
|
|
// Full "BMad Method" logo for wide terminals, "BMad" only for narrow
|
|
const logoWide = [
|
|
' ██████╗ ███╗ ███╗ █████╗ ██████╗ ███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ™',
|
|
'██╔══██╗████╗ ████║██╔══██╗██╔══██╗ ████╗ ████║██╔════╝╚══██╔══╝██║ ██║██╔═══██╗██╔══██╗',
|
|
'██████╔╝██╔████╔██║███████║██║ ██║ ██╔████╔██║█████╗ ██║ ███████║██║ ██║██║ ██║',
|
|
'██╔══██╗██║╚██╔╝██║██╔══██║██║ ██║ ██║╚██╔╝██║██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║',
|
|
'██████╔╝██║ ╚═╝ ██║██║ ██║██████╔╝ ██║ ╚═╝ ██║███████╗ ██║ ██║ ██║╚██████╔╝██████╔╝',
|
|
'╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ',
|
|
];
|
|
|
|
const logoNarrow = [
|
|
' ██████╗ ███╗ ███╗ █████╗ ██████╗ ™',
|
|
' ██╔══██╗████╗ ████║██╔══██╗██╔══██╗',
|
|
' ██████╔╝██╔████╔██║███████║██║ ██║',
|
|
' ██╔══██╗██║╚██╔╝██║██╔══██║██║ ██║',
|
|
' ██████╔╝██║ ╚═╝ ██║██║ ██║██████╔╝',
|
|
' ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝',
|
|
];
|
|
|
|
const logoLines = termWidth >= 95 ? logoWide : logoNarrow;
|
|
const logo = logoLines.map((line) => color.blue(line)).join('\n');
|
|
// The wordmark supplies "BMad Method", so the lines below read as its
|
|
// tagline, then its positioning, then the company credit.
|
|
const tagline = color.white(' Agile Ai Driven Development');
|
|
const slogan = color.dim(' the agile way to do AiDD');
|
|
const credit = color.dim(' Build More, Architect Dreams · © BMad Code');
|
|
|
|
await prompts.box(`${logo}\n${tagline}\n${slogan}\n${credit}`, '', {
|
|
contentAlign: 'center',
|
|
rounded: true,
|
|
formatBorder: color.blue,
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Display module configuration header
|
|
* @param {string} moduleName - Module name (fallback if no custom header)
|
|
* @param {string} header - Custom header from module.yaml
|
|
* @param {string} subheader - Custom subheader from module.yaml
|
|
*/
|
|
async displayModuleConfigHeader(moduleName, header = null, subheader = null) {
|
|
const title = header || `Configuring ${moduleName.toUpperCase()} Module`;
|
|
await prompts.note(subheader || '', title);
|
|
},
|
|
};
|
|
|
|
module.exports = { CLIUtils };
|