<commit_before>const { readFileSync, writeFileSync } = require('fs');
const { execSync } = require('child_process');
const toml = require('toml');

const VARIABLES_FILE_PATH = './src/variables.js';
const PYPROJECT_FILE_PATH = '../pyproject.toml';
const COMMAND_RASA_SDK_VERSION =
    'python -c "from rasa_sdk import __version__ as rasa_sdk_version; print(rasa_sdk_version)"';
const JSON_SPACE_INDENT = 4;

const getRasaVersion = () => {
    const pyproject = readFileSync(PYPROJECT_FILE_PATH).toString();
    return toml.parse(pyproject).tool.poetry.version;
};

const getRasaSdkVersion = () => execSync(COMMAND_RASA_SDK_VERSION).toString().trim();

const writeVariablesFile = () => {
    const variables = JSON.stringify(
        {
            release: getRasaVersion(),
            rasa_sdk_version: getRasaSdkVersion(),
        },
        null,
        JSON_SPACE_INDENT,
    );
    const fileContent = `// this file is automatically generated, please do not update it manually\n\nexport default ${variables}`;
    writeFileSync(VARIABLES_FILE_PATH, fileContent);
};

console.info(`Computing docs variables and writing to ${VARIABLES_FILE_PATH}`);
writeVariablesFile();<commit_msg>add const for DISCLAIMER + missing semicolon<commit_after>const { readFileSync, writeFileSync } = require('fs');
const { execSync } = require('child_process');
const toml = require('toml');

const VARIABLES_FILE_PATH = './src/variables.js';
const PYPROJECT_FILE_PATH = '../pyproject.toml';
const COMMAND_RASA_SDK_VERSION =
    'python -c "from rasa_sdk import __version__ as rasa_sdk_version; print(rasa_sdk_version)"';
const DISCLAIMER = 'this file is automatically generated, please do not update it manually';
const JSON_SPACE_INDENT = 4;

const getRasaVersion = () => {
    const pyproject = readFileSync(PYPROJECT_FILE_PATH).toString();
    return toml.parse(pyproject).tool.poetry.version;
};

const getRasaSdkVersion = () => execSync(COMMAND_RASA_SDK_VERSION).toString().trim();

const writeVariablesFile = () => {
    const variables = JSON.stringify(
        {
            release: getRasaVersion(),
            rasa_sdk_version: getRasaSdkVersion(),
        },
        null,
        JSON_SPACE_INDENT,
    );
    const fileContent = `// ${DISCLAIMER}\n\nexport default ${variables};`;
    writeFileSync(VARIABLES_FILE_PATH, fileContent);
};

console.info(`Computing docs variables and writing to ${VARIABLES_FILE_PATH}`);
writeVariablesFile();
{'fraction_non_alphanumeric': 0.12182116488925349, 'fraction_numerical': 0.0008203445447087777, 'mean_word_length': 4.480898876404495, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6060089', 'n_tokens_mistral': 772, 'n_tokens_neox': 760, 'n_words': 159}