Skip to content

Commit 9cda78d

Browse files
committed
update from CRAN submission
1 parent 63261b9 commit 9cda78d

File tree

7 files changed

+99
-26
lines changed

7 files changed

+99
-26
lines changed

.DS_Store

2 KB
Binary file not shown.

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
^pkgdown$
1010
^\.github$
1111
^CODE_OF_CONDUCT\.md$
12+
^CRAN-SUBMISSION$

CRAN-SUBMISSION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Version: 0.0.1
2+
Date: 2025-11-05 15:49:44 UTC
3+
SHA: 63261b92bdb71d892b8aab684cfa73e4d8b146cd

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Package: shinyfa
2-
Title: Analyze the File Contents of Shiny Directories
3-
Version: 0.0.0.9000
2+
Title: Analyze the File Contents of 'shiny' Directories
3+
Version: 0.0.1
44
Authors@R: person("Jasmine", "Daly", email = "jasmine.dumas@gmail.com", role = c("aut", "cre"),
55
comment = c(ORCID = "0000-0001-8006-2428"))
66
Description: Provides tools for analyzing and understanding the file contents of
7-
large Shiny application directories. The package extracts key information about
8-
render functions, reactive functions, and their inputs from Shiny app files,
7+
large 'shiny' application directories. The package extracts key information about
8+
render functions, reactive functions, and their inputs from app files,
99
organizing them into structured data frames for easy reference. This streamlines
1010
the onboarding process for new contributors and helps identify areas for
11-
optimization in complex Shiny codebases with multiple files and sourcing chains.
11+
optimization in complex 'shiny' codebases with multiple files and sourcing chains.
1212
URL: https://github.com/dalyanalytics/shinyfa, https://dalyanalytics.github.io/shinyfa/
1313
BugReports: https://github.com/dalyanalytics/shinyfa/issues
1414
License: MIT + file LICENSE

NEWS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# shinyfa (development version)
1+
# shinyfa 0.0.1 (development version)
22

33
* 2025-02-17: Initial development on GitHub.
4-
* 2025-06-14: Prepping for CRAN submission
4+
* 2025-06-14: Prepping for CRAN submission.
5+
* 2025-10-31: submitting to CRAN after community testing.

README.md

Lines changed: 81 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# shinyfa
1+
# shinyfa
22

33
<img src="https://media.githubusercontent.com/media/dalyanalytics/shinyfa/refs/heads/main/man/figures/shinyfa-logo.png" align="right" alt="shinyfa logo" width="200" />
44

55

