Skip to content

Commit

Permalink
Remove setPnpmResolutionMode as default is highest (#57828)
Browse files Browse the repository at this point in the history
The linked documentation mentions that `highest` is the default in the
pnpm version we use:

> Default: highest (was lowest-direct from v8.0.0 to v8.6.12)

https://pnpm.io/npmrc#resolution-mode


<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: Zack Tanner <[email protected]>
  • Loading branch information
timneutkens and ztanner authored Nov 4, 2023
1 parent 758c47f commit b9baf48
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 46 deletions.
5 changes: 2 additions & 3 deletions test/development/basic/emotion-swc/emotion-swc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ createNextDescribe(
{
files: join(__dirname, 'fixture'),
dependencies: {
'@emotion/cache': '^10.0.29',
'@emotion/core': '^10.0.35',
'@emotion/styled': '^10.0.27',
'@emotion/react': '11.10.4',
'@emotion/styled': '11.10.4',
},
},
({ next }) => {
Expand Down
2 changes: 1 addition & 1 deletion test/development/basic/emotion-swc/fixture/jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"compilerOptions": {
"jsxImportSource": "@emotion/core"
"jsxImportSource": "@emotion/react"
}
}
2 changes: 1 addition & 1 deletion test/development/basic/emotion-swc/fixture/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import createCache from '@emotion/cache'
import { CacheProvider } from '@emotion/core'
import { CacheProvider } from '@emotion/react'

import { globalStyles } from '../shared/styles'

Expand Down
2 changes: 1 addition & 1 deletion test/development/basic/emotion-swc/fixture/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from '@emotion/core'
import { css } from '@emotion/react'
import {
Animated,
Basic,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css, Global, keyframes } from '@emotion/core'
import { css, Global, keyframes } from '@emotion/react'
import styled from '@emotion/styled'

export const globalStyles = (
Expand Down
23 changes: 0 additions & 23 deletions test/lib/create-next-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,6 @@ const { randomBytes } = require('crypto')
const { linkPackages } =
require('../../.github/actions/next-stats-action/src/prepare/repo-setup')()

/**
* Sets the `resolution-mode` for pnpm in the specified directory.
*
* See [pnpm/.npmrc#resolution-mode]{@link https://pnpm.io/npmrc#resolution-mode} and
* [GitHub Issue]{@link https://github.com/pnpm/pnpm/issues/6463}
*
* @param {string} cwd - The project directory where pnpm configuration is set.
* @returns {Promise<void>}
*/
function setPnpmResolutionMode(cwd) {
return execa(
'pnpm',
['config', 'set', '--location=project', 'resolution-mode', 'highest'],
{
cwd: cwd,
stdio: ['ignore', 'inherit', 'inherit'],
env: process.env,
}
)
}

async function createNextInstall({
parentSpan = null,
dependencies = null,
Expand Down Expand Up @@ -149,7 +128,6 @@ async function createNextInstall({
2
)
)
await setPnpmResolutionMode(installDir)

if (installCommand) {
const installString =
Expand Down Expand Up @@ -202,7 +180,6 @@ async function createNextInstall({
}

module.exports = {
setPnpmResolutionMode,
createNextInstall,
getPkgPaths: linkPackages,
}
6 changes: 1 addition & 5 deletions test/lib/next-modes/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import treeKill from 'tree-kill'
import type { NextConfig } from 'next'
import { FileRef } from '../e2e-utils'
import { ChildProcess } from 'child_process'
import {
createNextInstall,
setPnpmResolutionMode,
} from '../create-next-install'
import { createNextInstall } from '../create-next-install'
import { Span } from 'next/src/trace'
import webdriver from '../next-webdriver'
import { renderViaHTTP, fetchViaHTTP } from 'next-test-utils'
Expand Down Expand Up @@ -187,7 +184,6 @@ export class NextInstance {
2
)
)
await setPnpmResolutionMode(this.testDir)
} else {
if (
process.env.NEXT_TEST_STARTER &&
Expand Down
22 changes: 11 additions & 11 deletions test/production/eslint-plugin-deps/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,24 @@ describe('eslint plugin deps', () => {
},
dependencies: {
// Manually installed @typescript-eslint/eslint-plugin, expect to be deduped
'@typescript-eslint/eslint-plugin': '^5.16.0',
'@typescript-eslint/parser': '^5.16.0',
'eslint-config-prettier': '^8.5.0',
'eslint-plugin-import': '^2.25.4',
'eslint-plugin-react': '^7.29.4',
'@types/node': '17.0.23',
'@types/react': '17.0.43',
'@types/react-dom': '17.0.14',
eslint: '^8.12.0',
'eslint-config-next': '^12.1.1',
'@typescript-eslint/eslint-plugin': 'latest',
'@typescript-eslint/parser': 'latest',
'eslint-config-prettier': 'latest',
'eslint-plugin-import': 'latest',
'eslint-plugin-react': 'latest',
'@types/node': 'latest',
'@types/react': 'latest',
'@types/react-dom': 'latest',
eslint: 'latest',
'eslint-config-next': 'latest',
typescript: 'latest',
},
packageJson: {
scripts: {
build: 'next build --no-lint && next lint',
},
},
buildCommand: 'yarn build',
buildCommand: 'pnpm build',
})
})
afterAll(() => next.destroy())
Expand Down

0 comments on commit b9baf48

Please sign in to comment.