Skip to content

Commit

Permalink
chore: migrate to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Mar 14, 2024
1 parent ea4b71a commit 52adc39
Show file tree
Hide file tree
Showing 22 changed files with 24,883 additions and 22,728 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ There is a long list of features we want to add to Leather, and we’d love help

Code contributions must follow the style and patterns already employed by the project. This list of requirements is non-exhaustive. The Leather team might ask for additional changes.

- Code must conform to our linting setup `yarn lint`
- Code formatting correctly `yarn prettier`
- Code must be typed properly with Typescript `yarn typecheck`
- Code must conform to our linting setup `pnpm lint`
- Code formatting correctly `pnpm prettier`
- Code must be typed properly with Typescript `pnpm typecheck`

## Testing

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/check-version-lock/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Check package version lock'
description: Checks all versions are installed with exact version
runs:
using: 'node16'
using: 'node20'
main: 'check-version-lock.js'
25 changes: 15 additions & 10 deletions .github/actions/provision/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,30 @@ runs:
using: 'composite'
steps:
- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

- uses: actions/cache@v3
- name: Set up pnpm
uses: pnpm/action-setup@v3

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: nick-fields/retry@v2
if: steps.cache.outputs.cache-hit != 'true'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
with:
timeout_minutes: 5
max_attempts: 3
command: yarn --frozen-lockfile

- name: Pandacodegen
run: yarn panda codegen
shell: bash
command: pnpm install --frozen-lockfile
4 changes: 2 additions & 2 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: kyranjamie/[email protected]
with:
header: '> _Building Leather at commit `${{ env.SHORT_SHA }}`_'
header: '> _Building Leather at commit ${{ env.SHORT_SHA }}_'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
Expand All @@ -42,7 +42,7 @@ jobs:
- run: echo "SHORT_SHA=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-7`" >> $GITHUB_ENV

- name: Build project
run: yarn build
run: pnpm build
env:
WALLET_ENVIRONMENT: feature
TARGET_BROWSER: ${{ matrix.target }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: yarn

- uses: ./.github/actions/provision

- uses: chromaui/action@latest
with:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Lint
run: yarn lint:prettier
run: pnpm lint:prettier

lint-eslint:
runs-on: ubuntu-latest
Expand All @@ -23,7 +23,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Lint
run: yarn lint:eslint
run: pnpm lint:eslint

lint-filename:
runs-on: ubuntu-latest
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: ./.github/actions/provision

- name: File name checker
run: yarn lint:filename
run: pnpm lint:filename

lint-commit:
runs-on: ubuntu-latest
Expand All @@ -51,7 +51,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Lint dependency rules
run: yarn lint:deps
run: pnpm lint:deps

lint-message-schema:
runs-on: ubuntu-latest
Expand All @@ -60,7 +60,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Validate message schema
run: yarn lint:remote-wallet-config
run: pnpm lint:remote-wallet-config

lint-unused-exports:
runs-on: ubuntu-latest
Expand All @@ -69,19 +69,19 @@ jobs:
- uses: ./.github/actions/provision

- name: Lint unused TypeScript exports
run: yarn lint:unused-exports
run: pnpm lint:unused-exports

lint-firefox-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision

- run: yarn build
- run: pnpm build
env:
TARGET_BROWSER: firefox

- run: yarn web-ext lint
- run: pnpm web-ext lint

locked-versions:
runs-on: ubuntu-latest
Expand All @@ -99,7 +99,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Audit
run: yarn audit-ci --high --skip-dev
run: pnpm audit-ci --high --skip-dev

typecheck:
runs-on: ubuntu-latest
Expand All @@ -108,7 +108,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Typecheck
run: yarn typecheck
run: pnpm typecheck

test-unit:
runs-on: ubuntu-latest
Expand All @@ -117,7 +117,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Test
run: yarn test:unit
run: pnpm test:unit

test-build:
runs-on: ubuntu-latest
Expand All @@ -126,7 +126,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Build
run: yarn build
run: pnpm build

- name: Package extension
run: sh build-ext.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
paths-ignore:
- '**/CHANGELOG.md'
- '**/package.json'
- '**/yarn.lock'
- '**/pnpm-lock.yaml'
- './config/**'
- 'README.md'

Expand All @@ -29,7 +29,7 @@ jobs:
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
- uses: ./.github/actions/provision

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/development-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Build project
env:
IS_PUBLISHING: true
run: yarn build
run: pnpm build

- uses: actions/upload-artifact@v3
name: Upload build artifact
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/external-api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,43 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile
shell: bash

- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV

- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

- name: Install Playwright deps
run: yarn playwright install chrome
run: pnpm playwright install chrome
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Run Playwright tests
id: playwright
uses: mathiasvr/[email protected]
with:
run: yarn playwright test --reporter=github tests/api
run: pnpm playwright test --reporter=github tests/api

- name: Truncate String
uses: 2428392/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Build
run: yarn test:coverage
run: pnpm test:coverage

- name: Make badge maker
run: npx make-coverage-badge
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 14.x
- name: Get latest Chrome version
Expand Down
28 changes: 9 additions & 19 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,23 @@ jobs:
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV

- uses: actions/cache@v3
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}-${{ env.PLAYWRIGHT_VERSION }}-force

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: yarn --frozen-lockfile

- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-cache-${{ env.PLAYWRIGHT_VERSION }}

- name: Install Playwright browsers
run: yarn playwright install chrome chromium
run: pnpm playwright install chrome chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Install Playwright deps
run: yarn playwright install --with-deps
run: pnpm playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Build extension in test mode
run: yarn build:test
run: pnpm build:test

- name: Extract branch name
shell: bash
Expand All @@ -77,7 +65,7 @@ jobs:
# processes that require a display server to run in environments where
# one is not available.
- name: Run Playwright tests
run: xvfb-run yarn playwright test tests/specs --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=1
run: xvfb-run pnpm playwright test tests/specs --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=1
env:
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
TEST_ACCOUNT_SECRET_KEY: ${{ secrets.TEST_ACCOUNT_SECRET_KEY }}
Expand All @@ -98,10 +86,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Set up pnpm
uses: pnpm/action-setup@v3

- name: Install dependencies
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# We only add the sentry auth token for chrome, as we don't want to
# create a duplicate release during the ff build
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: yarn build
run: pnpm build

- uses: actions/upload-artifact@v3
name: Upload build artifact
Expand All @@ -74,7 +74,7 @@ jobs:
continue-on-error: true
id: publish-chrome
run: |
yarn chrome-webstore-upload upload --auto-publish --source leather-chromium.zip
pnpm chrome-webstore-upload upload --auto-publish --source leather-chromium.zip
echo "::set-output name=publish_status::${?}"
env:
EXTENSION_ID: ${{ secrets.CHROME_APP_ID }}
Expand All @@ -99,7 +99,7 @@ jobs:

- name: Build project

run: yarn build
run: pnpm build

- uses: actions/upload-artifact@v3
name: Upload build artifact
Expand All @@ -111,7 +111,7 @@ jobs:
continue-on-error: true
id: publish-firefox
run: |
yarn web-ext-submit --channel listed --artifacts-dir dist
pnpm web-ext-submit --channel listed --artifacts-dir dist
echo "::set-output name=publish_status::${?}"
env:
WEB_EXT_API_KEY: ${{ secrets.FIREFOX_API_KEY }}
Expand Down
2 changes: 0 additions & 2 deletions .tool-versions

This file was deleted.

Loading

0 comments on commit 52adc39

Please sign in to comment.