Skip to content

Commit

Permalink
chore: release 0.2.0 (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
cablehead authored Jan 4, 2025
1 parent 8cc77bd commit 8b982cf
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "cross-stream"
edition = "2021"
version = "0.2.0-dev"
version = "0.2.0"
description = "An event stream store for personal, local-first use, specializing in event sourcing."
license = "MIT"
repository = "https://github.com/cablehead/xs"
Expand Down
Binary file added changes/0.2.0-docs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added changes/0.2.0-logging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions changes/0.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## Highlights

- `.get` is now available as an internal `nu` command (for handlers)
- We have a new docs site, powered by [astro starlight](https://starlight.astro.build)

![new docs site](./0.2.0-docs.png)

### Handlers

- `env` is now preserved from your handler configuration script and between handler calls. This makes it convenient to set variables, e.g. access tokens, from your configuration script and to preserve state between handler calls.
- Your configuration script can now specify [modules](https://cablehead.github.io/xs/reference/handlers/#configuration-record-fields) to load for your handler.

### Miscellaneous

- Nushell to v0.101.0 🚀
- Fjall to 2.4.4 🚀
- Improved tracing / logging

![logging](./0.2.0-logging.png)

## Breaking Changes

- There is no longer the concept of "stateful" handers, which take a second argument for state. Since `env` is preserved between handler calls, you can use that to store state.
- All configuration for handlers has been moved from the frame metadata to a configuration script.
- The handler configuration script now returns a table of configuration options instead of the closure.

## Raw commit messages:

- feat: add .get as in internal nu command
- docs: add reference/generators
- docs: nu-fmt
- docs: port reference/handlers over from the wiki
- docs: typo
- docs: getting-started/first-stream
- docs: tweaks to installation and architecture
- docs: add an architecture overview
- chore: update next release to 0.2.0: we're skipping the path 0.1.1 took
- chore: update to Nushell v0.101.0
- chore: bump fjall dependency to 2.4.4
- docs: getting started / installation
- feat: move handler config out of frame meta to a configuration script (#37)
- fix: restore the .rm to .remove alias
- feat(nu): replace async/await with sync operations in command implementations
- refactor: move AppendCommand buffer to nu/commands
- feat: add sync versions of the Store.cas_* methods
- feat: add a sync version of Store.read: that only retrieves historic frames
- feat: move cleaning up expired frames to a background thread
- feat: drop async from store.append -- it's not needed
- refactor: store into its own module, including ttl
- refactor: move topic_index_key from Store impl to standalone function
- refactor: Store::new doesn't require async
- refactor: move compaction from ReadOptions to inline tasks.rs, match handler pattern
- refactor: consolidate thread pool and span handling
- example(discord): update to make use of modules and with_env
- feat: add with_env variables option to handler registration
- feat: rename use_modules to modules
- feat: add the ability to load modules to handlers
- feat(deps): switch from async-std to tokio runtime for cacache
- chore: .gitignore
- fix: backoff for logging long outstanding spans
- feat: fleshing out tracing (#35)
- fix: updated handlers now start, on restart (#34)
- example(discord): reduce heartbeat ttl to 5mins
8 changes: 4 additions & 4 deletions docs/src/content/docs/reference/handlers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To register a handler, append a registration script with the topic
handler's behavior:

```nushell
{
r###'{
# Required: Handler closure
process: {|frame|
if $frame.topic == "ping" {
Expand All @@ -62,7 +62,7 @@ handler's behavior:
suffix: ".response" # Output topic suffix
ttl: "head:1" # Keep only most recent frame
}
} | .append echo.register
}'### | .append echo.register
```

The registration script is stored in CAS and evaluated to obtain the handler's
Expand Down Expand Up @@ -94,14 +94,14 @@ The `return_options` field controls how return values are handled:
The `modules` option allows handlers to use custom Nushell modules:

```nushell
{
r###'{
process: {|frame|
my-math double 8 # Use module command
}
modules: {
"my-math": "export def double [x] { $x * 2 }"
}
} | .append processor.register
}'### | .append processor.register
```

## State and Environment
Expand Down
36 changes: 36 additions & 0 deletions notes/how-to-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
```nushell
# update version in Cargo.toml
let PREVIOUS_RELEASE = "0.1.0"
$env.RELEASE = open Cargo.toml | get package.version
# grab the raw commit messages between the previous release and now
git log --format=%s $"v($PREVIOUS_RELEASE)..HEAD" | vipe | save $"changes/($env.RELEASE).md"
git commit -a -m "chore: release $env.RELEASE"
git push
cargo publish
cargo install cross-stream --locked
rm ~/bin/xs
which xs # should be /Users/andy/.cargo/bin/xs
# test the new version
let pkgdir = $"cross-stream-($env.RELEASE)"
let tarball = $"cross-stream-($env.RELEASE)-macos.tar.gz"
mkdir $pkgdir
cp /Users/andy/.cargo/bin/xs $pkgdir
tar -czvf $tarball -C $pkgdir xs
gh release create $"v($env.RELEASE)" -F $"changes/($env.RELEASE).md" $tarball
shasum -a 256 $tarball
# update: [email protected]:cablehead/homebrew-tap.git
brew uninstall cross-stream
brew install cablehead/tap/cross-stream
which xs # should be /opt/homebrew/bin/xs
# test the new version
```

0 comments on commit 8b982cf

Please sign in to comment.