Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

web: migrate from yarn to pnpm #46143

Merged
merged 56 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
05cace5
web: move global styles to `wildcard`
valerybugakov Dec 23, 2022
fd0b552
web: fix incorrect import path
valerybugakov Dec 23, 2022
ecd7a2b
Merge branch 'main' into vb/move-global-styles-to-wildcard
valerybugakov Dec 26, 2022
c182a5e
web: move global styles to `wildcard`
valerybugakov Dec 26, 2022
04a46f7
web: test pnpm
valerybugakov Dec 26, 2022
fd4d746
chore: migrate yarn command to pnpm
gitstart-sourcegraph Jan 4, 2023
1a35d26
Merge commit '2b0f6a5be8dda4dfc9686016bd67d60dc92a4816' of https://gi…
gitstart-sourcegraph Jan 4, 2023
28d2cbf
chore: revert some changes + fix some CI check failing
gitstart-sourcegraph Jan 4, 2023
abdee47
[SG-45970] Add client packages to workspaces dependencies (#45981)
gitstart-sourcegraph Jan 4, 2023
0809096
chore: revert some redundant changes
gitstart-sourcegraph Jan 4, 2023
0541f28
chore: resolve conflicts
gitstart-sourcegraph Jan 4, 2023
5c7960d
fix: build-ts
gitstart-sourcegraph Jan 4, 2023
5fbbf04
fix: pnpm-install-with-retry.sh
gitstart-sourcegraph Jan 4, 2023
62b57be
fix: esbuild
gitstart-sourcegraph Jan 4, 2023
8903355
chore: update yarn usages in github action
gitstart-sourcegraph Jan 5, 2023
e6ee064
web: use the realpath for build config paths to support symlinks in w…
valerybugakov Jan 5, 2023
5f56591
web: drop `yarn` related folders and configs
valerybugakov Jan 5, 2023
83af6fe
web: update ignore files
valerybugakov Jan 5, 2023
854ee1b
web: remove redundant pnpm usages
valerybugakov Jan 5, 2023
b01db04
[SG-45990] Migrate all the remaining yarn commands to pnpm (#46008)
gitstart-sourcegraph Jan 6, 2023
f459652
Merge branch 'vb/pnpm-test-2' into vb/pnpm-test-3
valerybugakov Jan 6, 2023
da1faeb
web: drop redundant dependencies
valerybugakov Jan 6, 2023
66a72c5
web: prettier
valerybugakov Jan 6, 2023
9ccfd0f
web: update Bazel workspace
valerybugakov Jan 6, 2023
ffbfc97
web: replace yarn
valerybugakov Jan 6, 2023
a226d50
web: replace yarn
valerybugakov Jan 6, 2023
a4da558
web: update `scip-typescript` to use `--pnpm-workspaces`
valerybugakov Jan 6, 2023
78db32e
web: trigger the `scip-typescript` job
valerybugakov Jan 6, 2023
93cbc20
web: update `dependency_decisions.yml`
valerybugakov Jan 9, 2023
eac5244
Merge branch 'main' into vb/pnpm-test-3
valerybugakov Jan 9, 2023
d9c324c
Revert "chore: revert some changes + fix some CI check failing"
valerybugakov Jan 9, 2023
ef6ac8e
Revert "chore: revert some redundant changes"
valerybugakov Jan 9, 2023
3adae89
revert redundant changes
valerybugakov Jan 9, 2023
74d7d7d
web: update `dependency_decisions.yml`
valerybugakov Jan 9, 2023
b1fcdff
web: fix TS build
valerybugakov Jan 9, 2023
e519abf
Merge branch 'main' into vb/pnpm-test-3
valerybugakov Jan 9, 2023
d5f0558
web: update `pnpm-lock.yaml`
valerybugakov Jan 9, 2023
e4fbcd5
vscode: migrate scripts to pnpm (#46194)
valerybugakov Jan 10, 2023
316d16b
Merge branch 'main' into vb/pnpm-test-3
valerybugakov Jan 10, 2023
861a2f3
web: more `yarn` —> `pnpm`
valerybugakov Jan 10, 2023
c18a855
web: disable hoisting
valerybugakov Jan 10, 2023
9035e7e
web: add missing dependencies
valerybugakov Jan 10, 2023
426357e
web: add missing dependencies
valerybugakov Jan 10, 2023
68afdda
web: pnpm deduplicate
valerybugakov Jan 10, 2023
6df89e9
web: update `web` fallbacks
valerybugakov Jan 10, 2023
d8de304
web: fix storybook build
valerybugakov Jan 10, 2023
aad643c
web: fix eslint
valerybugakov Jan 10, 2023
63478f5
Merge branch 'main' into vb/pnpm-test-3
valerybugakov Jan 11, 2023
5463031
web: update pnpm
valerybugakov Jan 11, 2023
b72f3d2
web: fix wildcard import
valerybugakov Jan 11, 2023
a926ca1
web: remove redundant import
valerybugakov Jan 11, 2023
22f60cf
web: add `--frozen-lockfile` to `pnpm install` calls on CI
valerybugakov Jan 11, 2023
0ef3809
web: drop the `--ignore-engines` flag
valerybugakov Jan 12, 2023
6845ab7
web: remove redundant comment
valerybugakov Jan 12, 2023
ac7d314
web: update jest `transformIgnorePatterns`
valerybugakov Jan 12, 2023
a765b31
Merge branch 'main' into vb/pnpm-test-3
valerybugakov Jan 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is used in our production build to adjust CSS and JS output to support specified browsers. For additional information regarding the format and rule options, please see: https://github.com/browserslist/browserslist#queries

# Run `yarn browserslist` to see which browsers are targeted by these queries
# Run `pnpm browserslist` to see which browsers are targeted by these queries

### Primary browsers ###
# Target browsers with the highest usage.
Expand Down
10 changes: 5 additions & 5 deletions .buildkite/pipeline.async.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ env:

steps:
- command:
- COVERAGE_INSTRUMENT=true dev/ci/yarn-run.sh storybook:build
- yarn run cover-storybook
- yarn nyc report -r json
- COVERAGE_INSTRUMENT=true dev/ci/pnpm-run.sh storybook:build
- pnpm cover-storybook
- pnpm nyc report -r json
- bash <(curl -s https://codecov.io/bash) -c -F typescript -F storybook
label: ':storybook::codecov: Storybook coverage'
- command:
- dev/ci/yarn-build.sh client/web
- yarn lhci autorun
- dev/ci/pnpm-build.sh client/web
- pnpm lhci autorun
label: ':lighthouse: Lighthouse'
retry:
automatic:
Expand Down
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ grapher/ruby/rubysonar/target
grapher/ruby/rubysonar/dependency-reduced-pom.xml
grapher/ruby/yard/.bundle
npm-debug.log
yarn-error.log
pnpm-error.log
pnpm-debug.log
.codemod.bookmark
.elasticbeanstalk/

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/request_patch_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ I have read [when and why we perform patch releases](https://handbook.sourcegrap
- [ ] Change `previousRelease` to the previous patch release version
- [ ] Change `releaseDate` to the current date (time is optional) along with `oneWorkingDayAfterRelease` and `threeWorkingDaysBeforeRelease`
- [ ] Change `captainSlackUsername` and `captainGitHubUsername` to the patch captain's
- [ ] Run `yarn release tracking:issues` on `main`
- [ ] Run `pnpm release tracking:issues` on `main`
- [ ] Add the listed commits alongside a link to this issue to the generated [release tracking issue](https://github.com/sourcegraph/sourcegraph/issues?q=is%3Aissue+label%3Arelease-tracking+)
- [ ] **Comment and close this issue once the relevant commit(s) have been cherry-picked into the release branch**.

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/licenses-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 7.24.2
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid hard coding the version in the github workflow, I've used this action before. Maybe we can reuse it here?

      # The pnpm GitHub action does not support reading the version from
      # .tool-versions yet so we have to be creative.
      - name: Read .tool-versions
        uses: marocchino/tool-versions-action@v1
        id: versions

      - name: Setup pnpm
        uses: pnpm/action-setup@v2
        with:
          version: ${{ steps.versions.outputs.pnpm}}

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice find, I love that. Let's do it in a follow-up PR!

Copy link
Member

Choose a reason for hiding this comment

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

oh nice, that's awesome!

run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.3' # Not needed with a .ruby-version file - uses: actions/setup-ruby@v1
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/licenses-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ jobs:
- name: Install asdf plugins
uses: asdf-vm/actions/install@v1

# we use classic yarn to install the new version of yarn
- name: ensure the correct version of yarn
run: yarn
- name: Install npm dependencies
run: pnpm install --frozen-lockfile

- name: Install license_finder
run: gem install license_finder:7.1.0 # sync with licenses-check.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lighthouse-production.yml-disabled
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with: { node-version: '${{ steps.nvmrc.outputs.NODE_VERSION }}' }

- name: Install dependencies
run: yarn --ignore-engines --ignore-scripts
run: pnpm --ignore-scripts

- name: Run Lighthouse
run: |
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/scip-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 7.24.2
valerybugakov marked this conversation as resolved.
Show resolved Hide resolved
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install npm dependencies
run: yarn
- run: yarn generate
- run: yarn dlx -p @sourcegraph/scip-typescript scip-typescript index --yarn-berry-workspaces
run: pnpm install --frozen-lockfile
- run: pnpm generate
- run: pnpm dlx @sourcegraph/scip-typescript index --pnpm-workspaces
- run: cp index.scip dump.lsif-typed
- name: Install src-cli
run: |
Expand Down
12 changes: 2 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ grapher/ruby/rubysonar/target
grapher/ruby/rubysonar/dependency-reduced-pom.xml
grapher/ruby/yard/.bundle
npm-debug.log
yarn-error.log
pnpm-error.log
pnpm-debug.log
.codemod.bookmark
.elasticbeanstalk/

Expand Down Expand Up @@ -181,14 +182,5 @@ go.work.sum
# binary
/sg

# New Yarn without using Zero-Installs (https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored)
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# SCIP
index.scip
12 changes: 12 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
# rules_js lays out under Bazel (without a hidden node_modules/.pnpm/node_modules)
hoist=false

# We have to hoist storybook packages because storybok@6 is incompatible with pnpm and relies on
# package hoisting for internal imports. We cannot migrate to storybook@7 because it's currently
# in beta and multiple addons that we use are not yet compatible with the beta version.
# The storybook@7 is fully compatible with pnpm, and once addons are updated, we can upgrade
# and remove these hoist patterns. For more context, see:
# https://github.com/storybookjs/storybook/issues/13428#issuecomment-1368062647
public-hoist-pattern[]=*storybook*
public-hoist-pattern[]=global

# We have to hoist eslint packages to use them in the `.eslintrc` config.
public-hoist-pattern[]=*eslint*
Comment on lines +15 to +16
Copy link
Member Author

Choose a reason for hiding this comment

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

This is only required when Storybook packages are hoisted. We can remove both patterns after upgrading Storybook to v7.


# npm_translate_lock with the yarn.lock file will complain about missing/incorrect peer dependencies.
# Temporarily ignore warnings until we switch to pnpm and can user pnpm.packageExtensions to fix them.
# https://pnpm.io/package_json#pnpmpackageextensions
Expand Down
5 changes: 1 addition & 4 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
golang 1.19.3
nodejs 16.18.1
# We install classic yarn with asdf, and then use yarn itself to upgrade to 3.2.3
# This is done because there is a problem fetching yarn via asdf, instead the version is
# specified in .yarnrc via the yarnPath.
yarn 1.22.19
fd 7.4.0
shfmt 3.5.0
shellcheck 0.7.1
Expand All @@ -16,3 +12,4 @@ awscli 2.4.7
python system
rust 1.62.0
ruby 3.1.3
pnpm 7.24.2
valerybugakov marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
"build.allowImplicitNetworkAccess": true,
"local": "github.com/sourcegraph/sourcegraph"
},
"jest.jestCommandLine": "yarn test",
"jest.jestCommandLine": "pnpm test",
"jest.showCoverageOnLoad": false,
"gulp.autoDetect": "off",
"npm.packageManager": "yarn",
"npm.packageManager": "pnpm",
"npm.runSilent": true,
"typescript.preferences.quoteStyle": "single",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.format.semicolons": "remove",
"typescript.tsc.autoDetect": "off",
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.packageManager": "yarn",
"eslint.packageManager": "pnpm",
"eslint.lintTask.enable": false,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"editor.codeActionsOnSave": {},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
{
"label": "stylelint",
"command": "yarn",
"command": "pnpm",
"args": ["run", "lint:css:all", "--", "--formatter", "compact"],
"problemMatcher": {
"owner": "stylelint",
Expand Down
Loading