Skip to content

Commit 38c429f

Browse files
committed
refactor: Modularize Shiny UI into dedicated files, add R and JS CI workflows, and set document language for accessibility.
1 parent 31c8b73 commit 38c429f

File tree

15 files changed

+857
-722
lines changed

15 files changed

+857
-722
lines changed

.github/workflows/lint-js.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: JS Lint
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
lint-js:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Use Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20.x'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run Lint
25+
run: npm run lint

.github/workflows/test-r.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: R Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
test-r:
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up R
20+
uses: r-lib/actions/setup-r@v2
21+
with:
22+
r-version: 'release'
23+
24+
- name: Install system dependencies
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev
28+
29+
- name: Cache R packages
30+
uses: actions/cache@v3
31+
with:
32+
path: ${{ env.R_LIBS_USER }}
33+
key: ${{ runner.os }}-r-${{ hashFiles('shiny/config/constants.R') }}
34+
restore-keys: |
35+
${{ runner.os }}-r-
36+
37+
- name: Install dependencies
38+
run: |
39+
install.packages(c("shiny", "testthat", "vegan", "iNEXT", "ggplot2", "DT", "shinyjs", "waiter", "shinyFeedback", "readr", "readxl", "dplyr", "tidyr", "ape", "picante", "betapart", "rmarkdown"))
40+
shell: Rscript {0}
41+
42+
- name: Run tests
43+
run: |
44+
testthat::test_dir("shiny/tests/testthat")
45+
shell: Rscript {0}

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"start": "electron-forge start",
1111
"package": "electron-forge package",
1212
"make": "electron-forge make",
13-
"publish": "electron-forge publish"
13+
"publish": "electron-forge publish",
14+
"lint": "standard"
1415
},
1516
"keywords": [
1617
"community-ecology",
@@ -33,6 +34,7 @@
3334
"homepage": "https://github.com/jm0535/0rdin#readme",
3435
"dependencies": {
3536
"axios": "^1.6.0",
37+
"electron-log": "^5.4.3",
3638
"electron-squirrel-startup": "^1.0.0"
3739
},
3840
"devDependencies": {
@@ -71,7 +73,9 @@
7173
"exe": "ordin.exe",
7274
"setupExe": "Ordin-3.0.0-Setup.exe"
7375
},
74-
"platforms": ["win32"]
76+
"platforms": [
77+
"win32"
78+
]
7579
},
7680
{
7781
"name": "@electron-forge/maker-zip",
@@ -88,22 +92,32 @@
8892
"maintainer": "Ordin",
8993
"homepage": "https://github.com/jmoses/ordin",
9094
"icon": "./build/icon.png",
91-
"categories": ["Science", "Education"],
95+
"categories": [
96+
"Science",
97+
"Education"
98+
],
9299
"section": "science"
93100
}
94101
},
95-
"platforms": ["linux"]
102+
"platforms": [
103+
"linux"
104+
]
96105
},
97106
{
98107
"name": "@electron-forge/maker-rpm",
99108
"config": {
100109
"options": {
101110
"homepage": "https://github.com/jmoses/ordin",
102111
"icon": "./build/icon.png",
103-
"categories": ["Science", "Education"]
112+
"categories": [
113+
"Science",
114+
"Education"
115+
]
104116
}
105117
},
106-
"platforms": ["linux"]
118+
"platforms": [
119+
"linux"
120+
]
107121
}
108122
]
109123
}

0 commit comments

Comments
 (0)