Skip to content

Tags: davidnguyen11/react-styleguidist

Tags

v6.5.0

Toggle v6.5.0's commit message
Changelog: 🚀

👋 **[Support Styleguidist](https://opencollective.com/styleguidist) on Open Collective** 👋

## New features

### Page per section 🚧

This is a huge improvement for large style guides: now you can show only one component at a page instead of all components.

![](https://d3vv6lp55qjaqc.cloudfront.net/items/0W2q2K2s3n2k311O1J0y/Screen%20Recording%202018-03-22%20at%2010.06%20AM.gif)

To enable:

```js
module.exports = {
  pagePerSection: true
};
```

This is an experimental feature and we need your feedback to make it better and really useful. For example, right now there’s no isolated mode. So feel free to share your ideas [in issues](https://github.com/styleguidist/react-styleguidist/issues).

(styleguidist#835 by @bitionaire and @stepancar, closes styleguidist#494 and styleguidist#768)

### “Fork me” ribbon

One more step to make Styleguidist usable for documenting open source projects:

![](https://d3vv6lp55qjaqc.cloudfront.net/items/1t331n2a3v0F2i290K0Z/Image%202018-03-22%20at%209.13.11%20AM.png)

New config option to enable the ribbon, define the URL and change the label:

```js
module.exports = {
  ribbon: {
    url: 'http://example.com/',
    text: 'Fork me on GitHub'
  }
};
```

And two new [theme variables](https://github.com/styleguidist/react-styleguidist/blob/master/src/styles/theme.js) to change colors: `color.ribbonBackground` and `color.ribbonText`.

(styleguidist#861 by @glebez and @wkwiatek, part of styleguidist#195, closes styleguidist#647)

### Options to change CLI output on server start and build

Two new options, `printServerInstructions` and `printBuildInstructions`:

```js
module.exports = {
  printBuildInstructions(config) {
    console.log(
      `Style guide published to ${
        config.styleguideDir
      }. Something else interesting.`
    );
  }
};
```

(styleguidist#878 by @roblevintennis, closes styleguidist#876)

### Option to modify props

A new option, `updateDocs` to modify props before rendering. For example, you can load a component version number from a JSON file:

```js
module.exports = {
  updateDocs(docs) {
    if (docs.doclets.version) {
      const versionFilePath = path.resolve(
        path.dirname(file),
        docs.doclets.version
      );
      const version = require(versionFilePath).version;

      docs.doclets.version = version;
      docs.tags.version[0].description = version;
    }

    return docs;
  }
};
```

(styleguidist#868 by @ryanoglesby08)

### Limited support for named exports

Styleguidist used to require default exports for components. Now you can use named exports too, though Styleguidist still supports only one component per file. I hope this change will make some users happier, see more details [in the docs](https://react-styleguidist.js.org/docs/components.html#loading-and-exposing-components).

(styleguidist#825 by @marcdavi-es, closes styleguidist#820 and styleguidist#633)

### Allow arrays of component paths in sections

More flexibility in structuring your style guide:

```js
module.exports = {
  sections: [
    {
      name: 'Forms',
      components: [
        'lib/components/ui/Button.js',
        'lib/components/ui/Input.js'
      ]
    }
  ]
};
```

(styleguidist#794 by @glebez, closes styleguidist#774)

### Sort properties by `required` and `name` attributes

This change should make props tables more predictable for the users. Instead of relying on developers to sort props in a meaningful way, Styleguidist will show required props first, and sort props in each group alphabetically.

To disable sorting, use the identity function:

```javascript
module.exports = {
  sortProps: props => props
};
```

(styleguidist#784 by @dotcs)

## Bug fixes

* Allow `Immutable` state in examples (styleguidist#870 by @nicoffee, closes styleguidist#864)
* Change template container ID to prevent clashes (styleguidist#859 by @glebez, closes styleguidist#753)
* Better props definitions with Flow types (styleguidist#781 by @nanot1m)

v6.4.0

Toggle v6.4.0's commit message
Feat: Sort properties by 'required' and 'name' attributes (styleguidi…

…st#784)

v6.3.0

Toggle v6.3.0's commit message
Feat: Better prop-types definitions with Flow types (styleguidist#781)

v6.2.7

Toggle v6.2.7's commit message
Fix: Correct order of components and sections (styleguidist#858)

Closes styleguidist#854.

v6.2.6

Toggle v6.2.6's commit message
Fix: Basic webpack 4 support (styleguidist#849)

To have webpack 4 configured correctly we need to set the webpack mode.

v6.2.5

Toggle v6.2.5's commit message
Fix: Use editorConFfig.theme for CodeMirror theme (styleguidist#814)

Fixes styleguidist#788 by using `editorConfig.theme` in the config.  A fallback
for using the old `highlightTheme` option is already present in the
config schema.

v6.2.4

Toggle v6.2.4's commit message
Fix: Up Buble version to 0.19.2 (styleguidist#815)

Fixes styleguidist#807
Related styleguidist#798 styleguidist#764

v6.2.3

Toggle v6.2.3's commit message
Fix: Include filepath in props to Section/ReactComponentRenderer (sty…

…leguidist#803)

v6.2.2

Toggle v6.2.2's commit message
Fix: Decrease Buble version to fix wrong HTML entities encoding (styl…

…eguidist#801)

v6.2.1

Toggle v6.2.1's commit message
Fix: Update uglifyjs-webpack-plugin (styleguidist#797)

Close styleguidist#783