Skip to content

Commit

Permalink
account-compression: Move sdk to pnpm workspace (solana-labs#5910)
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque authored Nov 28, 2023
1 parent 0df0cba commit 8138a70
Show file tree
Hide file tree
Showing 14 changed files with 583 additions and 4,757 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/pull-request-account-compression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "ci/*-version.sh"
- "ci/install-anchor.sh"
- ".github/workflows/pull-request-account-compression.yml"
- "!account-compression/sdk/**"
push:
branches: [master]
paths:
Expand All @@ -16,6 +17,7 @@ on:
- "ci/*-version.sh"
- "ci/install-anchor.sh"
- ".github/workflows/pull-request-account-compression.yml"
- "!account-compression/sdk/**"

jobs:
anchor-build-account-compression:
Expand Down Expand Up @@ -74,22 +76,19 @@ jobs:
runs-on: ubuntu-latest
env:
NODE_VERSION: 16.x
needs: anchor-build-account-compression
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/cache@v3
with:
path: ~/.cache/yarn
key: node-${{ hashFiles('account-compression/sdk/yarn.lock') }}
path: ~/.npm
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- name: Download programs
uses: actions/download-artifact@v3
with:
name: account-compression-programs
path: account-compression/target/deploy
- run: ./ci/js-test-account-compression.sh
4 changes: 3 additions & 1 deletion .github/workflows/pull-request-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Pull Request JS
on:
pull_request:
paths:
- 'account-compression/sdk/**'
- 'libraries/type-length-value/js/**'
- 'memo/js/**'
- 'name-service/js/**'
Expand All @@ -17,6 +18,7 @@ on:
push:
branches: [master]
paths:
- 'account-compression/sdk/**'
- 'libraries/type-length-value/js/**'
- 'memo/js/**'
- 'single-pool/js/**'
Expand All @@ -32,7 +34,7 @@ jobs:
js-test:
strategy:
matrix:
package: [libraries, memo, name-service, single-pool, stake-pool, token, token-lending, token-metadata, token-swap]
package: [account-compression, libraries, memo, name-service, single-pool, stake-pool, token, token-lending, token-metadata, token-swap]
runs-on: ubuntu-latest
env:
NODE_VERSION: 20.5
Expand Down
8 changes: 4 additions & 4 deletions account-compression/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions account-compression/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Testing contracts locally requires the SDK to be built.

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

1. `yarn link @solana/spl-account-compression`
2. `yarn`
3. `yarn test`
1. `pnpm link @solana/spl-account-compression`
2. `pnpm i`
3. `pnpm test`

## Audit

Expand Down
3 changes: 1 addition & 2 deletions account-compression/sdk/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/.eslintrc.js
/.solitarc.js
/jest.config.js
/yarn.lock
doc
dist
dist
1 change: 0 additions & 1 deletion account-compression/sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dist/
doc/
test-ledger/
yarn-error.log
1 change: 0 additions & 1 deletion account-compression/sdk/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules/
test-ledger/
tests/
yarn-error.log
8 changes: 4 additions & 4 deletions account-compression/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ Here are some examples using account compression in the wild:

## Build from Source

0. Install dependencies with `yarn`.
0. Install dependencies with `pnpm i`.

1. Generate the Solita SDK with `yarn solita`.
1. Generate the Solita SDK with `pnpm solita`.

2. Then build the SDK with `yarn build`.
2. Then build the SDK with `pnpm build`.

3. Run tests with `yarn test`. (Expect `jest` to detect an open handle that prevents it from exiting naturally)
3. Run tests with `pnpm test`. (Expect `jest` to detect an open handle that prevents it from exiting naturally)
23 changes: 12 additions & 11 deletions account-compression/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@
},
"scripts": {
"build": "rm -rf dist/ && tsc -p tsconfig.json",
"build:program": "cargo build-sbf --manifest-path=../programs/account-compression/Cargo.toml && cargo build-sbf --manifest-path=../programs/noop/Cargo.toml",
"fmt": "prettier --write '{*,**/*}.{ts,tsx,js,jsx,json}'",
"pretty": "prettier --check '{,{src,test}/**/}*.{j,t}s'",
"pretty:fix": "prettier --write '{,{src,test}/**/}*.{j,t}s'",
"lint": "set -ex; npm run pretty; eslint . --ext .js,.ts",
"lint:fix": "npm run pretty:fix && eslint . --fix --ext .js,.ts",
"docs": "rm -rf docs/ && typedoc --out docs",
"deploy:docs": "yarn docs && gh-pages --dest account-compression/sdk --dist docs --dotfiles",
"deploy:docs": "npm run docs && gh-pages --dest account-compression/sdk --dist docs --dotfiles",
"start-validator": "solana-test-validator --reset --quiet --bpf-program cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK ../target/deploy/spl_account_compression.so --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV ../target/deploy/spl_noop.so",
"run-tests": "jest tests --detectOpenHandles",
"run-tests:events": "jest tests/events --detectOpenHandles",
Expand All @@ -61,20 +62,20 @@
"typescript-collections": "^1.3.3"
},
"peerDependencies": {
"@solana/web3.js": "^1.50.1"
"@solana/web3.js": "^1.87.6"
},
"devDependencies": {
"@metaplex-foundation/rustbin": "^0.3.1",
"@metaplex-foundation/solita": "0.15.2",
"@project-serum/anchor": "^0.25.0",
"@solana/eslint-config-solana": "^1.0.2",
"@solana/prettier-config-solana": "^0.0.2",
"@types/bn.js": "^5.1.1",
"@solana/prettier-config-solana": "^0.0.3",
"@types/bn.js": "^5.1.0",
"@types/chai": "^4.3.0",
"@types/jest": "^29.0.0",
"@types/node-fetch": "^2.6.2",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"chai": "^4.3.4",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -85,15 +86,15 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"gh-pages": "^4.0.0",
"gh-pages": "^6.1.0",
"jest": "^29.0.1",
"jest-config": "^29.0.1",
"start-server-and-test": "^1.14.0",
"ts-jest": "^28.0.8",
"start-server-and-test": "^2.0.3",
"ts-jest": "^29.0.0",
"ts-jest-resolver": "^2.0.0",
"ts-node": "^10.9.1",
"typedoc": "^0.22.2",
"typescript": "=4.7.4"
"typedoc": "^0.25.4",
"typescript": "5.3.2"
},
"prettier": "@solana/prettier-config-solana"
}
Loading

0 comments on commit 8138a70

Please sign in to comment.