Skip to content

Commit ced7d33

Browse files
committed
Add links to shinylive pages
1 parent 67f0902 commit ced7d33

14 files changed

Lines changed: 823 additions & 27 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build Shinylive Links
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: "20"
29+
30+
- name: Setup Python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: "3.12"
34+
35+
- name: Install shinylive
36+
run: |
37+
pip install shinylive
38+
# Verify installation
39+
shinylive --version
40+
41+
- name: Build all example apps
42+
run: |
43+
./scripts/build-all-examples.sh
44+
45+
- name: Generate shinylive redirect pages
46+
run: |
47+
python scripts/generate-shinylive-links.py
48+
49+
- name: Upload pages artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: shinylive-pages
53+
54+
deploy:
55+
if: github.ref == 'refs/heads/main'
56+
needs: build
57+
runs-on: ubuntu-latest
58+
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist/
44
*.py[cod]
55
.DS_Store
66
examples/*/package-lock.json
7+
shinylive-pages/

examples/1-hello-world/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"scripts": {
88
"build": "concurrently -c auto \"npm run build-r\" \"npm run build-py\" \"tsc --noEmit\"",
99
"watch": "concurrently -c auto \"npm run watch-r\" \"npm run watch-py\" \"tsc --noEmit --watch --preserveWatchOutput\"",
10-
"build-r": "esbuild srcts/main.tsx --bundle --outfile=r/www/main.js --format=esm --alias:react=react",
11-
"watch-r": "esbuild srcts/main.tsx --bundle --outfile=r/www/main.js --format=esm --alias:react=react --watch",
12-
"build-py": "esbuild srcts/main.tsx --bundle --outfile=py/www/main.js --format=esm --alias:react=react",
13-
"watch-py": "esbuild srcts/main.tsx --bundle --outfile=py/www/main.js --format=esm --alias:react=react --watch",
10+
"build-r": "esbuild srcts/main.tsx --bundle --minify --outfile=r/www/main.js --format=esm --alias:react=react",
11+
"watch-r": "esbuild srcts/main.tsx --bundle --minify --outfile=r/www/main.js --format=esm --alias:react=react --watch",
12+
"build-py": "esbuild srcts/main.tsx --bundle --minify --outfile=py/www/main.js --format=esm --alias:react=react",
13+
"watch-py": "esbuild srcts/main.tsx --bundle --minify --outfile=py/www/main.js --format=esm --alias:react=react --watch",
1414
"clean": "rm -rf r/www py/www"
1515
},
1616
"author": "Winston Chang",
@@ -26,5 +26,11 @@
2626
},
2727
"dependencies": {
2828
"@posit/shiny-react": "^0.0.6"
29+
},
30+
"exampleMetadata": {
31+
"title": "Hello World",
32+
"description": "Basic bidirectional communication between React and Shiny",
33+
"deployToShinylive": true,
34+
"comment": ""
2935
}
3036
}

examples/2-inputs/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"scripts": {
88
"build": "concurrently -c auto \"npm run build-r\" \"npm run build-py\" \"tsc --noEmit\"",
99
"watch": "concurrently -c auto \"npm run watch-r\" \"npm run watch-py\" \"tsc --noEmit --watch --preserveWatchOutput\"",
10-
"build-r": "esbuild srcts/main.tsx --bundle --outfile=r/www/main.js --format=esm --alias:react=react",
11-
"watch-r": "esbuild srcts/main.tsx --bundle --outfile=r/www/main.js --format=esm --alias:react=react --watch",
12-
"build-py": "esbuild srcts/main.tsx --bundle --outfile=py/www/main.js --format=esm --alias:react=react",
13-
"watch-py": "esbuild srcts/main.tsx --bundle --outfile=py/www/main.js --format=esm --alias:react=react --watch",
10+
"build-r": "esbuild srcts/main.tsx --bundle --minify --outfile=r/www/main.js --format=esm --alias:react=react",
11+
"watch-r": "esbuild srcts/main.tsx --bundle --minify --outfile=r/www/main.js --format=esm --alias:react=react --watch",
12+
"build-py": "esbuild srcts/main.tsx --bundle --minify --outfile=py/www/main.js --format=esm --alias:react=react",
13+
"watch-py": "esbuild srcts/main.tsx --bundle --minify --outfile=py/www/main.js --format=esm --alias:react=react --watch",
1414
"clean": "rm -rf r/www py/www"
1515
},
1616
"author": "Winston Chang",
@@ -26,5 +26,11 @@
2626
},
2727
"dependencies": {
2828
"@posit/shiny-react": "^0.0.6"
29+
},
30+
"exampleMetadata": {
31+
"title": "Input Components",
32+
"description": "Comprehensive showcase of input components and form handling",
33+
"deployToShinylive": true,
34+
"comment": ""
2935
}
3036
}

examples/2-inputs/srcts/styles.css

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ body::before {
5353
}
5454

5555
.app-container {
56-
max-width: 1400px;
56+
max-width: 1200px;
5757
width: 100%;
5858
}
5959

@@ -62,14 +62,6 @@ body::before {
6262
margin-bottom: 3rem;
6363
}
6464

65-
.cards-wrap {
66-
display: flex;
67-
flex-wrap: wrap;
68-
gap: 24px;
69-
justify-content: center;
70-
max-width: 100%;
71-
}
72-
7365
@media (max-width: 520px) {
7466
.cards-wrap {
7567
gap: 16px;
@@ -81,9 +73,18 @@ body::before {
8173
}
8274
}
8375

76+
.cards-wrap {
77+
display: flex;
78+
flex-wrap: wrap;
79+
gap: 16px;
80+
padding: 0 24px;
81+
justify-content: center;
82+
max-width: 100%;
83+
}
84+
8485
.card {
85-
width: 600px;
86-
margin: 0 auto;
86+
flex: 1 1 300px;
87+
max-width: 620px;
8788
background: rgba(255, 255, 255, 0.95);
8889
-webkit-backdrop-filter: blur(20px); /* Safari support */
8990
backdrop-filter: blur(20px);

