Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursion doesn't seem to be working #12

Open
kwhitaker opened this issue Dec 18, 2015 · 3 comments
Open

Recursion doesn't seem to be working #12

kwhitaker opened this issue Dec 18, 2015 · 3 comments
Labels

Comments

@kwhitaker
Copy link

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
@tmcw
Copy link
Member

tmcw commented May 23, 2016

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

@tmcw tmcw added the question label May 23, 2016
@kwhitaker
Copy link
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
Copy link

jgrauel commented Jun 13, 2016

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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants