Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
6188b98
break circular dependencies
pirate Oct 15, 2025
e05bf24
cleaner variable names
pirate Oct 15, 2025
9bc7b4b
consistent naming of event_children
pirate Oct 15, 2025
aa73613
add tests for independent usage
pirate Oct 15, 2025
582aefc
add support for middlewares to hook into event bus handler lifecycle
pirate Oct 16, 2025
b65ff22
Merge pull request #2 from pirate/middlewares
pirate Oct 16, 2025
27e8c51
Merge branch 'main' into circular-cleanup
pirate Oct 16, 2025
518ee27
better variable naming
pirate Oct 16, 2025
3963aa7
implement event history backend
pirate Oct 16, 2025
ad36a77
Merge pull request #3 from pirate/event-history-backend
pirate Oct 16, 2025
8cd3335
add monitor dash mini app
pirate Oct 17, 2025
5747fcb
improve monitor ui dash
pirate Oct 17, 2025
615c34e
better middleware API and documentation
pirate Oct 18, 2025
719e934
add query method and debounce helpers
pirate Oct 18, 2025
89b6df8
rename folder to ui
pirate Oct 18, 2025
5a094dc
improve perf tests
pirate Oct 18, 2025
165169e
add event_history mirroring test
pirate Oct 18, 2025
be314d6
ignore sqlite temp files
pirate Oct 18, 2025
c925e17
add stricter type checking for tests
pirate Oct 18, 2025
d195dd6
proper type inference tests
pirate Oct 18, 2025
b4e4a34
bump version
pirate Oct 18, 2025
5e7bd12
Add EventEmitter2 link to inspiration section
pirate Nov 26, 2025
73a60f6
Revise README description for bubus library
pirate Nov 28, 2025
854773d
Merge pull request #4 from pirate/patch-1
pirate Nov 28, 2025
79e4063
Update README.md
pirate Dec 8, 2025
b5fac1c
Update README.md
pirate Dec 8, 2025
67f5b1e
remove old js lockfile
pirate Dec 8, 2025
807c3a6
fix queue-jumping behavior to be more intuitive to actually jump inst…
pirate Dec 8, 2025
7c21c3b
bump version
pirate Dec 8, 2025
2db5914
propagate dispatch-time user-provided ContextVars to handler execution
pirate Dec 8, 2025
0c5c1df
clear ContextVars after handler execution to lower memory use
pirate Dec 8, 2025
5899a3d
bump version
pirate Dec 8, 2025
1ca9709
document the new ContextVar propagation feature
pirate Dec 8, 2025
1c6e6cf
add claude perms
pirate Dec 9, 2025
bf82b95
implement new .find method to replace expect and get_or_dispatch
pirate Dec 9, 2025
fb3f4bb
fix bus name conflict checking and determinism around gc
pirate Dec 9, 2025
aa61357
add EventStatus enum and cleanup middlewares APIs for clarity
pirate Dec 9, 2025
9d6b782
massivly simplify middleware interface
pirate Dec 9, 2025
f6abe6d
fix middlewares type
pirate Dec 9, 2025
4e291cf
bump version
pirate Dec 9, 2025
140fb7a
Revise event handling examples in README
pirate Dec 9, 2025
fb68fcb
add bubus-ts implementation
pirate Feb 5, 2026
5230ba0
use monotonic timestamps and fix bus proxy
pirate Feb 5, 2026
b5cda39
add ts readme
pirate Feb 5, 2026
b04db57
remove unused configs
pirate Feb 5, 2026
500ed8e
fix eslint
pirate Feb 5, 2026
6b0cf8c
Fix log tree behavior and child completion
pirate Feb 5, 2026
d891ff2
add asynclocalstorage
pirate Feb 5, 2026
40a248e
fix tests and improve naming consistency
pirate Feb 6, 2026
b678e79
more queue jumping fixes
pirate Feb 6, 2026
2e0a9d2
add debug logging
pirate Feb 6, 2026
413d0cf
wip
pirate Feb 6, 2026
2acac40
all tests passing
pirate Feb 6, 2026
82a346e
completed lock system refactor
pirate Feb 6, 2026
1be5da2
readme updates
pirate Feb 6, 2026
4d038a6
LockManager consolidation
pirate Feb 6, 2026
a1f51f1
tests passing
pirate Feb 7, 2026
328af87
code cleanup and better naming
pirate Feb 7, 2026
a21dd46
all working except slower performance
pirate Feb 7, 2026
2d51a39
add type inference for return values
pirate Feb 7, 2026
e79782b
update readme
pirate Feb 7, 2026
03a2449
fix perf regression
pirate Feb 7, 2026
f20916c
more cleanup and naming improvements
pirate Feb 8, 2026
daa7dab
make awaiting event wait for processing on all busses, raise Exceptio…
pirate Feb 8, 2026
4d9d88c
bump version
pirate Feb 8, 2026
9b6d4bf
Update README.md
pirate Feb 9, 2026
fd7e6b5
Revise README to emphasize multi-language support
pirate Feb 9, 2026
dc29a76
Update README for brevity and clarity
pirate Feb 9, 2026
4228337
Update README description for bubus
pirate Feb 9, 2026
fd52a82
Update README with implementation badges
pirate Feb 9, 2026
da51cfd
Clean up README.md by removing duplicates
pirate Feb 9, 2026
b190994
add bubus-ts publish flow
pirate Feb 9, 2026
46b59ab
add perf tests
pirate Feb 9, 2026
875e331
unverified python perf fixes
pirate Feb 9, 2026
45b5c6a
Add retry() decorator with semaphore support and re-entrancy protection
claude Feb 9, 2026
8be7423
Use shared async_context.ts polyfill for retry re-entrancy tracking
claude Feb 9, 2026
57884c1
Support string error names and RegExp patterns in retry_on_errors
claude Feb 9, 2026
f9b2ce6
Update README retry_on_errors docs for string/RegExp matchers
claude Feb 9, 2026
792b725
Add semaphore_scope option: 'global', 'class', 'instance'
claude Feb 9, 2026
b577a5f
Add TC39 @retry() decorator syntax tests and scope fallback tests
claude Feb 9, 2026
fa5d90c
rename _refs to _event_buses
pirate Feb 9, 2026
182e98d
Add full usage pattern tests and README docs for @retry decorator
claude Feb 9, 2026
7a82629
Add test for retry wrapping emit→done cycle in parallel with other ev…
claude Feb 9, 2026
df34d9d
Document @retry as handler-level concept; discourage emit-level retry…
claude Feb 9, 2026
0ab4696
Add .first() method on BaseEvent for racing event handlers
claude Feb 9, 2026
6c816b6
Replace _first_result with first_result getter on BaseEvent
claude Feb 9, 2026
e742d64
fix status icon tests
pirate Feb 9, 2026
701bd71
Replace _first_mode with event_handler_completion field for replay vi…
claude Feb 9, 2026
305b6f8
Merge pull request #5 from pirate/claude/add-retry-decorator-L3GT1
pirate Feb 9, 2026
a7c67e9
Update README.md
pirate Feb 9, 2026
74b3ba3
move handler locks to live on event
pirate Feb 10, 2026
114aaab
Update README.md
pirate Feb 10, 2026
27c7614
wip
pirate Feb 10, 2026
6cb8c66
label event busses by uuid instead of just name, clenaup dispatch met…
pirate Feb 10, 2026
c685c50
add cross-runtime performance measurement
pirate Feb 10, 2026
df2bd38
better perf tests
pirate Feb 10, 2026
8cc59ee
better gc handling in perf tests
pirate Feb 10, 2026
323140a
update perf section to include versions tested
pirate Feb 10, 2026
4fd3db2
lazily allocate EventResult.event_children and ._lock to save memory …
pirate Feb 10, 2026
3bee4b1
more perf optimizations
pirate Feb 10, 2026
e273f14
change output stats formatting
pirate Feb 10, 2026
02c8106
more perf measuring
pirate Feb 11, 2026
6b7db03
more accurate perf
pirate Feb 11, 2026
e9a8cab
readme improvements
pirate Feb 11, 2026
7f02d49
rewrite ts readme
pirate Feb 11, 2026
b682ed4
more readme cleanup
pirate Feb 11, 2026
32a3edf
bump version
pirate Feb 11, 2026
3df0e31
tweak readme install instructions
pirate Feb 11, 2026
82116d4
tweak runtimes
pirate Feb 11, 2026
53842be
add new examples
pirate Feb 11, 2026
94e586b
add shebangs
pirate Feb 11, 2026
6078a39
fix dispatch vs emit consistency
pirate Feb 11, 2026
d5c87cf
prettier
pirate Feb 11, 2026
ada3dde
Add tests for parallel emit + Promise.all done() racing pattern
claude Feb 9, 2026
7c3f883
Add package-lock.json to gitignore (pnpm project)
claude Feb 9, 2026
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: 5 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
"Bash(echo:*)",
"Bash(grep:*)",
"Bash(rg:*)",
"Bash(.venv/bin/pytest tests/test_typed_event_results.py::test_builtin_type_casting -v -s --timeout=10)"
"WebFetch(domain:github.com)",
"Bash(timeout 60 .venv/bin/pytest:*)",
"Bash(timeout 180 .venv/bin/pytest tests/ -v)",
"Bash(timeout 180 .venv/bin/pytest:*)",
"Bash(git tag:*)"
],
"deny": []
}
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: publish-npm

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: npm dist-tag to publish under
required: false
default: latest

