Skip to content

Recursion doesn't seem to be working #12

Open
@kwhitaker

Description

@kwhitaker

When I attempt to run my gulp-documentation task, it works fine on the file pointed to as the src, but won't recurse into any of my imported files.

Here's the task in question:

gulp.task('docs', () => {
  return gulp.src('src/init.jsx')
    .pipe(documentation({format: 'md', filename: 'api.md'}))
    .pipe(gulp.dest('docs'))
})

and the command I use to run my gulp task:

NODE_PATH=$NODE_PATH:src NODE_ENV=development babel-node ./node_modules/.bin/gulp docs

Activity

tmcw

tmcw commented on May 23, 2016

@tmcw
Member

Are you using CommonJS or es6 imports? Can you share a link to the source code, or any other details?

kwhitaker

kwhitaker commented on May 23, 2016

@kwhitaker
Author

@tmcw I'm using ES6 imports.

Here's a snippet of the source code:

import {connect} from 'react-redux'
import {fetchConfig} from 'state/config'
import Config from 'components/ecosystems/config'
import React, {PropTypes} from 'react'
import TitleBar from 'components/molecules/title-bar'
import NotFound from 'components/organisms/not-found'
import SiteFooter from 'components/atoms/site-footer'
import './global.sass'

/**
 * The Layout component is the top-level component of the app.
 */
export class Layout extends React.Component {

  static propTypes = {
    config: PropTypes.shape({
      existing: PropTypes.bool,
      error: PropTypes.object,
      loading: PropTypes.bool.isRequired,
      serverSettings: PropTypes.shape({
        hostName: PropTypes.string,
        userName: PropTypes.string,
        password: PropTypes.string,
        version: PropTypes.string,
      }),
    }),
    development: PropTypes.bool,
    dispatch: PropTypes.func,
    fetchConfig: PropTypes.func,
    router: PropTypes.shape({
      url: PropTypes.string,
      route: PropTypes.shape({
        name: PropTypes.string,
        options: PropTypes.object,
      }),
    }),
  };

  componentDidMount() {
    this.props.fetchConfig()
  }

  /**
   * Only include DevTools if in development.
   * @returns {React.Component}
   */
  renderDevTools() {
    if (this.props.development) {
      const DevTools = require('utils/dev-tools')
      return <DevTools/>
    }
    return null
  }

  /**
   * Return the main content selected by the current route.
   * @returns {React.Component}
   */
  renderMainContent() {
    const {config} = this.props
    if (!config.existing) {
      return <Config isFetching={config.loading}/>
    }

    switch (this.props.router.route.name) {
      case 'config':
        return <Config/>
      default:
        return <NotFound path={this.props.router.url}/>
    }
  }

  render() {
    const {config, router} = this.props
    const existingConfig = config.existing && !config.loading

    return (
      <div>
        <TitleBar currentRoute={router.route.name} showNav={existingConfig}/>
        {this.renderMainContent()}
        <SiteFooter version={config.serverSettings.version}/>
        {this.renderDevTools()}
      </div>
    )
  }

}

export default connect(
  state => ({
    router: state.router,
    config: state.config.toJS(),
  }), {fetchConfig}
)(Layout)
jgrauel

jgrauel commented on Jun 13, 2016

@jgrauel

I am having the same issue with CommonJS requires.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tmcw@kwhitaker@jgrauel

        Issue actions

          Recursion doesn't seem to be working · Issue #12 · documentationjs/gulp-documentation