Skip to content

Commit ec1ac2e

Browse files
authored
Merge pull request #81 from kaitranntt/dev
chore: add GitHub Sponsors funding configuration
2 parents 9b53c4d + a50d260 commit ec1ac2e

File tree

4 files changed

+95
-71
lines changed

4 files changed

+95
-71
lines changed

.github/FUNDING.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# These are supported funding model platforms
2+
3+
github: kaitranntt
4+
# ko_fi: kaitranntt
5+
# buy_me_a_coffee: kaitranntt
6+
# polar: kaitranntt
7+
custom: ['https://ccs.kaitran.ca/sponsor']

CLAUDE.md

Lines changed: 86 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -13,92 +13,105 @@ CLI wrapper for instant switching between multiple Claude accounts and alternati
1313
- **DRY**: One source of truth (config.json)
1414
- **CLI-First**: All features must have CLI interface
1515

16-
## TypeScript Quality Gates
16+
## Quality Gates (MANDATORY)
1717

18-
**The npm package is 100% TypeScript. Quality gates MUST pass before publish.**
18+
Quality gates MUST pass before committing. Run from project root.
19+
20+
### Main Project (src/)
1921

20-
**Package Manager: bun** - 10-25x faster than npm
2122
```bash
22-
bun install # Install dependencies (creates bun.lockb)
23-
bun run build # Compile src/ → dist/
24-
bun run validate # Full validation: typecheck + lint:fix + format:check + test
23+
# Full validation (REQUIRED before commit/PR)
24+
bun run validate # typecheck + lint:fix + format:check + test:all
25+
26+
# Individual commands
27+
bun run typecheck # tsc --noEmit
28+
bun run lint:fix # eslint src/ --fix
29+
bun run format:check # prettier --check src/
30+
bun run test:all # bun test
31+
32+
# Fix issues
33+
bun run lint:fix # Auto-fix lint issues
34+
bun run format # Auto-fix formatting (prettier --write)
2535
```
2636

27-
**Fix issues before committing:**
37+
**ESLint rules (eslint.config.mjs) - ALL errors:**
38+
| Rule | Level | Notes |
39+
|------|-------|-------|
40+
| `@typescript-eslint/no-unused-vars` | error | Ignore `_` prefix |
41+
| `@typescript-eslint/no-explicit-any` | error | Use proper types or `unknown` |
42+
| `@typescript-eslint/no-non-null-assertion` | error | No `!` assertions |
43+
| `prefer-const`, `no-var`, `eqeqeq` | error | Code quality |
44+
45+
**TypeScript (tsconfig.json) - strict mode:**
46+
| Option | Value | Notes |
47+
|--------|-------|-------|
48+
| `strict` | true | All strict flags enabled |
49+
| `noUnusedLocals` | true | No unused variables |
50+
| `noUnusedParameters` | true | No unused params |
51+
| `noImplicitReturns` | true | All paths must return |
52+
| `noFallthroughCasesInSwitch` | true | Explicit case handling |
53+
54+
### UI Project (ui/)
55+
2856
```bash
57+
cd ui
58+
59+
# Full validation (REQUIRED before commit/PR)
60+
bun run validate # typecheck + lint:fix + format:check (no tests)
61+
62+
# Individual commands
63+
bun run typecheck # tsc -b --noEmit
64+
bun run lint:fix # eslint . --fix
65+
bun run format:check # prettier --check src/
66+
67+
# Fix issues
2968
bun run lint:fix # Auto-fix lint issues
3069
bun run format # Auto-fix formatting
3170
```
3271

33-
**Automatic enforcement:**
34-
- `prepublishOnly` / `prepack` runs `validate` + `sync-version.js`
72+
**ESLint rules (ui/eslint.config.js) - ALL errors:**
73+
| Rule | Level | Notes |
74+
|------|-------|-------|
75+
| `@typescript-eslint/no-unused-vars` | error | Ignore `_` prefix |
76+
| `@typescript-eslint/no-explicit-any` | error | Use proper types or `unknown` |
77+
| `@typescript-eslint/no-non-null-assertion` | error | No `!` assertions |
78+
| `prefer-const`, `no-var`, `eqeqeq` | error | Code quality |
79+
| `react-hooks/*` | recommended | Hooks rules from plugin |
80+
| `react-refresh/*` | vite | Fast refresh compatibility |
81+
82+
**TypeScript (ui/tsconfig.app.json) - strict mode:**
83+
| Option | Value | Notes |
84+
|--------|-------|-------|
85+
| `strict` | true | All strict flags enabled |
86+
| `noUnusedLocals` | true | No unused variables |
87+
| `noUnusedParameters` | true | No unused params |
88+
| `noFallthroughCasesInSwitch` | true | Explicit case handling |
89+
| `erasableSyntaxOnly` | true | No runtime type constructs |
90+
| `noUncheckedSideEffectImports` | true | Validate side-effect imports |
91+
92+
### Automatic Enforcement
93+
94+
- `prepublishOnly` / `prepack` runs `build:all` + `validate` + `sync-version.js`
3595
- CI/CD runs `bun run validate` on every PR
96+
- husky pre-commit hooks enforce conventional commits
3697

