Skip to content

Commit

Permalink
fix: fixing PR checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dafuga committed Jun 28, 2024
1 parent b3e778c commit 76fc42e
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 45 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
21 changes: 21 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
}
};
13 changes: 3 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,13 @@ jobs:
uses: actions/checkout@v2

- name: Install Bun
run: |
curl -fsSL https://bun.sh/install | bash
echo 'export BUN_INSTALL="$HOME/.bun"' >> $GITHUB_ENV
echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> $GITHUB_ENV
source $GITHUB_ENV
- name: Verify Bun installation
run: bun --version
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install

- name: Run checks
run: bun run make check
run: make check

- name: Run tests
run: bun run make test
run: make test
Binary file modified bun.lockb
Binary file not shown.
50 changes: 26 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
{
"name": "lighthouse",
"module": "src/index.ts",
"type": "module",
"scripts": {
"start": "bun src/index.ts",
"build": "bun build src/index.ts --compile --outfile dist/lighthouse",
"dev": "bun --hot src/index.ts"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"overrides": {
"@wharfkit/antelope": "^1.0.7"
},
"dependencies": {
"@wharfkit/antelope": "^1.0.7",
"@wharfkit/common": "^1.2.2",
"bun-types": "latest",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0"
},
"devDependencies": {
"@types/bun": "^1.0.8"
}
"name": "lighthouse",
"module": "src/index.ts",
"type": "module",
"scripts": {
"start": "bun src/index.ts",
"build": "bun build src/index.ts --compile --outfile dist/lighthouse",
"dev": "bun --hot src/index.ts"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"overrides": {
"@wharfkit/antelope": "^1.0.7"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@wharfkit/antelope": "^1.0.7",
"@wharfkit/common": "^1.2.2",
"bun-types": "latest"
},
"devDependencies": {
"@types/bun": "^1.0.8",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"svelte-eslint-parser": "^0.39.2"
}
}
8 changes: 1 addition & 7 deletions src/chains.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import { ChainDefinition, Chains } from "@wharfkit/common";

export type Chain = ChainDefinition | {
id: string;
name: string;
url: string;
};
import { Chains } from "@wharfkit/common";

const AYETU_MAINNET = {
id: "9b06067cf9f0a293e854cbdbcf4bc0292bbf1137dd01d3d9300f403706444504",
Expand Down
9 changes: 5 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { serve } from "bun";
import { APIClient, PublicKey } from "@wharfkit/antelope";
import { MAINNET_CHAINS, TESTNET_CHAINS, type Chain } from "./chains";
import { API, APIClient, PublicKey } from "@wharfkit/antelope";
import { MAINNET_CHAINS, TESTNET_CHAINS } from "./chains";
import type { Chain } from "./types";

export const accountLookup = async (req: Request) => {
const url = new URL(req.url);
Expand Down Expand Up @@ -42,8 +43,8 @@ export const lookupNetwork = async (publicKey: PublicKey, chain: Chain, apiClien

const networkRequest = async (publicKey: PublicKey, chain: Chain, apiClient?: APIClient) => {
const client = apiClient || new APIClient(chain);
const response = await client.v1.chain.get_accounts_by_authorizers({ keys: [publicKey] });
return response.accounts.map((account: any) => ({
const response: API.v1.AccountsByAuthorizers = await client.v1.chain.get_accounts_by_authorizers({ keys: [publicKey] });
return response.accounts.map(account => ({
actor: account.account_name,
permission: account.permission_name,
}));
Expand Down
7 changes: 7 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { ChainDefinition } from "@wharfkit/common";

export type Chain = ChainDefinition | {
id: string;
name: string;
url: string;
};

0 comments on commit 76fc42e

Please sign in to comment.