Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ git:
sudo: false
cache:
directories:
- node_modules
- build-babel/node_modules
- build-babel/jspm_packages
language: node_js
Expand All @@ -15,4 +16,5 @@ matrix:
- node_js: '5'
- node_js: '6'
before_script:
- "npm i jspm@beta --prefix build-babel" # Force install in build-babel/node_modules
- "npm run build"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var t = _interopRequireWildcard(_babelTypes);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function runtimeProperty(name, regeneratorIdentifier) {
return t.memberExpression(regeneratorIdentifer || t.identifier("regeneratorRuntime"), t.identifier(name), false);
return t.memberExpression(regeneratorIdentifier || t.identifier("regeneratorRuntime"), t.identifier(name), false);
} /**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
Expand All @@ -26,4 +26,4 @@ function runtimeProperty(name, regeneratorIdentifier) {

function isReference(path) {
return path.isReferenced() || path.parentPath.isAssignmentExpression({ left: path.node });
}
}
45 changes: 35 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,49 @@
#!/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
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)

#

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
verifyLatestVersionOverrides "npm/babel-plugin-transform-regenerator@$LATEST_BABEL_PLUGIN_TRANSFORM_REGENERATOR_VERSION"

#

cd build-babel
cd $BUILD_DIR
rm -rf jspm_packages node_modules

npm install jspm@${JSPM_VERSION} --cache-min=Infinity
Expand All @@ -31,7 +56,7 @@ ${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
cat jspm_packages/npm/regenerator-runtime@$LATEST_REGENERATOR_VERSION/runtime.js
echo "return module.exports; })({exports:{}});"
) > ../regenerator-runtime.js
cd ..