dufu1991 2 rokov pred
rodič
commit
eef1c6623e

+ 2 - 2
packages/rollup-plugin-stdf-icon/package.json

@@ -1,11 +1,11 @@
 {
 	"name": "rollup-plugin-stdf-icon",
-	"version": "0.0.11",
+	"version": "0.0.12",
 	"description": "A Rollup plugin that combines a series of svg into one symbol for use in the STDF project",
 	"main": "dist/index.js",
 	"scripts": {
 		"build": "rollup -c",
-		"test": "echo \"Error: no test specified\" && exit 1"
+		"test": "node test/index.js"
 	},
 	"type": "module",
 	"author": "dufu1991",

+ 1 - 0
packages/rollup-plugin-stdf-icon/test/icons/ri-cake-2-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 6V9.999H11V6H13V9.999H16V6H18V9.999L19 10C20.5977 10 21.9037 11.2489 21.9949 12.8237L22 13V14C22 15.0139 21.6227 15.9397 21.001 16.6447L21 21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21L2.99917 16.6401C2.47812 16.0464 2.12795 15.2943 2.02793 14.4584L2.00551 14.2052L2 14V13C2 11.4023 3.24892 10.0963 4.82373 10.0051L5 10L6 9.999V6H8ZM19 12H5C4.48716 12 4.06449 12.386 4.00673 12.8834L4 13L3.99958 13.9711L4.00342 14.1184C4.06444 15.1715 4.93934 16 6 16C7.00762 16 7.84761 15.2523 7.98033 14.2995L7.99532 14.1474L8.00042 13.9711C8.03649 12.7225 9.82713 12.6779 9.98853 13.8373L9.99958 13.9711L10.0034 14.1184C10.0644 15.1715 10.9393 16 12 16C13.0544 16 13.9182 15.1841 13.9945 14.1493L14.007 13.8668C14.131 12.7111 15.869 12.7111 15.993 13.8668L16.0055 14.1493C16.0818 15.1841 16.9456 16 18 16C19.0544 16 19.9182 15.1841 19.9945 14.1493L20 14V13C20 12.4872 19.614 12.0645 19.1166 12.0067L19 12ZM7 1C8.31948 1.87119 8.6633 3.08803 8.44889 3.88823C8.23448 4.68843 7.41197 5.1633 6.61177 4.94889C5.81157 4.73448 5.3367 3.91197 5.55111 3.11177C5.84871 2.00111 7 2.5 7 1ZM12 1C13.3195 1.87119 13.6633 3.08803 13.4489 3.88823C13.2345 4.68843 12.412 5.1633 11.6118 4.94889C10.8116 4.73448 10.3367 3.91197 10.5511 3.11177C10.8487 2.00111 12 2.5 12 1ZM17 1C18.3195 1.87119 18.6633 3.08803 18.4489 3.88823C18.2345 4.68843 17.412 5.1633 16.6118 4.94889C15.8116 4.73448 15.3367 3.91197 15.5511 3.11177C15.8487 2.00111 17 2.5 17 1Z"></path></svg>

+ 1 - 0
packages/rollup-plugin-stdf-icon/test/icons/ri-medal-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 7.00002C16.4183 7.00002 20 10.5817 20 15C20 19.4183 16.4183 23 12 23C7.58172 23 4 19.4183 4 15C4 10.5817 7.58172 7.00002 12 7.00002ZM12 10.5L10.6775 13.1797L7.72025 13.6094L9.86012 15.6953L9.35497 18.6406L12 17.25L14.645 18.6406L14.1399 15.6953L16.2798 13.6094L13.3225 13.1797L12 10.5ZM13 1.99902L18 2.00002V5.00002L16.6366 6.13758C15.5305 5.55773 14.3025 5.17887 13.0011 5.04951L13 1.99902ZM11 1.99902L10.9997 5.04943C9.6984 5.17866 8.47046 5.55738 7.36441 6.13706L6 5.00002V2.00002L11 1.99902Z"></path></svg>

+ 1 - 0
packages/rollup-plugin-stdf-icon/test/icons/ri-paint-brush-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 4.99658V7.99658H19V4.99658H5ZM4 2.99658H20C20.5523 2.99658 21 3.4443 21 3.99658V8.99658C21 9.54887 20.5523 9.99658 20 9.99658H4C3.44772 9.99658 3 9.54887 3 8.99658V3.99658C3 3.4443 3.44772 2.99658 4 2.99658ZM6 11.9966H12C12.5523 11.9966 13 12.4443 13 12.9966V15.9966H14V21.9966H10V15.9966H11V13.9966H5C4.44772 13.9966 4 13.5489 4 12.9966V10.9966H6V11.9966ZM17.7322 13.7288L19.5 11.961L21.2678 13.7288C22.2441 14.7051 22.2441 16.288 21.2678 17.2643C20.2915 18.2407 18.7085 18.2407 17.7322 17.2643C16.7559 16.288 16.7559 14.7051 17.7322 13.7288Z"></path></svg>

+ 1 - 0
packages/rollup-plugin-stdf-icon/test/icons/ri-riding-line.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.5 21C3.01472 21 1 18.9853 1 16.5C1 14.0147 3.01472 12 5.5 12C7.98528 12 10 14.0147 10 16.5C10 18.9853 7.98528 21 5.5 21ZM5.5 19C6.88071 19 8 17.8807 8 16.5C8 15.1193 6.88071 14 5.5 14C4.11929 14 3 15.1193 3 16.5C3 17.8807 4.11929 19 5.5 19ZM18.5 21C16.0147 21 14 18.9853 14 16.5C14 14.0147 16.0147 12 18.5 12C20.9853 12 23 14.0147 23 16.5C23 18.9853 20.9853 21 18.5 21ZM18.5 19C19.8807 19 21 17.8807 21 16.5C21 15.1193 19.8807 14 18.5 14C17.1193 14 16 15.1193 16 16.5C16 17.8807 17.1193 19 18.5 19ZM11.023 10.3054L13 12V18H11V13L8.28117 10.7343C8.18221 10.6661 8.08802 10.588 8 10.5C7.21895 9.71895 7.21895 8.45262 8 7.67157L10.8284 4.84315C11.6095 4.0621 12.8758 4.0621 13.6569 4.84315L15.0711 6.25736C16.1746 7.36086 17.5548 8.01891 18.9884 8.23151L18.978 10.2474C17.0335 10.0218 15.1485 9.16323 13.6569 7.67157L11.023 10.3054ZM16 5C14.8954 5 14 4.10457 14 3C14 1.89543 14.8954 1 16 1C17.1046 1 18 1.89543 18 3C18 4.10457 17.1046 5 16 5Z"></path></svg>

+ 1 - 0
packages/rollup-plugin-stdf-icon/test/icons/ri-spy-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 13C19.2091 13 21 14.7909 21 17C21 19.2091 19.2091 21 17 21C14.8578 21 13 19.21 13 17H11C11 19.2091 9.20914 21 7 21C4.79086 21 3 19.2091 3 17C3 14.7909 4.79086 13 7 13C8.48052 13 9.77317 13.8043 10.4648 14.9999H13.5352C14.2268 13.8043 15.5195 13 17 13ZM2 12V10H4V7C4 4.79086 5.79086 3 8 3H16C18.2091 3 20 4.79086 20 7V10H22V12H2Z"></path></svg>

+ 1 - 0
packages/rollup-plugin-stdf-icon/test/icons/ri-switch-fill.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.62 21C13.5351 21 13.4786 20.9434 13.4927 20.8727V3.12726C13.4927 3.0707 13.5351 3.01414 13.6058 3.01414H16.3914C18.9366 3.01414 21.001 5.07855 21.001 7.62372V16.3904C21.001 18.9356 18.9366 21 16.3914 21H13.62ZM17.0418 11.0738C16.0379 11.0738 15.2178 11.894 15.2178 12.8979C15.2178 13.9018 16.0379 14.7219 17.0418 14.7219C18.0458 14.7219 18.8659 13.9018 18.8659 12.8979C18.8659 11.894 18.0458 11.0738 17.0418 11.0738ZM5.80066 8.40141C5.80066 7.46819 6.56421 6.70463 7.49744 6.70463C8.43067 6.70463 9.19422 7.46819 9.19422 8.40141C9.19422 9.33464 8.43067 10.0982 7.49744 10.0982C6.56421 10.0982 5.80066 9.33464 5.80066 8.40141ZM11.5414 3C11.6263 3 11.6828 3.05656 11.6687 3.12726V20.8586C11.6687 20.9293 11.6121 20.9859 11.5414 20.9859H7.61056C5.06539 20.9859 3.00098 18.9214 3.00098 16.3763V7.60958C3.00098 5.06441 5.06539 3 7.61056 3H11.5414ZM10.2264 19.5436V4.44226H7.61056C6.76217 4.44226 5.97034 4.78162 5.37647 5.37549C4.76846 5.96936 4.44324 6.76119 4.44324 7.60958V16.3763C4.44324 17.2247 4.78259 18.0165 5.37647 18.6104C5.97034 19.2184 6.76217 19.5436 7.61056 19.5436H10.2264Z"></path></svg>

+ 5 - 0
packages/rollup-plugin-stdf-icon/test/index.js

@@ -0,0 +1,5 @@
+import svgSprite from '../src/index.js';
+
+// 将会在 test 目录下生成 symbol.svg 文件,内容为 test/icons 目录下所有 svg 文件的 symbol
+// Let the symbol.svg file be generated in the test directory, and the content is the symbol of all svg files in the test/icons directory
+svgSprite([{ inFile: 'test/icons', outFile: 'test', fileName: 'symbol', simple: true }]);