Skip to content

Commit

Permalink
js: Move everything to pnpm (#5775)
Browse files Browse the repository at this point in the history
* Add workspace file and lockfile after install

* Update tlv library to pnpm

* Update memo to newer jest / pnpm

* name-service: Update to pnpm, fix old deps

* stake-pool: Update to pnpm

* token: Update to pnpm

* token-lending: Update to pnpm and some new packages

* token-swap: Update to pnpm

* token-metadata: Update to pnpm

* single-pool: Add to same workspace

* CI: Use pnpm everywhere

* Use workspace versions of internal packages

* Build dependent packages in CI

* Update lockfile, remove some unused packages

* Move token-swap tests to mocha

* Move tests into test file, maybe that'll do it?

* Update token-swap js build

* Use updated eslint in token-swap

* Fixup token ci build to include memo

* ci: Trigger on changes to pnpm-lock.yaml

* Refresh pnpm lock file
  • Loading branch information
joncinque authored Nov 9, 2023
1 parent 8c20de5 commit c817ecb
Show file tree
Hide file tree
Showing 56 changed files with 8,907 additions and 56,559 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/pull-request-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
paths:
- 'libraries/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'
push:
branches: [master]
paths:
- 'libraries/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -64,13 +66,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('libraries/type-length-value/js/package-lock.json') }}
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- run: ./ci/js-test-tlv.sh
9 changes: 7 additions & 2 deletions .github/workflows/pull-request-memo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
paths:
- 'memo/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'
push:
branches: [master]
paths:
- 'memo/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -64,13 +66,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('memo/js/package-lock.json') }}
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- run: ./ci/js-test-memo.sh
11 changes: 8 additions & 3 deletions .github/workflows/pull-request-name-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
paths:
- 'name-service/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'
push:
branches: [master]
paths:
- 'name-service/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -72,13 +74,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: node-${{ hashFiles('name-service/js/yarn.lock') }}
path: ~/.npm
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- name: Download programs
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pull-request-single-pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- 'associated-token-account/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-single-pool.yml'
- 'pnpm-lock.yaml'
push:
branches: [master]
paths:
Expand All @@ -16,6 +17,7 @@ on:
- 'associated-token-account/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-single-pool.yml'
- 'pnpm-lock.yaml'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -129,6 +131,12 @@ jobs:
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- name: Download programs
uses: actions/download-artifact@v2
with:
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/pull-request-stake-pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- 'ci/*-version.sh'
- 'ci/warning/purge-ubuntu-runner.sh'
- '.github/workflows/pull-request-stake-pool.yml'
- 'pnpm-lock.yaml'
push:
branches: [master]
paths:
Expand All @@ -16,6 +17,7 @@ on:
- 'ci/*-version.sh'
- 'ci/warning/purge-ubuntu-runner.sh'
- '.github/workflows/pull-request-stake-pool.yml'
- 'pnpm-lock.yaml'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -83,24 +85,21 @@ jobs:
runs-on: ubuntu-latest
env:
NODE_VERSION: 16.x
needs: cargo-test-sbf
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('stake-pool/js/package-lock.json') }}
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- name: Download programs
uses: actions/download-artifact@v2
with:
name: stake-pool-programs
path: target/deploy
- run: ./ci/js-test-stake-pool.sh

py-test:
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/pull-request-token-lending.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:
- 'token-lending/**'
- 'token/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'
push:
branches: [master]
paths:
- 'token-lending/**'
- 'token/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -70,22 +72,19 @@ jobs:
runs-on: ubuntu-latest
env:
NODE_VERSION: 18.x
needs: cargo-test-sbf
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('token-lending/js/package-lock.json') }}
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- name: Download programs
uses: actions/download-artifact@v2
with:
name: token-lending-programs
path: target/deploy
- run: ./ci/js-test-token-lending.sh
9 changes: 7 additions & 2 deletions .github/workflows/pull-request-token-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
- 'token/program-2022/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-token-metadata.yml'
- 'pnpm-lock.yaml'
push:
branches: [master]
paths:
- 'token-metadata/**'
- 'token/program-2022/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-token-metadata.yml'
- 'pnpm-lock.yaml'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -75,13 +77,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('token-metadata/js/package-lock.json') }}
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- run: ./ci/js-test-token-metadata.sh
9 changes: 7 additions & 2 deletions .github/workflows/pull-request-token-swap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
- 'token/**'
- 'libraries/math/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'
push:
branches: [master]
paths:
- 'token-swap/**'
- 'token/**'
- 'libraries/math/**'
- 'ci/*-version.sh'
- 'pnpm-lock.yaml'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -89,13 +91,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('token-swap/js/package-lock.json') }}
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- name: Download programs
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/pull-request-token.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
- 'token/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-token.yml'
- 'pnpm-lock.yaml'
push:
branches: [master]
paths:
- 'associated-token-account/**'
- 'token/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-token.yml'
- 'pnpm-lock.yaml'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -257,13 +259,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('token/js/package-lock.json') }}
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- name: Download programs
Expand Down
8 changes: 4 additions & 4 deletions ci/js-test-memo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source ./ci/solana-version.sh install
set -x
cd memo/js

npm install
npm run lint
npm run build
npm test
pnpm install
pnpm lint
pnpm build
pnpm test
8 changes: 4 additions & 4 deletions ci/js-test-name-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source ./ci/solana-version.sh install
set -x
cd name-service/js

yarn install --pure-lockfile
yarn lint
yarn build
yarn test
pnpm install
pnpm lint
pnpm build
pnpm test
4 changes: 2 additions & 2 deletions ci/js-test-single-pool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ cd single-pool/js
pnpm install

cd packages/modern
pnpm run lint
pnpm lint
pnpm build

cd ../classic
pnpm run lint
pnpm lint
pnpm build
pnpm test
13 changes: 8 additions & 5 deletions ci/js-test-stake-pool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

set -ex
cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install

pnpm install

(cd memo/js && pnpm build)
(cd token/js && pnpm build)

cd stake-pool/js
npm install
npm run lint
npm run build
npm run test
pnpm lint
pnpm build
pnpm test
9 changes: 4 additions & 5 deletions ci/js-test-tlv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

set -e
cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install

set -x
cd libraries/type-length-value/js

npm install
npm run lint
npm run build
npm test
pnpm install
pnpm lint
pnpm build
pnpm test
Loading

0 comments on commit c817ecb

Please sign in to comment.