From 4c6dc1b93484baec53b37fb4b9619006be7c5623 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Wed, 12 Aug 2015 22:19:06 -0700 Subject: [PATCH] [fixed] Installing on Windows Fixes #1577 --- .babelrc | 1 + package.json | 8 +++++--- scripts/release.sh | 21 ++++++++++++++------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.babelrc b/.babelrc index 04cac84085..6629c545de 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,5 @@ { "stage": 0, + "loose": "all", "plugins": [ "object-assign" ] } diff --git a/package.json b/package.json index 0a5bd27a12..2ff182133c 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,13 @@ "homepage": "https://rackt.github.io/react-router/", "bugs": "https://github.com/rackt/react-router/issues", "scripts": { - "build": "scripts/build.sh", + "build": "babel ./modules -d lib --ignore '__tests__'", + "build-umd": "NODE_ENV=production webpack modules/index.js lib/umd/History.js", + "build-min": "NODE_ENV=production webpack -p modules/index.js lib/umd/History.min.js", "build-website": "scripts/build-website.sh", - "prepublish": "npm run build", "examples": "webpack-dev-server --config examples/webpack.config.js --content-base examples --inline", - "test": "eslint modules && karma start" + "test": "eslint modules && karma start", + "prepublish": "npm run build" }, "authors": [ "Ryan Florence", diff --git a/scripts/release.sh b/scripts/release.sh index e797958360..203037c9ad 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -7,15 +7,19 @@ update_version() { echo "Updated ${1} version to ${2}" } +validate_semver() { + if ! [[ $1 =~ ^[0-9]\.[0-9]+\.[0-9](-.+)? ]]; then + echo "Version $1 is not valid! It must be a valid semver string like 1.0.2 or 2.3.0-beta.1" + exit 1 + fi +} + current_version=$(node -p "require('./package').version") printf "Next version (current is $current_version)? " read next_version -if ! [[ $next_version =~ ^[0-9]\.[0-9]+\.[0-9](-.+)? ]]; then - echo "Version must be a valid semver string, e.g. 1.0.2 or 2.3.0-beta.1" - exit 1 -fi +validate_semver $next_version next_ref="v$next_version" @@ -26,8 +30,12 @@ update_version 'package.json' $next_version $changelog -t $next_ref npm run build -git add -A build +npm run build-umd +npm run build-min +echo "gzipped, the UMD build is `gzip -c lib/umd/ReactRouter.min.js | wc -c | sed -e 's/^[[:space:]]*//'` bytes" + +git add -A build git commit -am "Version $next_version" git tag $next_ref @@ -37,8 +45,7 @@ git push origin master git push origin $next_ref git push origin latest -f -npm publish build +npm publish echo "# Publishing docs website" ./publish-docs.sh -