You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

34 lines
1.0 KiB

  1. # Deploy `swagger-ui-react` to npm.
  2. # https://www.peterbe.com/plog/set-ex
  3. set -ex
  4. # Parameter Expansion: http://stackoverflow.com/questions/6393551/what-is-the-meaning-of-0-in-a-bash-script
  5. cd "${0%/*}"
  6. mkdir -p ../dist
  7. # Copy UI's dist files to our directory
  8. cp ../../../dist/swagger-ui.js ../dist
  9. cp ../../../dist/swagger-ui-es-bundle.js ../dist
  10. cp ../../../dist/swagger-ui.css ../dist
  11. # Create a releasable package manifest
  12. node create-manifest.js > ../dist/package.json
  13. # Transpile our top-level component
  14. ../../../node_modules/.bin/cross-env BABEL_ENV=commonjs ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.js > ../dist/commonjs.js
  15. ../../../node_modules/.bin/cross-env BABEL_ENV=es ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.js > ../dist/index.js
  16. # Copy our README into the dist folder for npm
  17. cp ../README.md ../dist
  18. # Run the release from the dist folder
  19. cd ../dist
  20. if [ "$PUBLISH_FLAVOR_REACT" = "true" ] ; then
  21. npm publish .
  22. else
  23. npm pack .
  24. fi