From c6fc4e82cee9d15364284cfd3ec41cb9cee09cb2 Mon Sep 17 00:00:00 2001 From: Sander Verweij Date: Thu, 7 Nov 2019 11:39:42 +0100 Subject: [PATCH] make running with Plug'n Play possible on node 13 (#7650) * ci(circleci): prevent timeout on circle-ci macos node10 build The circle ci job for macOS on node 10 currently fails because it takes too long (both PR's #7649 and #7650 don't green because of that). A big chunk of the time is taken by updating homebrew - which in this macOS (the one connected to xcode 9 => macOS 10.12) does not contain node 10 by default. This change: - sets the required xcode version to 11.0 -> this gets us a more up to date macOS version (except for node 6, which isn't available in the homebrew associated with xcode 11) - removes the brew update from the macOS node 10 job * fix(generate-pnp-map-api.tpl.js): make running with Plug'n Play possible on node 13 On node 13 Module._findPath (which the setup() of this module redefines) also gets called with null for the path parameter (by lib/internal/bootstrap/pre_execution.js in the (new) function resolveMainPath). This fix ensures the patched _findPath also handles that situation. * ci(azure-pipelines): add node 13 (and 12) to the azure-pipeline matrix #7642 * ci(circleci): add node 13 (and 12) to the build matrix (linux) * docs(CHANGELOG.md): adds PR #7650 to the change log --- .circleci/config.yml | 42 ++++++++++++++++++++++++++++ CHANGELOG.md | 5 ++++ azure-pipelines.yml | 12 ++++++++ src/util/generate-pnp-map-api.tpl.js | 2 +- 4 files changed, 60 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f2d881eff..73cd559039 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -122,6 +122,16 @@ jobs: root: ~/project paths: - yarn + test-pkg-tests-linux-node13: + <<: *docker_defaults + docker: + - image: node:13 + <<: *pkg_tests + test-pkg-tests-linux-node12: + <<: *docker_defaults + docker: + - image: node:12 + <<: *pkg_tests test-pkg-tests-linux-node10: <<: *docker_defaults docker: @@ -130,8 +140,20 @@ jobs: test-pkg-tests-linux-node8: <<: *docker_defaults <<: *pkg_tests + test-linux-node13: + <<: *docker_defaults + docker: + - image: node:13 + <<: *test_steps + test-linux-node12: + <<: *docker_defaults + docker: + - image: node:12 + <<: *test_steps test-linux-node10: <<: *docker_defaults + docker: + - image: node:10 <<: *test_steps test-linux-node8: <<: *docker_defaults @@ -249,6 +271,14 @@ workflows: filters: *default_filters requires: - install + - test-pkg-tests-linux-node13: + filters: *default_filters + requires: + - install + - test-pkg-tests-linux-node12: + filters: *default_filters + requires: + - install - test-pkg-tests-linux-node10: filters: *default_filters requires: @@ -257,6 +287,14 @@ workflows: filters: *default_filters requires: - install + - test-linux-node13: + filters: *default_filters + requires: + - install + - test-linux-node12: + filters: *default_filters + requires: + - install - test-linux-node10: filters: *default_filters requires: @@ -295,8 +333,12 @@ workflows: branches: ignore: /.*/ requires: + - test-pkg-tests-linux-node13 + - test-pkg-tests-linux-node12 - test-pkg-tests-linux-node10 - test-pkg-tests-linux-node8 + - test-linux-node13 + - test-linux-node12 - test-linux-node10 - test-linux-node8 - test-linux-node6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d4f72db86..d287c78698 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,15 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa ## Master +- Makes running scripts with Plug'n Play possible on node 13 + + [#7650](https://github.com/yarnpkg/yarn/pull/7650) - [**Sander Verweij**](https://github.com/sverweij) + - Change run command to check cwd/node_modules/.bin for commands. Fixes run in workspaces. [#7151](https://github.com/yarnpkg/yarn/pull/7151) - [**Jeff Valore**](https://twitter.com/codingwithspike) + ## 1.19.1 **Important:** This release contains a cache bump. It will cause the very first install following the upgrade to take slightly more time, especially if you don't use the [Offline Mirror](https://yarnpkg.com/blog/2016/11/24/offline-mirror/) feature. After that everything will be back to normal. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c7b5e0e000..01d9333f35 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,6 +13,10 @@ jobs: # node_version: 8.x node_10_x: node_version: 10.x + node_12_x: + node_version: 12.x + node_13_x: + node_version: 13.x steps: - template: scripts/azure-run-tests.yml @@ -30,6 +34,10 @@ jobs: node_version: 8.x node_10_x: node_version: 10.x + node_12_x: + node_version: 12.x + node_13_x: + node_version: 13.x steps: - template: scripts/azure-run-tests.yml @@ -47,6 +55,10 @@ jobs: node_version: 8.x node_10_x: node_version: 10.x + node_12_x: + node_version: 12.x + node_13_x: + node_version: 13.x steps: - template: scripts/azure-run-tests.yml diff --git a/src/util/generate-pnp-map-api.tpl.js b/src/util/generate-pnp-map-api.tpl.js index 835b6f85f1..c44db3605a 100644 --- a/src/util/generate-pnp-map-api.tpl.js +++ b/src/util/generate-pnp-map-api.tpl.js @@ -714,7 +714,7 @@ exports.setup = function setup() { return originalFindPath.call(Module, request, paths, isMain); } - for (const path of paths) { + for (const path of paths || []) { let resolution; try {