Skip to content

Conversation

@alandipert
Copy link
Collaborator

Makes improvements suggested by @cpsievert in #8; the npmPkg argument is now called npmPkgs, and the user may supply multiple npm dependencies as a named list mapping name to version.

#11 should be merged to master first.

toDepJSON <- function(npmPkgs) {
if (is.null(npmPkgs)) {
""
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add another check here to make sure names(npmPkgs) returns something sensible, like

else if (!length(names(npmPkgs))) {
  stop("Must specify npm package names in the names attributes of npmPkgs")
} else {
  paste0(sprintf('"%s": "%s"', names(npmPkgs), npmPkgs), collapse = ",\n")
}

@timelyportfolio timelyportfolio merged commit ce7094e into add-node_modules-rbuildignore Jan 26, 2019
@timelyportfolio timelyportfolio deleted the scaffold-multiple-npm-libs branch September 14, 2024 12:40
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.

4 participants