atorus-research / matte

{usethis} style tooling to help with Shiny applications evolving maturing into production systems
Other
1 stars 0 forks source link

Add `make_child_app()` and parentApp example package #18

Closed lauramaxwell closed 4 days ago

lauramaxwell commented 5 days ago

Overview

Creates make_child_app() function that copies over relevant pieces of the parentApp (found in inst at the moment...will want to make this a standalone repo eventually) into a new child app. This function also allows the user to include a jobs folder and meta.yaml file either from the parent app or the {matte} templates, and include app-as-package framework elements from golem or rhino, if desired.

closes #16 closes #4 closes #13 closes #6

Test code

Feel free to play with the arguments as you'd like given the help file

 make_child_app(parent_app_dir = "inst/parentApp",
                child_app_dir = "~/childTest",
                copy_jobs_dir = TRUE,
                include_renv = TRUE,
                include_meta_yaml = TRUE,
                job_file_type = "Rmd",
                overwrite = FALSE,
                framework = "none")

devtools::load_all("~/matte/inst/parentApp/")
runApp("~/childTest")
lauramaxwell commented 5 days ago

started a template for the R/main.R file needed for rhino child apps, but still needs some work. golem and no-framework child apps are working well on my end.

jiwanheo commented 5 days ago

I think we'd want to put in a Rproj when we create new children.

When overwriting, we should print out a message? (it does overwrite) Honestly, we can just disable overwrite?

image

In this else clause, system.file can't start with "inst". You can actually omit "inst", and just give it the file name

image

I think we decided to detect the yaml file usage from parent? This might have to be tweaked

image

lauramaxwell commented 4 days ago

first two comments make sense i can i fix those quickly.

for the yaml usage- if they select to copy the jobs folder from the parent and a yaml exists in the parent's jobs folder than it will get copied over instead of the yaml template, which is i think what we wanted. maybe we need to make this more explicit in the documentation or argument names?