@univerjs/icons-svg 1.0.0-alpha.3 → 1.0.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/icons-svg",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.1",
4
4
  "description": "SVG icons for Univer",
5
5
  "author": "DreamNum Co., Ltd. <developer@univer.ai>",
6
6
  "license": "MIT",
@@ -21,7 +21,12 @@
21
21
  ],
22
22
  "sideEffects": false,
23
23
  "exports": {
24
- "./manifest.json": "./manifest.json"
24
+ "./manifest": "./manifest.json"
25
25
  },
26
+ "files": [
27
+ "double",
28
+ "other",
29
+ "single"
30
+ ],
26
31
  "scripts": {}
27
32
  }
@@ -1,44 +0,0 @@
1
- import { globSync, writeFileSync } from 'node:fs'
2
- import { cwd } from 'node:process'
3
-
4
- function main() {
5
- const currentPath = cwd()
6
-
7
- const svgFiles = globSync('**/*.svg', {
8
- cwd: currentPath,
9
- })
10
-
11
- const manifest: Map<string, {
12
- name: string
13
- componentName: string
14
- group: string
15
- path: string
16
- }[]> = new Map()
17
-
18
- for (const filePath of svgFiles) {
19
- const key = filePath.split('/')[0]
20
-
21
- if (!manifest.has(key)) {
22
- manifest.set(key, [])
23
- }
24
-
25
- const iconName = filePath.split('/').pop()!.replace('.svg', '')
26
-
27
- manifest.get(key)!.push({
28
- name: iconName,
29
- componentName: iconName
30
- .split('-')
31
- .map(part => part.charAt(0).toUpperCase() + part.slice(1))
32
- .join(''),
33
- group: key,
34
- path: `${currentPath}/${filePath}`,
35
- })
36
- }
37
-
38
- writeFileSync(
39
- `${currentPath}/manifest.json`,
40
- JSON.stringify(Object.fromEntries(manifest), null, 2),
41
- )
42
- }
43
-
44
- main()