svger-cli 2.0.1 → 2.0.3

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 (91) hide show
  1. package/.svgerconfig.example.json +38 -0
  2. package/CHANGELOG.md +64 -0
  3. package/DEVELOPMENT.md +353 -0
  4. package/README.md +24 -5
  5. package/SECURITY.md +69 -0
  6. package/dist/builder.js +16 -16
  7. package/dist/clean.js +2 -2
  8. package/dist/cli.js +38 -38
  9. package/dist/config.js +11 -11
  10. package/dist/core/error-handler.d.ts +63 -0
  11. package/dist/core/error-handler.js +227 -0
  12. package/dist/core/framework-templates.d.ts +17 -0
  13. package/{src/core/framework-templates.ts → dist/core/framework-templates.js} +104 -139
  14. package/dist/core/logger.d.ts +22 -0
  15. package/dist/core/logger.js +85 -0
  16. package/dist/core/performance-engine.d.ts +67 -0
  17. package/dist/core/performance-engine.js +252 -0
  18. package/dist/core/plugin-manager.d.ts +56 -0
  19. package/dist/core/plugin-manager.js +191 -0
  20. package/dist/core/style-compiler.d.ts +88 -0
  21. package/dist/core/style-compiler.js +468 -0
  22. package/dist/core/template-manager.d.ts +64 -0
  23. package/{src/core/template-manager.ts → dist/core/template-manager.js} +172 -255
  24. package/dist/index.d.ts +153 -0
  25. package/{src/index.ts → dist/index.js} +32 -110
  26. package/dist/lock.js +7 -7
  27. package/dist/processors/svg-processor.d.ts +73 -0
  28. package/dist/processors/svg-processor.js +261 -0
  29. package/dist/services/config.d.ts +55 -0
  30. package/dist/services/config.js +211 -0
  31. package/dist/services/file-watcher.d.ts +54 -0
  32. package/dist/services/file-watcher.js +180 -0
  33. package/dist/services/svg-service.d.ts +81 -0
  34. package/dist/services/svg-service.js +395 -0
  35. package/dist/templates/ComponentTemplate.js +25 -25
  36. package/dist/types/index.d.ts +146 -0
  37. package/dist/types/index.js +4 -0
  38. package/dist/utils/native.d.ts +104 -0
  39. package/dist/utils/native.js +340 -0
  40. package/dist/watch.d.ts +1 -1
  41. package/dist/watch.js +14 -14
  42. package/package.json +154 -14
  43. package/.svgconfig.json +0 -3
  44. package/CODE_OF_CONDUCT.md +0 -79
  45. package/CONTRIBUTING.md +0 -146
  46. package/TESTING.md +0 -143
  47. package/cli-framework.test.js +0 -16
  48. package/cli-test-angular/Arrowbenddownleft.component.ts +0 -27
  49. package/cli-test-angular/Vite.component.ts +0 -27
  50. package/cli-test-angular/index.ts +0 -25
  51. package/cli-test-output/Arrowbenddownleft.vue +0 -33
  52. package/cli-test-output/Vite.vue +0 -33
  53. package/cli-test-output/index.ts +0 -25
  54. package/cli-test-react/Arrowbenddownleft.tsx +0 -39
  55. package/cli-test-react/Vite.tsx +0 -39
  56. package/cli-test-react/index.ts +0 -25
  57. package/cli-test-svelte/Arrowbenddownleft.svelte +0 -22
  58. package/cli-test-svelte/Vite.svelte +0 -22
  59. package/cli-test-svelte/index.ts +0 -25
  60. package/frameworks.test.js +0 -170
  61. package/my-svgs/ArrowBendDownLeft.svg +0 -6
  62. package/my-svgs/vite.svg +0 -1
  63. package/src/builder.ts +0 -104
  64. package/src/clean.ts +0 -21
  65. package/src/cli.ts +0 -221
  66. package/src/config.ts +0 -81
  67. package/src/core/error-handler.ts +0 -303
  68. package/src/core/logger.ts +0 -104
  69. package/src/core/performance-engine.ts +0 -327
  70. package/src/core/plugin-manager.ts +0 -228
  71. package/src/core/style-compiler.ts +0 -605
  72. package/src/lock.ts +0 -74
  73. package/src/processors/svg-processor.ts +0 -288
  74. package/src/services/config.ts +0 -241
  75. package/src/services/file-watcher.ts +0 -218
  76. package/src/services/svg-service.ts +0 -468
  77. package/src/templates/ComponentTemplate.ts +0 -57
  78. package/src/types/index.ts +0 -169
  79. package/src/utils/native.ts +0 -352
  80. package/src/watch.ts +0 -88
  81. package/test-output-mulit/TestIcon-angular-module.component.ts +0 -26
  82. package/test-output-mulit/TestIcon-angular-standalone.component.ts +0 -27
  83. package/test-output-mulit/TestIcon-lit.ts +0 -35
  84. package/test-output-mulit/TestIcon-preact.tsx +0 -38
  85. package/test-output-mulit/TestIcon-react.tsx +0 -35
  86. package/test-output-mulit/TestIcon-solid.tsx +0 -27
  87. package/test-output-mulit/TestIcon-svelte.svelte +0 -22
  88. package/test-output-mulit/TestIcon-vanilla.ts +0 -37
  89. package/test-output-mulit/TestIcon-vue-composition.vue +0 -33
  90. package/test-output-mulit/TestIcon-vue-options.vue +0 -31
  91. package/tsconfig.json +0 -18
