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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
llm-core/**
pipeline
pipeline/**
dist/**
**/dist
packages/*/dist/**
examples/*/client/dist/**
examples/*/server/dist/**
assistant-ui/**
copilot-sdk/**
codex/**
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
},
overrides: [
{
files: ["docs/**/*.ts", "docs/**/*.js", "tests/**/*.ts", "tests/**/*.js"],
files: ["docs/**/*.ts", "docs/**/*.js", "tests/**/*.ts", "tests/**/*.js", "**/tests/**/*.ts", "**/tests/**/*.js"],
rules: {
"consistent-return": "off",
},
Expand Down
55 changes: 43 additions & 12 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,23 +1,54 @@
#!/bin/sh
set -e

STAGED_FILES=$(git diff --cached --name-only -z)
# Get changed files
STAGED_FILES=$(git diff --cached --name-only)

echo "pre-commit: format"
bun run format
echo "pre-commit: lint:fix"
bun run lint:fix
echo "pre-commit: typecheck"
bun run typecheck
echo "pre-commit: test"
bun run test
# Define patterns
CORE_PATTERN="^packages/|^package.json|^tsconfig.json|^.eslintrc.cjs"
DOCS_PATTERN="^docs/"
EXAMPLES_PATTERN="^examples/"

# Function to check if files matching pattern changed
has_changes() {
echo "$STAGED_FILES" | grep -q "$1"
Comment thread
pipewrk marked this conversation as resolved.
Outdated
}

# Run core checks if core files changed
if has_changes "$CORE_PATTERN"; then
echo "📦 Core changes detected. Running core checks..."
echo " - Format"
bun run format
echo " - Lint"
bun run lint:fix
echo " - Typecheck"
bun run typecheck
echo " - Test"
bun run test
fi

# Run doc checks if docs changed
if has_changes "$DOCS_PATTERN"; then
echo "📚 Docs changes detected. Running doc checks..."
echo " - Build"
bun run docs:build
echo " - Snippets Typecheck"
bun run docs:snippets:typecheck
fi

# Run example checks if examples changed
if has_changes "$EXAMPLES_PATTERN"; then
echo "🧪 Example changes detected. Running example checks..."
echo " - Typecheck Examples"
bun run typecheck:examples
fi

# Check for unstaged changes after auto-formatting
if [ -n "$STAGED_FILES" ]; then
CHANGED=$(printf "%s" "$STAGED_FILES" | xargs -0 git diff --name-only --)
CHANGED=$(git diff --name-only -- $STAGED_FILES)
if [ -n "$CHANGED" ]; then
echo "pre-commit: staged files changed after formatting/lint. Please review and re-stage."
echo "⚠️ Staged files changed after formatting/lint. Please review and re-stage:"
echo "$CHANGED"
echo "hint: git add $CHANGED"
exit 1
fi
fi
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
- name: Test
run: bun test --coverage --coverage-reporter=text --coverage-reporter=lcov

- name: Typecheck Examples
run: bun run typecheck:examples

- name: Upload coverage
uses: codecov/codecov-action@v5
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Docs
on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -32,14 +33,21 @@ jobs:
- name: Build docs
run: bun run docs:build

- name: Typecheck Snippets
run: bun run docs:snippets:typecheck

- name: Upload Pages artifact
# Only upload artifact if pushing to main (deployment candidate)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
runs-on: ubuntu-latest
needs: build
# Only deploy on main push
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
62 changes: 57 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ on:
push:
tags:
- "v*"
- "*/*"

permissions:
contents: write

jobs:
publish:
release-core:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -29,11 +31,61 @@ jobs:
- name: Install
run: bun install

- name: Build
run: bun run build
- name: Build Core
run: bun run --filter @geekist/llm-core build

- name: Publish
run: npm publish --access public
- name: Publish Core
run: cd packages/llm-core && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: GitHub Release
uses: softprops/action-gh-release@v2

release-app:
if: contains(github.ref, '/')
runs-on: ubuntu-latest
Comment thread
pipewrk marked this conversation as resolved.
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.2.21"

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"

- name: Install
run: bun install

- name: Parse Tag
id: parse_tag
run: |
TAG=${GITHUB_REF#refs/tags/}
APP_NAME=$(echo $TAG | cut -d'/' -f1)
echo "app_name=$APP_NAME" >> $GITHUB_OUTPUT

- name: Build App
run: bun run --filter ${{ steps.parse_tag.outputs.app_name }} build

- name: Publish App
# Assumes app directory name matches the tag prefix or we map it via bun filter
# For simplicity, we filter by package name which usually matches or we cd into apps/$APP_NAME
# Here we try generic publish if possible, or assume package name matches
run: |
APP_NAME=${{ steps.parse_tag.outputs.app_name }}
# Find directory
APP_DIR=$(find apps examples -name "$APP_NAME" -type d -maxdepth 2 | head -n 1)
if [ -z "$APP_DIR" ]; then
echo "App directory not found for $APP_NAME"
exit 1
fi
cd $APP_DIR && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down
Loading
Loading