-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy path0-dev_history.Rmd
115 lines (84 loc) · 2.46 KB
/
0-dev_history.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
title: "Development actions history"
output: html_document
editor_options:
chunk_output_type: console
---
All commands that you use to use when developing packages...
# Start using git
```{r, eval=FALSE}
usethis::use_git()
# Deal with classical files to ignore
usethis::git_vaccinate()
```
# Set extra sources of documentation
```{r, eval=FALSE}
# README
usethis::use_readme_rmd()
# Code of Conduct
usethis::use_code_of_conduct("[email protected]")
# NEWS
usethis::use_news_md()
```
**From now, you will need to "inflate" your package at least once to be able to use the following commands. Let's go to your flat template, and come back here later if/when needed.**
# Package development tools
## Use once
```{r, eval=FALSE}
# Pipe
usethis::use_pipe()
# package-level documentation
usethis::use_package_doc()
# Set CI
# _GitHub
usethis::use_github_action_check_standard()
usethis::use_github_action("pkgdown")
usethis::use_github_action("test-coverage")
# _GitLab
gitlabr::use_gitlab_ci(type = "check-coverage-pkgdown")
# Add new flat template
fusen::add_flat_template("add")
```
## Use everytime needed
```{r}
# Simulate package installation
pkgload::load_all()
# Generate documentation and deal with dependencies
attachment::att_amend_desc()
# Check the package
pkgload::load_all()
devtools::test() # for interactive required
devtools::check()
```
# Share the package
```{r}
# set and try pkgdown documentation website
usethis::use_pkgdown()
pkgdown::build_site()
# build the tar.gz to share with others
devtools::build()
```
# Checks for CRAN release ----
## Copy the latest version of PREPARE_FOR_CRAN ----
```{r}
url <- "https://raw.githubusercontent.com/ThinkR-open/prepare-for-cran/master/README.md"
destination <- "dev/dev_history_PREPARE_FOR_CRAN.md"
download.file(url, destfile = destination, mode = "wb")
line <- grep(pattern = "# Prepare for CRAN ----", readLines(destination))
rstudioapi::navigateToFile(destination, line = line)
```
### Run the automated tests
## {dockerfiler} specificity : ----
### If `Check reverse dependencies` doesn't work`with `revdep_check()`:
### retrieve the GitHub files of the {dockerfiler}-dependent packages (golem),
### install attachment locally and check().
## BEFORE RELEASE: ----
### Add comments for CRAN
### Need to .gitignore this file
```{r}
usethis::use_cran_comments(open = rlang::is_interactive())
```
### Why we have `\dontrun{}`
```{r}
usethis::use_git_ignore("cran-comments.md")
usethis::use_git_ignore("CRAN-SUBMISSION")
```