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
20 changes: 15 additions & 5 deletions .github/workflows/release.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -129,8 +129,8 @@ jobs:
NEXT_VERSION: ${{ steps.version.outputs.next_version }}
run: |
set -euo pipefail
perl -0pi -e 's/(\[package\][\s\S]*?\nversion = ")[^"]+(")/$1$ENV{NEXT_VERSION}$2/' Cargo.toml
perl -0pi -e 's/(\[package\][\s\S]*?\nversion = ")[^"]+(")/$1$ENV{NEXT_VERSION}$2/' crates/tinydocs-module/Cargo.toml
perl -0pi -e 's/(\[workspace\.package\][\s\S]*?\nversion = ")[^"]+(")/$1$ENV{NEXT_VERSION}$2/' Cargo.toml
cargo update -p tinydocs-bus --precise "$NEXT_VERSION"
cargo update -p "$CRATE_NAME" --precise "$NEXT_VERSION"

- name: Commit version bump and tag
Expand All@@ -140,12 +140,21 @@ jobs:
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add Cargo.toml Cargo.lock crates/tinydocs-module/Cargo.toml
git add Cargo.toml Cargo.lock
git commit -m "Release ${RELEASE_TAG}"
git tag -a "${RELEASE_TAG}" -m "Release ${RELEASE_TAG}"

- name: Package crate
run: cargo package --locked --package tinydocs
- name: Package and publish the bus contract
run: |
set -euo pipefail
cargo package --locked --package tinydocs-bus
cargo publish --locked --package tinydocs-bus

- name: Package and publish crate
run: |
set -euo pipefail
cargo package --locked --package tinydocs
cargo publish --locked --package tinydocs

- name: Package TinyBus source and module SDK
run: |
Expand All@@ -162,6 +171,7 @@ jobs:
with:
name: source-packages
path: |
target/package/tinydocs-bus-${{ steps.version.outputs.next_version }}.crate
target/package/${{ steps.version.outputs.crate_name }}-${{ steps.version.outputs.next_version }}.crate
target/package/tinybus-source-*.tar.gz
if-no-files-found: error
Expand Down
12 changes: 7 additions & 5 deletions AGENTS.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,13 +32,13 @@ This is a Rust 2024 library crate rooted at `Cargo.toml`.
```text
src/
├── lib.rs # crate docs + the entire public re-export surface
├── error/mod.rs # crate-wide `Error` and `Result<T>`
└── <feature>/ # one directory per feature area
├── mod.rs # module docs, wiring, smallest useful public API
├── types.rs # substantial type definitions
└── test.rs # module-local unit tests
tests/ # integration tests against the public API only
examples/ # runnable, compiled-in-CI usage examples
crates/tinydocs-bus/ # TinyBus wire contract: names, payload types, errors
crates/tinydocs-module/ # private TinyBus cdylib adapter
vendor/tinybus/ # pinned TinyBus source; optional until wired by a project
docs/
Expand All@@ -64,8 +64,9 @@ missing module. Prefer many small modules that each do one thing well over few
broad ones.

Keep public exports centralized in `src/lib.rs` so downstream users have one
predictable surface. Put shared error variants in `src/error/mod.rs` and return
the crate-wide `Result<T>` from fallible public APIs.
predictable surface. The shared error variants live in `tinydocs-bus` because
`DocumentSpec::validate` is an inherent method on a contract-owned type; re-
export its `Error` and `Result<T>` from `src/lib.rs` for the primary API.

## Build And Test

Expand DownExpand Up@@ -114,8 +115,9 @@ Use standard `rustfmt` output and Rust 2024 idioms. Do not hand-format around

### Errors

- One crate-wide `Error` enum in `src/error/mod.rs`, built with `thiserror`.
- Fallible public functions return `Result<T>`, the crate alias.
- One crate-wide `Error` enum in `crates/tinydocs-bus/src/error/mod.rs`, built with
`thiserror` and re-exported by `tinydocs`.
- Fallible public functions return `Result<T>`, the re-exported crate alias.
- Add a specific variant instead of stuffing context into a string; error
messages are lowercase, without trailing punctuation.
- Do not `unwrap()`, `expect()`, or `panic!` in library code paths. They are
Expand Down
Loading