<commit_before>// @flow
/* eslint-disable global-require */

const BABEL_ALLOWED_VERSIONS = new Set([6, 7])
const DEFAULT_STATICS = [
  '.png',
  '.jpg',
  '.woff',
  '.woff2',
  '.ttf',
  '.otf',
  '.eot',
  '.svg',
  '.webp',
  '.jpeg',
  '.gif',
  '.apng',
  '.bmp',
]

function getPresetComponents({
  report: { cli: reportCLI = true } = {},
  transform: {
    cson = false,
    css = true,
    coffee = false,
    json = true,
    json5 = false,
    babel = false,
    js = true,
    less = false,
    sass = false,
    stylus = false,
    postcss = false,
    typescript = false,
  } = {},
  development = process.env.NODE_ENV !== 'production',
  generate: { js: generateJS = true, css: generateCSS = true, html: generateHTML = true } = {},
  optimize: { js: optimizeJS = !development, css: optimizeCSS = !development, html: optimizeHTML = !development } = {},
  statics = [],
  resolve = true,
  target = process.env.PUNDLE_TARGET || 'browser',
}: {
  report?: {
    cli?: boolean,
  },
  transform?: {
    cson?: boolean,
    css?: boolean,
    coffee?: boolean,
    json?: boolean,
    json5?: boolean,
    babel?: 6 | 7 | false,
    js?: boolean,
    less?: boolean,
    sass?: boolean,
    stylus?: boolean,
    postcss?: boolean,
    typescript?: boolean,
  },
  development?: boolean,
  generate?: {
    js?: boolean,
    csss?: boolean,
    html?: boolean,
  },
  optimize?: {
    js?: boolean,
    css?: boolean,
    html?: boolean,
  },
  statics?: Array<string>,
  resolve?: boolean | { aliases: Object },
  target?: 'node' | 'browser',
} = {}) {
  const components = []
  const extensions = {
    css: new Set(['.css']),
    js: new Set(['.js', '.mjs']),
    static: new Set([DEFAULT_STATICS, ...statics]),
  }

  if (reportCLI) {
    components.push(require('pundle-reporter-cli')())
  }
  if (cson) {
    extensions.js.add('.cson')
    components.push(require('pundle-transformer-cson')())
  }
  if (coffee) {
    extensions.js.add('.coffee')
    components.push(require('pundle-transformer-coffee')())
  }
  if (json) {
    extensions.js.add('.json')
    components.push(require('pundle-transformer-json')())
  }
  if (json5) {<commit_msg>:bug: Fix default static extensions<commit_after>// @flow
/* eslint-disable global-require */

const BABEL_ALLOWED_VERSIONS = new Set([6, 7])
const DEFAULT_STATICS = [
  '.png',
  '.jpg',
  '.woff',
  '.woff2',
  '.ttf',
  '.otf',
  '.eot',
  '.svg',
  '.webp',
  '.jpeg',
  '.gif',
  '.apng',
  '.bmp',
]

function getPresetComponents({
  report: { cli: reportCLI = true } = {},
  transform: {
    cson = false,
    css = true,
    coffee = false,
    json = true,
    json5 = false,
    babel = false,
    js = true,
    less = false,
    sass = false,
    stylus = false,
    postcss = false,
    typescript = false,
  } = {},
  development = process.env.NODE_ENV !== 'production',
  generate: { js: generateJS = true, css: generateCSS = true, html: generateHTML = true } = {},
  optimize: { js: optimizeJS = !development, css: optimizeCSS = !development, html: optimizeHTML = !development } = {},
  statics = [],
  resolve = true,
  target = process.env.PUNDLE_TARGET || 'browser',
}: {
  report?: {
    cli?: boolean,
  },
  transform?: {
    cson?: boolean,
    css?: boolean,
    coffee?: boolean,
    json?: boolean,
    json5?: boolean,
    babel?: 6 | 7 | false,
    js?: boolean,
    less?: boolean,
    sass?: boolean,
    stylus?: boolean,
    postcss?: boolean,
    typescript?: boolean,
  },
  development?: boolean,
  generate?: {
    js?: boolean,
    csss?: boolean,
    html?: boolean,
  },
  optimize?: {
    js?: boolean,
    css?: boolean,
    html?: boolean,
  },
  statics?: Array<string>,
  resolve?: boolean | { aliases: Object },
  target?: 'node' | 'browser',
} = {}) {
  const components = []
  const extensions = {
    css: new Set(['.css']),
    js: new Set(['.js', '.mjs']),
    static: new Set([...DEFAULT_STATICS, ...statics]),
  }

  if (reportCLI) {
    components.push(require('pundle-reporter-cli')())
  }
  if (cson) {
    extensions.js.add('.cson')
    components.push(require('pundle-transformer-cson')())
  }
  if (coffee) {
    extensions.js.add('.coffee')
    components.push(require('pundle-transformer-coffee')())
  }
  if (json) {
    extensions.js.add('.json')
    components.push(require('pundle-transformer-json')())
  }
  if (json5) {
{'fraction_non_alphanumeric': 0.18711162255466052, 'fraction_numerical': 0.003682393555811277, 'mean_word_length': 2.8460176991150443, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4544368', 'n_tokens_mistral': 1559, 'n_tokens_neox': 1532, 'n_words': 346}