Skip to content

Commit

Permalink
ci: fix PnP e2e tests using Webpack 5 (#24216)
Browse files Browse the repository at this point in the history
Fixes the e2e PnP tests by updating `enhanced-resolve` to get the fix in webpack/enhanced-resolve#289, the tests started failing in #23810

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
  • Loading branch information
merceyz authored Apr 19, 2021
1 parent 0bcc694 commit d24a0c1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
8 changes: 5 additions & 3 deletions packages/next/bundles/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ electron-to-chromium@^1.3.634:
integrity sha512-OfzVPIqD1MkJ7fX+yTl2nKyOE4FReeVfMCzzxQS+Kp43hZYwHwThlGP+EGIZRXJsxCM7dqo8Y65NOX/HP12iXQ==

enhanced-resolve@^5.7.0:
version "5.7.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz#525c5d856680fbd5052de453ac83e32049958b5c"
integrity sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw==
version "5.8.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz#d9deae58f9d3773b6a111a5a46831da5be5c9ac0"
integrity sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==
dependencies:
graceful-fs "^4.2.4"
tapable "^2.2.0"
Expand Down Expand Up @@ -379,6 +379,7 @@ safe-buffer@^5.1.0:
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==

"schema-utils3@npm:schema-utils@3.0.0", schema-utils@^3.0.0:
name schema-utils3
version "3.0.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.0.0.tgz#67502f6aa2b66a2d4032b4279a2944978a0913ef"
integrity sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==
Expand Down Expand Up @@ -466,6 +467,7 @@ watchpack@^2.0.0:
graceful-fs "^4.1.2"

"webpack-sources2@npm:webpack-sources@2.2.0", webpack-sources@^2.1.1:
name webpack-sources2
version "2.2.0"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.2.0.tgz#058926f39e3d443193b6c31547229806ffd02bac"
integrity sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==
Expand Down
21 changes: 17 additions & 4 deletions packages/next/compiled/webpack/bundle5.js
Original file line number Diff line number Diff line change
Expand Up @@ -18044,7 +18044,12 @@ function createOptions(options) {
descriptionFiles: Array.from(
new Set(options.descriptionFiles || ["package.json"])
),
enforceExtension: options.enforceExtension || false,
enforceExtension:
options.enforceExtension === undefined
? options.extensions && options.extensions.includes("")
? true
: false
: options.enforceExtension,
extensions: new Set(options.extensions || [".js", ".json", ".node"]),
fileSystem: options.useSyncFileSystemCalls
? new SyncAsyncFileSystemDecorator(
Expand Down Expand Up @@ -18253,13 +18258,21 @@ exports.createResolver = function (options) {
});
modules.forEach(item => {
if (Array.isArray(item)) {
plugins.push(
new ModulesInHierachicDirectoriesPlugin("raw-module", item, "module")
);
if (item.includes("node_modules") && pnpApi) {
plugins.push(
new ModulesInHierachicDirectoriesPlugin(
"raw-module",
item.filter(i => i !== "node_modules"),
"module"
)
);
plugins.push(
new PnpPlugin("raw-module", pnpApi, "undescribed-resolve-in-package")
);
} else {
plugins.push(
new ModulesInHierachicDirectoriesPlugin("raw-module", item, "module")
);
}
} else {
plugins.push(new ModulesInRootPlugin("raw-module", item, "module"));
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6628,9 +6628,9 @@ enhanced-resolve@^4.3.0:
tapable "^1.0.0"

enhanced-resolve@^5.7.0:
version "5.7.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz#525c5d856680fbd5052de453ac83e32049958b5c"
integrity sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw==
version "5.8.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz#d9deae58f9d3773b6a111a5a46831da5be5c9ac0"
integrity sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==
dependencies:
graceful-fs "^4.2.4"
tapable "^2.2.0"
Expand Down

0 comments on commit d24a0c1

Please sign in to comment.