Skip to content

Commit 7308dca

Browse files
Reorganize repository to Vite + src/configs layout (#103)
* Initial plan * chore: reorganize project for vite structure Agent-Logs-Url: https://github.com/dandi/access-page/sessions/2fc1ef50-153b-46d1-8d5f-b82b453b0373 Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com> * fix: keep CNAME at repository root Agent-Logs-Url: https://github.com/dandi/access-page/sessions/471740d7-9f9a-423b-9bbd-f33c23a07c65 Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com> * fix: make CNAME copy step cross-platform Agent-Logs-Url: https://github.com/dandi/access-page/sessions/471740d7-9f9a-423b-9bbd-f33c23a07c65 Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com> * fix: use ESM-safe CNAME copy command Agent-Logs-Url: https://github.com/dandi/access-page/sessions/471740d7-9f9a-423b-9bbd-f33c23a07c65 Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com> * refactor: move image files to src assets Agent-Logs-Url: https://github.com/dandi/access-page/sessions/d6795640-f636-4911-82bb-d8d2d87c33e0 Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com> * fix: bundle plotting libs to avoid CDN load failures Agent-Logs-Url: https://github.com/dandi/access-page/sessions/14a35d7a-f3db-47ef-b5bd-59ce39b6dbc9 Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com> * fix: use relative Vite base for preview asset paths Agent-Logs-Url: https://github.com/dandi/access-page/sessions/793a9c56-8d99-4a43-8ea4-ae172b324017 Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com> * fix: include root public assets in Vite build Agent-Logs-Url: https://github.com/dandi/access-page/sessions/90c2ebf4-0623-4f60-ba36-9e8d75934370 Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com> * fix: declare totals header in strict module scope Agent-Logs-Url: https://github.com/dandi/access-page/sessions/b76b904e-77ef-4a3c-9e87-44885bfd595a Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com>
1 parent 0a085e0 commit 7308dca

15 files changed

Lines changed: 1049 additions & 23 deletions

.github/workflows/preview.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,20 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v4
1717

18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 24
22+
cache: npm
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build site
28+
run: npm run build
29+
1830
- name: Deploy preview
1931
uses: rossjrw/pr-preview-action@v1
2032
with:
21-
source-dir: .
33+
source-dir: dist
2234
preview-branch: gh-pages

.github/workflows/refresh_pages.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,27 @@ on:
99
jobs:
1010
refresh:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
1214

1315
steps:
1416
- name: Checkout code
1517
uses: actions/checkout@v4
1618

17-
- name: Reset gh-pages to latest main
18-
run: |
19-
git fetch origin
20-
git checkout gh-pages
21-
git reset --hard origin/main
22-
git push origin gh-pages --force
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 24
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build site
29+
run: npm run build
30+
31+
- name: Deploy to gh-pages
32+
uses: peaceiris/actions-gh-pages@v4
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./dist

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# PyCharm
22
.idea/*
33
nohup.out
4+
node_modules/
5+
dist/

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<picture>
3-
<img alt="nwb2bids logo" src="dandi-usage-logo.svg" width="200">
3+
<img alt="nwb2bids logo" src="src/assets/dandi-usage-logo.svg" width="200">
44
</picture>
55

66
<h1 align="center">DANDI usage webpage (source)</h1>
@@ -13,8 +13,15 @@ Main webpage: https://usage.dandiarchive.org
1313
## Configuration
1414

1515
When deploying a fork that points at a different data repository, update the
16-
`BASE_URL` constant near the top of `plots.js`:
16+
`BASE_URL` constant near the top of `src/plots.js`:
1717

1818
```js
1919
const BASE_URL = "https://raw.githubusercontent.com/myorg/myrepo/main";
2020
```
21+
22+
## Development
23+
24+
```bash
25+
npm install
26+
npm run dev
27+
```

configs/vite.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from "vite";
2+
3+
export default defineConfig({
4+
root: "src",
5+
publicDir: "../public",
6+
base: "./",
7+
build: {
8+
outDir: "../dist",
9+
emptyOutDir: true,
10+
},
11+
});

0 commit comments

Comments
 (0)