Skip to content

Commit

Permalink
feat: update deps & implement basic ci/cd config
Browse files Browse the repository at this point in the history
  • Loading branch information
alysonhower committed Nov 16, 2024
1 parent dc91293 commit 2cac716
Show file tree
Hide file tree
Showing 56 changed files with 714 additions and 1,069 deletions.
22 changes: 22 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": ["config:recommended", "group:all", "schedule:weekly", ":widenPeerDependencies"],
"enabledManagers": ["cargo", "github-actions", "npm"],
"packageRules": [
{
"matchUpdateTypes": ["patch"],
"enabled": false
},
{
"matchManagers": ["cargo"],
"automerge": true,
"minimumReleaseAge": "2 days"
},
{
"matchManagers": ["bun"],
"automerge": true,
"minimumReleaseAge": "2 days"
}
],
"timezone": "America/Sao_Paulo",
"dependencyDashboard": true
}
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'publish'

on:
push:
tags:
- v*.*.*
workflow_dispatch:

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
# Uncomment for Intel builds
# - platform: 'macos-latest' # for Intel based macs.
# args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-24.04'
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun i

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Build Tauri
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'v__VERSION__'
releaseBody: 'See [CHANGES.md](https://github.com/alysonhower/tauri2-svelte5-shadcn/blob/main/CHANGES.md) for a complete list of changes.'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
47 changes: 47 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build

on:
push:
branches:
- main
paths:
- 'src/**'
- 'src-tauri/**'
- 'tests/**'
- 'bun.lockb'
- 'src-tauri/Cargo.lock'
- '.github/workflows/test-build.yml'
pull_request:
workflow_dispatch:

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
build-tauri:
permissions:
contents: write
strategy:
fail-fast: true

runs-on: 'ubuntu-24.04'
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun i

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Build Tauri
run: bun tauri build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ Thumbs.db
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

# Tauri
/src-tauri/target
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"plugins": [
"prettier-plugin-svelte"
],
"overrides": [
{
"files": "*.svelte",
Expand Down
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"rust-lang.rust-analyzer",
"tauri-apps.tauri-vscode",
"svelte.svelte-vscode",
"bradlc.vscode-tailwindcss",
"esbenp.prettier-vscode"
]
}
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 1.0.0 (2024-11-15)

- Feat: implement basic ci/cd config
99 changes: 23 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,39 @@
# Tauri 2 + Svelte 5 + Shadcn Boilerplate
# Tauri 2 Svelte 5 Boilerplate
Simple boilerplate for Tauri 2 with Svelte 5 (and shadcn-svelte) using Bun runtime.

[![Tauri 2.0](https://img.shields.io/badge/Tauri-2.0-blue)](https://tauri.app/)
[![Svelte 5](https://img.shields.io/badge/Svelte-5.0-orange)](https://svelte.dev/)
[![Bun](https://img.shields.io/badge/Bun-ts-pink)](https://bun.sh/)
[![shadcn-svelte](https://img.shields.io/badge/UI-shadcn--svelte-purple)](https://www.shadcn-svelte.com/)
## Requirements
In order to run this boilerplate, you need to install Bun and Rust. If you are on Windows I also recommend installing MSVC before the other dependencies (make sure to check the "Desktop development with C++" workload).

A modern, feature-rich boilerplate for building cross-platform desktop applications using Tauri 2, Svelte 5, and shadcn-svelte components. This template provides a solid foundation for developing performant desktop applications with a beautiful UI.
Some useful links:
- https://bun.sh/docs/installation
- https://www.rust-lang.org/tools/install
- https://visualstudio.microsoft.com/vs/community/

## ✨ Features

- 🚀 **Tauri 2.0** - Build smaller, faster, and more secure desktop applications
- 🎯 **Svelte 5** - Cybernetically enhanced web apps with runes
- 💅 **shadcn-svelte** - Beautiful and accessible UI components
- 🎨 **TailwindCSS** - Utility-first CSS framework
- 📦 **Bun** - Fast JavaScript runtime and package manager
- 🔧 **TypeScript** - Type-safe development
- 🎭 **Pre-configured development environment**

## 🚀 Getting Started

### Prerequisites

Before you begin, ensure you have the following installed:

1. **Bun** - [Bun installation](https://bun.sh/docs/installation)
2. **Rust** - [Rust installation](https://www.rust-lang.org/tools/install)
3. **For Windows Users:**
- Install [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/)
- During installation, select "Desktop development with C++" workload

### Installation

1. Clone the repository:
```bash
git clone https://github.com/alysonhower/tauri2-svelte5-shadcn.git
## Setup
```

2. Navigate to the project directory:
```bash
git clone https://github.com/alysonhower/tauri2-svelte5-shadcn.git
cd tauri2-svelte5-shadcn
bun i
```

3. Install dependencies:
```bash
bun install
## Useful commands
### Start dev server
```

## 🛠️ Development

### Start Development Server
```bash
bun run tauri dev
```

### Build Production Release
```bash
bun run tauri build
```

### Code Formatting
```bash
bun run format
### Build executable
```

### Adding UI Components
To add shadcn components (e.g., button):
```bash
bunx shadcn-svelte@latest add button
bun run tauri build
```

## 📚 Usefull Links

- [Svelte 5](https://svelte.dev/)
- [Tauri 2](https://tauri.app/start/)
- [TailwindCSS](https://tailwindcss.com/)
- [Shadcn-svelte](https://next.shadcn-svelte.com/)

## 🤝 Contributing

Contributions are welcome! Feel free to:

1. Fork the repository
2. Create a feature branch
3. Submit a Pull Request
## Other links
### Svelte 5
https://svelte.dev/docs

Please ensure your PR follows the project's coding standards and includes appropriate tests.
### Tauri 2
https://tauri.app/start/

## ⚠️ Platform Support
### shadcn-svelte
https://next.shadcn-svelte.com/

Currently tested and verified on:
- ✅ Windows 11
Note: Boilerplate tested on Windows 11 only.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"style": "default",
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app.css",
"css": "src\\app.css",
"baseColor": "slate"
},
"aliases": {
Expand Down
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
{
"name": "tauri2-svelte5-shadcn",
"version": "0.0.1",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write ./src",
"lint": "prettier --check ./src",
"format": "prettier --write .",
"lint": "prettier --check .",
"tauri": "tauri"
},
"devDependencies": {
"@sveltejs/kit": "^2.7.4",
"@sveltejs/kit": "^2.7.2",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"autoprefixer": "^10.4.20",
"bits-ui": "^1.0.0-next.40",
"bits-ui": "^1.0.0-next.58",
"clsx": "^2.1.1",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7",
"svelte": "^5.1.9",
"svelte": "^5.1.1",
"svelte-check": "^4.0.5",
"tailwind-merge": "^2.5.4",
"tailwind-variants": "^0.2.1",
"tailwind-variants": "^0.3.0",
"tailwindcss": "^3.4.14",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"@sveltejs/adapter-static": "^3.0.6",
"@tauri-apps/cli": "^2.0.4",
"bun-types": "^1.1.34",
"lucide-svelte": "^0.454.0",
"mode-watcher": "^0.4.1"
"vite": "^5.4.10"
},
"dependencies": {}
}
"dependencies": {
"@sveltejs/adapter-static": "^3.0.5",
"@tauri-apps/api": "^2.0.3",
"@tauri-apps/cli": "^2.0.4",
"bun-types": "^1.1.33"
}
}
8 changes: 4 additions & 4 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
Loading

0 comments on commit 2cac716

Please sign in to comment.