chore: switch to pnpm instead of yarn (#8589)

Signed-off-by: Florent Benoit <fbenoit@redhat.com>
This commit is contained in:
Florent BENOIT 2024-08-29 22:13:01 +02:00 committed by GitHub
parent ccbdd9b4bb
commit 13577e14ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 24140 additions and 21624 deletions

61
.github/workflows/add-pnpm.yaml vendored Normal file
View file

@ -0,0 +1,61 @@
#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: pnpm-release
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to build the release from'
required: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
pnpm-store:
name: pnpm-store-${{ matrix.arch }}
runs-on: ubuntu-24.04
strategy:
matrix:
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: create the pnpm store from the dependencies
run: |
podman run --platform linux/${{ matrix.arch }} -v $(pwd):/project --rm -it --entrypoint=sh node:20 -c "cd /project && corepack enable pnpm && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm install --frozen-lockfile --store-dir pnpm-store"
# now the store is in the pnpm-store directory
# create a tarball of the store
echo "Creating the archive store-cache-pnpm-${{ matrix.arch }}.tgz"
tar -czf store-cache-pnpm-${{ matrix.arch }}.tgz pnpm-store
ls -la
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: store-cache-pnpm-${{ matrix.arch }}.tgz
tag: ${{ github.event.inputs.tag }}

View file

@ -1,5 +1,5 @@
#
# Copyright (C) 2023 Red Hat, Inc.
# Copyright (C) 2023-2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -24,7 +24,7 @@ on:
- main
paths:
- 'package.json'
- 'yarn.lock'
- 'pnpm-lock.yaml'
- 'storybook/**'
- 'website/**'
- 'website-argos/**'
@ -34,7 +34,7 @@ on:
paths:
- '.github/workflows/argos.yaml'
- 'package.json'
- 'yarn.lock'
- 'pnpm-lock.yaml'
- 'storybook/**'
- 'website/**'
- 'website-argos/**'
@ -45,38 +45,32 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Execute yarn
run: yarn --frozen-lockfile
- name: Execute pnpm
run: pnpm install
- name: Run website
run: yarn website:build
run: pnpm website:build
- name: Install Playwright browsers
working-directory: website-argos
run: yarn playwright install --with-deps chromium
run: pnpm playwright install --with-deps chromium
- name: Take screenshots with Playwright
run: yarn website:screenshots
run: pnpm website:screenshots
- name: Upload screenshots to Argos
continue-on-error: true
working-directory: website-argos
run: yarn upload
run: pnpm upload
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}

View file

@ -1,5 +1,5 @@
#
# Copyright (C) 2023 Red Hat, Inc.
# Copyright (C) 2023-2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -53,9 +53,18 @@ jobs:
- uses: actions/checkout@v4
if: github.event_name == 'push'
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Update podman
run: |
@ -73,27 +82,15 @@ jobs:
wget https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/amd64/conmon_2.1.2~0_amd64.deb -O /tmp/conmon_2.1.2.deb
sudo apt install /tmp/conmon_2.1.2.deb
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Execute yarn
run: yarn --frozen-lockfile
- name: Execute pnpm
run: pnpm install
- name: Run All E2E tests
env:
PODMANDESKTOP_CI_BOT_TOKEN: ${{ secrets.PODMANDESKTOP_CI_BOT_TOKEN }}
TEST_PODMAN_MACHINE: 'true'
SKIP_KIND_INSTALL: 'true'
run: yarn test:e2e
run: pnpm test:e2e
- uses: actions/upload-artifact@v4
if: always()

View file

