@quasar/icongenie 2.5.0 → 2.5.3
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/bin/icongenie +1 -1
- package/lib/cmd/generate.js +178 -161
- package/{bin/icongenie-help → lib/cmd/help.js} +1 -2
- package/lib/cmd/profile.js +143 -56
- package/lib/cmd/verify.js +90 -139
- package/lib/generators/svg.js +3 -5
- package/lib/runner/generate.js +171 -0
- package/lib/runner/profile.js +69 -0
- package/lib/runner/verify.js +148 -0
- package/lib/utils/merge-objects.js +1 -1
- package/lib/utils/parse-argv.js +24 -6
- package/package.json +12 -10
- package/bin/icongenie-generate +0 -189
- package/bin/icongenie-profile +0 -150
- package/bin/icongenie-verify +0 -100
package/lib/utils/parse-argv.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { existsSync, lstatSync } = require('fs')
|
|
2
|
-
const { resolve, normalize, join } = require('path')
|
|
2
|
+
const { resolve, normalize, join, isAbsolute } = require('path')
|
|
3
3
|
const untildify = require('untildify')
|
|
4
4
|
|
|
5
5
|
const getPngSize = require('./get-png-size')
|
|
@@ -124,6 +124,27 @@ function padding (value, argv) {
|
|
|
124
124
|
: sizes
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
function parseIconPath (value) {
|
|
128
|
+
const __path = untildify(value)
|
|
129
|
+
|
|
130
|
+
if (isAbsolute(__path)) {
|
|
131
|
+
return existsSync(__path) === true
|
|
132
|
+
? __path
|
|
133
|
+
: null
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
let icon = resolve(process.cwd(), __path)
|
|
137
|
+
|
|
138
|
+
if (existsSync(icon)) {
|
|
139
|
+
return icon
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const { appDir } = require('./app-paths')
|
|
143
|
+
icon = resolve(appDir, __path)
|
|
144
|
+
|
|
145
|
+
return existsSync(icon) ? icon : null
|
|
146
|
+
}
|
|
147
|
+
|
|
127
148
|
function icon (value, argv) {
|
|
128
149
|
if (!value) {
|
|
129
150
|
warn(`No source icon file specified, so using the sample one`)
|
|
@@ -131,12 +152,9 @@ function icon (value, argv) {
|
|
|
131
152
|
return
|
|
132
153
|
}
|
|
133
154
|
|
|
155
|
+
argv.icon = parseIconPath(value)
|
|
134
156
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
argv.icon = resolve(appDir, untildify(value))
|
|
138
|
-
|
|
139
|
-
if (!existsSync(argv.icon)) {
|
|
157
|
+
if (!argv.icon) {
|
|
140
158
|
die(`Path to source icon file does not exists: "${value}"`)
|
|
141
159
|
}
|
|
142
160
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quasar/icongenie",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "A Quasar tool for generating all your Quasar App's icons and splashscreens",
|
|
5
5
|
"bin": {
|
|
6
6
|
"icongenie": "./bin/icongenie"
|
|
@@ -37,23 +37,25 @@
|
|
|
37
37
|
"homepage": "https://quasar.dev/icongenie/introduction",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@hapi/joi": "^17.1.1",
|
|
40
|
-
"kolorist": "^1.5.1",
|
|
41
40
|
"cross-spawn": "^7.0.2",
|
|
42
41
|
"elementtree": "^0.1.7",
|
|
43
|
-
"fast-glob": "^3.2.
|
|
44
|
-
"fs-extra": "^
|
|
42
|
+
"fast-glob": "^3.2.11",
|
|
43
|
+
"fs-extra": "^10.0.1",
|
|
45
44
|
"imagemin": "^7.0.1",
|
|
46
|
-
"imagemin-pngquant": "^
|
|
45
|
+
"imagemin-pngquant": "^9.0.2",
|
|
47
46
|
"is-png": "^2.0.0",
|
|
48
|
-
"
|
|
49
|
-
"minimist": "^1.2.
|
|
47
|
+
"kolorist": "^1.5.1",
|
|
48
|
+
"minimist": "^1.2.6",
|
|
50
49
|
"png2icons": "^2.0.1",
|
|
51
50
|
"potrace": "^2.1.5",
|
|
52
51
|
"read-chunk": "^3.2.0",
|
|
53
|
-
"sharp": "^0.
|
|
54
|
-
"svgo": "^
|
|
52
|
+
"sharp": "^0.30.3",
|
|
53
|
+
"svgo": "^2.8.0",
|
|
55
54
|
"untildify": "^4.0.0",
|
|
56
|
-
"update-notifier": "^
|
|
55
|
+
"update-notifier": "^5.1.0"
|
|
56
|
+
},
|
|
57
|
+
"resolutions": {
|
|
58
|
+
"minimist": "^1.2.6"
|
|
57
59
|
},
|
|
58
60
|
"publishConfig": {
|
|
59
61
|
"access": "public"
|
package/bin/icongenie-generate
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const parseArgs = require('minimist')
|
|
4
|
-
const processArgv = process.argv.slice(2)
|
|
5
|
-
|
|
6
|
-
const argv = parseArgs(processArgv, {
|
|
7
|
-
alias: {
|
|
8
|
-
p: 'profile', // config file
|
|
9
|
-
i: 'icon',
|
|
10
|
-
b: 'background',
|
|
11
|
-
m: 'mode',
|
|
12
|
-
f: 'filter',
|
|
13
|
-
q: 'quality',
|
|
14
|
-
h: 'help'
|
|
15
|
-
},
|
|
16
|
-
boolean: [ 'h', 'skip-trim' ],
|
|
17
|
-
string: [
|
|
18
|
-
'p', 'i', 'b', 'm', 'f', 'q',
|
|
19
|
-
'padding',
|
|
20
|
-
'theme-color',
|
|
21
|
-
'png-color',
|
|
22
|
-
'splashscreen-color',
|
|
23
|
-
'svg-color',
|
|
24
|
-
'splashscreen-icon-ratio'
|
|
25
|
-
]
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
// if user hasn't explicitly specified this, then
|
|
29
|
-
// we shouldn't take it into account
|
|
30
|
-
if (processArgv.includes('--skip-trim') === false) {
|
|
31
|
-
delete argv['skip-trim']
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const { green } = require('kolorist')
|
|
35
|
-
|
|
36
|
-
if (argv.help) {
|
|
37
|
-
const modes = Object.keys(require('../lib/modes')).join('|')
|
|
38
|
-
const generators = Object.keys(require('../lib/generators')).join('|')
|
|
39
|
-
const defaultParams = require('../lib/utils/default-params')
|
|
40
|
-
|
|
41
|
-
console.log(`
|
|
42
|
-
Description
|
|
43
|
-
Generate App icons & splashscreens
|
|
44
|
-
|
|
45
|
-
Usage
|
|
46
|
-
$ icongenie generate [options]
|
|
47
|
-
|
|
48
|
-
# generate icons for all installed Quasar modes
|
|
49
|
-
$ icongenie generate -i /path/to/icon.png
|
|
50
|
-
$ icongenie g -i /path/to/icon.png
|
|
51
|
-
|
|
52
|
-
# generate for (as example) PWA mode only
|
|
53
|
-
$ icongenie generate -m pwa --icon /path/to/icon.png
|
|
54
|
-
|
|
55
|
-
# generate for (as example) Cordova & Capacitor mode only
|
|
56
|
-
$ icongenie g -m cordova,capacitor -i
|
|
57
|
-
/path/to/icon.png -b /path/to/background.png
|
|
58
|
-
|
|
59
|
-
# generate by using a profile file
|
|
60
|
-
$ icongenie generate -p ./icongenie-profile.json
|
|
61
|
-
|
|
62
|
-
# generate by using batch of profile files
|
|
63
|
-
$ icongenie generate -p ./folder-containing-profile-files
|
|
64
|
-
|
|
65
|
-
Options
|
|
66
|
-
--icon, -i ${green('Required')};
|
|
67
|
-
Path to source file for icon; must be:
|
|
68
|
-
- a .png file
|
|
69
|
-
- min resolution: 64x64 px (the higher the better!!)
|
|
70
|
-
- with transparency
|
|
71
|
-
Best results are with a square image (height = width)
|
|
72
|
-
Image will be trimmed automatically
|
|
73
|
-
(also see "skip-trim" and "padding" param)
|
|
74
|
-
Path can be absolute, or relative to the root of the
|
|
75
|
-
Quasar project folder
|
|
76
|
-
Recommended min size: 1024x1024 px
|
|
77
|
-
|
|
78
|
-
--background, -b Path to optional background source file (for splashscreens);
|
|
79
|
-
must be:
|
|
80
|
-
- a .png file
|
|
81
|
-
- min resolution: 128x128 px (the higher the better!!)
|
|
82
|
-
- transparency is optional (but recommended if you
|
|
83
|
-
combine with the splashscreen-color param)
|
|
84
|
-
Path can be absolute, or relative to the root of the
|
|
85
|
-
Quasar project folder
|
|
86
|
-
Recommended min size: 1024x1024 px
|
|
87
|
-
|
|
88
|
-
--mode, -m For which Quasar mode(s) to generate the assets;
|
|
89
|
-
Default: all
|
|
90
|
-
[all|${modes}]
|
|
91
|
-
Multiple can be specified, separated by ",":
|
|
92
|
-
spa,cordova
|
|
93
|
-
|
|
94
|
-
--filter, -f Filter the available generators; when used, it can
|
|
95
|
-
generate only one type of asset instead of all
|
|
96
|
-
[${generators}]
|
|
97
|
-
|
|
98
|
-
--quality Quality of the files [1 - 12] (default: ${defaultParams.quality})
|
|
99
|
-
- higher quality --> bigger filesize & slower to create
|
|
100
|
-
- lower quality --> smaller filesize & faster to create
|
|
101
|
-
|
|
102
|
-
--skip-trim Do not trim the icon source file
|
|
103
|
-
|
|
104
|
-
--padding Apply fixed padding to the icon after trimming it;
|
|
105
|
-
Syntax: <horiz: number>,<vert: number>
|
|
106
|
-
Default: 0,0
|
|
107
|
-
Example: "--padding 10,5" means apply 10px padding to top
|
|
108
|
-
10px to bottom, 5px to left side and 5px to rightside
|
|
109
|
-
|
|
110
|
-
--theme-color Theme color to use for all generators requiring a color;
|
|
111
|
-
It gets overridden if any generator color is also specified;
|
|
112
|
-
The color must be in hex format (NOT hexa) without the leading
|
|
113
|
-
'#' character. Transparency not allowed.
|
|
114
|
-
Examples: 1976D2, eee
|
|
115
|
-
|
|
116
|
-
--svg-color Color to use for the generated monochrome svgs
|
|
117
|
-
Default (if no theme-color is specified): ${defaultParams.svgColor.slice(1)}
|
|
118
|
-
The color must be in hex format (NOT hexa) without the leading
|
|
119
|
-
'#' character. Transparency not allowed.
|
|
120
|
-
Examples: 1976D2, eee
|
|
121
|
-
|
|
122
|
-
--png-color Background color to use for the png generator, when
|
|
123
|
-
"background: true" in the asset definition (like for
|
|
124
|
-
the cordova/capacitor iOS icons);
|
|
125
|
-
Default (if no theme-color is specified): ${defaultParams.pngColor.slice(1)}
|
|
126
|
-
The color must be in hex format (NOT hexa) without the leading
|
|
127
|
-
'#' character. Transparency not allowed.
|
|
128
|
-
Examples: 1976D2, eee
|
|
129
|
-
|
|
130
|
-
--splashscreen-color Background color to use for the splashscreen generator;
|
|
131
|
-
Default (if no theme-color is specified): ${defaultParams.splashscreenColor.slice(1)}
|
|
132
|
-
The color must be in hex format (NOT hexa) without the leading
|
|
133
|
-
'#' character. Transparency not allowed.
|
|
134
|
-
Examples: 1976D2, eee
|
|
135
|
-
|
|
136
|
-
--splashscreen-icon-ratio Ratio of icon size in respect to the width or height
|
|
137
|
-
(whichever is smaller) of the resulting splashscreen;
|
|
138
|
-
Represents percentages; Valid values: 0 - 100
|
|
139
|
-
If 0 then it doesn't add the icon of top of background
|
|
140
|
-
Default: ${defaultParams.splashscreenIconRatio}
|
|
141
|
-
|
|
142
|
-
--profile, -p Use JSON profile file(s):
|
|
143
|
-
- path to folder (absolute or relative to current folder)
|
|
144
|
-
that contains JSON profile files (icongenie-*.json)
|
|
145
|
-
- path to a single *.json profile file (absolute or relative
|
|
146
|
-
to current folder)
|
|
147
|
-
Structure of a JSON profile file:
|
|
148
|
-
{
|
|
149
|
-
"params": {
|
|
150
|
-
"include": [ ... ], /* optional */
|
|
151
|
-
...
|
|
152
|
-
},
|
|
153
|
-
"assets": [ /* list of custom assets */ ]
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
--help, -h Displays this message
|
|
157
|
-
`)
|
|
158
|
-
process.exit(0)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const parseArgv = require('../lib/utils/parse-argv')
|
|
162
|
-
const generate = require('../lib/cmd/generate')
|
|
163
|
-
const getProfileFiles = require('../lib/utils/get-profile-files')
|
|
164
|
-
const filterArgvParams = require('../lib/utils/filter-argv-params')
|
|
165
|
-
const { log } = require('../lib/utils/logger')
|
|
166
|
-
|
|
167
|
-
async function runProfiles (params, profileFiles) {
|
|
168
|
-
for (let i = 0; i < profileFiles.length; i++) {
|
|
169
|
-
const profile = profileFiles[i]
|
|
170
|
-
|
|
171
|
-
console.log(`\n`)
|
|
172
|
-
log(`---------------------`)
|
|
173
|
-
log(`Generating by profile: ${profile}`)
|
|
174
|
-
log(`---------------------`)
|
|
175
|
-
console.log(`\n`)
|
|
176
|
-
|
|
177
|
-
await generate({ ...params, profile })
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const params = filterArgvParams(argv)
|
|
182
|
-
|
|
183
|
-
if (params.profile) {
|
|
184
|
-
parseArgv(params, [ 'profile' ])
|
|
185
|
-
runProfiles(params, getProfileFiles(params.profile))
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
generate(params)
|
|
189
|
-
}
|
package/bin/icongenie-profile
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const parseArgs = require('minimist')
|
|
4
|
-
|
|
5
|
-
const argv = parseArgs(process.argv.slice(2), {
|
|
6
|
-
alias: {
|
|
7
|
-
o: 'output',
|
|
8
|
-
a: 'assets',
|
|
9
|
-
|
|
10
|
-
i: 'icon',
|
|
11
|
-
b: 'background',
|
|
12
|
-
f: 'filter',
|
|
13
|
-
q: 'quality',
|
|
14
|
-
h: 'help'
|
|
15
|
-
},
|
|
16
|
-
boolean: [ 'h', 'skip-trim' ],
|
|
17
|
-
string: [
|
|
18
|
-
'o', 'a',
|
|
19
|
-
'i', 'b', 'include', 'f', 'q',
|
|
20
|
-
'padding',
|
|
21
|
-
'theme-color',
|
|
22
|
-
'png-color',
|
|
23
|
-
'splashscreen-color',
|
|
24
|
-
'svg-color',
|
|
25
|
-
'splashscreen-icon-ratio'
|
|
26
|
-
]
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
if (argv.help) {
|
|
30
|
-
const modes = Object.keys(require('../lib/modes')).join('|')
|
|
31
|
-
const generators = Object.keys(require('../lib/generators')).join('|')
|
|
32
|
-
const defaultParams = require('../lib/utils/default-params')
|
|
33
|
-
|
|
34
|
-
console.log(`
|
|
35
|
-
Description
|
|
36
|
-
Helper command to easily bootstrap Icon Genie profile files.
|
|
37
|
-
|
|
38
|
-
Usage
|
|
39
|
-
$ icongenie profile -o <filename> [options]
|
|
40
|
-
|
|
41
|
-
# supplying params list
|
|
42
|
-
$ icongenie profile -o <filename> --include pwa,spa --quality 7
|
|
43
|
-
|
|
44
|
-
# supplying assets based on Icon Genie's internal list
|
|
45
|
-
$ icongenie profile -o <filename> --assets spa,bex
|
|
46
|
-
|
|
47
|
-
Options
|
|
48
|
-
--output, -o Name of the new Icon Genie profile file
|
|
49
|
-
|
|
50
|
-
--assets, -a Prefill the assets Array with Icon Genie's
|
|
51
|
-
internal list, based on the modes that you indicate;
|
|
52
|
-
[all|${modes}]
|
|
53
|
-
Multiple can be specified, separated by ",":
|
|
54
|
-
spa,cordova
|
|
55
|
-
|
|
56
|
-
--icon, -i Path to source file for icons; must be:
|
|
57
|
-
- a .png file
|
|
58
|
-
- min resolution: 64x64 px (the higher the better!!)
|
|
59
|
-
- with transparency
|
|
60
|
-
Best results are with a square image (height = width)
|
|
61
|
-
Image will be trimmed automatically
|
|
62
|
-
(also see "skip-trim" and "padding" param)
|
|
63
|
-
Path can be absolute, or relative to the root of the
|
|
64
|
-
Quasar project folder
|
|
65
|
-
Recommended min size: 1024x1024 px
|
|
66
|
-
|
|
67
|
-
--background, -b Path to optional background source file (for splashscreens);
|
|
68
|
-
must be:
|
|
69
|
-
- a .png file
|
|
70
|
-
- min resolution: 128x128 px (the higher the better!!)
|
|
71
|
-
- transparency is optional (but recommended if you
|
|
72
|
-
combine with the splashscreen-color param)
|
|
73
|
-
Path can be absolute, or relative to the root of the
|
|
74
|
-
Quasar project folder
|
|
75
|
-
Recommended min size: 1024x1024 px
|
|
76
|
-
|
|
77
|
-
--include Prefill the params.include property;
|
|
78
|
-
[all|${modes}]
|
|
79
|
-
Multiple can be specified, separated by ",":
|
|
80
|
-
spa,cordova
|
|
81
|
-
|
|
82
|
-
--filter, -f Prefill the params.filter property;
|
|
83
|
-
[${generators}]
|
|
84
|
-
|
|
85
|
-
--quality Prefill in the params.quality property;
|
|
86
|
-
Quality of the files [1 - 12] (default: ${defaultParams.quality})
|
|
87
|
-
- higher quality --> bigger filesize & slower to create
|
|
88
|
-
- lower quality --> smaller filesize & faster to create
|
|
89
|
-
|
|
90
|
-
--skip-trim Do not trim the icon source file
|
|
91
|
-
|
|
92
|
-
--padding Apply fixed padding to the icon after trimming it;
|
|
93
|
-
Syntax: <horiz: number>,<vert: number>
|
|
94
|
-
Default: 0,0
|
|
95
|
-
Example: "--padding 10,5" means apply 10px padding to top
|
|
96
|
-
10px to bottom, 5px to left side and 5px to rightside
|
|
97
|
-
|
|
98
|
-
--theme-color Prefill the params.themeColor property;
|
|
99
|
-
Theme color to use for all generators requiring a color;
|
|
100
|
-
It gets overridden if any generator color is also specified;
|
|
101
|
-
The color must be in hex format (NOT hexa) without the leading
|
|
102
|
-
'#' character. Transparency not allowed.
|
|
103
|
-
Examples: 1976D2, eee
|
|
104
|
-
|
|
105
|
-
--svg-color Prefill the params.svgColor property;
|
|
106
|
-
Color to use for the generated monochrome svgs
|
|
107
|
-
Default (if no theme-color is specified): ${defaultParams.svgColor.slice(1)}
|
|
108
|
-
The color must be in hex format (NOT hexa) without the leading
|
|
109
|
-
'#' character. Transparency not allowed.
|
|
110
|
-
Examples: 1976D2, eee
|
|
111
|
-
|
|
112
|
-
--png-color Prefill the params.pngColor property;
|
|
113
|
-
Background color to use for the png generator, when
|
|
114
|
-
"background: true" in the asset definition (like for
|
|
115
|
-
the Cordova/Capacitor iOS icons);
|
|
116
|
-
Default (if no theme-color is specified): ${defaultParams.pngColor.slice(1)}
|
|
117
|
-
The color must be in hex format (NOT hexa) without the leading
|
|
118
|
-
'#' character. Transparency not allowed.
|
|
119
|
-
Examples: 1976D2, eee
|
|
120
|
-
|
|
121
|
-
--splashscreen-color Prefill the params.splashscreenColor property;
|
|
122
|
-
Background color to use for the splashscreen generator;
|
|
123
|
-
Default (if no theme-color is specified): ${defaultParams.splashscreenColor.slice(1)}
|
|
124
|
-
The color must be in hex format (NOT hexa) without the leading
|
|
125
|
-
'#' character. Transparency not allowed.
|
|
126
|
-
Examples: 1976D2, eee
|
|
127
|
-
|
|
128
|
-
--splashscreen-icon-ratio Prefill the params.splashscreenIconRatio property;
|
|
129
|
-
Ratio of icon size in respect to the width or height
|
|
130
|
-
(whichever is smaller) of the resulting splashscreen;
|
|
131
|
-
Represents percentages; Valid values: 0 - 100
|
|
132
|
-
If 0 then it doesn't add the icon of top of background
|
|
133
|
-
Default: ${defaultParams.splashscreenIconRatio}
|
|
134
|
-
`)
|
|
135
|
-
process.exit(0)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const profile = require('../lib/cmd/profile')
|
|
139
|
-
const filterArgvParams = require('../lib/utils/filter-argv-params')
|
|
140
|
-
const parseArgv = require('../lib/utils/parse-argv')
|
|
141
|
-
|
|
142
|
-
parseArgv(argv, [
|
|
143
|
-
'output',
|
|
144
|
-
'assets',
|
|
145
|
-
'padding'
|
|
146
|
-
])
|
|
147
|
-
|
|
148
|
-
const params = filterArgvParams(argv)
|
|
149
|
-
|
|
150
|
-
profile(params)
|
package/bin/icongenie-verify
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const parseArgs = require('minimist')
|
|
4
|
-
|
|
5
|
-
const argv = parseArgs(process.argv.slice(2), {
|
|
6
|
-
alias: {
|
|
7
|
-
m: 'mode',
|
|
8
|
-
p: 'profile',
|
|
9
|
-
f: 'filter',
|
|
10
|
-
h: 'help'
|
|
11
|
-
},
|
|
12
|
-
boolean: ['h']
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
if (argv.help) {
|
|
16
|
-
const modes = Object.keys(require('../lib/modes')).join('|')
|
|
17
|
-
const generators = Object.keys(require('../lib/generators')).join('|')
|
|
18
|
-
|
|
19
|
-
console.log(`
|
|
20
|
-
Description
|
|
21
|
-
Verifies your Quasar App's icons and splashscreens
|
|
22
|
-
for all installed modes.
|
|
23
|
-
|
|
24
|
-
Usage
|
|
25
|
-
$ icongenie verify [options]
|
|
26
|
-
|
|
27
|
-
# verify all Quasar modes
|
|
28
|
-
$ icongenie verify
|
|
29
|
-
|
|
30
|
-
# verify specific mode
|
|
31
|
-
$ icongenie verify -m spa
|
|
32
|
-
|
|
33
|
-
# verify with specific filter
|
|
34
|
-
$ icongenie verify -f ico
|
|
35
|
-
|
|
36
|
-
# verify by using a profile file
|
|
37
|
-
$ icongenie verify -p ./icongenie-profile.json
|
|
38
|
-
|
|
39
|
-
# verify by using batch of profile files
|
|
40
|
-
$ icongenie verify -p ./folder-containing-profile-files
|
|
41
|
-
|
|
42
|
-
Options
|
|
43
|
-
--mode, -m For which Quasar mode(s) to verify the assets;
|
|
44
|
-
Default: all
|
|
45
|
-
[all|${modes}]
|
|
46
|
-
Multiple can be specified, separated by ",":
|
|
47
|
-
spa,cordova,capacitor
|
|
48
|
-
|
|
49
|
-
--filter, -f Filter the available generators; when used, it verifies
|
|
50
|
-
only one type of asset instead of all
|
|
51
|
-
[${generators}]
|
|
52
|
-
|
|
53
|
-
--profile Use JSON profile file(s) to extract the asset list to verify:
|
|
54
|
-
- path to folder (absolute or relative to current folder)
|
|
55
|
-
that contains JSON profile files (icongenie-*.json)
|
|
56
|
-
- path to a single *.json profile file (absolute or relative
|
|
57
|
-
to current folder)
|
|
58
|
-
Structure of a JSON profile file:
|
|
59
|
-
{
|
|
60
|
-
"params": {
|
|
61
|
-
"include": [ ... ], /* optional */
|
|
62
|
-
...
|
|
63
|
-
},
|
|
64
|
-
"assets": [ /* list of custom assets */ ]
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
--help, -h Displays this message
|
|
68
|
-
`)
|
|
69
|
-
process.exit(0)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const parseArgv = require('../lib/utils/parse-argv')
|
|
73
|
-
const verify = require('../lib/cmd/verify')
|
|
74
|
-
const getProfileFiles = require('../lib/utils/get-profile-files')
|
|
75
|
-
const filterArgvParams = require('../lib/utils/filter-argv-params')
|
|
76
|
-
const { log } = require('../lib/utils/logger')
|
|
77
|
-
|
|
78
|
-
async function runProfiles (params, profileFiles) {
|
|
79
|
-
for (let i = 0; i < profileFiles.length; i++) {
|
|
80
|
-
const profile = profileFiles[i]
|
|
81
|
-
|
|
82
|
-
console.log(`\n`)
|
|
83
|
-
log(`--------------------`)
|
|
84
|
-
log(`Verifying by profile: ${profile}`)
|
|
85
|
-
log(`--------------------`)
|
|
86
|
-
console.log(`\n`)
|
|
87
|
-
|
|
88
|
-
await verify({ ...params, profile })
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const params = filterArgvParams(argv)
|
|
93
|
-
|
|
94
|
-
if (params.profile) {
|
|
95
|
-
parseArgv(params, [ 'profile' ])
|
|
96
|
-
runProfiles(params, getProfileFiles(params.profile))
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
verify(params)
|
|
100
|
-
}
|