2019-06-04 07:07:46 -04:00
|
|
|
#!/usr/bin/env zsh
|
2018-11-05 05:06:39 -05:00
|
|
|
set -ex
|
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
echo "----------------------------------------"
|
|
|
|
echo "-------GIT CLEANING UNUSED FILES--------"
|
|
|
|
echo "----------------------------------------"
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
git clean -fd
|
|
|
|
|
|
|
|
echo "----------------------------------------"
|
|
|
|
echo "--------------ENTRY FILE----------------"
|
|
|
|
echo "----------------------------------------"
|
|
|
|
|
|
|
|
npx bulk-decaffeinate convert --file app.coffee
|
|
|
|
|
|
|
|
for entryPoint in modules/**/index.coffee; do
|
|
|
|
npx bulk-decaffeinate convert --file $entryPoint
|
|
|
|
done
|
|
|
|
|
|
|
|
npx bulk-decaffeinate clean
|
|
|
|
|
|
|
|
npx prettier-eslint 'app.js' --write
|
|
|
|
|
|
|
|
for entryPoint in modules/**/index.js; do
|
|
|
|
npx prettier-eslint "$entryPoint" --write
|
|
|
|
done
|
|
|
|
|
|
|
|
git add .
|
|
|
|
git commit -m "Prettier: convert app.js & index.js decaffeinated files to Prettier format"
|
|
|
|
|
|
|
|
echo "----------------------------------------"
|
|
|
|
echo "------------GRUNTFILE FILE--------------"
|
|
|
|
echo "----------------------------------------"
|
|
|
|
|
|
|
|
npx bulk-decaffeinate convert --file Gruntfile.coffee
|
|
|
|
|
|
|
|
npx bulk-decaffeinate clean
|
|
|
|
|
|
|
|
npx prettier-eslint 'Gruntfile.js' --write
|
|
|
|
|
|
|
|
git add .
|
|
|
|
git commit -m "Prettier: convert Gruntfile.coffee decaffeinated files to Prettier format"
|
|
|
|
|
|
|
|
echo "----------------------------------------"
|
|
|
|
echo "------------------APP-------------------"
|
|
|
|
echo "----------------------------------------"
|
|
|
|
|
|
|
|
npx bulk-decaffeinate convert --dir app/coffee
|
|
|
|
|
|
|
|
for module in modules/**/app/coffee; do
|
2018-11-05 05:06:39 -05:00
|
|
|
npx bulk-decaffeinate convert --dir $module
|
|
|
|
done
|
|
|
|
|
|
|
|
npx bulk-decaffeinate clean
|
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
git mv app/coffee app/src
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
for module in modules/**/app; do
|
2018-11-05 05:06:39 -05:00
|
|
|
if [ -e $module/coffee ]; then
|
|
|
|
git mv $module/coffee $module/src
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
git commit -m "Rename app/coffee dir to app/src"
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
npx prettier-eslint 'app/src/**/*.js' --write
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
for module in modules/**/app/src; do
|
2018-11-05 05:06:39 -05:00
|
|
|
npx prettier-eslint "$module/**/*.js" --write
|
|
|
|
done
|
|
|
|
|
|
|
|
git add .
|
2019-05-29 05:21:06 -04:00
|
|
|
git commit -m "Prettier: convert app/src decaffeinated files to Prettier format"
|
|
|
|
|
|
|
|
echo "----------------------------------------"
|
|
|
|
echo "--------------UNIT TESTS----------------"
|
|
|
|
echo "----------------------------------------"
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
npx bulk-decaffeinate convert --dir test/unit/coffee
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
for module in modules/**/test/unit/coffee; do
|
2018-11-05 05:06:39 -05:00
|
|
|
npx bulk-decaffeinate convert --dir $module
|
|
|
|
done
|
|
|
|
|
|
|
|
npx bulk-decaffeinate clean
|
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
git mv test/unit/coffee test/unit/src
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
for module in modules/**/test/unit; do
|
2018-11-05 05:06:39 -05:00
|
|
|
if [ -e $module/coffee ]; then
|
|
|
|
git mv $module/coffee $module/src
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
git commit -m "Rename test/unit/coffee to test/unit/src"
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
npx prettier-eslint 'test/unit/src/**/*.js' --write
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2019-05-29 05:21:06 -04:00
|
|
|
for module in modules/**/test/unit/src; do
|
2018-11-05 05:06:39 -05:00
|
|
|
npx prettier-eslint "$module/**/*.js" --write
|
|
|
|
done
|
|
|
|
|
|
|
|
git add .
|
2019-05-29 05:21:06 -04:00
|
|
|
git commit -m "Prettier: convert test/unit decaffeinated files to Prettier format"
|
|
|
|
|
|
|
|
echo "----------------------------------------"
|
|
|
|
echo "-----------ACCEPTANCE TESTS-------------"
|
|
|
|
echo "----------------------------------------"
|
|
|
|
|
|
|
|
npx bulk-decaffeinate convert --dir test/acceptance/coffee
|
|
|
|
|
|
|
|
for module in modules/**/test/acceptance/coffee; do
|
|
|
|
npx bulk-decaffeinate convert --dir $module
|
|
|
|
done
|
|
|
|
|
|
|
|
npx bulk-decaffeinate clean
|
|
|
|
|
|
|
|
git mv test/acceptance/coffee test/acceptance/src
|
|
|
|
|
|
|
|
for module in modules/**/test/acceptance; do
|
|
|
|
if [ -e $module/coffee ]; then
|
|
|
|
git mv $module/coffee $module/src
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
git commit -m "Rename test/acceptance/coffee to test/acceptance/src"
|
|
|
|
|
|
|
|
npx prettier-eslint 'test/acceptance/src/**/*.js' --write
|
|
|
|
|
|
|
|
for module in modules/**/test/acceptance/src; do
|
|
|
|
npx prettier-eslint "$module/**/*.js" --write
|
|
|
|
done
|
|
|
|
|
|
|
|
git add .
|
|
|
|
git commit -m "Prettier: convert test/acceptance decaffeinated files to Prettier format"
|
|
|
|
|
|
|
|
echo "----------------------------------------"
|
|
|
|
echo "-------------SMOKE TESTS----------------"
|
|
|
|
echo "----------------------------------------"
|
|
|
|
|
|
|
|
npx bulk-decaffeinate convert --dir test/smoke/coffee
|
|
|
|
|
|
|
|
npx bulk-decaffeinate clean
|
|
|
|
|
|
|
|
git mv test/smoke/coffee test/smoke/src
|
|
|
|
|
|
|
|
git commit -m "Rename test/smoke/coffee to test/smoke/src"
|
|
|
|
|
|
|
|
npx prettier-eslint 'test/smoke/src/**/*.js' --write
|
|
|
|
|
|
|
|
git add .
|
|
|
|
git commit -m "Prettier: convert test/smoke decaffeinated files to Prettier format"
|
|
|
|
|
|
|
|
echo "----------------------------------------"
|
|
|
|
echo "-----------FIX REQUIRE PATHS------------"
|
|
|
|
echo "----------------------------------------"
|
|
|
|
|
|
|
|
perl -i.bak -pe "s/([\'\"\`].*)\/app\/js(.*[\'\"\`])/\1\/app\/src\2/g" app.js
|
|
|
|
rm app.js.bak
|
|
|
|
|
|
|
|
perl -i.bak -pe "s/([\'\"\`].*)\/app\/js(.*[\'\"\`])/\1\/app\/src\2/g" Gruntfile.js
|
|
|
|
rm Gruntfile.js.bak
|
|
|
|
|
|
|
|
perl -i.bak -pe "s/([\'\"\`].*)\/app\/js(.*[\'\"\`])/\1\/app\/src\2/g" modules/**/index.js
|
|
|
|
rm modules/**/index.js.bak
|
|
|
|
|
|
|
|
perl -i.bak -pe "s/([\'\"\`].*)\/app\/js(.*[\'\"\`])/\1\/app\/src\2/g" **/src/**/*.js
|
|
|
|
rm **/src/**/*.js.bak
|
|
|
|
|
|
|
|
perl -i.bak -pe "s/([\'\"\`].*)\/test\/acceptance\/js(.*[\'\"\`])/\1\/test\/acceptance\/src\2/g" **/src/**/*.js
|
|
|
|
rm **/src/**/*.js.bak
|
|
|
|
|
|
|
|
perl -i.bak -pe "s/([\'\"\`].*)test\/smoke\/js(.*[\'\"\`])/\1test\/smoke\/src\2/g" **/src/**/*.js
|
|
|
|
rm **/src/**/*.js.bak
|
|
|
|
|
|
|
|
# Fix formatting after rewriting paths - extra character can make a difference
|
|
|
|
make format_fix
|
|
|
|
|
|
|
|
git add .
|
|
|
|
git commit -m "Fix require paths in modules after decaffeination" || true
|
2018-11-05 05:06:39 -05:00
|
|
|
|
|
|
|
echo "done"
|