Skip to content

Commit e2b9c55

Browse files
committed
feat: init client
0 parents  commit e2b9c55

25 files changed

+16391
-0
lines changed

.audit-ci.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"low": true,
3+
"moderate": true,
4+
"high": false,
5+
"critical": false,
6+
"allowlist": [],
7+
"report-type": "summary",
8+
"package-manager": "npm"
9+
}

.commitlintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
// Allow longer lines in body and footer for generated commit messages
5+
'body-max-line-length': [0, 'always', 200],
6+
'footer-max-line-length': [0, 'always', 200],
7+
// Keep header line reasonable
8+
'header-max-length': [2, 'always', 72],
9+
// Subject line should be reasonable
10+
'subject-max-length': [2, 'always', 50]
11+
},
12+
ignores: [
13+
// Ignore semantic-release commits
14+
(message) => message.includes('[skip ci]') || message.startsWith('chore(release):')
15+
]
16+
};

.github/workflows/ci.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
types: [ opened, synchronize, reopened, edited ]
9+
10+
permissions:
11+
contents: read
12+
checks: write
13+
pull-requests: write
14+
15+
jobs:
16+
test:
17+
name: Test Node.js ${{ matrix.node-version }}
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
matrix:
22+
node-version: [18.x, 20.x, 22.x]
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js ${{ matrix.node-version }}
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: ${{ matrix.node-version }}
32+
cache: 'npm'
33+
34+
- name: Install just
35+
uses: extractions/setup-just@v2
36+
37+
- name: Install dependencies
38+
run: just install
39+
40+
- name: Run type check
41+
run: just typecheck
42+
43+
- name: Run linter
44+
run: just lint
45+
46+
- name: Run tests with coverage
47+
run: just test-coverage
48+
49+
- name: Upload coverage to Codecov
50+
if: matrix.node-version == '20.x' && github.repository == 'jacobboykin/amazing-marvin-client-javascript'
51+
uses: codecov/codecov-action@v4
52+
with:
53+
files: ./coverage/lcov.info
54+
fail_ci_if_error: false
55+
token: ${{ secrets.CODECOV_TOKEN }}
56+
continue-on-error: true
57+
58+
- name: Build project
59+
run: just build
60+
61+
- name: Test package installation
62+
if: matrix.node-version == '20.x'
63+
run: |
64+
npm pack
65+
npm install -g ./jacobboykin-amazing-marvin-client-*.tgz
66+
node -e "console.log('Package installed successfully')"
67+
68+
commitlint:
69+
name: Validate commit messages
70+
runs-on: ubuntu-latest
71+
if: github.event_name == 'pull_request'
72+
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v4
76+
with:
77+
fetch-depth: 0
78+
79+
- name: Setup Node.js
80+
uses: actions/setup-node@v4
81+
with:
82+
node-version: '20.x'
83+
cache: 'npm'
84+
85+
- name: Install just
86+
uses: extractions/setup-just@v2
87+
88+
- name: Install dependencies
89+
run: just install
90+
91+
- name: Validate PR title
92+
run: echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose
93+
94+
security:
95+
name: Security audit
96+
runs-on: ubuntu-latest
97+
98+
steps:
99+
- name: Checkout code
100+
uses: actions/checkout@v4
101+
102+
- name: Setup Node.js
103+
uses: actions/setup-node@v4
104+
with:
105+
node-version: '20.x'
106+
cache: 'npm'
107+
108+
- name: Install just
109+
uses: extractions/setup-just@v2
110+
111+
- name: Install dependencies
112+
run: just install
113+
114+
- name: Run security audit
115+
run: just audit
116+
117+
- name: Check for known vulnerabilities
118+
run: npx audit-ci --config .audit-ci.json || true
119+
120+
release:
121+
name: Release
122+
runs-on: ubuntu-latest
123+
needs: [test, security]
124+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
125+
126+
permissions:
127+
contents: write
128+
issues: write
129+
pull-requests: write
130+
id-token: write
131+
packages: write
132+
133+
steps:
134+
- name: Checkout code
135+
uses: actions/checkout@v4
136+
with:
137+
fetch-depth: 0
138+
persist-credentials: false
139+
140+
- name: Setup Node.js
141+
uses: actions/setup-node@v4
142+
with:
143+
node-version: '20.x'
144+
cache: 'npm'
145+
registry-url: 'https://npm.pkg.github.com'
146+
scope: '@jacobboykin'
147+
148+
- name: Install just
149+
uses: extractions/setup-just@v2
150+
151+
- name: Install dependencies
152+
run: just install
153+
154+
- name: Run full CI pipeline
155+
run: just ci
156+
157+
- name: Release
158+
env:
159+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
160+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161+
run: npx semantic-release

.gitignore

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# Snowpack dependency directory (https://snowpack.dev/)
45+
web_modules/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional stylelint cache
57+
.stylelintcache
58+
59+
# Optional REPL history
60+
.node_repl_history
61+
62+
# Output of 'npm pack'
63+
*.tgz
64+
65+
# Yarn Integrity file
66+
.yarn-integrity
67+
68+
# dotenv environment variable files
69+
.env
70+
.env.*
71+
!.env.example
72+
73+
# parcel-bundler cache (https://parceljs.org/)
74+
.cache
75+
.parcel-cache
76+
77+
# Next.js build output
78+
.next
79+
out
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
dist
84+
dist-test
85+
86+
# Gatsby files
87+
.cache/
88+
# Comment in the public line in if your project uses Gatsby and not Next.js
89+
# https://nextjs.org/blog/next-9-1#public-directory-support
90+
# public
91+
92+
# vuepress build output
93+
.vuepress/dist
94+
95+
# vuepress v2.x temp and cache directory
96+
.temp
97+
98+
# Sveltekit cache directory
99+
.svelte-kit/
100+
101+
# vitepress build output
102+
**/.vitepress/dist
103+
104+
# vitepress cache directory
105+
**/.vitepress/cache
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# Firebase cache directory
120+
.firebase/
121+
122+
# TernJS port file
123+
.tern-port
124+
125+
# Stores VSCode versions used for testing VSCode extensions
126+
.vscode-test
127+
128+
# yarn v3
129+
.pnp.*
130+
.yarn/*
131+
!.yarn/patches
132+
!.yarn/plugins
133+
!.yarn/releases
134+
!.yarn/sdks
135+
!.yarn/versions
136+
137+
# Vite logs files
138+
vite.config.js.timestamp-*
139+
vite.config.ts.timestamp-*
140+
141+
# jetbrains
142+
.idea/

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@jacobboykin:registry=https://npm.pkg.github.com

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: lint
5+
name: ESLint
6+
entry: npm run lint
7+
language: node
8+
files: \.(ts|tsx|js|jsx)$
9+
pass_filenames: false
10+
11+
- id: test
12+
name: Run tests
13+
entry: npm run test
14+
language: node
15+
pass_filenames: false
16+
17+
- repo: https://github.com/pre-commit/pre-commit-hooks
18+
rev: v4.6.0
19+
hooks:
20+
- id: trailing-whitespace
21+
- id: end-of-file-fixer
22+
- id: check-yaml
23+
- id: check-json
24+
- id: check-merge-conflict
25+
- id: check-added-large-files
26+
args: ['--maxkb=500']
27+
28+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
29+
rev: v9.18.0
30+
hooks:
31+
- id: commitlint
32+
stages: [commit-msg]
33+
additional_dependencies: ['@commitlint/config-conventional']

0 commit comments

Comments
 (0)