<commit_before>import {Component} from 'angular2/core';
import {NGL_DIRECTIVES} from '../../../dist/ng-lightning';

import {DemoBadges} from './components/badges/badges';
import {DemoButtons} from './components/buttons/buttons';
import {DemoIcons} from './components/icons/icons';
import {DemoAvatars} from './components/images/images';
import {DemoModals} from './components/modals/modals';
import {DemoPaginations} from './components/paginations/paginations';
import {DemoSpinners} from './components/spinners/spinners';
import {DemoTabs} from './components/tabs/tabs';

interface IComponent {
  key: string;
  title: string;
  component: any;
  readme: string;
  html?: string;
  ts?: string;
  api?: string;
};

const components: IComponent[] = [
  { key: 'images', title: 'Images', component: DemoAvatars, readme: require('src/images/README.md'), api: require('src/images/API.md') },
  { key: 'badges', title: 'Badges', component: DemoBadges, readme: require('src/badges/README.md'), api: require('src/badges/API.md') },
  { key: 'buttons', title: 'Buttons', component: DemoButtons, readme: require('src/buttons/README.md'), api: require('src/buttons/API.md') },
  { key: 'icons', title: 'Icons', component: DemoIcons, readme: require('src/icons/README.md'), api: require('src/icons/API.md')  },
  { key: 'modals', title: 'Modals', component: DemoModals, readme: require('src/modals/README.md'), api: require('src/modals/API.md') },
  { key: 'paginations', title: 'Paginations', component: DemoPaginations, readme: require('src/paginations/README.md'), api: require('src/paginations/API.md') },
  { key: 'spinners', title: 'Spinners', component: DemoSpinners, readme: require('src/spinners/README.md'), api: require('src/spinners/API.md') },
  { key: 'tabs', title: 'Tabs', component: DemoTabs, readme: require('src/tabs/README.md'), api: require('src/tabs/API.md') },
].sort((a, b) => a.key.localeCompare(b.key));

const content = {};
components.forEach(component => {
  const { key } = component;
  const path = 'components/' + key + '/' + key;
  component.html = require('!!prismjs?lang=markdown!./' + path + '.html');
  component.ts = require('!!string-replace?search=../../../../../dist&replace=ng-lightning!prismjs?lang=typescript!./' + path + '.ts');
});


@Component({
  template: require('./demo.jade')({ content, components }),
  directives: [NGL_DIRECTIVES].concat(components.map((c: any) => c.component)),
})
export class DemoRoute { }<commit_msg>refactor(demo): reduce required fields for component definition<commit_after>import {Component} from 'angular2/core';
import {NGL_DIRECTIVES} from '../../../dist/ng-lightning';

import {DemoBadges} from './components/badges/badges';
import {DemoButtons} from './components/buttons/buttons';
import {DemoIcons} from './components/icons/icons';
import {DemoAvatars} from './components/images/images';
import {DemoModals} from './components/modals/modals';
import {DemoPaginations} from './components/paginations/paginations';
import {DemoSpinners} from './components/spinners/spinners';
import {DemoTabs} from './components/tabs/tabs';

interface IComponent {
  key: string;
  component: any;
  title?: string;
  readme?: string;
  html?: string;
  ts?: string;
  api?: string;
};

const components: any[] = [
  { key: 'badges', component: DemoBadges },
  { key: 'buttons', component: DemoButtons },
  { key: 'icons', component: DemoIcons },
  { key: 'images', component: DemoAvatars },
  { key: 'modals', component: DemoModals },
  { key: 'paginations', component: DemoPaginations },
  { key: 'spinners', component: DemoSpinners },
  { key: 'tabs', component: DemoTabs },
].sort((a, b) => a.key.localeCompare(b.key));

const content = {};
components.forEach(component => {
  const { key } = component;
  const path = 'components/' + key + '/' + key;
  component.html = require('!!prismjs?lang=markdown!./' + path + '.html');
  component.ts = require('!!string-replace?search=../../../../../dist&replace=ng-lightning!prismjs?lang=typescript!./' + path + '.ts');
  if (!component.title) {
    component.title = key.charAt(0).toUpperCase() + key.slice(1);
  }
  if (!component.readme) {
    component.readme = require('src/' + key + '/README.md');
  }
  if (!component.api) {
    component.api = require('src/' + key + '/API.md');
  }
});


@Component({
  template: require('./demo.jade')({ content, components }),
  directives: [NGL_DIRECTIVES].concat(components.map((c: any) => c.component)),
})
export class DemoRoute { }
{'fraction_non_alphanumeric': 0.19848349687778769, 'fraction_numerical': 0.0008920606601248885, 'mean_word_length': 4.8095854922279795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3684504', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1479, 'n_words': 321}