<commit_before>'use strict';

// Summary
//  CLI wrapper for managing Rekit elements.

const component = require('./component');
const style = require('./style');
const test = require('./test');
const action = require('./action');
const featureMgr = require('./feature');
const entry = require('./entry');

module.exports = {
  addComponent(feature, name) {
    component.add(feature, name);
    style.add(feature, name);
    test.add(feature, name);
  },

  moveComponent(source, dest) {
    component.move(source, dest);
    style.move(source, dest);
    if (source.feature === dest.feature) {
      entry.renameInIndex(source.feature, source.name, dest.name);
      entry.renameInStyle(source.feature, source.name, dest.name);
    } else {
      entry.removeFromIndex(source.feature, source.name);
      entry.addToIndex(dest.feature, dest.name);

      entry.removeFromStyle(source.feature, source.name);
      entry.addToStyle(dest.feature, dest.name);
    }
  },

  removeComponent(feature, name) {
    component.remove(feature, name);
    style.remove(feature, name);
    test.remove(feature, name);
  },

  addPage(feature, name, urlPath, isIndex) {
    component.add(feature, name, { templateFile: 'Page.js' });
    entry.addToRoute(feature, name, urlPath, isIndex);
    style.add(feature, name);
    test.add(feature, name, { templateFile: 'Page.test.js' });
  },

  removePage(feature, name, urlPath) {
    component.remove(feature, name);
    entry.removeFromRoute(feature, name, urlPath);
    style.remove(feature, name);
    test.remove(feature, name);
  },

  addAction(feature, name, actionType) {
    action.add(feature, name, { actionType });
    test.addAction(feature, name, { actionType });
  },

  removeAction(feature, name, actionType) {
    action.remove(feature, name, actionType);
    test.removeAction(feature, name);
  },

  addAsyncAction(feature, name) {
    action.addAsync(feature, name);
    test.addAction(feature, name, { isAsync: true });
  },

  removeAsyncAction(feature, name) {
    action.removeAsync(feature, name);
    test.removeAction(feature, name);
  },

  addFeature(name) {
    featureMgr.add(name);
    entry.addToRootReducer(name);
    entry.addToRouteConfig(name);
    entry.addToRootStyle(name);

    // Add default page and sample action
    this.addPage.call(this, name, 'default-page', null, true);
    this.addAction.call(this, name, 'sample-action');
  },

  removeFeature(name) {
    featureMgr.remove(name);
    entry.removeFromRootReducer(name);
    entry.removeFromRouteConfig(name);
    entry.removeFromRootStyle(name);
  },
};

<commit_msg>Rename page CLI in progress.<commit_after>'use strict';

// Summary
//  CLI wrapper for managing Rekit elements.

const component = require('./component');
const style = require('./style');
const test = require('./test');
const action = require('./action');
const featureMgr = require('./feature');
const entry = require('./entry');

module.exports = {
  addComponent(feature, name) {
    component.add(feature, name);
    style.add(feature, name);
    test.add(feature, name);
  },

  moveComponent(source, dest) {
    component.move(source, dest);
    style.move(source, dest);
    if (source.feature === dest.feature) {
      entry.renameInIndex(source.feature, source.name, dest.name);
      entry.renameInStyle(source.feature, source.name, dest.name);
    } else {
      entry.removeFromIndex(source.feature, source.name);
      entry.addToIndex(dest.feature, dest.name);

      entry.removeFromStyle(source.feature, source.name);
      entry.addToStyle(dest.feature, dest.name);
    }
  },

  removeComponent(feature, name) {
    component.remove(feature, name);
    style.remove(feature, name);
    test.remove(feature, name);
  },

  addPage(feature, name, urlPath, isIndex) {
    component.add(feature, name, { templateFile: 'Page.js' });
    entry.addToRoute(feature, name, urlPath, isIndex);
    style.add(feature, name);
    test.add(feature, name, { templateFile: 'Page.test.js' });
  },

  removePage(feature, name, urlPath) {
    component.remove(feature, name);
    entry.removeFromRoute(feature, name, urlPath);
    style.remove(feature, name);
    test.remove(feature, name);
  },

  movePage(source, dest) {
    this.moveComponent(source, dest);
    if (source.feature === dest.feature) {
    } else {
      entry.removeFromRoute(source.feature, source.name);
      entry.addToRoute(dest.feature, dest.name, urlPath, isIndex);
    }
  },

  addAction(feature, name, actionType) {
    action.add(feature, name, { actionType });
    test.addAction(feature, name, { actionType });
  },

  removeAction(feature, name, actionType) {
    action.remove(feature, name, actionType);
    test.removeAction(feature, name);
  },

  addAsyncAction(feature, name) {
    action.addAsync(feature, name);
    test.addAction(feature, name, { isAsync: true });
  },

  removeAsyncAction(feature, name) {
    action.removeAsync(feature, name);
    test.removeAction(feature, name);
  },

  addFeature(name) {
    featureMgr.add(name);
    entry.addToRootReducer(name);
    entry.addToRouteConfig(name);
    entry.addToRootStyle(name);

    // Add default page and sample action
    this.addPage(name, 'default-page', null, true);
    this.addAction(name, 'sample-action');
  },

  removeFeature(name) {
    featureMgr.remove(name);
    entry.removeFromRootReducer(name);
    entry.removeFromRouteConfig(name);
    entry.removeFromRootStyle(name);
  },
};


{'fraction_non_alphanumeric': 0.15112657995969958, 'fraction_numerical': 0.0, 'mean_word_length': 3.819064430714916, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1312043', 'n_tokens_mistral': 1717, 'n_tokens_neox': 1695, 'n_words': 322}