Skip to content

Commit b9281d2

Browse files
committed
Initial commit
0 parents  commit b9281d2

121 files changed

Lines changed: 13062 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Binary assets are stored via Git LFS.
2+
*.png filter=lfs diff=lfs merge=lfs -text
3+
*.jpg filter=lfs diff=lfs merge=lfs -text
4+
*.jpeg filter=lfs diff=lfs merge=lfs -text
5+
*.gif filter=lfs diff=lfs merge=lfs -text
6+
*.webp filter=lfs diff=lfs merge=lfs -text
7+
*.tif filter=lfs diff=lfs merge=lfs -text
8+
*.tiff filter=lfs diff=lfs merge=lfs -text
9+
*.ico filter=lfs diff=lfs merge=lfs -text
10+
*.icns filter=lfs diff=lfs merge=lfs -text
11+
*.ttf filter=lfs diff=lfs merge=lfs -text
12+
*.otf filter=lfs diff=lfs merge=lfs -text
13+
*.woff filter=lfs diff=lfs merge=lfs -text
14+
*.woff2 filter=lfs diff=lfs merge=lfs -text
15+
16+
# SVGs are text (XML), so keep them out of LFS and normalize line endings.
17+
*.svg text

.github/workflows/ci.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: CI
2+
3+
# Run on pushes and pull requests targeting the default branch.
4+
on:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
branches: [master]
9+
10+
# Cancel an in-progress run when a newer commit is pushed to the same
11+
# branch/PR so we don't waste runners on superseded work.
12+
concurrency:
13+
group: ci-${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
# ---------------------------------------------------------------------------
18+
# Frontend: type-check (svelte-check) and unit tests (vitest).
19+
# Runs on Linux because the JS toolchain has no platform-specific needs here.
20+
# ---------------------------------------------------------------------------
21+
frontend:
22+
name: Frontend (check + test)
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
27+
with:
28+
# Binary assets (png/ico/icns/...) are stored in Git LFS.
29+
lfs: true
30+
31+
# pnpm must be installed before setup-node so the pnpm cache can resolve.
32+
# The pnpm version comes from package.json's "packageManager" field.
33+
- name: Setup pnpm
34+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
35+
with:
36+
run_install: false
37+
38+
- name: Setup Node
39+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
40+
with:
41+
node-version: 26
42+
cache: pnpm
43+
44+
- name: Install dependencies
45+
run: pnpm install --frozen-lockfile
46+
47+
# `check` chains `svelte-kit sync` first, so generated types exist.
48+
- name: Type-check
49+
run: pnpm check
50+
51+
- name: Unit tests
52+
run: pnpm test
53+
54+
# ---------------------------------------------------------------------------
55+
# Rust: format, lint and test the Tauri crate.
56+
# Runs on Windows (the app's target) to avoid installing Tauri's Linux
57+
# system dependencies (webkit2gtk, etc.). Uses the runner's preinstalled
58+
# rustup and the official actions/cache, no third-party actions.
59+
# ---------------------------------------------------------------------------
60+
rust:
61+
name: Rust (fmt + clippy + test)
62+
runs-on: windows-latest
63+
defaults:
64+
run:
65+
# All cargo steps operate inside the Tauri crate.
66+
working-directory: src-tauri
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
70+
with:
71+
lfs: true
72+
73+
# rustup ships preinstalled on GitHub runners; just select stable and
74+
# ensure the components we lint with are present.
75+
- name: Set up Rust
76+
run: |
77+
rustup default stable
78+
rustup component add rustfmt clippy
79+
80+
# Cache the cargo registry/git deps and the crate's target dir.
81+
- name: Cache cargo
82+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
83+
with:
84+
path: |
85+
~/.cargo/registry
86+
~/.cargo/git
87+
src-tauri/target
88+
key: ${{ runner.os }}-cargo-${{ hashFiles('src-tauri/Cargo.lock') }}
89+
restore-keys: |
90+
${{ runner.os }}-cargo-
91+
92+
- name: Format check
93+
run: cargo fmt --all -- --check
94+
95+
- name: Clippy
96+
run: cargo clippy --all-targets -- -D warnings
97+
98+
- name: Tests
99+
run: cargo test

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release
2+
3+
# Build and publish the Tauri app when a version tag (v*) is pushed.
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
# Needed by tauri-action to create the GitHub Release and upload bundles.
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
name: Build Tauri bundle (Windows)
16+
runs-on: windows-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
20+
with:
21+
# Icons and other binary assets live in Git LFS.
22+
lfs: true
23+
24+
# The pnpm version comes from package.json's "packageManager" field.
25+
- name: Setup pnpm
26+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
27+
with:
28+
run_install: false
29+
30+
- name: Setup Node
31+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
32+
with:
33+
node-version: 26
34+
cache: pnpm
35+
36+
# rustup is preinstalled on the runner; just pin to stable.
37+
- name: Set up Rust
38+
run: rustup default stable
39+
40+
- name: Cache cargo
41+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
42+
with:
43+
path: |
44+
~/.cargo/registry
45+
~/.cargo/git
46+
src-tauri/target
47+
key: ${{ runner.os }}-cargo-release-${{ hashFiles('src-tauri/Cargo.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-cargo-release-
50+
${{ runner.os }}-cargo-
51+
52+
- name: Install dependencies
53+
run: pnpm install --frozen-lockfile
54+
55+
# tauri-action runs `beforeBuildCommand` (pnpm build), compiles the
56+
# Rust app, bundles it, and attaches the artifacts to a draft release.
57+
- name: Build and release
58+
uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # action-v0.6.2
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
tagName: ${{ github.ref_name }}
63+
releaseName: 'Watermarker ${{ github.ref_name }}'
64+
releaseDraft: true
65+
prerelease: false

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
vite.config.js.timestamp-*
10+
vite.config.ts.timestamp-*

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Generated / vendored files. Never format these.
2+
node_modules
3+
.svelte-kit
4+
build
5+
dist
6+
pnpm-lock.yaml
7+
pnpm-workspace.yaml
8+
src-tauri/target
9+
src-tauri/gen
10+
static
11+
*.png
12+
*.ico
13+
*.icns
14+
*.svg

.prettierrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"useTabs": false,
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"printWidth": 100,
7+
"semi": true,
8+
"plugins": ["prettier-plugin-svelte"],
9+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
10+
}

0 commit comments

Comments
 (0)