Skip to content

Commit

Permalink
Merge pull request #20 from simon-smart88/dev
Browse files Browse the repository at this point in the history
Merge 0.2.2
  • Loading branch information
simon-smart88 authored Dec 11, 2024
2 parents c50e345 + 9546ba1 commit 15d1c76
Show file tree
Hide file tree
Showing 68 changed files with 2,147 additions and 1,489 deletions.
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ Dockerfile
runtime.txt
apt.txt
install.R
inst/shiny/rsconnect/
inst/shiny/debug*
inst/shiny/install*
.lintr
paper/
renv.lock
61 changes: 61 additions & 0 deletions .github/workflows/R-CMD-check-no-suggests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# via https://github.com/tidymodels/workflowsets/blob/main/.github/workflows/R-CMD-check-no-suggests.yaml
#
# NOTE: This workflow only directly installs "hard" dependencies, i.e. Depends,
# Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never
# installed, with the exception of testthat, knitr, and rmarkdown. The cache is
# never used to avoid accidentally restoring a cache containing a suggested
# dependency.
on:
push:
branches:
'**'
pull_request:
branches: [master]

name: R-CMD-check-no-suggests.yaml

permissions: read-all

jobs:
check-no-suggests:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"hard"'
cache: false
extra-packages: |
any::rcmdcheck
any::testthat
any::shinytest2
any::knitr
any::rmarkdown
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
build_args: 'c("--no-manual")'
70 changes: 47 additions & 23 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,54 +1,78 @@
Package: shinyscholar
Version: 0.2.1
Date: 2024-09-26
Title: A template for creating modular reproducible shiny applications
Description: The 'shiny' application shinyscholar is a modular platform for
creating reproducible applications to academic standards. 'shinyscholar' is
forked from 'wallace' and provides a template for producing applications
that are interactive, reproducible, adaptable and built to high standards.
Version: 0.2.2
Date: 2024-12-10
Title: A template for creating reproducible 'shiny' applications
Description: Create a skeleton shiny application with create_template() that is
reproducible, can be saved and meets academic standards for attribution.
Forked from 'wallace'. Code is split into modules that are loaded and linked
together automatically and each call one function. Guidance pages explain
modules to users and flexible logging informs them of any errors. Options
enable asynchronous operations, viewing of source code, interactive maps and
data tables. Use to create complex analytical applications, following best
practices in open science and software development. Includes functions for
automating repetitive development tasks and an example application at
run_shinyscholar() that requires
install.packages("shinyscholar", dependencies = TRUE).
Authors@R:
c(person("Simon E. H.", "Smart", email = "[email protected]", role = c("aut","cre")))
c(person("Simon E. H.", "Smart", email = "[email protected]", role = c("aut", "cre", "cph")),
person("Jamie M.", "Kass", email = "[email protected]", role = "ctb"),
person("Gonzalo E.", "Pinilla-Buitrago", email = "[email protected]", role = "ctb"),
person("Andrea", "Paz", email = "[email protected]", role = "ctb"),
person("Bethany A.", "Johnson", email = "[email protected]", role = "ctb"),
person("Valentina", "Grisales-Betancur", email = "[email protected]", role = "ctb"),
person("Dean", "Attali", email = "[email protected]", role = "ctb"),
person("Matthew E.", "Aiello-Lammens", email = "[email protected]", role = "ctb"),
person("Cory", "Merow", email = "[email protected]", role = "ctb"),
person("Mary E.", "Blair", email = "[email protected]", role = "ctb"),
person("Robert P.", "Anderson", email = "[email protected]", role = "ctb"),
person("Sarah I.", "Meenan", email = "[email protected]", role = "ctb"),
person("Olivier", "Broennimann", email = "[email protected]", role = "ctb"),
person("Peter J.", "Galante", email = "[email protected]", role = "ctb"),
person("Brian S.", "Maitner", email = "[email protected]", role = "ctb"),
person("Hannah L.", "Owens", email = "[email protected]", role = "ctb"),
person("Sara", "Varela", email = "[email protected]", role = "ctb"),
person("Bruno", "Vilela", email = "[email protected]", role = "ctb"),
person("Robert", "Muscarella", email = "[email protected]", role = "ctb"))
Depends:
R (>= 3.5.0),
shiny (>= 1.8.1),
gargoyle,
leaflet (>= 2.0.2),
gargoyle
shiny (>= 1.8.1)
Imports:
bslib,
curl,
devtools,
dplyr (>= 1.0.2),
glue,
knitr,
magrittr,
tools,
zip
Suggests:
bslib,
DT (>= 0.5),
dplyr (>= 1.0.2),
future,
glue,
httr2,
knitcitations,
knitr,
leafem,
leaflet.extras (>= 1.0.0),
magrittr,
markdown,
promises,
R6,
RColorBrewer,
renv,
rintrojs,
rlang,
rmarkdown,
shinyAce,
shinyalert,
shinybusy,
shinyjs,
shinytest2,
shinyWidgets (>= 0.6.0),
terra,
tools,
xml2,
zip
Suggests:
shinytest2,
testthat
testthat,
xml2
License: GPL-3
URL: https://simon-smart88.github.io/shinyscholar/
BugReports: https://github.com/simon-smart88/shinyscholar/issues
Encoding: UTF-8
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Generated by roxygen2: do not edit by hand

