Skip to content
Open
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: 1 addition & 1 deletion babel-transpiler.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
'LICENSE'
]

s.add_dependency 'babel-source', '>= 4.0', '< 6'
s.add_dependency 'babel-source', '>= 4.0', '< 7'
s.add_dependency 'execjs', '~> 2.0'
s.add_development_dependency 'minitest', '~> 5.5'

Expand Down
26 changes: 22 additions & 4 deletions script/build-gem
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,35 @@ git fetch origin

git checkout --quiet "v$VERSION"
make bootstrap build-dist
popd

DATE=$(git show --format=%at | head -n1)
BROWSERIFY_CMD="../babel/node_modules/browserify/bin/cmd.js"

mkdir -p babel-core/{node_modules,dist}
pushd babel-core
ln -s ../../babel/packages/babel-core node_modules/babel-core
cat <<JS | node $BROWSERIFY_CMD --insert-global-vars global --outfile dist/babel-core.js -
global.babel = require('babel-core');
JS
popd

mkdir -p babel-cli/{node_modules,dist}
pushd babel-cli
ln -s ../../babel/packages/babel-cli node_modules/babel-cli
cat <<JS | node $BROWSERIFY_CMD --insert-global-vars global --outfile dist/external-helpers.js -
global.babelHelpers = require('babel-cli/lib/babel-external-helpers');
JS
popd

popd

DATE=$(git show --format=%at | head -n1)

dir="tmp/babel-source-$VERSION"
mkdir -p "$dir/lib/babel"
cp "tmp/babel/packages/babel/dist/browser.js" "$dir/lib/babel.js"
cp "tmp/babel/packages/babel/dist/external-helpers.js" "$dir/lib/babel/external-helpers.js"
cp "tmp/babel/packages/babel/dist/polyfill.js" "$dir/lib/babel/polyfill.js"
cp "tmp/babel-core/dist/babel-core.js" "$dir/lib/babel.js"
cp "tmp/babel-cli/dist/external-helpers.js" "$dir/lib/babel/external-helpers.js" #
cp "tmp/babel/packages/babel-polyfill/dist/polyfill.js" "$dir/lib/babel/polyfill.js"

cp "tmp/babel/LICENSE" "$dir/LICENSE"
./script/eval-erb-template "babel-source.gemspec.erb" "$GEM_VERSION" "$DATE" > "$dir/babel-source.gemspec"
Expand Down