<commit_before>require('babel-core/register');

const generateStaticFiles = require('./generateStaticFiles');
const updatePackageVersions = require('./updatePackageVersions');

const createApp = require('../src/server/app');
const routes = require('../src/client/routes').default;
const packages = require('../src/client/constants/packages').default;
const guides = require('../src/client/constants/guides').default;
const examples = require('../src/client/constants/examples').default;

const packageNames = packages.map(p => ({ package: p.name }));
const guideNames = guides.map(p => ({ slug: p.slug }));
const exampleNames = examples.map(p => ({ slug: p.slug }));

updatePackageVersions();

let server;
const app = createApp();
server = app.listen('8000', () => {
  generateStaticFiles(
    routes,
    {
      'Packages': {
        children: {
          'Package': {
            params: packageNames
          }
        }
      },
      'Guide': {
        params: guideNames
      },
      'Examples': {
        children: {
          'Example': {
            params: exampleNames
          }
        }
      }
    }
  )
    .then(() => {
      server.close();
    });
});<commit_msg>(docs) Add tutorials to build [ci skip]<commit_after>require('babel-core/register');

const generateStaticFiles = require('./generateStaticFiles');
const updatePackageVersions = require('./updatePackageVersions');

const createApp = require('../src/server/app');
const routes = require('../src/client/routes').default;
const packages = require('../src/client/constants/packages').default;
const guides = require('../src/client/constants/guides').default;
const examples = require('../src/client/constants/examples').default;
const tutorialsByName = require('../src/client/constants/tutorials').byName;

const packageNames = packages.map(p => ({ package: p.name }));
const guideNames = guides.map(p => ({ slug: p.slug }));
const exampleNames = examples.map(p => ({ slug: p.slug }));
const tutorialNames = Object.keys(tutorialsByName).map(name => ({ name }));

updatePackageVersions();

let server;
const app = createApp();
server = app.listen('8000', () => {
  generateStaticFiles(
    routes,
    {
      'Packages': {
        children: {
          'Package': {
            params: packageNames
          }
        }
      },
      'Guide': {
        params: guideNames
      },
      'Examples': {
        children: {
          'Example': {
            params: exampleNames
          }
        }
      },
      'Tutorial': {
        params: tutorialNames
      }
    }
  )
    .then(() => {
      server.close();
    });
});
{'fraction_non_alphanumeric': 0.17075038284839203, 'fraction_numerical': 0.0030627871362940277, 'mean_word_length': 2.6854724964739067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '7376245', 'n_tokens_mistral': 746, 'n_tokens_neox': 746, 'n_words': 140}