<commit_before>/* eslint key-spacing:0 spaced-comment:0 */
const path = require('path');
const debug = require('debug')('app:config:project');
const argv = require('yargs').argv;
const ip = require('ip');

debug('Creating default configuration.');
// ========================================================
// Default Configuration
// ========================================================
const config = {
    env : process.env.NODE_ENV || 'development',

  // ----------------------------------
  // Project Structure
  // ----------------------------------
    path_base  : path.resolve(__dirname, '..'),
    dir_client : 'src',
    dir_dist   : 'dist',
    dir_public : 'public',
    dir_server : 'server',
    dir_test   : 'tests',

  // ----------------------------------
  // Server Configuration
  // ----------------------------------
    server_host : ip.address(), // use string 'localhost' to prevent exposure on local network
    server_port : process.env.PORT || 3000,

  // ----------------------------------
  // Compiler Configuration
  // ----------------------------------
    compiler_babel : {
        cacheDirectory : true,
        plugins        : ['transform-runtime'],
        presets        : ['es2015', 'react', 'stage-0'],
    },
    compiler_devtool         : 'source-map',
    compiler_hash_type       : 'hash',
    compiler_fail_on_warning : false,
    compiler_quiet           : false,
    compiler_public_path     : '/',
    compiler_stats           : {
        chunks : false,
        chunkModules : false,
        colors : true,
    },
    compiler_vendors : [
        'react',
        'react-redux',
        'redux',
    ],

  // ----------------------------------
  // Test Configuration
  // ----------------------------------
    coverage_reporters : [
    { type : 'text-summary' },
    { type : 'lcov', dir : 'coverage' },
    ],
};

/************************************************
-------------------------------------------------

All Internal Configuration Below
Edit at Your Own Risk

-------------------------------------------------
************************************************/

// ------------------------------------
// Environment
// ------------------------------------
// N.B.: globals added here must _also_ be added to .eslintrc
config.globals = {
    'process.env'  : {
        'NODE_ENV' : JSON.stringify(config.env),
    },
    'NODE_ENV'     : config.env,
    '__DEV__'      : config.env === 'development',
    '__PROD__'     : config.env === 'production',
    '__TEST__'     : config.env === 'test',
    '__COVERAGE__' : !argv.watch && config.env === 'test',
    '__BASENAME__' : JSON.stringify(process.env.BASENAME || ''),
//    API_BASE       : '"http://rock.positron.cz:8080"',
//    AUDIO_BASE     : '"http://commondatastorage.googleapis.com/karel-makon-mp3/"',
    API_BASE       : '"http://localhost:5000"',
    AUDIO_BASE     : '"http://localhost:5000/static/audio/"',
    AUDIO_SUFFIX   : '".ogg"',
};

// ------------------------------------
// Validate Vendor Dependencies
// ------------------------------------
const pkg = require('../package.json');

config.compiler_vendors = config.compiler_vendors
  .filter((dep) => {
      if (pkg.dependencies[dep]) return true;

      debug(
      `Package "${dep}" was not found as an npm dependency in package.json; ` +
      `it won't be included in the webpack vendor bundle.<commit_msg>set api and audio bases depending on environment<commit_after>/* eslint key-spacing:0 spaced-comment:0 */
const path = require('path');
const debug = require('debug')('app:config:project');
const argv = require('yargs').argv;
const ip = require('ip');

debug('Creating default configuration.');
// ========================================================
// Default Configuration
// ========================================================
const config = {
    env : process.env.NODE_ENV || 'development',

  // ----------------------------------
  // Project Structure
  // ----------------------------------
    path_base  : path.resolve(__dirname, '..'),
    dir_client : 'src',
    dir_dist   : 'dist',
    dir_public : 'public',
    dir_server : 'server',
    dir_test   : 'tests',

  // ----------------------------------
  // Server Configuration
  // ----------------------------------
    server_host : ip.address(), // use string 'localhost' to prevent exposure on local network
    server_port : process.env.PORT || 3000,

  // ----------------------------------
  // Compiler Configuration
  // ----------------------------------
    compiler_babel : {
        cacheDirectory : true,
        plugins        : ['transform-runtime'],
        presets        : ['es2015', 'react', 'stage-0'],
    },
    compiler_devtool         : 'source-map',
    compiler_hash_type       : 'hash',
    compiler_fail_on_warning : false,
    compiler_quiet           : false,
    compiler_public_path     : '/',
    compiler_stats           : {
        chunks : false,
        chunkModules : false,
        colors : true,
    },
    compiler_vendors : [
        'react',
        'react-redux',
        'redux',
    ],

  // ----------------------------------
  // Test Configuration
  // ----------------------------------
    coverage_reporters : [
    { type : 'text-summary' },
    { type : 'lcov', dir : 'coverage' },
    ],
};

/************************************************
-------------------------------------------------

All Internal Configuration Below
Edit at Your Own Risk

-------------------------------------------------
************************************************/

// ------------------------------------
// Environment
// ------------------------------------
// N.B.: globals added here must _also_ be added to .eslintrc
config.globals = {
    'process.env'  : {
        'NODE_ENV' : JSON.stringify(config.env),
    },
    'NODE_ENV'     : config.env,
    '__DEV__'      : config.env === 'development',
    '__PROD__'     : config.env === 'production',
    '__TEST__'     : config.env === 'test',
    '__COVERAGE__' : !argv.watch && config.env === 'test',
    '__BASENAME__' : JSON.stringify(process.env.BASENAME || ''),
    API_BASE       : config.env === 'production'
                     ? '"http://rock.positron.cz:8080"'
                     : '"http://localhost:5000"',
    AUDIO_BASE     : config.env === 'production'
                     ? '"http://commondatastorage.googleapis.com/karel-makon-mp3/"'
                     : '"http://localhost:5000/static/audio/"',
    AUDIO_SUFFIX   : '".ogg"',
};

// ------------------------------------
// Validate Vendor Dependencies
// ------------------------------------
const pkg = require('../package.json');

config.compiler_vendors = config.compiler_vendors
  .filter((dep) => {
      if (pkg.dependencies[dep]) return true;

      debug(
      `Package "${dep}" was not found as an npm dependency in package.json; ` +
      `it won't be included in the webpack vendor bundle.
{'fraction_non_alphanumeric': 0.33127424220657953, 'fraction_numerical': 0.00689556098261744, 'mean_word_length': 1.5576781778104336, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4004172', 'n_tokens_mistral': 1862, 'n_tokens_neox': 1764, 'n_words': 370}