Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support $ in overrides instead of specific version #5703 #5704

Merged
merged 4 commits into from Nov 29, 2022

Conversation

ufec
Copy link
Contributor

@ufec ufec commented Nov 27, 2022

issue id: ##5703
success
is ok

@ufec ufec requested a review from zkochan as a code owner November 27, 2022 14:18
@welcome
Copy link

welcome bot commented Nov 27, 2022

💖 Thanks for opening this pull request! 💖
Please be patient and we will get back to you as soon as we can.

Copy link
Member

@zkochan zkochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be covered with a test.
And a changeset should be generated.

@ufec
Copy link
Contributor Author

ufec commented Nov 28, 2022

test('getOptionsFromRootManifest() Support $ in overrides by dependencies', () => {
  const options = getOptionsFromRootManifest({
    dependencies: {
      foo: '1.0.0',
    },
    pnpm: {
      overrides: {
        foo: '$foo',
      },
    },
  })
  expect(options.overrides).toStrictEqual({ foo: '1.0.0' })
})

test('getOptionsFromRootManifest() Support $ in overrides by devDependencies', () => {
  const options = getOptionsFromRootManifest({
    devDependencies: {
      foo: '1.0.0',
    },
    pnpm: {
      overrides: {
        foo: '$foo',
      },
    },
  })
  expect(options.overrides).toStrictEqual({ foo: '1.0.0' })
})

test('getOptionsFromRootManifest() Support $ in overrides by dependencies and devDependencies', () => {
  const options = getOptionsFromRootManifest({
    dependencies: {
      foo: '1.0.0',
    },
    devDependencies: {
      foo: '2.0.0',
    },
    pnpm: {
      overrides: {
        foo: '$foo',
      },
    },
  })
  expect(options.overrides).toStrictEqual({ foo: '1.0.0' })
})

test

@ufec
Copy link
Contributor Author

ufec commented Nov 28, 2022

@zkochan

@zkochan zkochan merged commit 4097af6 into pnpm:main Nov 29, 2022
@zkochan zkochan added this to the v7.18 milestone Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants