Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"@typescript-eslint",
"react",
"react-hooks",
"import"
],
"rules": {
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"import/order": ["warn", {
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}]
},
"settings": {
"react": {
"version": "detect"
}
},
"ignorePatterns": [
"node_modules/",
"dist/",
"build/",
"src-tauri/target/"
]
}
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
allow:
- dependency-type: "all"
open-pull-requests-limit: 10

- package-ecosystem: cargo
directory: "/src-tauri"
schedule:
interval: weekly
allow:
- dependency-type: "all"
open-pull-requests-limit: 10
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

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

- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev

- name: Install dependencies
run: npm ci

- name: Build
run: npm run tauri build

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: builds-${{ matrix.os }}
path: |
src-tauri/target/release/bundle/
!src-tauri/target/release/bundle/**/*.d
110 changes: 110 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
create-release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v4

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false

build-release:
needs: create-release
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset_name: dbviz-linux-x86_64
- os: macos-latest
target: x86_64-apple-darwin
asset_name: dbviz-macos-x86_64
- os: macos-latest
target: aarch64-apple-darwin
asset_name: dbviz-macos-aarch64
- os: windows-latest
target: x86_64-pc-windows-msvc
asset_name: dbviz-windows-x86_64.exe

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev

- name: Install dependencies
run: npm ci

- name: Build
run: npm run tauri build -- --target ${{ matrix.target }}

- name: Find binary (Linux)
if: matrix.os == 'ubuntu-latest'
id: find_binary_linux
run: |
BINARY=$(find src-tauri/target/${{ matrix.target }}/release -maxdepth 1 -type f -executable -name "database-schema-visualizer" | head -n 1)
echo "binary_path=$BINARY" >> $GITHUB_OUTPUT

- name: Find binary (macOS)
if: matrix.os == 'macos-latest'
id: find_binary_macos
run: |
BINARY=$(find src-tauri/target/${{ matrix.target }}/release/bundle/macos -name "*.app" | head -n 1)
tar -czf ${{ matrix.asset_name }}.tar.gz -C $(dirname $BINARY) $(basename $BINARY)
echo "binary_path=${{ matrix.asset_name }}.tar.gz" >> $GITHUB_OUTPUT

- name: Find binary (Windows)
if: matrix.os == 'windows-latest'
id: find_binary_windows
run: |
$BINARY = Get-ChildItem -Path src-tauri/target/${{ matrix.target }}/release -Filter "*.exe" -File | Select-Object -First 1
echo "binary_path=$($BINARY.FullName)" >> $env:GITHUB_OUTPUT

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ steps.find_binary_linux.outputs.binary_path || steps.find_binary_macos.outputs.binary_path || steps.find_binary_windows.outputs.binary_path }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream
41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Tests

on:
push:
branches: [main, develop, claude/**]
pull_request:
branches: [main, develop]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npx eslint src --ext .ts,.tsx

- name: Check Prettier formatting
run: npx prettier --check src

- name: Run type checking
run: npm run lint

- name: Run tests
run: npm test

- name: Upload coverage
uses: codecov/codecov-action@v3
if: always()
with:
files: ./coverage/coverage-final.json
flags: unittests
fail_ci_if_error: false
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.{ts,tsx}": ["eslint --fix", "prettier --write"],
"*.json": ["prettier --write"],
"*.md": ["prettier --write"]
}
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
dist
build
src-tauri/target
.git
.github
coverage
*.sql
package-lock.json
pnpm-lock.yaml
yarn.lock
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5",
"arrowParens": "always",
"printWidth": 100,
"endOfLine": "lf"
}
Loading
Loading