Skip to content

Commit e447c7e

Browse files
committed
chore: initial project infrastructure
- Neostandard - Prettier - TypeScript - node --test Signed-off-by: Miroslav Bajtoš <[email protected]>
1 parent c238962 commit e447c7e

File tree

13 files changed

+4180
-3
lines changed

13 files changed

+4180
-3
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* @bajtos
2+
*/package.json
3+
package-lock.json

.github/dependabot.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'npm'
4+
directory: '/'
5+
versioning-strategy: increase
6+
schedule:
7+
interval: 'daily'
8+
time: '09:00'
9+
timezone: 'Europe/Berlin'
10+
commit-message:
11+
prefix: 'deps'
12+
prefix-development: 'deps(dev)'
13+
groups:
14+
sentry:
15+
patterns:
16+
- '@sentry/*'
17+
- package-ecosystem: 'github-actions'
18+
directory: '/'
19+
schedule:
20+
interval: 'daily'
21+
time: '09:00'
22+
timezone: 'Europe/Berlin'
23+
commit-message:
24+
prefix: 'ci'

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 22
15+
- run: npm ci
16+
- run: npm test:unit
17+
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
- run: npm ci
26+
- run: npm run lint
27+
- run: npm run test:types
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Dependabot auto-approve minor updates
2+
on: pull_request
3+
4+
permissions:
5+
pull-requests: write
6+
7+
jobs:
8+
dependabot:
9+
runs-on: ubuntu-latest
10+
if: ${{ github.actor == 'dependabot[bot]' }}
11+
strategy:
12+
matrix:
13+
dependencyStartsWith:
14+
- '@sentry/'
15+
- pg
16+
- debug
17+
- ethers
18+
- typescript
19+
- postgrator
20+
- '@types/'
21+
- standard
22+
- prettier
23+
- '@sinclair/typebox'
24+
- multiformats
25+
steps:
26+
- name: Dependabot metadata
27+
id: metadata
28+
uses: dependabot/fetch-metadata@v2
29+
with:
30+
github-token: '${{ secrets.GITHUB_TOKEN }}'
31+
- name: Approve a PR
32+
if:
33+
${{startsWith(steps.metadata.outputs.dependency-names, matrix.dependencyStartsWith) &&
34+
(steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
35+
steps.metadata.outputs.update-type == 'version-update:semver-minor')}}
36+
run: gh pr review --approve "$PR_URL"
37+
env:
38+
PR_URL: ${{github.event.pull_request.html_url}}
39+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Dependabot auto-merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
12+
steps:
13+
- name: Enable auto-merge for Dependabot PRs
14+
run: gh pr merge --auto --squash "$PR_URL"
15+
env:
16+
PR_URL: ${{github.event.pull_request.html_url}}
17+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.prettierrc.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
semi: false
2+
singleQuote: true
3+
printWidth: 100
4+
trailingComma: all
5+
proseWrap: always

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# tiny-json-rpc
2+
23
A tiny JSON RPC client

eslint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import neostandard from 'neostandard'
2+
3+
export default neostandard({
4+
noStyle: true, // Disable style-related rules, we use Prettier
5+
ts: true,
6+
})

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* @param {string | URL} url
3+
* @param {string[][] | Record<string, string | ReadonlyArray<string>> | Headers} [headers]
4+
*/
5+
export function createJsonRpcClient(url, headers) {
6+
return () => Promise.reject(new Error('Not implemented'))
7+
}

0 commit comments

Comments
 (0)