Skip to content
Closed
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
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Bug Report
about: Report a bug with the opencode-pty plugin
title: "[Bug]: "
labels: ["bug"]
assignees: ""
title: '[Bug]: '
labels: ['bug']
assignees: ''
---

## Description
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Feature Request
about: Suggest a new feature or enhancement
title: "[Feature]: "
labels: ["enhancement"]
assignees: ""
title: '[Feature]: '
labels: ['enhancement']
assignees: ''
---

## Problem Statement
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read
actions: read

jobs:
test:
strategy:
fail-fast: false
matrix:
quality: [test, typecheck, lint, format:check, test:e2e]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6

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

- name: Cache Bun dependencies
uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-

- name: Install dependencies
run: bun ci

- name: Install Playwright Browsers
run: bunx playwright install --with-deps

- name: Build
run: bun build:prod

- name: Run quality step
run: bun ${{matrix.quality}}

dependency-review:
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
steps:
- name: Checkout Repository
uses: actions/checkout@v6

- name: Dependency Review
uses: actions/dependency-review-action@v4

nix-flake-test:
strategy:
fail-fast: false
matrix:
quality: [quality, test, test:e2e]
name: Nix Flake CI
runs-on: ubuntu-latest
permissions:
id-token: write # Required for FlakeHub cache authentication
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Determinate Nix
uses: DeterminateSystems/determinate-nix-action@v3
- name: Enable Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v13
with:
use-flakehub: false
- name: Cache Bun dependencies
uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies (Nix devShell)
run: nix develop .# --command bun ci

- name: Build (Nix devShell)
run: nix develop .# --command bun build:prod

- name: Quality checks (Nix devShell)
run: nix develop .# --command bun ${{matrix.quality}}
39 changes: 17 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Release

on:
push:
branches:
- main
workflow_run:
workflows: ['CI']
types:
- completed
branches: [main]
workflow_dispatch:

permissions:
Expand All @@ -12,26 +14,27 @@ permissions:

jobs:
publish:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 20
bun-version: latest

- name: Determine release state
id: determine
run: |
set -euo pipefail
CURRENT_VERSION=$(node -p "require('./package.json').version")
CURRENT_VERSION=$(bun -e 'import pkg from "./package.json"; console.log(pkg.version)')
echo "current_version=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
if git rev-parse HEAD^ >/dev/null 2>&1; then
PREVIOUS_VERSION=$(node -e "const { execSync } = require('node:child_process'); try { const data = execSync('git show HEAD^:package.json', { stdio: ['ignore', 'pipe', 'ignore'] }); const json = JSON.parse(data.toString()); if (json && typeof json.version === 'string') { process.stdout.write(json.version); } } catch (error) {}")
PREVIOUS_VERSION=$(bun -e "const { execSync } = require('node:child_process'); try { const data = execSync('git show HEAD^:package.json', { stdio: ['ignore', 'pipe', 'ignore'] }); const json = JSON.parse(data.toString()); if (json && typeof json.version === 'string') { process.stdout.write(json.version); } } catch (error) {}")
PREVIOUS_VERSION=${PREVIOUS_VERSION//$'\n'/}
else
PREVIOUS_VERSION=""
Expand All @@ -51,13 +54,7 @@ jobs:

- name: Install dependencies
if: steps.determine.outputs.changed == 'true' && steps.determine.outputs.tag_exists == 'false'
run: |
npm install -g npm@latest
npm install

- name: Type check
if: steps.determine.outputs.changed == 'true' && steps.determine.outputs.tag_exists == 'false'
run: npx tsc --noEmit
run: bun ci

- name: Generate release notes
if: steps.determine.outputs.changed == 'true' && steps.determine.outputs.tag_exists == 'false'
Expand Down Expand Up @@ -123,14 +120,12 @@ jobs:

- name: Create GitHub release
if: steps.determine.outputs.changed == 'true' && steps.determine.outputs.tag_exists == 'false'
uses: actions/create-release@v1
run: |
gh release create "v${{ steps.determine.outputs.current_version }}" \
--title "v${{ steps.determine.outputs.current_version }}" \
--notes "${{ steps.release_notes.outputs.body }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.determine.outputs.current_version }}
release_name: v${{ steps.determine.outputs.current_version }}
body: ${{ steps.release_notes.outputs.body }}
generate_release_notes: false

- name: Publish to npm
if: steps.determine.outputs.changed == 'true' && steps.determine.outputs.tag_exists == 'false'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ dist
coverage
*.lcov

# test results and reports
playwright-report/
test-results/

# logs
logs
_.log
Expand Down
4 changes: 4 additions & 0 deletions .opencode/opencode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://opencode.ai/config.json",
"instructions": ["README.md"]
}
30 changes: 30 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Dependencies
node_modules/
bun.lock

# Build outputs
dist/
*.tgz

# Test reports
playwright-report/
test-results/
coverage/

# Logs
*.log
logs/

# OS generated files
.DS_Store
Thumbs.db

# IDE
.vscode/
.idea/

# Git
.git/

# Lock files (Bun handles this)
bun.lock
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": false,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"useTabs": false
}
Loading