sourcegraph/dev/foreach-non-web-client-project.sh

68 lines
1.4 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
use single root package.json, do not build intermediate shared code (#936) * remove enterprise workspace (build together with webapp) * remove sourcegraph-extension-api workspace * directly import graphqlschema instead of symlinking * remove unneeded symlink (file now lives in this package) * noEmit on extensions-client-common & refer to graphql schema in webapp only * update paths @sourcegraph/extensions-client-common/{lib => src} * remove unneeded workspace for and deps from extensions-client-common * extensions-client-common compiles * update paths in browser-extensions * webapp compiles with ecc node_modules deleted * compiling after adding back ecc node_modules * root gulpfile working * mv packages/webapp -> web * replace "packages/webapp" with "web" * mv packages/browser-extensions client/browser * remove broken phabricator dev script see https://github.com/sourcegraph/sourcegraph/issues/938 * replace "packages/browser-extensions" with "client/browser" * mv packages/extensions-client-common shared * update paths * yarn.lock for browser ext * update paths to graphqlschema * tslint paths * LinkOrSpan * update gql * client/browser typechecks * client/browser tslint * tsconfig.json combining * rearrange gulpfiles * clean up schema gulp tasks * before linking a lot of deps * webpack build working * more consolidation * add more common deps * almost done w browser ext * WIP just tried adding base.config.ts symlinks true to try to fix the issues where multiple highlight.js caused hovers to fail due to no highlighting, and multiple rxjs type errors (codeintellify and sourcegraph/sourcegraph) showing up only in webpack. hypothesis is that this is due to webpack not resolving symlinks and so "seeing" multiple pkgs. * hovers working, fixed resolve issue, just needed to add rxjs to root package.json * regenerate lockfiles * add browser ext to procfile * add back builds * manually sync contribution.schema.json * import schema json files directly, no copying * update import paths * wip typescript build doc * move enterprise/src/ into src/ for ease of typescript build * wip build doc * wip * use a single root package.json * update yarn.lock * prettier * set up .bin symlinks * prettier * all:typecheck * fix * fix all:typecheck * fix schema output path * add back .bin links * fix link * fix gulpfiles * only include gulpfile in root tsconfig * clean up gulpfiles * generate * fix node_modules paths in webpack * sort * simplify tsconfig * ignore generated files * fix bundlesize paths * fix enterprise build * fix tsconfigs * fix back tsconfigs * fix * TMP * fix path * TIP * WIP * transpileonly in tests because we have already typechecked it * fix browser ext test * remove browser ext from procfile for now * fix enterprise paths
2018-11-12 09:05:35 +00:00
set -e
unset CDPATH
cd "$(dirname "${BASH_SOURCE[0]}")/.." # cd to repo root dir
parallel_run() {
./dev/ci/parallel_run.sh "$@"
}
export ARGS=$*
# Keep the list of client workspaces in alphabetical order!
DIRS=(
client/branded
client/browser
client/build-config
client/client-api
client/codeintellify
client/common
client/extension-api
client/extension-api-types
client/http-client
client/jetbrains
client/observability-client
client/observability-server
client/shared
client/storybook
client/template-parser
client/testing
client/vscode
client/wildcard
)
# Keep the list of client workspaces in alphabetical order!
run_command() {
local MAYBE_TIME_PREFIX=""
if [[ "${CI_DEBUG_PROFILE:-"false"}" == "true" ]]; then
MAYBE_TIME_PREFIX="env time -v"
fi
dir=$1
echo "--- $dir: $ARGS"
(
set -x
cd "$dir" && eval "${MAYBE_TIME_PREFIX} ${ARGS}"
)
ecode="$?"
# shellcheck disable=SC2181
# We are checking the sub-shell, following SC2181 would make this unreadable
if [[ $ecode -ne 0 ]]; then
echo "^^^ +++"
exit $ecode
fi
}
export -f run_command
if [[ "${CI:-"false"}" == "true" ]]; then
echo "--- 🚨 Buildkite's timing information is misleading! Only consider the job timing that's printed after 'done'"
parallel_run run_command {} ::: "${DIRS[@]}"
else
for dir in "${DIRS[@]}"; do
run_command "$dir"
done
fi