svger-cli 2.0.8 โ†’ 3.1.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
@@ -5,6 +5,327 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
6
6
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.1.0] - 2025-12-04
9
+
10
+ ### ๐Ÿš€ Major Improvements - Testing & DevOps
11
+
12
+ This release brings comprehensive testing infrastructure and production-grade CI/CD pipelines, significantly improving project reliability and developer experience.
13
+
14
+ ### Added - Testing Infrastructure
15
+
16
+ #### **Comprehensive Test Suite** ๐Ÿ“‹
17
+ - โœ… **114 automated tests** covering unit, integration, and E2E scenarios
18
+ - โœ… **Jest integration** with TypeScript support and ESM modules
19
+ - โœ… **82.5% initial pass rate** with well-structured test cases
20
+ - โœ… **7 test suites**:
21
+ - `builder.test.ts` - Build orchestration and parallel processing (7 tests)
22
+ - `cli.test.ts` - CLI command parsing and execution (13 tests)
23
+ - `config-service.test.ts` - Configuration validation and loading (17 tests)
24
+ - `integration.test.ts` - End-to-end workflow testing (19 tests)
25
+ - `svg-processor.test.ts` - SVG parsing and optimization (11 tests)
26
+ - `templates.test.ts` - Framework template generation (22 tests)
27
+ - `utils.test.ts` - Utility functions and FileSystem operations (26 tests)
28
+ - โœ… **Test fixtures** with 11 SVG variations (simple, complex, nested, gradients, accessibility, animated)
29
+ - โœ… **Code coverage** configured with 70% threshold across branches, functions, lines, statements
30
+ - โœ… **Coverage reporters**: text, text-summary, lcov, html, json, clover
31
+ - โœ… **Test documentation** in `src/__tests__/README.md` with best practices and debugging guides
32
+
33
+ #### **New Test Scripts** ๐Ÿงช
34
+ - `npm run test:jest` - Run all Jest tests
35
+ - `npm run test:unit` - Run unit tests only
36
+ - `npm run test:watch` - Watch mode for development
37
+ - `npm run test:coverage` - Generate coverage reports
38
+ - `npm test` - Run complete test suite (Jest + framework + config + E2E + integrations)
39
+
40
+ ### Added - CI/CD Infrastructure
41
+
42
+ #### **GitHub Actions Workflows** ๐Ÿ”„
43
+ - โœ… **Release workflow** (`.github/workflows/release.yml`):
44
+ - Automated version bumping and changelog generation
45
+ - Multi-platform Docker builds (linux/amd64, linux/arm64)
46
+ - NPM package publishing with provenance
47
+ - Documentation deployment to GitHub Pages
48
+ - Codecov integration for coverage tracking
49
+ - Snyk security scanning
50
+ - Slack notifications for releases
51
+ - GitHub Release creation with assets
52
+ - โœ… **CI workflow** enhancements for automated testing
53
+
54
+ #### **Jenkins Pipeline** ๐Ÿ—๏ธ
55
+ - โœ… **Complete Jenkinsfile** with 11 stages:
56
+ 1. Checkout - Git repository cloning
57
+ 2. Setup - Node.js environment configuration
58
+ 3. Install - Dependency installation with caching
59
+ 4. Lint - Code quality checks
60
+ 5. Build - TypeScript compilation
61
+ 6. Test - Parallel test execution (unit, integration, E2E)
62
+ 7. Security - Dependency vulnerability scanning
63
+ 8. Package - NPM package creation
64
+ 9. Docker - Multi-architecture image builds
65
+ 10. Release - Version management and publishing
66
+ 11. Push - Docker registry updates
67
+ - โœ… **Build parameters** for version bumping and branch selection
68
+ - โœ… **Parallel execution** for faster builds
69
+ - โœ… **Artifact preservation** and workspace cleanup
70
+ - โœ… **Email notifications** for build status
71
+
72
+ #### **Docker Support** ๐Ÿณ
73
+ - โœ… **Multi-stage Dockerfile**:
74
+ - Alpine-based production image
75
+ - Non-root user for security
76
+ - Health checks configured
77
+ - Multi-architecture support (amd64, arm64)
78
+ - Optimized layer caching
79
+ - โœ… **docker-compose.yml** with 6 profiles:
80
+ - `dev` - Development environment with volume mounts
81
+ - `prod` - Production deployment
82
+ - `test` - Test execution environment
83
+ - `watch` - File watching for auto-rebuild
84
+ - `ci` - CI/CD pipeline execution
85
+ - `docs` - Documentation server (nginx)
86
+ - โœ… **Docker optimization**:
87
+ - `.dockerignore` for efficient builds
88
+ - Volume mounts for workspace persistence
89
+ - Environment variable configuration
90
+ - Network isolation
91
+
92
+ #### **Validation & Documentation** ๐Ÿ“š
93
+ - โœ… **CI/CD validation script** (`scripts/validate-cicd.sh`):
94
+ - Project structure verification
95
+ - NPM scripts validation
96
+ - Dependencies check
97
+ - TypeScript configuration
98
+ - Build verification
99
+ - YAML syntax validation
100
+ - Docker and Jenkinsfile validation
101
+ - Security and documentation checks
102
+ - โœ… **Comprehensive documentation**:
103
+ - `CICD.md` - Complete CI/CD setup guide
104
+ - `CICD-QUICKREF.md` - Quick reference for developers
105
+ - `CICD-SETUP-CHECKLIST.md` - Step-by-step setup instructions
106
+ - `CI-CD-IMPLEMENTATION-REPORT.md` - Implementation summary
107
+ - `TEST-SUITE-SUMMARY.md` - Test suite documentation
108
+
109
+ ### Changed - Configuration
110
+
111
+ #### **Jest Configuration**
112
+ - ๐Ÿ”ง Renamed `jest.config.js` โ†’ `jest.config.cjs` for ES module compatibility
113
+ - ๐Ÿ”ง Renamed `jest.setup.js` โ†’ `jest.setup.cjs`
114
+ - ๐Ÿ”ง Updated module name mapper for `.js` extension handling
115
+ - ๐Ÿ”ง Added test path ignoring for build artifacts and temporary files
116
+ - ๐Ÿ”ง Configured parallel execution with 50% max workers
117
+ - ๐Ÿ”ง Added fixtures exclusion from test runs
118
+
119
+ #### **Package.json**
120
+ - ๐Ÿ”ง Updated test scripts to include Jest integration
121
+ - ๐Ÿ”ง Added new npm scripts for granular test execution
122
+ - ๐Ÿ”ง Main test script now runs comprehensive suite
123
+
124
+ ### Improved - Developer Experience
125
+
126
+ #### **Documentation**
127
+ - ๐Ÿ“– **README.md** enhanced with:
128
+ - Complete project structure tree
129
+ - NPM download and version badges
130
+ - Test suite information
131
+ - CI/CD pipeline documentation links
132
+ - ๐Ÿ“– **Test documentation** with:
133
+ - Writing tests best practices
134
+ - Debugging guides
135
+ - CI/CD integration instructions
136
+ - Troubleshooting section
137
+ - Coverage information
138
+
139
+ #### **Code Quality**
140
+ - โœจ Structured test organization following industry standards
141
+ - โœจ AAA pattern (Arrange, Act, Assert) in test cases
142
+ - โœจ Proper cleanup with beforeEach/afterEach hooks
143
+ - โœจ Comprehensive edge case coverage
144
+ - โœจ Reusable test fixtures and utilities
145
+
146
+ ### Fixed
147
+
148
+ - ๐Ÿ› Jest configuration compatibility with ES modules
149
+ - ๐Ÿ› TypeScript compilation in test environment
150
+ - ๐Ÿ› Module resolution for test imports
151
+ - ๐Ÿ› Docker permission handling in validation scripts
152
+
153
+ ### Security
154
+
155
+ - ๐Ÿ”’ Snyk integration for vulnerability scanning
156
+ - ๐Ÿ”’ Automated dependency auditing in CI/CD
157
+ - ๐Ÿ”’ Non-root Docker user for container security
158
+ - ๐Ÿ”’ NPM provenance for package authenticity
159
+
160
+ ### Performance
161
+
162
+ - โšก Parallel test execution for faster validation
163
+ - โšก Docker layer caching optimization
164
+ - โšก Multi-stage builds for smaller images
165
+ - โšก Jest worker optimization (50% CPU allocation)
166
+
167
+ ### Testing Coverage
168
+
169
+ - ๐ŸŽฏ **94/114 tests passing** (82.5% success rate)
170
+ - ๐ŸŽฏ **4/7 test suites** fully passing
171
+ - ๐ŸŽฏ Coverage targets: 70% for branches, functions, lines, statements
172
+ - ๐ŸŽฏ Multiple coverage formats: text, lcov, html, json, clover
173
+
174
+ ### CI/CD Metrics
175
+
176
+ - ๐Ÿ“Š **11-stage Jenkins pipeline** for complete automation
177
+ - ๐Ÿ“Š **6 Docker Compose profiles** for different environments
178
+ - ๐Ÿ“Š **Multi-architecture builds** (linux/amd64, linux/arm64)
179
+ - ๐Ÿ“Š **Automated release workflow** with GitHub Actions
180
+ - ๐Ÿ“Š **Comprehensive validation** with 10+ checks
181
+
182
+ ---
183
+
184
+ ## [3.0.0] - 2025-11-26
185
+
186
+ ### ๐ŸŽ‰ Major Release - Official Build Tool Integrations
187
+
188
+ This major release introduces **official build tool integrations**, making SVGER-CLI the most
189
+ comprehensive SVG-to-component solution with first-class support for all major build tools and
190
+ frameworks.
191
+
192
+ ### Added - Build Tool Integrations
193
+
194
+ #### **Webpack Integration** (`svger-cli/webpack`)
195
+
196
+ - โœ… Full webpack plugin with HMR (Hot Module Replacement) support
197
+ - โœ… Webpack loader for inline SVG transformation
198
+ - โœ… Watch mode with intelligent debouncing
199
+ - โœ… Asset emission directly to webpack compilation
200
+ - โœ… TypeScript support with full type definitions
201
+ - โœ… Multi-framework support (React, Vue, Angular, etc.)
202
+
203
+ #### **Vite Plugin** (`svger-cli/vite`)
204
+
205
+ - โœ… Native Vite plugin with lightning-fast HMR
206
+ - โœ… Virtual module support for dynamic imports
207
+ - โœ… Dev server integration with instant updates
208
+ - โœ… Build optimization and tree-shaking
209
+ - โœ… Named and default export options
210
+ - โœ… Source map generation
211
+
212
+ #### **Rollup Plugin** (`svger-cli/rollup`)
213
+
214
+ - โœ… Full Rollup plugin with tree-shaking support
215
+ - โœ… Load and transform hooks for SVG files
216
+ - โœ… Source map generation for debugging
217
+ - โœ… Bundle optimization for production
218
+ - โœ… Library-friendly named exports
219
+ - โœ… Zero runtime overhead
220
+
221
+ #### **Babel Plugin** (`svger-cli/babel`)
222
+
223
+ - โœ… Complete Babel plugin with visitor pattern
224
+ - โœ… Automatic import transformation (SVG โ†’ Component)
225
+ - โœ… Dynamic import support (`import('./icon.svg')`)
226
+ - โœ… Pre-build SVG processing
227
+ - โœ… Works with Create React App, Gatsby, Vue CLI
228
+ - โœ… Framework-agnostic with full TypeScript support
229
+
230
+ #### **Next.js Integration** (`svger-cli/nextjs`)
231
+
232
+ - โœ… `withSvger` wrapper for seamless Next.js integration
233
+ - โœ… Server-Side Rendering (SSR) support
234
+ - โœ… App Router and Pages Router compatibility
235
+ - โœ… Webpack configuration extension
236
+ - โœ… Hot Module Replacement for development
237
+ - โœ… TypeScript support out of the box
238
+
239
+ #### **Jest Preset** (`svger-cli/jest`)
240
+
241
+ - โœ… Complete Jest transformer for SVG files
242
+ - โœ… Jest preset configuration
243
+ - โœ… Custom transformer factory
244
+ - โœ… Mock mode for faster test execution
245
+ - โœ… CommonJS and ES module support
246
+ - โœ… Multi-framework compatibility
247
+
248
+ ### Added - Package Infrastructure
249
+
250
+ - **11 New Export Paths**: Added dedicated exports for all integrations
251
+ - `./webpack`, `./webpack-loader`
252
+ - `./vite`
253
+ - `./rollup`
254
+ - `./babel`, `./babel-plugin`
255
+ - `./nextjs`
256
+ - `./jest`, `./jest-transformer`, `./jest-preset`
257
+
258
+ - **Comprehensive Documentation**:
259
+ - New `docs/INTEGRATIONS.md` - Complete integration guide (500+ lines)
260
+ - New `docs/INTEGRATION-IMPLEMENTATION-SUMMARY.md` - Implementation overview
261
+ - 6 example configuration files in `examples/` directory
262
+ - Updated API documentation with integration examples
263
+
264
+ - **Enhanced Testing**:
265
+ - New integration verification test suite
266
+ - 100% integration test coverage (7/7 passing)
267
+ - Automated testing for all build tool integrations
268
+ - New `test:integrations` npm script
269
+
270
+ - **Updated Keywords**: Added 18+ new npm keywords:
271
+ - Build tools: `webpack`, `webpack-plugin`, `webpack-loader`
272
+ - Bundlers: `vite`, `vite-plugin`, `rollup`, `rollup-plugin`
273
+ - Transpilers: `babel`, `babel-plugin`, `babel-transform`
274
+ - Frameworks: `nextjs`, `next-js`
275
+ - Testing: `jest`, `jest-preset`, `jest-transformer`
276
+ - General: `build-tools`, `bundler`, `hmr`, `hot-module-replacement`
277
+
278
+ ### Changed
279
+
280
+ - **Package Description**: Updated to highlight official build tool integrations
281
+ - **Main Index**: Reorganized exports to include all integration plugins
282
+ - **Type Definitions**: Enhanced TypeScript types for all integrations
283
+ - **Documentation Structure**: Improved organization with dedicated integration docs
284
+
285
+ ### Features Comparison
286
+
287
+ | Feature | Webpack | Vite | Rollup | Babel | Next.js | Jest |
288
+ | ------------------ | ------- | ---- | ------ | ----- | ------- | ---- |
289
+ | HMR Support | โœ… | โœ… | โŒ | โŒ | โœ… | N/A |
290
+ | Source Maps | โœ… | โœ… | โœ… | โŒ | โœ… | โŒ |
291
+ | SSR Support | โŒ | โœ… | โŒ | โŒ | โœ… | N/A |
292
+ | Virtual Modules | โŒ | โœ… | โŒ | โŒ | โŒ | N/A |
293
+ | Watch Mode | โœ… | โœ… | โœ… | โœ… | โœ… | N/A |
294
+ | Import Transform | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… |
295
+ | Dynamic Imports | โœ… | โœ… | โœ… | โœ… | โœ… | โŒ |
296
+ | Framework Agnostic | โœ… | โœ… | โœ… | โœ… | โŒ | โœ… |
297
+
298
+ ### Migration Guide from 2.x to 3.0
299
+
300
+ **No Breaking Changes for CLI Users**: If you're using the CLI (`svger-cli`), everything works
301
+ exactly as before.
302
+
303
+ **New Features for Build Tool Users**:
304
+
305
+ ```bash
306
+ # Install
307
+ npm install svger-cli@3.0.0 --save-dev
308
+
309
+ # Use with your build tool
310
+ # See docs/INTEGRATIONS.md for detailed examples
311
+ ```
312
+
313
+ ### Performance
314
+
315
+ - Zero runtime dependencies
316
+ - 85% faster than SVGR for batch processing
317
+ - Tree-shakeable exports - only bundle what you use
318
+ - Optimized build tool integrations with minimal overhead
319
+
320
+ ### Documentation
321
+
322
+ - Complete integration guide in `docs/INTEGRATIONS.md`
323
+ - 6 working example configurations in `examples/` directory
324
+ - Updated README with integration quick-start
325
+ - Enhanced API documentation
326
+
327
+ ---
328
+
8
329
  ## [2.0.7] - 2025-11-20
9
330
 
10
331
  ### Fixed
@@ -81,6 +402,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
81
402
  ## [Unreleased] - 2025-11-12
82
403
 
83
404
  ### Added
405
+
84
406
  - Comprehensive performance analysis documentation with detailed technical breakdown
85
407
  - Professional competitive analysis with fair tool comparisons
86
408
  - Transparency section welcoming community feedback
@@ -89,6 +411,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
89
411
  - Research sources and feedback channels for documentation accuracy
90
412
 
91
413
  ### Changed
414
+
92
415
  - Corrected SVGR description to acknowledge webpack ecosystem support (not React-only)
93
416
  - Clarified 85% performance improvement claim with proper context and scope
94
417
  - Enhanced "Advanced Props" definition vs standard SVG props
@@ -97,6 +420,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
97
420
  - Updated documentation tone to be educational rather than competitive
98
421
 
99
422
  ### Fixed
423
+
100
424
  - Inaccurate claims about competitor tools' capabilities
101
425
  - Misleading performance comparisons without proper context
102
426
  - Unprofessional competitive analysis language
@@ -105,6 +429,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
105
429
  ## [2.0.5] - 2025-11-11
106
430
 
107
431
  ### Fixed
432
+
108
433
  - **CRITICAL**: PascalCase component naming preservation
