Remove any library() or require() calls, in favor of usethis::use_package("name").
If your app uses modules, place related ones in individual .R files with usethis::use_r("module-category").
Wrap core app inside a function and place within a .R file, e.g:
greetingApp <-function() {# define a user-interface with two elements: a text input with an ID, # label, and initial value; define a textOutput that # returns the input + greetingui <-fluidPage(textInput(inputId ="nameInput", label ="What is your name?", value ="World"),textOutput("name"))# define the server side logic to manipulate the inputsserver <-function(input, output, session) {# define the output that concatenates the strings # "Hello, " + user input + "." output$name <-renderText({paste0("Hello, ", input$nameInput, ".")})}# run the applicationshinyApp(ui, server)}
Call devtools::load_all() and your function – greetingApp() to say hello to your package!