From a52748cd1b2902ba6d76ae468c4673f24cda49ea Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 22 Nov 2021 18:17:34 +0100 Subject: [PATCH 1/2] @uppy/companion: fix deploy When running from the Dockerfile, Corepack cannot pick up the information from the parent package.json and tries to run with an older version of Yarn. --- bin/update-yarn.sh | 4 +++- packages/@uppy/companion/package.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/update-yarn.sh b/bin/update-yarn.sh index 0f951e74e6..01fa886f79 100755 --- a/bin/update-yarn.sh +++ b/bin/update-yarn.sh @@ -21,7 +21,9 @@ PLUGINS=$(awk '{ if ($1 == "spec:") print $2 }' .yarnrc.yml) echo "$PLUGINS" | xargs -n1 -t corepack yarn plugin remove cp package.json .yarn/cache/tmp.package.json -sed "s#yarn\": \"$CURRENT_VERSION\"#yarn\": \"$LAST_VERSION\"#;s#\"yarn@$CURRENT_VERSION\"#\"yarn@$LAST_VERSION\"#" .yarn/cache/tmp.package.json > package.json +sed "s#\"yarn\": \"$CURRENT_VERSION\"#\"yarn\": \"$LAST_VERSION\"#;s#\"yarn@$CURRENT_VERSION\"#\"yarn@$LAST_VERSION\"#" .yarn/cache/tmp.package.json > package.json +cp packages/@uppy/companion/package.json .yarn/cache/tmp.package.json +sed "s#\"yarn\": \"$CURRENT_VERSION\"#\"yarn\": \"$LAST_VERSION\"#;s#\"yarn@$CURRENT_VERSION\"#\"yarn@$LAST_VERSION\"#" .yarn/cache/tmp.package.json > packages/@uppy/companion/package.json rm .yarn/cache/tmp.package.json echo "$PLUGINS" | xargs -n1 -t corepack yarn plugin import diff --git a/packages/@uppy/companion/package.json b/packages/@uppy/companion/package.json index 7d40c7d87b..f4c5591d73 100644 --- a/packages/@uppy/companion/package.json +++ b/packages/@uppy/companion/package.json @@ -112,7 +112,9 @@ "test": "bash -c 'source env.test.sh && ../../../node_modules/jest/bin/jest.js'", "test:watch": "yarn test -- --watch" }, + "packageManager": "yarn@3.1.0", "engines": { - "node": ">=10.20.1" + "node": ">=10.20.1", + "yarn": "3.1.0" } } From be10806900192858349a3dec82944507416d5e10 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 23 Nov 2021 17:41:51 +0100 Subject: [PATCH 2/2] Update update-yarn.sh --- bin/update-yarn.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/update-yarn.sh b/bin/update-yarn.sh index 01fa886f79..cebde82714 100755 --- a/bin/update-yarn.sh +++ b/bin/update-yarn.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash + +# This script is meant to be run on a dev's machine to update the version on +# Yarn used by the monorepo. Its goal is to make sure that every mention of Yarn +# version is updated, and it re-installs the plugins to make sure those are +# up-to-date as well. + set -o pipefail set -o errexit set -o nounset