Skip to content

Commit ec92077

Browse files
committed
App Push Test (main@b24c5f49)
0 parents  commit ec92077

File tree

24 files changed

+2416
-0
lines changed

24 files changed

+2416
-0
lines changed

.Rprofile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if (file.exists("renv")) {
2+
source("renv/activate.R")
3+
} else {
4+
# The `renv` directory is automatically skipped when deploying with rsconnect.
5+
message("No 'renv' directory found; renv won't be activated.")
6+
}
7+
8+
# Allow absolute module imports (relative to the app root).
9+
options(box.path = getwd())

.github/workflows/rhino-test.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Rhino Test
2+
on: push
3+
permissions:
4+
contents: read
5+
jobs:
6+
main:
7+
name: Run linters and tests
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- name: Checkout repo
11+
uses: actions/checkout@v4
12+
13+
- name: Setup system dependencies
14+
run: |
15+
packages=(
16+
# List each package on a separate line.
17+
)
18+
sudo apt-get update
19+
sudo apt-get install --yes "${packages[@]}"
20+
21+
- name: Setup R
22+
uses: r-lib/actions/setup-r@v2
23+
with:
24+
r-version: renv
25+
26+
- name: Setup R dependencies
27+
uses: r-lib/actions/setup-renv@v2
28+
29+
- name: Setup Node
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: 20
33+
34+
- name: Lint R
35+
if: always()
36+
shell: Rscript {0}
37+
run: rhino::lint_r()
38+
39+
- name: Lint JavaScript
40+
if: always()
41+
shell: Rscript {0}
42+
run: rhino::lint_js()
43+
44+
- name: Lint Sass
45+
if: always()
46+
shell: Rscript {0}
47+
run: rhino::lint_sass()
48+
49+
- name: Build JavaScript
50+
if: always()
51+
shell: Rscript {0}
52+
run: rhino::build_js()
53+
54+
- name: Build Sass
55+
if: always()
56+
shell: Rscript {0}
57+
run: rhino::build_sass()
58+
59+
- name: Run R unit tests
60+
if: always()
61+
shell: Rscript {0}
62+
run: rhino::test_r()
63+
64+
- name: Run Cypress end-to-end tests
65+
if: always()
66+
uses: cypress-io/github-action@v6
67+
with:
68+
working-directory: .rhino # Created by earlier commands which use Node.js
69+
start: npm run run-app
70+
project: ../tests
71+
wait-on: 'http://localhost:3333/'
72+
wait-on-timeout: 60

.lintr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
linters:
2+
linters_with_defaults(
3+
line_length_linter = line_length_linter(100),
4+
box_alphabetical_calls_linter = rhino::box_alphabetical_calls_linter(),
5+
box_func_import_count_linter = rhino::box_func_import_count_linter(),
6+
box_separate_calls_linter = rhino::box_separate_calls_linter(),
7+
box_trailing_commas_linter = rhino::box_trailing_commas_linter(),
8+
box_universal_import_linter = rhino::box_universal_import_linter(),
9+
object_usage_linter = NULL # Does not work with `box::use()`.
10+
)

.renvignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Only use `dependencies.R` to infer project dependencies.
2+
*
3+
!dependencies.R

.rscignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.github
2+
.lintr
3+
.renvignore
4+
.Renviron
5+
.rhino
6+
.rscignore
7+
tests

app.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Rhino / shinyApp entrypoint. Do not edit.
2+
rhino::app()

app/js/index.js

Whitespace-only changes.

app/logic/__init__.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Logic: application code independent from Shiny.
2+
# https://go.appsilon.com/rhino-project-structure

app/main.R

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
box::use(
2+
shiny[bootstrapPage, div, moduleServer, NS, renderUI, tags, uiOutput],
3+
)
4+
5+
#' @export
6+
ui <- function(id) {
7+
ns <- NS(id)
8+
bootstrapPage(
9+
uiOutput(ns("message"))
10+
)
11+
}
12+
13+
#' @export
14+
server <- function(id) {
15+
moduleServer(id, function(input, output, session) {
16+
output$message <- renderUI({
17+
div(
18+
style = "display: flex; justify-content: center; align-items: center; height: 100vh;",
19+
tags$h1(
20+
tags$a("Check out Rhino docs!", href = "https://appsilon.github.io/rhino/")
21+
)
22+
)
23+
})
24+
})
25+
}

app/static/favicon.ico

9.44 KB
Binary file not shown.

app/styles/main.scss

Whitespace-only changes.

app/view/__init__.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# View: Shiny modules and related code.
2+
# https://go.appsilon.com/rhino-project-structure

config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
default:
2+
rhino_log_level: !expr Sys.getenv("RHINO_LOG_LEVEL", "INFO")
3+
rhino_log_file: !expr Sys.getenv("RHINO_LOG_FILE", NA)

dependencies.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file allows packrat (used by rsconnect during deployment) to pick up dependencies.
2+
library(rhino)

0 commit comments

Comments
 (0)