Skip to content

Commit 9001e88

Browse files
committed
feat: complete Week 1 foundation setup
- Setup project structure with TypeScript, ESLint, Prettier - Configure build pipeline with tsup - Setup testing framework with Vitest - Implement core TypeScript interfaces and types - Create comprehensive error hierarchy - Setup constants and configuration utilities - Implement logging system - Create CLI framework with Commander.js - Setup CI/CD pipelines with GitHub Actions - Add initial unit tests All acceptance criteria for Week 1 (Task 1.1, 1.2, 1.3) completed: ✓ npm install works ✓ npm test runs with 12 passing tests ✓ npm run build produces dist/ ✓ Type checking passes ✓ Linting passes ✓ oct --help and oct --version work
1 parent 2d808d3 commit 9001e88

22 files changed

+6390
-0
lines changed

.eslintrc.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 2022,
6+
"sourceType": "module",
7+
"project": "./tsconfig.json"
8+
},
9+
"plugins": ["@typescript-eslint", "prettier"],
10+
"extends": [
11+
"eslint:recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
14+
"prettier"
15+
],
16+
"rules": {
17+
"prettier/prettier": "error",
18+
"@typescript-eslint/explicit-function-return-type": "warn",
19+
"@typescript-eslint/no-explicit-any": "error",
20+
"@typescript-eslint/no-unused-vars": [
21+
"error",
22+
{
23+
"argsIgnorePattern": "^_",
24+
"varsIgnorePattern": "^_"
25+
}
26+
],
27+
"@typescript-eslint/consistent-type-imports": "error"
28+
},
29+
"ignorePatterns": ["dist", "node_modules", "*.config.ts"]
30+
}

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
node-version: [18.x, 20.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linter
30+
run: npm run lint
31+
32+
- name: Run type check
33+
run: npm run typecheck
34+
35+
- name: Run tests
36+
run: npm run test:coverage
37+
38+
- name: Upload coverage to Codecov
39+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
40+
uses: codecov/codecov-action@v3
41+
with:
42+
files: ./coverage/coverage-final.json
43+
flags: unittests
44+
name: codecov-umbrella
45+
46+
build:
47+
runs-on: ubuntu-latest
48+
needs: test
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Setup Node.js
54+
uses: actions/setup-node@v4
55+
with:
56+
node-version: '20.x'
57+
cache: 'npm'
58+
59+
- name: Install dependencies
60+
run: npm ci
61+
62+
- name: Build
63+
run: npm run build
64+
65+
- name: Upload build artifacts
66+
uses: actions/upload-artifact@v3
67+
with:
68+
name: dist
69+
path: dist/

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
id-token: write
14+
15+
steps:
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+
registry-url: 'https://registry.npmjs.org'
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run tests
29+
run: npm test
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- name: Publish to npm
35+
run: npm publish --provenance --access public
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
39+
- name: Create GitHub Release
40+
uses: softprops/action-gh-release@v1
41+
with:
42+
generate_release_notes: true
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
7+
# Testing
8+
coverage/
9+
10+
# Logs
11+
*.log
12+
logs/
13+
14+
# Environment
15+
.env
16+
.env.local
17+
.env.*.local
18+
19+
# IDE
20+
.vscode/
21+
.idea/
22+
*.swp
23+
*.swo
24+
*~
25+
26+
# OS
27+
.DS_Store
28+
Thumbs.db
29+
30+
# Temporary files
31+
*.tmp
32+
.temp/

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
node_modules
3+
coverage
4+
*.md

.prettierrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always",
9+
"endOfLine": "lf"
10+
}

0 commit comments

Comments
 (0)