From 9b64c72b7002a7657075762217c79002b09f4ff4 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 13 Apr 2022 12:41:14 +0100 Subject: [PATCH] Move all dependency linking into budibase --- package.json | 3 ++- scripts/link-dependencies.sh | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 scripts/link-dependencies.sh diff --git a/package.json b/package.json index ad1b1c4c6f..091f523b25 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ }, "scripts": { "setup": "node ./hosting/scripts/setup.js && yarn && yarn bootstrap && yarn build && yarn dev", - "bootstrap": "lerna link && lerna bootstrap", + "bootstrap": "yarn run pre-bootstrap && lerna link && lerna bootstrap", + "pre-bootstrap": "./scripts/link-dependencies.sh", "build": "lerna run build", "publishnpm": "yarn build && lerna publish --force-publish", "release": "lerna publish patch --yes --force-publish", diff --git a/scripts/link-dependencies.sh b/scripts/link-dependencies.sh new file mode 100755 index 0000000000..de94cc71b0 --- /dev/null +++ b/scripts/link-dependencies.sh @@ -0,0 +1,45 @@ +if [ "${CI}" = true ]; then + echo 'Skipping bootstrap-pro in CI' + exit 0 +fi + +echo "Linking backend-core" +cd packages/backend-core +yarn link +cd - + +echo "Linking string-templates" +cd packages/string-templates +yarn link +cd - + +if [ -d "../budibase-pro" ]; then + cd ../budibase-pro/packages/pro + echo "Linking pro" + yarn link + + echo "Linking backend-core to pro" + yarn link '@budibase/backend-core' + cd - + + echo "Linking pro to worker" + cd packages/worker && yarn link '@budibase/pro' + cd - + + echo "Linking pro to server" + cd packages/server && yarn link '@budibase/pro' + cd - +fi + +if [ -d "../account-portal" ]; then + cd ../account-portal/packages/server + echo "Linking backend-core to account-portal" + yarn link "@budibase/backend-core" + + echo "Linking string-templates to account-portal" + yarn link "@budibase/pro" + + echo "Linking pro to account-portal" + yarn link "@budibase/pro" + cd - +fi