Skip to content

Commit

Permalink
build: add script to prepare rave repo on top of vxsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
eventualbuddha committed Feb 27, 2024
1 parent c266e58 commit 4b4fb3d
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules

# production
build
dist
target
*-*.*.*.tgz
*.tsbuildinfo
Expand Down
1 change: 0 additions & 1 deletion libs/monorepo-utils/src/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export interface WorkspaceFolder {
const DEFAULT_EXTRA_FOLDERS: readonly WorkspaceFolder[] = [
'docs',
'libs/usb-mocking',
'services/converter-ms-sems',
].map((path) => ({ path, name: path }));

function DEFAULT_PACKAGE_FILTER(pkg: PackageInfo) {
Expand Down
74 changes: 74 additions & 0 deletions script/rave-prepare
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env bash

# This script is used to prepare the project after rebasing from `vxsuite`.

no_commit=false
no_config=false

for arg in "$@"; do
case $arg in
--no-commit)
no_commit=true
shift
;;

--no-config)
no_config=true
shift
;;

*)
echo "error: unknown option $arg"
exit 1
;;
esac
done

# go to the root of the package
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/../"

echo "🪓 Remove services:"
rm -rf services

echo "🪓 Remove applications:"
./libs/monorepo-utils/bin/remove-package \
@votingworks/admin-frontend \
@votingworks/admin-backend \
@votingworks/admin-integration-testing \
@votingworks/central-scan-frontend \
@votingworks/central-scan-backend \
@votingworks/central-scan-integration-testing \
@votingworks/mark-frontend \
@votingworks/mark-backend \
@votingworks/mark-integration-testing \
@votingworks/mark-scan-frontend \
@votingworks/mark-scan-backend \
@votingworks/mark-scan-integration-testing \
@votingworks/scan-frontend \
@votingworks/scan-backend \
@votingworks/design-frontend \
@votingworks/design-backend

echo "🪓 Remove libraries:"
./libs/monorepo-utils/bin/remove-package \
@votingworks/cvr-fixture-generator \
@votingworks/custom-paper-handler

echo "🪓 Remove unused packages:"
./libs/monorepo-utils/bin/prune-unused

if [ "$no_config" = false ]; then
# regenerate config
pnpm -w generate-circleci-config
pnpm -w update-vscode-workspace

# regenerate lockfile
pnpm install
fi

if [ "$no_commit" = false ]; then
# commit changes
git add -A
git commit -m "chore: remove unused apps and packages"
fi

0 comments on commit 4b4fb3d

Please sign in to comment.