Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoid committed Jun 30, 2024
0 parents commit bf47d1b
Show file tree
Hide file tree
Showing 35 changed files with 4,486 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/package-size-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Package Size Report

on:
pull_request:
branches: [main]

jobs:
pkg-size-report:
name: Package Size Report
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Package size report
id: pkg-size-report
uses: privatenumber/pkg-size-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
push:
branches: main

permissions:
contents: read # for checkout

jobs:
release:
name: Release
runs-on: ubuntu-latest

permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9
run_install: true

- name: Build
run: pnpm build

- name: Lint
run: pnpm lint

- name: Type check
run: pnpm type-check

- name: Test
run: pnpm test

- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: pnpm audit signatures

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm dlx semantic-release
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9
run_install: true

- name: Type check
run: pnpm type-check

- name: Build
run: pnpm build

- name: Test
run: pnpm test

- name: Test Node.js v16
run: pnpm --use-node-version=16.20.0 test

- name: Lint
run: pnpm lint
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# macOS
.DS_Store

# Logs
logs
*.log
npm-debug.log*

# Dependency directories
node_modules/

# Output of 'npm pack'
/*.tgz

# dotenv environment variables file
.env
.env.test

# Distribution
dist

# Cache
.eslintcache
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.12
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# AnchorES

Minimal Solana transaction parser.

- Tree-shakeable: 10KB (2.5KB gzip) to parse Jupiter Swap Events
- ESM and commonjs
- No IDL, structs defined in code
- Minimal dependencies
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import unjs from "eslint-config-unjs";

export default unjs({
ignores: [
// ignore paths
],
rules: {
// rule overrides
"unicorn/no-array-callback-reference": "off",
},
});
100 changes: 100 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"name": "anchores",
"version": "0.0.1",
"description": "",
"keywords": [],
"author": "",
"license": "ISC",
"type": "module",
"sideEffects": false,
"files": [
"dist"
],
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"exports": {
".": {
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
},
"./binary": {
"require": {
"types": "./dist/binary.d.cts",
"default": "./dist/binary.cjs"
},
"import": {
"types": "./dist/binary.d.mts",
"default": "./dist/binary.mjs"
}
},
"./anchor": {
"require": {
"types": "./dist/anchor.d.cts",
"default": "./dist/anchor.cjs"
},
"import": {
"types": "./dist/anchor.d.mts",
"default": "./dist/anchor.mjs"
}
},
"./parsers": {
"require": {
"types": "./dist/parsers/types.d.cts"
},
"import": {
"types": "./dist/parsers/types.d.mts"
}
},
"./parsers/jupiter": {
"require": {
"types": "./dist/parsers/jupiter.d.cts",
"default": "./dist/parsers/jupiter.cjs"
},
"import": {
"types": "./dist/parsers/jupiter.d.mts",
"default": "./dist/parsers/jupiter.mjs"
}
},
"./parsers/meteora-dlmm": {
"require": {
"types": "./dist/parsers/meteora-dlmm.d.cts",
"default": "./dist/parsers/meteora-dlmm.cjs"
},
"import": {
"types": "./dist/parsers/meteora-dlmm.d.mts",
"default": "./dist/parsers/meteora-dlmm.mjs"
}
}
},
"scripts": {
"lint": "eslint --cache . && prettier -c src",
"lint:fix": "eslint --cache . --fix && prettier -w src",
"test": "vitest --typecheck",
"dev": "pkgroll --watch",
"build": "pkgroll --minify",
"type-check": "tsc --noEmit",
"prepack": "pnpm build && clean-pkg-json"
},
"devDependencies": {
"@solana/web3.js": "^1.94.0",
"@types/node": "^20.14.2",
"clean-pkg-json": "^1.2.0",
"eslint": "^9.6.0",
"eslint-config-unjs": "^0.3.2",
"pkgroll": "^2.1.1",
"prettier": "^3.3.2",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
},
"dependencies": {
"@noble/hashes": "^1.4.0",
"@scure/base": "^1.1.7"
}
}
Loading

0 comments on commit bf47d1b

Please sign in to comment.