fetch_webawesomeR Documentation

Fetch a pinned Web Awesome dist-cdn bundle

Description

Downloads a specific version of the upstream Web Awesome npm package using 'npm pack', extracts the package tarball in a temporary directory, and copies the upstream browser-ready 'dist-cdn/' tree into 'vendor/webawesome/<version>/dist-cdn/'. The fetched version is also recorded in 'vendor/webawesome/<version>/VERSION'.

Usage

fetch_webawesome(
  version = NULL,
  root = ".",
  package_name = .default_webawesome_package(),
  version_file = .default_version_file(),
  command_runner = .run_fetch_command,
  verbose = interactive()
)

Arguments

version

Optional Web Awesome version string. If 'NULL', reads the pinned version from 'dev/webawesome-version.txt'.

root

Repository root directory.

package_name

Upstream npm package name. Defaults to '"@awesome.me/webawesome"'.

version_file

Path to the pinned version file, relative to the repository root.

command_runner

Function used to run external commands. Primarily intended for testing.

verbose

Logical scalar. If 'TRUE', emits a short fetch summary.

Details

If 'version' is 'NULL', the version pinned in 'dev/webawesome-version.txt' is used.

This tool uses 'npm' by default. If the desired executable is not already on 'PATH', set 'SHINY_WEBAWESOME_NPM' to the command or path that should be used for 'npm pack'.

CLI entry point: './tools/fetch_webawesome.R –help'

Value

A list describing the fetch operation, including the resolved version, package name, target directory, and copied paths.

Examples

## Not run: 
fetch_webawesome()
fetch_webawesome(version = "3.3.1")

## End(Not run)