examples/3-outputs/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"scripts": {
77
"build": "concurrently -c auto \"npm run build-r\" \"npm run build-py\" \"tsc --noEmit\"",
88
"watch": "concurrently -c auto \"npm run watch-r\" \"npm run watch-py\" \"tsc --noEmit --watch --preserveWatchOutput\"",
9-
"build-r": "esbuild srcts/main.tsx --bundle --outfile=r/www/main.js --format=esm --alias:react=react",
10-
"watch-r": "esbuild srcts/main.tsx --bundle --outfile=r/www/main.js --format=esm --alias:react=react --watch",
11-
"build-py": "esbuild srcts/main.tsx --bundle --outfile=py/www/main.js --format=esm --alias:react=react",
12-
"watch-py": "esbuild srcts/main.tsx --bundle --outfile=py/www/main.js --format=esm --alias:react=react --watch",
9+
"build-r": "esbuild srcts/main.tsx --bundle --minify --outfile=r/www/main.js --format=esm --alias:react=react",
10+
"watch-r": "esbuild srcts/main.tsx --bundle --minify --outfile=r/www/main.js --format=esm --alias:react=react --watch",
11+
"build-py": "esbuild srcts/main.tsx --bundle --minify --outfile=py/www/main.js --format=esm --alias:react=react",
12+
"watch-py": "esbuild srcts/main.tsx --bundle --minify --outfile=py/www/main.js --format=esm --alias:react=react --watch",
1313
"clean": "rm -rf r/www py/www"
1414
},
1515
"author": "Winston Chang",
@@ -27,5 +27,11 @@
2727
},
2828
"dependencies": {
2929
"@posit/shiny-react": "^0.0.6"
30+
},
31+
"exampleMetadata": {
32+
"title": "Output Components",
33+
"description": "Data visualization and output rendering examples",
34+
"deployToShinylive": true,
35+
"comment": ""
3036
}
3137
}

examples/4-messages/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"scripts": {
77
"build": "concurrently -c auto \"npm run build-r\" \"npm run build-py\" \"tsc --noEmit\"",
88
"watch": "concurrently -c auto \"npm run watch-r\" \"npm run watch-py\" \"tsc --noEmit --watch --preserveWatchOutput\"",
9-
"build-r": "esbuild srcts/main.tsx --bundle --outfile=r/www/main.js --format=esm --alias:react=react",
10-
"watch-r": "esbuild srcts/main.tsx --bundle --outfile=r/www/main.js --format=esm --alias:react=react --watch",
11-
"build-py": "esbuild srcts/main.tsx --bundle --outfile=py/www/main.js --format=esm --alias:react=react",
12-
"watch-py": "esbuild srcts/main.tsx --bundle --outfile=py/www/main.js --format=esm --alias:react=react --watch",
9+
"build-r": "esbuild srcts/main.tsx --bundle --minify --outfile=r/www/main.js --format=esm --alias:react=react",
10+
"watch-r": "esbuild srcts/main.tsx --bundle --minify --outfile=r/www/main.js --format=esm --alias:react=react --watch",
11+
"build-py": "esbuild srcts/main.tsx --bundle --minify --outfile=py/www/main.js --format=esm --alias:react=react",
12+
"watch-py": "esbuild srcts/main.tsx --bundle --minify --outfile=py/www/main.js --format=esm --alias:react=react --watch",
1313
"clean": "rm -rf r/www py/www"
1414
},
1515
"author": "Winston Chang",
@@ -29,5 +29,11 @@
2929
},
3030
"dependencies": {
3131
"@posit/shiny-react": "^0.0.6"
32+
},
33+
"exampleMetadata": {
34+
"title": "Server Messages",
35+
"description": "Server-to-client messaging patterns and real-time updates",
36+
"deployToShinylive": true,
37+
"comment": ""
3238
}
3339
}

examples/5-shadcn/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,11 @@
3434
"class-variance-authority": "^0.7.1",
3535
"clsx": "^2.1.1",
3636
"tailwind-merge": "^3.3.1"
37+
},
38+
"exampleMetadata": {
39+
"title": "shadcn/ui Components",
40+
"description": "Modern UI components using shadcn/ui design system",
41+
"deployToShinylive": true,
42+
"comment": ""
3743
}
3844
}

examples/6-dashboard/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,11 @@
4444
"lucide-react": "^0.542.0",
4545
"recharts": "^2.8.0",
4646
"tailwind-merge": "^3.3.1"
47+
},
48+
"exampleMetadata": {
49+
"title": "Dashboard",
50+
"description": "Full dashboard with charts, tables, and interactive widgets",
51+
"deployToShinylive": true,
52+
"comment": ""
4753
}
4854
}

examples/7-chat/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# AI Chat Example
22

3+
**Note: This example very experimental. In the future, it will benefit from better integration with Ellmer (R) and Chatlas (Python).**
4+
35
A modern AI chat application built with Shiny-React, featuring:
46

57
- **Frontend**: React with shadcn/ui components and Tailwind CSS

0 commit comments

Comments
 (0)