Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 8138a70

Browse files
authored
account-compression: Move sdk to pnpm workspace (#5910)
1 parent 0df0cba commit 8138a70

File tree

14 files changed

+583
-4757
lines changed

14 files changed

+583
-4757
lines changed

.github/workflows/pull-request-account-compression.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- "ci/*-version.sh"
99
- "ci/install-anchor.sh"
1010
- ".github/workflows/pull-request-account-compression.yml"
11+
- "!account-compression/sdk/**"
1112
push:
1213
branches: [master]
1314
paths:
@@ -16,6 +17,7 @@ on:
1617
- "ci/*-version.sh"
1718
- "ci/install-anchor.sh"
1819
- ".github/workflows/pull-request-account-compression.yml"
20+
- "!account-compression/sdk/**"
1921

2022
jobs:
2123
anchor-build-account-compression:
@@ -74,22 +76,19 @@ jobs:
7476
runs-on: ubuntu-latest
7577
env:
7678
NODE_VERSION: 16.x
77-
needs: anchor-build-account-compression
7879
steps:
7980
- uses: actions/checkout@v4
8081
- name: Use Node.js ${{ env.NODE_VERSION }}
8182
uses: actions/setup-node@v4
8283
with:
8384
node-version: ${{ env.NODE_VERSION }}
85+
- uses: pnpm/action-setup@v2
86+
with:
87+
version: 8
8488
- uses: actions/cache@v3
8589
with:
86-
path: ~/.cache/yarn
87-
key: node-${{ hashFiles('account-compression/sdk/yarn.lock') }}
90+
path: ~/.npm
91+
key: node-${{ hashFiles('pnpm-lock.yaml') }}
8892
restore-keys: |
8993
node-
90-
- name: Download programs
91-
uses: actions/download-artifact@v3
92-
with:
93-
name: account-compression-programs
94-
path: account-compression/target/deploy
9594
- run: ./ci/js-test-account-compression.sh

.github/workflows/pull-request-js.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Pull Request JS
33
on:
44
pull_request:
55
paths:
6+
- 'account-compression/sdk/**'
67
- 'libraries/type-length-value/js/**'
78
- 'memo/js/**'
89
- 'name-service/js/**'
@@ -17,6 +18,7 @@ on:
1718
push:
1819
branches: [master]
1920
paths:
21+
- 'account-compression/sdk/**'
2022
- 'libraries/type-length-value/js/**'
2123
- 'memo/js/**'
2224
- 'single-pool/js/**'
@@ -32,7 +34,7 @@ jobs:
3234
js-test:
3335
strategy:
3436
matrix:
35-
package: [libraries, memo, name-service, single-pool, stake-pool, token, token-lending, token-metadata, token-swap]
37+
package: [account-compression, libraries, memo, name-service, single-pool, stake-pool, token, token-lending, token-metadata, token-swap]
3638
runs-on: ubuntu-latest
3739
env:
3840
NODE_VERSION: 20.5

account-compression/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

account-compression/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Testing contracts locally requires the SDK to be built.
2626

2727
With a built local SDK, the test suite can be ran with:
2828

29-
1. `yarn link @solana/spl-account-compression`
30-
2. `yarn`
31-
3. `yarn test`
29+
1. `pnpm link @solana/spl-account-compression`
30+
2. `pnpm i`
31+
3. `pnpm test`
3232

3333
## Audit
3434

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/.eslintrc.js
22
/.solitarc.js
33
/jest.config.js
4-
/yarn.lock
54
doc
6-
dist
5+
dist

account-compression/sdk/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
dist/
22
doc/
33
test-ledger/
4-
yarn-error.log

account-compression/sdk/.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules/
22
test-ledger/
33
tests/
4-
yarn-error.log

account-compression/sdk/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ Here are some examples using account compression in the wild:
171171

172172
## Build from Source
173173

174-
0. Install dependencies with `yarn`.
174+
0. Install dependencies with `pnpm i`.
175175

176-
1. Generate the Solita SDK with `yarn solita`.
176+
1. Generate the Solita SDK with `pnpm solita`.
177177

178-
2. Then build the SDK with `yarn build`.
178+
2. Then build the SDK with `pnpm build`.
179179

180-
3. Run tests with `yarn test`. (Expect `jest` to detect an open handle that prevents it from exiting naturally)
180+
3. Run tests with `pnpm test`. (Expect `jest` to detect an open handle that prevents it from exiting naturally)

account-compression/sdk/package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@
3434
},
3535
"scripts": {
3636
"build": "rm -rf dist/ && tsc -p tsconfig.json",
37+
"build:program": "cargo build-sbf --manifest-path=../programs/account-compression/Cargo.toml && cargo build-sbf --manifest-path=../programs/noop/Cargo.toml",
3738
"fmt": "prettier --write '{*,**/*}.{ts,tsx,js,jsx,json}'",
3839
"pretty": "prettier --check '{,{src,test}/**/}*.{j,t}s'",
3940
"pretty:fix": "prettier --write '{,{src,test}/**/}*.{j,t}s'",
4041
"lint": "set -ex; npm run pretty; eslint . --ext .js,.ts",
4142
"lint:fix": "npm run pretty:fix && eslint . --fix --ext .js,.ts",
4243
"docs": "rm -rf docs/ && typedoc --out docs",
43-
"deploy:docs": "yarn docs && gh-pages --dest account-compression/sdk --dist docs --dotfiles",
44+
"deploy:docs": "npm run docs && gh-pages --dest account-compression/sdk --dist docs --dotfiles",
4445
"start-validator": "solana-test-validator --reset --quiet --bpf-program cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK ../target/deploy/spl_account_compression.so --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV ../target/deploy/spl_noop.so",
4546
"run-tests": "jest tests --detectOpenHandles",
4647
"run-tests:events": "jest tests/events --detectOpenHandles",
@@ -61,20 +62,20 @@
6162
"typescript-collections": "^1.3.3"
6263
},
6364
"peerDependencies": {
64-
"@solana/web3.js": "^1.50.1"
65+
"@solana/web3.js": "^1.87.6"
6566
},
6667
"devDependencies": {
6768
"@metaplex-foundation/rustbin": "^0.3.1",
6869
"@metaplex-foundation/solita": "0.15.2",
6970
"@project-serum/anchor": "^0.25.0",
7071
"@solana/eslint-config-solana": "^1.0.2",
71-
"@solana/prettier-config-solana": "^0.0.2",
72-
"@types/bn.js": "^5.1.1",
72+
"@solana/prettier-config-solana": "^0.0.3",
73+
"@types/bn.js": "^5.1.0",
7374
"@types/chai": "^4.3.0",
7475
"@types/jest": "^29.0.0",
7576
"@types/node-fetch": "^2.6.2",
76-
"@typescript-eslint/eslint-plugin": "^5.40.1",
77-
"@typescript-eslint/parser": "^5.40.1",
77+
"@typescript-eslint/eslint-plugin": "^6.12.0",
78+
"@typescript-eslint/parser": "^6.12.0",
7879
"chai": "^4.3.4",
7980
"eslint": "^8.25.0",
8081
"eslint-config-prettier": "^8.5.0",
@@ -85,15 +86,15 @@
8586
"eslint-plugin-prettier": "^4.2.1",
8687
"eslint-plugin-simple-import-sort": "^10.0.0",
8788
"eslint-plugin-sort-keys-fix": "^1.1.2",
88-
"gh-pages": "^4.0.0",
89+
"gh-pages": "^6.1.0",
8990
"jest": "^29.0.1",
9091
"jest-config": "^29.0.1",
91-
"start-server-and-test": "^1.14.0",
92-
"ts-jest": "^28.0.8",
92+
"start-server-and-test": "^2.0.3",
93+
"ts-jest": "^29.0.0",
9394
"ts-jest-resolver": "^2.0.0",
9495
"ts-node": "^10.9.1",
95-
"typedoc": "^0.22.2",
96-
"typescript": "=4.7.4"
96+
"typedoc": "^0.25.4",
97+
"typescript": "5.3.2"
9798
},
9899
"prettier": "@solana/prettier-config-solana"
99100
}

0 commit comments

Comments
 (0)