Repository navigation
Description
Parent
What to build
Create src/app/store/command/ and move the two small command builders, the command string and the settings-file text into it. The RAxML and RAxML-NG builders stay in Run.ts for the next ticket.
command/astral.ts:astralArgs( run: AstralInput, platform: Platform ): string[][].command/modeltestNg.ts:modeltestNgArgs( run: ModeltestNgInput, platform: Platform ): CmdArg[][].command/index.ts: theCmdArgtype, thePlatformtype ({ windows: boolean }), the command string function and the settings-text function.
Each builder declares its own input interface in its own file, listing only the members it reads, mirroring the nesting Run has today. AstralInput is outputDir, outputNameSafe and astralTree. ModeltestNgInput is outputDir, outputNameSafe, dataType, finalAlignment: { path } and numThreads: { value }. The platform is the second argument; no file under command/ reads host.
The command string function takes the binary name, the argument lists, and whether the binary is ASTRAL. The settings-text function takes the app version, the analysis title, the binary's name and version, the output folder, and the argument lists. Neither takes a run.
In Run.ts: the astralArgs and modeltestNgArgs methods are removed. The args getter calls the two moved builders with this and { windows }, and still calls this.raxmlNgArgs() and this.raxmlArgs(). The command and settingsFileContent getters stay and call the two new functions. CmdArg is imported from command/.
Builder bodies move with this. replaced by run. and no other edit; comments move with the code. The typed shape was checked against the real Run in commandInput.prototype.ts; copy from it, don't merge its branch.
Add one small direct test per builder file that runs the builder on a plain object for both platforms.
Acceptance criteria
-
command/astral.ts,command/modeltestNg.tsandcommand/index.tsexist with the signatures above - No file under
command/importsRun, MobX orhost -
Runhas noastralArgsormodeltestNgArgsmember -
run.args,run.commandandrun.settingsFileContentare still getters onRunand still listed in itsmakeObservablecall - The moved builder bodies differ from the originals only by
this.becomingrun.; their comments moved with them - One direct test per builder file runs it on a plain object with
windows: trueandwindows: false - No command pin snapshot file appears in the diff
- No view,
RunOptions.ts,Alignment.tsorFinalAlignment.tschanges -
yarn verifypasses
Activity
Move the ASTRAL and ModelTest-NG command builders out of Run.ts (#421) (