109
434
  - Fixed issue where PascalCase filenames were incorrectly converted to lowercase
110
435
  - ArrowBendDownLeft.svg โ†’ ArrowBendDownLeft.tsx (was: Arrowbenddownleft.tsx)
@@ -114,12 +439,14 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
114
439
  - All 28 framework tests continue passing
115
440
 
116
441
  ### Changed
442
+
117
443
  - Updated package version to 2.0.5
118
444
  - Enhanced toPascalCase utility function for better case detection
119
445
 
120
446
  ## [2.0.4] - 2025-11-11
121
447
 
122
448
  ### Added
449
+
123
450
  - Complete 28-property configuration schema
124
451
  - React/Vue/Angular specific configuration options
125
452
  - Enhanced responsive design support with breakpoint configurations
@@ -129,6 +456,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
129
456
  - Enhanced TypeScript support with improved type definitions
130
457
 
131
458
  ### Changed
459
+
132
460
  - Streamlined ESLint configuration (.eslintrc.js โ†’ .eslintrc.cjs)
133
461
  - Enhanced component templates with new configuration support
134
462
  - Improved configuration management across multiple files
@@ -136,12 +464,14 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
136
464
  - Enhanced comparison tables and installation instructions
137
465
 
138
466
  ### Fixed
467
+
139
468
  - TypeScript duplicate export errors in index generation