export(asyncLog)
export(check_suggests)
export(check_url)
export(close_loading_modal)
export(create_module)
Expand All @@ -10,7 +12,6 @@ export(plot_hist)
export(plot_scatter)
export(printVecAsis)
export(register_module)
export(run_module)
export(run_shinyscholar)
export(save_and_load)
export(select_async)
Expand Down
11 changes: 10 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ shinyscholar 0.1.0
2. Due to objects inside `common` not being inherently reactive, event triggers have been added using `{gargoyle}`
3. A Code tab has been added to the Visualization panel to allow the code for each module and the function that each module calls to be viewed.
4. Unit tests for each module have been created using `{shinytest2}` in addition to unit tests for the function that the module calls.
5. Added a new function `run_module()` which can be used to run a single module.
5. ~~Added a new function `run_module()` which can be used to run a single module.~~ Removed in 0.2.2 use `run_<app name>()` or `load_file`
6. Added a new function `create_template()` which can be used to create a skeleton app.
7. Added a Dockerfile which can be used to run the app on a shiny-server.
8. Added `show_loading_modal()` which uses `{shinybusy}` to display a modal whilst slow functions are running.
Expand Down Expand Up @@ -42,3 +42,12 @@ shinyscholar 0.2.0
shinyscholar 0.2.1
=============
- The `select_query` and `select_async` modules in the demonstration have been re-written to use a different API.

shinyscholar 0.2.2
=============
- Removed `run_module()` as it was not maintainable.
- Moved all packages to Suggests unless they are required for development of new applications.
- Added `asyncLog()` to improve logging from inside async functions.
- Updated `run_<app name>()` to take a load file as an argument which is loaded automatically.
- Creating `load_file` containing the path to a save file will attempt to load it on app start up.
- Made `create_template()`, `metadata()` and `save_and_load()` more robust.
32 changes: 32 additions & 0 deletions R/check_suggests.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#' @title Check suggests
#' @description
#' Checks whether all the packages in Suggests are installed and stops execution
#' if not.
#' @author Simon Smart <simon.smart@@cantab.net>
#' @param testing logical. For use in testing.
#' @param example logical. For use in examples.
#' @keywords internal
#' @export
check_suggests <- function(testing = FALSE, example = FALSE){
desc <- read.dcf(system.file("DESCRIPTION", package = "shinyscholar"))
suggests <- trimws(
gsub(
"\\(.*\\)", "",
gsub("\\n", "", unlist(strsplit(desc[,"Suggests"], ",")))
)
)
if (testing){
suggests <- c(suggests, "phantompackage")
}

check <- any(!sapply(suggests, requireNamespace, quietly = TRUE))

if (example){
return(!check)
} else {
if (check){
stop('Some packages required to run the application are not installed, please reinstall using:
install.packages("shinyscholar", dependencies = TRUE)')
}
}
}
Loading

0 comments on commit 15d1c76

Please sign in to comment.