Skip to content
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
35 changes: 18 additions & 17 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,38 @@ jobs:
build:
name: Lint, Build & Unit, E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
packages: read
env:
INTERNAL_EVENT: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}

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

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- uses: pnpm/action-setup@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
version: 9
node-version: 22
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint

- name: Run linter
run: pnpm run lint
- name: Type check
run: pnpm typecheck

- name: Run tests
run: pnpm run test
- name: Test
run: pnpm test

- name: Build project
run: pnpm run build
- name: Build
run: pnpm build

- name: Release a nightly build
if: env.INTERNAL_EVENT == 'true'
Expand Down Expand Up @@ -110,7 +111,7 @@ jobs:
PAIRING_SECRET: '12345678'
ENC_PW: '12345678'
APP_NAME: 'lattice-manager'
run: pnpm run e2e --reporter=basic
run: pnpm run e2e -- --reporter=basic

- name: Show simulator logs on failure
if: failure() && env.INTERNAL_EVENT == 'true'
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/docs-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,24 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 60

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

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- uses: pnpm/action-setup@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
version: 9
node-version: 22
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Build docs
run: pnpm --filter gridplus-sdk-docs run build
run: pnpm turbo run build --filter=gridplus-sdk-docs

- name: Upload production-ready build files
uses: actions/upload-artifact@v4
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,24 @@ jobs:
publish-npm:
name: Publish
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v5
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- uses: pnpm/action-setup@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
version: 9
node-version: 22
registry-url: 'https://registry.npmjs.org'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Build project
run: pnpm run build
run: pnpm turbo run build

- name: Publish to NPM
run: pnpm --filter gridplus-sdk publish --no-git-checks
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ coverage
*.temp
~/node_modules
cache
.turbo
5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

13 changes: 0 additions & 13 deletions .prettierrc

This file was deleted.

