Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Token program ESM exports #3508

Merged
merged 23 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/pull-request-memo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: yarn-${{ hashFiles('memo/js/yarn.lock') }}
path: ~/.npm
key: node-${{ hashFiles('memo/js/package-lock.json') }}
restore-keys: |
node-
- run: ./ci/js-test-memo.sh
6 changes: 3 additions & 3 deletions .github/workflows/pull-request-token.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
js-test:
runs-on: ubuntu-latest
env:
NODE_VERSION: 14.x
NODE_VERSION: 16.x
needs: cargo-test-sbf
steps:
- uses: actions/checkout@v2
Expand All @@ -130,8 +130,8 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: node-${{ hashFiles('token/js/yarn.lock') }}
path: ~/.npm
key: node-${{ hashFiles('token/js/package-lock.json') }}
restore-keys: |
node-
- name: Download programs
Expand Down
8 changes: 4 additions & 4 deletions ci/js-test-memo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source ./ci/solana-version.sh install
set -x
cd memo/js

yarn install --pure-lockfile
yarn lint
yarn build
yarn test
npm install
npm run lint
npm run build
npm test
8 changes: 4 additions & 4 deletions ci/js-test-token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source ./ci/solana-version.sh install
set -x
cd token/js

yarn install --pure-lockfile
yarn lint
yarn build
yarn test
npm install
npm run lint
npm run build
npm test
File renamed without changes.
5 changes: 3 additions & 2 deletions token/js/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules

docs
lib
test-ledger

package-lock.json
20 changes: 20 additions & 0 deletions token/js/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier"
],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/consistent-type-imports": "error"
}
}
14 changes: 0 additions & 14 deletions token/js/.eslintrc.json

This file was deleted.

13 changes: 12 additions & 1 deletion token/js/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
lib
.idea
.vscode
.DS_Store

node_modules

pnpm-lock.yaml
yarn.lock

docs
lib
test-ledger
*.tsbuildinfo
2 changes: 2 additions & 0 deletions token/js/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
docs
lib
test-ledger

package-lock.json
21 changes: 15 additions & 6 deletions token/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ Please see [upgrading from 0.1.x](#upgrading-from-0.1.x).
## Install

```shell
yarn add @solana/spl-token
npm install --save @solana/spl-token @solana/web3.js
```
_OR_
```shell
yarn add @solana/spl-token @solana/web3.js
```

## Build from Source

0. Prerequisites

* Node 16+
* NPM 8+

1. Clone the project:
```shell
git clone https://github.com/solana-labs/solana-program-library.git
Expand All @@ -42,27 +51,27 @@ cd solana-program-library/token/js

3. Install the dependencies:
```shell
yarn install
npm install
```

4. Build the library:
```shell
yarn build
npm run build
```

5. Build the on-chain programs:
```shell
yarn test:build-programs
npm run test:build-programs
```

6. Run the tests:
```shell
yarn test
npm run test
```

7. Run the example:
```shell
yarn example
npm run example
```

## Upgrading
Expand Down
Loading