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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Build
run: npm run build

Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
node_modules/
coverage/
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 88,
"semi": true,
"singleQuote": false,
"trailingComma": "es5"
}
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,25 @@ API gateway, metering, and billing backend for the AgentPay protocol (machine-to

## Prerequisites

- Node.js 18+
- Node.js 18.18+
- npm

## Setup for contributors

1. **Clone the repo** (or add remote and pull):

```bash
git clone <repo-url> && cd agentpay-backend
```

2. **Install dependencies**:

```bash
npm install
```

3. **Verify setup**:

```bash
npm run build
npm test
Expand All @@ -51,25 +54,28 @@ agentpay-backend/

## Commands

| Command | Description |
|--------|-------------|
| `npm run build` | Compile TypeScript to `dist/` |
| `npm test` | Build and run tests |
| `npm run dev` | Run with ts-node |
| `npm start` | Run production build |
| Command | Description |
| ---------------- | ------------------------------------------- |
| `npm run build` | Compile TypeScript to `dist/` |
| `npm run lint` | Run ESLint over TypeScript source and tests |
| `npm run format` | Check formatting with Prettier |
| `npm test` | Build and run tests |
| `npm run dev` | Run with ts-node |
| `npm start` | Run production build |

## CI/CD

On push/PR to `main`, GitHub Actions runs:

- `npm ci`
- `npm run lint`
- `npm run build`
- `npm test`

## Contributing

1. Fork the repo and create a branch.
2. Make changes; ensure `npm run build` and `npm test` pass.
2. Make changes; ensure `npm run lint`, `npm run build`, and `npm test` pass.
3. Open a pull request. CI must pass before merge.

## License
Expand Down
40 changes: 40 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: ["dist/**", "node_modules/**", "coverage/**"],
},
{
files: ["src/**/*.ts"],
extends: [
js.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
eslintConfigPrettier,
],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
},
}
);
Loading
Loading