Skip to content

Commit

Permalink
js: Add top-level package.json and turbo build
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque committed Nov 13, 2023
1 parent c94eeec commit 4a24128
Show file tree
Hide file tree
Showing 16 changed files with 383 additions and 34 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = { // E: 'module' is not defined.
extends: ['turbo', '@solana/eslint-config-solana', '@solana/eslint-config-solana/jest'],
root: true,
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ test-ledger
docker-target
.idea
.coderrect
.turbo
5 changes: 1 addition & 4 deletions ci/js-test-stake-pool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ set -ex
cd "$(dirname "$0")/.."

pnpm install

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

cd stake-pool/js
pnpm lint
pnpm build
pnpm test
5 changes: 1 addition & 4 deletions ci/js-test-token-lending.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ cd "$(dirname "$0")/.."

set -x
pnpm install

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

cd token-lending/js
pnpm lint
pnpm build
4 changes: 1 addition & 3 deletions ci/js-test-token-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ cd "$(dirname "$0")/.."

set -x
pnpm install

(cd libraries/type-length-value/js && pnpm build)
pnpm build

cd token-metadata/js
pnpm lint
pnpm build
pnpm test
5 changes: 1 addition & 4 deletions ci/js-test-token-swap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install

pnpm install

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

cd token-swap/js
pnpm lint
pnpm build
pnpm start-with-test-validator
(cd ../../target/deploy && mv spl_token_swap_production.so spl_token_swap.so)
SWAP_PROGRAM_OWNER_FEE_ADDRESS="HfoTxFR1Tm6kGmWgYWD6J7YHVy1UwqSULUGVLXkJqaKN" pnpm start-with-test-validator
4 changes: 1 addition & 3 deletions ci/js-test-token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ source ./ci/solana-version.sh install

set -x
pnpm install

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

cd token/js
pnpm lint
pnpm build
pnpm test
8 changes: 4 additions & 4 deletions name-service/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"dev": "tsc && node --trace-warnings dist/transfer.js",
"build": "tsc",
"prepublish": "tsc",
"lint": "yarn pretty && eslint --max-warnings 0 'src/*.ts'",
"lint:fix": "yarn pretty:fix && eslint 'src/*.ts' --fix",
"lint": "npm run pretty && eslint --max-warnings 0 'src/*.ts'",
"lint:fix": "npm run pretty:fix && eslint 'src/*.ts' --fix",
"pretty": "prettier --check '{src/*.ts,test/*/*.ts}'",
"pretty:fix": "prettier --write '{src/*.ts,test/*/*.ts}'",
"doc": "yarn typedoc src/index.ts",
"test": "yarn test:unit && yarn test:e2e",
"doc": "npm run typedoc src/index.ts",
"test": "npm run test:unit && npm run test:e2e",
"test:unit": "mocha test/unit",
"test:e2e": "start-server-and-test 'solana-test-validator --bpf-program namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX ../../target/deploy/spl_name_service.so --reset --quiet' http://127.0.0.1:8899/health 'mocha test/e2e'"
},
Expand Down
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"private": true,
"workspaces": [
"libraries/type-length-value/js",
"memo/js",
"single-pool/js",
"stake-pool/js",
"token/js",
"token-lending/js",
"token-metadata/js",
"token-swap/js"
],
"scripts": {
"build": "turbo run build",
"clean": "turbo run clean",
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix",
"test": "turbo run test"
},
"devDependencies": {
"@solana/eslint-config-solana": "^1.0.2",
"@solana/prettier-config-solana": "^0.0.3",
"eslint-config-turbo": "^1.10.13",
"turbo": "^1.10.16"
},
"engines": {
"node": ">=14.0.0"
},
"packageManager": "[email protected]",
"prettier": "@solana/prettier-config-solana"
}
Loading

0 comments on commit 4a24128

Please sign in to comment.