README.md

boxingtape - (very) WIP

An attempt to use box for opionated project setup (inspired by dflow). Has some modules that are included in project setup - grab (module manager) and dir (box path setup).

To get started with a project, run boxingtape::setup(). This will set up a template project with the following structure:

- /modules
  - /dir
  - /grab
- /R
- app.r
- .here
-  .gitignore

With boxingtape, downloaded modules are intended to not be shared when uploading a project to github. Instead, users should run grab$install() to download the modules listed in the package.json. This keeps the package.json as the source of truth, and keeps project sizes smaller.

Modules

Dir Module

use_here_directory

Sets the box.path option to the here() directory on load. E.g.

box::use(. / modules / dir / use_here_directory) # box.path is set as soon as this is loaded

use_global_directory

Similar to use_here_directory, but sets the box.path to a global module directory. By default, this is set to .libPaths[1]/module-library. The directory can be set with options('module.dir' = a/path).

options('module.dir' = '~/R/module-library/') # Set the global directory
box::use(. / modules / dir / use_global_directory) # box.path is now set to module.dir

Grab Module

Rudementary module manager in the vein of yarn and npm. Load via box::use(. / modules / grab).

grab$init

Initialise a template package.json file.

box::use(. / modules / grab)
grab$init()

grab$add

Add a module to your package.json and install to module repo.

box::use(. / modules / grab)
grab$add(c('A/Repo','Another/Repo'))

grab$remove

Remove a module from your package.json file, and your local module directory if applicable.

box::use(. / modules / grab)
grab$remove(c('A/Repo','Another/Repo'))

grab$install

grab$install() downloads all the modules listed in the package.json. Alternatively, grab$install('A/Repo') downloads a specified repository without adding to package.json.

box::use(. / modules / grab)

grab$install()
# or
grab$install('A/Repo')

grab$grab

Wrapper function that calls init() and then install(). Similar to running 'yarn' for any js users out there.

box::use(. / modules / grab)
grab$grab()

grab$upgrade

grab$upgrade() checks all modules listed in package.json for updates. Alternatively, grab$upgrade('A/Repo') updates a specified module.

box::use(. / modules / grab)

grab$upgrade()
# or
grab$upgrade('A/Repo')


ElianHugh/boxingtape documentation built on Feb. 13, 2021, 12:48 a.m.