Skip to content

Commit

Permalink
feat: Migrate to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Cory authored and Will Cory committed Jun 27, 2023
1 parent 1c21d5d commit 4545459
Show file tree
Hide file tree
Showing 9 changed files with 7,116 additions and 7,240 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,18 @@ jobs:
token: ${{ secrets.PAT }}
fetch-depth: 0

- uses: pnpm/action-setup@v2
with:
version: 8.6.0

- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: pnpm

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

- name: Patch token list version
run: |
Expand All @@ -48,7 +41,7 @@ jobs:
- name: Generate token list
run: |
yarn generate:ci
pnpm generate:ci
- name: Commit token list
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- uses: pnpm/action-setup@v2
with:
version: 8.6.0

# Setup .npmrc file to publish to npm
- name: Use Node.js 16.x
uses: actions/setup-node@v3
Expand All @@ -26,9 +30,9 @@ jobs:
scope: '@eth-optimism'

- name: Install dependencies to prepare for release 🔧
run: yarn
run: pnpm install --frozen-lockfile

- name: Build and publish package on NPM 📦
run: yarn release
run: pnpm release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20 changes: 6 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,18 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: pnpm/action-setup@v2
with:
version: 8.6.0

- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
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: Install dependencies
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Run Test
run: |
npm run test
pnpm test
20 changes: 6 additions & 14 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,17 @@ jobs:
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
with:
version: 8.6.0

- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
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: Install dependencies
run: yarn --frozen-lockfile
run: pnpm --frozen-lockfile

- name: Save PR number
run: echo ${{ github.event.number }} > pr.txt
Expand All @@ -59,7 +51,7 @@ jobs:
- name: Validate token list
run: |
yarn validate --datadir ./data --tokens "${{ steps.changed_tokens.outputs.result }}" 2> err.txt 1> std.txt
pnpm validate --datadir ./data --tokens "${{ steps.changed_tokens.outputs.result }}" 2> err.txt 1> std.txt
- name: Print output
if: ${{ always() }}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.bot
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ FROM node:16-alpine3.14
WORKDIR /app

COPY package*.json /app
COPY yarn.lock /app
COPY pnpm-lock.yaml /app

RUN yarn install
RUN pnpm install

COPY . /app

CMD [ "yarn", "start-bot" ]
CMD [ "pnpm", "start-bot" ]

EXPOSE 7300
4 changes: 2 additions & 2 deletions bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ program
fs.writeFileSync(
validationResultsFilePath,
`Below are the results from running validation for the token changes. To ` +
`re-run the validation locally run: ` +
`yarn validate --datadir ./data --tokens ${options.tokens}\n\n`
`re-run the validation locally run: ` +
`pnpm validate --datadir ./data --tokens ${options.tokens}\n\n`
)
}

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"scripts": {
"validate": "tsx ./bin/cli.ts validate",
"generate": "tsx ./bin/cli.ts generate",
"generate:ci": "yarn generate --datadir ./data --outfile optimism.tokenlist.json",
"build": "yarn tsup",
"build:ci": "yarn generate:ci && yarn tsup --dts",
"release": "yarn build:ci && npm publish",
"generate:ci": "pnpm generate --datadir ./data --outfile optimism.tokenlist.json",
"build": "tsup",
"build:ci": "pnpm generate:ci && pnpm tsup --dts",
"release": "pnpm build:ci && npm publish",
"test": "jest --detectOpenHandles",
"lint:check": "eslint . --max-warnings=0",
"lint:fix": "eslint --fix .",
"lint": "yarn lint:fix && yarn lint:check",
"lint": "pnpm lint:fix && pnpm lint:check",
"start-bot": "tsx ./src/bot.ts",
"typecheck": "tsc -p ./tsconfig.json --noEmit"
},
Expand Down
Loading

0 comments on commit 4545459

Please sign in to comment.