Skip to content

Commit

Permalink
Pnpm migration (#4566)
Browse files Browse the repository at this point in the history
* Transpiling parser pkg

* Move from yarn to pnpm package manager

* React packages version fixed

* Github actions and docs migration

* Moved the setup-pnpm action to use the commit id instead of version

* Synced the lock file

* Build failure fixed

* Fixed missing dependencies

* Type check and lint errors fixed

* Changed the workflow order to run typecheck before lint as that shows more useful errors earlier

* Storybook build fixed

* Use version from env vars

Co-authored-by: Maxime Brunet <max@brnt.mx>

* Updated github workflows to use pnpm version from env vars

* Lockfile synced

---------

Co-authored-by: Maxime Brunet <max@brnt.mx>
  • Loading branch information
manojVivek and maxbrunet authored May 1, 2024
1 parent 28b15f3 commit e1be2a7
Show file tree
Hide file tree
Showing 41 changed files with 26,840 additions and 25,479 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/pkg/symbolizer @parca-dev/agent-maintainers

package.json
yarn.lock
pnpm-lock.yaml
/go.mod
/go.sum
Dockerfile*
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ env:
QEMU_VERSION: 7.0.0-7
# renovate: datasource=docker depName=docker.io/buildpack-deps versioning=ubuntu
BUILDPACK_DEPS_VERSION: '22.04'
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

jobs:
build-and-test-multi-arch:
Expand Down Expand Up @@ -61,13 +63,17 @@ jobs:
with:
go-version-file: .go-version

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
if: ${{ steps.skip-check.outputs.should_skip != 'true' && matrix.arch == 'amd64' }}
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Build
if: ${{ steps.skip-check.outputs.should_skip != 'true' && matrix.arch == 'amd64' }}
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

# List of jobs
jobs:
skip-check:
Expand Down Expand Up @@ -57,13 +61,17 @@ jobs:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0 # Required to retrieve git history
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}
- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml
- name: Install dependencies and build app
run: yarn install --frozen-lockfile --prefer-offline && yarn build
run: pnpm install --frozen-lockfile --prefer-offline && pnpm run build
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@3dcb6636a4f8eed347ef6214f5d74d2b5fee45e4 # v11.3.0
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/codeql-analysis-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

jobs:
skip-check:
name: Skip check
Expand Down Expand Up @@ -69,12 +73,16 @@ jobs:
with:
go-version-file: .go-version

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Initialize CodeQL
uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ concurrency:
env:
# renovate: datasource=go depName=github.com/goreleaser/goreleaser
GORELEASER_VERSION: v1.25.1
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

jobs:
skip-check:
Expand Down Expand Up @@ -74,12 +76,16 @@ jobs:
with:
go-version-file: .go-version

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Set Tag
run: |
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

jobs:
skip-check:
name: Skip check
Expand Down Expand Up @@ -58,12 +62,16 @@ jobs:
with:
go-version-file: .go-version

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Docs check
run: |
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

jobs:
skip-check:
name: Skip check
Expand Down Expand Up @@ -63,12 +67,16 @@ jobs:
run: |
./env.sh
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Build UI
run: make ui/build
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/release-dry-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ concurrency:
env:
# renovate: datasource=go depName=github.com/goreleaser/goreleaser
GORELEASER_VERSION: v1.25.1
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

permissions:
contents: write
Expand Down Expand Up @@ -81,12 +83,16 @@ jobs:
with:
go-version-file: .go-version

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Set up Snapcraft
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ concurrency:
env:
# renovate: datasource=go depName=github.com/goreleaser/goreleaser
GORELEASER_VERSION: v1.25.1
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

permissions:
contents: write
Expand All @@ -37,12 +39,16 @@ jobs:
with:
go-version-file: .go-version

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Set up Snapcraft
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ concurrency:
env:
# renovate: datasource=go depName=github.com/goreleaser/goreleaser
GORELEASER_VERSION: v1.25.1
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

permissions:
contents: write
Expand Down Expand Up @@ -84,12 +86,16 @@ jobs:
check-latest: true
cache: true

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Set up Snapcraft
run: |
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/ui-publish-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: false

env:
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

jobs:
skip-check:
name: Skip check
Expand Down Expand Up @@ -52,12 +56,16 @@ jobs:
git fetch origin +refs/heads/main:refs/remotes/origin/main && \
git checkout main
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Ensure access
working-directory: ui
Expand All @@ -71,16 +79,16 @@ jobs:
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Install packages with yarn
- name: Install packages with pnpm
working-directory: ui
run: yarn install
run: pnpm install

- name: Build Packages
working-directory: ui
run: yarn build
run: pnpm run build

- name: Bump versions and publish packages
working-directory: ui
run: yarn publish:ci
run: pnpm run publish:ci
env:
GH_TOKEN: ${{ secrets.GH_PAT_UI }}
26 changes: 17 additions & 9 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
# renovate: datasource=npm depName=pnpm versioning=npm
PNPM_VERSION: '9.0.6'

jobs:
skip-check:
name: Skip check
Expand Down Expand Up @@ -50,27 +54,31 @@ jobs:
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: .node-version
cache: 'yarn'
cache-dependency-path: ui/yarn.lock
cache: 'pnpm'
cache-dependency-path: ui/pnpm-lock.yaml

- name: Install project dependencies
run: yarn install --frozen-lockfile --prefer-offline
run: pnpm install --frozen-lockfile --prefer-offline
working-directory: ui

- run: yarn build
- run: pnpm run build
working-directory: ui

- run: yarn test
- run: pnpm run test
working-directory: ui

- name: Run ESLint
- name: Check typing
working-directory: ui
run: yarn run lint
run: pnpm run type-check

- name: Check typing
- name: Run ESLint
working-directory: ui
run: yarn run type-check
run: pnpm run lint
6 changes: 3 additions & 3 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ WORKDIR /app

COPY ui/packages/shared ./packages/shared
COPY ui/packages/app/web/package.json ./packages/app/web/package.json
COPY ui/package.json ui/yarn.lock ./
RUN yarn workspace @parca/web install --frozen-lockfile --prefer-offline
COPY ui/package.json ui/pnpm-lock.yaml ./
RUN pnpm --filter @parca/web install --frozen-lockfile --prefer-offline

FROM docker.io/node:16.20.2-alpine@sha256:a1f9d027912b58a7c75be7716c97cfbc6d3099f3a97ed84aa490be9dee20e787 AS ui-builder

WORKDIR /app

COPY ui .
COPY --from=ui-deps /app/node_modules ./node_modules
RUN yarn install --frozen-lockfile --prefer-offline && yarn build
RUN pnpm install --frozen-lockfile --prefer-offline && pnpm run build

FROM docker.io/golang:1.22.2-alpine@sha256:cdc86d9f363e8786845bea2040312b4efa321b828acdeb26f393faa864d887b0 AS builder

Expand Down
Loading

0 comments on commit e1be2a7

Please sign in to comment.