Skip to content

[build-utils] [tidy] extract checkIfAlreadyInstalled helper to clarify intent - #13060

Merged
erikareads merged 5 commits into
mainfrom
erikarowland/extract-check-if-already-installed-helper
Feb 18, 2025
Merged

erikareads merged 5 commits into
mainfrom
erikarowland/extract-check-if-already-installed-helper

Conversation

@erikareads

@erikareads erikareads commented Feb 13, 2025 •

Copy link
Copy Markdown
Contributor

Prior to this PR, we had logic in runNpmInstall that prevented duplicate installs based on the same packageJsonPath. The code was a nest of conditionals that made it difficult to follow what it was trying to accomplish.

This PR extracts the conditional logic into a couple helper functions, and refactors runNpmInstall to make it clear what's happening: we're returning early if a default install has already happened for a given packageJsonPath.

@changeset-bot

changeset-bot Bot commented Feb 13, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a8af01c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@vercel/build-utils Patch
vercel Patch
@vercel/client Patch
@vercel/gatsby-plugin-vercel-builder Patch
@vercel/node Patch
@vercel/static-build Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

onsclom
onsclom previously approved these changes Feb 13, 2025
onsclom
onsclom previously approved these changes Feb 13, 2025
@erikareads
erikareads enabled auto-merge February 13, 2025 21:43
@erikareads
erikareads added this pull request to the merge queue Feb 13, 2025
@erikareads
erikareads removed this pull request from the merge queue due to a manual request Feb 13, 2025
@erikareads
erikareads added this pull request to the merge queue Feb 13, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Feb 13, 2025
@erikareads
erikareads added this pull request to the merge queue Feb 18, 2025
@erikareads
erikareads removed this pull request from the merge queue due to a manual request Feb 18, 2025
@erikareads
erikareads added this pull request to the merge queue Feb 18, 2025
Merged via the queue into main with commit 00c622d Feb 18, 2025
@erikareads
erikareads deleted the erikarowland/extract-check-if-already-installed-helper branch February 18, 2025 16:47
onsclom pushed a commit that referenced this pull request Feb 21, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](#13072))

### Patch Changes

- Improve build log messages surrounding pnpm 10
([#13088](#13088))

- [build-utils] extract checkIfAlreadyInstalled helper to clarify intent
([#13060](#13060))

- Allow pnpm 10 to use package.json#packageManager without an engines
error ([#13083](#13083))

## [email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](#13072))

### Patch Changes

- [cli] bump `@vercel/fun` to v1.1.5
([#13070](#13070))

- Updated dependencies
\[[`adb1f80db1337f10c6310e3d05bbabb7bac3f05d`](adb1f80),
[`00c622d4497d37932d17571854c19bd2340d5c36`](00c622d),
[`ef75bcc0ef2400f4f704f500b09a0f20e1f0d0a0`](ef75bcc),
[`1b5c53642abca43ce6223f1f58d1586ee2fd87b1`](1b5c536)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](#13072))

### Patch Changes

- fix(cli): catch json parse
([#13071](#13071))

- Updated dependencies
\[[`adb1f80db1337f10c6310e3d05bbabb7bac3f05d`](adb1f80),
[`00c622d4497d37932d17571854c19bd2340d5c36`](00c622d),
[`ef75bcc0ef2400f4f704f500b09a0f20e1f0d0a0`](ef75bcc),
[`1b5c53642abca43ce6223f1f58d1586ee2fd87b1`](1b5c536)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](#13072))

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](#13072))

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](#13072))

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](#13072))

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](#13072))

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`adb1f80db1337f10c6310e3d05bbabb7bac3f05d`](adb1f80),
[`00c622d4497d37932d17571854c19bd2340d5c36`](00c622d),
[`ef75bcc0ef2400f4f704f500b09a0f20e1f0d0a0`](ef75bcc),
[`1b5c53642abca43ce6223f1f58d1586ee2fd87b1`](1b5c536)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`adb1f80db1337f10c6310e3d05bbabb7bac3f05d`](adb1f80),
[`00c622d4497d37932d17571854c19bd2340d5c36`](00c622d),
[`ef75bcc0ef2400f4f704f500b09a0f20e1f0d0a0`](ef75bcc),
[`1b5c53642abca43ce6223f1f58d1586ee2fd87b1`](1b5c536)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](vercel/vercel#13072))

### Patch Changes

- Improve build log messages surrounding pnpm 10
([#13088](vercel/vercel#13088))

- [build-utils] extract checkIfAlreadyInstalled helper to clarify intent
([#13060](vercel/vercel#13060))

- Allow pnpm 10 to use package.json#packageManager without an engines
error ([#13083](vercel/vercel#13083))

## [email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](vercel/vercel#13072))

### Patch Changes

- [cli] bump `@vercel/fun` to v1.1.5
([#13070](vercel/vercel#13070))

- Updated dependencies
\[[`2692de22d771704a7a48e6f812836d2f5cc19d58`](vercel/vercel@2692de2),
[`bf5662d7029a0c7e032da87db6a005fe3cbaa7a5`](vercel/vercel@bf5662d),
[`fef47933a5b215bc25fc2833960a0abc7e5acc96`](vercel/vercel@fef4793),
[`95d9553a726a068457d05e4d59fd7d045d0ba5f4`](vercel/vercel@95d9553)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](vercel/vercel#13072))

### Patch Changes

- fix(cli): catch json parse
([#13071](vercel/vercel#13071))

- Updated dependencies
\[[`2692de22d771704a7a48e6f812836d2f5cc19d58`](vercel/vercel@2692de2),
[`bf5662d7029a0c7e032da87db6a005fe3cbaa7a5`](vercel/vercel@bf5662d),
[`fef47933a5b215bc25fc2833960a0abc7e5acc96`](vercel/vercel@fef4793),
[`95d9553a726a068457d05e4d59fd7d045d0ba5f4`](vercel/vercel@95d9553)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](vercel/vercel#13072))

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](vercel/vercel#13072))

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](vercel/vercel#13072))

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](vercel/vercel#13072))

## @vercel/[email protected]

### Minor Changes

- Detect v9 pnpm lock files as pnpm 10 for new projects
([#13072](vercel/vercel#13072))

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`2692de22d771704a7a48e6f812836d2f5cc19d58`](vercel/vercel@2692de2),
[`bf5662d7029a0c7e032da87db6a005fe3cbaa7a5`](vercel/vercel@bf5662d),
[`fef47933a5b215bc25fc2833960a0abc7e5acc96`](vercel/vercel@fef4793),
[`95d9553a726a068457d05e4d59fd7d045d0ba5f4`](vercel/vercel@95d9553)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`2692de22d771704a7a48e6f812836d2f5cc19d58`](vercel/vercel@2692de2),
[`bf5662d7029a0c7e032da87db6a005fe3cbaa7a5`](vercel/vercel@bf5662d),
[`fef47933a5b215bc25fc2833960a0abc7e5acc96`](vercel/vercel@fef4793),
[`95d9553a726a068457d05e4d59fd7d045d0ba5f4`](vercel/vercel@95d9553)]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview — a8af01c1 Deployed Feb 13, 2025 by vercel[bot]
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.

2 participants