Skip to content

Commit 6aacbe3

Browse files
committed
feat: add Zed extension for codetime.dev activity tracking
Port of codetime-vscode. Zed exposes no editor-event or status-bar API to extensions, so editing activity is captured via the language server protocol instead: the WASM extension registers and launches a native language server (codetime-ls) that turns didOpen/didChange/didSave into CodeTime event logs and POSTs them to the API. Consequence: the VS Code status-bar total has no Zed equivalent and is dropped; tracking is unaffected.
0 parents  commit 6aacbe3

10 files changed

Lines changed: 2879 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release codetime-ls
2+
3+
# Tag a release (e.g. `git tag v0.1.0 && git push --tags`) to build the language
4+
# server for every platform the Zed extension downloads, and attach the
5+
# `codetime-ls-<target-triple>.zip` assets the extension looks for.
6+
on:
7+
push:
8+
tags:
9+
- "v*"
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build:
16+
name: ${{ matrix.target }}
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- os: ubuntu-latest
23+
target: x86_64-unknown-linux-gnu
24+
cross: false
25+
- os: ubuntu-latest
26+
target: aarch64-unknown-linux-gnu
27+
cross: true
28+
- os: macos-latest
29+
target: x86_64-apple-darwin
30+
cross: false
31+
- os: macos-latest
32+
target: aarch64-apple-darwin
33+
cross: false
34+
- os: windows-latest
35+
target: x86_64-pc-windows-msvc
36+
cross: false
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- uses: dtolnay/rust-toolchain@stable
41+
with:
42+
targets: ${{ matrix.target }}
43+
44+
- name: Install cross
45+
if: matrix.cross
46+
run: cargo install cross --locked
47+
48+
- name: Build
49+
shell: bash
50+
run: |
51+
if [ "${{ matrix.cross }}" = "true" ]; then
52+
cross build -p codetime-ls --release --target ${{ matrix.target }}
53+
else
54+
cargo build -p codetime-ls --release --target ${{ matrix.target }}
55+
fi
56+
57+
- name: Package
58+
shell: bash
59+
run: |
60+
bin=codetime-ls
61+
ext=""
62+
if [[ "${{ matrix.target }}" == *windows* ]]; then ext=".exe"; fi
63+
src="target/${{ matrix.target }}/release/${bin}${ext}"
64+
out="codetime-ls-${{ matrix.target }}.zip"
65+
# Zip must contain the binary at its root, named codetime-ls(.exe).
66+
if command -v 7z >/dev/null 2>&1; then
67+
cp "$src" "${bin}${ext}"
68+
7z a "$out" "${bin}${ext}"
69+
else
70+
(cd "target/${{ matrix.target }}/release" && zip -j "$OLDPWD/$out" "${bin}${ext}")
71+
fi
72+
73+
- name: Upload to release
74+
uses: softprops/action-gh-release@v2
75+
with:
76+
files: codetime-ls-${{ matrix.target }}.zip

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
*.wasm

0 commit comments

Comments
 (0)