Skip to content

Commit 1b39226

Browse files
committed
Add Tauri
1 parent c218358 commit 1b39226

File tree

15 files changed

+345
-83
lines changed

15 files changed

+345
-83
lines changed

.github/workflows/deploy-web.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy Web Version to Netlify
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build web version
27+
run: npm run build:web
28+
29+
- name: Deploy to Netlify
30+
uses: netlify/actions/cli@master
31+
with:
32+
args: deploy --dir=dist --prod
33+
env:
34+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
35+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
36+
37+
- name: Comment PR with deploy URL
38+
if: github.event_name == 'pull_request'
39+
uses: netlify/actions/cli@master
40+
with:
41+
args: deploy --dir=dist --alias=pr-${{ github.event.number }}
42+
env:
43+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
44+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

README.md

Lines changed: 40 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,46 @@
1-
# React + TypeScript + Vite
1+
# Get Static
2+
3+
[![Deploy Web Version](https://github.com/yourusername/yourrepo/actions/workflows/deploy-web.yml/badge.svg)](https://github.com/yourusername/yourrepo/actions/workflows/deploy-web.yml)
4+
5+
A static site generator built with React and Tauri.
6+
7+
## Development
8+
9+
```bash
10+
# Install dependencies
11+
npm install
12+
13+
# Start development server
14+
npm run dev
15+
16+
# Build for web deployment
17+
npm run build:web
18+
19+
# Build Tauri desktop app
20+
npm run tauri build
21+
```
22+
23+
## Deployment
24+
25+
The web version is automatically deployed to Netlify on every push to the main branch.
26+
27+
- **Live Site**: [your-site-name.netlify.app](https://your-site-name.netlify.app)
28+
- **Deploy Status**: Check the Actions tab for build status
29+
30+
## Architecture
31+
32+
- **Frontend**: React + TypeScript + Tailwind CSS
33+
- **Desktop**: Tauri (Rust + WebView)
34+
- **Web Deployment**: Netlify
35+
- **CI/CD**: GitHub Actions
36+
37+
---
38+
39+
## Original Vite Template Info
240

341
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
442

543
Currently, two official plugins are available:
644

745
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9-
10-
## Expanding the ESLint configuration
11-
12-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13-
14-
```js
15-
export default tseslint.config([
16-
globalIgnores(['dist']),
17-
{
18-
files: ['**/*.{ts,tsx}'],
19-
extends: [
20-
// Other configs...
21-
22-
// Remove tseslint.configs.recommended and replace with this
23-
...tseslint.configs.recommendedTypeChecked,
24-
// Alternatively, use this for stricter rules
25-
...tseslint.configs.strictTypeChecked,
26-
// Optionally, add this for stylistic rules
27-
...tseslint.configs.stylisticTypeChecked,
28-
29-
// Other configs...
30-
],
31-
languageOptions: {
32-
parserOptions: {
33-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
34-
tsconfigRootDir: import.meta.dirname,
35-
},
36-
// other options...
37-
},
38-
},
39-
])
40-
```
41-
42-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
43-
44-
```js
45-
// eslint.config.js
46-
import reactX from 'eslint-plugin-react-x'
47-
import reactDom from 'eslint-plugin-react-dom'
48-
49-
export default tseslint.config([
50-
globalIgnores(['dist']),
51-
{
52-
files: ['**/*.{ts,tsx}'],
53-
extends: [
54-
// Other configs...
55-
// Enable lint rules for React
56-
reactX.configs['recommended-typescript'],
57-
// Enable lint rules for React DOM
58-
reactDom.configs.recommended,
59-
],
60-
languageOptions: {
61-
parserOptions: {
62-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
63-
tsconfigRootDir: import.meta.dirname,
64-
},
65-
// other options...
66-
},
67-
},
68-
])
69-
```
46+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

netlify.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[build]
2+
publish = "dist"
3+
command = "npm run build:web"
4+
5+
[build.environment]
6+
NODE_VERSION = "18"
7+
8+
# Handle client-side routing
9+
[[redirects]]
10+
from = "/*"
11+
to = "/index.html"
12+
status = 200
13+
14+
# Security headers
15+
[[headers]]
16+
for = "/*"
17+
[headers.values]
18+
X-Frame-Options = "DENY"
19+
X-XSS-Protection = "1; mode=block"
20+
X-Content-Type-Options = "nosniff"
21+
Referrer-Policy = "strict-origin-when-cross-origin"
22+
23+
# Cache static assets
24+
[[headers]]
25+
for = "/assets/*"
26+
[headers.values]
27+
Cache-Control = "public, max-age=31536000, immutable"

package-lock.json

Lines changed: 11 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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "tsc -b && vite build",
9+
"build:web": "tsc -b && vite build --config vite.config.web.ts",
10+
"preview:web": "vite preview --config vite.config.web.ts --outDir dist",
911
"lint": "eslint .",
10-
"preview": "vite preview"
12+
"preview": "vite preview",
13+
"ci:install": "npm ci --prefer-offline --no-audit",
14+
"ci:build": "npm run build:web"
1115
},
1216
"dependencies": {
1317
"@blocknote/core": "^0.32.0-hackdays.0",
@@ -34,6 +38,7 @@
3438
"@rjsf/utils": "^6.0.0-beta.11",
3539
"@rjsf/validator-ajv8": "^6.0.0-beta.10",
3640
"@tailwindcss/vite": "^4.1.11",
41+
"@tauri-apps/api": "^2.6.0",
3742
"@types/dompurify": "^3.0.5",
3843
"browser-image-compression": "^2.0.2",
3944
"class-variance-authority": "^0.7.1",

src-tauri/Cargo.lock

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

src-tauri/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ serde = { version = "1.0", features = ["derive"] }
2323
log = "0.4"
2424
tauri = { version = "2.6.1", features = [] }
2525
tauri-plugin-log = "2"
26+
27+
[target."cfg(target_os = \"macos\")".dependencies]
28+
cocoa = "0.26"

0 commit comments

Comments
 (0)