@ -86,50 +86,27 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.tag.outputs.githubTag}}
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Get yarn cache directory path (Windows)
if: ${{ matrix.os=='windows-2022' }}
id: yarn-cache-dir-path-windows
run: echo "dir=$(yarn cache dir)" >> ${env:GITHUB_OUTPUT}
- name: Get yarn cache directory path (mac/Linux)
if: ${{ matrix.os=='ubuntu-24.04' || matrix.os=='macos-14' }}
id: yarn-cache-dir-path-unix
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
if: ${{ matrix.os=='windows-2022' }}
id: yarn-cache-windows
with:
path: ${{ steps.yarn-cache-dir-path-windows.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v4
if: ${{ matrix.os=='ubuntu-24.04' || matrix.os=='macos-14' }}
id: yarn-cache-unix
with:
path: ${{ steps.yarn-cache-dir-path-unix.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: setup telemetry key for production
run: |
sed -i -r -e "s/SEGMENT_KEY = '.*'/SEGMENT_KEY = '${{ secrets.SEGMENT_WRITE_KEY }}'/" packages/main/src/plugin/telemetry/telemetry.ts
- name: yarn
run: |
yarn --frozen-lockfile --network-timeout 180000
- name: Execute pnpm
run: pnpm install
- name: Install flatpak on Linux
if: ${{ matrix.os=='ubuntu-24.04' }}
@ -162,7 +139,7 @@ jobs:
- name: Run Build
timeout-minutes: 40
run: yarn compile:next
run: pnpm compile:next
release:
needs: [tag, build]
@ -185,24 +162,18 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Execute yarn
run: yarn --frozen-lockfile --network-timeout 180000
- name: Execute pnpm
run: pnpm install
- name: Set-up npmjs auth token
run: printf "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}\n" >> ~/.npmrc
@ -211,22 +182,22 @@ jobs:
run: |
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" packages/extension-api/package.json
cd packages/extension-api && yarn publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
cd packages/extension-api && pnpm publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
- name: Publish Webview API to npmjs
run: |
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" packages/webview-api/package.json
cd packages/webview-api && yarn publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
cd packages/webview-api && pnpm publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
- name: Publish ui/svelte to npmjs
run: |
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" packages/ui/package.json
cd packages/ui && yarn build && yarn publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
cd packages/ui && pnpm build && pnpm publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
- name: Publish tests-playwright to npmjs
run: |
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" tests/playwright/package.json
cd tests/playwright && yarn build && yarn publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
cd tests/playwright && pnpm build && pnpm publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public

View file

@ -21,7 +21,7 @@ on:
pull_request:
paths:
- 'package.json'
- 'yarn.lock'
- 'pnpm-lock.yaml'
- 'website/**'
- 'storybook/**'
- 'packages/extension-api/src/**'
@ -32,27 +32,21 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Execute yarn
run: yarn --frozen-lockfile
- name: Execute pnpm
run: pnpm install
- name: Run website
run: yarn website:build
run: pnpm website:build
- name: Store pull request details for publish-netlify
run: |

View file

@ -29,21 +29,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: yarn
run: |
yarn --frozen-lockfile --network-timeout 180000
- name: Execute pnpm
run: pnpm install
- name: Run Build
timeout-minutes: 20
run: yarn compile:pull-request
run: pnpm compile:pull-request
- name: List Build
run: ls ./dist/
@ -77,25 +78,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Execute yarn
run: yarn --frozen-lockfile --network-timeout 180000
- name: Execute pnpm
run: pnpm install
- name: Install flatpak
run: |
@ -108,7 +102,7 @@ jobs:
- name: Run Build
timeout-minutes: 20
run: yarn compile:pull-request
run: pnpm compile:pull-request
- name: List Build
run: ls -la ./dist/
@ -132,29 +126,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Execute yarn
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: yarn --frozen-lockfile --network-timeout 180000
- name: Execute pnpm
run: pnpm install
- name: Run Build
timeout-minutes: 40
run: yarn compile:pull-request
run: pnpm compile:pull-request
- name: List Build
run: ls -la ./dist/
@ -183,42 +170,33 @@ jobs:
os: [windows-2022, ubuntu-24.04]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Get yarn cache directory path (mac/Linux)
if: ${{ matrix.os=='ubuntu-24.04'}}
id: yarn-cache-dir-path-unix
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
if: ${{ matrix.os=='ubuntu-24.04'}}
id: yarn-cache-unix
with:
path: ${{ steps.yarn-cache-dir-path-unix.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Execute yarn
run: yarn --frozen-lockfile --network-timeout 180000
- name: Execute pnpm
run: pnpm install
- name: Run linter
run: yarn lint:check
run: pnpm lint:check
- name: Run formatter
run: yarn format:check
run: pnpm format:check
- name: Run unit tests
run: yarn test:unit
run: pnpm test:unit
- name: Run typecheck
run: yarn typecheck
run: pnpm typecheck
- name: Run svelte check
run: yarn svelte:check
run: pnpm svelte:check
# Check we don't have changes in git
- name: Check no changes in git
@ -234,9 +212,6 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Update podman
run: |
@ -254,23 +229,21 @@ jobs:
wget https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/amd64/conmon_2.1.2~0_amd64.deb -O /tmp/conmon_2.1.2.deb
sudo apt install /tmp/conmon_2.1.2.deb
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
run_install: false
- name: Execute yarn
run: yarn --frozen-lockfile
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Run E2E smoke tests
run: yarn test:e2e:smoke
run: pnpm test:e2e:smoke
- uses: actions/upload-artifact@v4
if: always()

View file

@ -1,5 +1,5 @@
#
# Copyright (C) 2023 Red Hat, Inc.
# Copyright (C) 2023-2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -35,30 +35,23 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Get yarn cache directory path (mac/Linux)
id: yarn-cache-dir-path-unix
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache-unix
with:
path: ${{ steps.yarn-cache-dir-path-unix.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn
run: |
yarn --frozen-lockfile --network-timeout 180000
- name: Execute pnpm
run: pnpm install
- name: Build
run: |
cd tools
yarn build
pnpm build
- name: Generate the release notes document
run: |

View file

@ -141,49 +141,27 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.tag.outputs.githubTag}}
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Get yarn cache directory path (Windows)
if: ${{ matrix.os=='windows-2022' }}
id: yarn-cache-dir-path-windows
run: echo "dir=$(yarn cache dir)" >> ${env:GITHUB_OUTPUT}
- name: Get yarn cache directory path (mac/Linux)
if: ${{ matrix.os=='ubuntu-24.04' || matrix.os=='macos-14' }}
id: yarn-cache-dir-path-unix
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
if: ${{ matrix.os=='windows-2022' }}
id: yarn-cache-windows
with:
path: ${{ steps.yarn-cache-dir-path-windows.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v4
if: ${{ matrix.os=='ubuntu-24.04' || matrix.os=='macos-14' }}
id: yarn-cache-unix
with:
path: ${{ steps.yarn-cache-dir-path-unix.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: setup telemetry key for production
run: |
sed -i -r -e "s/SEGMENT_KEY = '.*'/SEGMENT_KEY = '${{ secrets.SEGMENT_WRITE_KEY }}'/" packages/main/src/plugin/telemetry/telemetry.ts
- name: yarn
run: |
yarn --frozen-lockfile --network-timeout 180000
- name: Execute pnpm
run: pnpm install
- name: Install flatpak on Linux
if: ${{ matrix.os=='ubuntu-24.04' }}
@ -217,7 +195,7 @@ jobs:
timeout-minutes: 40
env:
AIRGAP_DOWNLOAD: ${{ matrix.airgap == 'true' && '1' || '' }}
run: yarn compile:next
run: pnpm compile:next
release:
needs: [tag, build]
@ -240,24 +218,18 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Execute yarn
run: yarn --frozen-lockfile --network-timeout 180000
- name: Execute pnpm
run: pnpm install
- name: Set-up npmjs auth token
run: printf "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}\n" >> ~/.npmrc
@ -266,22 +238,22 @@ jobs:
run: |
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" packages/extension-api/package.json
cd packages/extension-api && yarn publish --tag latest --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
cd packages/extension-api && pnpm publish --tag latest --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
- name: Publish Webview API to npmjs
run: |
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" packages/webview-api/package.json
cd packages/webview-api && yarn publish --tag latest --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
cd packages/webview-api && pnpm publish --tag latest --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
- name: Publish ui/svelte to npmjs
run: |
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" packages/ui/package.json
cd packages/ui && yarn build && yarn publish --tag latest --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
cd packages/ui && pnpm build && pnpm publish --tag latest --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
- name: Publish tests-playwright to npmjs
run: |
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" tests/playwright/package.json
cd tests/playwright && yarn build && yarn publish --tag latest --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
cd tests/playwright && pnpm build && pnpm publish --tag latest --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public

View file

@ -24,7 +24,7 @@ on:
- main
paths:
- 'package.json'
- 'yarn.lock'
- 'pnpm-lock.yaml'
- 'storybook/**'
- 'website/**'
- 'packages/extension-api/src/**'
@ -41,25 +41,23 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.tag.outputs.githubTag}}
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn
run: |
yarn --frozen-lockfile --network-timeout 180000
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Run Build
timeout-minutes: 20
run: yarn website:build
run: pnpm website:build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:

1
.gitignore vendored
View file

@ -12,3 +12,4 @@ dist
/kind.exe
/storybook/.storybook/themes.css
/storybook/storybook-static/
yarn.lock

View file

@ -30,7 +30,7 @@ if test ! -f "$1"; then
exit 1
fi
yarn commitlint --edit "$1"
pnpm commitlint --edit "$1"
SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
grep -qs "^$SOB" "$1" || echo "$SOB" >>"$1"

View file

@ -16,4 +16,4 @@
# SPDX-License-Identifier: Apache-2.0
yarn lint-staged
pnpm lint-staged

2
.npmrc Normal file
View file

@ -0,0 +1,2 @@
node-linker=hoisted

View file

@ -58,7 +58,7 @@ You can develop on either: `Windows`, `macOS` or `Linux`.
Requirements:
- [Node.js 20+](https://nodejs.org/en/)
- [yarn v1.x](https://yarnpkg.com/) (`npm i -g yarn@1)
- [pnpm v9.x](https://pnpm.io/installation) (`corepack enable pnpm)
Optional Linux requirements:
@ -93,10 +93,10 @@ git clone https://github.com/<you>/podman-desktop && cd podman-desktop
### Step 2. Install dependencies
Fetch all dependencies using the command `yarn`:
Fetch all dependencies using the command `pnpm`:
```sh
yarn install
pnpm install
```
### Step 3. Start in watch mode
@ -104,7 +104,7 @@ yarn install
Run the application in watch mode:
```sh
yarn watch
pnpm watch
```
The dev environment will track all files changes and reload the application respectively.
@ -113,22 +113,22 @@ The dev environment will track all files changes and reload the application resp
Write tests! Please try to write some unit tests when submitting your PR.
Run the unit and component tests using `yarn`:
Run the unit and component tests using `pnpm`:
```sh
yarn test:unit
pnpm test:unit
```
Depending on to what part of project you contribute to, you can specify to run tests for the given module only, ie., if you are working on extensions, you can run the tests for extensions and have faster feedback:
```sh
yarn test:extensions
pnpm test:extensions
```
or if you are contributing to a particular extension, you can call:
```sh
yarn test:extensions:compose
pnpm test:extensions:compose
```
This will show a test results for restricted amount of tests:
@ -150,10 +150,10 @@ Check the npm script tasks in our `package.json` for more options.
### Step 5. Run E2E tests
In case of adding new feature, it is always suitable to make sure we do not bring any new regression. For this purpose we are using the E2E tests. They can be run using `yarn`:
In case of adding new feature, it is always suitable to make sure we do not bring any new regression. For this purpose we are using the E2E tests. They can be run using `pnpm`:
```sh
yarn test:e2e:smoke
pnpm test:e2e:smoke
```
Although, there are requirements that need to be fulfilled before running the tests in order to make them pass:
@ -195,13 +195,13 @@ Check that your code is properly formatted with the linter and formatter:
Checking:
```sh
yarn lint:check && yarn format:check
pnpm lint:check && pnpm format:check
```
Fix:
```sh
yarn lint:fix && yarn format:fix
pnpm lint:fix && pnpm format:fix
```
### Step 8. Compile production binaries (optional)
@ -209,7 +209,7 @@ yarn lint:fix && yarn format:fix
You may want to test the binary against your local system before pushing a PR, you can do so by running the following command:
```sh
yarn compile:current
pnpm compile:current
```
This will create a binary according to your local system and output it to the `dist/` folder.
@ -350,7 +350,7 @@ If you're unsure where to add code (renderer, UI, extensions, plugins) see the b
- `packages/preload`: Electron code that runs before the page gets rendered. Typically has access to APIs and used to setup communication processes between the main and renderer code.
- `packages/preload-docker-extension`: Electron preload code specific to the Docker Desktop extension.
- `packages/renderer`: Electron code that runs in the renderer process. The renderer runs separate to the main process and is responsible for typically rendering the main pages of Podman Desktop. Typically, this is where you find the `.svelte` code that renders the main Podman Desktop UI.
- `scripts`: Scripts Podman Desktop requires such as `yarn watch` functionality and updating Electron vendorered modules.
- `scripts`: Scripts Podman Desktop requires such as `pnpm watch` functionality and updating Electron vendorered modules.
- `tests`: Contains e2e tests for Podman Desktop.
- `types`: Additional types required for TypeScript.
- `website`: The documentation as well as [Podman Desktop website](https://podman-desktop.io) developed in [Docusaurus](https://docusaurus.io).

View file

@ -19,7 +19,7 @@ The website is built using [docusaurus](https://docusaurus.io/) and published to
The website can be previewed by running the following command:
```sh
yarn website:dev
pnpm website:dev
```
Which will automatically open your browser to `localhost:3000`.
@ -27,7 +27,7 @@ Which will automatically open your browser to `localhost:3000`.
You may also build a "production-like" environment by using:
```sh
yarn website:prod
pnpm website:prod
```
## Pull request previews
@ -42,12 +42,12 @@ Formatting and lint checking can be examined by running the following commands:
```sh
# Markdown formatting
yarn format:check
yarn format:fix
pnpm format:check
pnpm format:fix
# Markdown lint checking
yarn markdownlint:check
yarn markdownlint:fix
pnpm markdownlint:check
pnpm markdownlint:fix
```
## Screenshot and video standards

View file

@ -155,7 +155,7 @@
"shell-path": "^3.0.0"
},
"devDependencies": {
"@podman-desktop/api": "^0.0.1",
"@podman-desktop/api": "workspace:*",
"@types/mustache": "^4.2.5",
"adm-zip": "^0.5.15",
"mkdirp": "^3.0.1",

View file

@ -17,11 +17,11 @@
"watch": "vite build --watch"
},
"dependencies": {
"@podman-desktop/api": "^0.0.1"
"@podman-desktop/api": "workspace:*"
},
"devDependencies": {
"@podman-desktop/api": "workspace:*",
"adm-zip": "^0.5.15",
"@podman-desktop/api": "^0.0.1",
"mkdirp": "^3.0.1",
"vite": "^5.4.2",
"vitest": "^2.0.5"

View file

@ -103,7 +103,7 @@
},
"dependencies": {
"@octokit/rest": "^21.0.2",
"@podman-desktop/api": "^0.0.1",
"@podman-desktop/api": "workspace:*",
"mustache": "^4.2.0",
"yaml": "^2.5.0"
},

View file

@ -74,5 +74,5 @@ async function download(tagVersion: string, repoPath: string, fileName: string):
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// download the file from the given URL and store the content in destFile
// particular contour file should be manually added to the repo once downloaded
// run download script on demand using `yarn --cwd extensions/kind/ run install:contour`
// run download script on demand using `pnpm --cwd extensions/kind/ run install:contour`
download(CONTOUR_VERSION, CONTOUR_DEPLOY_PATH, CONTOUR_DEPLOY_FILE);

View file

@ -38,7 +38,7 @@
"watch": "vite build -w"
},
"dependencies": {
"@podman-desktop/api": "^0.0.1",
"@podman-desktop/api": "workspace:*",
"js-yaml": "^4.1.0"
},
"devDependencies": {

View file

@ -145,8 +145,8 @@
"format:fix": "prettier --write \"**/*.ts\" \"scripts/*.js\""
},
"dependencies": {
"@podman-desktop/api": "^0.0.1",
"@octokit/rest": "^21.0.2",
"@podman-desktop/api": "workspace:*",
"semver": "^7.6.3",
"shell-path": "^3.0.0"
},

View file

@ -64,7 +64,7 @@
"watch": "vite build --watch"
},
"dependencies": {
"@podman-desktop/api": "^0.0.1"
"@podman-desktop/api": "workspace:*"
},
"devDependencies": {
"adm-zip": "^0.5.15",

View file

@ -383,7 +383,7 @@
},
"dependencies": {
"@ltd/j-toml": "^1.38.0",
"@podman-desktop/api": "^0.0.1",
"@podman-desktop/api": "workspace:*",
"compare-versions": "^6.1.1",
"ps-list": "^8.1.1",
"ssh2": "^1.15.0"
@ -394,7 +394,7 @@
"adm-zip": "^0.5.15",
"hasha": "^6.0.0",
"mkdirp": "^3.0.1",
"nock": "^14.0.0-beta.7",
"nock": "14.0.0-beta.7",
"octokit": "^4.0.2",
"sshpk": "^1.18.0",
"tsx": "^4.19.0",

View file

@ -18,7 +18,7 @@
"watch": "vite build --watch"
},
"dependencies": {
"@podman-desktop/api": "^0.0.1"
"@podman-desktop/api": "workspace:*"
},
"devDependencies": {
"adm-zip": "^0.5.15",

View file

@ -11,18 +11,6 @@
"npm": ">=10.2.3"
},
"main": "packages/main/dist/index.cjs",
"workspaces": {
"packages": [
"packages/*",
"extensions/*",
"storybook",
"website",
"website-argos",
"tools",
"tests/*",
"scripts"
]
},
"scripts": {
"build": "npm run build:main && npm run build:preload && npm run build:preload-docker-extension && npm run build:preload-webview && npm run build:ui && npm run build:renderer && npm run build:extensions",
"build:main": "cd ./packages/main && vite build",
@ -100,13 +88,13 @@
"typecheck:extensions:registries": "tsc --noEmit --project extensions/registries",
"typecheck:extensions:kubectl-cli": "tsc --noEmit --project extensions/kubectl-cli",
"typecheck": "npm run typecheck:main && npm run typecheck:preload && npm run typecheck:ui && npm run typecheck:renderer && npm run typecheck:preload-dd-extension && npm run typecheck:preload-webview && npm run typecheck:extensions && npm run typecheck:extension-api",
"website:build": "yarn run storybook:build && cd website && yarn run docusaurus build",
"website:prod": "yarn run website:build && cd website/build && yarn serve",
"website:dev": "yarn run storybook:build && cd website && yarn run docusaurus start",
"website:screenshots": "cd website-argos && yarn run screenshot",
"website:build": "pnpm run storybook:build && cd website && pnpm run docusaurus build",
"website:prod": "pnpm run website:build && cd website/build && pnpm serve",
"website:dev": "pnpm run storybook:build && cd website && pnpm run docusaurus start",
"website:screenshots": "cd website-argos && pnpm run screenshot",
"storybook:css": "tsx ./scripts/generate-stylesheet.ts --output storybook/.storybook/themes.css",
"storybook:dev": "npm run storybook:css && cd storybook && yarn run dev",
"storybook:build": "npm run build:ui && npm run storybook:css && cd storybook && yarn run build",
"storybook:dev": "npm run storybook:css && cd storybook && pnpm run dev",
"storybook:build": "npm run build:ui && npm run storybook:css && cd storybook && pnpm run build",
"prepare": "husky install",
"postinstall": "playwright install"
},
@ -125,6 +113,7 @@
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.1",
"@playwright/test": "1.46.1",
"@podman-desktop/api": "workspace:",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
@ -165,7 +154,7 @@
"js-yaml": "^4.1.0",
"lint-staged": "^15.2.9",
"minimist": "^1.2.8",
"nock": "^14.0.0-beta.7",
"nock": "14.0.0-beta.7",
"postcss-import": "^16.1.0",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.6",
@ -208,11 +197,5 @@
"win-ca": "^3.5.1",
"yaml": "^2.5.0"
},
"resolutions": {
"trim": "0.0.3",
"@types/node": "^20",
"**/react-dev-utils/loader-utils": "^3.2.1",
"**/recursive-readdir/minimatch": "^3.0.5",
"**/markdownlint-cli2/micromatch": "~4.0.8"
}
"packageManager": "pnpm@9.7.1+sha512.faf344af2d6ca65c4c5c8c2224ea77a81a5e8859cbc4e06b1511ddce2f0151512431dd19e6aff31f2c6a8f5f2aced9bd2273e1fed7dd4de1868984059d2c4247"
}

View file

@ -15,7 +15,7 @@
"clean": "rimraf lib *.tsbuildinfo",
"build": "",
"watch": "",
"publish:next": "yarn publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\""
"publish:next": "pnpm publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\""
},
"devDependencies": {}
}

View file

@ -5,7 +5,7 @@
"type": "module",
"private": true,
"devDependencies": {
"@podman-desktop/webview-api": "0.0.1",
"@podman-desktop/webview-api": "workspace:*",
"electron": "32.0.1",
"vitest": "^2.0.5"
}

View file

@ -52,7 +52,7 @@
"yaml": "^2.5.0"
},
"dependencies": {
"@podman-desktop/ui-svelte": "^0.0.1",
"@podman-desktop/ui-svelte": "workspace:*",
"@zerodevx/svelte-toast": "^0.9.5",
"electron-context-menu": "4.0.3",
"js-yaml": "^4.1.0",

View file

@ -9,7 +9,7 @@
"test": "vitest run --coverage --passWithNoTests",
"test:watch": "vitest watch --coverage --passWithNoTests",
"svelte:check": "svelte-check --tsconfig ./tsconfig.json",
"publish:next": "yarn publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\""
"publish:next": "pnpm publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\""
},
"files": [
"dist",

View file

@ -15,7 +15,7 @@
"clean": "rimraf lib *.tsbuildinfo",
"build": "",
"watch": "",
"publish:next": "yarn publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\""
"publish:next": "pnpm publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\""
},
"devDependencies": {}
}

23845
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff

9
pnpm-workspace.yaml Normal file
View file

@ -0,0 +1,9 @@
packages:
- 'packages/*'
- 'extensions/*'
- 'storybook'
- 'website'
- 'website-argos'
- 'tools'
- 'tests/*'
- 'scripts'

View file

@ -222,7 +222,7 @@ const setupExtensionApiWatcher = name => {
const folderName = resolve(name);
console.log('dirname is', folderName);
spawnProcess = spawn('yarn', ['--cwd', folderName, 'watch'], { shell: process.platform === 'win32' });
spawnProcess = spawn('pnpm', ['watch'], { cwd: folderName, shell: process.platform === 'win32' });
spawnProcess.stdout.on('data', d => d.toString().trim() && console.warn(d.toString(), { timestamp: true }));
spawnProcess.stderr.on('data', d => {

View file

@ -16,7 +16,7 @@
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@podman-desktop/ui-svelte": "^0.0.1",
"@podman-desktop/ui-svelte": "workspace:*",
"eslint": "^9.9.1",
"svelte-fa": "^4.0.2"
},

View file

@ -1 +0,0 @@
yarn.lock

View file

@ -7,13 +7,13 @@ Testing Framework dedicated to a Podman Desktop and its extensions.
0. git clone podman-desktop
1. Install Node.js 20 (ideal is to use `nvm`)
2. checkout to `tests/playwright`
3. Install local dependencies: `yarn install`
3. Install local dependencies: `pnpm install`
4. Implement changes to the e2e tests library
5. Build: `yarn build`
5. Build: `pnpm build`
6. Create local package `npm run package`, this will produce an archive
7. In YOUR repository, update `package.json` file
8. Use dependecy on `@podman-desktop/tests-playwright`, using `file:../podman-desktop/tests/playwright/podman-desktop-tests-playwright-1.9.0.tgz`
9. `yarn install` -> this should extract the content of locally built archive into `node_modules` in your repo
9. `pnpm install` -> this should extract the content of locally built archive into `node_modules` in your repo
10. Write your E2E tests with use of your changes to `@podman-desktop/tests-playwright`
## Usage of @podman-desktop/tests-playwright in your repository
@ -127,8 +127,8 @@ You will have to checkout podman-desktop repository and build it first.
1. `git clone https://github.com/containers/podman-desktop`
2. `cd podman-desktop`
3. `yarn install`
4. `yarn test:e2e:build` -> this step is essential
3. `pnpm install`
4. `pnpm test:e2e:build` -> this step is essential
Then you need to prepare your tests to be run from your repository

View file

@ -16,7 +16,7 @@
"build": "vite build",
"package": "npm run build && npm link && npm pack",
"test": "echo \"Error: no test specified\" && exit 1",
"publish:next": "yarn publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\""
"publish:next": "pnpm publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\""
},
"peerDependencies": {
"@playwright/test": "1.42.1",

View file

@ -23,7 +23,7 @@ const config: PlaywrightTestConfig = {
webServer: {
cwd: '../website',
port: 3000,
command: 'yarn serve',
command: 'pnpm serve',
},
projects: [
{

View file

@ -3,13 +3,13 @@
### Install the project dependencies
```shell-session
$ yarn install
$ pnpm install
```
### Local Development of the website / documentation
```shell-session
$ yarn start
$ pnpm start
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
@ -17,7 +17,7 @@ This command starts a local development server and opens up a browser window. Mo
### Build
```shell-session
$ yarn build
$ pnpm build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
@ -27,13 +27,13 @@ This command generates static content into the `build` directory and can be serv
Using SSH:
```shell-session
$ USE_SSH=true yarn deploy
$ USE_SSH=true pnpm deploy
```
Not using SSH:
```shell-session
$ GIT_USER=<Your GitHub username> yarn deploy
$ GIT_USER=<Your GitHub username> pnpm deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
@ -44,13 +44,13 @@ If you are using GitHub pages for hosting, this command is a convenient way to b
```shell-session
$ cd website
$ yarn add <module>
$ pnpm add <module>
```
2. Update the `yarn.lock` file in the repository root context:
2. Update the `pnpm-lock.yaml` file in the repository root context:
```shell-session
$ cd ..
$ git checkout HEAD -- yarn.lock
$ yarn
$ git checkout HEAD -- pnpm-lock.yaml
$ pnpm install
```

View file

@ -383,7 +383,7 @@ export default config;
To start Podman Desktop with your extension loaded, run the following from your clone of the Podman Desktop repo:
```shell
yarn watch --extension-folder /path/to/your/extension
pnpm watch --extension-folder /path/to/your/extension
```
If you have a webview created, debugging / accessing the the console of the extension can be done by:

21276
yarn.lock

File diff suppressed because it is too large Load diff