Revised App Builder script
There are several known issues with the current AB scripts:
| Issue | Resolution |
| CLI can be left in the wrong module group (e.g. user cancels the script at the "wrong" time) | Switch a bootstrap module instead of the CLI. |
| CLI rollback history is dropped (on the first run, startAppBuilder switches the CLI to experimental in order to create the appbuilder module; as a result, the user's rollback history is lost) | Same as previous: Switch a bootstrap module instead of the CLI. |
| Servicing the scripts requires a CLI update. | Refactor the scripts following the pattern of the "zero" script: Minimal bootstrap capability in CLI; all remaining functionality goes into the repository. |
| Can be slow to create the first "stable" module. | Create a "stable" module as part of the bootstrap process (primes the module group with the dependencies needed for a new module). |
Refactored scripts
We'll change from using command-specific scripts (e.g. startAppBuilder) to one script that takes commands as arguments (e.g. appbuilder start). This will allow us to change/add/remove commands without servicing the CLI.
We'll implement a three-tiered solution, with progressive serviceability: A minimal script in the CLI (ideally doesn't need to be serviced) invokes a script in zero.cli.tasks (serviceable at the rate of updates to stable modulegroup), which then invokes a third script in experimental / zero.appbuilder (serviceable as needed):
File: zero.cli/appbuilder[.bat]
- zero version (a no-op command that ensures the CLI has been bootstrapped)
- execute zero.cli.tasks/appbuilder "args"
File: zero.cli.tasks/appbuilder[.bat]
- cd ZERO_HOME
- if (!installed/appbuilder) then
- delete appbuilder.bootstrap (just to be sure)
- zero create appbuilder.bootstrap
- cd appbuilder.bootstrap
- zero modulegroup create experimental
- zero switch experimental
- zero create ../installed/appbuilder
- cd ..
- delete appbuilder.bootstrap
- cd installed/appbuilder
- execute zero.appbuilder/appbuilder "args"
File: zero.appbuilder/appbuilder[.bat]
# optional check/override on args
# for example, "appbuilder open" might be handled here by calling "zero start" then launching the browser
# everything else falls through as a CLI invocation
- zero "args"
Commands
- start (zero start)
- stop (zero stop)
- open (zero start followed by opening the browser to the AB URI)
- latest (should be a verb; ideas? the steps are documented as a manual operation today)