@kq_npm/client_icons_vue 0.7.8-beta → 0.8.0-beta
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/package.json +1 -1
- package/packages/svg/package-lock.json +155 -0
- package/packages/svg/svgo.config.js +12 -0
- package/packages/svg//346/225/260/346/215/256/346/243/200/346/237/245-icon-data-check.svg +1 -0
- package/packages/svg//351/253/230/346/270/205/345/207/272/345/233/276-icon-high-definition-imaging.svg +1 -0
- package/packages/svg//351/253/230/347/272/247/345/207/272/345/233/276-icon-advanced-imaging.svg +1 -0
- package/packages/vue/build/build.js +77 -0
- package/packages/vue/build/generate.js +90 -0
- package/packages/vue/build/paths.js +9 -0
- package/packages/vue/build/publish.js +78 -0
- package/packages/vue/package-lock.json +3300 -0
- package/packages/vue/package.json +1 -1
- package/packages/vue/src/global.js +11 -0
- package/packages/vue/src/index.js +11 -0
- package/packages/vue/dist/global.cjs +0 -7108
- package/packages/vue/dist/global.iife.js +0 -7121
- package/packages/vue/dist/global.iife.min.js +0 -4
- package/packages/vue/dist/global.iife.min.js.map +0 -7
- package/packages/vue/dist/global.js +0 -7094
- package/packages/vue/dist/global.min.cjs +0 -4
- package/packages/vue/dist/global.min.cjs.map +0 -7
- package/packages/vue/dist/global.min.js +0 -4
- package/packages/vue/dist/global.min.js.map +0 -7
- package/packages/vue/dist/index.cjs +0 -7108
- package/packages/vue/dist/index.iife.js +0 -7121
- package/packages/vue/dist/index.iife.min.js +0 -4
- package/packages/vue/dist/index.iife.min.js.map +0 -7
- package/packages/vue/dist/index.js +0 -7094
- package/packages/vue/dist/index.min.cjs +0 -4
- package/packages/vue/dist/index.min.cjs.map +0 -7
- package/packages/vue/dist/index.min.js +0 -4
- package/packages/vue/dist/index.min.js.map +0 -7
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@kq_npm/client_icons_vue","author":"KQWEB GROUP","description":"KQGIS Client Icons for Vue.js","version":"0.
|
|
1
|
+
{"name":"@kq_npm/client_icons_vue","author":"KQWEB GROUP","description":"KQGIS Client Icons for Vue.js","version":"0.8.0-beta","homepage":"","keywords":["KQGIS","Vue","Icon"],"main":"./packages/vue/dist/index.js","scripts":{"serve":"npm run build:svg && vue-cli-service serve","build":"npm run build:svg && vue-cli-service build","lint":"vue-cli-service lint","build:svg":"svgo -f ./packages/svg -o ./packages/svg --config=./packages/svg/svgo.config.js && npm run -C ./packages/vue build","publish:svg":"npm run build:svg && node --experimental-json-modules ./packages/vue/build/publish.js && npm publish --access public"},"devDependencies":{"@babel/core":"^7.12.16","@babel/eslint-parser":"^7.12.16","@vue/cli-plugin-babel":"~5.0.0","@vue/cli-plugin-eslint":"~5.0.0","@vue/cli-service":"^5.0.1","core-js":"^3.29.1","element-plus":"^2.3.1","eslint":"^7.32.0","eslint-plugin-vue":"^8.0.3","execa":"^2.0.0","follow-redirects":"^1.15.6","json5":"^2.0.0","vue":"^3.2.13","vue-clipboard3":"^2.0.0","webpack-dev-server":"^5.1.0","ws":"^8.18.0"},"eslintConfig":{"root":true,"env":{"node":true},"extends":["plugin:vue/vue3-essential","eslint:recommended"],"parserOptions":{"parser":"@babel/eslint-parser"},"rules":{}},"browserslist":["> 1%","last 2 versions","not dead","not ie 11"],"dependencies":{}}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kqwebclient-vue/icons-svg",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"lockfileVersion": 1,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@trysound/sax": {
|
|
8
|
+
"version": "0.2.0",
|
|
9
|
+
"resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz",
|
|
10
|
+
"integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==",
|
|
11
|
+
"dev": true
|
|
12
|
+
},
|
|
13
|
+
"boolbase": {
|
|
14
|
+
"version": "1.0.0",
|
|
15
|
+
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
|
|
16
|
+
"integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==",
|
|
17
|
+
"dev": true
|
|
18
|
+
},
|
|
19
|
+
"commander": {
|
|
20
|
+
"version": "7.2.0",
|
|
21
|
+
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
|
|
22
|
+
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
|
23
|
+
"dev": true
|
|
24
|
+
},
|
|
25
|
+
"css-select": {
|
|
26
|
+
"version": "4.3.0",
|
|
27
|
+
"resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz",
|
|
28
|
+
"integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==",
|
|
29
|
+
"dev": true,
|
|
30
|
+
"requires": {
|
|
31
|
+
"boolbase": "^1.0.0",
|
|
32
|
+
"css-what": "^6.0.1",
|
|
33
|
+
"domhandler": "^4.3.1",
|
|
34
|
+
"domutils": "^2.8.0",
|
|
35
|
+
"nth-check": "^2.0.1"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"css-tree": {
|
|
39
|
+
"version": "1.1.3",
|
|
40
|
+
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
|
|
41
|
+
"integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
|
|
42
|
+
"dev": true,
|
|
43
|
+
"requires": {
|
|
44
|
+
"mdn-data": "2.0.14",
|
|
45
|
+
"source-map": "^0.6.1"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"css-what": {
|
|
49
|
+
"version": "6.1.0",
|
|
50
|
+
"resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz",
|
|
51
|
+
"integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==",
|
|
52
|
+
"dev": true
|
|
53
|
+
},
|
|
54
|
+
"csso": {
|
|
55
|
+
"version": "4.2.0",
|
|
56
|
+
"resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz",
|
|
57
|
+
"integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==",
|
|
58
|
+
"dev": true,
|
|
59
|
+
"requires": {
|
|
60
|
+
"css-tree": "^1.1.2"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"dom-serializer": {
|
|
64
|
+
"version": "1.4.1",
|
|
65
|
+
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz",
|
|
66
|
+
"integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==",
|
|
67
|
+
"dev": true,
|
|
68
|
+
"requires": {
|
|
69
|
+
"domelementtype": "^2.0.1",
|
|
70
|
+
"domhandler": "^4.2.0",
|
|
71
|
+
"entities": "^2.0.0"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"domelementtype": {
|
|
75
|
+
"version": "2.3.0",
|
|
76
|
+
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
|
|
77
|
+
"integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
|
|
78
|
+
"dev": true
|
|
79
|
+
},
|
|
80
|
+
"domhandler": {
|
|
81
|
+
"version": "4.3.1",
|
|
82
|
+
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz",
|
|
83
|
+
"integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==",
|
|
84
|
+
"dev": true,
|
|
85
|
+
"requires": {
|
|
86
|
+
"domelementtype": "^2.2.0"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"domutils": {
|
|
90
|
+
"version": "2.8.0",
|
|
91
|
+
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
|
|
92
|
+
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
|
|
93
|
+
"dev": true,
|
|
94
|
+
"requires": {
|
|
95
|
+
"dom-serializer": "^1.0.1",
|
|
96
|
+
"domelementtype": "^2.2.0",
|
|
97
|
+
"domhandler": "^4.2.0"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"entities": {
|
|
101
|
+
"version": "2.2.0",
|
|
102
|
+
"resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
|
|
103
|
+
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
|
|
104
|
+
"dev": true
|
|
105
|
+
},
|
|
106
|
+
"mdn-data": {
|
|
107
|
+
"version": "2.0.14",
|
|
108
|
+
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz",
|
|
109
|
+
"integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==",
|
|
110
|
+
"dev": true
|
|
111
|
+
},
|
|
112
|
+
"nth-check": {
|
|
113
|
+
"version": "2.1.1",
|
|
114
|
+
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
|
|
115
|
+
"integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
|
|
116
|
+
"dev": true,
|
|
117
|
+
"requires": {
|
|
118
|
+
"boolbase": "^1.0.0"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"picocolors": {
|
|
122
|
+
"version": "1.0.0",
|
|
123
|
+
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
|
124
|
+
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
|
|
125
|
+
"dev": true
|
|
126
|
+
},
|
|
127
|
+
"source-map": {
|
|
128
|
+
"version": "0.6.1",
|
|
129
|
+
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
|
130
|
+
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
|
131
|
+
"dev": true
|
|
132
|
+
},
|
|
133
|
+
"stable": {
|
|
134
|
+
"version": "0.1.8",
|
|
135
|
+
"resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz",
|
|
136
|
+
"integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==",
|
|
137
|
+
"dev": true
|
|
138
|
+
},
|
|
139
|
+
"svgo": {
|
|
140
|
+
"version": "2.8.0",
|
|
141
|
+
"resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz",
|
|
142
|
+
"integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==",
|
|
143
|
+
"dev": true,
|
|
144
|
+
"requires": {
|
|
145
|
+
"@trysound/sax": "0.2.0",
|
|
146
|
+
"commander": "^7.2.0",
|
|
147
|
+
"css-select": "^4.1.3",
|
|
148
|
+
"css-tree": "^1.1.3",
|
|
149
|
+
"csso": "^4.2.0",
|
|
150
|
+
"picocolors": "^1.0.0",
|
|
151
|
+
"stable": "^0.1.8"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M834.846 62.09A122.476 122.476 0 0 1 961.82 178.565V866.93a99.98 99.98 0 0 1-103.98 94.981H188.975A122.476 122.476 0 0 1 62 845.433V178.566A122.476 122.476 0 0 1 188.975 62.09zm0 64.487H188.975a54.49 54.49 0 0 0-57.489 49.99v668.866a54.49 54.49 0 0 0 57.489 49.99H857.84a32.993 32.993 0 0 0 34.993-30.494V178.566a54.989 54.989 0 0 0-57.988-49.99zM598.393 415.519a167.467 167.467 0 0 1 172.966 160.968 152.97 152.97 0 0 1-28.495 88.482l86.483 80.484a29.494 29.494 0 0 1 9.998 22.496 31.494 31.494 0 0 1-9.998 22.995 37.992 37.992 0 0 1-24.995 9.498 35.493 35.493 0 0 1-23.995-9.498l-85.483-78.984a177.965 177.965 0 0 1-95.481 26.994 166.967 166.967 0 0 1-172.966-160.468A167.467 167.467 0 0 1 599.393 417.52zm0 64.487a99.98 99.98 0 0 0-103.98 96.48 99.98 99.98 0 0 0 103.98 95.982 99.98 99.98 0 0 0 103.98-95.981 99.98 99.98 0 0 0-103.98-96.48zM390.934 415.52a32.494 32.494 0 1 1 0 64.487H286.955a32.494 32.494 0 1 1 0-64.487zm311.438-176.465a32.993 32.993 0 0 1 34.493 31.994 33.493 33.493 0 0 1-34.493 31.993H286.955a33.493 33.493 0 0 1-34.493-31.993 32.993 32.993 0 0 1 34.493-31.994zm0 0" fill="currentColor"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M224 192a96 96 0 0 0-96 96v576a96 96 0 0 0 96 96h576a96 96 0 0 0 96-96V368a32 32 0 0 1 64 0v496a160 160 0 0 1-160 160H224A160 160 0 0 1 64 864V288a160 160 0 0 1 160-160h565.312a32 32 0 1 1 0 64H224z" fill="currentColor"/><path d="M704 296.96V23.04a12.8 12.8 0 0 1 19.584-10.816l219.072 136.96a12.8 12.8 0 0 1 0 21.696L723.584 307.776A12.8 12.8 0 0 1 704 296.896zm96 171.712c6.72 13.76 10.112 28.672 10.112 44.672.128 16-1.28 31.232-4.288 45.696-7.872 36.8-21.888 67.84-41.984 93.44C736.576 686.784 702.08 704 660.288 704h-119.04l58.688-276.352h119.04c17.024.256 30.848 2.24 41.472 5.952 17.984 6.4 31.168 18.112 39.552 35.072zm-53.76 94.336c5.952-28.16 6.144-49.664.512-64.64-5.632-15.168-21.568-22.72-47.808-22.72h-53.248L607.36 656h53.248c27.264 0 49.152-13.44 65.664-40.32 8.96-14.72 15.616-32.32 19.84-52.672zm-399.616 17.6L320.576 704H263.36l58.688-276.352h57.216l-22.528 105.344h108.032l22.464-105.344h57.408L485.952 704h-57.408l26.112-123.392H346.624z" fill="currentColor"/></svg>
|
package/packages/svg//351/253/230/347/272/247/345/207/272/345/233/276-icon-advanced-imaging.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path d="M224 192a96 96 0 0 0-96 96v576a96 96 0 0 0 96 96h576a96 96 0 0 0 96-96V368a32 32 0 0 1 64 0v496a160 160 0 0 1-160 160H224A160 160 0 0 1 64 864V288a160 160 0 0 1 160-160h565.312a32 32 0 1 1 0 64H224z" fill="currentColor"/><path d="M704 296.96V23.04a12.8 12.8 0 0 1 19.584-10.816l219.072 136.96a12.8 12.8 0 0 1 0 21.696L723.584 307.776A12.8 12.8 0 0 1 704 296.896zM320 352a32 32 0 1 0 0 64 32 32 0 0 0 0-64zm-96 32a96 96 0 1 1 192 0 96 96 0 0 1-192 0zm461.76 160.064c-66.112-3.2-138.56 32.128-217.984 132.352-61.44 77.504-151.424 73.984-224.32 47.808-72.704-26.24-139.648-77.952-172.16-117.248a32 32 0 1 1 49.344-40.768c25.344 30.592 82.752 75.52 144.512 97.792 61.504 22.144 115.968 18.624 152.448-27.328 85.824-108.288 176-161.28 271.36-156.48 93.44 4.608 180.8 64.448 262.72 154.88a32 32 0 1 1-47.36 42.944c-78.08-86.144-150.72-130.56-218.56-133.952z" fill="currentColor"/></svg>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import consola from 'consola'
|
|
3
|
+
import chalk from 'chalk'
|
|
4
|
+
import { build } from 'esbuild'
|
|
5
|
+
import GlobalsPlugin from 'esbuild-plugin-globals'
|
|
6
|
+
import vue from 'unplugin-vue/esbuild'
|
|
7
|
+
import { emptyDir } from 'fs-extra'
|
|
8
|
+
import { version } from '../package.json'
|
|
9
|
+
import { pathOutput, pathSrc } from './paths'
|
|
10
|
+
|
|
11
|
+
const buildBundle = async () => {
|
|
12
|
+
const getBuildOptions = (format) => {
|
|
13
|
+
const options = {
|
|
14
|
+
entryPoints: [
|
|
15
|
+
path.resolve(pathSrc, "index.js"),
|
|
16
|
+
path.resolve(pathSrc, "global.js"),
|
|
17
|
+
],
|
|
18
|
+
target: "es2018",
|
|
19
|
+
platform: "neutral",
|
|
20
|
+
plugins: [
|
|
21
|
+
vue({
|
|
22
|
+
isProduction: true,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
bundle: true,
|
|
26
|
+
format,
|
|
27
|
+
minifySyntax: true,
|
|
28
|
+
banner: {
|
|
29
|
+
js: `/*! kqwebclient Vue Icons v${version} */\n`,
|
|
30
|
+
},
|
|
31
|
+
outdir: pathOutput,
|
|
32
|
+
};
|
|
33
|
+
if (format === 'iife') {
|
|
34
|
+
options.plugins.push(
|
|
35
|
+
GlobalsPlugin({
|
|
36
|
+
vue: 'Vue',
|
|
37
|
+
})
|
|
38
|
+
)
|
|
39
|
+
options.globalName = "KQWebClientVueIcons";
|
|
40
|
+
} else {
|
|
41
|
+
options.external = ['vue']
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return options
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const doBuild = async (minify) => {
|
|
48
|
+
await Promise.all([
|
|
49
|
+
build({
|
|
50
|
+
...getBuildOptions('esm'),
|
|
51
|
+
entryNames: `[name]${minify ? '.min' : ''}`,
|
|
52
|
+
minify,
|
|
53
|
+
sourcemap: minify,
|
|
54
|
+
}),
|
|
55
|
+
build({
|
|
56
|
+
...getBuildOptions('iife'),
|
|
57
|
+
entryNames: `[name].iife${minify ? '.min' : ''}`,
|
|
58
|
+
minify,
|
|
59
|
+
sourcemap: minify,
|
|
60
|
+
}),
|
|
61
|
+
build({
|
|
62
|
+
...getBuildOptions('cjs'),
|
|
63
|
+
entryNames: `[name]${minify ? '.min' : ''}`,
|
|
64
|
+
outExtension: { '.js': '.cjs' },
|
|
65
|
+
minify,
|
|
66
|
+
sourcemap: minify,
|
|
67
|
+
}),
|
|
68
|
+
])
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return Promise.all([doBuild(true), doBuild(false)])
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
consola.info(chalk.blue('cleaning dist...'))
|
|
75
|
+
await emptyDir(pathOutput)
|
|
76
|
+
consola.info(chalk.blue('building...'))
|
|
77
|
+
await buildBundle()
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { readFile, writeFile } from "fs/promises";
|
|
3
|
+
import { emptyDir, ensureDir } from "fs-extra";
|
|
4
|
+
import consola from "consola";
|
|
5
|
+
import camelcase from "camelcase";
|
|
6
|
+
import glob from "fast-glob";
|
|
7
|
+
import { format } from "prettier";
|
|
8
|
+
import chalk from "chalk";
|
|
9
|
+
import findWorkspaceDir from "@pnpm/find-workspace-dir";
|
|
10
|
+
import findWorkspacePackages from "@pnpm/find-workspace-packages";
|
|
11
|
+
import { pathComponents } from "./paths";
|
|
12
|
+
|
|
13
|
+
const getSvgFiles = async () => {
|
|
14
|
+
const pkgs = await findWorkspacePackages.default(
|
|
15
|
+
await findWorkspaceDir.default(process.cwd())
|
|
16
|
+
);
|
|
17
|
+
const pkg = pkgs.find(
|
|
18
|
+
(pkg) => pkg.manifest.name === "@kqwebclient-vue/icons-svg"
|
|
19
|
+
);
|
|
20
|
+
return glob("*.svg", { cwd: pkg.dir, absolute: true });
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const getName = (file) => {
|
|
24
|
+
let filename = path.basename(file).replace(".svg", "");
|
|
25
|
+
let fileTile = filename.split("-")[0];
|
|
26
|
+
filename = `icon${filename.split("icon")[1]}`;
|
|
27
|
+
let componentName = camelcase(filename, {
|
|
28
|
+
pascalCase: true,
|
|
29
|
+
preserveConsecutiveUppercase: true,
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
filename,
|
|
33
|
+
fileTile,
|
|
34
|
+
componentName,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const formatCode = (code, parser) =>
|
|
39
|
+
format(code, {
|
|
40
|
+
parser,
|
|
41
|
+
semi: false,
|
|
42
|
+
singleQuote: true,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const transformToVueComponent = async (file) => {
|
|
46
|
+
let content = await readFile(file, "utf-8");
|
|
47
|
+
|
|
48
|
+
let { filename, componentName, fileTile } = getName(file);
|
|
49
|
+
// content = convertShapeToPath(content);
|
|
50
|
+
const vue = formatCode(
|
|
51
|
+
`
|
|
52
|
+
<template>
|
|
53
|
+
${content}
|
|
54
|
+
</template>
|
|
55
|
+
<script lang="ts">
|
|
56
|
+
import type { DefineComponent } from 'vue'
|
|
57
|
+
export default ({
|
|
58
|
+
name: "${componentName}",
|
|
59
|
+
title:"${fileTile}"
|
|
60
|
+
}) as DefineComponent
|
|
61
|
+
</script>`,
|
|
62
|
+
"vue"
|
|
63
|
+
);
|
|
64
|
+
writeFile(path.resolve(pathComponents, `${filename}.vue`), vue, "utf-8");
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const generateEntry = async (files) => {
|
|
68
|
+
const code = formatCode(
|
|
69
|
+
files
|
|
70
|
+
.map((file) => {
|
|
71
|
+
const { filename, componentName } = getName(file);
|
|
72
|
+
return `export { default as ${componentName} } from './${filename}.vue'`;
|
|
73
|
+
})
|
|
74
|
+
.join("\n")
|
|
75
|
+
);
|
|
76
|
+
await writeFile(path.resolve(pathComponents, "index.js"), code, "utf-8");
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
consola.info(chalk.blue("generating vue components"));
|
|
80
|
+
|
|
81
|
+
await ensureDir(pathComponents);
|
|
82
|
+
await emptyDir(pathComponents);
|
|
83
|
+
|
|
84
|
+
const files = await getSvgFiles();
|
|
85
|
+
|
|
86
|
+
consola.info(chalk.blue("generating vue files"));
|
|
87
|
+
await Promise.all(files.map((file) => transformToVueComponent(file)));
|
|
88
|
+
|
|
89
|
+
consola.info(chalk.blue("generating entry file"));
|
|
90
|
+
await generateEntry(files);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { dirname, resolve } from "path";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
|
|
4
|
+
const dir = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
|
|
6
|
+
export const pathRoot = resolve(dir, "..");
|
|
7
|
+
export const pathSrc = resolve(pathRoot, "src");
|
|
8
|
+
export const pathComponents = resolve(pathSrc, "components");
|
|
9
|
+
export const pathOutput = resolve(pathRoot, "dist");
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import config from "../../../package.json";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { exec } from "child_process";
|
|
6
|
+
|
|
7
|
+
const __filenameNew = fileURLToPath(import.meta.url);
|
|
8
|
+
|
|
9
|
+
const __dirnameNew = path.dirname(__filenameNew);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 获取npm仓库最新包的版本号
|
|
13
|
+
*/
|
|
14
|
+
const getLatestPackageVersion = () => {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
exec(
|
|
17
|
+
`npm view @kq_npm/client_icons_vue version --json`,
|
|
18
|
+
(error, stdout) => {
|
|
19
|
+
if (error) {
|
|
20
|
+
reject(error);
|
|
21
|
+
} else {
|
|
22
|
+
try {
|
|
23
|
+
resolve(JSON.parse(stdout.trim()));
|
|
24
|
+
} catch (parseError) {
|
|
25
|
+
reject(parseError);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 动态生成版本号
|
|
35
|
+
*/
|
|
36
|
+
const setVersion = (version) => {
|
|
37
|
+
var suffix = version.split("-")[1];
|
|
38
|
+
var prefix = version.split("-")[0].split(".");
|
|
39
|
+
prefix[2]++;
|
|
40
|
+
if (prefix[2] > 9) {
|
|
41
|
+
prefix[2] = 0;
|
|
42
|
+
prefix[1]++;
|
|
43
|
+
if (prefix[1] > 9) {
|
|
44
|
+
prefix[1] = 0;
|
|
45
|
+
prefix[0]++;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const _version = prefix.join(".") + "-" + suffix;
|
|
49
|
+
console.log(`即将上传的@kq_npm/client_icons_vue的版本: ${_version}`);
|
|
50
|
+
return _version;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const setConfig = (str) => {
|
|
54
|
+
fs.writeFile(
|
|
55
|
+
path.resolve(__dirnameNew, `../../../package.json`),
|
|
56
|
+
str,
|
|
57
|
+
(err, res) => {
|
|
58
|
+
if (err) {
|
|
59
|
+
console.log(`../../../package.jsonn修改失败${err}`);
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
62
|
+
console.log(`../../../package.json修改成功`);
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
getLatestPackageVersion()
|
|
68
|
+
.then((version) => {
|
|
69
|
+
console.log(`线上npm仓库的@kq_npm/client_icons_vue最新版本: ${version}`);
|
|
70
|
+
config.version = setVersion(version);
|
|
71
|
+
setConfig(JSON.stringify(config));
|
|
72
|
+
})
|
|
73
|
+
.catch((error) => {
|
|
74
|
+
console.error(
|
|
75
|
+
`获取线上npm仓库的@kq_npm/client_icons_vue版本时出错:`,
|
|
76
|
+
error
|
|
77
|
+
);
|
|
78
|
+
});
|