Skip to content

Commit

Permalink
Merge pull request #10 from hemilabs/update-to-typescript
Browse files Browse the repository at this point in the history
Update to typescript
  • Loading branch information
gndelia authored Dec 30, 2024
2 parents f81a061 + 171badc commit 24be32b
Show file tree
Hide file tree
Showing 16 changed files with 3,007 additions and 2,193 deletions.
30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"extends": ["bloq", "prettier"],
"ignorePatterns": ["_esm/*", "_cjs/*", "_types/*"],
"overrides": [
{
"extends": ["bloq/typescript", "prettier"],
"files": ["src/**/*.ts"]
},
{
"extends": ["bloq/markdown"],
"files": ["*.md"]
},
{
"extends": ["bloq/vitest", "prettier"],
"files": ["*.test.{js,ts}"]
}
],
"parserOptions": {
"sourceType": "module"
},
"root": true,
"rules": {
"camelcase": [
"warn",
{
"allow": ["after_txid"]
}
]
}
}
16 changes: 4 additions & 12 deletions .github/workflows/js-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ concurrency:
cancel-in-progress: true

jobs:
run-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: npm ci
- run: npm run format:check
- run: npm run lint
- run: npm run knip
- run: npm test
js-checks:
uses: hemilabs/actions/.github/workflows/js-checks.yml@main
with:
node-versions: '["16", "18", "20", "22"]'
14 changes: 3 additions & 11 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ on:
- published

jobs:
publish-to-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: npm ci
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
npm-publish:
uses: hemilabs/actions/.github/workflows/npm-publish.yml@main
secrets: inherit
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
_cjs
_esm
_types
.eslintcache
.nyc_output
.vscode
coverage
node_modules
tsconfig.tsbuildinfo
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"!(*.{js,md,ts}|package.json)": ["prettier --ignore-unknown --write"],
"*.{js,md,ts}": ["eslint --cache --fix --quiet", "prettier --write"],
"package.json": ["better-sort-package-json", "prettier --write"]
}
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ const balance = chain_stats.funded_txo_sum - chain_stats.spent_txo_sum;

NPM packages:

- https://github.com/mempool/mempool.js
- https://github.com/MiguelMedeiros/esplora-js
- [mempool.js](https://github.com/mempool/mempool.js)
- [esplora-js](https://github.com/MiguelMedeiros/esplora-js)

API docs:

- https://mempool.space/docs/api/rest
- https://github.com/Blockstream/esplora/blob/master/API.md
- [Mempool docs](https://mempool.space/docs/api/rest)
- [Esplora api](https://github.com/Blockstream/esplora/blob/master/API.md)
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
extends: ["bloq"],
};
12 changes: 12 additions & 0 deletions knip.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @type {import('knip').KnipConfig}
*/
const config = {
ignoreDependencies: [
"@vitest/coverage-v8",
"eslint-config-prettier",
"lint-staged",
],
};

export default config;
Loading

0 comments on commit 24be32b

Please sign in to comment.