Skip to content

Releases: hashicorp/swingset

0.8.0

04 May 23:04
Compare
Choose a tag to compare

0.7.3

22 Apr 22:09
c676359
Compare
Choose a tag to compare

Loosen react peer dependency requirements

0.7.2

22 Apr 21:57
2ba18dd
Compare
Choose a tag to compare

Regenerate package-lock with npm v7

0.7.1

22 Apr 21:56
f1d9672
Compare
Choose a tag to compare

Loosen peer dep version ranges

0.7.0

01 Apr 21:01
Compare
Choose a tag to compare

Minor Changes

  • Add mdx options to createStaticProps: #20 (details)
  • Add peerComponents frontmatter attribute: #21 (details)

Patches

  • Bugfix: remove hardcoded / from swingset page route: #19

New MDX Options

You can now pass mdxOptions to swingset/createStaticProps in order to customize the Markdown rendering on your documentation pages. The options are passed directly to the MDX compiler via next-mdx-remote. For example, the following configuration would add code highlighting to any fenced code blocks:

import createPage from 'swingset/page'
import createStaticProps from 'swingset/getStaticProps'
import highlight from '@mapbox/rehype-prism'

export default createPage()
export const getStaticProps = createStaticProps({
  mdxOptions: {
      rehypePlugins: [[highlight, { ignoreMissing: true }]],
  },
})

peerComponents

Previously, the only components available on a docs.mdx page were the main component (componentName in frontmatter), and any global components you pass to Swingset (like the default <PropsTable />). Now, you can inject arbitrary components at the page level by specifying them in the new peerComponents frontmatter attribute.

---
componentName: Button
peerComponents:
  - AnimatedLoaderIcon
---

Welcome to the `Button` docs page! `Button` wraps its `children` in a button UI. Example:

<Button text="Click me">
  <AnimatedLoaderIcon />
</Button>

Note: peerComponents must also be present in Swingset (i.e., they have their own docs.mdx page).

0.6.1

08 Mar 16:43
Compare
Choose a tag to compare

Patches

  • Fix: move sidebar styles so the full list element is clickable: #18

v0.6.0

08 Mar 15:01
Compare
Choose a tag to compare

Minor Changes

  • Adds support for sidebar filtering (#17)
  • Adds support for a custom logo (#17)

To pass in a custom logo use the logo option when calling createPage:

createPage({ logo: <MyLogo /> })

0.5.1

25 Jan 15:30
3a407c2
Compare
Choose a tag to compare

Patch issues with packageJson: #14

0.5.0

22 Jan 15:56
fe3a1a8
Compare
Choose a tag to compare

This release exposes a new packageJson prop to each component's page scope, if that component has a package.json in its component.path.

Minor Changes

  • Expose package.json in component' docs page scopes: #13

Patches

  • Harden example script - optionally install node_modules - make next-transpile-modules a peerdep: dd0a082
  • Merge pull request #12 from hashicorp/km.version: 53669ce

0.5.0-canary.0

22 Jan 20:23
a99e8c5
Compare
Choose a tag to compare
0.5.0-canary.0 Pre-release
Pre-release

Patch issues with packageJson introduced in 0.5.0.

Patches

  • Add prerelease command: 2183001
  • Use null, as undefined not serializable: 173aacf