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

Transform parameter #24

Merged
merged 4 commits into from
Mar 1, 2024
Merged

Transform parameter #24

merged 4 commits into from
Mar 1, 2024

Conversation

lmestel
Copy link
Contributor

@lmestel lmestel commented Feb 26, 2024

Breaking Change

  • The parameters shape changed from
    parameters: {
      jsonschema: schema,
    }
    to
    parameters: {
      jsonschema: { schema },
    }
  • Args are no longer transformed by kickstartDS' pack and unpack helper.
    You can restore the old behavior with the new optional parameters fromArgs & toArgs:
    parameters: {
      jsonschema: {
        async toArgs(obj) {
          return (await import("@kickstartds/core/lib/storybook")).pack(obj);
        },
        async fromArgs(args) {
          return (await import("@kickstartds/core/lib/storybook")).unpack(args);
        },
      },
    }
    (yes, we need to use dynamic imports b/c it seems storybook doesn't support external references in parameters function bodies 🫤)
📦 Published PR as canary version: 3.0.0--canary.24.ce201f4.0

✨ Test out this PR locally via:

npm install @kickstartds/storybook-addon-jsonschema@3.0.0--canary.24.ce201f4.0
# or 
yarn add @kickstartds/storybook-addon-jsonschema@3.0.0--canary.24.ce201f4.0

Version

Published prerelease version: v3.0.0-next.0

Changelog

💥 Breaking Change

🚀 Enhancement

Authors: 1

@lmestel lmestel added the major Increment the major version when merged label Feb 26, 2024
@lmestel lmestel changed the base branch from main to next February 26, 2024 16:47
@lmestel lmestel merged commit 3939288 into next Mar 1, 2024
1 check passed
@lmestel lmestel deleted the feature/args-transform-parameter branch March 1, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Increment the major version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant