Skip to content

Commit

Permalink
Version Packages (#9)
Browse files Browse the repository at this point in the history
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @tnezdev/actions@0.3.0

### Minor Changes

- cc3b908: Add the logger instance to the context that is passed in to
the action handler.

This allows the action handler to send logs with the context established
by the action wrapper.

    This means that you can do the following in your action handlers:

    ```ts
const handler: ActionHandler<Context, Input, Output> = (ctx, input) => {
      ctx.logger.info("This is a log from inside the action handler");

      // ...do something and return a result
      return doSomething(input);
    };
    ```

And it will yield this log in addition to the normal logs that the
wrapper emits:

        [{DisplayName}:{CorrelationId}] Action Started (input: {input})]
[{DisplayName}:{CorrelationId}] This is a log from inside the action
handler
        [{DisplayName}:{CorrelationId}] Action Completed (data: {data})]

### Patch Changes

- 434c30a: Corrections and enhancements to the examples in the
`README.md`.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] committed Jun 30, 2023
1 parent 434c30a commit 292392e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
5 changes: 0 additions & 5 deletions .changeset/great-schools-wait.md

This file was deleted.

26 changes: 0 additions & 26 deletions .changeset/proud-beds-confess.md

This file was deleted.

31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# @tnezdev/actions

## 0.3.0

### Minor Changes

- cc3b908: Add the logger instance to the context that is passed in to the action handler.

This allows the action handler to send logs with the context established by the action wrapper.

This means that you can do the following in your action handlers:

```ts
const handler: ActionHandler<Context, Input, Output> = (ctx, input) => {
ctx.logger.info("This is a log from inside the action handler");

// ...do something and return a result
return doSomething(input);
};
```

And it will yield this log in addition to the normal logs that the wrapper emits:

```
[{DisplayName}:{CorrelationId}] Action Started (input: {input})]
[{DisplayName}:{CorrelationId}] This is a log from inside the action handler
[{DisplayName}:{CorrelationId}] Action Completed (data: {data})]
```

### Patch Changes

- 434c30a: Corrections and enhancements to the examples in the `README.md`.

## 0.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tnezdev/actions",
"version": "0.2.0",
"version": "0.3.0",
"description": "Patterns to express business logic using dependency injection for side-effects",
"repository": {
"type": "git",
Expand Down

0 comments on commit 292392e

Please sign in to comment.