CLI Plugins
CLI Plugins provide default handling for the most common lifecycle events during Mountaineer development. Import these if convenient, otherwise you can follow our implementation approaches to implement your own.
Webapp CLI
mountaineer.cli.handle_runserver
handle_runserver(
*,
package,
webservice,
webcontroller,
host="127.0.0.1",
port,
subscribe_to_mountaineer=False
)
Start a local development server. This will hot-reload your browser any time your frontend or backend code changes.
PARAMETER | DESCRIPTION |
---|---|
package |
Ex. "ci_webapp"
TYPE:
|
webservice |
Ex. "ci_webapp.app:app"
TYPE:
|
webcontroller |
Ex. "ci_webapp.app:controller"
TYPE:
|
port |
Desired port for the webapp while running locally
TYPE:
|
subscribe_to_mountaineer |
See
TYPE:
|
mountaineer.cli.handle_watch
handle_watch(
*,
package,
webcontroller,
subscribe_to_mountaineer=False
)
Watch the file directory and rebuild auto-generated files. This only creates the frontend files necessary to get server-side typehints. It doesn't build the package for production use.
PARAMETER | DESCRIPTION |
---|---|
package |
Ex. "ci_webapp"
TYPE:
|
webcontroller |
Ex. "ci_webapp.app:controller"
TYPE:
|
subscribe_to_mountaineer |
If True, will subscribe the local build server to changes in the
TYPE:
|
mountaineer.cli.handle_build
handle_build(*, webcontroller, minify=True)
Creates a production bundle of frontend files that is ready for service.
Building your app will compile your TypeScript into the client-side bundle that will be downloaded
by the browser. It also ahead-of-time generates the server code that will be run as part of SSR.
You'll want to do it before deploying your application into production - but since a full build can take up
to 10s, handle_runserver
provides a better workflow for daily development.
PARAMETER | DESCRIPTION |
---|---|
webcontroller |
Ex. "ci_webapp.app:controller"
TYPE:
|
minify |
Minify the JS bundle, strip debug symbols
TYPE:
|
Building your app will compile your TypeScript into the client-side bundle that will be downloaded
by the browser. It also ahead-of-time generates the server code that will be run as part of SSR.
You'll want to do it before deploying your application into production - but since a full build can take up
to 10s, handle_runserver
provides a better workflow for daily development.
Database CLI
mountaineer.database.cli.handle_createdb
async
handle_createdb(*args, **kwargs)
Strictly speaking, passing a list of models isn't required for this function. We'll happily
accept being called with handle_createdb()
. We just encourage an explicit passing of either
the models module or the SQLModels themselves to make sure they are in-scope of the table
registry when this function is run. This is how we determine which tables to create at runtime.
PARAMETER | DESCRIPTION |
---|---|
model_module |
The module containing the SQLModels to create
|
models |
An explicit list of SQLModels to create
|