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

chore(infra): migrate to pnpm #428

Merged
merged 25 commits into from May 14, 2024
Merged

chore(infra): migrate to pnpm #428

merged 25 commits into from May 14, 2024

Conversation

sean-perkins
Copy link
Collaborator

@sean-perkins sean-perkins commented Apr 19, 2024

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally for affected output targets
  • Tests (npm test) were run locally and passed
  • Prettier (npm run prettier) was run locally and passed

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

With the dependency on @lit/react that adds a peer dependency for @types/react, the workspace has a type resolution issue when trying to reconcile the version of @types/react in the example react project.

What is the new behavior?

Infrastructure

Angular Output Target

  • Updated project dependencies
  • Updated test infrastructure to run locally with updated dependencies

Vue Output Target

  • Updated project dependencies

Does this introduce a breaking change?

  • Yes
  • No

Other information

This PR is required to unblock #432.

renovate bot and others added 4 commits April 4, 2024 18:27
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
Updates many outdated dependencies and configurations.
@sean-perkins sean-perkins changed the title Sp/pnpm do not review - Sp/pnpm Apr 19, 2024
@sean-perkins sean-perkins changed the title do not review - Sp/pnpm feat(react-output-target): generate functional components and ES modules Apr 23, 2024
@sean-perkins sean-perkins changed the base branch from main to next April 23, 2024 18:51
@sean-perkins sean-perkins changed the base branch from next to sp/react-output-target April 30, 2024 17:23
@sean-perkins sean-perkins changed the title feat(react-output-target): generate functional components and ES modules chore(infra): migrate to pnpm Apr 30, 2024
@sean-perkins sean-perkins marked this pull request as ready for review May 2, 2024 15:05
@sean-perkins sean-perkins requested review from a team as code owners May 2, 2024 15:05
@sean-perkins sean-perkins requested review from rwaskiewicz, alicewriteswrongs and thetaPC and removed request for a team May 2, 2024 15:05
Copy link
Member

@tanner-reits tanner-reits left a comment

Choose a reason for hiding this comment

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

LGTM overall! Ran into one issue testing that's an easy fix.

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Copy link
Member

@tanner-reits tanner-reits left a comment

Choose a reason for hiding this comment

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

Woops. Meant to request changes for that little fix, my b

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

Two non blocking nits, overall LGTM 👍

packages/angular-output-target/tsconfig.json Outdated Show resolved Hide resolved
packages/vue-output-target/tsconfig.json Outdated Show resolved Hide resolved
Copy link

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

LGTM

@rwaskiewicz
Copy link
Member

Taking a look now 👀

@rwaskiewicz rwaskiewicz self-assigned this May 3, 2024
- name: Install Dependencies
run: npx lerna bootstrap --include-dependencies --scope ${{ inputs.scope }} --ignore-scripts -- --legacy-peer-deps
run: pnpm --filter ${{ inputs.scope }} install
shell: bash
working-directory: ${{ inputs.working-directory }}
- name: Update Version
run: npx lerna version ${{ inputs.version }} --yes --exact --no-changelog --no-git-tag-version --preid=${{ inputs.preid }}
Copy link
Member

Choose a reason for hiding this comment

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

For my own understanding, is there a reason that we don't use pnpm version here?

I'm not super well versed in pnpm, so my understanding here might be off - IIUC, pnpm itself doesn't have a version command of its own, but does fall back to npm in some cases. If that's the case, I'm guessing there's a reason we use lerna to bump the version here instead of npm (but I can't remember for the life of me what it is).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Personally I have not used pnpm version or was aware if it versions similar to lerna or falls back to it. If the team is interested in that, that is something that could continued to be investigated in further work. To leave as much of the infrastructure in place I would say keeping lerna provides confidence that versioning and the dev & prod release workflows continue to operate as they do today (and similar to other projects the team maintains, i.e.: Ionic Framework).

Copy link
Member

Choose a reason for hiding this comment

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

That's fine - I was just trying to understand what lerna did/brought to the table here. Unfortunately, I think the pnpm/lerna knowledge gap is one the Framework + Stencil teams will have to bridge (moreso the Stencil team with respect to lerna, as that team doesn't use lerna in any of its projects) - with that in mind, I was trying (and I suppose my goal still is) to get a baseline for why we do certain things the way we do today, since figuring them out after some period of time is often more trying in my experience 😉

.github/workflows/ci.yml Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
"test": "jest",
"tsc": "tsc -p .",
"validate": "npm i && npm run lint && npm run test && npm run build"
"validate": "pnpm i && pnpm run lint && pnpm run test && pnpm run build"
Copy link
Member

Choose a reason for hiding this comment

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

This may fall in line with "we don't need this" (similar to some of my prev comments), but it might be good to explictly put --frozen-lockfile for if/when folks run this locally:

Suggested change
"validate": "pnpm i && pnpm run lint && pnpm run test && pnpm run build"
"validate": "pnpm i --frozen-lockfile && pnpm run lint && pnpm run test && pnpm run build"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe we can mark this as resolved too based on the outcome of: #428 (comment).

pnpm is discouraging explicit usage of the --frozen-lockfile CLI argument.

Copy link
Member

Choose a reason for hiding this comment

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

sounds good to me!

package.json Outdated Show resolved Hide resolved
@@ -1,4 +1,4 @@
import pkg from './package.json';
import pkg from './package.json' assert { type: 'json' };
Copy link
Member

Choose a reason for hiding this comment

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

Can we use with here? assert is deprecated per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules

Copy link
Member

Choose a reason for hiding this comment

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

This would require Node.js v20.10 which requires us to update the Node version in package.json

@christian-bromann
Copy link
Member

It seems like we mostly have consensus to move forward with this. There are 3 remaining comments that we might want to address:

I don't have any strong preferences for the first two issues. In regards to the Volta comment I suggest to merge @rwaskiewicz suggestion noting that Volta support for PNPM is experimental and if you don't use it, be advised to have the right Node.js version installed.

Thoughts @rwaskiewicz @sean-perkins ?

@rwaskiewicz
Copy link
Member

Agreed with respect to Volta support - although we'll have to revisit our usage of https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#node-version-file in GH Actions if we remove it

Copy link
Member

@alicewriteswrongs alicewriteswrongs left a comment

Choose a reason for hiding this comment

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

👍
:shipit:
🚢 - 🇮🇹

@rwaskiewicz rwaskiewicz removed their assignment May 14, 2024
@sean-perkins sean-perkins merged commit 3579f6d into sp/react-output-target May 14, 2024
5 checks passed
@sean-perkins sean-perkins deleted the sp/pnpm branch May 14, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants