docs: function writeIndex (groups, dir, name) {
    let data
    let keys = Object.keys(groups)
    if (name) {
      if (indexAssigns.indexOf(name) !== -1) {
        let reqs = keys.map((name) => `  require('./${name}')`).join(',\n')
        data = `${noticeString}module.exports = Object.assign({},\n${reqs}\n)\n`
      } else if (indexObjects.indexOf(name) !== -1) {
        let reqs = keys.map((name) => `  ${name}: require('./${name}')`).join(',\n')
        data = `${noticeString}module.exports = {\n${reqs}\n}\n`
      }// else if (indexArrs.indexOf(name) !== -1) {
        // let reqs = keys.map((name) => `  require('./${name}')`).join(',\n')
        // data = `${noticeString}module.exports = [\n${reqs}\n]\n`
      // }
    } else {
      let reqs = keys.map((name, index) => {
        let ret = `  ${name}: require('./${name}')`
        if (name === 'mocks') {
          let dot = (index === keys.length - 1) ? '' : ','
          return `// #if IS_MOCK\n${ret}${dot}\n// #endif`
        }
        return ret
      }).join(',\n').replace(/endif,/g, 'endif')
      data = `${noticeString}module.exports = {\n${reqs}\n}\n`
    }
    return outputFile(path.resolve(dir, `index.js`), data)
  }