github-archiver 1.0.2 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.releaserc.json +9 -1
- package/CHANGELOG.md +25 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +2 -2
- package/package.json +6 -2
- package/.claude/CLAUDE.md +0 -248
- package/.claude/settings.json +0 -15
- package/.github/dependabot.yml +0 -76
- package/.github/workflows/ci.yml +0 -64
- package/.github/workflows/release.yml +0 -55
- package/AGENTS.md +0 -248
- package/CONTRIBUTING.md +0 -343
- package/QUICKSTART.md +0 -221
- package/bun.lock +0 -1380
- package/issues.txt +0 -1105
- package/notes.md +0 -0
- package/scripts/build.ts +0 -14
- package/src/commands/archive.ts +0 -344
- package/src/commands/auth.ts +0 -184
- package/src/constants/defaults.ts +0 -6
- package/src/constants/messages.ts +0 -24
- package/src/constants/paths.ts +0 -12
- package/src/index.ts +0 -42
- package/src/services/archiver.ts +0 -192
- package/src/services/auth-manager.ts +0 -79
- package/src/services/github.ts +0 -211
- package/src/types/config.ts +0 -24
- package/src/types/error.ts +0 -35
- package/src/types/github.ts +0 -34
- package/src/types/index.ts +0 -4
- package/src/utils/colors.ts +0 -79
- package/src/utils/config.ts +0 -95
- package/src/utils/errors.ts +0 -93
- package/src/utils/formatting.ts +0 -65
- package/src/utils/input-handler.ts +0 -163
- package/src/utils/logger.ts +0 -65
- package/src/utils/parser.ts +0 -125
- package/src/utils/progress.ts +0 -87
- package/tests/unit/formatting.test.ts +0 -93
- package/tests/unit/parser.test.ts +0 -140
- package/tsconfig.json +0 -36
package/AGENTS.md
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
# Ultracite Code Standards
|
|
2
|
-
|
|
3
|
-
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
|
|
4
|
-
|
|
5
|
-
## Quick Reference
|
|
6
|
-
|
|
7
|
-
- **Format code**: `bun x ultracite fix`
|
|
8
|
-
- **Check for issues**: `bun x ultracite check`
|
|
9
|
-
- **Diagnose setup**: `bun x ultracite doctor`
|
|
10
|
-
|
|
11
|
-
Biome (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Core Principles
|
|
16
|
-
|
|
17
|
-
Write code that is **accessible, performant, type-safe, and maintainable**. Focus on clarity and explicit intent over brevity.
|
|
18
|
-
|
|
19
|
-
### Type Safety & Explicitness
|
|
20
|
-
|
|
21
|
-
- Use explicit types for function parameters and return values when they enhance clarity
|
|
22
|
-
- Prefer `unknown` over `any` when the type is genuinely unknown
|
|
23
|
-
- Use const assertions (`as const`) for immutable values and literal types
|
|
24
|
-
- Leverage TypeScript's type narrowing instead of type assertions
|
|
25
|
-
- Use meaningful variable names instead of magic numbers - extract constants with descriptive names
|
|
26
|
-
|
|
27
|
-
### Modern JavaScript/TypeScript
|
|
28
|
-
|
|
29
|
-
- Use arrow functions for callbacks and short functions
|
|
30
|
-
- Prefer `for...of` loops over `.forEach()` and indexed `for` loops
|
|
31
|
-
- Use optional chaining (`?.`) and nullish coalescing (`??`) for safer property access
|
|
32
|
-
- Prefer template literals over string concatenation
|
|
33
|
-
- Use destructuring for object and array assignments
|
|
34
|
-
- Use `const` by default, `let` only when reassignment is needed, never `var`
|
|
35
|
-
|
|
36
|
-
### Async & Promises
|
|
37
|
-
|
|
38
|
-
- Always `await` promises in async functions - don't forget to use the return value
|
|
39
|
-
- Use `async/await` syntax instead of promise chains for better readability
|
|
40
|
-
- Handle errors appropriately in async code with try-catch blocks
|
|
41
|
-
- Don't use async functions as Promise executors
|
|
42
|
-
|
|
43
|
-
### React & JSX
|
|
44
|
-
|
|
45
|
-
- Use function components over class components
|
|
46
|
-
- Call hooks at the top level only, never conditionally
|
|
47
|
-
- Specify all dependencies in hook dependency arrays correctly
|
|
48
|
-
- Use the `key` prop for elements in iterables (prefer unique IDs over array indices)
|
|
49
|
-
- Nest children between opening and closing tags instead of passing as props
|
|
50
|
-
- Don't define components inside other components
|
|
51
|
-
- Use semantic HTML and ARIA attributes for accessibility:
|
|
52
|
-
- Provide meaningful alt text for images
|
|
53
|
-
- Use proper heading hierarchy
|
|
54
|
-
- Add labels for form inputs
|
|
55
|
-
- Include keyboard event handlers alongside mouse events
|
|
56
|
-
- Use semantic elements (`<button>`, `<nav>`, etc.) instead of divs with roles
|
|
57
|
-
|
|
58
|
-
### Error Handling & Debugging
|
|
59
|
-
|
|
60
|
-
- Remove `console.log`, `debugger`, and `alert` statements from production code
|
|
61
|
-
- Throw `Error` objects with descriptive messages, not strings or other values
|
|
62
|
-
- Use `try-catch` blocks meaningfully - don't catch errors just to rethrow them
|
|
63
|
-
- Prefer early returns over nested conditionals for error cases
|
|
64
|
-
|
|
65
|
-
### Code Organization
|
|
66
|
-
|
|
67
|
-
- Keep functions focused and under reasonable cognitive complexity limits
|
|
68
|
-
- Extract complex conditions into well-named boolean variables
|
|
69
|
-
- Use early returns to reduce nesting
|
|
70
|
-
- Prefer simple conditionals over nested ternary operators
|
|
71
|
-
- Group related code together and separate concerns
|
|
72
|
-
|
|
73
|
-
### Security
|
|
74
|
-
|
|
75
|
-
- Add `rel="noopener"` when using `target="_blank"` on links
|
|
76
|
-
- Avoid `dangerouslySetInnerHTML` unless absolutely necessary
|
|
77
|
-
- Don't use `eval()` or assign directly to `document.cookie`
|
|
78
|
-
- Validate and sanitize user input
|
|
79
|
-
|
|
80
|
-
### Performance
|
|
81
|
-
|
|
82
|
-
- Avoid spread syntax in accumulators within loops
|
|
83
|
-
- Use top-level regex literals instead of creating them in loops
|
|
84
|
-
- Prefer specific imports over namespace imports
|
|
85
|
-
- Avoid barrel files (index files that re-export everything)
|
|
86
|
-
- Use proper image components (e.g., Next.js `<Image>`) over `<img>` tags
|
|
87
|
-
|
|
88
|
-
### Framework-Specific Guidance
|
|
89
|
-
|
|
90
|
-
**Next.js:**
|
|
91
|
-
- Use Next.js `<Image>` component for images
|
|
92
|
-
- Use `next/head` or App Router metadata API for head elements
|
|
93
|
-
- Use Server Components for async data fetching instead of async Client Components
|
|
94
|
-
|
|
95
|
-
**React 19+:**
|
|
96
|
-
- Use ref as a prop instead of `React.forwardRef`
|
|
97
|
-
|
|
98
|
-
**Solid/Svelte/Vue/Qwik:**
|
|
99
|
-
- Use `class` and `for` attributes (not `className` or `htmlFor`)
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Testing
|
|
104
|
-
|
|
105
|
-
- Write assertions inside `it()` or `test()` blocks
|
|
106
|
-
- Avoid done callbacks in async tests - use async/await instead
|
|
107
|
-
- Don't use `.only` or `.skip` in committed code
|
|
108
|
-
- Keep test suites reasonably flat - avoid excessive `describe` nesting
|
|
109
|
-
|
|
110
|
-
## When Biome Can't Help
|
|
111
|
-
|
|
112
|
-
Biome's linter will catch most issues automatically. Focus your attention on:
|
|
113
|
-
|
|
114
|
-
1. **Business logic correctness** - Biome can't validate your algorithms
|
|
115
|
-
2. **Meaningful naming** - Use descriptive names for functions, variables, and types
|
|
116
|
-
3. **Architecture decisions** - Component structure, data flow, and API design
|
|
117
|
-
4. **Edge cases** - Handle boundary conditions and error states
|
|
118
|
-
5. **User experience** - Accessibility, performance, and usability considerations
|
|
119
|
-
6. **Documentation** - Add comments for complex logic, but prefer self-documenting code
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
Most formatting and common issues are automatically fixed by Biome. Run `bun x ultracite fix` before committing to ensure compliance.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
# Ultracite Code Standards
|
|
127
|
-
|
|
128
|
-
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
|
|
129
|
-
|
|
130
|
-
## Quick Reference
|
|
131
|
-
|
|
132
|
-
- **Format code**: `npm exec -- ultracite fix`
|
|
133
|
-
- **Check for issues**: `npm exec -- ultracite check`
|
|
134
|
-
- **Diagnose setup**: `npm exec -- ultracite doctor`
|
|
135
|
-
|
|
136
|
-
Biome (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## Core Principles
|
|
141
|
-
|
|
142
|
-
Write code that is **accessible, performant, type-safe, and maintainable**. Focus on clarity and explicit intent over brevity.
|
|
143
|
-
|
|
144
|
-
### Type Safety & Explicitness
|
|
145
|
-
|
|
146
|
-
- Use explicit types for function parameters and return values when they enhance clarity
|
|
147
|
-
- Prefer `unknown` over `any` when the type is genuinely unknown
|
|
148
|
-
- Use const assertions (`as const`) for immutable values and literal types
|
|
149
|
-
- Leverage TypeScript's type narrowing instead of type assertions
|
|
150
|
-
- Use meaningful variable names instead of magic numbers - extract constants with descriptive names
|
|
151
|
-
|
|
152
|
-
### Modern JavaScript/TypeScript
|
|
153
|
-
|
|
154
|
-
- Use arrow functions for callbacks and short functions
|
|
155
|
-
- Prefer `for...of` loops over `.forEach()` and indexed `for` loops
|
|
156
|
-
- Use optional chaining (`?.`) and nullish coalescing (`??`) for safer property access
|
|
157
|
-
- Prefer template literals over string concatenation
|
|
158
|
-
- Use destructuring for object and array assignments
|
|
159
|
-
- Use `const` by default, `let` only when reassignment is needed, never `var`
|
|
160
|
-
|
|
161
|
-
### Async & Promises
|
|
162
|
-
|
|
163
|
-
- Always `await` promises in async functions - don't forget to use the return value
|
|
164
|
-
- Use `async/await` syntax instead of promise chains for better readability
|
|
165
|
-
- Handle errors appropriately in async code with try-catch blocks
|
|
166
|
-
- Don't use async functions as Promise executors
|
|
167
|
-
|
|
168
|
-
### React & JSX
|
|
169
|
-
|
|
170
|
-
- Use function components over class components
|
|
171
|
-
- Call hooks at the top level only, never conditionally
|
|
172
|
-
- Specify all dependencies in hook dependency arrays correctly
|
|
173
|
-
- Use the `key` prop for elements in iterables (prefer unique IDs over array indices)
|
|
174
|
-
- Nest children between opening and closing tags instead of passing as props
|
|
175
|
-
- Don't define components inside other components
|
|
176
|
-
- Use semantic HTML and ARIA attributes for accessibility:
|
|
177
|
-
- Provide meaningful alt text for images
|
|
178
|
-
- Use proper heading hierarchy
|
|
179
|
-
- Add labels for form inputs
|
|
180
|
-
- Include keyboard event handlers alongside mouse events
|
|
181
|
-
- Use semantic elements (`<button>`, `<nav>`, etc.) instead of divs with roles
|
|
182
|
-
|
|
183
|
-
### Error Handling & Debugging
|
|
184
|
-
|
|
185
|
-
- Remove `console.log`, `debugger`, and `alert` statements from production code
|
|
186
|
-
- Throw `Error` objects with descriptive messages, not strings or other values
|
|
187
|
-
- Use `try-catch` blocks meaningfully - don't catch errors just to rethrow them
|
|
188
|
-
- Prefer early returns over nested conditionals for error cases
|
|
189
|
-
|
|
190
|
-
### Code Organization
|
|
191
|
-
|
|
192
|
-
- Keep functions focused and under reasonable cognitive complexity limits
|
|
193
|
-
- Extract complex conditions into well-named boolean variables
|
|
194
|
-
- Use early returns to reduce nesting
|
|
195
|
-
- Prefer simple conditionals over nested ternary operators
|
|
196
|
-
- Group related code together and separate concerns
|
|
197
|
-
|
|
198
|
-
### Security
|
|
199
|
-
|
|
200
|
-
- Add `rel="noopener"` when using `target="_blank"` on links
|
|
201
|
-
- Avoid `dangerouslySetInnerHTML` unless absolutely necessary
|
|
202
|
-
- Don't use `eval()` or assign directly to `document.cookie`
|
|
203
|
-
- Validate and sanitize user input
|
|
204
|
-
|
|
205
|
-
### Performance
|
|
206
|
-
|
|
207
|
-
- Avoid spread syntax in accumulators within loops
|
|
208
|
-
- Use top-level regex literals instead of creating them in loops
|
|
209
|
-
- Prefer specific imports over namespace imports
|
|
210
|
-
- Avoid barrel files (index files that re-export everything)
|
|
211
|
-
- Use proper image components (e.g., Next.js `<Image>`) over `<img>` tags
|
|
212
|
-
|
|
213
|
-
### Framework-Specific Guidance
|
|
214
|
-
|
|
215
|
-
**Next.js:**
|
|
216
|
-
- Use Next.js `<Image>` component for images
|
|
217
|
-
- Use `next/head` or App Router metadata API for head elements
|
|
218
|
-
- Use Server Components for async data fetching instead of async Client Components
|
|
219
|
-
|
|
220
|
-
**React 19+:**
|
|
221
|
-
- Use ref as a prop instead of `React.forwardRef`
|
|
222
|
-
|
|
223
|
-
**Solid/Svelte/Vue/Qwik:**
|
|
224
|
-
- Use `class` and `for` attributes (not `className` or `htmlFor`)
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## Testing
|
|
229
|
-
|
|
230
|
-
- Write assertions inside `it()` or `test()` blocks
|
|
231
|
-
- Avoid done callbacks in async tests - use async/await instead
|
|
232
|
-
- Don't use `.only` or `.skip` in committed code
|
|
233
|
-
- Keep test suites reasonably flat - avoid excessive `describe` nesting
|
|
234
|
-
|
|
235
|
-
## When Biome Can't Help
|
|
236
|
-
|
|
237
|
-
Biome's linter will catch most issues automatically. Focus your attention on:
|
|
238
|
-
|
|
239
|
-
1. **Business logic correctness** - Biome can't validate your algorithms
|
|
240
|
-
2. **Meaningful naming** - Use descriptive names for functions, variables, and types
|
|
241
|
-
3. **Architecture decisions** - Component structure, data flow, and API design
|
|
242
|
-
4. **Edge cases** - Handle boundary conditions and error states
|
|
243
|
-
5. **User experience** - Accessibility, performance, and usability considerations
|
|
244
|
-
6. **Documentation** - Add comments for complex logic, but prefer self-documenting code
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
Most formatting and common issues are automatically fixed by Biome. Run `npm exec -- ultracite fix` before committing to ensure compliance.
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
# Contributing to GitHub Archiver
|
|
2
|
-
|
|
3
|
-
Thank you for your interest in contributing to GitHub Archiver! This document provides guidelines and instructions for contributing.
|
|
4
|
-
|
|
5
|
-
## Code of Conduct
|
|
6
|
-
|
|
7
|
-
Be respectful, inclusive, and constructive in all interactions.
|
|
8
|
-
|
|
9
|
-
## Getting Started
|
|
10
|
-
|
|
11
|
-
### Prerequisites
|
|
12
|
-
- Node.js 18+
|
|
13
|
-
- npm or bun
|
|
14
|
-
- Git
|
|
15
|
-
|
|
16
|
-
### Setup Development Environment
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# Clone the repository
|
|
20
|
-
git clone https://github.com/mynameistito/github-archiver.git
|
|
21
|
-
cd github-archiver
|
|
22
|
-
|
|
23
|
-
# Install dependencies
|
|
24
|
-
npm install
|
|
25
|
-
|
|
26
|
-
# Verify setup
|
|
27
|
-
npm run typecheck
|
|
28
|
-
npm run test
|
|
29
|
-
npm run build
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Development Workflow
|
|
33
|
-
|
|
34
|
-
### 1. Create a Branch
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
git checkout -b feature/your-feature-name
|
|
38
|
-
# or
|
|
39
|
-
git checkout -b fix/your-bug-fix
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Use descriptive branch names:
|
|
43
|
-
- `feature/` for new features
|
|
44
|
-
- `fix/` for bug fixes
|
|
45
|
-
- `docs/` for documentation
|
|
46
|
-
- `test/` for test additions
|
|
47
|
-
- `refactor/` for code improvements
|
|
48
|
-
|
|
49
|
-
### 2. Make Changes
|
|
50
|
-
|
|
51
|
-
Follow the code standards below and make atomic commits with clear messages.
|
|
52
|
-
|
|
53
|
-
### 3. Test Your Changes
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# Run tests
|
|
57
|
-
npm run test
|
|
58
|
-
|
|
59
|
-
# Check TypeScript
|
|
60
|
-
npm run typecheck
|
|
61
|
-
|
|
62
|
-
# Check code style
|
|
63
|
-
npm run lint
|
|
64
|
-
|
|
65
|
-
# Auto-format code
|
|
66
|
-
npm run format
|
|
67
|
-
|
|
68
|
-
# Build the project
|
|
69
|
-
npm run build
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### 4. Submit a Pull Request
|
|
73
|
-
|
|
74
|
-
Push your branch and create a PR with:
|
|
75
|
-
- Clear title describing the change
|
|
76
|
-
- Detailed description of what and why
|
|
77
|
-
- Reference to any related issues
|
|
78
|
-
- Screenshots/examples if applicable
|
|
79
|
-
|
|
80
|
-
## Code Standards
|
|
81
|
-
|
|
82
|
-
This project uses **Ultracite** (Biome-based) code standards. Key principles:
|
|
83
|
-
|
|
84
|
-
### Type Safety
|
|
85
|
-
- Always use explicit types for function parameters and returns
|
|
86
|
-
- Use `unknown` instead of `any` when type is genuinely unknown
|
|
87
|
-
- No implicit `any` allowed
|
|
88
|
-
- Leverage TypeScript's type narrowing
|
|
89
|
-
|
|
90
|
-
### Error Handling
|
|
91
|
-
- Throw `Error` objects with descriptive messages, not strings
|
|
92
|
-
- Use meaningful error messages with context
|
|
93
|
-
- Provide recovery suggestions in user-facing errors
|
|
94
|
-
- Use try-catch for async operations appropriately
|
|
95
|
-
|
|
96
|
-
### Code Organization
|
|
97
|
-
- Keep functions focused and reasonably sized
|
|
98
|
-
- Extract complex conditions into named boolean variables
|
|
99
|
-
- Use early returns to reduce nesting
|
|
100
|
-
- Group related code together
|
|
101
|
-
|
|
102
|
-
### Async/Promises
|
|
103
|
-
- Always `await` promises in async functions
|
|
104
|
-
- Use `async/await` instead of promise chains
|
|
105
|
-
- Handle errors appropriately
|
|
106
|
-
|
|
107
|
-
### Testing
|
|
108
|
-
- Write assertions inside `it()` or `test()` blocks
|
|
109
|
-
- Avoid done callbacks - use async/await
|
|
110
|
-
- Don't use `.only` or `.skip` in committed code
|
|
111
|
-
- Keep test suites flat
|
|
112
|
-
|
|
113
|
-
### Security
|
|
114
|
-
- Add `rel="noopener"` when using `target="_blank"`
|
|
115
|
-
- Avoid `dangerouslySetInnerHTML`
|
|
116
|
-
- Don't use `eval()` or direct `document.cookie` assignment
|
|
117
|
-
- Validate and sanitize user input
|
|
118
|
-
|
|
119
|
-
### Performance
|
|
120
|
-
- Avoid spread syntax in loop accumulators
|
|
121
|
-
- Use top-level regex literals, not in loops
|
|
122
|
-
- Prefer specific imports over namespaces
|
|
123
|
-
- Avoid barrel files (index.ts re-exports)
|
|
124
|
-
|
|
125
|
-
## Before Committing
|
|
126
|
-
|
|
127
|
-
Always run these checks:
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
# Format code
|
|
131
|
-
npm run format
|
|
132
|
-
|
|
133
|
-
# Type check
|
|
134
|
-
npm run typecheck
|
|
135
|
-
|
|
136
|
-
# Run tests
|
|
137
|
-
npm run test
|
|
138
|
-
|
|
139
|
-
# Lint
|
|
140
|
-
npm run lint
|
|
141
|
-
|
|
142
|
-
# Build
|
|
143
|
-
npm run build
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
All of these must pass before submitting a PR.
|
|
147
|
-
|
|
148
|
-
## Architecture Guidelines
|
|
149
|
-
|
|
150
|
-
### Project Structure
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
src/
|
|
154
|
-
├── commands/ # CLI command implementations
|
|
155
|
-
├── services/ # Business logic services
|
|
156
|
-
├── utils/ # Reusable utilities
|
|
157
|
-
├── types/ # TypeScript interfaces and types
|
|
158
|
-
└── constants/ # Configuration and constants
|
|
159
|
-
|
|
160
|
-
tests/
|
|
161
|
-
└── unit/ # Unit tests
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Adding New Features
|
|
165
|
-
|
|
166
|
-
1. **Define Types First**: Add interfaces/types in `src/types/`
|
|
167
|
-
2. **Create Service**: Add business logic in `src/services/`
|
|
168
|
-
3. **Add Utility Functions**: Extract reusable logic to `src/utils/`
|
|
169
|
-
4. **Create Command**: Implement CLI command in `src/commands/`
|
|
170
|
-
5. **Write Tests**: Add tests in `tests/unit/`
|
|
171
|
-
6. **Update Documentation**: Update README and CHANGELOG
|
|
172
|
-
|
|
173
|
-
### Adding New Commands
|
|
174
|
-
|
|
175
|
-
1. Create new file in `src/commands/your-command.ts`
|
|
176
|
-
2. Export a `createYourCommand()` function returning `Command`
|
|
177
|
-
3. Register in `src/index.ts`
|
|
178
|
-
4. Add tests in `tests/unit/your-command.test.ts`
|
|
179
|
-
5. Document in README.md
|
|
180
|
-
|
|
181
|
-
Example:
|
|
182
|
-
```typescript
|
|
183
|
-
// src/commands/your-command.ts
|
|
184
|
-
import { Command } from 'commander'
|
|
185
|
-
|
|
186
|
-
export function createYourCommand(): Command {
|
|
187
|
-
return new Command('your-command')
|
|
188
|
-
.description('What this command does')
|
|
189
|
-
.option('--option <value>', 'Option description')
|
|
190
|
-
.action(async (options) => {
|
|
191
|
-
// Implementation
|
|
192
|
-
})
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## Commit Message Guidelines
|
|
197
|
-
|
|
198
|
-
Use clear, descriptive commit messages:
|
|
199
|
-
|
|
200
|
-
```
|
|
201
|
-
feat: add new feature description
|
|
202
|
-
fix: fix specific bug
|
|
203
|
-
docs: update documentation
|
|
204
|
-
test: add tests for feature
|
|
205
|
-
refactor: improve code organization
|
|
206
|
-
chore: update dependencies or config
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
Example:
|
|
210
|
-
```
|
|
211
|
-
feat: add support for archiving by repository age
|
|
212
|
-
|
|
213
|
-
- Allow filtering repositories older than X days
|
|
214
|
-
- Add --min-age and --max-age options
|
|
215
|
-
- Add tests for age-based filtering
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
## Pull Request Checklist
|
|
219
|
-
|
|
220
|
-
Before submitting:
|
|
221
|
-
|
|
222
|
-
- [ ] Code follows Ultracite standards
|
|
223
|
-
- [ ] All tests pass (`npm run test`)
|
|
224
|
-
- [ ] TypeScript compilation succeeds (`npm run typecheck`)
|
|
225
|
-
- [ ] Code is formatted (`npm run format`)
|
|
226
|
-
- [ ] Linting passes (`npm run lint`)
|
|
227
|
-
- [ ] Build succeeds (`npm run build`)
|
|
228
|
-
- [ ] Commit messages are clear and descriptive
|
|
229
|
-
- [ ] PR description explains the changes
|
|
230
|
-
- [ ] Related issues are referenced
|
|
231
|
-
- [ ] Documentation is updated if needed
|
|
232
|
-
|
|
233
|
-
## Testing Guidelines
|
|
234
|
-
|
|
235
|
-
### Unit Tests
|
|
236
|
-
- Test utilities and isolated functions
|
|
237
|
-
- Use descriptive test names
|
|
238
|
-
- Keep tests focused on one thing
|
|
239
|
-
- Mock external dependencies
|
|
240
|
-
|
|
241
|
-
Example:
|
|
242
|
-
```typescript
|
|
243
|
-
import { describe, it, expect } from 'vitest'
|
|
244
|
-
import { URLParser } from '../utils/parser'
|
|
245
|
-
|
|
246
|
-
describe('URLParser', () => {
|
|
247
|
-
it('should parse HTTPS GitHub URLs', () => {
|
|
248
|
-
const result = URLParser.parseRepositoryUrl('https://github.com/owner/repo')
|
|
249
|
-
expect(result.owner).toBe('owner')
|
|
250
|
-
expect(result.repo).toBe('repo')
|
|
251
|
-
})
|
|
252
|
-
})
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
### Integration Tests
|
|
256
|
-
- Test command workflows end-to-end
|
|
257
|
-
- Use mock GitHub responses
|
|
258
|
-
- Verify complete user flows
|
|
259
|
-
- Test error scenarios
|
|
260
|
-
|
|
261
|
-
## Documentation Guidelines
|
|
262
|
-
|
|
263
|
-
When adding features:
|
|
264
|
-
|
|
265
|
-
1. Update README.md with:
|
|
266
|
-
- Command description
|
|
267
|
-
- Usage examples
|
|
268
|
-
- Options and parameters
|
|
269
|
-
- Troubleshooting tips
|
|
270
|
-
|
|
271
|
-
2. Update CHANGELOG.md with:
|
|
272
|
-
- Feature description
|
|
273
|
-
- Breaking changes (if any)
|
|
274
|
-
- Migration guide (if needed)
|
|
275
|
-
|
|
276
|
-
3. Add code comments for:
|
|
277
|
-
- Complex algorithms
|
|
278
|
-
- Non-obvious business logic
|
|
279
|
-
- Important decisions
|
|
280
|
-
|
|
281
|
-
## Reporting Issues
|
|
282
|
-
|
|
283
|
-
When reporting bugs:
|
|
284
|
-
|
|
285
|
-
1. **Check existing issues** - Don't duplicate
|
|
286
|
-
2. **Provide details**:
|
|
287
|
-
- OS and Node version
|
|
288
|
-
- Steps to reproduce
|
|
289
|
-
- Expected vs actual behavior
|
|
290
|
-
- Error messages and logs
|
|
291
|
-
- Screenshots if applicable
|
|
292
|
-
|
|
293
|
-
3. **Example issue**:
|
|
294
|
-
```
|
|
295
|
-
Title: Archive command fails with permission error
|
|
296
|
-
|
|
297
|
-
Steps to reproduce:
|
|
298
|
-
1. Run `github-archiver auth login`
|
|
299
|
-
2. Run `github-archiver archive --file repos.txt`
|
|
300
|
-
3. Wait for processing...
|
|
301
|
-
|
|
302
|
-
Expected: Repositories should be archived
|
|
303
|
-
Actual: Permission denied error appears
|
|
304
|
-
|
|
305
|
-
Environment:
|
|
306
|
-
- OS: Windows 11
|
|
307
|
-
- Node: 18.12.0
|
|
308
|
-
- CLI version: 1.0.0
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
## Feature Requests
|
|
312
|
-
|
|
313
|
-
When requesting features:
|
|
314
|
-
|
|
315
|
-
1. **Be specific** about what you need
|
|
316
|
-
2. **Explain the use case** and why it's useful
|
|
317
|
-
3. **Consider alternatives** you've tried
|
|
318
|
-
4. **Provide examples** if applicable
|
|
319
|
-
|
|
320
|
-
Example:
|
|
321
|
-
```
|
|
322
|
-
Title: Add option to archive repositories by age
|
|
323
|
-
|
|
324
|
-
Description:
|
|
325
|
-
I need a way to archive all repositories that haven't
|
|
326
|
-
been updated in more than a year. Currently I have to
|
|
327
|
-
manually check each repository.
|
|
328
|
-
|
|
329
|
-
Suggested solution:
|
|
330
|
-
Add --min-age and --max-age options to filter repositories
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
## Questions?
|
|
334
|
-
|
|
335
|
-
- Check existing issues and discussions
|
|
336
|
-
- Open a new issue to ask for help
|
|
337
|
-
- Start a discussion for design questions
|
|
338
|
-
|
|
339
|
-
## License
|
|
340
|
-
|
|
341
|
-
By contributing, you agree that your contributions will be licensed under the same MIT license as the project.
|
|
342
|
-
|
|
343
|
-
Thank you for contributing! 🎉
|