svger-cli 1.0.6 → 1.0.7

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.
Files changed (64) hide show
  1. package/CODE_OF_CONDUCT.md +79 -0
  2. package/CONTRIBUTING.md +146 -0
  3. package/LICENSE +21 -0
  4. package/README.md +1862 -73
  5. package/TESTING.md +143 -0
  6. package/cli-framework.test.js +16 -0
  7. package/cli-test-angular/Arrowbenddownleft.component.ts +27 -0
  8. package/cli-test-angular/Vite.component.ts +27 -0
  9. package/cli-test-angular/index.ts +25 -0
  10. package/{my-icons/ArrowBendDownLeft.tsx → cli-test-output/Arrowbenddownleft.vue} +28 -12
  11. package/{my-icons/Vite.tsx → cli-test-output/Vite.vue} +28 -12
  12. package/cli-test-output/index.ts +25 -0
  13. package/cli-test-react/Arrowbenddownleft.tsx +39 -0
  14. package/cli-test-react/Vite.tsx +39 -0
  15. package/cli-test-react/index.ts +25 -0
  16. package/cli-test-svelte/Arrowbenddownleft.svelte +22 -0
  17. package/cli-test-svelte/Vite.svelte +22 -0
  18. package/cli-test-svelte/index.ts +25 -0
  19. package/dist/builder.js +12 -13
  20. package/dist/clean.js +3 -3
  21. package/dist/cli.js +139 -61
  22. package/dist/config.d.ts +1 -1
  23. package/dist/config.js +5 -7
  24. package/dist/lock.js +1 -1
  25. package/dist/templates/ComponentTemplate.d.ts +15 -0
  26. package/dist/templates/ComponentTemplate.js +15 -0
  27. package/dist/watch.d.ts +2 -1
  28. package/dist/watch.js +30 -33
  29. package/docs/ADR-SVG-INTRGRATION-METHODS-002.adr.md +550 -0
  30. package/docs/FRAMEWORK-GUIDE.md +768 -0
  31. package/docs/IMPLEMENTATION-SUMMARY.md +376 -0
  32. package/frameworks.test.js +170 -0
  33. package/package.json +7 -10
  34. package/src/builder.ts +12 -13
  35. package/src/clean.ts +3 -3
  36. package/src/cli.ts +148 -59
  37. package/src/config.ts +5 -6
  38. package/src/core/error-handler.ts +303 -0
  39. package/src/core/framework-templates.ts +428 -0
  40. package/src/core/logger.ts +104 -0
  41. package/src/core/performance-engine.ts +327 -0
  42. package/src/core/plugin-manager.ts +228 -0
  43. package/src/core/style-compiler.ts +605 -0
  44. package/src/core/template-manager.ts +619 -0
  45. package/src/index.ts +235 -0
  46. package/src/lock.ts +1 -1
  47. package/src/processors/svg-processor.ts +288 -0
  48. package/src/services/config.ts +241 -0
  49. package/src/services/file-watcher.ts +218 -0
  50. package/src/services/svg-service.ts +468 -0
  51. package/src/types/index.ts +169 -0
  52. package/src/utils/native.ts +352 -0
  53. package/src/watch.ts +36 -36
  54. package/test-output-mulit/TestIcon-angular-module.component.ts +26 -0
  55. package/test-output-mulit/TestIcon-angular-standalone.component.ts +27 -0
  56. package/test-output-mulit/TestIcon-lit.ts +35 -0
  57. package/test-output-mulit/TestIcon-preact.tsx +38 -0
  58. package/test-output-mulit/TestIcon-react.tsx +35 -0
  59. package/test-output-mulit/TestIcon-solid.tsx +27 -0
  60. package/test-output-mulit/TestIcon-svelte.svelte +22 -0
  61. package/test-output-mulit/TestIcon-vanilla.ts +37 -0
  62. package/test-output-mulit/TestIcon-vue-composition.vue +33 -0
  63. package/test-output-mulit/TestIcon-vue-options.vue +31 -0
  64. package/tsconfig.json +11 -9
