View source: R/dt2_check_updates.R
| dt2_update_libs | R Documentation |
Checks for updates (respecting version constraints), patches version
numbers in the source files, and optionally runs
tools/get-dt2-libs.sh to download the new files.
dt2_update_libs(pkg_dir = ".", download = TRUE, dry_run = FALSE)
pkg_dir |
Path to the DT2 source root (the directory containing
|
download |
Logical. If |
dry_run |
Logical. If |
This function only works from the package source tree (i.e. during development). It will refuse to run from an installed package.
The workflow is:
Query npm for the latest compatible version of every library.
Patch tools/get-dt2-libs.sh (version variables).
Patch R/dt2_extensions.R (extension registry).
Patch R/dt2_check_updates.R (core lib versions).
Patch R/dt2_deps.R (DataTables core version).
Run bash tools/get-dt2-libs.sh to download the files.
Version constraints prevent incompatible upgrades:
jQuery is pinned to 3.x (DataTables 2 requires jQuery 3).
pdfmake is pinned to 0.2.x (0.3.x has breaking changes and is not available on cdnjs).
Bootstrap is pinned to 5.x.
Libraries marked as "PINNED" are skipped. Only "UPDATE"
items are applied.
Invisibly, a data.frame with the update results.
## Not run:
# Developer-only tool: requires the DT2 package source tree
# (DESCRIPTION, tools/get-dt2-libs.sh, R/dt2_extensions.R, ...).
# It cannot run from an installed package, so it is not executable
# in CRAN check or from a regular user session.
# from the DT2 source root:
dt2_update_libs()
# preview changes without modifying anything:
dt2_update_libs(dry_run = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.