diff --git a/go.mod b/go.mod index 2fd93d8fa..4870b72eb 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.14 require ( github.com/jmorrell/semver v0.0.0-20190521202929-0d1a4bb09cfa - github.com/stretchr/testify v1.7.2 + github.com/stretchr/testify v1.8.1 ) diff --git a/go.sum b/go.sum index 12d1c3581..18ddcd01f 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,19 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/jmorrell/semver v0.0.0-20190521202929-0d1a4bb09cfa h1:r1iPuFpnBYOGRucEzPyY4TdeC6+HBUrd79Q9Qg6OdBg= github.com/jmorrell/semver v0.0.0-20190521202929-0d1a4bb09cfa/go.mod h1:VxabTS3pB/A0ivrKFcm8NX6RT7Btqn+0hjn8jnozEW8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/lib/dependencies.sh b/lib/dependencies.sh index 2c160b1e6..8e1854d2a 100644 --- a/lib/dependencies.sh +++ b/lib/dependencies.sh @@ -146,7 +146,18 @@ yarn_2_install() { echo "Running 'yarn install' with yarn.lock" cd "$build_dir" || return - monitor "yarn-2-install" yarn install --immutable 2>&1 + if [ ! -z "$YARN2_FOCUS_WORKSPACE" ]; then + if has_yarn_workspace_plugin_installed "$build_dir"; then + echo "Running with focused workspace $YARN2_FOCUS_WORKSPACE" + # echo doo-dah to allow multiple focused workspaces eg build application + monitor "yarn-2-install" yarn workspaces focus $(echo $YARN2_FOCUS_WORKSPACE) 2>&1 + else + echo "No workspaces plugin detected!" + exit 1 + fi + else + monitor "yarn-2-install" yarn install --immutable 2>&1 + fi } yarn_prune_devdependencies() { @@ -172,6 +183,11 @@ yarn_prune_devdependencies() { meta_set "skipped-prune" "true" return 0 fi + if [ ! -z "$YARN2_FOCUS_WORKSPACE" ]; then + echo "Skipping pruning because workspace is focused already" + meta_set "skipped-prune" "true" + return 0 + fi cd "$build_dir" || return echo "Running 'yarn heroku prune'" export YARN_PLUGINS="${buildpack_dir}/yarn2-plugins/prune-dev-dependencies/bundles/@yarnpkg/plugin-prune-dev-dependencies.js"