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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug Report
description: File a bug report to help us improve Cinder Notes
title: "[Bug]: "
labels: ["bug", "triage"]
title: '[Bug]: '
labels: ['bug', 'triage']
body:
- type: markdown
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature Request
description: Suggest an idea for this project
title: "[Feat]: "
labels: ["enhancement"]
title: '[Feat]: '
labels: ['enhancement']
body:
- type: markdown
attributes:
Expand Down
156 changes: 149 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,170 @@ on:
branches: [main]

jobs:
verify:
name: Verify PR
runs-on: ubuntu-latest
setup:
name: Setup
uses: ./.github/workflows/setup.yml

# ── Frontend checks (run when src/ or config files change) ──

lint:
name: Lint
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
node-version: 22

- name: Install dependencies
run: npm ci
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ github.sha }}

- name: Lint
run: npm run lint

typecheck:
name: Typecheck
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ github.sha }}

- name: Typecheck
run: npm run typecheck

prettier:
name: Prettier
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ github.sha }}

- name: Check formatting
run: npm run format:check

build:
name: Build (Vite)
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ github.sha }}

- name: Build
run: npm run build

# ── Tauri build (only when src-tauri/ changes) ──

check-tauri-changes:
name: Check Tauri Changes
runs-on: ubuntu-latest
outputs:
tauri_changed: ${{ steps.filter.outputs.tauri }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Check for src-tauri changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
tauri:
- 'src-tauri/**'

tauri-build:
name: Build (Tauri)
needs: [build, check-tauri-changes]
if: needs.check-tauri-changes.outputs.tauri_changed == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ github.sha }}

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

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

- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
src-tauri/target
key: rust-${{ runner.os }}-${{ hashFiles('src-tauri/Cargo.lock') }}
restore-keys: rust-${{ runner.os }}-

- name: Build Tauri app
run: npm run tauri:build

verify:
name: Verify PR
needs: [lint, typecheck, prettier, build, tauri-build]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check pipeline status
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "❌ One or more pipeline jobs failed or were cancelled."
exit 1
fi
echo "✅ All jobs completed successfully or were intentionally skipped!"
28 changes: 28 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Setup

on:
workflow_call:

jobs:
setup:
name: Install Dependencies
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Cache node_modules
uses: actions/cache/save@v4
with:
path: node_modules
key: node-modules-${{ github.sha }}
32 changes: 32 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

# Colors for better feedback in terminal
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
NC='\033[0m' # No Color

echo "\n${BLUE}--- Running Pre-Commit Checks ---${NC}\n"

# Step 1: Lint Staged (ESLint, Prettier, Cargo fmt)
echo "${YELLOW}[1/2] Checking staged files (Lint & Format)...${NC}"
if npx lint-staged; then
echo "${GREEN}✔ Step 1 passed: Staged files formatted and linted.${NC}\n"
else
echo "\n${RED}✘ Step 1 failed: Format or Lint errors detected.${NC}"
echo "${RED} Review the errors above, fix them, 'git add' the files, and try committing again.${NC}\n"
exit 1
fi

# Step 2: Global Typecheck
echo "${YELLOW}[2/2] Running global TypeScript typecheck...${NC}"
if npm run typecheck; then
echo "${GREEN}✔ Step 2 passed: No TypeScript issues found.${NC}\n"
else
echo "\n${RED}✘ Step 2 failed: TypeScript compilation errors detected.${NC}"
echo "${RED} Review the type errors above, fix them, and try committing again.${NC}\n"
exit 1
fi

echo "${GREEN}--- All pre-commit checks passed! ---${NC}\n"
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 80,
"tabWidth": 2
}
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ There are plenty of note-taking apps out there, but most are either bloated Elec

### Keyboard Shortcuts

| Shortcut | Action |
| --- | --- |
| Cmd+S | Force save |
| Cmd+N | New file |
| Cmd+Shift+N | New folder |
| Cmd+W | Close current tab |
| Cmd+B | Toggle sidebar |
| Cmd+Shift+F | Global search |
| Cmd+F | Find/replace (in editor) |
| Shortcut | Action |
| ----------- | ------------------------ |
| Cmd+S | Force save |
| Cmd+N | New file |
| Cmd+Shift+N | New folder |
| Cmd+W | Close current tab |
| Cmd+B | Toggle sidebar |
| Cmd+Shift+F | Global search |
| Cmd+F | Find/replace (in editor) |

### Theming & UI

Expand Down Expand Up @@ -120,16 +120,16 @@ Compiled binaries will be generated in `src-tauri/target/release/`.

## Tech Stack

| Layer | Technology |
| --- | --- |
| Framework | [Tauri](https://tauri.app/) -- Lightweight native apps with a Rust backend |
| Frontend | [React 19](https://react.dev/) + [TypeScript](https://www.typescriptlang.org/) |
| Build | [Vite](https://vite.dev/) |
| Styling | [Tailwind CSS v4](https://tailwindcss.com/) + CSS Variables |
| State | [Zustand](https://github.com/pmndrs/zustand) -- Minimal state management |
| Editor | [CodeMirror](https://codemirror.net/) via [@uiw/react-codemirror](https://github.com/uiwjs/react-codemirror) |
| Markdown | [react-markdown](https://github.com/remarkjs/react-markdown) + remark-gfm + remark-math + rehype-katex + rehype-highlight + rehype-sanitize |
| Icons | [Lucide](https://lucide.dev/) + [React Icons](https://react-icons.github.io/react-icons/) |
| Layer | Technology |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Framework | [Tauri](https://tauri.app/) -- Lightweight native apps with a Rust backend |
| Frontend | [React 19](https://react.dev/) + [TypeScript](https://www.typescriptlang.org/) |
| Build | [Vite](https://vite.dev/) |
| Styling | [Tailwind CSS v4](https://tailwindcss.com/) + CSS Variables |
| State | [Zustand](https://github.com/pmndrs/zustand) -- Minimal state management |
| Editor | [CodeMirror](https://codemirror.net/) via [@uiw/react-codemirror](https://github.com/uiwjs/react-codemirror) |
| Markdown | [react-markdown](https://github.com/remarkjs/react-markdown) + remark-gfm + remark-math + rehype-katex + rehype-highlight + rehype-sanitize |
| Icons | [Lucide](https://lucide.dev/) + [React Icons](https://react-icons.github.io/react-icons/) |

**Why Tauri over Electron?**
Tauri apps are significantly smaller (~10-20MB vs ~150MB), use less memory, and leverage the OS's native webview. The Rust backend ensures security and performance.
Expand Down
Loading