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: migrate to yarn v3 #935

Merged
merged 8 commits into from
Mar 29, 2023
Merged

chore: migrate to yarn v3 #935

merged 8 commits into from
Mar 29, 2023

Conversation

dbjorge
Copy link
Contributor

@dbjorge dbjorge commented Mar 17, 2023

Details

This PR migrates the repo from Yarn v1 to Yarn v3 for dependency management. The main migration followed the steps in Yarn's migration guide for a non-zero-installs configuration, similar to the migrations in accessibility-insights-service and accessibility-insights-action.

Besides the required/mechanical steps, this PR also includes:

  • Updating the resolutions used by this repo to use versioned resolutions, similar to chore: clean up yarn resolutions using versioned specifiers accessibility-insights-action#1596
  • Modifying the test-resources generator setup to work as a run script from the root directory instead of using a separate package.json in src/test-resources/generator. This avoided what would have otherwise required a more complicated setup using either multiple checked in copies of yarn or a more complicated workspace setup, and slightly simplifies the steps for using the generator. I updated the README instructions accordingly.
    • The new !dist/test-resources entry in the files field of package.json ensures that there is no change to the package as-distributed because of this update.

As part of these changes, I verified manually that yarn generate-test-resources regenerates the current versions of the test resource files successfully.

Motivation
Context

Similar PRs in other repos:

Pull request checklist

  • PR title respects Conventional Commits (starts with fix:, feat:, etc, and is suitable for user-facing release notes)
  • PR contains no breaking changes, OR description of both PR and final merge commit starts with BREAKING CHANGE:
  • [n/a] (if applicable) Addresses issue: #0000
  • [n/a] Added relevant unit tests for your changes
  • Ran yarn precheckin
  • [n/a] Verified code coverage for the changes made

@dbjorge dbjorge requested a review from a team as a code owner March 17, 2023 20:00
dbjorge added a commit to microsoft/accessibility-insights-web that referenced this pull request Mar 22, 2023
#### Details

Migrates the repo's package manager from yarn v1 to yarn v3 (in
non-zero-installs configuration)

Some of this was mechanical based on [Yarn's migration
guide](https://yarnpkg.com/getting-started/migration). Beyond the steps
there, this PR:

* Updates assorted CI pipelines/workflows and dev docs to adapt to minor
syntax updates
* Updates CI workflow's caching strategy to use
`actions/setup-node@v3`'s built-in support for yarn berry friendly
caching instead of implementing our own with `actions/cache@v3`
* Updates license-check-and-add and prettier configs to exclude `.yarn/`
* Updates e2e `Dockerfile` to account for new changes
* Drops Lerna dependency in favor of plain Yarn workspaces, similar to
service and action

##### Motivation

* Simplifies some common dev commands. In particular, the command to
update report package snapshots changes from `yarn test:report:e2e -- --
-- -u` to just `yarn test:report:e2e -u`
* Consistency with other repos
* Allows for versioned resolutions (similar to
microsoft/accessibility-insights-action#1596) -
I left modifying existing resolutions out of scope since this PR was
already pretty large without them, will cover them in a different PR
* Removes a dependency (Lerna)

##### Context

Similar PRs in other repos:

* microsoft/accessibility-insights-service#2210
* microsoft/accessibility-insights-action#1559
* microsoft/accessibility-insights-action#1596
* microsoft/axe-sarif-converter#935
* https://github.com/microsoft/accessibility-insights-docs/pull/1577

#### Pull request checklist
<!-- If a checklist item is not applicable to this change, write "n/a"
in the checkbox -->
- [n/a] Addresses an existing issue: #0000
- [x] Ran `yarn fastpass`
- [n/a] Added/updated relevant unit test(s) (and ran `yarn test`)
- [n/a] Verified code coverage for the changes made. Check coverage
report at: `<rootDir>/test-results/unit/coverage`
- [x] PR title *AND* final merge commit title both start with a semantic
tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See
`CONTRIBUTING.md`.
- [n/a] (UI changes only) Added screenshots/GIFs to description above
- [n/a] (UI changes only) Verified usability with NVDA/JAWS
Copy link
Member

@waabid waabid left a comment

Choose a reason for hiding this comment

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

LGTM

@DaveTryon DaveTryon merged commit c84b061 into microsoft:main Mar 29, 2023
@ada-cat
Copy link
Collaborator

ada-cat commented Jun 5, 2023

🎉 This PR is included in version 2.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants