├── .buildpacks ├── LICENSE ├── README.md └── bin ├── compile ├── detect ├── release ├── test └── test-compile /.buildpacks: -------------------------------------------------------------------------------- 1 | https://github.com/heroku/heroku-buildpack-nodejs.git 2 | https://github.com/mars/create-react-app-inner-buildpack.git#v9.0.0 3 | https://github.com/heroku/heroku-buildpack-static.git#21c1f5175186b70cf247384fd0bf922504b419be 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Mars Hall 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Heroku Buildpack for create-react-app 2 | ===================================== 3 | 4 | After a long, useful run, this buildpack is now at its end of life 🌅 5 | 6 | The underlying [static web server buildpack](https://github.com/heroku/heroku-buildpack-static) is deprecated and will not be supported on Heroku-22 or newer stacks. 7 | 8 | Please look into using [Next.js](https://nextjs.org) or [Remix](https://remix.run) to develop React apps which are deployable using the [Node.js buildpack](https://github.com/heroku/heroku-buildpack-nodejs). 9 | 10 | ---------- 11 | 12 | Original README is still available on the [final release tag](https://github.com/mars/create-react-app-buildpack/tree/v9.0.1). 13 | -------------------------------------------------------------------------------- /bin/compile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bin/compile 3 | 4 | # Fail immediately on non-zero exit code. 5 | set -e 6 | # Fail immediately on non-zero exit code within a pipeline. 7 | set -o pipefail 8 | # Fail on undeclared variables. 9 | set -u 10 | # Debug, echo every command 11 | #set -x 12 | 13 | function indent() { 14 | c='s/^/ /' 15 | case $(uname) in 16 | Darwin) sed -l "$c";; 17 | *) sed -u "$c";; 18 | esac 19 | } 20 | 21 | BUILD_DIR=$1 22 | CACHE_DIR=$2 23 | ENV_DIR=$3 24 | BP_DIR=`cd $(dirname $0); cd ..; pwd` 25 | 26 | # Switch to new Node auto build behavior ahead of release 27 | export NEW_BUILD_SCRIPT_BEHAVIOR=true 28 | 29 | echo 30 | echo "=====! create-react-app-buildpack has reached end-of-life 🌅" 31 | echo " This build may succeed, but the buildpack is no longer maintained." 32 | echo " On the Heroku-22 stack and beyond, this may fail to build at all." 33 | echo 34 | echo " Please consider migrating to https://nextjs.org or https://remix.run to develop React apps which are deployable using Heroku's Node.js buildpack https://github.com/heroku/heroku-buildpack-nodejs, or you may develop your own create-react-app deployment with Node.js and Nginx buildpacks." 35 | echo 36 | 37 | # Use architecture of multi-buildpack to compose behavior. 38 | # https://github.com/heroku/heroku-buildpack-multi 39 | cp $BP_DIR/.buildpacks $BUILD_DIR/.buildpacks 40 | url=https://github.com/heroku/heroku-buildpack-multi.git 41 | branch="" 42 | dir=$(mktemp -t buildpackXXXXX) 43 | rm -rf $dir 44 | 45 | echo "=====> Downloading Buildpack: $url" 46 | 47 | if [[ "$url" =~ \.tgz$ ]] || [[ "$url" =~ \.tgz\? ]]; then 48 | mkdir -p "$dir" 49 | curl -s "$url" | tar xvz -C "$dir" >/dev/null 2>&1 50 | else 51 | git clone $url $dir >/dev/null 2>&1 52 | fi 53 | cd $dir 54 | 55 | if [ "$branch" != "" ]; then 56 | git checkout $branch >/dev/null 2>&1 57 | fi 58 | 59 | chmod -f +x $dir/bin/{detect,compile,release} 60 | 61 | framework=$($dir/bin/detect $1) 62 | 63 | if [ $? == 0 ]; then 64 | echo "=====> Detected Framework: $framework" 65 | $dir/bin/compile $BUILD_DIR $CACHE_DIR $ENV_DIR 66 | 67 | if [ $? != 0 ]; then 68 | exit 1 69 | fi 70 | else 71 | echo "create-react-app `.buildpacks` not defined. Exiting." 72 | exit 1 73 | fi 74 | -------------------------------------------------------------------------------- /bin/detect: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bin/detect 3 | 4 | if [ -f $1/package.json ]; then 5 | echo "React.js (create-react-app) multi" && exit 0 6 | else 7 | echo "no" && exit 1 8 | fi -------------------------------------------------------------------------------- /bin/release: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Use architecture of multi-buildpack to compose behavior. 4 | # https://github.com/heroku/heroku-buildpack-multi 5 | if [ -e $1/last_pack_release.out ]; then 6 | cat $1/last_pack_release.out 7 | rm $1/last_pack_release.out 8 | else 9 | echo "--- {}" 10 | fi -------------------------------------------------------------------------------- /bin/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bin/test-compile BUILD_DIR CACHE_DIR ENV_DIR 3 | 4 | # Hint to the test runner to exit when complete instead of watching. 5 | export CI=true 6 | 7 | # Test runner copied from Node buildpack: 8 | # https://github.com/heroku/heroku-buildpack-nodejs/blob/master/bin/test 9 | 10 | BUILD_DIR=${1:-} 11 | if yarn --version > /dev/null 2>&1; then 12 | cd "$BUILD_DIR" && yarn test 13 | else 14 | cd "$BUILD_DIR" && npm test 15 | fi -------------------------------------------------------------------------------- /bin/test-compile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bin/test-compile BUILD_DIR CACHE_DIR ENV_DIR 3 | 4 | # Test compiler copied from Node buildpack: 5 | # https://github.com/heroku/heroku-buildpack-nodejs/blob/master/bin/test-compile 6 | 7 | NODE_ENV=test "$(dirname ${0:-})/compile" "$1" "$2" "$3" --------------------------------------------------------------------------------