github doczjs/docz v0.13.0

latest releases: v2.4.0, v2.3.3-alpha.0, v2.3.2-alpha.0...
5 years ago

Changelog

0.13.0 (2018-12-17)

🐞  Bug Fixes

  • docz: ts warning (19ccc09)
  • docz-core: add setMaxListener for chokidar watchers (6053c16)
  • docz-core: log level based on debug argument (507e149)
  • docz-core: node path resolve modules merge (27102fd)
  • docz-core: turn off htmlMinifier when loading from templates (#518) (9cb0e1d)
  • docz-core: use webpack-dev-server instead of webpack-serve (4157e05)

🚀  Features

  • docz-core: add onCreateWebpackChain hook (70bb242)
  • docz-core: add promise logger using progress-estimator (2797608)
  • docz-core: use NODE_PATH to resolve modules (#516) (cc86f93)
  • docz-theme-default: set max lines before scroll editor (#519) (698261b)

onCreateWebpackChain

Now you can customize the webpack configuration using webpack-chain by modifying it using onCreateWebpackChain inside your doczrc.js or when you're creating your plugin.

import { createPlugin } from 'docz-core'

const plugin = createPlugin({
  onCreateWebpackChain: (config) => {
    /** add your logic here */
  }
})

export default {
  plugins: [plugin],
  onCreateWebpackChain: (config) => {
    /** add your logic here */
  }
}

Resolve modules using NODE_PATH

If you want to resolve modules from some path, now you can set the NODE_PATH env variable that will be used as a path to resolve your imports like in create-react-app. You can set your env variables using .env file or directly on your npm script.

// .env
NODE_PATH="src"

Then you simply import modules resolved from your path:

// before
import { SomeModule } from 'src/resolved/path'

// after
import { SomeModule } from 'resolved/path'

Set editor max line before scrolling

In the previous version of docz, when the editor preview had more than 11 lines of code it was scrolled, this was a fixed number. Now, you can configure with how many lines you want to scroll your editor using the themeConfig.linesToScrollEditor inside your doczrc.js:

export default {
  themeConfig: {
    linesToScrollEditor: 8
  }
}

Don't miss a new docz release

NewReleases is sending notifications on new releases.