<commit_before>import { registerTSPaths } from '../server/helpers/register-ts-paths'
registerTSPaths()

import { readdir, stat } from 'fs-extra'
import { join } from 'path'
import { root } from '@server/helpers/core-utils'

async function run () {
  const result = {
    app: await buildResult(join(root(), 'client', 'dist', 'en-US')),
    embed: await buildResult(join(root(), 'client', 'dist', 'standalone', 'videos'))
  }

  console.log(JSON.stringify(result))
}

run()
  .catch(err => console.error(err))

async function buildResult (path: string) {
  const distFiles = await readdir(path)

  const files: { [ name: string ]: number } = {}

  for (const file of distFiles) {
    const filePath = join(path, file)

    const statsResult = await stat(filePath)
    files[file] = statsResult.size
  }

  return files
}<commit_msg>Update stats format<commit_after>import { registerTSPaths } from '../server/helpers/register-ts-paths'
registerTSPaths()

import { readdir, stat } from 'fs-extra'
import { join } from 'path'
import { root } from '@server/helpers/core-utils'

async function run () {
  const result = {
    app: await buildResult(join(root(), 'client', 'dist', 'en-US')),
    embed: await buildResult(join(root(), 'client', 'dist', 'standalone', 'videos'))
  }

  console.log(JSON.stringify(result))
}

run()
  .catch(err => console.error(err))

async function buildResult (path: string) {
  const distFiles = await readdir(path)

  const files: { name: string, size: number }[] = []

  for (const file of distFiles) {
    const filePath = join(path, file)

    const statsResult = await stat(filePath)
    files.push({
      name: file,
      size: statsResult.size
    })
  }

  return files
}
{'fraction_non_alphanumeric': 0.1522248243559719, 'fraction_numerical': 0.0, 'mean_word_length': 3.910919540229885, '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': '3601866', 'n_tokens_mistral': 556, 'n_tokens_neox': 546, 'n_words': 148}