endtoend-build-tests 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env bash
  2. set -o pipefail
  3. set -o errexit
  4. set -o nounset
  5. set -o xtrace
  6. # Set magic variables for current file & dir
  7. __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  8. __file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
  9. __base="$(basename "${__file}" .sh)"
  10. __root="$(cd "$(dirname "${__dir}")" && pwd)"
  11. __e2eSuites="${__root}/test/endtoend"
  12. ESBUILD="$(corepack yarn workspace @uppy-tests/end2end bin esbuild)"
  13. for t in $(cd "$__e2eSuites" && ls -d */ | cut -f1 -d'/'); do
  14. if [ "$t" = "tmp" ]; then continue; fi
  15. if [ "$t" = "create-react-app" ]; then continue; fi
  16. mkdir -p "${__e2eSuites}/$t/dist"
  17. cp "${__root}/packages/uppy/dist/uppy.min.css" "${__e2eSuites}/$t/dist"
  18. cp "${__e2eSuites}/$t/index.html" "${__e2eSuites}/$t/dist"
  19. entryPointName="main.mjs"
  20. if [ "$t" = "typescript" ]; then entryPointName="main.ts"; fi
  21. "$ESBUILD" "${__e2eSuites}/$t/$entryPointName" \
  22. --bundle --target=es2017 \
  23. --outfile="${__e2eSuites}/$t/dist/bundle.js"
  24. done
  25. # Speeecial tests that need custom builds.
  26. pushd "${__e2eSuites}/create-react-app"
  27. npm install
  28. REACT_APP_ON_TRAVIS="${TRAVIS:-}" npm run build
  29. popd