@quasar/icongenie 4.0.0 → 5.0.0
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/README.md +7 -1
- package/bin/icongenie.js +22 -22
- package/lib/cmd/generate.js +36 -41
- package/lib/cmd/help.js +1 -1
- package/lib/cmd/profile.js +34 -38
- package/lib/cmd/verify.js +18 -17
- package/lib/generators/icns.js +7 -3
- package/lib/generators/ico.js +7 -3
- package/lib/generators/index.js +0 -1
- package/lib/generators/png.js +7 -6
- package/lib/generators/splashscreen.js +6 -12
- package/lib/generators/svg.js +3 -4
- package/lib/modes/index.js +1 -8
- package/lib/modes/{quasar-app-v2 → v2}/bex.js +1 -2
- package/lib/modes/{quasar-app-v1 → v2}/capacitor.js +28 -35
- package/lib/modes/{quasar-app-v1 → v2}/cordova.js +40 -47
- package/lib/modes/v2/electron.js +32 -0
- package/lib/modes/{quasar-app-v1 → v2}/index.js +0 -1
- package/lib/modes/v2/pwa.js +71 -0
- package/lib/modes/{quasar-app-v2 → v2}/spa.js +1 -2
- package/lib/modes/{quasar-app-v1 → v2}/ssr.js +1 -2
- package/lib/mount/index.js +4 -7
- package/lib/mount/mount-cordova.js +71 -63
- package/lib/mount/mount-tag.js +3 -6
- package/lib/runner/generate.js +57 -55
- package/lib/runner/profile.js +18 -26
- package/lib/runner/verify.js +29 -27
- package/lib/utils/app-paths.js +8 -9
- package/lib/utils/default-params.js +0 -1
- package/lib/utils/filter-argv-params.js +3 -4
- package/lib/utils/get-argv.js +47 -0
- package/lib/utils/get-assets-files.js +9 -12
- package/lib/utils/get-compression.js +31 -19
- package/lib/utils/get-file-size.js +5 -6
- package/lib/utils/get-files-options.js +18 -21
- package/lib/utils/get-png-size.js +7 -11
- package/lib/utils/get-profile-content.js +3 -7
- package/lib/utils/get-profile-files.js +10 -13
- package/lib/utils/get-square-icon.js +5 -4
- package/lib/utils/logger.js +6 -7
- package/lib/utils/merge-objects.js +5 -6
- package/lib/utils/node-version-check.js +11 -11
- package/lib/utils/package-json.js +1 -5
- package/lib/utils/parse-argv.js +63 -74
- package/lib/utils/spawn-sync.js +10 -10
- package/lib/utils/validate-profile-object.js +34 -27
- package/package.json +46 -48
- package/samples/icongenie-profile.json +9 -17
- package/.editorconfig +0 -13
- package/.eslintignore +0 -1
- package/.eslintrc.cjs +0 -50
- package/lib/modes/quasar-app-v1/bex.js +0 -9
- package/lib/modes/quasar-app-v1/electron.js +0 -24
- package/lib/modes/quasar-app-v1/pwa.js +0 -74
- package/lib/modes/quasar-app-v1/spa.js +0 -17
- package/lib/modes/quasar-app-v2/capacitor.js +0 -155
- package/lib/modes/quasar-app-v2/cordova.js +0 -159
- package/lib/modes/quasar-app-v2/electron.js +0 -24
- package/lib/modes/quasar-app-v2/index.js +0 -45
- package/lib/modes/quasar-app-v2/pwa.js +0 -74
- package/lib/modes/quasar-app-v2/ssr.js +0 -4
package/README.md
CHANGED
|
@@ -22,12 +22,16 @@ This means you need your logo in about 100+ different sizes with representative
|
|
|
22
22
|
|
|
23
23
|
## Installation of Icon Genie
|
|
24
24
|
|
|
25
|
-
Node.js >=
|
|
25
|
+
Node.js >=22.22.0 is required.
|
|
26
26
|
|
|
27
27
|
```
|
|
28
28
|
$ yarn global add @quasar/icongenie
|
|
29
29
|
# or
|
|
30
30
|
$ npm install -g @quasar/icongenie
|
|
31
|
+
# or
|
|
32
|
+
$ pnpm add -g @quasar/icongenie
|
|
33
|
+
# or
|
|
34
|
+
$ bun add -g @quasar/icongenie
|
|
31
35
|
```
|
|
32
36
|
|
|
33
37
|
## Usage
|
|
@@ -35,6 +39,7 @@ $ npm install -g @quasar/icongenie
|
|
|
35
39
|
Please visit [https://quasar.dev/icongenie].
|
|
36
40
|
|
|
37
41
|
## Supporting Quasar
|
|
42
|
+
|
|
38
43
|
Quasar Framework is an MIT-licensed open source project. Its ongoing development is made possible thanks to the support by these awesome [backers](https://github.com/rstoenescu/quasar-framework/blob/dev/backers.md).
|
|
39
44
|
|
|
40
45
|
**Please read our manifest on [Why donations are important](https://quasar.dev/why-donate)**. If you'd like to become a donator, check out [Quasar Framework's Donator campaign](https://donate.quasar.dev).
|
|
@@ -60,6 +65,7 @@ Ask questions at the official community forum: [https://forum.quasar.dev](https:
|
|
|
60
65
|
I'm excited if you want to contribute to Quasar under any form (report bugs, write a plugin, fix an issue, write a new feature). Please read the [Contributing Guide](../CONTRIBUTING.md).
|
|
61
66
|
|
|
62
67
|
## Semver
|
|
68
|
+
|
|
63
69
|
Quasar is following [Semantic Versioning 2.0](https://semver.org/).
|
|
64
70
|
|
|
65
71
|
## License
|
package/bin/icongenie.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
if (
|
|
4
|
+
process.argv.includes('--no-color') ||
|
|
5
|
+
(await import('ci-info').then(({ isCI }) => isCI))
|
|
6
|
+
) {
|
|
7
|
+
process.env.FORCE_COLOR = '0'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
await import('../lib/utils/node-version-check.js')
|
|
4
11
|
|
|
5
|
-
|
|
6
|
-
|
|
12
|
+
const { default: updateNotifier } = await import('update-notifier')
|
|
13
|
+
const { packageJson } = await import('../lib/utils/package-json.js')
|
|
7
14
|
|
|
8
15
|
updateNotifier({ pkg: packageJson }).notify()
|
|
9
16
|
|
|
10
|
-
const commands = [
|
|
11
|
-
'generate',
|
|
12
|
-
'verify',
|
|
13
|
-
'profile',
|
|
14
|
-
'help'
|
|
15
|
-
]
|
|
17
|
+
const commands = ['generate', 'verify', 'profile', 'help']
|
|
16
18
|
|
|
17
|
-
let cmd = process.argv[
|
|
19
|
+
let cmd = process.argv[2]
|
|
18
20
|
|
|
19
21
|
if (cmd && cmd.length === 1) {
|
|
20
22
|
const mapToCmd = {
|
|
@@ -23,7 +25,7 @@ if (cmd && cmd.length === 1) {
|
|
|
23
25
|
p: 'profile',
|
|
24
26
|
h: 'help'
|
|
25
27
|
}
|
|
26
|
-
cmd = mapToCmd[
|
|
28
|
+
cmd = mapToCmd[cmd]
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
import { warn } from '../lib/utils/logger.js'
|
|
@@ -31,8 +33,7 @@ import { warn } from '../lib/utils/logger.js'
|
|
|
31
33
|
if (cmd) {
|
|
32
34
|
if (commands.includes(cmd)) {
|
|
33
35
|
process.argv.splice(2, 1)
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
+
} else {
|
|
36
37
|
if (cmd === '-v' || cmd === '--version') {
|
|
37
38
|
console.log(packageJson.version)
|
|
38
39
|
process.exit(0)
|
|
@@ -40,22 +41,21 @@ if (cmd) {
|
|
|
40
41
|
|
|
41
42
|
if (cmd === '-h' || cmd === '--help') {
|
|
42
43
|
cmd = 'help'
|
|
43
|
-
}
|
|
44
|
-
else if (cmd.indexOf('-') === 0) {
|
|
44
|
+
} else if (cmd.indexOf('-') === 0) {
|
|
45
45
|
warn()
|
|
46
46
|
warn(`Command must come before the options`)
|
|
47
47
|
cmd = 'help'
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
48
|
+
} else {
|
|
50
49
|
warn()
|
|
51
|
-
warn(`Unknown command specified: "${
|
|
50
|
+
warn(`Unknown command specified: "${cmd}"`)
|
|
52
51
|
cmd = 'help'
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
54
|
+
} else {
|
|
57
55
|
cmd = 'help'
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
const { showCliBanner } = await import('@quasar/art')
|
|
59
|
+
showCliBanner()
|
|
60
|
+
|
|
61
|
+
import(`../lib/cmd/${cmd}.js`)
|
package/lib/cmd/generate.js
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
]
|
|
1
|
+
import { getArgv } from '../utils/get-argv.js'
|
|
2
|
+
|
|
3
|
+
const argv = getArgv({
|
|
4
|
+
profile: { type: 'string', short: 'p' },
|
|
5
|
+
icon: { type: 'string', short: 'i' },
|
|
6
|
+
background: { type: 'string', short: 'b' },
|
|
7
|
+
mode: { type: 'string', short: 'm' },
|
|
8
|
+
filter: { type: 'string', short: 'f' },
|
|
9
|
+
quality: { type: 'string' },
|
|
10
|
+
padding: { type: 'string' },
|
|
11
|
+
'theme-color': { type: 'string' },
|
|
12
|
+
'png-color': { type: 'string' },
|
|
13
|
+
'splashscreen-color': { type: 'string' },
|
|
14
|
+
'splashscreen-icon-ratio': { type: 'string' },
|
|
15
|
+
'skip-trim': { type: 'boolean' },
|
|
16
|
+
'no-color': { type: 'boolean' },
|
|
17
|
+
help: { type: 'boolean', short: 'h' }
|
|
26
18
|
})
|
|
27
19
|
|
|
28
20
|
// if user hasn't explicitly specified this, then
|
|
29
21
|
// we shouldn't take it into account
|
|
30
|
-
if (
|
|
31
|
-
delete argv
|
|
22
|
+
if (!process.argv.includes('--skip-trim')) {
|
|
23
|
+
delete argv.skipTrim
|
|
32
24
|
}
|
|
33
25
|
|
|
34
26
|
import { green } from 'kolorist'
|
|
@@ -67,7 +59,7 @@ if (argv.help) {
|
|
|
67
59
|
$ icongenie generate -p ./folder-containing-profile-files
|
|
68
60
|
|
|
69
61
|
Options
|
|
70
|
-
--icon, -i ${
|
|
62
|
+
--icon, -i ${green('Required')};
|
|
71
63
|
Path to source file for icon; must be:
|
|
72
64
|
- a .png file
|
|
73
65
|
- min resolution: 64x64 px (the higher the better!!)
|
|
@@ -91,15 +83,15 @@ if (argv.help) {
|
|
|
91
83
|
|
|
92
84
|
--mode, -m For which Quasar mode(s) to generate the assets;
|
|
93
85
|
Default: all
|
|
94
|
-
[all|${
|
|
86
|
+
[all|${modesList}]
|
|
95
87
|
Multiple can be specified, separated by ",":
|
|
96
88
|
spa,cordova
|
|
97
89
|
|
|
98
90
|
--filter, -f Filter the available generators; when used, it can
|
|
99
91
|
generate only one type of asset instead of all
|
|
100
|
-
[${
|
|
92
|
+
[${generatorsList}]
|
|
101
93
|
|
|
102
|
-
--quality Quality of the files [1 - 12] (default: ${
|
|
94
|
+
--quality Quality of the files [1 - 12] (default: ${defaultParams.quality})
|
|
103
95
|
- higher quality --> bigger filesize & slower to create
|
|
104
96
|
- lower quality --> smaller filesize & faster to create
|
|
105
97
|
|
|
@@ -118,7 +110,7 @@ if (argv.help) {
|
|
|
118
110
|
Examples: 1976D2, eee
|
|
119
111
|
|
|
120
112
|
--svg-color Color to use for the generated monochrome svgs
|
|
121
|
-
Default (if no theme-color is specified): ${
|
|
113
|
+
Default (if no theme-color is specified): ${defaultParams.svgColor.slice(1)}
|
|
122
114
|
The color must be in hex format (NOT hexa) without the leading
|
|
123
115
|
'#' character. Transparency not allowed.
|
|
124
116
|
Examples: 1976D2, eee
|
|
@@ -126,13 +118,13 @@ if (argv.help) {
|
|
|
126
118
|
--png-color Background color to use for the png generator, when
|
|
127
119
|
"background: true" in the asset definition (like for
|
|
128
120
|
the cordova/capacitor iOS icons);
|
|
129
|
-
Default (if no theme-color is specified): ${
|
|
121
|
+
Default (if no theme-color is specified): ${defaultParams.pngColor.slice(1)}
|
|
130
122
|
The color must be in hex format (NOT hexa) without the leading
|
|
131
123
|
'#' character. Transparency not allowed.
|
|
132
124
|
Examples: 1976D2, eee
|
|
133
125
|
|
|
134
126
|
--splashscreen-color Background color to use for the splashscreen generator;
|
|
135
|
-
Default (if no theme-color is specified): ${
|
|
127
|
+
Default (if no theme-color is specified): ${defaultParams.splashscreenColor.slice(1)}
|
|
136
128
|
The color must be in hex format (NOT hexa) without the leading
|
|
137
129
|
'#' character. Transparency not allowed.
|
|
138
130
|
Examples: 1976D2, eee
|
|
@@ -141,7 +133,7 @@ if (argv.help) {
|
|
|
141
133
|
(whichever is smaller) of the resulting splashscreen;
|
|
142
134
|
Represents percentages; Valid values: 0 - 100
|
|
143
135
|
If 0 then it doesn't add the icon of top of background
|
|
144
|
-
Default: ${
|
|
136
|
+
Default: ${defaultParams.splashscreenIconRatio}
|
|
145
137
|
|
|
146
138
|
--profile, -p Use JSON profile file(s):
|
|
147
139
|
- path to folder (absolute or relative to current folder)
|
|
@@ -157,8 +149,11 @@ if (argv.help) {
|
|
|
157
149
|
"assets": [ /* list of custom assets */ ]
|
|
158
150
|
}
|
|
159
151
|
|
|
152
|
+
--no-color Disable colored output
|
|
160
153
|
--help, -h Displays this message
|
|
161
154
|
`)
|
|
155
|
+
|
|
156
|
+
argv.__warn?.()
|
|
162
157
|
process.exit(0)
|
|
163
158
|
}
|
|
164
159
|
|
|
@@ -168,13 +163,13 @@ import { getProfileFiles } from '../utils/get-profile-files.js'
|
|
|
168
163
|
import { filterArgvParams } from '../utils/filter-argv-params.js'
|
|
169
164
|
import { log } from '../utils/logger.js'
|
|
170
165
|
|
|
171
|
-
async function runProfiles
|
|
166
|
+
async function runProfiles(params, profileFiles) {
|
|
172
167
|
for (let i = 0; i < profileFiles.length; i++) {
|
|
173
|
-
const profile = profileFiles[
|
|
168
|
+
const profile = profileFiles[i]
|
|
174
169
|
|
|
175
170
|
console.log(`\n`)
|
|
176
171
|
log(`---------------------`)
|
|
177
|
-
log(`Generating by profile: ${
|
|
172
|
+
log(`Generating by profile: ${profile}`)
|
|
178
173
|
log(`---------------------`)
|
|
179
174
|
console.log(`\n`)
|
|
180
175
|
|
|
@@ -185,9 +180,9 @@ async function runProfiles (params, profileFiles) {
|
|
|
185
180
|
const params = filterArgvParams(argv)
|
|
186
181
|
|
|
187
182
|
if (params.profile) {
|
|
188
|
-
parseArgv(params, [
|
|
183
|
+
parseArgv(params, ['profile'])
|
|
184
|
+
// oxlint-disable-next-line unicorn/prefer-top-level-await
|
|
189
185
|
runProfiles(params, getProfileFiles(params.profile))
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
186
|
+
} else {
|
|
192
187
|
generate(params)
|
|
193
188
|
}
|
package/lib/cmd/help.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { packageJson } from '../utils/package-json.js'
|
|
3
2
|
|
|
4
3
|
console.log(' Running @quasar/icongenie v' + packageJson.version)
|
|
@@ -13,6 +12,7 @@ console.log(`
|
|
|
13
12
|
|
|
14
13
|
Options
|
|
15
14
|
--version, -v Print Quasar Icon Genie CLI version
|
|
15
|
+
--no-color Disable colored output
|
|
16
16
|
|
|
17
17
|
Commands
|
|
18
18
|
generate, g Generate App icons & splashscreens
|
package/lib/cmd/profile.js
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'theme-color',
|
|
21
|
-
'png-color',
|
|
22
|
-
'splashscreen-color',
|
|
23
|
-
'svg-color',
|
|
24
|
-
'splashscreen-icon-ratio'
|
|
25
|
-
]
|
|
1
|
+
import { getArgv } from '../utils/get-argv.js'
|
|
2
|
+
|
|
3
|
+
const argv = getArgv({
|
|
4
|
+
output: { type: 'string', short: 'o' },
|
|
5
|
+
assets: { type: 'string', short: 'a' },
|
|
6
|
+
icon: { type: 'string', short: 'i' },
|
|
7
|
+
background: { type: 'string', short: 'b' },
|
|
8
|
+
include: { type: 'string' },
|
|
9
|
+
filter: { type: 'string', short: 'f' },
|
|
10
|
+
quality: { type: 'string' },
|
|
11
|
+
padding: { type: 'string' },
|
|
12
|
+
'theme-color': { type: 'string' },
|
|
13
|
+
'png-color': { type: 'string' },
|
|
14
|
+
'splashscreen-color': { type: 'string' },
|
|
15
|
+
'splashscreen-icon-ratio': { type: 'string' },
|
|
16
|
+
'skip-trim': { type: 'boolean' },
|
|
17
|
+
|
|
18
|
+
'no-color': { type: 'boolean' },
|
|
19
|
+
help: { type: 'boolean', short: 'h' }
|
|
26
20
|
})
|
|
27
21
|
|
|
28
22
|
if (argv.help) {
|
|
@@ -52,7 +46,7 @@ if (argv.help) {
|
|
|
52
46
|
|
|
53
47
|
--assets, -a Prefill the assets Array with Icon Genie's
|
|
54
48
|
internal list, based on the modes that you indicate;
|
|
55
|
-
[all|${
|
|
49
|
+
[all|${modesList}]
|
|
56
50
|
Multiple can be specified, separated by ",":
|
|
57
51
|
spa,cordova
|
|
58
52
|
|
|
@@ -78,15 +72,15 @@ if (argv.help) {
|
|
|
78
72
|
Recommended min size: 1024x1024 px
|
|
79
73
|
|
|
80
74
|
--include Prefill the params.include property;
|
|
81
|
-
[all|${
|
|
75
|
+
[all|${modesList}]
|
|
82
76
|
Multiple can be specified, separated by ",":
|
|
83
77
|
spa,cordova
|
|
84
78
|
|
|
85
79
|
--filter, -f Prefill the params.filter property;
|
|
86
|
-
[${
|
|
80
|
+
[${generatorsList}]
|
|
87
81
|
|
|
88
82
|
--quality Prefill in the params.quality property;
|
|
89
|
-
Quality of the files [1 - 12] (default: ${
|
|
83
|
+
Quality of the files [1 - 12] (default: ${defaultParams.quality})
|
|
90
84
|
- higher quality --> bigger filesize & slower to create
|
|
91
85
|
- lower quality --> smaller filesize & faster to create
|
|
92
86
|
|
|
@@ -107,7 +101,7 @@ if (argv.help) {
|
|
|
107
101
|
|
|
108
102
|
--svg-color Prefill the params.svgColor property;
|
|
109
103
|
Color to use for the generated monochrome svgs
|
|
110
|
-
Default (if no theme-color is specified): ${
|
|
104
|
+
Default (if no theme-color is specified): ${defaultParams.svgColor.slice(1)}
|
|
111
105
|
The color must be in hex format (NOT hexa) without the leading
|
|
112
106
|
'#' character. Transparency not allowed.
|
|
113
107
|
Examples: 1976D2, eee
|
|
@@ -116,14 +110,14 @@ if (argv.help) {
|
|
|
116
110
|
Background color to use for the png generator, when
|
|
117
111
|
"background: true" in the asset definition (like for
|
|
118
112
|
the Cordova/Capacitor iOS icons);
|
|
119
|
-
Default (if no theme-color is specified): ${
|
|
113
|
+
Default (if no theme-color is specified): ${defaultParams.pngColor.slice(1)}
|
|
120
114
|
The color must be in hex format (NOT hexa) without the leading
|
|
121
115
|
'#' character. Transparency not allowed.
|
|
122
116
|
Examples: 1976D2, eee
|
|
123
117
|
|
|
124
118
|
--splashscreen-color Prefill the params.splashscreenColor property;
|
|
125
119
|
Background color to use for the splashscreen generator;
|
|
126
|
-
Default (if no theme-color is specified): ${
|
|
120
|
+
Default (if no theme-color is specified): ${defaultParams.splashscreenColor.slice(1)}
|
|
127
121
|
The color must be in hex format (NOT hexa) without the leading
|
|
128
122
|
'#' character. Transparency not allowed.
|
|
129
123
|
Examples: 1976D2, eee
|
|
@@ -133,8 +127,14 @@ if (argv.help) {
|
|
|
133
127
|
(whichever is smaller) of the resulting splashscreen;
|
|
134
128
|
Represents percentages; Valid values: 0 - 100
|
|
135
129
|
If 0 then it doesn't add the icon of top of background
|
|
136
|
-
Default: ${
|
|
130
|
+
Default: ${defaultParams.splashscreenIconRatio}
|
|
131
|
+
|
|
132
|
+
--no-color Disable colored output
|
|
133
|
+
--help, -h Displays this message
|
|
134
|
+
|
|
137
135
|
`)
|
|
136
|
+
|
|
137
|
+
argv.__warn?.()
|
|
138
138
|
process.exit(0)
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -142,11 +142,7 @@ import { profile } from '../runner/profile.js'
|
|
|
142
142
|
import { filterArgvParams } from '../utils/filter-argv-params.js'
|
|
143
143
|
import { parseArgv } from '../utils/parse-argv.js'
|
|
144
144
|
|
|
145
|
-
parseArgv(argv, [
|
|
146
|
-
'output',
|
|
147
|
-
'assets',
|
|
148
|
-
'padding'
|
|
149
|
-
])
|
|
145
|
+
parseArgv(argv, ['output', 'assets', 'padding'])
|
|
150
146
|
|
|
151
147
|
const params = filterArgvParams(argv)
|
|
152
148
|
|
package/lib/cmd/verify.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import { getArgv } from '../utils/get-argv.js'
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
const argv = getArgv({
|
|
4
|
+
mode: { type: 'string', short: 'm' },
|
|
5
|
+
profile: { type: 'string', short: 'p' },
|
|
6
|
+
filter: { type: 'string', short: 'f' },
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
m: 'mode',
|
|
7
|
-
p: 'profile',
|
|
8
|
-
f: 'filter',
|
|
9
|
-
h: 'help'
|
|
10
|
-
},
|
|
11
|
-
boolean: [ 'h' ]
|
|
8
|
+
'no-color': { type: 'boolean' },
|
|
9
|
+
help: { type: 'boolean', short: 'h' }
|
|
12
10
|
})
|
|
13
11
|
|
|
14
12
|
if (argv.help) {
|
|
@@ -44,13 +42,13 @@ if (argv.help) {
|
|
|
44
42
|
Options
|
|
45
43
|
--mode, -m For which Quasar mode(s) to verify the assets;
|
|
46
44
|
Default: all
|
|
47
|
-
[all|${
|
|
45
|
+
[all|${modesList}]
|
|
48
46
|
Multiple can be specified, separated by ",":
|
|
49
47
|
spa,cordova,capacitor
|
|
50
48
|
|
|
51
49
|
--filter, -f Filter the available generators; when used, it verifies
|
|
52
50
|
only one type of asset instead of all
|
|
53
|
-
[${
|
|
51
|
+
[${generatorsList}]
|
|
54
52
|
|
|
55
53
|
--profile Use JSON profile file(s) to extract the asset list to verify:
|
|
56
54
|
- path to folder (absolute or relative to current folder)
|
|
@@ -66,8 +64,11 @@ if (argv.help) {
|
|
|
66
64
|
"assets": [ /* list of custom assets */ ]
|
|
67
65
|
}
|
|
68
66
|
|
|
67
|
+
--no-color Disable colored output
|
|
69
68
|
--help, -h Displays this message
|
|
70
69
|
`)
|
|
70
|
+
|
|
71
|
+
argv.__warn?.()
|
|
71
72
|
process.exit(0)
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -77,13 +78,13 @@ import { getProfileFiles } from '../utils/get-profile-files.js'
|
|
|
77
78
|
import { filterArgvParams } from '../utils/filter-argv-params.js'
|
|
78
79
|
import { log } from '../utils/logger.js'
|
|
79
80
|
|
|
80
|
-
async function runProfiles
|
|
81
|
+
async function runProfiles(params, profileFiles) {
|
|
81
82
|
for (let i = 0; i < profileFiles.length; i++) {
|
|
82
|
-
const profile = profileFiles[
|
|
83
|
+
const profile = profileFiles[i]
|
|
83
84
|
|
|
84
85
|
console.log(`\n`)
|
|
85
86
|
log(`--------------------`)
|
|
86
|
-
log(`Verifying by profile: ${
|
|
87
|
+
log(`Verifying by profile: ${profile}`)
|
|
87
88
|
log(`--------------------`)
|
|
88
89
|
console.log(`\n`)
|
|
89
90
|
|
|
@@ -94,9 +95,9 @@ async function runProfiles (params, profileFiles) {
|
|
|
94
95
|
const params = filterArgvParams(argv)
|
|
95
96
|
|
|
96
97
|
if (params.profile) {
|
|
97
|
-
parseArgv(params, [
|
|
98
|
+
parseArgv(params, ['profile'])
|
|
99
|
+
// oxlint-disable-next-line unicorn/prefer-top-level-await
|
|
98
100
|
runProfiles(params, getProfileFiles(params.profile))
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
+
} else {
|
|
101
102
|
verify(params)
|
|
102
103
|
}
|
package/lib/generators/icns.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|
import { writeFile } from 'node:fs'
|
|
3
2
|
import png2icons from 'png2icons'
|
|
4
3
|
|
|
5
4
|
import { getSquareIcon } from '../utils/get-square-icon.js'
|
|
6
5
|
|
|
7
|
-
export default async function (file, opts, done) {
|
|
6
|
+
export default async function icns(file, opts, done) {
|
|
8
7
|
const img = getSquareIcon({
|
|
9
8
|
file,
|
|
10
9
|
icon: opts.icon,
|
|
@@ -13,7 +12,12 @@ export default async function (file, opts, done) {
|
|
|
13
12
|
})
|
|
14
13
|
|
|
15
14
|
const buffer = await img.toBuffer()
|
|
16
|
-
const output = await png2icons.createICNS(
|
|
15
|
+
const output = await png2icons.createICNS(
|
|
16
|
+
buffer,
|
|
17
|
+
opts.compression.ico,
|
|
18
|
+
0,
|
|
19
|
+
true
|
|
20
|
+
)
|
|
17
21
|
|
|
18
22
|
writeFile(file.absoluteName, output, done)
|
|
19
23
|
}
|
package/lib/generators/ico.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|
import { writeFile } from 'node:fs'
|
|
3
2
|
import png2icons from 'png2icons'
|
|
4
3
|
|
|
5
4
|
import { getSquareIcon } from '../utils/get-square-icon.js'
|
|
6
5
|
|
|
7
|
-
export default async function (file, opts, done) {
|
|
6
|
+
export default async function ico(file, opts, done) {
|
|
8
7
|
const img = getSquareIcon({
|
|
9
8
|
file,
|
|
10
9
|
icon: opts.icon,
|
|
@@ -13,7 +12,12 @@ export default async function (file, opts, done) {
|
|
|
13
12
|
})
|
|
14
13
|
|
|
15
14
|
const buffer = await img.toBuffer()
|
|
16
|
-
const output = await png2icons.createICO(
|
|
15
|
+
const output = await png2icons.createICO(
|
|
16
|
+
buffer,
|
|
17
|
+
opts.compression.ico,
|
|
18
|
+
0,
|
|
19
|
+
true
|
|
20
|
+
)
|
|
17
21
|
|
|
18
22
|
writeFile(file.absoluteName, output, done)
|
|
19
23
|
}
|
package/lib/generators/index.js
CHANGED
package/lib/generators/png.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
1
|
import { getSquareIcon } from '../utils/get-square-icon.js'
|
|
3
2
|
|
|
4
|
-
export default function (file, opts, done) {
|
|
3
|
+
export default function png(file, opts, done) {
|
|
5
4
|
const img = getSquareIcon({
|
|
6
5
|
file,
|
|
7
6
|
icon: opts.icon,
|
|
8
7
|
size: file.height,
|
|
9
8
|
padding: opts.padding,
|
|
10
|
-
background:
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
background:
|
|
10
|
+
file.background === true
|
|
11
|
+
? opts.pngColor
|
|
12
|
+
: { r: 255, g: 255, b: 255, alpha: 0 }
|
|
13
13
|
})
|
|
14
14
|
|
|
15
15
|
if (file.background === true) {
|
|
@@ -18,7 +18,8 @@ export default function (file, opts, done) {
|
|
|
18
18
|
})
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
img
|
|
21
|
+
img
|
|
22
|
+
.png()
|
|
22
23
|
.toFile(file.absoluteName)
|
|
23
24
|
.then(() => opts.compression.png(file.absoluteName))
|
|
24
25
|
.then(done)
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
|
|
2
1
|
import { getSquareIcon } from '../utils/get-square-icon.js'
|
|
3
2
|
|
|
4
|
-
export default async function (file, opts, done) {
|
|
3
|
+
export default async function splashscreen(file, opts, done) {
|
|
5
4
|
const size = Math.min(file.width, file.height)
|
|
6
5
|
|
|
7
|
-
const img = opts.background
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
.flatten({
|
|
11
|
-
background: opts.splashscreenColor
|
|
12
|
-
})
|
|
6
|
+
const img = opts.background.clone().resize(file.width, file.height).flatten({
|
|
7
|
+
background: opts.splashscreenColor
|
|
8
|
+
})
|
|
13
9
|
|
|
14
10
|
if (opts.splashscreenIconRatio > 0) {
|
|
15
11
|
const icon = getSquareIcon({
|
|
16
12
|
file,
|
|
17
13
|
icon: opts.icon,
|
|
18
|
-
size: Math.round(size * opts.splashscreenIconRatio / 100),
|
|
14
|
+
size: Math.round((size * opts.splashscreenIconRatio) / 100),
|
|
19
15
|
padding: opts.padding
|
|
20
16
|
})
|
|
21
17
|
|
|
22
18
|
const buffer = await icon.toBuffer()
|
|
23
19
|
|
|
24
|
-
img.composite([
|
|
25
|
-
{ input: buffer }
|
|
26
|
-
])
|
|
20
|
+
img.composite([{ input: buffer }])
|
|
27
21
|
}
|
|
28
22
|
|
|
29
23
|
img
|
package/lib/generators/svg.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
1
|
import { optimize } from 'svgo'
|
|
3
2
|
import { writeFile } from 'node:fs'
|
|
4
3
|
import { posterize } from 'potrace'
|
|
5
4
|
|
|
6
5
|
import { getSquareIcon } from '../utils/get-square-icon.js'
|
|
7
6
|
|
|
8
|
-
export default async function (file, opts, done) {
|
|
7
|
+
export default async function svg(file, opts, done) {
|
|
9
8
|
const img = getSquareIcon({
|
|
10
9
|
file,
|
|
11
10
|
icon: opts.icon,
|
|
@@ -21,8 +20,8 @@ export default async function (file, opts, done) {
|
|
|
21
20
|
|
|
22
21
|
const buffer = await img.toBuffer()
|
|
23
22
|
|
|
24
|
-
posterize(buffer, params, (_,
|
|
25
|
-
const res = optimize(
|
|
23
|
+
posterize(buffer, params, (_, svgToOptimize) => {
|
|
24
|
+
const res = optimize(svgToOptimize)
|
|
26
25
|
writeFile(file.absoluteName, res.data, done)
|
|
27
26
|
})
|
|
28
27
|
}
|
package/lib/modes/index.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { existsSync } from 'node:fs'
|
|
3
|
-
import { resolveDir } from '../utils/app-paths.js'
|
|
4
|
-
|
|
5
|
-
const { modes } = existsSync(resolveDir('public'))
|
|
6
|
-
? await import('./quasar-app-v2/index.js')
|
|
7
|
-
: await import('./quasar-app-v1/index.js')
|
|
8
|
-
|
|
1
|
+
const { modes } = await import('./v2/index.js')
|
|
9
2
|
export { modes }
|