@@ -1,27 +0,0 @@
1
- import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'test-icon',
5
- standalone: true,
6
- template: `
7
- <svg
8
- [attr.class]="className"
9
- [attr.width]="width"
10
- [attr.height]="height"
11
- [attr.fill]="fill"
12
- [attr.stroke]="stroke"
13
- viewBox="0 0 24 24"
14
- xmlns="http://www.w3.org/2000/svg"
15
- >
16
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
17
- </svg>
18
- `,
19
- changeDetection: ChangeDetectionStrategy.OnPush
20
- })
21
- export class TestIconComponent {
22
- @Input() className: string = '';
23
- @Input() width: string | number = 24;
24
- @Input() height: string | number = 24;
25
- @Input() fill: string = 'currentColor';
26
- @Input() stroke: string = '';
27
- }
@@ -1,35 +0,0 @@
1
- import { LitElement, html, css, svg } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
-
4
- @customElement('test-icon')
5
- export class TestIcon extends LitElement {
6
- @property({ type: String }) className = '';
7
- @property({ type: String, reflect: true }) width = '24';
8
- @property({ type: String, reflect: true }) height = '24';
9
- @property({ type: String, reflect: true }) fill = 'currentColor';
10
- @property({ type: String, reflect: true }) stroke = '';
11
-
12
- static styles = css`:host { display: inline-block; }`;
13
-
14
- render() {
15
- return svg`
16
- <svg
17
- class="${this.className}"
18
- width="${this.width}"
19
- height="${this.height}"
20
- fill="${this.fill}"
21
- stroke="${this.stroke}"
22
- viewBox="0 0 24 24"
23
- xmlns="http://www.w3.org/2000/svg"
24
- >
25
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
26
- </svg>
27
- `;
28
- }
29
- }
30
-
31
- declare global {
32
- interface HTMLElementTagNameMap {
33
- 'test-icon': TestIcon;
34
- }
35
- }
@@ -1,38 +0,0 @@
1
- import { h, FunctionComponent } from 'preact';
2
- import { JSX } from 'preact/jsx-runtime';
3
-
4
- export interface TestIconProps extends JSX.SVGAttributes<SVGSVGElement> {
5
- className?: string;
6
- width?: string | number;
7
- height?: string | number;
8
- fill?: string;
9
- stroke?: string;
10
- }
11
-
12
- const TestIcon: FunctionComponent<TestIconProps> = ({
13
- className,
14
- style,
15
- width,
16
- height,
17
- fill,
18
- stroke,
19
- ...props
20
- }) => {
21
- return (
22
- <svg
23
- class={className}
24
- style={style}
25
- width={width || 24}
26
- height={height || 24}
27
- fill={fill || 'currentColor'}
28
- stroke={stroke}
29
- viewBox="0 0 24 24"
30
- xmlns="http://www.w3.org/2000/svg"
31
- {...props}
32
- >
33
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
34
- </svg>
35
- );
36
- };
37
-
38
- export default TestIcon;
@@ -1,35 +0,0 @@
1
- import React from "react";
2
- import type { SVGProps } from "react";
3
-
4
- export interface TestIconProps extends SVGProps<SVGSVGElement> {
5
- size?: number | string;
6
- }
7
-
8
- const TestIcon = React.forwardRef<SVGSVGElement, TestIconProps>(
9
- ({ size, className, style, ...props }, ref) => {
10
- const dimensions = size ? { width: size, height: size } : {
11
- width: props.width || 24,
12
- height: props.height || 24
13
- };
14
-
15
- return (
16
- <svg
17
- ref={ref}
18
- viewBox="0 0 24 24"
19
- xmlns="http://www.w3.org/2000/svg"
20
- width={dimensions.width}
21
- height={dimensions.height}
22
- fill={props.fill || "currentColor"}
23
- className={className}
24
- style={style}
25
- {...props}
26
- >
27
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
28
- </svg>
29
- );
30
- }
31
- );
32
-
33
- TestIcon.displayName = "TestIcon";
34
-
35
- export default TestIcon;
@@ -1,27 +0,0 @@
1
- import { Component, JSX } from 'solid-js';
2
-
3
- export interface TestIconProps extends JSX.SvgSVGAttributes<SVGSVGElement> {
4
- className?: string;
5
- width?: string | number;
6
- height?: string | number;
7
- fill?: string;
8
- stroke?: string;
9
- }
10
-
11
- const TestIcon: Component<TestIconProps> = (props) => (
12
- <svg
13
- class={props.className}
14
- style={props.style}
15
- width={props.width || 24}
16
- height={props.height || 24}
17
- fill={props.fill || 'currentColor'}
18
- stroke={props.stroke}
19
- viewBox="0 0 24 24"
20
- xmlns="http://www.w3.org/2000/svg"
21
- {...props}
22
- >
23
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
24
- </svg>
25
- );
26
-
27
- export default TestIcon;
@@ -1,22 +0,0 @@
1
- <script lang="ts">
2
- export let className: string = '';
3
- export let style: string = '';
4
- export let width: string | number = 24;
5
- export let height: string | number = 24;
6
- export let fill: string = 'currentColor';
7
- export let stroke: string = '';
8
- </script>
9
-
10
- <svg
11
- class={className}
12
- {style}
13
- {width}
14
- {height}
15
- {fill}
16
- {stroke}
17
- viewBox="0 0 24 24"
18
- xmlns="http://www.w3.org/2000/svg"
19
- {...$$restProps}
20
- >
21
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
22
- </svg>
@@ -1,37 +0,0 @@
1
- export interface TestIconOptions {
2
- className?: string;
3
- width?: string | number;
4
- height?: string | number;
5
- fill?: string;
6
- stroke?: string;
7
- [key: string]: any;
8
- }
9
-
10
- export function TestIcon(options: TestIconOptions = {}): SVGSVGElement {
11
- const {
12
- className = '',
13
- width = 24,
14
- height = 24,
15
- fill = 'currentColor',
16
- stroke = '',
17
- ...attrs
18
- } = options;
19
-
20
- const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
21
- svg.setAttribute('viewBox', '0 0 24 24');
22
- svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
23
-
24
- if (className) svg.setAttribute('class', className);
25
- svg.setAttribute('width', String(width));
26
- svg.setAttribute('height', String(height));
27
- svg.setAttribute('fill', fill);
28
- if (stroke) svg.setAttribute('stroke', stroke);
29
-
30
- Object.entries(attrs).forEach(([key, value]) => {
31
- svg.setAttribute(key, String(value));
32
- });
33
-
34
- svg.innerHTML = `<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>`;
35
-
36
- return svg;
37
- }
@@ -1,33 +0,0 @@
1
- <template>
2
- <svg
3
- :class="className"
4
- :style="style"
5
- :width="width || 24"
6
- :height="height || 24"
7
- :fill="fill || 'currentColor'"
8
- :stroke="stroke"
9
- viewBox="0 0 24 24"
10
- xmlns="http://www.w3.org/2000/svg"
11
- v-bind="$attrs"
12
- >
13
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
14
- </svg>
15
- </template>
16
-
17
- <script setup lang="ts">
18
- interface Props {
19
- className?: string;
20
- style?: string | Record<string, any>;
21
- width?: string | number;
22
- height?: string | number;
23
- fill?: string;
24
- stroke?: string;
25
- }
26
-
27
- withDefaults(defineProps<Props>(), {
28
- className: '',
29
- fill: 'currentColor',
30
- width: 24,
31
- height: 24
32
- });
33
- </script>
@@ -1,31 +0,0 @@
1
- <template>
2
- <svg
3
- :class="className"
4
- :style="style"
5
- :width="width"
6
- :height="height"
7
- :fill="fill"
8
- :stroke="stroke"
9
- viewBox="0 0 24 24"
10
- xmlns="http://www.w3.org/2000/svg"
11
- v-bind="$attrs"
12
- >
13
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
14
- </svg>
15
- </template>
16
-
17
- <script lang="ts">
18
- import { defineComponent } from 'vue';
19
-
20
- export default defineComponent({
21
- name: 'TestIcon',
22
- props: {
23
- className: { type: String, default: '' },
24
- style: { type: [String, Object], default: '' },
25
- width: { type: [String, Number], default: 24 },
26
- height: { type: [String, Number], default: 24 },
27
- fill: { type: String, default: 'currentColor' },
28
- stroke: { type: String, default: '' }
29
- }
30
- });
31
- </script>
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ES2022",
5
- "moduleResolution": "Bundler",
6
- "outDir": "dist",
7
- "rootDir": "src",
8
- "declaration": true,
9
- "emitDeclarationOnly": false,
10
- "skipLibCheck": true,
11
- "strict": true,
12
- "esModuleInterop": true,
13
- "resolveJsonModule": true,
14
- "jsx": "react-jsx",
15
- "types": ["node"]
16
- },
17
- "include": ["src"]
18
- }