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

feat: token-group interface js library #6014

Merged
merged 9 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
17 changes: 16 additions & 1 deletion .github/workflows/pull-request-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'single-pool/js/**'
- 'stake-pool/js/**'
- 'token/js/**'
- 'token-group/js/**'
- 'token-lending/js/**'
- 'token-metadata/js/**'
- 'token-swap/js/**'
Expand All @@ -24,6 +25,7 @@ on:
- 'single-pool/js/**'
- 'stake-pool/js/**'
- 'token/js/**'
- 'token-group/js/**'
- 'token-lending/js/**'
- 'token-metadata/js/**'
- 'token-swap/js/**'
Expand All @@ -34,7 +36,20 @@ jobs:
js-test:
strategy:
matrix:
package: [account-compression, 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-group,
token-lending,
token-metadata,
token-swap,
]
runs-on: ubuntu-latest
env:
NODE_VERSION: 20.5
Expand Down
39 changes: 31 additions & 8 deletions .github/workflows/pull-request-token-group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ name: Token-Group Pull Request
on:
pull_request:
paths:
- 'token-group/**'
- 'token/program-2022/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-token-group.yml'
- 'token-group/**'
- 'token/program-2022/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-token-group.yml'
- '!token-group/js/**'
push:
branches: [master]
paths:
- 'token-group/**'
- 'token/program-2022/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-token-group.yml'
- 'token-group/**'
- 'token/program-2022/**'
- 'ci/*-version.sh'
- '.github/workflows/pull-request-token-group.yml'
- '!token-group/js/**'

jobs:
cargo-test-sbf:
Expand Down Expand Up @@ -64,3 +66,24 @@ jobs:

- name: Build and test example
run: ./ci/cargo-test-sbf.sh token-group/example

js-test:
runs-on: ubuntu-latest
env:
NODE_VERSION: 16.x
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: ~/.npm
key: node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
node-
- run: ./ci/js-test-token-group.sh
12 changes: 12 additions & 0 deletions ci/js-test-token-group.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -e
cd "$(dirname "$0")/.."

set -x
pnpm install
pnpm build

cd token-group/js
pnpm lint
pnpm test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"single-pool/js",
"stake-pool/js",
"token/js",
"token-group/js",
"token-lending/js",
"token-metadata/js",
"token-swap/js"
Expand Down
79 changes: 79 additions & 0 deletions pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ packages:
- "single-pool/js/packages/*"
- "stake-pool/js"
- "token/js"
- "token-group/js"
- "token-lending/js"
- "token-metadata/js"
- "token-swap/js"
5 changes: 5 additions & 0 deletions token-group/js/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
docs
lib
test-ledger

package-lock.json
34 changes: 34 additions & 0 deletions token-group/js/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:require-extensions/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier",
"require-extensions"
],
"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"
},
"overrides": [
{
"files": [
"examples/**/*",
"test/**/*"
],
"rules": {
"require-extensions/require-extensions": "off",
"require-extensions/require-index": "off"
}
}
]
}
13 changes: 13 additions & 0 deletions token-group/js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.idea
.vscode
.DS_Store

node_modules

pnpm-lock.yaml
yarn.lock

docs
lib
test-ledger
*.tsbuildinfo
5 changes: 5 additions & 0 deletions token-group/js/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extension": ["ts"],
"node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"],
"timeout": 5000
}
Empty file added token-group/js/.nojekyll
Empty file.
5 changes: 5 additions & 0 deletions token-group/js/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
docs
lib
test-ledger

package-lock.json
7 changes: 7 additions & 0 deletions token-group/js/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 120,
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true
}
Loading