Skip to content

ref(nextjs): Update vercel testing script #5738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 23 additions & 13 deletions packages/nextjs/vercel/set-up-branch-for-test-app-use.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,41 @@

echo " "

NEXTJS_SDK_DIR=$(pwd)
# This puts us in the packages directory
cd ..

# this puts us in the repo root
cd ../..

# make sure we're dealing with a clean SDK repo
# Make sure we're dealing with a clean SDK repo
STASHED_CHANGES=$(git status --porcelain)
if [ -n "${STASHED_CHANGES}" ]; then
echo "Found uncommitted changes. Stashing them."
git stash --quiet --include-untracked
fi

# if this hasn't already been done, get rid of irrelevant packages to speed up deploy process
# If this hasn't already been done, get rid of irrelevant packages to speed up deploy process
PACKAGES_DELETED=false
for package in "angular" "ember" "eslint-config-sdk" "eslint-plugin-sdk" "gatsby" "serverless" "vue" "wasm"; do
if [ -d packages/${package} ]; then
for package in *; do
# Delete all packages which aren't either runtime or dev dependencies of the nextjs SDK
case $package in
# Runtime depependencies
"nextjs" | "core" | "hub" | "browser" | "node" | "react" | "tracing" | "utils" | "integrations")
continue
;;
# Dev dependencies
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gah. Why does the auto-formatter insist on indenting these comments? 😖

"eslint-config-sdk" | "eslint-plugin-sdk" | "types" | "typescript")
continue
;;
# Everything else
*)
echo "Deleting ${package}"
rm -rf packages/${package}
rm -rf ${package}
PACKAGES_DELETED=true
fi
;;
esac
done

echo " "

# if we deleted anything, commit the result
# If we deleted anything, commit the result
if [ "$PACKAGES_DELETED" = true ]; then
echo "Committing deletions. Don't forget to push this commit before you deploy."
git add .
Expand All @@ -37,7 +47,7 @@ else
echo "Branch already set up for vercel deployment"
fi

# restore working directory, if necessary
# Restore working directory, if necessary
if [ -n "${STASHED_CHANGES}" ]; then
echo " "
echo "Restoring changes from earlier stash:"
Expand All @@ -46,4 +56,4 @@ if [ -n "${STASHED_CHANGES}" ]; then
echo " "
fi

cd $NEXTJS_SDK_DIR
cd nextjs