37-
**File structure:**
38-
- `src/` - TypeScript source (55 modules)
39-
- `dist/` - Compiled JavaScript (npm package)
40-
- `lib/` - Native shell scripts (bash, PowerShell)
41-
- `ui/` - React dashboard (Vite + React 19 + shadcn/ui)
98+
### File Structure
4299

43-
**Development server (ALWAYS use for testing UI changes):**
44-
```bash
45-
bun run dev # Start dev server with hot reload (http://localhost:3000)
46100
```
47-
**IMPORTANT:** Use `bun run dev` at CCS root level for always up-to-date code. Do NOT use `ccs config` during development as it uses the globally installed (outdated) version.
48-
49-
## UI Quality Gates (React Dashboard)
50-
51-
**The ui/ directory has IDENTICAL quality gates to the main project.**
52-
53-
**Package Manager: bun** (same as root)
54-
```bash
55-
cd ui
56-
bun install # Install dependencies
57-
bun run build # TypeScript + Vite build
58-
bun run validate # Full validation: typecheck + lint:fix + format:check
101+
src/ → TypeScript source (main project)
102+
dist/ → Compiled JavaScript (npm package)
103+
lib/ → Native shell scripts (bash, PowerShell)
104+
ui/src/ → React components, hooks, pages
105+
ui/src/components/ui/ → shadcn/ui components
106+
dist/ui/ → Built UI bundle (served by Express)
59107
```
60108

61-
**Fix issues before committing:**
109+
### Development Server
110+
62111
```bash
63-
cd ui
64-
bun run typecheck # Type check only
65-
bun run lint:fix # Auto-fix lint issues
66-
bun run format # Auto-fix formatting
67-
bun run format:check # Verify formatting (no changes)
112+
bun run dev # Build + start config server (http://localhost:3000)
68113
```
69-
70-
**Linting rules (ui/eslint.config.js) - ALL errors:**
71-
- `@typescript-eslint/no-unused-vars` - error (ignore `_` prefix)
72-
- `@typescript-eslint/no-explicit-any` - error
73-
- `@typescript-eslint/no-non-null-assertion` - error
74-
- `prefer-const`, `no-var`, `eqeqeq` - error
75-
- `react-hooks/exhaustive-deps` - warning
76-
- `react-refresh/only-export-components` - error
77-
78-
**Type safety (ui/tsconfig.app.json):**
79-
- `strict: true` with `verbatimModuleSyntax` enabled
80-
- `noUnusedLocals`, `noUnusedParameters` - enabled
81-
- Type-only imports required: `import type { X }` for types
82-
83-
**UI file structure:**
84-
- `ui/src/` - React components, hooks, pages
85-
- `ui/src/components/ui/` - shadcn/ui components
86-
- `ui/src/hooks/` - Custom React hooks
87-
- `ui/src/pages/` - Route pages
88-
- `ui/src/providers/` - Context providers
89-
- `dist/ui/` - Built bundle (served by Express)
90-
91-
**Linting rules (eslint.config.mjs) - ALL errors:**
92-
- `@typescript-eslint/no-unused-vars` - error (ignore `_` prefix)
93-
- `@typescript-eslint/no-explicit-any` - error
94-
- `@typescript-eslint/no-non-null-assertion` - error
95-
- `prefer-const`, `no-var`, `eqeqeq` - error
96-
97-
**Type safety (tsconfig.json):**
98-
- `strict: true` with all strict flags enabled
99-
- `noUnusedLocals`, `noUnusedParameters`, `noImplicitReturns` - enabled
100-
- Avoid `any` types - use proper typing or `unknown`
101-
- Avoid `@ts-ignore` - fix the type error properly
114+
**IMPORTANT:** Use `bun run dev` at CCS root for always up-to-date code. Do NOT use `ccs config` during development as it uses the globally installed version.
102115

103116
## Critical Constraints (NEVER VIOLATE)
104117

@@ -375,7 +388,11 @@ rm -rf ~/.ccs # Clean environment
375388

376389
## Pre-PR Checklist (MANDATORY)
377390

378-
- [ ] `bun run validate` passes (typecheck + lint:fix + format:check + tests)
391+
**Quality Gates:**
392+
- [ ] `bun run validate` passes (main: typecheck + lint:fix + format:check + tests)
393+
- [ ] `cd ui && bun run validate` passes (ui: typecheck + lint:fix + format:check)
394+
395+
**Code Quality:**
379396
- [ ] All commits follow conventional format (`feat:`, `fix:`, etc.)
380397
- [ ] `--help` updated and consistent across src/ccs.ts, lib/ccs, lib/ccs.ps1
381398
- [ ] ASCII only (NO emojis), NO_COLOR respected

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.15.0
1+
5.15.0-dev.2

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kaitranntt/ccs",
3-
"version": "5.15.0",
3+
"version": "5.15.0-dev.2",
44
"description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
55
"keywords": [
66
"cli",

0 commit comments

Comments
 (0)