140
469
  - Simplified index.ts generation to prevent conflicts
141
470
  - Improved configuration validation and error messages
142
471
  - Enhanced toPascalCase to preserve existing PascalCase names
143
472
 
144
473
  ### Removed
474
+
145
475
  - Redundant test documentation files (COMPLETE-TEST-REPORT.md, TEST-RESULTS.md, TESTING-SUMMARY.md)
146
476
  - Deprecated ESLint configuration format
147
477
  - Outdated package dependencies reducing bundle size
@@ -175,6 +505,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
175
505
  - Native module file path resolution error
176
506
 
177
507
  ### Removed
508
+
178
509
  - Unnecessary test folders and configuration files
179
510
  - Redundant package configurations
180
511
 
@@ -197,6 +528,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
197
528
  - TypeScript-first approach with native type generation
198
529
 
199
530
  ### Removed
531
+
200
532
  - Legacy dependencies reducing package size by 89%
201
533
  - Single-framework limitation
202
534
  - Dependency-heavy build processes
@@ -204,17 +536,20 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
204
536
  ## [2.0.0] - 2024-10-30
205
537
 
206
538
  ### Added
539
+
207
540
  - Complete multi-framework support for all 8 UI frameworks
208
541
  - Enhanced CLI commands with comprehensive options
209
542
  - Open source project files (CODE_OF_CONDUCT, LICENSE, CONTRIBUTING)
210
543
  - Professional project structure and documentation
211
544
 
212
545
  ### Changed
546
+
213
547
  - Major version release with breaking changes from 1.x
214
548
  - Enhanced README with multi-framework guide and benchmarks
215
549
  - Consolidated project structure and test organization
216
550
 
217
551
  ### Removed
552
+
218
553
  - node_modules folder from repository
219
554
  - Legacy 1.x architecture and dependencies
220
555