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

Commit 7a4af0a

Browse files
authored
js: Add top-level package.json and turbo build (#5819)
1 parent 2c1480c commit 7a4af0a

16 files changed

+383
-34
lines changed

Diff for: .eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = { // E: 'module' is not defined.
2+
extends: ['turbo', '@solana/eslint-config-solana', '@solana/eslint-config-solana/jest'],
3+
root: true,
4+
};

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ test-ledger
1313
docker-target
1414
.idea
1515
.coderrect
16+
.turbo

Diff for: ci/js-test-stake-pool.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ set -ex
44
cd "$(dirname "$0")/.."
55

66
pnpm install
7-
8-
(cd memo/js && pnpm build)
9-
(cd token/js && pnpm build)
7+
pnpm build
108

119
cd stake-pool/js
1210
pnpm lint
13-
pnpm build
1411
pnpm test

Diff for: ci/js-test-token-lending.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ cd "$(dirname "$0")/.."
55

66
set -x
77
pnpm install
8-
9-
(cd memo/js && pnpm build)
10-
(cd token/js && pnpm build)
8+
pnpm build
119

1210
cd token-lending/js
1311
pnpm lint
14-
pnpm build

Diff for: ci/js-test-token-metadata.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ cd "$(dirname "$0")/.."
55

66
set -x
77
pnpm install
8-
9-
(cd libraries/type-length-value/js && pnpm build)
8+
pnpm build
109

1110
cd token-metadata/js
1211
pnpm lint
13-
pnpm build
1412
pnpm test

Diff for: ci/js-test-token-swap.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ cd "$(dirname "$0")/.."
55
source ./ci/solana-version.sh install
66

77
pnpm install
8-
9-
(cd memo/js && pnpm build)
10-
(cd token/js && pnpm build)
8+
pnpm build
119

1210
cd token-swap/js
1311
pnpm lint
14-
pnpm build
1512
pnpm start-with-test-validator
1613
(cd ../../target/deploy && mv spl_token_swap_production.so spl_token_swap.so)
1714
SWAP_PROGRAM_OWNER_FEE_ADDRESS="HfoTxFR1Tm6kGmWgYWD6J7YHVy1UwqSULUGVLXkJqaKN" pnpm start-with-test-validator

Diff for: ci/js-test-token.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ source ./ci/solana-version.sh install
66

77
set -x
88
pnpm install
9-
10-
(cd memo/js && pnpm build)
9+
pnpm build
1110

1211
cd token/js
1312
pnpm lint
14-
pnpm build
1513
pnpm test

Diff for: name-service/js/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"dev": "tsc && node --trace-warnings dist/transfer.js",
2222
"build": "tsc",
2323
"prepublish": "tsc",
24-
"lint": "yarn pretty && eslint --max-warnings 0 'src/*.ts'",
25-
"lint:fix": "yarn pretty:fix && eslint 'src/*.ts' --fix",
24+
"lint": "npm run pretty && eslint --max-warnings 0 'src/*.ts'",
25+
"lint:fix": "npm run pretty:fix && eslint 'src/*.ts' --fix",
2626
"pretty": "prettier --check '{src/*.ts,test/*/*.ts}'",
2727
"pretty:fix": "prettier --write '{src/*.ts,test/*/*.ts}'",
28-
"doc": "yarn typedoc src/index.ts",
29-
"test": "yarn test:unit && yarn test:e2e",
28+
"doc": "npm run typedoc src/index.ts",
29+
"test": "npm run test:unit && npm run test:e2e",
3030
"test:unit": "mocha test/unit",
3131
"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'"
3232
},

Diff for: package.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"private": true,
3+
"workspaces": [
4+
"libraries/type-length-value/js",
5+
"memo/js",
6+
"single-pool/js",
7+
"stake-pool/js",
8+
"token/js",
9+
"token-lending/js",
10+
"token-metadata/js",
11+
"token-swap/js"
12+
],
13+
"scripts": {
14+
"build": "turbo run build",
15+
"clean": "turbo run clean",
16+
"lint": "turbo run lint",
17+
"lint:fix": "turbo run lint:fix",
18+
"test": "turbo run test"
19+
},
20+
"devDependencies": {
21+
"@solana/eslint-config-solana": "^1.0.2",
22+
"@solana/prettier-config-solana": "^0.0.3",
23+
"eslint-config-turbo": "^1.10.13",
24+
"turbo": "^1.10.16"
25+
},
26+
"engines": {
27+
"node": ">=14.0.0"
28+
},
29+
"packageManager": "[email protected]",
30+
"prettier": "@solana/prettier-config-solana"
31+
}

0 commit comments

Comments
 (0)