From 1d325d1fdbacf69a608db72509a760fc7eb7e246 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 28 Aug 2023 12:42:27 +0200 Subject: [PATCH] gnu: r-bslib: Update to 0.5.1. * gnu/packages/cran.scm (r-bslib): Update to 0.5.1. [source]: Delete more minified JavaScript files. [arguments]: Adjust JavaScript build code. [native-inputs]: Update typescript-components repository. --- gnu/packages/cran.scm | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index 760f1c020f..9ef9ac1a76 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -4328,19 +4328,21 @@ expression estimates for all genes.") (define-public r-bslib (package (name "r-bslib") - (version "0.5.0") + (version "0.5.1") (source (origin (method url-fetch) (uri (cran-uri "bslib" version)) (sha256 (base32 - "05fi1cbb33hvrxx3vibbai7bzlx60jxd3iaqpc86x0224b3gpim2")) + "03phbr6zax3898yvdfqmrs0sjiik4pfn34ksysf95fp348in2xdi")) (snippet '(for-each delete-file - '("inst/components/accordion.min.js" - "inst/components/card.min.js" - "inst/components/sidebar.min.js" + '("inst/components/dist/accordion/accordion.min.js" + "inst/components/dist/bslibShiny/bslibShiny.min.js" + "inst/components/dist/card/card.min.js" + "inst/components/dist/sidebar/sidebar.min.js" + "inst/components/dist/webComponents/webComponents.min.js" "inst/lib/bs-a11y-p/plugins/js/bootstrap-accessibility.min.js" "inst/lib/bs3/assets/javascripts/bootstrap.min.js" "inst/lib/bs4/dist/js/bootstrap.bundle.min.js" @@ -4360,13 +4362,28 @@ expression estimates for all genes.") (for-each (lambda (component) (invoke "esbuild" "--bundle" "--minify" "--sourcemap" - "--target=es6" ;"--external=:bootstrap" + "--target=es6" ;"--external=:bootstrap" (string-append #$(this-package-native-input "typescript-components") "/srcts/src/components/" component ".ts") - (string-append "--outfile=inst/components/" - component ".min.js"))) - '("accordion" "sidebar" "card")) + (string-append "--outfile=inst/components/dist/" + component "/" component ".min.js"))) + '("accordion" "bslibShiny" "card" "sidebar")) + ;; XXX: webComponents requires "lit" for type annotations, which + ;; we cannot easily build. + (with-directory-excursion "inst/" + (call-with-values + (lambda () + (unzip2 + `(("components/dist/webComponents/webComponents.js" + "components/dist/webComponents/webComponents.min.js")))) + (lambda (sources targets) + (for-each (lambda (source target) + (format #t "Processing ~a --> ~a~%" + source target) + (invoke "esbuild" source "--minify" + (string-append "--outfile=" target))) + sources targets)))) (with-directory-excursion "inst/lib/" (call-with-values (lambda () @@ -4423,7 +4440,7 @@ expression estimates for all genes.") (file-name (git-file-name name version)) (sha256 (base32 - "1krmavvbnpikiyxgv36vf70p8qzy1rymh1l41pjc7z74hk526p7c")))))) + "0rvwdn1xg7vwphq0bpa7s81f2d2xyhmy5kb516b0lxvc7qfdypa4")))))) (home-page "https://rstudio.github.io/bslib/") (synopsis "Custom Bootstrap Sass themes for shiny and rmarkdown") (description