79 changes: 79 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"attributePosition": "auto"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noForEach": "warn"
},
"correctness": {
"noUnusedImports": {
"level": "error"
},
"noUnusedVariables": {
"level": "warn",
"fix": "none"
},
"noUnusedFunctionParameters": {
"level": "warn",
"fix": "none"
}
},
"style": {
"noParameterAssign": "warn",
"noNonNullAssertion": "error",
"noUselessElse": "warn",
"noUnusedTemplateLiteral": "error",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useSingleVarDeclarator": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error"
},
"performance": {
"noAccumulatingSpread": "warn"
},
"suspicious": {
"noArrayIndexKey": "warn",
"noAssignInExpressions": "warn",
"noExplicitAny": "warn"
}
}
},
"organizeImports": {
"enabled": false
},
"files": {
"ignoreUnknown": true,
"include": ["packages/*/src/**"],
"ignore": ["**/dist/**", "**/node_modules/**", "**/coverage/**"]
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto"
}
}
}
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
{
"name": "gridplus-sdk-monorepo",
"private": true,
"packageManager": "pnpm@10.6.2",
"scripts": {
"build": "pnpm --filter @gridplus/btc run build && pnpm --filter gridplus-sdk run build",
"test": "pnpm --filter @gridplus/btc run build && pnpm --filter @gridplus/btc run test && pnpm --filter gridplus-sdk run test",
"test-unit": "pnpm --filter @gridplus/btc run build && pnpm --filter @gridplus/btc run test && pnpm --filter gridplus-sdk run test-unit",
"lint": "pnpm --filter @gridplus/btc run lint && pnpm --filter gridplus-sdk run lint",
"lint:fix": "pnpm --filter @gridplus/btc run lint:fix && pnpm --filter gridplus-sdk run lint:fix",
"e2e": "pnpm --filter gridplus-sdk run e2e",
"build": "turbo run build --filter=gridplus-sdk --filter=@gridplus/btc",
"test": "turbo run test --filter=gridplus-sdk --filter=@gridplus/btc",
"test-unit": "turbo run test-unit --filter=gridplus-sdk --filter=@gridplus/btc",
"lint": "turbo run lint --filter=gridplus-sdk --filter=@gridplus/btc",
"lint:fix": "turbo run lint:fix --filter=gridplus-sdk --filter=@gridplus/btc",
"typecheck": "turbo run typecheck --filter=gridplus-sdk --filter=@gridplus/btc",
"e2e": "turbo run e2e --filter=gridplus-sdk",
"docs:build": "pnpm --filter gridplus-sdk-docs run build",
"docs:start": "pnpm --filter gridplus-sdk-docs run start"
},
"devDependencies": {
"@biomejs/biome": "^1.9.0",
"turbo": "^2.3.0"
},
"engines": {
"node": ">=20"
}
Expand Down
8 changes: 8 additions & 0 deletions packages/btc/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"extends": ["../../biome.json"],
"files": {
"include": ["src/**/*.ts"],
"ignore": ["**/dist/**", "**/node_modules/**"]
}
}
13 changes: 4 additions & 9 deletions packages/btc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"scripts": {
"build": "tsup",
"test": "vitest run ./src/__test__/unit",
"lint": "eslint src --config eslint.config.mjs",
"lint:fix": "eslint src --config eslint.config.mjs --fix"
"lint": "biome check src",
"lint:fix": "biome check --write src",
"typecheck": "tsc --noEmit"
},
"files": [
"dist"
Expand All @@ -32,14 +33,8 @@
"bs58check": "^4.0.0"
},
"devDependencies": {
"@eslint/js": "^9.36.0",
"@biomejs/biome": "^1.9.0",
"@types/node": "^24.10.4",
"@typescript-eslint/eslint-plugin": "^8.44.1",
"@typescript-eslint/parser": "^8.44.1",
"eslint": "^9.36.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"prettier": "^3.6.2",
"tsup": "^8.5.0",
"typescript": "^5.9.2",
"vitest": "3.2.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/btc/src/provider/blockbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class BlockbookProvider implements BtcProvider {
`Fee estimation failed: invalid response format for ${blocks} blocks`,
);
}
const btcPerKb = parseFloat(response.result);
const btcPerKb = Number.parseFloat(response.result);
if (Number.isNaN(btcPerKb) || btcPerKb <= 0) {
throw new Error(
`Fee estimation failed: invalid fee rate "${response.result}" for ${blocks} blocks`,
Expand Down
2 changes: 1 addition & 1 deletion packages/btc/src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { HARDENED_OFFSET } from './constants';
* @throws Error if the value cannot be parsed to a valid integer
*/
function safeParseInt(value: string, fieldName: string): number {
const parsed = parseInt(value, 10);
const parsed = Number.parseInt(value, 10);
if (Number.isNaN(parsed)) {
throw new Error(
`Invalid ${fieldName}: expected numeric string but received "${value}"`,
Expand Down
1 change: 1 addition & 0 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.4.0",
"@tsconfig/docusaurus": "^2.0.3",
"@types/node": "^22.0.0",
"docusaurus-plugin-typedoc": "~1.0.1",
"typedoc": "~0.25.13",
"typedoc-plugin-markdown": "~4.0.1",
Expand Down
1 change: 0 additions & 1 deletion packages/docs/src/components/HomepageFeatures.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import clsx from 'clsx';
import styles from './HomepageFeatures.module.css';

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
padding: 0 var(--ifm-pre-padding);
}

html[data-theme='dark'] .docusaurus-highlight-code-line {
html[data-theme="dark"] .docusaurus-highlight-code-line {
background-color: rgba(0, 0, 0, 0.3);
}
14 changes: 10 additions & 4 deletions packages/docs/src/pages/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import type React from 'react';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
import Layout, { type Props as LayoutProps } from '@theme/Layout';
import clsx from 'clsx';
import React from 'react';
import styles from './index.module.css';

interface ExtendedLayoutProps extends LayoutProps {
title?: string;
description?: string;
}

function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
return (
Expand All @@ -27,13 +32,14 @@ function HomepageHeader() {

export default function Home(): JSX.Element {
const { siteConfig } = useDocusaurusContext();
const ExtendedLayout = Layout as React.ComponentType<ExtendedLayoutProps>;
return (
<Layout
<ExtendedLayout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />"
>
<HomepageHeader />
<main>{/* <HomepageFeatures /> */}</main>
</Layout>
</ExtendedLayout>
);
}
7 changes: 4 additions & 3 deletions packages/docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"skipLibCheck": true
"skipLibCheck": true,
"jsx": "react-jsx",
"types": ["node", "@docusaurus/module-type-aliases"]
},
"include": ["../src"],
"types": ["node", "jest", "vitest", "vitest/globals"]
"include": ["src"]
}
Loading
Loading