1
0
Fork 0
mirror of synced 2024-06-13 16:05:06 +12:00

Use local string-templates

This commit is contained in:
Adria Navarro 2023-10-03 11:02:11 +02:00
parent d4fa87550e
commit 3d697949f0
3 changed files with 31 additions and 1 deletions

View file

@ -6,4 +6,4 @@ packages/worker/node_modules
packages/cli
packages/client
packages/bbui
packages/string-templates
packages/string-templates/node_modules

View file

@ -14,6 +14,8 @@ COPY packageNames.txt .
COPY packages/server/package.json packages/server/package.json
COPY packages/worker/package.json packages/worker/package.json
# string-templates does not get bundled during the esbuild process, so we want to use the local version
COPY packages/string-templates/package.json packages/string-templates/package.json
COPY scripts/removeWorkspaceDependencies.sh scripts/removeWorkspaceDependencies.sh
@ -30,6 +32,7 @@ RUN yarn install --production && yarn cache clean
COPY packages/server/dist packages/server/dist
COPY packages/server/client packages/server/client
COPY packages/worker/dist packages/worker/dist
COPY packages/string-templates packages/string-templates
FROM budibase/couchdb as runner

View file

@ -1,4 +1,25 @@
#!/bin/bash
exclude_packages=()
while getopts "e:" opt; do
case $opt in
e)
exclude_packages+=("$OPTARG")
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
root_package_json=$(cat "package.json")
process_package() {
@ -9,6 +30,12 @@ process_package() {
while IFS= read -r package_name; do
for exclude_package in "${exclude_packages[@]}"; do
if [ "$package_name" == "$exclude_package" ]; then
continue 2 # Skip this package and continue with the next one
fi
done
if echo "$package_json" | jq -e --arg package_name "$package_name" '.dependencies | has($package_name)' > /dev/null; then
package_json=$(echo "$package_json" | jq "del(.dependencies[\"$package_name\"])")
has_changes=true