<commit_before>import {
  getVersionedPackages,
  writePackageJson,
  getBabelDependencies,
  installDependencies,
  getPackageJson,
  writeFileAsJson,
  copyTemplate,
  readFileAsJson,
} from '../../helpers';
import { NpmOptions } from '../../NpmOptions';
import { GeneratorOptions } from '../../GeneratorOptions';

function addStorybookExcludeGlobToTsConfig() {
  const tsConfigJson = readFileAsJson('tsconfig.json', true);
  const glob = '**/*.stories.ts';
  if (!tsConfigJson) {
    return;
  }

  const { exclude = [] } = tsConfigJson;
  if (exclude.includes(glob)) {
    return;
  }

  tsConfigJson.exclude = [...exclude, glob];
  writeFileAsJson('tsconfig.json', tsConfigJson);
}

export default async (npmOptions: NpmOptions, { storyFormat = 'csf' }: GeneratorOptions) => {
  copyTemplate(__dirname, storyFormat);
  const packages = [
    '@storybook/aurelia',
    '@storybook/addon-actions',
    '@storybook/addon-links',
    '@storybook/addons',
    '@storybook/addon-storysource',
    '@storybook/addon-knobs',<commit_msg>refactor(cli): use storyformat in aurelia generator<commit_after>import {
  getVersionedPackages,
  writePackageJson,
  getBabelDependencies,
  installDependencies,
  getPackageJson,
  writeFileAsJson,
  copyTemplate,
  readFileAsJson,
} from '../../helpers';
import { NpmOptions } from '../../NpmOptions';
import { GeneratorOptions } from '../../GeneratorOptions';
import { StoryFormat } from '../../project_types';

function addStorybookExcludeGlobToTsConfig() {
  const tsConfigJson = readFileAsJson('tsconfig.json', true);
  const glob = '**/*.stories.ts';
  if (!tsConfigJson) {
    return;
  }

  const { exclude = [] } = tsConfigJson;
  if (exclude.includes(glob)) {
    return;
  }

  tsConfigJson.exclude = [...exclude, glob];
  writeFileAsJson('tsconfig.json', tsConfigJson);
}

export default async (
  npmOptions: NpmOptions,
  { storyFormat = StoryFormat.CSF }: GeneratorOptions
) => {
  copyTemplate(__dirname, storyFormat);
  const packages = [
    '@storybook/aurelia',
    '@storybook/addon-actions',
    '@storybook/addon-links',
    '@storybook/addons',
    '@storybook/addon-storysource',
    '@storybook/addon-knobs',
{'fraction_non_alphanumeric': 0.1497005988023952, 'fraction_numerical': 0.0, 'mean_word_length': 4.159144893111639, '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': '6632309', 'n_tokens_mistral': 707, 'n_tokens_neox': 708, 'n_words': 128}