Skip to content

A proposed function to provide base::getNamespaceExports() for {box}#369

Open
radbasa wants to merge 10 commits into
klmr:mainfrom
Appsilon:feature/get_module_exports
Open

A proposed function to provide base::getNamespaceExports() for {box}#369
radbasa wants to merge 10 commits into
klmr:mainfrom
Appsilon:feature/get_module_exports

Conversation

@radbasa

@radbasa radbasa commented Jul 1, 2024

Copy link
Copy Markdown

This is a proposed solution to provide similar functionality to base::getNamespaceExports().

The implementation is largely a subset of box::use(), box:::use_one(), box:::load_and_register() with the loading packages/modules/functions into the environment removed.

> box::get_exports(dplyr, stringr[str_pad, some_alias = str_trim])
$dplyr
  [1] "slice_max"             "expr"                  "src"  
...
[298] "sql_join"             

$str_pad
[1] "str_pad"

$some_alias
[1] "str_trim"
> options(box.path = "tests/testthat")
> box::get_exports(mod/mod_name, mod/mod_file[nested_module_file])
$mod_name
[1] "this_module_name"     "this_module_name2"    "after_module_attach" 
[4] "function_module_name" "after_package_attach" "nested_module_name"  

$nested_module_file
[1] "nested_module_file"

@radbasa

radbasa commented Aug 19, 2024

Copy link
Copy Markdown
Author

Hi, @klmr , is this a safe way to do this?

@klmr

klmr commented Aug 19, 2024

Copy link
Copy Markdown
Owner

Hi @radbasa Apologies, I haven’t had time yet to look at the proposal but I promise I’ll get to it eventually. At any rate thanks a lot for the PR, it’s highly appreciated!

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.

2 participants