Skip to content

Commit 09b6202

Browse files
committed
bump version to v0.1.0
1 parent f804a61 commit 09b6202

52 files changed

Lines changed: 1132 additions & 197 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@
3030
^\.vscode$
3131
^CRAN-SUBMISSION$
3232
^tmp\.R$
33+
^43_use_vendor\.R

.codebuddy/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
memory/**
2+
*.md

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: rpkgkit
2-
Title: Create and Maintain 'R' Packages
3-
Version: 0.0.7
2+
Title: Create and Maintain R Packages
3+
Version: 0.1.0
44
Authors@R: c(
55
person("Yuxi", "Yang", , "15364051195@163.com", role = c("aut", "cre")),
66
person("Jacob", "Scott", role = c("aut", "cph"),
@@ -9,7 +9,7 @@ Authors@R: c(
99
comment = "Contributor to the included pedant code"),
1010
person("Sebastian", "Lammers", role = c("ctb", "cph"),
1111
comment = "Contributor to the included pedant code"))
12-
Description: Create and maintain R packages with utilities for NEWS.md
12+
Description: Utilities for R package development including NEWS.md
1313
management, standalone file creation, and code formatting. Supports popular
1414
development workflows and integrates with 'usethis' and 'RStudio'. Includes
1515
helper functions for renaming functions and detecting common coding errors.

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ export(render_rmd)
2121
export(update_time_in_standalone)
2222
export(use_hexsticker)
2323
export(use_workflow_version_update)
24+
export(use_zzz)

NEWS.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
# . 0.1.0 (2026-06-25)
2+
3+
## BUG FIXES
4+
5+
* Fix path bug in `render_rmd()`
6+
7+
8+
# rpkgkit 0.1.0 (2026-06-25)
9+
10+
## DOCUMENTATION
11+
12+
* Fix documentation and examples to meet CRAN requirements
13+
14+
15+
## NEW FEATURES
16+
17+
* Added `use_zzz()` for easier zzz.R management
18+
19+
* Bump verion to v0.1
20+
21+
122
# rpkgkit 0.0.7 (2026-06-17)
223

324
## MINOR IMPROVEMENTS

R/00_pkg_description.R

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
1-
#' @title A Package for R Package Development
2-
#' @description A Package for R Package Development
1+
#' @title Create and Maintain R Packages
2+
#'
3+
#' @description Utilities for R package development including NEWS.md
4+
#' management, standalone file creation, and code formatting. Supports popular
5+
#' development workflows and integrates with 'usethis' and 'RStudio'. Includes
6+
#' helper functions for renaming functions and detecting common coding errors.
7+
#'
8+
#' @section License:
9+
#' MIT + file LICENSE
10+
#'
11+
#' @docType package
12+
#' @name rpkgkit-package
13+
#' @aliases rpkgkit
314
#' @keywords internal
15+
#'
416
"_PACKAGE"
17+
18+
19+
.onAttach <- function(libname, pkgname) {
20+
pkg_version <- utils::packageVersion(pkgname)
21+
22+
msg <- cli::cli_fmt(cli::cli_alert_success(
23+
"{.pkg {pkgname}} v{pkg_version} loaded"
24+
))
25+
packageStartupMessage(msg)
26+
invisible()
27+
}
28+
29+
.onLoad <- function(libname, pkgname) {
30+
invisible()
31+
}

R/01_file_path_utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ get_wd <- function() {
1010
current_wd <- dirname(rstudioapi::getActiveDocumentContext()$path)
1111
}
1212
if (is.null(current_wd)) {
13-
current_wd <- getwd()
13+
current_wd <- "."
1414
}
1515
if (is_pkg(dirname(current_wd))) {
1616
return(dirname(current_wd))

R/10_air_format.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#'
1717
#' @examples
1818
#' \dontrun{
19-
#' air_format(system.file("", package = "rpkgkit"))
19+
#' air_format(system.file("R_template/zzz_template.R", package = "rpkgkit"))
2020
#' }
2121
#' @export
2222
air_format <- function(path = NULL, ...) {

R/12_render_rmd.R

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@
88
#' @return The output file path from rmarkdown::render.
99
#'
1010
#' @examples
11-
#' \dontrun{
12-
#' rlang::is_installed("rmarkdown")
11+
#' \donttest{
12+
#' rlang::check_installed("rmarkdown")
1313
#' tmp <- tempfile(fileext = ".Rmd")
1414
#' writeLines(c("---", "title: Test", "---", "", "Hello, world!"), tmp)
15-
#' render_rmd(tmp)
15+
#' render_rmd(path = tmp)
1616
#' }
1717
#' @export
1818
render_rmd <- function(path = NULL, output_format = "md_document", ...) {
1919
rlang::check_installed("rmarkdown")
20-
path <- if (is.null(path) && rlang::is_installed("rstudioapi")) {
21-
rstudioapi::getActiveDocumentContext()$path
22-
}
20+
path <- path %||%
21+
if (rlang::is_installed("rstudioapi")) {
22+
rstudioapi::getActiveDocumentContext()$path
23+
}
2324
if (is.null(path)) {
24-
cli::cli_abort(("c" = "{.arg path} is required"))
25+
cli::cli_abort(c("x" = "{.arg path} is required"))
2526
}
2627
rmarkdown::render(input = path, output_format = output_format, ...)
2728
}

R/13_make_func_call_explicit.R

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,19 @@
2626
#' package by Jacob Scott et al., licensed under MIT.
2727
#'
2828
#' @examples
29-
#' \dontrun{
30-
#' make_func_call_explicit("path/to/file.R")
29+
#' \donttest{
30+
#' file <- tempfile(fileext = ".R")
31+
#' writeLines("
32+
#' starwars |>
33+
#' mutate(name, bmi = mass / ((height / 100)^2)) |>
34+
#' select(name:mass, bmi)
35+
#' ", file)
3136
#' make_func_call_explicit(
32-
#' path = "path/to/file.R",
37+
#' path = file,
3338
#' use_packages = c("dplyr", "tidyr"),
3439
#' ignore_functions = c("library", "require")
3540
#' )
41+
#' readLines(file) |> message()
3642
#' }
3743
#'
3844
#' @export
@@ -47,8 +53,10 @@ make_func_call_explicit <- function(
4753

4854
path <- if (is.null(path) && rlang::is_installed("rstudioapi")) {
4955
rstudioapi::getActiveDocumentContext()$path
50-
} else {
56+
} else if (is.null(path)) {
5157
cli::cli_abort(("c" = "{.arg path} is required"))
58+
} else {
59+
path
5260
}
5361

5462
cli::cli_alert_info("Retrieving function calls from {.pkg {use_packages}}")

0 commit comments

Comments
 (0)