<commit_before>// Client Asset Manager
// --------------------
// The Client Asset Manager allows you to define multiple single-page 'clients' which can be served on
// different URLs or to different devices. Note: The Client Asset Manager deliberately makes extensive use
// of synchronous code. This is because all operations only ever run once on startup (when packing the assets)
// unless you are running in dev mode
'use strict';

require('colors');

var shortid = require('shortid'),
    log = require('../utils/log'),
    systemAssets = require('./system');

// Set defaults
var options = {};

function setDefaultOptions(options) {

  // Determine if assets should be (re)packed on startup
  var packAssets = process.env['SS_PACK'];

  //TODO packAssets vs packedAssets
  options.packedAssets = packAssets || false;

  options.liveReload = ['code', 'css', 'static', 'templates', 'views'];
  options.defaultEntryInit = 'require("/entry");';
  options.urls = {
    assets: '/assets/'
  };
  options.dirs = {
    client: '/client',
    code: '/client/code',
    css: '/client/css',
    static: '/client/static',
    assets: '/client/static/assets',
    templates: '/client/templates',
    views: '/client/views',
    workers: '/client/workers'
  };
}

setDefaultOptions(options);

// Store each client as an object
var clients = {};

/**
 * @ngdoc service
 * @name ss.client:client
 * @function
 *
 * @description
 * Client serving, bundling, development, building.
 * -----------
 * One or more clients are defined and will be served in production as a single HTML, CSS, and JS file.
 */
module.exports = function(ss, router) {

  // make bundler methods available for default and other implementations
  ss.bundler = require('./bundler/index')(ss,options);

  // Require sub modules
  var templateEngine = require('./template_engine')(ss),
      formatters = require('./formatters')(ss);
      //TODO why isn't this referenced anymore ? http = require('./http')(ss, clients, options);

  // Load default code formatters
  formatters.add('javascript');
  formatters.add('css');
  formatters.add('html');
  formatters.add('map');

  systemAssets.load();

  // Return API
  return {<commit_msg>fix(client): http require provides the serveClient API<commit_after>// Client Asset Manager
// --------------------
// The Client Asset Manager allows you to define multiple single-page 'clients' which can be served on
// different URLs or to different devices. Note: The Client Asset Manager deliberately makes extensive use
// of synchronous code. This is because all operations only ever run once on startup (when packing the assets)
// unless you are running in dev mode
'use strict';

require('colors');

var shortid = require('shortid'),
    log = require('../utils/log'),
    systemAssets = require('./system');

// Set defaults
var options = {};

function setDefaultOptions(options) {

  // Determine if assets should be (re)packed on startup
  var packAssets = process.env['SS_PACK'];

  //TODO packAssets vs packedAssets
  options.packedAssets = packAssets || false;

  options.liveReload = ['code', 'css', 'static', 'templates', 'views'];
  options.defaultEntryInit = 'require("/entry");';
  options.urls = {
    assets: '/assets/'
  };
  options.dirs = {
    client: '/client',
    code: '/client/code',
    css: '/client/css',
    static: '/client/static',
    assets: '/client/static/assets',
    templates: '/client/templates',
    views: '/client/views',
    workers: '/client/workers'
  };
}

setDefaultOptions(options);

// Store each client as an object
var clients = {};

/**
 * @ngdoc service
 * @name ss.client:client
 * @function
 *
 * @description
 * Client serving, bundling, development, building.
 * -----------
 * One or more clients are defined and will be served in production as a single HTML, CSS, and JS file.
 */
module.exports = function(ss, router) {

  // make bundler methods available for default and other implementations
  ss.bundler = require('./bundler/index')(ss,options);

  // Require sub modules
  var templateEngine = require('./template_engine')(ss),
      formatters = require('./formatters')(ss);

  // extend http response API
  require('./http')(ss, clients, options);
  
  // Load default code formatters
  formatters.add('javascript');
  formatters.add('css');
  formatters.add('html');
  formatters.add('map');

  systemAssets.load();

  // Return API
  return {
{'fraction_non_alphanumeric': 0.15081521739130435, 'fraction_numerical': 0.0, 'mean_word_length': 3.4258517034068134, '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': '2442122', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1213, 'n_words': 415}