-
Notifications
You must be signed in to change notification settings - Fork 7
fix: move required Shiny app packages from Suggests to Imports #1209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
9cf0c56
fix: move required Shiny app packages from Suggests to Imports (#1207)
Gero1999 7c6d173
chore: drop later from Imports, it is a transitive dep of shiny
Gero1999 071c205
refactor lintr
Gero1999 d64e1f4
fix: guard sessionInfo() in About tab against broken packages
Gero1999 a630c83
chore: add manual test script for verifying app without Suggests
Gero1999 995f857
Update PR template with dependency checklist
Gero1999 cecf34c
docs: add dependency test step to PR checklist
Gero1999 18f63da
fix: add importFrom directives for shiny-only Imports packages
Gero1999 4ac9ff9
Merge remote-tracking branch 'origin/main' into 1207-bug/fix-suggests…
Gero1999 1a27f25
Merge branch '1207-bug/fix-suggests-imports-classification' of https:…
Gero1999 abdb064
make plain script to recover pkgs hidden
Gero1999 46a92e6
fix: guard sessionInfo() in About tab against missing packages
Gero1999 bc0c108
fix: guard .export_session_info() in ZIP export against missing packages
Gero1999 64b0d1e
refactor lintr
Gero1999 7ca8606
Bump version from 0.1.0.9147 to 0.1.0.9153
Gero1999 304337a
Merge branch 'main' into 1207-bug/fix-suggests-imports-classification
Gero1999 06373d5
Bump version from 0.1.0.9153 to 0.1.0.9154
Gero1999 18fece5
Merge branch 'main' into 1207-bug/fix-suggests-imports-classification
Gero1999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Declare Imports used only by the Shiny app (inst/shiny/). | ||
| # | ||
| # R CMD check requires that every package in Imports has at least one | ||
| # @importFrom directive. These packages are used in the Shiny app code | ||
| # (inst/shiny/) which R CMD check does not scan for namespace usage. | ||
|
|
||
| #' @importFrom bslib page_sidebar | ||
| #' @importFrom htmltools tags | ||
| #' @importFrom htmlwidgets onRender | ||
| #' @importFrom logger log_info | ||
| #' @importFrom reactable reactable | ||
| #' @importFrom reactable.extras reactable_extras_dependency | ||
| #' @importFrom shiny runApp | ||
| #' @importFrom shinycssloaders withSpinner | ||
| #' @importFrom shinyjs useShinyjs | ||
| #' @importFrom shinyjqui orderInput | ||
| #' @importFrom shinyWidgets pickerInput | ||
| #' @importFrom zip zipr | ||
| NULL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Manual test: verify run_app() works without Suggests packages | ||
| # | ||
| # This script hides all Suggests packages (except testthat/covr needed by | ||
| # devtools) and launches the app. Use it to verify that: | ||
| # | ||
| # 1. The app starts without errors. | ||
| # 2. Core workflow works (upload → map → NCA → export). | ||
| # 3. Optional features (SAS import, PowerPoint export, listings) show | ||
| # graceful messages instead of crashing. | ||
| # | ||
| # Usage: | ||
| # 1. Open a fresh R session (Ctrl+Shift+F10 in RStudio). | ||
| # 2. source("data-raw/test_suggests_hidden.R") | ||
| # 3. Test the app manually. | ||
| # 4. Stop the app (Ctrl+C / Esc), then run restore_packages() to unhide. | ||
| # | ||
| # WARNING: Do NOT run this in CI. It renames package directories on disk. | ||
|
|
||
| # --- Hide Suggests packages --- | ||
| desc <- read.dcf("DESCRIPTION", fields = "Suggests") | ||
| hide <- trimws(unlist(strsplit(desc[1, "Suggests"], ","))) | ||
| hide <- gsub("\\s*\\(.*\\)", "", hide) | ||
| hide <- hide[nzchar(hide)] | ||
|
|
||
| # Keep packages that devtools::load_all() needs | ||
| hide <- setdiff(hide, c("testthat", "covr")) | ||
|
|
||
| lib <- .libPaths()[1] | ||
| hidden <- character(0) | ||
|
|
||
| for (pkg in hide) { | ||
| from <- file.path(lib, pkg) | ||
| if (dir.exists(from)) { | ||
| file.rename(from, paste0(from, "_HIDDEN")) | ||
| hidden <- c(hidden, pkg) | ||
| } | ||
| } | ||
| cat("Hidden:", paste(hidden, collapse = ", "), "\n") | ||
|
|
||
| # --- Load and run --- | ||
| devtools::load_all() | ||
| aNCA::run_app() | ||
|
|
||
| # --- Restore function (call after stopping the app) --- | ||
| restore_packages <- function() { | ||
| for (pkg in hidden) { | ||
| to <- file.path(lib, pkg) | ||
| from <- paste0(to, "_HIDDEN") | ||
| if (dir.exists(from)) file.rename(from, to) | ||
| } | ||
| cat("Restored:", paste(hidden, collapse = ", "), "\n") | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.