% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dt2_check_updates.R
\name{dt2_update_libs}
\alias{dt2_update_libs}
\title{Update DataTables JS/CSS libraries (developer tool)}
\usage{
dt2_update_libs(pkg_dir = ".", download = TRUE, dry_run = FALSE)
}
\arguments{
\item{pkg_dir}{Path to the DT2 source root (the directory containing
\code{DESCRIPTION}). Defaults to the current working directory.}

\item{download}{Logical. If \code{TRUE}, runs the shell script after
patching version numbers. Default \code{TRUE}.}

\item{dry_run}{Logical. If \code{TRUE}, shows what would change without
modifying any files. Default \code{FALSE}.}
}
\value{
Invisibly, a data.frame with the update results.
}
\description{
Checks for updates (respecting version constraints), patches version
numbers in the source files, and optionally runs
\code{tools/get-dt2-libs.sh} to download the new files.
}
\details{
This function only works from the \strong{package source tree} (i.e.
during development). It will refuse to run from an installed package.

The workflow is:
\enumerate{
\item Query npm for the latest compatible version of every library.
\item Patch \code{tools/get-dt2-libs.sh} (version variables).
\item Patch \code{R/dt2_extensions.R} (extension registry).
\item Patch \code{R/dt2_check_updates.R} (core lib versions).
\item Patch \code{R/dt2_deps.R} (DataTables core version).
\item Run \code{bash tools/get-dt2-libs.sh} to download the files.
}

Version constraints prevent incompatible upgrades:
\itemize{
\item jQuery is pinned to 3.x (DataTables 2 requires jQuery 3).
\item pdfmake is pinned to 0.2.x (0.3.x has breaking changes and
is not available on cdnjs).
\item Bootstrap is pinned to 5.x.
}

Libraries marked as \code{"PINNED"} are skipped. Only \code{"UPDATE"}
items are applied.
}
\examples{
\dontrun{
# 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)
}
}
