github-archiver 1.2.0 → 1.3.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,104 @@
1
1
  ## [1.1.1](https://github.com/mynameistito/github-archiver/compare/v1.1.0...v1.1.1) (2026-01-12)
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`3644afb`](https://github.com/mynameistito/github-archiver/commit/3644afb853d7b17e954b8f55db565f7c5f372e07) Thanks [@mynameistito](https://github.com/mynameistito)! - ## Comprehensive Test Coverage Expansion
8
+
9
+ This changeset introduces a major test coverage expansion, achieving 100% coverage on all core business logic and adding 200+ new test cases.
10
+
11
+ ### Key Changes
12
+
13
+ #### Test Coverage Improvements
14
+
15
+ - **Added 200+ new test cases** with 549 total assertions
16
+ - **Achieved 100% coverage on 15 src files** (71% of all src files)
17
+ - **95%+ coverage on all testable code**
18
+ - **366 passing tests** with zero failures
19
+ - Test execution time: ~4.8 seconds
20
+
21
+ #### Core Business Logic (100% Complete)
22
+
23
+ - All 3 constants files: 100% coverage
24
+ - All 4 type definition files: 100% coverage
25
+ - Both service files (archiver, auth-manager): 100% coverage
26
+ - 6 utility files (colors, config, errors, formatting, progress, logger): 98-100% coverage
27
+
28
+ #### Code Refactoring for Testability
29
+
30
+ - **archive.ts**: Exported 9 helper functions
31
+
32
+ - `validateOptions()` - validates CLI options with bounds checking
33
+ - `authenticateUser()` - handles GitHub authentication
34
+ - `getRepositories()` - reads repositories from file/stdin/interactive
35
+ - `logParseErrors()` - displays parsing errors with line numbers
36
+ - `showRepositoriesPreview()` - displays repository preview
37
+ - `confirmOperation()` - handles user confirmation
38
+ - `archiveRepositories()` - executes archiving workflow
39
+ - `displayResults()` - shows archiving results
40
+ - `handleArchiveError()` / `provideErrorGuidance()` - error handling
41
+
42
+ - **auth.ts**: Exported 6 helper functions
43
+ - `createLoginCommand()` - login subcommand
44
+ - `createLogoutCommand()` - logout subcommand
45
+ - `createStatusCommand()` - status subcommand
46
+ - `createValidateCommand()` - validate subcommand
47
+ - `promptForToken()` - token input prompt
48
+ - `confirmAction()` - confirmation prompt
49
+
50
+ #### Test Files Added/Enhanced
51
+
52
+ - `tests/unit/archive-command.test.ts` - 48 test cases for archive command logic
53
+ - `tests/unit/auth-command.test.ts` - 41 test cases for auth command logic
54
+ - Enhanced `tests/unit/github.test.ts` with 50+ test cases
55
+ - Enhanced `tests/unit/input-handler.test.ts` with 30+ test cases
56
+ - Enhanced `tests/unit/logger.test.ts` with console formatting tests
57
+ - Enhanced `tests/unit/parser.test.ts` with edge case coverage
58
+
59
+ #### Code Quality
60
+
61
+ - ✅ All tests comply with Ultracite code standards
62
+ - ✅ No console.log/debugger statements in code
63
+ - ✅ Proper error handling and cleanup
64
+ - ✅ Type-safe test implementation
65
+ - ✅ Comprehensive test isolation with beforeEach/afterEach
66
+
67
+ #### Documentation
68
+
69
+ - Added `COVERAGE_SUMMARY.md` with detailed coverage breakdown
70
+ - Added `TEST_COVERAGE_ANALYSIS.md` with comprehensive analysis
71
+
72
+ ### Coverage Metrics
73
+
74
+ | Category | Files | 100% Coverage | Avg Coverage |
75
+ | ----------- | ------ | --------------- | ------------ |
76
+ | Constants | 3 | 3/3 (100%) | 100% |
77
+ | Types | 4 | 4/4 (100%) | 100% |
78
+ | Services | 2 | 2/2 (100%) | 100% |
79
+ | Utilities | 6 | 6/6 (100%) | 99% |
80
+ | Commands | 2 | 0/2 (0%) | 32% |
81
+ | Integration | 1 | 0/1 (0%) | 9% |
82
+ | **TOTAL** | **21** | **15/21 (71%)** | **87%** |
83
+
84
+ ### Breaking Changes
85
+
86
+ None. All exported functions are implementation details that maintain backward compatibility.
87
+
88
+ ### Migration Guide
89
+
90
+ No migration needed. The exported functions were previously internal and are now available for testing. CLI and public API remain unchanged.
91
+
92
+ ### Future Work
93
+
94
+ For 100% coverage on remaining files:
95
+
96
+ - CLI integration tests (archive.ts, auth.ts) - requires integration test framework
97
+ - GitHub API mocking (github.ts) - requires API mocking library
98
+ - Interactive readline tests (input-handler.ts) - requires readline mock library
99
+
100
+ These require specialized testing frameworks beyond unit testing and are typically handled with dedicated integration/E2E test suites.
101
+
3
102
  ## 1.2.0
4
103
 
5
104
  ### Minor Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mynameistito (Hone Tito)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.