From 5c18ece4f3c5d4ff73ae04c30a0c13473270220a Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 20 Dec 2022 14:30:31 +0000 Subject: [PATCH] Only build pro after bootstrapping and after backend-core build (#9130) * Update .npmignore path to include all subdirectories of dist The dist/* pattern was including only the first level of files inside the dist folder. Update to no longer wildcard to include all the folder contents * Only build pro after bootstrapping and after backend-core build This protects against the scenario of a breaking change in backend-core that is relied on by the pro package. Introducing to fix the current build as the published backend-core package is corrupted. This change ensures the local filsystem version of core will be used. * Debug line * Debug lines * Update build script --- packages/backend-core/package.json | 2 ++ scripts/pro/build.sh | 15 +++++++++++++++ scripts/pro/install.sh | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 scripts/pro/build.sh diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index c2f4b2a98a..7260272f2e 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -15,6 +15,8 @@ "prebuild": "rimraf dist/", "prepack": "cp package.json dist", "build": "tsc -p tsconfig.build.json", + "build:pro": "../../scripts/pro/build.sh", + "postbuild": "yarn run build:pro", "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", "test": "jest --coverage --maxWorkers=2", "test:watch": "jest --watchAll" diff --git a/scripts/pro/build.sh b/scripts/pro/build.sh new file mode 100755 index 0000000000..b03d85a0d0 --- /dev/null +++ b/scripts/pro/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# This script is designed for building the pro repo after the backend-core build has completed. +# This ensures that any changes in core that are required by pro are done in the correct order. + +set -e + +# Go to parent of budibase +cd ../../../ + +if [[ -d "budibase-pro" ]]; then + cd budibase-pro + echo "Building pro" + yarn build +fi \ No newline at end of file diff --git a/scripts/pro/install.sh b/scripts/pro/install.sh index ee80bf9e0d..d6662d6341 100755 --- a/scripts/pro/install.sh +++ b/scripts/pro/install.sh @@ -35,5 +35,5 @@ if [[ -d "budibase-pro" ]]; then git pull echo "Initializing pro repo..." - yarn setup + yarn fi \ No newline at end of file