@varlet/icons 2.0.5 → 2.1.0-alpha.1666877950844

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = [
1
+ export default [
2
2
  "checkbox-marked-circle",
3
3
  "check-circle-outline",
4
4
  "information",
package/lib/index.js CHANGED
@@ -1,23 +1,24 @@
1
1
  #!/usr/bin/env node
2
+ import webfont from 'webfont'
3
+ import commander from 'commander'
4
+ import fse from 'fs-extra'
5
+ import { resolve } from 'path'
6
+ import { pathToFileURL } from 'url'
2
7
 
3
- const webfont = require('webfont').default
4
- const commander = require('commander')
5
- const { writeFile, ensureDir, removeSync, readdirSync } = require('fs-extra')
6
- const { resolve } = require('path')
7
-
8
- const CWD = process.cwd()
9
- const SVG_DIR = resolve(CWD, 'svg')
10
- const DIST_DIR = resolve(CWD, 'dist')
11
- const FONTS_DIR = resolve(DIST_DIR, 'fonts')
12
- const CSS_DIR = resolve(DIST_DIR, 'css')
13
- const formats = ['ttf', 'woff', 'woff2']
14
-
15
- const config = require(resolve(CWD, 'varlet-icons.config.js'))
8
+ const { writeFile, ensureDir, removeSync, readdirSync } = fse
16
9
 
17
10
  async function build() {
11
+ const CWD = process.cwd()
12
+ const SVG_DIR = resolve(CWD, 'svg')
13
+ const DIST_DIR = resolve(CWD, 'dist')
14
+ const FONTS_DIR = resolve(DIST_DIR, 'fonts')
15
+ const CSS_DIR = resolve(DIST_DIR, 'css')
16
+ const formats = ['ttf', 'woff', 'woff2']
17
+ const { default: config } = await import(pathToFileURL(resolve(CWD, 'varlet-icons.config.js')))
18
+
18
19
  const { base64, publicPath, namespace, fontName, fileName, fontWeight = 'normal', fontStyle = 'normal' } = config
19
20
 
20
- const { ttf, woff, woff2 } = await webfont({
21
+ const { ttf, woff, woff2 } = await webfont.default({
21
22
  files: `${SVG_DIR}/*.svg`,
22
23
  fontName,
23
24
  formats,
@@ -42,12 +43,6 @@ async function build() {
42
43
  const iconNames = icons.map((iconName) => ` "${iconName.name}"`)
43
44
 
44
45
  const indexTemplate = `\
45
- module.exports = [
46
- ${iconNames.join(',\n')}
47
- ]
48
- `
49
-
50
- const indexESMTemplate = `\
51
46
  export default [
52
47
  ${iconNames.join(',\n')}
53
48
  ]
@@ -101,7 +96,6 @@ ${icons
101
96
  writeFile(resolve(CSS_DIR, `${fileName}.css`), cssTemplate),
102
97
  writeFile(resolve(CSS_DIR, `${fileName}.less`), cssTemplate),
103
98
  writeFile(resolve(DIST_DIR, 'index.js'), indexTemplate),
104
- writeFile(resolve(DIST_DIR, 'index.esm.js'), indexESMTemplate),
105
99
  ])
106
100
 
107
101
  console.log('build success!')
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@varlet/icons",
3
- "version": "2.0.5",
3
+ "version": "2.1.0-alpha.1666877950844",
4
4
  "description": "Icons of varlet",
5
+ "type": "module",
5
6
  "main": "dist/index.js",
6
- "module": "dist/index.esm.js",
7
+ "module": "dist/index.js",
7
8
  "bin": {
8
9
  "varlet-icons": "lib/index.js"
9
10
  },
@@ -31,6 +32,9 @@
31
32
  "fs-extra": "^9.0.1",
32
33
  "webfont": "^9.0.0"
33
34
  },
35
+ "devDependencies": {
36
+ "@types/node": "^18.7.20"
37
+ },
34
38
  "scripts": {
35
39
  "build": "varlet-icons build"
36
40
  }
package/dist/index.esm.js DELETED
@@ -1,116 +0,0 @@
1
- export default [
2
- "checkbox-marked-circle",
3
- "check-circle-outline",
4
- "information",
5
- "information-outline",
6
- "warning",
7
- "alert-outline",
8
- "error",
9
- "alert-circle-outline",
10
- "checkbox-marked",
11
- "checkbox-marked-outline",
12
- "checkbox-blank-outline",
13
- "radio-marked",
14
- "checkbox-marked-circle-outline",
15
- "radio-blank",
16
- "close-circle",
17
- "close-circle-outline",
18
- "close-box",
19
- "close-box-outline",
20
- "minus-circle",
21
- "minus-circle-outline",
22
- "star",
23
- "star-half-full",
24
- "star-outline",
25
- "heart",
26
- "heart-half-full",
27
- "heart-outline",
28
- "delete",
29
- "trash-can",
30
- "trash-can-outline",
31
- "minus-box",
32
- "minus-box-outline",
33
- "account-circle",
34
- "account-circle-outline",
35
- "cog",
36
- "cog-outline",
37
- "map-marker-radius",
38
- "map-marker-radius-outline",
39
- "camera",
40
- "camera-outline",
41
- "cart",
42
- "cart-outline",
43
- "phone",
44
- "phone-outline",
45
- "image",
46
- "image-outline",
47
- "bell",
48
- "bell-outline",
49
- "home",
50
- "home-outline",
51
- "map-marker",
52
- "map-marker-outline",
53
- "magnify-plus",
54
- "magnify-plus-outline",
55
- "magnify-minus",
56
- "magnify-minus-outline",
57
- "play-circle",
58
- "play-circle-outline",
59
- "help-circle",
60
- "help-circle-outline",
61
- "plus-circle",
62
- "plus-circle-outline",
63
- "check",
64
- "window-close",
65
- "plus",
66
- "minus",
67
- "chevron-up",
68
- "chevron-down",
69
- "chevron-left",
70
- "chevron-right",
71
- "menu-up",
72
- "menu-down",
73
- "menu-left",
74
- "menu-right",
75
- "upload",
76
- "download",
77
- "format-list-checkbox",
78
- "menu",
79
- "menu-open",
80
- "dots-vertical",
81
- "message-text-outline",
82
- "message-processing-outline",
83
- "white-balance-sunny",
84
- "weather-cloudy",
85
- "weather-lightning",
86
- "weather-pouring",
87
- "weather-snowy",
88
- "weather-rainy",
89
- "translate",
90
- "magnify",
91
- "github",
92
- "refresh",
93
- "arrow-down",
94
- "power",
95
- "file-document-outline",
96
- "fire",
97
- "wifi",
98
- "wrench",
99
- "cake-variant",
100
- "notebook",
101
- "cellphone",
102
- "weather-night",
103
- "xml",
104
- "content-copy",
105
- "qrcode-scan",
106
- "barcode-scan",
107
- "shopping",
108
- "shopping-outline",
109
- "card-account-details",
110
- "card-account-details-outline",
111
- "pin",
112
- "pin-off",
113
- "pin-outline",
114
- "pin-off-outline",
115
- "code-json"
116
- ]