Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Version Packages #34

wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jul 5, 2023

This PR was opened by the Changesets release 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.4.0

Minor Changes

  • a13b38c: docs: switch to using fully fledged example packages

    Switch examples to use fully formed packages where each one has their own package.json and links to the built library.

  • 5d6d449: Add Metadata to ActionOutput

    Previously, the action output would be { ok: true, data: Data } for the happy path and { ok: false, error: Error } for the sad path. We have added a metadata property to both paths that is defined thusly:

    export interface ActionMetadata {
      correlationId: string;
      displayName: string;
      runTime: {
        start: number;
        end?: number;
        duration?: number;
      };
    }

    Which in real-world usage will look something like this:

    {
      ok: true,
      data: {
        temperature: 72,
      },
      metadata: {
        correlationId: '<correation-id>',
        displayName: 'GetTemperature',
        runTime: {
          start: 1688674365730,
          end: 1688674380205,
          duration: 14475,
        }
      }
    }
    
  • f76b2f2: Export Action type for better DX when composing actions (closes Export typeof Action #42)

    We now export the Action type which allows you to do the following inside custom actions.

    import type { Action } from "@tnezdev/actions";
    
    /**
     * You would define your action logic here...
     */
    export const SomeAction = (createAction<Context, Input, Output> = (
      ctx,
      input,
    ) => {
      /* ... */
    });
    
    /**
     * And then finally export the type for this same action
     */
    export type SomeAction = Action<Context, Input, Output>;

    Then you can use these exported action types in the context definition of other actions:

    import type { SomeAction } from "./some-action";
    
    export interface Context {
      actions: {
        someAction: SomeAction;
      };
    }

    To better illustrate how this works, we've included a new composed-actions example.

Patch Changes

  • 886450f: docs: move examples out of /src into their own top-level directory

@github-actions github-actions bot force-pushed the changeset-release/main branch 8 times, most recently from b3870c3 to baa4270 Compare July 12, 2023 14:36
@github-actions github-actions bot force-pushed the changeset-release/main branch 6 times, most recently from e62238f to f00a2db Compare July 17, 2023 22:29
Comment on lines +84 to +86
### Patch Changes

- 886450f: docs: move examples out of `/src` into their own top-level directory
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this because the change was superseded.

@github-actions github-actions bot force-pushed the changeset-release/main branch 9 times, most recently from 0dd2da2 to 1a420c2 Compare December 30, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export typeof Action
1 participant