66
<!-- badges: start -->
7-
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
7+
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
88
[![R-CMD-check](https://github.com/dalyanalytics/shinyfa/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/dalyanalytics/shinyfa/actions/workflows/pkgdown.yaml)
99
<!-- badges: end -->
1010

@@ -13,45 +13,109 @@ The `{shinyfa}` package is designed to help Shiny developers analyze and underst
1313

1414
Large Shiny applications often contain numerous files that define both dynamic UI and server components, sometimes linked together in complex sourcing chains (though this is less common in Shiny apps structured with modules). For new contributors—such as consultants joining a project—it can take considerable time to onboard, navigate the codebase, and identify areas for optimization.
1515

16-
This in-progress package aims to streamline that process by extracting key information from a Shiny app directory. It identifies specific render functions, reactive functions, and their inputs, organizing them into a structured `data.frame` for easy reference.
16+
This package aims to streamline that process by extracting key information from a Shiny app directory. It identifies specific render functions, reactive functions, and their inputs, organizing them into a structured `data.frame` for easy reference.
1717

1818
The *fa* in *shinyfa* stands for *file analysis*.
1919

20-
## Installation
20+
## 🎯 Why use shinyfa?
2121

22-
You can install the development version of {shinyfa} from [GitHub](https://github.com/) with:
22+
- **📊 Audit reactive dependencies**: Quickly understand which inputs affect which outputs across your entire app
23+
- **🔍 Identify unused code**: Find reactive expressions and render functions that may no longer be used
24+
- **🗺️ Map data flow**: Visualize how data flows through complex Shiny applications with multiple modules
25+
- **📚 Generate documentation**: Create instant reference guides for new team members joining the project
26+
- **⚡ Optimize performance**: Identify potential bottlenecks by understanding reactive chains
27+
28+
## 📦 Installation
29+
30+
Install from CRAN:
31+
32+
``` r
33+
install.packages("shinyfa")
34+
```
35+
36+
Or install the development version from GitHub:
2337

2438
``` r
25-
# install.packages("pak")
39+
# Install from GitHub
40+
devtools::install_github("dalyanalytics/shinyfa")
41+
42+
# Or using pak
2643
pak::pak("dalyanalytics/shinyfa")
2744
```
2845

29-
## Example
46+
## 🚀 Usage
47+
48+
### Basic Example
3049

31-
This is a basic example which shows you how to solve a common problem for looping through a directory that contains server files:
50+
Analyze a typical Shiny app structure:
3251

3352
``` r
3453
library(shinyfa)
35-
library(dplyr)
54+
library(dplyr)
3655

37-
file_path_df <- list.files("SHINY-SERVER-DIRECTORY",
38-
pattern = "\\.R$", full.names = TRUE)
56+
# Analyze server files in your Shiny app
57+
server_files <- list.files("my_shiny_app/server",
58+
pattern = "\\.R$",
59+
full.names = TRUE,
60+
recursive = TRUE)
3961

40-
file_analysis <- data.frame() # Initialize an empty dataframe
62+
file_analysis <- data.frame()
4163

42-
for (file in file_path_df) {
64+
for (file in server_files) {
4365
shiny_analysis <- analyze_shiny_reactivity(file_path = file)
4466

45-
# Skip if NULL (empty file or only `source()` calls)
4667
if (is.null(shiny_analysis)) next
4768

48-
# Add filename column
4969
shiny_analysis$file_name <- basename(file)
50-
51-
# Bind results
5270
file_analysis <- bind_rows(file_analysis, shiny_analysis)
5371
}
5472

73+
# View the analysis results
5574
print(file_analysis)
5675
```
5776

77+
### Example Output
78+
79+
```
80+
#> type name inputs output file_name
81+
#> 1 render plotSales c("dateRange", "product") plotOutput sales_module.R
82+
#> 2 reactive filteredData c("selectedRegion") NULL data_processing.R
83+
#> 3 observe updateFilters c("input$reset") NULL ui_helpers.R
84+
#> 4 render tableSummary c("filteredData") tableOutput summary_module.R
85+
#> 5 observeEvent downloadHandler c("input$download") NULL download_handlers.R
86+
```
87+
88+
### Analyzing Specific Patterns
89+
90+
``` r
91+
# Find all reactive expressions that depend on a specific input
92+
file_analysis %>%
93+
filter(type == "reactive",
94+
grepl("dateRange", inputs)) %>%
95+
select(name, file_name)
96+
97+
# Identify potentially unused render functions
98+
file_analysis %>%
99+
filter(type == "render",
100+
is.na(output) | output == "")
101+
```
102+
103+
## 🔍 Scope & Limitations
104+
105+
- **File types**: Supports `.R` files
106+
- **Module support**: Works with both traditional Shiny apps and modularized applications
107+
- **Static analysis**: Performs static code analysis without running the app
108+
- **Pattern detection**: May not catch all edge cases or dynamically generated reactives
109+
110+
## 🤝 Contributing
111+
112+
Contributions are welcomed!
113+
114+
- Submit bug reports and feature requests via [GitHub Issues](https://github.com/dalyanalytics/shinyfa/issues)
115+
- Fork the repository and submit pull requests for improvements
116+
- Help us improve documentation and add more examples
117+
118+
## 📄 License
119+
120+
MIT © Jasmine Daly / shinyfa authors
121+

cran-comments.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
# shinyfa 0.0.0.9000
1+
# shinyfa 0.0.1
22

33
## R CMD check results
44

5-
Duration: 19.7s
5+
Duration: 18.5s
66

77
0 errors ✔ | 0 warnings ✔ | 0 notes ✔
88

99
R CMD check succeeded
1010

11+
* This is a new release.
12+
* The words 'onboarding' and 'codebases' are not misspellings in the description file.
13+
* Updated Shiny to 'shiny' in Title and Description fields.
14+

0 commit comments

Comments
 (0)