add scripts
This commit is contained in:
25
scripts/bootstrap.sh
Executable file
25
scripts/bootstrap.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# install default set
|
||||
npm install
|
||||
|
||||
# remove global babel
|
||||
npm list --global --depth 1 babel >/dev/null 2>&1 && npm uninstall -g babel || true
|
||||
|
||||
for f in packages/*; do
|
||||
if [ -d $f ]; then
|
||||
cd $f
|
||||
if [ -f "package.json" ]; then
|
||||
npm install
|
||||
npm link
|
||||
fi
|
||||
if [ -f "scripts/bootstrap.sh" ]; then
|
||||
./scripts/bootstrap.sh
|
||||
fi
|
||||
cd ../..
|
||||
fi
|
||||
done
|
||||
|
||||
git submodule update --init
|
||||
make build
|
||||
10
scripts/build-core.sh
Executable file
10
scripts/build-core.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
for f in packages/*; do
|
||||
if [ -d "$f/src" ]; then
|
||||
node node_modules/babel/bin/babel "$f/src" --out-dir "$f/lib" --copy-files $1 &
|
||||
fi
|
||||
done
|
||||
|
||||
wait
|
||||
13
scripts/test-browser.sh
Executable file
13
scripts/test-browser.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
BROWSERIFY_CMD="node_modules/browserify/bin/cmd.js"
|
||||
|
||||
mkdir -p dist
|
||||
|
||||
node packages/babel/scripts/cache-templates
|
||||
node packages/babel/scripts/build-tests
|
||||
node $BROWSERIFY_CMD -e test/browser.js >dist/browser-test.js
|
||||
rm -rf packages/babel/templates.json packages/babel/tests.json
|
||||
|
||||
test -n "`which open`" && open test/browser.html
|
||||
15
scripts/test.sh
Executable file
15
scripts/test.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
for f in packages/*; do
|
||||
if [ -n "$TEST_ONLY" ] && [ `basename $f` != "$TEST_ONLY" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -d "$f/test" ]; then
|
||||
echo $f
|
||||
cd $f
|
||||
node ../../node_modules/mocha/bin/_mocha
|
||||
cd ../../
|
||||
fi
|
||||
done
|
||||
16
scripts/travis/build-website.sh
Normal file
16
scripts/travis/build-website.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ ! -d ./_babel.github.io ]; then
|
||||
git clone git@github.com:babel/babel.github.io.git _babel.github.io
|
||||
fi
|
||||
|
||||
cd _babel.github.io
|
||||
|
||||
if [ ! -d ./_babel ]; then
|
||||
ln -s .. _babel
|
||||
fi
|
||||
|
||||
make build
|
||||
git commit -am "${TRAVIS_TAG}"
|
||||
git push "https://${GH_TOKEN}@github.com/babel/babel.github.io"
|
||||
2
scripts/travis/comment-issues.sh
Normal file
2
scripts/travis/comment-issues.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
14
scripts/travis/merge-development-with-master.sh
Normal file
14
scripts/travis/merge-development-with-master.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "Branch: $TRAVIS_BRANCH"
|
||||
echo "Commit: $TRAVIS_COMMIT"
|
||||
|
||||
if [ "$TRAVIS_BRANCH" != "development" ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
git fetch origin master:master
|
||||
git checkout master
|
||||
git merge "$TRAVIS_COMMIT"
|
||||
git push "https://${GH_TOKEN}@github.com/babel/babel"
|
||||
17
scripts/travis/publish-cli.sh
Normal file
17
scripts/travis/publish-cli.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
LAST_TAG=$(git describe $(git rev-list --tags --max-count=1))
|
||||
TAG_DIFF=$(git diff $LAST_TAG -- packages/babel-cli/)
|
||||
|
||||
if [ -n "$TAG_DIFF" ]; then
|
||||
echo "Changes detected to babel-cli since last tag, publishing new version."
|
||||
|
||||
cd ../packages
|
||||
node build-cli.js
|
||||
|
||||
cd babel-cli
|
||||
npm publish
|
||||
else
|
||||
echo "No changes detected to babel-cli since last tag"
|
||||
fi
|
||||
5
scripts/travis/setup-git.sh
Normal file
5
scripts/travis/setup-git.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
git config user.name "sebmckbot"
|
||||
git config user.email "sebmckbbot@gmail.com"
|
||||
Reference in New Issue
Block a user