Skip to content

Commit

Permalink
fix(gatsby-theme-docz): use createPages instead of createPagesStatefully
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Feb 26, 2019
1 parent cd4750b commit 37b73c6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 78 deletions.
9 changes: 0 additions & 9 deletions core/docz-core/src/states/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import chokidar from 'chokidar'
import fastglob from 'fast-glob'
import { State, Params } from '../lib/DataServer'
import { flatten, get } from 'lodash/fp'
import { Signale } from 'signale'

import * as paths from '../config/paths'
import { Config } from '../config/argv'
Expand All @@ -26,9 +25,7 @@ export const mapToArray = (map: any = []) =>
const initial = (config: Config) => async (p: Params) => {
const pattern = getPattern(config)
const files = await fastglob<string>(pattern, { cwd: paths.root })
console.time('initial')
const metadata = await docgen(files, config)
console.timeEnd('initial')
p.setState('props', flatten(mapToArray(metadata)))
}

Expand Down Expand Up @@ -61,14 +58,8 @@ export const state = (config: Config): State => {
return {
id: 'props',
start: async params => {
const interactive = new Signale({ interactive: true, scope: 'props' })
interactive.await(
'Parsing initial props from your components (this could take a while)'
)
const addInitial = initial(config)
await addInitial(params)
interactive.success('Props parsed successfuly')

watcher.on('change', add(params, config))
watcher.on('unlink', remove(params))
},
Expand Down
2 changes: 1 addition & 1 deletion core/gatsby-theme-docz/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exports.createPagesStatefully = require('./src/node/createPagesStatefully')
exports.createPages = require('./src/node/createPages')
exports.onCreateBabelConfig = require('./src/node/onCreateBabelConfig')
exports.onPreInit = require('./src/node/onPreInit')
exports.sourceNodes = require('./src/node/sourceNodes')
1 change: 1 addition & 0 deletions core/gatsby-theme-docz/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// noop
68 changes: 0 additions & 68 deletions core/gatsby-theme-docz/src/node/createPagesStatefully.js

This file was deleted.

0 comments on commit 37b73c6

Please sign in to comment.