svger-cli 2.0.0 → 2.0.2
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/dist/cli.js +0 -0
- package/dist/core/error-handler.d.ts +63 -0
- package/dist/core/error-handler.js +224 -0
- package/dist/core/framework-templates.d.ts +17 -0
- package/{src/core/framework-templates.ts → dist/core/framework-templates.js} +100 -137
- package/dist/core/logger.d.ts +22 -0
- package/dist/core/logger.js +85 -0
- package/dist/core/performance-engine.d.ts +67 -0
- package/dist/core/performance-engine.js +251 -0
- package/dist/core/plugin-manager.d.ts +56 -0
- package/dist/core/plugin-manager.js +189 -0
- package/dist/core/style-compiler.d.ts +88 -0
- package/dist/core/style-compiler.js +466 -0
- package/dist/core/template-manager.d.ts +64 -0
- package/{src/core/template-manager.ts → dist/core/template-manager.js} +172 -255
- package/dist/index.d.ts +151 -0
- package/{src/index.ts → dist/index.js} +30 -108
- package/dist/processors/svg-processor.d.ts +67 -0
- package/dist/processors/svg-processor.js +225 -0
- package/dist/services/config.d.ts +55 -0
- package/dist/services/config.js +209 -0
- package/dist/services/file-watcher.d.ts +54 -0
- package/dist/services/file-watcher.js +180 -0
- package/dist/services/svg-service.d.ts +81 -0
- package/dist/services/svg-service.js +383 -0
- package/dist/types/index.d.ts +140 -0
- package/dist/types/index.js +4 -0
- package/dist/utils/native.d.ts +74 -0
- package/dist/utils/native.js +305 -0
- package/package.json +9 -3
- package/.svgconfig.json +0 -3
- package/CODE_OF_CONDUCT.md +0 -79
- package/CONTRIBUTING.md +0 -146
- package/TESTING.md +0 -143
- package/cli-framework.test.js +0 -16
- package/cli-test-angular/Arrowbenddownleft.component.ts +0 -27
- package/cli-test-angular/Vite.component.ts +0 -27
- package/cli-test-angular/index.ts +0 -25
- package/cli-test-output/Arrowbenddownleft.vue +0 -33
- package/cli-test-output/Vite.vue +0 -33
- package/cli-test-output/index.ts +0 -25
- package/cli-test-react/Arrowbenddownleft.tsx +0 -39
- package/cli-test-react/Vite.tsx +0 -39
- package/cli-test-react/index.ts +0 -25
- package/cli-test-svelte/Arrowbenddownleft.svelte +0 -22
- package/cli-test-svelte/Vite.svelte +0 -22
- package/cli-test-svelte/index.ts +0 -25
- package/docs/ADR-SVG-INTRGRATION-METHODS-001.adr.md +0 -157
- package/docs/ADR-SVG-INTRGRATION-METHODS-002.adr.md +0 -550
- package/docs/FRAMEWORK-GUIDE.md +0 -768
- package/docs/IMPLEMENTATION-SUMMARY.md +0 -376
- package/docs/TDR-SVG-INTRGRATION-METHODS-001.tdr.md +0 -115
- package/frameworks.test.js +0 -170
- package/my-svgs/ArrowBendDownLeft.svg +0 -6
- package/my-svgs/vite.svg +0 -1
- package/src/builder.ts +0 -104
- package/src/clean.ts +0 -21
- package/src/cli.ts +0 -221
- package/src/config.ts +0 -81
- package/src/core/error-handler.ts +0 -303
- package/src/core/logger.ts +0 -104
- package/src/core/performance-engine.ts +0 -327
- package/src/core/plugin-manager.ts +0 -228
- package/src/core/style-compiler.ts +0 -605
- package/src/lock.ts +0 -74
- package/src/processors/svg-processor.ts +0 -288
- package/src/services/config.ts +0 -241
- package/src/services/file-watcher.ts +0 -218
- package/src/services/svg-service.ts +0 -468
- package/src/templates/ComponentTemplate.ts +0 -57
- package/src/types/index.ts +0 -169
- package/src/utils/native.ts +0 -352
- package/src/watch.ts +0 -88
- package/test-output-mulit/TestIcon-angular-module.component.ts +0 -26
- package/test-output-mulit/TestIcon-angular-standalone.component.ts +0 -27
- package/test-output-mulit/TestIcon-lit.ts +0 -35
- package/test-output-mulit/TestIcon-preact.tsx +0 -38
- package/test-output-mulit/TestIcon-react.tsx +0 -35
- package/test-output-mulit/TestIcon-solid.tsx +0 -27
- package/test-output-mulit/TestIcon-svelte.svelte +0 -22
- package/test-output-mulit/TestIcon-vanilla.ts +0 -37
- package/test-output-mulit/TestIcon-vue-composition.vue +0 -33
- package/test-output-mulit/TestIcon-vue-options.vue +0 -31
- package/tsconfig.json +0 -18
package/cli-framework.test.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { svgProcessor } from './dist/processors/svg-processor.js';
|
|
4
|
-
import { frameworkTemplateEngine } from './dist/index.js';
|
|
5
|
-
|
|
6
|
-
// Test file extension generation
|
|
7
|
-
console.log('\n📋 Testing File Extension Generation:\n');
|
|
8
|
-
|
|
9
|
-
const frameworks = ['react', 'vue', 'svelte', 'angular', 'solid', 'preact', 'lit', 'vanilla'];
|
|
10
|
-
|
|
11
|
-
frameworks.forEach(fw => {
|
|
12
|
-
const ext = frameworkTemplateEngine.getFileExtension(fw, true);
|
|
13
|
-
console.log(` ${fw.padEnd(10)} => .${ext}`);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
console.log('\n✅ Framework file extensions working correctly!\n');
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'arrowbenddownleft',
|
|
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
|
-
<g id="surface1"><path d="M 2.25 5.25 C 2.253906 7.835938 3.28125 10.3125 5.109375 12.140625 C 6.9375 13.96875 9.414062 14.996094 12 15 L 19.1875 15 L 15.96875 18.21875 C 15.828125 18.359375 15.75 18.550781 15.75 18.75 C 15.75 18.949219 15.828125 19.140625 15.96875 19.28125 C 16.109375 19.421875 16.300781 19.5 16.5 19.5 C 16.699219 19.5 16.890625 19.421875 17.03125 19.28125 L 21.53125 14.78125 C 21.601562 14.710938 21.65625 14.628906 21.691406 14.539062 C 21.730469 14.445312 21.75 14.347656 21.75 14.25 C 21.75 14.152344 21.730469 14.054688 21.691406 13.960938 C 21.65625 13.871094 21.601562 13.789062 21.53125 13.71875 L 17.03125 9.21875 C 16.890625 9.078125 16.699219 9 16.5 9 C 16.300781 9 16.109375 9.078125 15.96875 9.21875 C 15.828125 9.359375 15.75 9.550781 15.75 9.75 C 15.75 9.949219 15.828125 10.140625 15.96875 10.28125 L 19.1875 13.5 L 12 13.5 C 9.8125 13.496094 7.714844 12.628906 6.167969 11.082031 C 4.621094 9.535156 3.75 7.4375 3.75 5.25 C 3.75 5.050781 3.671875 4.859375 3.53125 4.71875 C 3.390625 4.578125 3.199219 4.5 3 4.5 C 2.800781 4.5 2.609375 4.578125 2.46875 4.71875 C 2.328125 4.859375 2.25 5.050781 2.25 5.25 Z M 2.25 5.25 "/></g>
|
|
17
|
-
</svg>
|
|
18
|
-
`,
|
|
19
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
20
|
-
})
|
|
21
|
-
export class ArrowbenddownleftComponent {
|
|
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,27 +0,0 @@
|
|
|
1
|
-
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'vite',
|
|
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
|
-
<defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path>
|
|
17
|
-
</svg>
|
|
18
|
-
`,
|
|
19
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
20
|
-
})
|
|
21
|
-
export class ViteComponent {
|
|
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,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SVG Components Index
|
|
3
|
-
* Generated by svger-cli
|
|
4
|
-
*
|
|
5
|
-
* Import individual components:
|
|
6
|
-
* import { Arrowbenddownleft } from './components';
|
|
7
|
-
*
|
|
8
|
-
* Import all components:
|
|
9
|
-
* import * as Icons from './components';
|
|
10
|
-
* import Icons from './components'; // default export
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export { default as Arrowbenddownleft } from './Arrowbenddownleft';
|
|
14
|
-
export { default as Vite } from './Vite';
|
|
15
|
-
// Export all components
|
|
16
|
-
export {
|
|
17
|
-
Arrowbenddownleft,
|
|
18
|
-
Vite,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// Re-export for convenience
|
|
22
|
-
export default {
|
|
23
|
-
Arrowbenddownleft,
|
|
24
|
-
Vite,
|
|
25
|
-
};
|
|
@@ -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
|
-
<g id="surface1"><path d="M 2.25 5.25 C 2.253906 7.835938 3.28125 10.3125 5.109375 12.140625 C 6.9375 13.96875 9.414062 14.996094 12 15 L 19.1875 15 L 15.96875 18.21875 C 15.828125 18.359375 15.75 18.550781 15.75 18.75 C 15.75 18.949219 15.828125 19.140625 15.96875 19.28125 C 16.109375 19.421875 16.300781 19.5 16.5 19.5 C 16.699219 19.5 16.890625 19.421875 17.03125 19.28125 L 21.53125 14.78125 C 21.601562 14.710938 21.65625 14.628906 21.691406 14.539062 C 21.730469 14.445312 21.75 14.347656 21.75 14.25 C 21.75 14.152344 21.730469 14.054688 21.691406 13.960938 C 21.65625 13.871094 21.601562 13.789062 21.53125 13.71875 L 17.03125 9.21875 C 16.890625 9.078125 16.699219 9 16.5 9 C 16.300781 9 16.109375 9.078125 15.96875 9.21875 C 15.828125 9.359375 15.75 9.550781 15.75 9.75 C 15.75 9.949219 15.828125 10.140625 15.96875 10.28125 L 19.1875 13.5 L 12 13.5 C 9.8125 13.496094 7.714844 12.628906 6.167969 11.082031 C 4.621094 9.535156 3.75 7.4375 3.75 5.25 C 3.75 5.050781 3.671875 4.859375 3.53125 4.71875 C 3.390625 4.578125 3.199219 4.5 3 4.5 C 2.800781 4.5 2.609375 4.578125 2.46875 4.71875 C 2.328125 4.859375 2.25 5.050781 2.25 5.25 Z M 2.25 5.25 "/></g>
|
|
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>
|
package/cli-test-output/Vite.vue
DELETED
|
@@ -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
|
-
<defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path>
|
|
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>
|
package/cli-test-output/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SVG Components Index
|
|
3
|
-
* Generated by svger-cli
|
|
4
|
-
*
|
|
5
|
-
* Import individual components:
|
|
6
|
-
* import { Arrowbenddownleft } from './components';
|
|
7
|
-
*
|
|
8
|
-
* Import all components:
|
|
9
|
-
* import * as Icons from './components';
|
|
10
|
-
* import Icons from './components'; // default export
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export { default as Arrowbenddownleft } from './Arrowbenddownleft';
|
|
14
|
-
export { default as Vite } from './Vite';
|
|
15
|
-
// Export all components
|
|
16
|
-
export {
|
|
17
|
-
Arrowbenddownleft,
|
|
18
|
-
Vite,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// Re-export for convenience
|
|
22
|
-
export default {
|
|
23
|
-
Arrowbenddownleft,
|
|
24
|
-
Vite,
|
|
25
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { SVGProps } from "react";
|
|
3
|
-
|
|
4
|
-
export interface ArrowbenddownleftProps extends SVGProps<SVGSVGElement> {
|
|
5
|
-
size?: number | string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Arrowbenddownleft SVG Component
|
|
10
|
-
* Generated by svger-cli
|
|
11
|
-
*/
|
|
12
|
-
const Arrowbenddownleft = React.forwardRef<SVGSVGElement, ArrowbenddownleftProps>(
|
|
13
|
-
({ size, className, style, ...props }, ref) => {
|
|
14
|
-
const dimensions = size ? { width: size, height: size } : {
|
|
15
|
-
width: props.width || 24,
|
|
16
|
-
height: props.height || 32
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<svg
|
|
21
|
-
ref={ref}
|
|
22
|
-
viewBox="0 0 24 32"
|
|
23
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
-
width={dimensions.width}
|
|
25
|
-
height={dimensions.height}
|
|
26
|
-
fill={props.fill || "currentColor"}
|
|
27
|
-
className={className}
|
|
28
|
-
style={style}
|
|
29
|
-
{...props}
|
|
30
|
-
>
|
|
31
|
-
<g id="surface1"><path d="M 2.25 5.25 C 2.253906 7.835938 3.28125 10.3125 5.109375 12.140625 C 6.9375 13.96875 9.414062 14.996094 12 15 L 19.1875 15 L 15.96875 18.21875 C 15.828125 18.359375 15.75 18.550781 15.75 18.75 C 15.75 18.949219 15.828125 19.140625 15.96875 19.28125 C 16.109375 19.421875 16.300781 19.5 16.5 19.5 C 16.699219 19.5 16.890625 19.421875 17.03125 19.28125 L 21.53125 14.78125 C 21.601562 14.710938 21.65625 14.628906 21.691406 14.539062 C 21.730469 14.445312 21.75 14.347656 21.75 14.25 C 21.75 14.152344 21.730469 14.054688 21.691406 13.960938 C 21.65625 13.871094 21.601562 13.789062 21.53125 13.71875 L 17.03125 9.21875 C 16.890625 9.078125 16.699219 9 16.5 9 C 16.300781 9 16.109375 9.078125 15.96875 9.21875 C 15.828125 9.359375 15.75 9.550781 15.75 9.75 C 15.75 9.949219 15.828125 10.140625 15.96875 10.28125 L 19.1875 13.5 L 12 13.5 C 9.8125 13.496094 7.714844 12.628906 6.167969 11.082031 C 4.621094 9.535156 3.75 7.4375 3.75 5.25 C 3.75 5.050781 3.671875 4.859375 3.53125 4.71875 C 3.390625 4.578125 3.199219 4.5 3 4.5 C 2.800781 4.5 2.609375 4.578125 2.46875 4.71875 C 2.328125 4.859375 2.25 5.050781 2.25 5.25 Z M 2.25 5.25 "/></g>
|
|
32
|
-
</svg>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
Arrowbenddownleft.displayName = "Arrowbenddownleft";
|
|
38
|
-
|
|
39
|
-
export default Arrowbenddownleft;
|
package/cli-test-react/Vite.tsx
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { SVGProps } from "react";
|
|
3
|
-
|
|
4
|
-
export interface ViteProps extends SVGProps<SVGSVGElement> {
|
|
5
|
-
size?: number | string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Vite SVG Component
|
|
10
|
-
* Generated by svger-cli
|
|
11
|
-
*/
|
|
12
|
-
const Vite = React.forwardRef<SVGSVGElement, ViteProps>(
|
|
13
|
-
({ size, className, style, ...props }, ref) => {
|
|
14
|
-
const dimensions = size ? { width: size, height: size } : {
|
|
15
|
-
width: props.width || 24,
|
|
16
|
-
height: props.height || 32
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<svg
|
|
21
|
-
ref={ref}
|
|
22
|
-
viewBox="0 0 24 32"
|
|
23
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
-
width={dimensions.width}
|
|
25
|
-
height={dimensions.height}
|
|
26
|
-
fill={props.fill || "currentColor"}
|
|
27
|
-
className={className}
|
|
28
|
-
style={style}
|
|
29
|
-
{...props}
|
|
30
|
-
>
|
|
31
|
-
<defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path>
|
|
32
|
-
</svg>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
Vite.displayName = "Vite";
|
|
38
|
-
|
|
39
|
-
export default Vite;
|
package/cli-test-react/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SVG Components Index
|
|
3
|
-
* Generated by svger-cli
|
|
4
|
-
*
|
|
5
|
-
* Import individual components:
|
|
6
|
-
* import { Arrowbenddownleft } from './components';
|
|
7
|
-
*
|
|
8
|
-
* Import all components:
|
|
9
|
-
* import * as Icons from './components';
|
|
10
|
-
* import Icons from './components'; // default export
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export { default as Arrowbenddownleft } from './Arrowbenddownleft';
|
|
14
|
-
export { default as Vite } from './Vite';
|
|
15
|
-
// Export all components
|
|
16
|
-
export {
|
|
17
|
-
Arrowbenddownleft,
|
|
18
|
-
Vite,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// Re-export for convenience
|
|
22
|
-
export default {
|
|
23
|
-
Arrowbenddownleft,
|
|
24
|
-
Vite,
|
|
25
|
-
};
|
|
@@ -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
|
-
<g id="surface1"><path d="M 2.25 5.25 C 2.253906 7.835938 3.28125 10.3125 5.109375 12.140625 C 6.9375 13.96875 9.414062 14.996094 12 15 L 19.1875 15 L 15.96875 18.21875 C 15.828125 18.359375 15.75 18.550781 15.75 18.75 C 15.75 18.949219 15.828125 19.140625 15.96875 19.28125 C 16.109375 19.421875 16.300781 19.5 16.5 19.5 C 16.699219 19.5 16.890625 19.421875 17.03125 19.28125 L 21.53125 14.78125 C 21.601562 14.710938 21.65625 14.628906 21.691406 14.539062 C 21.730469 14.445312 21.75 14.347656 21.75 14.25 C 21.75 14.152344 21.730469 14.054688 21.691406 13.960938 C 21.65625 13.871094 21.601562 13.789062 21.53125 13.71875 L 17.03125 9.21875 C 16.890625 9.078125 16.699219 9 16.5 9 C 16.300781 9 16.109375 9.078125 15.96875 9.21875 C 15.828125 9.359375 15.75 9.550781 15.75 9.75 C 15.75 9.949219 15.828125 10.140625 15.96875 10.28125 L 19.1875 13.5 L 12 13.5 C 9.8125 13.496094 7.714844 12.628906 6.167969 11.082031 C 4.621094 9.535156 3.75 7.4375 3.75 5.25 C 3.75 5.050781 3.671875 4.859375 3.53125 4.71875 C 3.390625 4.578125 3.199219 4.5 3 4.5 C 2.800781 4.5 2.609375 4.578125 2.46875 4.71875 C 2.328125 4.859375 2.25 5.050781 2.25 5.25 Z M 2.25 5.25 "/></g>
|
|
22
|
-
</svg>
|
|
@@ -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
|
-
<defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path>
|
|
22
|
-
</svg>
|
package/cli-test-svelte/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SVG Components Index
|
|
3
|
-
* Generated by svger-cli
|
|
4
|
-
*
|
|
5
|
-
* Import individual components:
|
|
6
|
-
* import { Arrowbenddownleft } from './components';
|
|
7
|
-
*
|
|
8
|
-
* Import all components:
|
|
9
|
-
* import * as Icons from './components';
|
|
10
|
-
* import Icons from './components'; // default export
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export { default as Arrowbenddownleft } from './Arrowbenddownleft';
|
|
14
|
-
export { default as Vite } from './Vite';
|
|
15
|
-
// Export all components
|
|
16
|
-
export {
|
|
17
|
-
Arrowbenddownleft,
|
|
18
|
-
Vite,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// Re-export for convenience
|
|
22
|
-
export default {
|
|
23
|
-
Arrowbenddownleft,
|
|
24
|
-
Vite,
|
|
25
|
-
};
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
**ADR** How to implement correctly SVG Integration Methods in React
|
|
2
|
-
|
|
3
|
-
**Version: 1.0.0**
|
|
4
|
-
**Date: 10/14/2025**
|
|
5
|
-
**Author: Engineer Navid Rezadoost**
|
|
6
|
-
**TDR Document ID: [TDR-SVG-INTRGRATION-METHODS-001](https://docs.google.com/document/d/1b04_V01xOvLiSMzuPdaRynANlnt2wYdJ_vjs9MAqtn4/edit?tab=t.0)**
|
|
7
|
-
**Status**: Proposed
|
|
8
|
-
|
|
9
|
-
**Context**
|
|
10
|
-
This service is responsible for managing svg files. Given the documentation provided in the TDR for implementing Method 3, which covers the weaknesses of svgr, it was decided to release this package as an open source service on npm.
|
|
11
|
-
|
|
12
|
-
**Similar Weaknesses That We Are Looking To Solve In This Process**
|
|
13
|
-
|
|
14
|
-
* Add more commands for more control and mastery over svg file management
|
|
15
|
-
* Add different commands for rendering and rebuilding svg components with more control over files that we do not want to be rebuilt
|
|
16
|
-
* Add a command to create a component for new files that are added
|
|
17
|
-
* A command to componentize a specific svg
|
|
18
|
-
* Add settings for files that should remain unchanged due to specific styling
|
|
19
|
-
* Introduce the folder and run the build as \--watch as soon as a new svg file is added to the specified folder, the svg will be built automatically
|
|
20
|
-
* Create a config file or command on the command line to specify the source file to monitor or process and specify the destination directory
|
|
21
|
-
* Specify rules for building components in width and height dimensions and even styles that should be set as default
|
|
22
|
-
|
|
23
|
-
#### **Decision**
|
|
24
|
-
|
|
25
|
-
We will develop a custom SVG integration CLI and runtime service for React that:
|
|
26
|
-
|
|
27
|
-
* Watches directories for new SVG files.
|
|
28
|
-
* Generates React components automatically with flexible configuration.
|
|
29
|
-
* Allows selective rebuilds and fine-grained control over output styles and props.
|
|
30
|
-
|
|
31
|
-
#### **Rationale**
|
|
32
|
-
|
|
33
|
-
SVGR, while popular, has the following shortcomings:
|
|
34
|
-
|
|
35
|
-
* Lacks a flexible CLI API for selective component generation.
|
|
36
|
-
* No built-in `--watch` mode for automatic builds on new file additions.
|
|
37
|
-
* Limited support for default dimension and styling rules.
|
|
38
|
-
* Difficult to exclude or lock specific SVGs from rebuilds.
|
|
39
|
-
|
|
40
|
-
#### **Consequences**
|
|
41
|
-
|
|
42
|
-
* More control and automation for developers.
|
|
43
|
-
* Slightly increased setup complexity.
|
|
44
|
-
* Responsibility to maintain a custom build tool.
|
|
45
|
-
|
|
46
|
-
## **Example Configuration and Commands**
|
|
47
|
-
|
|
48
|
-
**Include examples so developers can easily visualize the usage.**
|
|
49
|
-
|
|
50
|
-
### Example `.svgconfig.json`
|
|
51
|
-
|
|
52
|
-
| { "source": "./src/assets/svg", "output": "./src/components/icons", "watch": true, "defaultWidth": "24", "defaultHeight": "24", "defaultFill": "currentColor", "exclude": \["logo.svg", "brand-icon.svg"\], "styleRules": { "fill": "inherit", "stroke": "none" }} |
|
|
53
|
-
| :---- |
|
|
54
|
-
|
|
55
|
-
**Commands**
|
|
56
|
-
|
|
57
|
-
**Build Command**
|
|
58
|
-
Builds React components from all SVG files in the specified source directory.
|
|
59
|
-
|
|
60
|
-
| svg-tool build \[options\] |
|
|
61
|
-
| :---- |
|
|
62
|
-
|
|
63
|
-
| svg-tool build \--src ./src/assets/svg \--out ./src/components/icons |
|
|
64
|
-
| :---- |
|
|
65
|
-
|
|
66
|
-
### **What It Does**
|
|
67
|
-
|
|
68
|
-
* Converts every `.svg` in the source folder to a React component.
|
|
69
|
-
* Applies rules from `.svgconfig.json` if present.
|
|
70
|
-
* Generates file names based on kebab-case or PascalCase (configurable).
|
|
71
|
-
|
|
72
|
-
**Watch Command**
|
|
73
|
-
Continuously watches the source directory for new or updated SVG files, and automatically builds them.
|
|
74
|
-
|
|
75
|
-
| svg-tool watch \[options\] |
|
|
76
|
-
| :---- |
|
|
77
|
-
|
|
78
|
-
| svg-tool watch \--src ./src/assets/svg \--out ./src/components/icons |
|
|
79
|
-
| :---- |
|
|
80
|
-
|
|
81
|
-
### **What It Does**
|
|
82
|
-
|
|
83
|
-
* Automatically rebuilds when an SVG file is added, updated, or removed.
|
|
84
|
-
* Skips locked SVG files.
|
|
85
|
-
* Ideal for active development environments.
|
|
86
|
-
|
|
87
|
-
## **Generate Command**
|
|
88
|
-
|
|
89
|
-
Converts a specific SVG file into a React component on demand.
|
|
90
|
-
|
|
91
|
-
| svg-tool generate \<svgFile\> \[options\] |
|
|
92
|
-
| :---- |
|
|
93
|
-
|
|
94
|
-
| svg-tool generate ./src/assets/svg/heart.svg \--out ./src/components/icons |
|
|
95
|
-
| :---- |
|
|
96
|
-
|
|
97
|
-
### **What It Does**
|
|
98
|
-
|
|
99
|
-
* Converts only the specified file.
|
|
100
|
-
* Ideal for adding individual icons to an existing collection.
|
|
101
|
-
|
|
102
|
-
## **Lock Command**
|
|
103
|
-
|
|
104
|
-
Locks one or more SVG files to prevent them from being rebuilt or overwritten during batch operations.
|
|
105
|
-
|
|
106
|
-
| svg-tool lock \<svgFile\> \[options\] |
|
|
107
|
-
| :---- |
|
|
108
|
-
|
|
109
|
-
| svg-tool lock ./src/assets/svg/logo.svg |
|
|
110
|
-
| :---- |
|
|
111
|
-
|
|
112
|
-
### **What It Does**
|
|
113
|
-
|
|
114
|
-
* Adds the specified file(s) to a `.svg-lock` or `.svgconfig.json` list.
|
|
115
|
-
* Protects specific SVGs with custom branding or styling.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
## **Unlock Command**
|
|
119
|
-
|
|
120
|
-
Unlocks one or more SVG files previously marked as locked, allowing them to be rebuilt.
|
|
121
|
-
|
|
122
|
-
| svg-tool unlock \<svgFile\> \[options\] |
|
|
123
|
-
| :---- |
|
|
124
|
-
|
|
125
|
-
| svg-tool unlock ./src/assets/svg/logo.svg |
|
|
126
|
-
| :---- |
|
|
127
|
-
|
|
128
|
-
## **Config Command**
|
|
129
|
-
|
|
130
|
-
Creates or modifies a `.svgconfig.json` file with default settings for builds and watches.
|
|
131
|
-
|
|
132
|
-
| svg-tool config \[options\] |
|
|
133
|
-
| :---- |
|
|
134
|
-
|
|
135
|
-
| svg-tool config \--init |
|
|
136
|
-
| :---- |
|
|
137
|
-
|
|
138
|
-
**\--init**
|
|
139
|
-
|
|
140
|
-
| svg-tool config \--init |
|
|
141
|
-
| :---- |
|
|
142
|
-
|
|
143
|
-
**\--set \<key=value\>**
|
|
144
|
-
|
|
145
|
-
| svg-tool config \--set defaultWidth=32 |
|
|
146
|
-
| :---- |
|
|
147
|
-
|
|
148
|
-
**`--show`**
|
|
149
|
-
|
|
150
|
-
| svg-tool config \--show |
|
|
151
|
-
| :---- |
|
|
152
|
-
|
|
153
|
-
**`Full One-Line Command Closet (for Bash / Mac / Linux / PowerShell)`**
|
|
154
|
-
|
|
155
|
-
| svg-tool config \--init && svg-tool config \--set source=./src/assets/svg && svg-tool config \--set output=./src/components/icons && svg-tool config \--set watch=true && svg-tool config \--set defaultWidth=24 && svg-tool config \--set defaultHeight=24 && svg-tool config \--set defaultFill=currentColor && svg-tool lock ./src/assets/svg/logo.svg && svg-tool build \--src ./src/assets/svg \--out ./src/components/icons \--verbose && svg-tool generate ./src/assets/svg/new-icon.svg \--out ./src/components/icons && svg-tool unlock ./src/assets/svg/logo.svg && svg-tool watch \--src ./src/assets/svg \--out ./src/components/icons && svg-tool clean \--out ./src/components/icons |
|
|
156
|
-
| :---- |
|
|
157
|
-
|