Skip to content

Commit a1e61ef

Browse files
authored
feat: Complete 1.1.1 Initialize Node.js project structure (#10)
* feat: Complete 1.1.1 Initialize Node.js project structure - Create package.json with dependencies - Set up TypeScript configuration - Configure ESLint and Prettier - Set up Git hooks and CI/CD * fix: Enhance security workflow with CodeQL initialization and improve build script formatting
1 parent eb9c24b commit a1e61ef

20 files changed

+8651
-18
lines changed

.github/dependabot.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Generated by Claude Sonnet 4 AI model
2+
version: 2
3+
updates:
4+
# Enable version updates for npm
5+
- package-ecosystem: 'npm'
6+
directory: '/'
7+
schedule:
8+
interval: 'weekly'
9+
day: 'monday'
10+
time: '09:00'
11+
open-pull-requests-limit: 5
12+
reviewers:
13+
- 'synthable'
14+
commit-message:
15+
prefix: 'chore'
16+
include: 'scope'
17+
# Group patch updates together
18+
groups:
19+
patch-updates:
20+
patterns:
21+
- '*'
22+
update-types:
23+
- 'patch'
24+
minor-updates:
25+
patterns:
26+
- '*'
27+
update-types:
28+
- 'minor'
29+
30+
# Enable version updates for GitHub Actions
31+
- package-ecosystem: 'github-actions'
32+
directory: '/'
33+
schedule:
34+
interval: 'weekly'
35+
day: 'monday'
36+
time: '09:30'
37+
open-pull-requests-limit: 3
38+
commit-message:
39+
prefix: 'ci'
40+
include: 'scope'

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Generated by Claude Sonnet 4 AI model
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: [main, develop]
7+
pull_request:
8+
branches: [main, develop]
9+
10+
jobs:
11+
test:
12+
name: Test on Node.js ${{ matrix.node-version }}
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [18.x, 20.x, 22.x]
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'npm'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: TypeScript type checking
33+
run: npm run typecheck
34+
35+
- name: ESLint validation
36+
run: npm run lint
37+
38+
- name: Prettier format checking
39+
run: npm run format:check
40+
41+
- name: Run tests with coverage
42+
run: npm run test:coverage
43+
44+
- name: Build verification
45+
run: npm run build
46+
47+
- name: Upload coverage to Codecov
48+
if: matrix.node-version == '20.x'
49+
uses: codecov/codecov-action@v4
50+
with:
51+
file: ./coverage/lcov.info
52+
fail_ci_if_error: false
53+
54+
quality-gate:
55+
name: Quality Gate
56+
runs-on: ubuntu-latest
57+
needs: test
58+
59+
steps:
60+
- name: Checkout code
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Node.js
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: '20.x'
67+
cache: 'npm'
68+
69+
- name: Install dependencies
70+
run: npm ci
71+
72+
- name: Run comprehensive quality check
73+
run: npm run quality-check
74+
75+
- name: Verify build artifacts
76+
run: |
77+
npm run build
78+
test -f dist/index.js
79+
test -f dist/index.d.ts
80+
test -f dist/core/cli.js

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Generated by Claude Sonnet 4 AI model
2+
name: Release
3+
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
release:
11+
name: Release and Publish
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20.x'
22+
cache: 'npm'
23+
registry-url: 'https://registry.npmjs.org'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run full test suite
29+
run: npm run test:coverage
30+
31+
- name: TypeScript type checking
32+
run: npm run typecheck
33+
34+
- name: ESLint validation
35+
run: npm run lint
36+
37+
- name: Prettier format checking
38+
run: npm run format:check
39+
40+
- name: Build project
41+
run: npm run build
42+
43+
- name: Verify package contents
44+
run: |
45+
npm pack --dry-run
46+
47+
- name: Extract version from tag
48+
id: version
49+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
50+
51+
- name: Create GitHub Release
52+
uses: actions/create-release@v1
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
tag_name: ${{ github.ref }}
57+
release_name: Release ${{ steps.version.outputs.version }}
58+
draft: false
59+
prerelease: false
60+
61+
- name: Publish to npm
62+
run: npm publish
63+
env:
64+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/security.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Generated by Claude Sonnet 4 AI model
2+
name: Security
3+
4+
on:
5+
push:
6+
branches: [main, develop]
7+
pull_request:
8+
branches: [main, develop]
9+
schedule:
10+
# Run security scan every Monday at 9 AM UTC
11+
- cron: '0 9 * * 1'
12+
13+
jobs:
14+
security-audit:
15+
name: Security Audit
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20.x'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Run npm audit
32+
run: npm audit --audit-level moderate
33+
34+
- name: Initialize CodeQL
35+
uses: github/codeql-action/init@v3
36+
with:
37+
languages: javascript
38+
39+
- name: Run CodeQL Analysis
40+
uses: github/codeql-action/analyze@v3
41+
with:
42+
languages: javascript
43+
44+
dependency-review:
45+
name: Dependency Review
46+
runs-on: ubuntu-latest
47+
if: github.event_name == 'pull_request'
48+
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v4
52+
53+
- name: Dependency Review
54+
uses: actions/dependency-review-action@v4
55+
with:
56+
fail-on-severity: moderate
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Generated by Claude Sonnet 4 AI model
2+
name: Update Dependencies
3+
4+
on:
5+
schedule:
6+
# Run every Sunday at 6 AM UTC
7+
- cron: '0 6 * * 0'
8+
workflow_dispatch: # Allow manual trigger
9+
10+
jobs:
11+
update-dependencies:
12+
name: Update Dependencies
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20.x'
25+
cache: 'npm'
26+
27+
- name: Check for outdated packages
28+
id: outdated
29+
run: |
30+
npm outdated --json > outdated.json || true
31+
if [ -s outdated.json ]; then
32+
echo "has_updates=true" >> $GITHUB_OUTPUT
33+
else
34+
echo "has_updates=false" >> $GITHUB_OUTPUT
35+
fi
36+
37+
- name: Update dependencies
38+
if: steps.outdated.outputs.has_updates == 'true'
39+
run: |
40+
npm update
41+
42+
- name: Run tests after update
43+
if: steps.outdated.outputs.has_updates == 'true'
44+
run: |
45+
npm run quality-check
46+
47+
- name: Create Pull Request
48+
if: steps.outdated.outputs.has_updates == 'true'
49+
uses: peter-evans/create-pull-request@v6
50+
with:
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
commit-message: 'chore: update dependencies'
53+
title: 'chore: automated dependency updates'
54+
body: |
55+
This PR contains automated dependency updates.
56+
57+
- Dependencies have been updated to their latest compatible versions
58+
- All tests and quality checks have passed
59+
- Please review the changes before merging
60+
branch: automated-dependency-updates
61+
delete-branch: true

.husky/pre-commit

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Generated by Claude-4 AI model
2+
3+
echo "🔍 Running pre-commit checks..."
4+
5+
# Run TypeScript type checking
6+
echo "📝 Type checking..."
7+
npm run typecheck
8+
9+
# Run lint-staged for staged files (includes ESLint auto-fix and Prettier)
10+
echo "🧹 Linting and formatting staged files..."
11+
npx lint-staged
12+
13+
echo "✅ Pre-commit checks completed!"

.husky/pre-push

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Claude-4 AI model
2+
3+
echo "🚀 Running pre-push checks..."
4+
5+
# Run TypeScript type checking
6+
echo "📝 Type checking..."
7+
npm run typecheck
8+
9+
# Run full test suite
10+
echo "🧪 Running full test suite..."
11+
npm test
12+
13+
# Run full lint check (not just staged files)
14+
echo "🔍 Running full lint check..."
15+
npm run lint
16+
17+
# Verify build works
18+
echo "🏗️ Verifying build..."
19+
npm run build
20+
21+
echo "✅ Pre-push checks completed! Ready to push."

0 commit comments

Comments
 (0)