@@ -0,0 +1,79 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We value open and honest communication, inspired by the Linux kernel community's emphasis on technical excellence and direct feedback, while maintaining respect and professionalism.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not only for us as individuals, but for the overall community
18
+ * Using inclusive language and avoiding assumptions about others' backgrounds or abilities
19
+
20
+ Examples of unacceptable behavior include:
21
+
22
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
26
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
27
+
28
+ ## Enforcement Responsibilities
29
+
30
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
31
+
32
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
33
+
34
+ ## Scope
35
+
36
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
37
+
38
+ ## Enforcement
39
+
40
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement. All complaints will be reviewed and investigated promptly and fairly.
41
+
42
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
43
+
44
+ ## Enforcement Guidelines
45
+
46
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
47
+
48
+ ### 1. Correction
49
+
50
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
51
+
52
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
53
+
54
+ ### 2. Warning
55
+
56
+ **Community Impact**: A violation through a single incident or series of actions.
57
+
58
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
59
+
60
+ ### 3. Temporary Ban
61
+
62
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
63
+
64
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
65
+
66
+ ### 4. Permanent Ban
67
+
68
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
69
+
70
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
71
+
72
+ ## Attribution
73
+
74
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
75
+
76
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
77
+
78
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
79
+ [Mozilla CoC]: https://github.com/mozilla/diversity
@@ -0,0 +1,146 @@
1
+ # Contributing to svger-cli
2
+
3
+ Thank you for your interest in contributing to svger-cli! We welcome contributions from the community to help improve and grow this zero-dependency enterprise SVG processing framework. This document outlines the guidelines and processes for contributing.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Code of Conduct](#code-of-conduct)
8
+ - [How to Contribute](#how-to-contribute)
9
+ - [Development Setup](#development-setup)
10
+ - [Reporting Issues](#reporting-issues)
11
+ - [Submitting Pull Requests](#submitting-pull-requests)
12
+ - [Code Style and Standards](#code-style-and-standards)
13
+ - [Testing](#testing)
14
+ - [Commit Guidelines](#commit-guidelines)
15
+ - [License](#license)
16
+
17
+ ## Code of Conduct
18
+
19
+ This project adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to the maintainers.
20
+
21
+ ## How to Contribute
22
+
23
+ There are many ways to contribute to svger-cli:
24
+
25
+ - **Report bugs** and request features via GitHub Issues
26
+ - **Improve documentation** by fixing typos or adding examples
27
+ - **Write code** by submitting pull requests
28
+ - **Review pull requests** from other contributors
29
+ - **Help others** in discussions and issue threads
30
+ - **Add framework support** for new UI libraries
31
+ - **Optimize performance** and reduce bundle size
32
+
33
+ ## Development Setup
34
+
35
+ 1. **Fork and Clone**: Fork the repository on GitHub and clone your fork locally.
36
+
37
+ ```bash
38
+ git clone https://github.com/your-username/svger-cli.git
39
+ cd svger-cli
40
+ ```
41
+
42
+ 2. **Install Dev Dependencies**: Install TypeScript and development tools.
43
+
44
+ ```bash
45
+ npm install
46
+ ```
47
+
48
+ 3. **Build the Project**: Compile TypeScript to JavaScript.
49
+
50
+ ```bash
51
+ npm run build
52
+ ```
53
+
54
+ 4. **Test the CLI**: Run the built CLI to ensure it works.
55
+
56
+ ```bash
57
+ node dist/cli.js --help
58
+ ```
59
+
60
+ ## Reporting Issues
61
+
62
+ When reporting issues, please include:
63
+
64
+ - A clear and descriptive title
65
+ - Steps to reproduce the issue
66
+ - Expected behavior
67
+ - Actual behavior
68
+ - Environment details (OS, Node.js version, etc.)
69
+ - Any relevant SVG files or error messages
70
+ - Framework you're targeting (React, Vue, etc.)
71
+
72
+ Use GitHub Issues for bug reports and feature requests.
73
+
74
+ ## Submitting Pull Requests
75
+
76
+ 1. **Create a Branch**: Create a feature branch from `main`.
77
+
78
+ ```bash
79
+ git checkout -b feature/your-feature-name
80
+ ```
81
+
82
+ 2. **Make Changes**: Implement your changes, following the code style guidelines.
83
+
84
+ 3. **Test Manually**: Since automated tests are not yet implemented, thoroughly test your changes manually.
85
+
86
+ 4. **Update Documentation**: Update README.md or other docs if necessary.
87
+
88
+ 5. **Commit Changes**: Use clear commit messages (see [Commit Guidelines](#commit-guidelines)).
89
+
90
+ 6. **Push and Create PR**: Push your branch and create a pull request on GitHub.
91
+
92
+ - Provide a clear description of the changes
93
+ - Reference any related issues
94
+ - Include before/after screenshots for UI changes
95
+ - Test with multiple frameworks if applicable
96
+
97
+ ## Code Style and Standards
98
+
99
+ - **Language**: TypeScript is the primary language
100
+ - **Zero Dependencies**: Maintain zero runtime dependencies - use only native Node.js APIs
101
+ - **Modular Architecture**: Follow the service-oriented architecture in `src/`
102
+ - **Naming**: Use descriptive names for variables, functions, and classes
103
+ - **Comments**: Add JSDoc comments for public APIs
104
+ - **Error Handling**: Use the centralized error handler for consistent error management
105
+ - **Performance**: Optimize for speed and memory usage
106
+
107
+ Build and test your changes:
108
+
109
+ ```bash
110
+ npm run build
111
+ node dist/cli.js [your-test-command]
112
+ ```
113
+
114
+ ## Testing
115
+
116
+ Currently, the project relies on manual testing. Future contributions that add automated testing infrastructure are highly encouraged.
117
+
118
+ When testing:
119
+
120
+ - Test with various SVG files (simple and complex)
121
+ - Test all supported frameworks
122
+ - Test edge cases like malformed SVGs
123
+ - Verify performance doesn't regress
124
+
125
+ ## Commit Guidelines
126
+
127
+ - Use the imperative mood in commit messages (e.g., "Add feature" not "Added feature")
128
+ - Keep the first line under 50 characters
129
+ - Provide a detailed description in the body if needed
130
+ - Reference issue numbers when applicable (e.g., "Fix #123")
131
+
132
+ Example:
133
+
134
+ ```
135
+ Add Vue.js framework support
136
+
137
+ - Implement Vue composition API template
138
+ - Add Vue-specific prop handling
139
+ - Update framework detection logic
140
+
141
+ Closes #456
142
+ ```
143
+
144
+ ## License
145
+
146
+ By contributing to this project, you agree that your contributions will be licensed under the [MIT License](LICENSE).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 navidrezadoost
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.