swingset

drop-in component library for next.js

MPL-2.0 License

Downloads
326
Stars
76
Committers
18

Bot releases are visible (Hide)

swingset - v0.15.0-canary-20221208035901

Published by hashibot-web almost 2 years ago

Minor Changes

swingset - v0.15.0-canary-20221115193513

Published by hashibot-web almost 2 years ago

Minor Changes

  • #47 13d1aca Thanks @dstaley! - Ignore node_modules folders when resolving components glob
swingset - v0.14.1

Published by BRKalow over 2 years ago

What's Changed

Full Changelog: https://github.com/hashicorp/swingset/compare/0.14.0...v0.14.1

swingset -

Published by ztanner over 2 years ago

Minor Changes

  • Support custom component categories: 5f255fc19e05b1913a13fef1fae2a8dd3d32c34b
  • Add KnobsComponent example; fix up some bugs & improve JSON parsing: 28b1fe37002e9a54278e297d1a59f300bdb4a64e
  • Add components directory to webpack cache: 4a3347350eadb6ebd12fa8c3548489b7d90ebe6a
swingset - 0.13.0

Published by ztanner over 2 years ago

Minor Changes

  • Migrate to TS: ab3c788cbf6536fb864e65bd774c1728a391b60a
swingset -

Published by ztanner over 2 years ago

Minor Changes

  • Fix development environment for examples, bump deps: b7ba94cd3072c2b934042f6826c8f62d5d945159
swingset -

Published by ashleemboyer almost 3 years ago

Minor Changes

  • Feat: pass components to DocsPage: #35
  • Updating search algorithm to includes: #36
swingset - v0.10.2

Published by BRKalow about 3 years ago

  • Fixes issue in getPeerComponents with updated component data structure (#33)
swingset - 0.10.0

Published by BRKalow over 3 years ago

  • Support access to named exports of the component index file in docs.mdx, not just the default export (#30)
swingset - 0.9.0

Published by BRKalow over 3 years ago

  • Adds support for standalone docs pages, picked up by defining a docsRoot in the plugin options
  • Adds support for an index page, pass index to swingsetOptions
  • Each component now has its own route, instead of rendering being driven by a query parameter

Here's what the implementation looks like now:

// in /pages/[[...swingset]].jsx
import createPage from 'swingset/page'
import { createStaticProps, createStaticPath } from 'swingset/server'

export default createPage()
export const getStaticPaths = createStaticPaths()
export const getStaticProps = createStaticProps({
  /* mdxOptions = {} */
})
swingset - 0.8.0

Published by BRKalow over 3 years ago

swingset -

Published by jescalan over 3 years ago

Loosen react peer dependency requirements

swingset -

Published by jescalan over 3 years ago

Regenerate package-lock with npm v7

swingset -

Published by jescalan over 3 years ago

Loosen peer dep version ranges

swingset -

Published by wkentdag over 3 years ago

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).

swingset -

Published by BRKalow over 3 years ago

Patches

  • Fix: move sidebar styles so the full list element is clickable: #18
swingset - v0.6.0

Published by BRKalow over 3 years ago

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 /> })
swingset -

Published by zchsh over 3 years ago

Patch issues with packageJson: #14

swingset -

Published by zchsh over 3 years ago

Patch issues with packageJson introduced in 0.5.0.

Patches

  • Add prerelease command: 2183001514b1126ea70cb2e72063088bde3e5372
  • Use null, as undefined not serializable: 173aacf8a019d718fb32f983eea312216d89c537
swingset -

Published by zchsh over 3 years ago

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: dd0a082afc50223a9f760cb419e7adc0445309d7
  • Merge pull request #12 from hashicorp/km.version: 53669ce1d0bd5cdde3ea8abed5f87d0768d65346