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

Commit 29d316e

Browse files
authored
Fix Token program ESM exports (#3508)
* Fix Memo program ESM exports * fix repository link * Fix Token program ESM exports * web3.js is a peer dependency * memo/ts -> memo/js (same as token) * add gh-pages dev dep * add explicit js extensions * use explicit js imports * lint fixes for type imports * fix version * check in package-lock.json * check in package-lock.json * update spl-memo dep * reorg imports * move spl-memo to dev deps * remove editorconfig * update spl-memo * update node version in CI * memo and token use npm now * use npm ci commands * reorder imports
1 parent a179eba commit 29d316e

File tree

116 files changed

+18380
-3524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+18380
-3524
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
node-version: ${{ env.NODE_VERSION }}
7070
- uses: actions/cache@v2
7171
with:
72-
path: ~/.cache/yarn
73-
key: yarn-${{ hashFiles('memo/js/yarn.lock') }}
72+
path: ~/.npm
73+
key: node-${{ hashFiles('memo/js/package-lock.json') }}
74+
restore-keys: |
75+
node-
7476
- run: ./ci/js-test-memo.sh

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
js-test:
121121
runs-on: ubuntu-latest
122122
env:
123-
NODE_VERSION: 14.x
123+
NODE_VERSION: 16.x
124124
needs: cargo-test-sbf
125125
steps:
126126
- uses: actions/checkout@v2
@@ -130,8 +130,8 @@ jobs:
130130
node-version: ${{ env.NODE_VERSION }}
131131
- uses: actions/cache@v2
132132
with:
133-
path: ~/.cache/yarn
134-
key: node-${{ hashFiles('token/js/yarn.lock') }}
133+
path: ~/.npm
134+
key: node-${{ hashFiles('token/js/package-lock.json') }}
135135
restore-keys: |
136136
node-
137137
- name: Download programs

ci/js-test-memo.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source ./ci/solana-version.sh install
77
set -x
88
cd memo/js
99

10-
yarn install --pure-lockfile
11-
yarn lint
12-
yarn build
13-
yarn test
10+
npm install
11+
npm run lint
12+
npm run build
13+
npm test

ci/js-test-token.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source ./ci/solana-version.sh install
77
set -x
88
cd token/js
99

10-
yarn install --pure-lockfile
11-
yarn lint
12-
yarn build
13-
yarn test
10+
npm install
11+
npm run lint
12+
npm run build
13+
npm test
File renamed without changes.

token/js/.eslintignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
node_modules
2-
31
docs
42
lib
3+
test-ledger
4+
5+
package-lock.json

token/js/.eslintrc

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:prettier/recommended"
7+
],
8+
"parser": "@typescript-eslint/parser",
9+
"plugins": [
10+
"@typescript-eslint",
11+
"prettier"
12+
],
13+
"rules": {
14+
"@typescript-eslint/ban-ts-comment": "off",
15+
"@typescript-eslint/no-explicit-any": "off",
16+
"@typescript-eslint/no-unused-vars": "off",
17+
"@typescript-eslint/no-empty-interface": "off",
18+
"@typescript-eslint/consistent-type-imports": "error"
19+
}
20+
}

token/js/.eslintrc.json

-14
This file was deleted.

token/js/.gitignore

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
lib
1+
.idea
2+
.vscode
3+
.DS_Store
4+
5+
node_modules
6+
7+
pnpm-lock.yaml
8+
yarn.lock
9+
210
docs
11+
lib
12+
test-ledger
13+
*.tsbuildinfo

token/js/.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
docs
22
lib
33
test-ledger
4+
5+
package-lock.json

token/js/README.md

+15-6
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,20 @@ Please see [upgrading from 0.1.x](#upgrading-from-0.1.x).
2525
## Install
2626

2727
```shell
28-
yarn add @solana/spl-token
28+
npm install --save @solana/spl-token @solana/web3.js
29+
```
30+
_OR_
31+
```shell
32+
yarn add @solana/spl-token @solana/web3.js
2933
```
3034

3135
## Build from Source
3236

37+
0. Prerequisites
38+
39+
* Node 16+
40+
* NPM 8+
41+
3342
1. Clone the project:
3443
```shell
3544
git clone https://github.com/solana-labs/solana-program-library.git
@@ -42,27 +51,27 @@ cd solana-program-library/token/js
4251

4352
3. Install the dependencies:
4453
```shell
45-
yarn install
54+
npm install
4655
```
4756

4857
4. Build the library:
4958
```shell
50-
yarn build
59+
npm run build
5160
```
5261

5362
5. Build the on-chain programs:
5463
```shell
55-
yarn test:build-programs
64+
npm run test:build-programs
5665
```
5766

5867
6. Run the tests:
5968
```shell
60-
yarn test
69+
npm run test
6170
```
6271

6372
7. Run the example:
6473
```shell
65-
yarn example
74+
npm run example
6675
```
6776

6877
## Upgrading

0 commit comments

Comments
 (0)