Skip to content
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

87 rewrite pkg structure #92

Merged
merged 14 commits into from
Apr 17, 2024
Merged

87 rewrite pkg structure #92

merged 14 commits into from
Apr 17, 2024

Conversation

ohjakobsen
Copy link
Contributor

This PR moved all functions that earlier were put in ./inst/app and ./inst/app/R into ./R. This way, all internal functions should be available within the apps ui() and server() functions. To align with best practices for R packages and remove notes and warnings from R CMD check, several changes has been made:

  • The global.R file has been removed and it's functions has been added elsewhere in the code, including in the server() and run_pioneer() functions
  • All code from conditionalUI.R has been added to server(). The code for the server() function can be split into Shiny modules in a later PR
  • All calls to require() has been replaced with @import or @importFrom statements or the use of ::. The package now includes far more packages in the Imports section to make sure that all packages needed to run the app are available

This PR does not include new tests. New test should be written for most functions. However, the purpose of this PR is to move all functions out of ./inst/app. We should have a review of how functions can be optimised now that they are all internal functions. This should be a separate PR where we also introduce new tests.

@ohjakobsen ohjakobsen added this to the 0.4.0 milestone Apr 16, 2024
@ohjakobsen ohjakobsen requested review from Aeilert and joasand April 16, 2024 14:54
Copy link
Collaborator

@Aeilert Aeilert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ohjakobsen!

This looks good. Just a few minor comments:

  • Please use @export, @keywords internal or @noRd-tags for all functions. I appears that particularly @noRd are missing in the fct_*-files.
  • I think we should be consistent in the use of :: vs. @import and @importFrom. I prefer :: since it makes the imports of a package explicit.
  • Please add an issue for the unit tests you think we should create.

R/fct_dea-bootstrap.R Show resolved Hide resolved
R/mod_file-upload.R Show resolved Hide resolved
R/shiny-functions.R Show resolved Hide resolved
R/shiny-functions.R Show resolved Hide resolved
NAMESPACE Outdated Show resolved Hide resolved
R/server.R Outdated Show resolved Hide resolved
R/fct_dea-bootstrap.R Show resolved Hide resolved
@ohjakobsen ohjakobsen merged commit 1c58006 into master Apr 17, 2024
7 checks passed
@ohjakobsen ohjakobsen deleted the 87-rewrite-pkg-structure branch April 17, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite package structure to align with new Shiny app development principles at OAGN
2 participants