svger-cli 1.0.6 → 1.0.8
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/CODE_OF_CONDUCT.md +79 -0
- package/CONTRIBUTING.md +146 -0
- package/LICENSE +21 -0
- package/README.md +1862 -73
- package/TESTING.md +143 -0
- package/cli-framework.test.js +16 -0
- package/cli-test-angular/Arrowbenddownleft.component.ts +27 -0
- package/cli-test-angular/Vite.component.ts +27 -0
- package/cli-test-angular/index.ts +25 -0
- package/{my-icons/ArrowBendDownLeft.tsx → cli-test-output/Arrowbenddownleft.vue} +28 -12
- package/{my-icons/Vite.tsx → cli-test-output/Vite.vue} +28 -12
- package/cli-test-output/index.ts +25 -0
- package/cli-test-react/Arrowbenddownleft.tsx +39 -0
- package/cli-test-react/Vite.tsx +39 -0
- package/cli-test-react/index.ts +25 -0
- package/cli-test-svelte/Arrowbenddownleft.svelte +22 -0
- package/cli-test-svelte/Vite.svelte +22 -0
- package/cli-test-svelte/index.ts +25 -0
- package/dist/builder.js +12 -13
- package/dist/clean.js +3 -3
- package/dist/cli.js +139 -61
- package/dist/config.d.ts +1 -1
- package/dist/config.js +5 -7
- package/dist/lock.js +1 -1
- package/dist/templates/ComponentTemplate.d.ts +15 -0
- package/dist/templates/ComponentTemplate.js +15 -0
- package/dist/watch.d.ts +2 -1
- package/dist/watch.js +30 -33
- package/docs/ADR-SVG-INTRGRATION-METHODS-002.adr.md +550 -0
- package/docs/FRAMEWORK-GUIDE.md +768 -0
- package/docs/IMPLEMENTATION-SUMMARY.md +376 -0
- package/frameworks.test.js +170 -0
- package/package.json +8 -10
- package/src/builder.ts +12 -13
- package/src/clean.ts +3 -3
- package/src/cli.ts +148 -59
- package/src/config.ts +5 -6
- package/src/core/error-handler.ts +303 -0
- package/src/core/framework-templates.ts +428 -0
- package/src/core/logger.ts +104 -0
- package/src/core/performance-engine.ts +327 -0
- package/src/core/plugin-manager.ts +228 -0
- package/src/core/style-compiler.ts +605 -0
- package/src/core/template-manager.ts +619 -0
- package/src/index.ts +235 -0
- package/src/lock.ts +1 -1
- package/src/processors/svg-processor.ts +288 -0
- package/src/services/config.ts +241 -0
- package/src/services/file-watcher.ts +218 -0
- package/src/services/svg-service.ts +468 -0
- package/src/types/index.ts +169 -0
- package/src/utils/native.ts +352 -0
- package/src/watch.ts +36 -36
- package/test-output-mulit/TestIcon-angular-module.component.ts +26 -0
- package/test-output-mulit/TestIcon-angular-standalone.component.ts +27 -0
- package/test-output-mulit/TestIcon-lit.ts +35 -0
- package/test-output-mulit/TestIcon-preact.tsx +38 -0
- package/test-output-mulit/TestIcon-react.tsx +35 -0
- package/test-output-mulit/TestIcon-solid.tsx +27 -0
- package/test-output-mulit/TestIcon-svelte.svelte +22 -0
- package/test-output-mulit/TestIcon-vanilla.ts +37 -0
- package/test-output-mulit/TestIcon-vue-composition.vue +33 -0
- package/test-output-mulit/TestIcon-vue-options.vue +31 -0
- package/tsconfig.json +11 -9
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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>
|
|
@@ -0,0 +1,31 @@
|
|
|
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
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"module": "
|
|
5
|
-
"moduleResolution": "
|
|
6
|
-
"declaration": true,
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ES2022",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
7
6
|
"outDir": "dist",
|
|
8
7
|
"rootDir": "src",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"emitDeclarationOnly": false,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
11
|
"strict": true,
|
|
12
|
-
"
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"types": ["node"]
|
|
13
16
|
},
|
|
14
17
|
"include": ["src"]
|
|
15
|
-
}
|
|
16
|
-
|
|
18
|
+
}
|