<commit_before>#!/bin/bash -xv

NODE_CWD=./node_modules/.bin

JSPM_CMD=${NODE_CWD}/jspm

JSPM_VERSION=beta
REGENERATOR_VERSION=^0.9.5 

#

LATEST_REGENERATOR_VERSIONS=$(npm v regenerator-runtime@$REGENERATOR_VERSION version)
if [ $(echo $LATEST_REGENERATOR_VERSIONS | wc -l) = "1" ];then
	REGENERATOR_VERSION=$LATEST_REGENERATOR_VERSIONS
else
	REGENERATOR_VERSION=$(echo $LATEST_REGENERATOR_VERSIONS | tail -n 1 | awk '{print $2}' | tr -d "'")
fi

#

cd build-babel
rm -rf jspm_packages node_modules

npm install jspm@${JSPM_VERSION} --cache-min=Infinity
${JSPM_CMD} install --quick --log err
cp -r jspm_packages_override/* jspm_packages

${JSPM_CMD} build systemjs-babel.js ../systemjs-babel-browser.js --format amd --skip-source-maps --skip-rollup --minify --log ok
${JSPM_CMD} build systemjs-babel.js ../systemjs-babel-node.js --format amd --node --skip-source-maps --skip-rollup --log ok
${JSPM_CMD} run systemjs-build-babel-helpers.js > ../babel-helpers.js
${JSPM_CMD} run systemjs-build-modular-babel-helpers.js
(
  echo "export default (function(module) {" ;
  cat jspm_packages/npm/regenerator-runtime@${REGENERATOR_VERSION}/runtime.js
  echo "return module.exports; })({exports:{}});"
) > ../regenerator-runtime.js
cd ..<commit_msg>chore(build): check overriden packages version<commit_after>#!/bin/bash -xv

NODE_CWD=./node_modules/.bin
JSPM_CMD=${NODE_CWD}/jspm

BABEL_PLUGIN_TRANSFORM_REGENERATOR_VERSION=^6.9.0
BUILD_DIR=build-babel
JSPM_VERSION=beta
REGENERATOR_VERSION=^0.9.5

#

function getLatestVersionFromRange
{
  local LATEST_VERSIONS=$(npm v $1 version)
  local LATEST_VERSION
  if [ $(echo $LATEST_VERSIONS | wc -l) = "1" ];then
    LATEST_VERSION=$LATEST_VERSIONS
  else
    LATEST_VERSION=$(echo $LATEST_VERSIONS | tail -n 1 | awk '{print $2}' | tr -d "'")
  fi

  echo $LATEST_VERSION
}

function verifyLatestVersionOverrides
{
  local OVERRIDDEN_PACKAGE_DIR="$BUILD_DIR/jspm_packages_override/$1"
  if [ ! -d "$OVERRIDDEN_PACKAGE_DIR" ];then
    echo "Expect $OVERRIDDEN_PACKAGE_DIR to be found" 1>&2
    exit 1
  fi
}

#

LATEST_REGENERATOR_VERSION=$(getLatestVersionFromRange regenerator-runtime@$REGENERATOR_VERSION)
LATEST_BABEL_PLUGIN_TRANSFORM_REGENERATOR_VERSION=$(getLatestVersionFromRange babel-plugin-transform-regenerator@$BABEL_PLUGIN_TRANSFORM_REGENERATOR_VERSION)

#

verifyLatestVersionOverrides "npm/babel-plugin-transform-regenerator@$LATEST_BABEL_PLUGIN_TRANSFORM_REGENERATOR_VERSION"

#

cd $BUILD_DIR
rm -rf jspm_packages node_modules

npm install jspm@${JSPM_VERSION} --cache-min=Infinity
${JSPM_CMD} install --quick --log err
cp -r jspm_packages_override/* jspm_packages

${JSPM_CMD} build systemjs-babel.js ../systemjs-babel-browser.js --format amd --skip-source-maps --skip-rollup --minify --log ok
${JSPM_CMD} build systemjs-babel.js ../systemjs-babel-node.js --format amd --node --skip-source-maps --skip-rollup --log ok
${JSPM_CMD} run systemjs-build-babel-helpers.js > ../babel-helpers.js
${JSPM_CMD} run systemjs-build-modular-babel-helpers.js
(
  echo "export default (function(module) {" ;
  cat jspm_packages/npm/regenerator-runtime@$LATEST_REGENERATOR_VERSION/runtime.js
  echo "return module.exports; })({exports:{}});"
) > ../regenerator-runtime.js
cd ..
{'fraction_non_alphanumeric': 0.13743781094527363, 'fraction_numerical': 0.006218905472636816, 'mean_word_length': 5.09280303030303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6655381', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1225, 'n_words': 217}