permissions:
contents: read
id-token: write

jobs:
publish_to_npm:
runs-on: ubuntu-latest
defaults:
run:
working-directory: bubus-ts
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: bubus-ts/pnpm-lock.yaml
registry-url: https://registry.npmjs.org

- run: pnpm install --frozen-lockfile
- run: pnpm run typecheck
- run: pnpm test
- run: pnpm run build

- name: Publish release tag
if: github.event_name == 'release'
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish manual tag
if: github.event_name == 'workflow_dispatch'
run: pnpm publish --access public --tag "${{ inputs.tag }}" --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
27 changes: 10 additions & 17 deletions .github/workflows/test.yaml → .github/workflows/test_py.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test
name: test-py
permissions:
actions: read
contents: write
Expand All @@ -17,7 +17,7 @@ on:
- '*'
pull_request:
workflow_dispatch:

jobs:
find_tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -68,15 +68,15 @@ jobs:
- run: uv sync --dev --all-extras

- run: pytest -x tests/${{ matrix.test_filename }}.py --cov=bubus --cov-report=term

- name: Check coverage files
run: |
echo "Looking for coverage files..."
ls -la .coverage* 2>/dev/null || ls -la | grep coverage || echo "No coverage files found"
if [ -f .coverage ]; then
echo "Found .coverage file, size: $(stat -f%z .coverage 2>/dev/null || stat -c%s .coverage) bytes"
fi

- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
Expand All @@ -91,20 +91,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v6
with:
enable-cache: true
activate-environment: true

- run: uv sync --dev --all-extras

- name: Download all coverage data
uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: coverage-data/

- name: Combine coverage data
run: |
# Find all .coverage files and copy them with unique names
Expand All @@ -113,7 +113,7 @@ jobs:
cp "$coverage_file" ".coverage.$counter"
counter=$((counter + 1))
done

- name: Combine coverage & fail if it's <80%
run: |
uv tool install 'coverage[toml]'
Expand All @@ -126,7 +126,7 @@ jobs:

# Report again and fail if under 80%.
coverage report --fail-under=80

- name: Upload combined coverage report
uses: actions/upload-artifact@v4
with:
Expand All @@ -135,10 +135,3 @@ jobs:
htmlcov/
coverage.xml
retention-days: 7

- name: Upload coverage to Codecov (optional)
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
continue-on-error: true
74 changes: 74 additions & 0 deletions .github/workflows/test_ts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: test-ts

on:
push:
branches:
- main
- stable
- 'releases/**'
tags:
- '*'
pull_request:
workflow_dispatch:

jobs:
find_ts_tests:
runs-on: ubuntu-latest
outputs:
TS_TEST_FILENAMES: ${{ steps.lsgrep.outputs.TS_TEST_FILENAMES }}
# ["eventbus_basics", ...]
steps:
- uses: actions/checkout@v4
- id: lsgrep
run: |
TS_TEST_FILENAMES="$(ls bubus-ts/tests/*.test.ts | sed 's|^bubus-ts/tests/||' | sed 's|\\.test\\.ts$||' | jq -R -s -c 'split("\n")[:-1]')"
echo "TS_TEST_FILENAMES=${TS_TEST_FILENAMES}" >> "$GITHUB_OUTPUT"
echo "$TS_TEST_FILENAMES"
- name: Check that at least one test file is found
run: |
if [ -z "${{ steps.lsgrep.outputs.TS_TEST_FILENAMES }}" ]; then
echo "Failed to find any *.test.ts files in bubus-ts/tests/ folder!" > /dev/stderr
exit 1
fi

tests:
needs: find_ts_tests
runs-on: ubuntu-latest
strategy:
matrix:
test_filename: ${{ fromJson(needs.find_ts_tests.outputs.TS_TEST_FILENAMES || '["FAILED_TO_DISCOVER_TESTS"]') }}
# autodiscovers all the files in bubus-ts/tests/*.test.ts
# - eventbus_basics
# ... and more
name: ts-${{ matrix.test_filename }}
defaults:
run:
working-directory: bubus-ts
steps:
- name: Check that the previous step managed to find some test files for us to run
run: |
if [[ "${{ matrix.test_filename }}" == "FAILED_TO_DISCOVER_TESTS" ]]; then
echo "Failed get list of test files in bubus-ts/tests/*.test.ts from find_ts_tests job" > /dev/stderr
exit 1
fi

- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: bubus-ts/pnpm-lock.yaml

- run: pnpm install --frozen-lockfile
- name: Run tests with coverage
run: |
NODE_OPTIONS='--expose-gc' node --expose-gc --test --experimental-test-coverage --import tsx tests/${{ matrix.test_filename }}.test.ts | tee coverage-output.txt
- name: Append coverage report to summary
run: |
echo "### TypeScript coverage: ${{ matrix.test_filename }}" >> "$GITHUB_STEP_SUMMARY"
awk '/# start of coverage report/{flag=1} flag{print} /# end of coverage report/{flag=0}' coverage-output.txt >> "$GITHUB_STEP_SUMMARY"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ CLAUDE.local.md

# Build files
dist/
node_modules/
package-lock.json

# Coverage files
.coverage
.coverage.*
htmlcov/
coverage.xml
*.cover

*.sqlite*

# Secrets and sensitive files
secrets.env
Expand Down
Loading
Loading