Export the app to a zip file.
(
zip: bool,
frontend_only: bool,
backend_only: bool,
zip_dest_dir: str,
upload_db_file: bool,
env: LITERAL_ENV,
backend_excluded_dirs: tuple[Path, ...] = (),
ssr: bool = True,
)
| 558 | help="Whether to enable server side rendering for the frontend.", |
| 559 | ) |
| 560 | def export( |
| 561 | zip: bool, |
| 562 | frontend_only: bool, |
| 563 | backend_only: bool, |
| 564 | zip_dest_dir: str, |
| 565 | upload_db_file: bool, |
| 566 | env: LITERAL_ENV, |
| 567 | backend_excluded_dirs: tuple[Path, ...] = (), |
| 568 | ssr: bool = True, |
| 569 | ): |
| 570 | """Export the app to a zip file.""" |
| 571 | from reflex.utils import export as export_utils |
| 572 | from reflex.utils import prerequisites |
| 573 | |
| 574 | if not environment.REFLEX_SSR.is_set(): |
| 575 | environment.REFLEX_SSR.set(ssr) |
| 576 | elif environment.REFLEX_SSR.get() != ssr: |
| 577 | ssr = environment.REFLEX_SSR.get() |
| 578 | |
| 579 | environment.REFLEX_COMPILE_CONTEXT.set(constants.CompileContext.EXPORT) |
| 580 | |
| 581 | running_mode = prerequisites.check_running_mode(frontend_only, backend_only) |
| 582 | |
| 583 | config = get_config() |
| 584 | |
| 585 | prerequisites.assert_in_reflex_dir() |
| 586 | |
| 587 | if running_mode.has_frontend() and prerequisites.needs_reinit(): |
| 588 | _init(name=config.app_name) |
| 589 | |
| 590 | export_utils.export( |
| 591 | zipping=zip, |
| 592 | frontend=running_mode.has_frontend(), |
| 593 | backend=running_mode.has_backend(), |
| 594 | zip_dest_dir=zip_dest_dir, |
| 595 | upload_db_file=upload_db_file, |
| 596 | env=constants.Env.DEV if env == constants.Env.DEV else constants.Env.PROD, |
| 597 | loglevel=config.loglevel.subprocess_level(), |
| 598 | backend_excluded_dirs=backend_excluded_dirs, |
| 599 | prerender_routes=ssr, |
| 600 | ) |
| 601 | |
| 602 | |
| 603 | @cli.command() |
nothing calls this directly
no test coverage detected