bin/convert-repository
#!/usr/bin/env bash
BASEDIR=$(npm root -g)/@feathersjs/tools
echo "Clearing node_modules"
rm -rf node_modules
rm .babelrc
if [ -d "src" ]; then
echo "Renaming src/ to lib/"
rm -rf lib/
mv src/ lib/
fi
echo "Running the convert-repo Node script"
node "$BASEDIR/bin/convert-repo"
echo "Updating .gitignore to latest from plugin generator"
curl https://raw.githubusercontent.com/feathersjs/generator-feathers-plugin/master/app/templates/__gitignore > .gitignore
echo "Updating .npmignore to latest from plugin generator"
curl https://raw.githubusercontent.com/feathersjs/generator-feathers-plugin/master/app/templates/__npmignore > .npmignore
echo "Updating istanbul configuration"
curl https://raw.githubusercontent.com/feathersjs/generator-feathers-plugin/master/app/templates/static/.istanbul.yml > .istanbul.yml
echo "Updating mocha.opts to latest from plugin generator"
curl https://raw.githubusercontent.com/feathersjs/generator-feathers-plugin/master/app/templates/static/mocha.opts > mocha.opts
echo "Running codemods"
jscodeshift lib/ test/ -t "$BASEDIR/lib/codemods/export-to-cjs.js"
jscodeshift lib/ test/ -t "$BASEDIR/lib/codemods/import-to-require.js"
npm install