<commit_before>#!/usr/bin/env bash

if [ $# -ne 1 ] || [[ $1 -ne "ci" && $1 -ne "prod" ]] ; then
        echo "Builds JavaScript modules and their dependencies (images such as PNG and CSS files)"
        echo "into bundles with Webpack and places them in the webapp/resources/js-bundles directory."
        echo
        echo "The script runs in two phases:"
        echo "1. Run “yarn upgrade”, ensuring the packages tagged with \"latest\" are updated."
        echo "2. Run “yarn run {ci|prod}”, which cleans the target directory and generates the bundle"
        echo "   files. See package.json for the different parameters passed to Webpack."
        echo
        echo "Usage: $0 {ci|prod}"
        exit;
fi

for dir in bundles/*
do
    pushd . > /dev/null
    echo "Upgrading $dir:"
    cd $dir
    # Upgrade everything but React and Webpack to their latest versions
    ncu -x '/(react.*)|(webpack.*)/' -a
    npm install
    popd > /dev/null
done

# Upgrade everything but React and Webpack to their latest versions
ncu -x '/(react.*)|(webpack.*)/' -a
npm install
npm run $1
<commit_msg>Since we have some packages that start with react- (now one of ours, react-faceted-search), list packages that we don’t want to update explicitly instead of with regexes<commit_after>#!/usr/bin/env bash

if [ $# -ne 1 ] || [[ $1 -ne "ci" && $1 -ne "prod" ]] ; then
        echo "Builds JavaScript modules and their dependencies (images such as PNG and CSS files)"
        echo "into bundles with Webpack and places them in the webapp/resources/js-bundles directory."
        echo
        echo "The script runs in two phases:"
        echo "1. Run “yarn upgrade”, ensuring the packages tagged with \"latest\" are updated."
        echo "2. Run “yarn run {ci|prod}”, which cleans the target directory and generates the bundle"
        echo "   files. See package.json for the different parameters passed to Webpack."
        echo
        echo "Usage: $0 {ci|prod}"
        exit;
fi

for dir in bundles/*
do
    pushd . > /dev/null
    echo "Upgrading $dir:"
    cd $dir
    # Upgrade everything but React and Webpack to their latest versions
    ncu -x react,react-dom,prop-types,webpack,webpack-dev-server -a
    npm install
    popd > /dev/null
done

# Upgrade everything but React and Webpack to their latest versions
ncu -x react,react-dom,prop-types,webpack,webpack-dev-server -a
npm install
npm run $1

{'fraction_non_alphanumeric': 0.10166666666666667, 'fraction_numerical': 0.005833333333333334, 'mean_word_length': 2.7515625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3002607', 'n_tokens_mistral': 719, 'n_tokens_neox': 697, 'n_words': 310}