From c13e8b6270a44bc60215212b9379adef437f37f7 Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Fri, 21 Jan 2022 12:26:40 -0500 Subject: [PATCH 1/3] Set turbo version to match local build --- scripts/run-examples.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/run-examples.sh b/scripts/run-examples.sh index 0d8474e4ee1e4..434484ed32533 100755 --- a/scripts/run-examples.sh +++ b/scripts/run-examples.sh @@ -6,9 +6,11 @@ echo "=> Running examples..." echo "=> Building turbo from source..." cd cli && CGO_ENABLED=0 go build ./cmd/turbo/... && cd ..; export TURBO_BINARY_PATH=$(pwd)/cli/turbo +export TURBO_VERSION = $(shell head -n 1 $(pwd)/cli/version.txt) echo "=> Binary path: TURBO_BINARY_PATH=$TURBO_BINARY_PATH" echo "=> Moving our own eslint settings out of the way..." echo "=> Actually running examples for real..." + if [ -f ".eslintrc.js" ]; then mv .eslintrc.js .eslintrc.js.bak fi @@ -78,6 +80,7 @@ for folder in examples/* ; do cleanup setup_git + cat package.json | jq "'.devDependencies.turbo = "$TURBO_VERSION"'" | sponge package.json cat package.json | jq '.packageManager = "yarn@1.22.17"' | sponge package.json echo "=======================================================" From ee8032044ebe577032c57adec384f01469d7a9e0 Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Fri, 21 Jan 2022 12:43:00 -0500 Subject: [PATCH 2/3] Fix run examples when on canary --- scripts/run-examples.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/scripts/run-examples.sh b/scripts/run-examples.sh index 434484ed32533..b84a63c54f560 100755 --- a/scripts/run-examples.sh +++ b/scripts/run-examples.sh @@ -6,8 +6,11 @@ echo "=> Running examples..." echo "=> Building turbo from source..." cd cli && CGO_ENABLED=0 go build ./cmd/turbo/... && cd ..; export TURBO_BINARY_PATH=$(pwd)/cli/turbo -export TURBO_VERSION = $(shell head -n 1 $(pwd)/cli/version.txt) +export TURBO_VERSION=$(head -n 1 $(pwd)/cli/version.txt) +export TURBO_TAG=$(cat $(pwd)/cli/version.txt | sed -n '2 p') + echo "=> Binary path: TURBO_BINARY_PATH=$TURBO_BINARY_PATH" +echo "=> Local Turbo Version: TURBO_VERSION=$TURBO_VERSION" echo "=> Moving our own eslint settings out of the way..." echo "=> Actually running examples for real..." @@ -53,6 +56,12 @@ for folder in examples/* ; do echo "=======================================================" echo "=> checking $folder " echo "=======================================================" + + cat package.json | jq '.packageManager = "yarn@1.22.17"' | sponge package.json + if [ "$TURBO_TAG" == "canary" ]; then + cat package.json | jq '.devDependencies.turbo = "canary"' | sponge package.json + fi + if [ "$folder" != "examples/with-pnpm" ]; then # cleanup @@ -79,9 +88,7 @@ for folder in examples/* ; do cleanup setup_git - - cat package.json | jq "'.devDependencies.turbo = "$TURBO_VERSION"'" | sponge package.json - cat package.json | jq '.packageManager = "yarn@1.22.17"' | sponge package.json + echo "=======================================================" echo "=> $folder: yarn install" @@ -147,4 +154,10 @@ if [[ ! -z $(git status -s | grep -v package.json) ]];then exit 1 fi -rm -rf examples/.yarnrc; \ No newline at end of file +rm -rf examples/.yarnrc; + +cat package.json | jq 'del(.packageManager)' | sponge package.json + +if [ "$TURBO_TAG" == "canary" ]; then + cat package.json | jq '.devDependencies.turbo = "latest"' | sponge package.json +fi \ No newline at end of file From 9f2760605dd4e3e71c3cfa5a83ba31145dc50961 Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Fri, 21 Jan 2022 12:49:30 -0500 Subject: [PATCH 3/3] Remove .yarnrc stuff --- scripts/run-examples.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/run-examples.sh b/scripts/run-examples.sh index b84a63c54f560..9182573fd9e39 100755 --- a/scripts/run-examples.sh +++ b/scripts/run-examples.sh @@ -18,8 +18,6 @@ if [ -f ".eslintrc.js" ]; then mv .eslintrc.js .eslintrc.js.bak fi -echo "'env:\n\tTURBO_BINARY_PATH: $TURBO_BINARY_PATH'" > examples/.yarnrc; - function cleanup { rm -rf node_modules rm -rf apps/*/node_modules @@ -154,8 +152,6 @@ if [[ ! -z $(git status -s | grep -v package.json) ]];then exit 1 fi -rm -rf examples/.yarnrc; - cat package.json | jq 'del(.packageManager)' | sponge package.json if [ "$TURBO_TAG" == "canary" ]; then