<commit_before>// @format

const path = require("path");

const reactDocgenTypescript = require("react-docgen-typescript").withCustomConfig(
  "./tsconfig.base.json"
);

const typescriptPropsParser = reactDocgenTypescript.parse;

module.exports = {
  title: "nteract components",
  defaultExample: false,
  propsParser: typescriptPropsParser,
  resolver: require("react-docgen").resolver.findAllComponentDefinitions,<commit_msg>Add custom getComponentPathLine to styleguidist config<commit_after>// @format

const path = require("path");

const reactDocgenTypescript = require("react-docgen-typescript").withCustomConfig(
  "./tsconfig.base.json"
);

const typescriptPropsParser = reactDocgenTypescript.parse;

module.exports = {
  title: "nteract components",
  defaultExample: false,
  propsParser: typescriptPropsParser,
  resolver: require("react-docgen").resolver.findAllComponentDefinitions,
  getComponentPathLine: componentPath => {
    const toPascalCase = string => {
      return string
        .match(/[a-z]+/gi)
        .map(function(word) {
          return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase();
        })
        .join("");
    };
    const name = path.basename(componentPath, ".tsx");
    const dir = path.dirname(componentPath);
    const package = dir.match(new RegExp("packages/(.*)/src"));
    return `import { ${toPascalCase(name)} } from '@nteract/${package[1]}';`;
  },
{'fraction_non_alphanumeric': 0.1419491525423729, 'fraction_numerical': 0.00211864406779661, 'mean_word_length': 4.578740157480315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6847050', 'n_tokens_mistral': 428, 'n_tokens_neox': 429, 'n_words': 77}