r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.37k stars 755 forks source link

Export is not working when using typed library #2549

Closed latot closed 6 months ago

latot commented 6 months ago

Hi, I don't know if this bug is more related to devtools or typed library, @moodymudskipper

Actually, if we create a function using typed library on the function and params then devtools will not be able to detect them, and will not be included in NAMESPACE even with the export keyword.

Example of function: https://github.com/latot/bugs/blob/devtools_2549/R/test.R

Result of NAMESPACE: https://github.com/latot/bugs/blob/devtools_2549/NAMESPACE

Example project: https://github.com/latot/bugs/blob/devtools_2549

Note: NAMESPACE generated by devtools::document()

Thx!

latot commented 6 months ago

Workaround, add to every function (fill with your data):

#' @title Create node's vector
#' @name node
#' @description Create node's vector
#'
#' @param x vector of integers
#' @export
moodymudskipper commented 6 months ago

It's not a devtools/roxygen2, it's because ? has higher precedence than <-, we can't expect roxygen2 to understand these expressions. You can close and we can follow up in the typed repo.

latot commented 6 months ago

okis! thx!