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
40 changes: 40 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Size labels are handled by the labeler action based on changed files
"package:core":
- changed-files:
- any-glob-to-any-file: "packages/core/**"

"package:plugin-api":
- changed-files:
- any-glob-to-any-file: "packages/plugin-api/**"

"package:storage":
- changed-files:
- any-glob-to-any-file:
- "packages/storage-core/**"
- "packages/storage-sqlite/**"

"package:api":
- changed-files:
- any-glob-to-any-file: "packages/api/**"

"app:desktop":
- changed-files:
- any-glob-to-any-file: "apps/desktop/**"

"app:docs":
- changed-files:
- any-glob-to-any-file: "apps/docs-site/**"

"app:marketing":
- changed-files:
- any-glob-to-any-file: "apps/marketing-site/**"

"ci":
- changed-files:
- any-glob-to-any-file: ".github/**"

"dependencies":
- changed-files:
- any-glob-to-any-file:
- "pnpm-lock.yaml"
- "**/package.json"
30 changes: 30 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Auto-merge

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: write
pull-requests: write

jobs:
automerge-owner:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'tomymaritano'
steps:
- name: Enable auto-merge for owner PRs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: gh pr merge "$PR_NUMBER" --auto --merge --repo "$GITHUB_REPOSITORY"

automerge-dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Enable auto-merge for dependabot PRs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: gh pr merge "$PR_NUMBER" --auto --merge --repo "$GITHUB_REPOSITORY"
203 changes: 165 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ on:
pull_request:
branches: [main, develop]

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

env:
NODE_VERSION: '22'

jobs:
lint:
# ── Shared install + cache ─────────────────────────
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -19,72 +27,191 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'

- name: Force HTTPS for GitHub git dependencies
run: git config --global 'url.https://github.com/.insteadOf' 'git@github.com:'

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Cache node_modules
uses: actions/cache/save@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
key: modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}

# ── Tier 1: Lint + Format ──────────────────────────
lint:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
key: modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Run ESLint
- name: ESLint
run: pnpm lint

- name: Check Prettier formatting
- name: Prettier
run: pnpm format:check

- name: Commitlint (PR title)
if: github.event_name == 'pull_request'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "$PR_TITLE" | pnpm commitlint

# ── Tier 1: Tests + Coverage ───────────────────────
test:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}

- name: Force HTTPS for GitHub git dependencies
run: git config --global 'url.https://github.com/.insteadOf' 'git@github.com:'

- name: Install dependencies
run: pnpm install
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
key: modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}

# Run tests (excludes storage-sqlite which requires native module)
- name: Run tests
run: pnpm test
- name: Run tests with coverage
run: pnpm test -- --coverage

- name: Build packages
run: pnpm build

- name: Upload coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
packages/*/coverage/
apps/*/coverage/
if-no-files-found: ignore

# ── Tier 1: Typecheck ──────────────────────────────
typecheck:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}

- name: Force HTTPS for GitHub git dependencies
run: git config --global 'url.https://github.com/.insteadOf' 'git@github.com:'

- name: Install dependencies
run: pnpm install
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
key: modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Build packages first
run: pnpm build

- name: Typecheck desktop
working-directory: apps/desktop
run: pnpm typecheck

# ── Tier 3: Security audit ─────────────────────────
security:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
key: modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Audit dependencies
run: pnpm audit --prod --audit-level=high || true

- name: Check licenses
run: |
npx license-checker --production --failOn "GPL-3.0;AGPL-3.0;SSPL-1.0" --summary || true

# ── Tier 2: Bundle size tracking ───────────────────
bundle-size:
needs: setup
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
key: modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Build all packages
run: pnpm build

- name: Report package sizes
run: |
echo "## 📦 Package Sizes" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "| Package | Size |" >> "$GITHUB_STEP_SUMMARY"
echo "|---------|------|" >> "$GITHUB_STEP_SUMMARY"
for dir in packages/*/dist; do
if [ -d "$dir" ]; then
pkg=$(basename "$(dirname "$dir")")
size=$(du -sh "$dir" 2>/dev/null | cut -f1)
echo "| $pkg | $size |" >> "$GITHUB_STEP_SUMMARY"
fi
done

# ── Tier 2: PR labels ─────────────────────────────
label:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CodeQL

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
- cron: '0 6 * * 1'

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

jobs:
analyze:
name: Analyze (JavaScript/TypeScript)
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript-typescript

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
28 changes: 28 additions & 0 deletions .github/workflows/pr-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR Size

on:
pull_request:
types: [opened, synchronize]

permissions:
pull-requests: write

jobs:
size-label:
runs-on: ubuntu-latest
steps:
- uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/XS'
xs_max_size: 10
s_label: 'size/S'
s_max_size: 50
m_label: 'size/M'
m_max_size: 200
l_label: 'size/L'
l_max_size: 500
xl_label: 'size/XL'
fail_if_xl: false
message_if_xl: >
This PR is quite large. Consider splitting it into smaller PRs for easier review.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm commitlint --edit "$1"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm test && pnpm typecheck
Loading
Loading