Build fixes

This commit is contained in:
zomars
2022-05-23 13:17:43 -06:00
parent 2e117d07c8
commit 40f1f9714e
3 changed files with 34 additions and 69 deletions
+7 -7
View File
@@ -10,19 +10,19 @@
"node": ">=14.19.x"
},
"scripts": {
"dev": "next build && PORT=3002 next start",
"dev-real": "PORT=3002 next dev",
"start": "PORT=3002 next start",
"build": "next build",
"lint": "next lint",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"dev-real": "PORT=3002 next dev",
"dev": "next build && PORT=3002 next start",
"lint-fix": "next lint --fix && prettier --write .",
"lint": "next lint",
"prebuild": "cd ../.. && yarn workspace @calcom/prisma generate-schemas",
"start": "PORT=3002 next start",
"test": "jest --detectOpenHandles --passWithNoTests",
"type-check": "tsc --pretty --noEmit",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
"type-check": "tsc --pretty --noEmit"
},
"devDependencies": {
"@calcom/tsconfig": "*",
"@typescript-eslint/eslint-plugin": "^5.25.0",
"babel-jest": "^28.1.0",
"jest": "^28.1.0",
"node-mocks-http": "^1.11.0"
+26 -55
View File
@@ -1,27 +1,24 @@
# github submodule repo addresses without https:// prefix
BRANCH_TO_CLONE="-b feat/api-keys"
# This didn't work ¯\_(ツ)_/¯
# declare -A remotes=(
# ["apps/website"]="github.com/calcom/website"
# ["apps/api"]="github.com/calcom/api"
# )
BRANCH_TO_CLONE=""
SUBMODULE_GITHUB=github.com/calcom/api
SUBMODULE_PATH=apps/api
COMMIT=$VERCEL_GIT_COMMIT_SHA
if [ "$VERCEL_GIT_COMMIT_SHA" == "" ]; then
echo "Error: VERCEL_GIT_COMMIT_SHA is empty"
exit 0
echo "Error: VERCEL_GIT_COMMIT_SHA is empty"
exit 0
fi
# github access token is necessary
# add it to Environment Variables on Vercel
if [ "$GITHUB_ACCESS_TOKEN" == "" ]; then
echo "Error: GITHUB_ACCESS_TOKEN is empty"
exit 0
echo "Error: GITHUB_ACCESS_TOKEN is empty"
exit 0
fi
# We add an exception to test on staging
if [ "$VERCEL_GIT_COMMIT_REF" == "staging" ]; then
BRANCH_TO_CLONE="-b $VERCEL_GIT_COMMIT_REF"
BRANCH_TO_CLONE="-b $VERCEL_GIT_COMMIT_REF"
fi
# stop execution on error - don't let it build if something goes wrong
@@ -38,52 +35,26 @@ git clone $BRANCH_TO_CLONE https://$GITHUB_ACCESS_TOKEN@github.com/calcom/cal.co
echo "Cloned"
# get submodule commit
output=$(git submodule status --recursive) # get submodule info
# set up an empty temporary work directory
rm -rf tmp || true # remove the tmp folder if exists
mkdir tmp # create the tmp folder
cd tmp # go into the tmp folder
# Extract each submodule commit hash and path
submodules=$(echo "$output" | sed "s/ /,/g")
# checkout the current submodule commit
git init # initialise empty repo
git remote add $SUBMODULE_PATH https://$GITHUB_ACCESS_TOKEN@$SUBMODULE_GITHUB # add origin of the submodule
git fetch --depth=1 $SUBMODULE_PATH $COMMIT # fetch only the required version
git checkout $COMMIT # checkout on the right commit
for submodule in $submodules; do
IFS=',' read -ra submodule_parts <<<"$submodule"
COMMIT=$(echo ${submodule_parts[0]} | sed "s/-/ /g")
SUBMODULE_PATH=${submodule_parts[1]}
echo "COMMIT: $COMMIT SUBMODULE_PATH: $SUBMODULE_PATH"
# move the submodule from tmp to the submodule path
cd .. # go folder up
rm -rf tmp/.git # remove .git
mv tmp/* $SUBMODULE_PATH/ # move the submodule to the submodule path
# This should be a hash table but couldn't make it work ¯\_(ツ)_/¯
# SUBMODULE_GITHUB=$remotes[$SUBMODULE_PATH]
if [ "$SUBMODULE_PATH" == "apps/website" ]; then
SUBMODULE_GITHUB=github.com/calcom/website
fi
# clean up
rm -rf tmp # remove the tmp folder
if [ "$SUBMODULE_PATH" == "apps/api" ]; then
SUBMODULE_GITHUB=github.com/calcom/api
COMMIT=$VERCEL_GIT_COMMIT_SHA
fi
echo "Submodule init"
# set up an empty temporary work directory
rm -rf tmp || true # remove the tmp folder if exists
mkdir tmp # create the tmp folder
cd tmp # go into the tmp folder
# checkout the current submodule commit
git init # initialise empty repo
git remote add $SUBMODULE_PATH https://$GITHUB_ACCESS_TOKEN@$SUBMODULE_GITHUB # add origin of the submodule
git fetch --depth=1 $SUBMODULE_PATH $COMMIT # fetch only the required version
git checkout $COMMIT # checkout on the right commit
# move the submodule from tmp to the submodule path
cd .. # go folder up
rm -rf tmp/.git # remove .git
mv tmp/* $SUBMODULE_PATH/ # move the submodule to the submodule path
# clean up
rm -rf tmp # remove the tmp folder
done
git diff --quiet HEAD^ HEAD ':!/apps/docs/*' ':!/apps/website/*' ':!/apps/web/*'
git diff --quiet HEAD^ HEAD ':!/apps/docs/*' ':!/apps/website/*' ':!/apps/web/*' ':!/apps/swagger/*' ':!/apps/console/*'
echo "✅ - Build can proceed"
exit 1
exit 1
+1 -7
View File
@@ -9,12 +9,6 @@
"@/*": ["*"]
}
},
"include": [
"next-env.d.ts",
"../../packages/types/*.d.ts",
"../../packages/types/next-auth.d.ts",
"**/*.ts",
"**/*.tsx"
],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "templates", "auth"]
}