Skip to contents

Builds a distributable Electron application from a converted Shiny app. Creates platform-specific installers and executables.

Usage

build_electron_app(
  app_dir,
  output_dir,
  app_name = NULL,
  app_type = "r-shinylive",
  platform = NULL,
  arch = NULL,
  icon = NULL,
  overwrite = FALSE,
  verbose = TRUE
)

Arguments

app_dir

Character string. Path to the converted Shiny/shinylive application.

output_dir

Character string. Path where the built Electron app will be saved.

app_name

Character string. Name of the application. If NULL, uses the base name of app_dir.

app_type

Character string. Type of application: "r-shinylive", "r-shiny", "py-shinylive", or "py-shiny".

platform

Character vector. Target platforms: "win", "mac", "linux". If NULL, builds for current platform.

arch

Character vector. Target architectures: "x64", "arm64". If NULL, uses current architecture.

icon

Character string. Path to application icon file. Platform-specific format required.

overwrite

Logical. Whether to overwrite existing output directory. Default is FALSE.

verbose

Logical. Whether to display detailed progress information. Default is TRUE.

Value

Character string. Path to the built Electron application directory.

Details

This function creates a complete Electron application by:

  • Setting up the Electron project structure

  • Copying application files and templates

  • Installing npm dependencies

  • Building platform-specific distributables

Examples

if (FALSE) { # \dontrun{
# Build Electron app for current platform
build_electron_app(
  app_dir = "path/to/shinylive/app",
  output_dir = "path/to/electron/build",
  app_name = "My Shiny App",
  app_type = "r-shinylive"
)

# Build for multiple platforms
build_electron_app(
  app_dir = "path/to/app",
  output_dir = "path/to/build",
  app_name = "My App",
  app_type = "r-shinylive",
  platform = c("win", "mac", "linux")
)
} # }