Skip to content

Commit

Permalink
@uppy/companion: fix deploy Yarn version (#3327)
Browse files Browse the repository at this point in the history
* @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.

* Update update-yarn.sh
  • Loading branch information
aduh95 committed Nov 29, 2021
1 parent f60133b commit 96192e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion 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
Expand All @@ -21,7 +27,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
Expand Down
4 changes: 3 additions & 1 deletion packages/@uppy/companion/package.json
Expand Up @@ -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"
}
}

0 comments on commit 96192e4

Please sign in to comment.