@quasar/icongenie 2.5.4 → 3.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.
Files changed (55) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.cjs +50 -0
  3. package/bin/{icongenie → icongenie.js} +11 -11
  4. package/lib/cmd/generate.js +26 -21
  5. package/lib/cmd/help.js +3 -1
  6. package/lib/cmd/profile.js +19 -15
  7. package/lib/cmd/verify.js +16 -13
  8. package/lib/generators/icns.js +5 -4
  9. package/lib/generators/ico.js +5 -4
  10. package/lib/generators/index.js +13 -6
  11. package/lib/generators/png.js +3 -2
  12. package/lib/generators/splashscreen.js +3 -2
  13. package/lib/generators/svg.js +6 -5
  14. package/lib/modes/index.js +8 -5
  15. package/lib/modes/quasar-app-v1/bex.js +2 -1
  16. package/lib/modes/quasar-app-v1/capacitor.js +11 -10
  17. package/lib/modes/quasar-app-v1/cordova.js +14 -13
  18. package/lib/modes/quasar-app-v1/electron.js +2 -1
  19. package/lib/modes/quasar-app-v1/index.js +16 -8
  20. package/lib/modes/quasar-app-v1/pwa.js +6 -5
  21. package/lib/modes/quasar-app-v1/spa.js +2 -1
  22. package/lib/modes/quasar-app-v1/ssr.js +3 -2
  23. package/lib/modes/quasar-app-v2/bex.js +2 -1
  24. package/lib/modes/quasar-app-v2/capacitor.js +11 -10
  25. package/lib/modes/quasar-app-v2/cordova.js +14 -13
  26. package/lib/modes/quasar-app-v2/electron.js +2 -1
  27. package/lib/modes/quasar-app-v2/index.js +16 -8
  28. package/lib/modes/quasar-app-v2/pwa.js +6 -5
  29. package/lib/modes/quasar-app-v2/spa.js +2 -1
  30. package/lib/modes/quasar-app-v2/ssr.js +3 -2
  31. package/lib/mount/index.js +5 -4
  32. package/lib/mount/mount-cordova.js +31 -30
  33. package/lib/mount/mount-tag.js +3 -2
  34. package/lib/runner/generate.js +37 -36
  35. package/lib/runner/profile.js +12 -11
  36. package/lib/runner/verify.js +23 -22
  37. package/lib/utils/app-paths.js +18 -18
  38. package/lib/utils/default-params.js +2 -1
  39. package/lib/utils/filter-argv-params.js +4 -3
  40. package/lib/utils/get-assets-files.js +6 -5
  41. package/lib/utils/get-compression.js +6 -6
  42. package/lib/utils/get-file-size.js +5 -4
  43. package/lib/utils/get-files-options.js +7 -6
  44. package/lib/utils/get-png-size.js +8 -7
  45. package/lib/utils/get-profile-content.js +9 -5
  46. package/lib/utils/get-profile-files.js +10 -9
  47. package/lib/utils/get-square-icon.js +5 -4
  48. package/lib/utils/logger.js +8 -7
  49. package/lib/utils/merge-objects.js +5 -4
  50. package/lib/utils/node-version-check.js +6 -6
  51. package/lib/utils/package-json.js +6 -0
  52. package/lib/utils/parse-argv.js +43 -45
  53. package/lib/utils/spawn-sync.js +6 -5
  54. package/lib/utils/validate-profile-object.js +12 -8
  55. package/package.json +24 -14
package/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ samples/
package/.eslintrc.cjs ADDED
@@ -0,0 +1,50 @@
1
+
2
+ module.exports = {
3
+ root: true,
4
+
5
+ parserOptions: {
6
+ ecmaVersion: 2022,
7
+ sourceType: 'module'
8
+ },
9
+
10
+ env: {
11
+ node: true,
12
+ },
13
+
14
+ extends: [
15
+ 'eslint:recommended',
16
+ 'plugin:n/recommended'
17
+ ],
18
+
19
+ rules: {
20
+ 'no-empty': 'off',
21
+ 'no-useless-escape': 'off',
22
+ 'no-unused-vars': [ 'error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' } ],
23
+
24
+ 'n/no-process-exit': 'off',
25
+
26
+ 'brace-style': [ 2, 'stroustrup', { allowSingleLine: true } ],
27
+ 'prefer-const': 2,
28
+ 'prefer-promise-reject-errors': 'off',
29
+ 'multiline-ternary': 'off',
30
+ 'no-prototype-builtins': 'off',
31
+ 'no-case-declarations': 'off',
32
+ 'generator-star-spacing': 'off',
33
+ 'arrow-parens': 'off',
34
+ 'object-property-newline': 'off',
35
+ 'one-var': 'off',
36
+ 'no-void': 'off',
37
+ 'no-lone-blocks': 'error',
38
+ 'no-unused-expressions': [ 'error', { allowShortCircuit: true } ],
39
+ 'no-useless-concat': 'error',
40
+ 'no-useless-return': 'error',
41
+ 'no-unneeded-ternary': 'error',
42
+ 'no-confusing-arrow': [ 'error', { allowParens: true } ],
43
+ 'operator-linebreak': [ 'error', 'before' ],
44
+
45
+ 'array-bracket-spacing': [ 'error', 'always' ],
46
+ 'object-curly-spacing': [ 'error', 'always' ],
47
+ 'computed-property-spacing': [ 'error', 'always' ],
48
+ 'template-curly-spacing': [ 'error', 'always' ]
49
+ }
50
+ }
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('../lib/utils/node-version-check')
3
+ import '../lib/utils/node-version-check.js'
4
4
 
5
- const updateNotifier = require('update-notifier')
6
- const pkg = require('../package.json')
5
+ import updateNotifier from 'update-notifier'
6
+ import { packageJson } from '../lib/utils/package-json.js'
7
7
 
8
- updateNotifier({ pkg }).notify()
8
+ updateNotifier({ pkg: packageJson }).notify()
9
9
 
10
10
  const commands = [
11
11
  'generate',
@@ -14,7 +14,7 @@ const commands = [
14
14
  'help'
15
15
  ]
16
16
 
17
- let cmd = process.argv[2]
17
+ let cmd = process.argv[ 2 ]
18
18
 
19
19
  if (cmd && cmd.length === 1) {
20
20
  const mapToCmd = {
@@ -23,21 +23,21 @@ if (cmd && cmd.length === 1) {
23
23
  p: 'profile',
24
24
  h: 'help'
25
25
  }
26
- cmd = mapToCmd[cmd]
26
+ cmd = mapToCmd[ cmd ]
27
27
  }
28
28
 
29
+ import { warn } from '../lib/utils/logger.js'
30
+
29
31
  if (cmd) {
30
32
  if (commands.includes(cmd)) {
31
33
  process.argv.splice(2, 1)
32
34
  }
33
35
  else {
34
36
  if (cmd === '-v' || cmd === '--version') {
35
- console.log(require('../package.json').version)
37
+ console.log(packageJson.version)
36
38
  process.exit(0)
37
39
  }
38
40
 
39
- const { warn } = require('../lib/utils/logger')
40
-
41
41
  if (cmd === '-h' || cmd === '--help') {
42
42
  cmd = 'help'
43
43
  }
@@ -48,7 +48,7 @@ if (cmd) {
48
48
  }
49
49
  else {
50
50
  warn()
51
- warn(`Unknown command specified: "${cmd}"`)
51
+ warn(`Unknown command specified: "${ cmd }"`)
52
52
  cmd = 'help'
53
53
  }
54
54
  }
@@ -58,4 +58,4 @@ else {
58
58
  }
59
59
 
60
60
  console.log()
61
- require(`../lib/cmd/${cmd}`)
61
+ import(`../lib/cmd/${ cmd }.js`)
@@ -1,5 +1,6 @@
1
1
 
2
- const parseArgs = require('minimist')
2
+ import parseArgs from 'minimist'
3
+
3
4
  const processArgv = process.argv.slice(2)
4
5
 
5
6
  const argv = parseArgs(processArgv, {
@@ -27,15 +28,19 @@ const argv = parseArgs(processArgv, {
27
28
  // if user hasn't explicitly specified this, then
28
29
  // we shouldn't take it into account
29
30
  if (processArgv.includes('--skip-trim') === false) {
30
- delete argv['skip-trim']
31
+ delete argv[ 'skip-trim' ]
31
32
  }
32
33
 
33
- const { green } = require('kolorist')
34
+ import { green } from 'kolorist'
34
35
 
35
36
  if (argv.help) {
36
- const modes = Object.keys(require('../modes')).join('|')
37
- const generators = Object.keys(require('../generators')).join('|')
38
- const defaultParams = require('../utils/default-params')
37
+ const { defaultParams } = await import('../utils/default-params.js')
38
+
39
+ const { modes } = await import('../modes/index.js')
40
+ const modesList = Object.keys(modes).join('|')
41
+
42
+ const { generators } = await import('../generators/index.js')
43
+ const generatorsList = Object.keys(generators).join('|')
39
44
 
40
45
  console.log(`
41
46
  Description
@@ -62,7 +67,7 @@ if (argv.help) {
62
67
  $ icongenie generate -p ./folder-containing-profile-files
63
68
 
64
69
  Options
65
- --icon, -i ${green('Required')};
70
+ --icon, -i ${ green('Required') };
66
71
  Path to source file for icon; must be:
67
72
  - a .png file
68
73
  - min resolution: 64x64 px (the higher the better!!)
@@ -86,15 +91,15 @@ if (argv.help) {
86
91
 
87
92
  --mode, -m For which Quasar mode(s) to generate the assets;
88
93
  Default: all
89
- [all|${modes}]
94
+ [all|${ modesList }]
90
95
  Multiple can be specified, separated by ",":
91
96
  spa,cordova
92
97
 
93
98
  --filter, -f Filter the available generators; when used, it can
94
99
  generate only one type of asset instead of all
95
- [${generators}]
100
+ [${ generatorsList }]
96
101
 
97
- --quality Quality of the files [1 - 12] (default: ${defaultParams.quality})
102
+ --quality Quality of the files [1 - 12] (default: ${ defaultParams.quality })
98
103
  - higher quality --> bigger filesize & slower to create
99
104
  - lower quality --> smaller filesize & faster to create
100
105
 
@@ -113,7 +118,7 @@ if (argv.help) {
113
118
  Examples: 1976D2, eee
114
119
 
115
120
  --svg-color Color to use for the generated monochrome svgs
116
- Default (if no theme-color is specified): ${defaultParams.svgColor.slice(1)}
121
+ Default (if no theme-color is specified): ${ defaultParams.svgColor.slice(1) }
117
122
  The color must be in hex format (NOT hexa) without the leading
118
123
  '#' character. Transparency not allowed.
119
124
  Examples: 1976D2, eee
@@ -121,13 +126,13 @@ if (argv.help) {
121
126
  --png-color Background color to use for the png generator, when
122
127
  "background: true" in the asset definition (like for
123
128
  the cordova/capacitor iOS icons);
124
- Default (if no theme-color is specified): ${defaultParams.pngColor.slice(1)}
129
+ Default (if no theme-color is specified): ${ defaultParams.pngColor.slice(1) }
125
130
  The color must be in hex format (NOT hexa) without the leading
126
131
  '#' character. Transparency not allowed.
127
132
  Examples: 1976D2, eee
128
133
 
129
134
  --splashscreen-color Background color to use for the splashscreen generator;
130
- Default (if no theme-color is specified): ${defaultParams.splashscreenColor.slice(1)}
135
+ Default (if no theme-color is specified): ${ defaultParams.splashscreenColor.slice(1) }
131
136
  The color must be in hex format (NOT hexa) without the leading
132
137
  '#' character. Transparency not allowed.
133
138
  Examples: 1976D2, eee
@@ -136,7 +141,7 @@ if (argv.help) {
136
141
  (whichever is smaller) of the resulting splashscreen;
137
142
  Represents percentages; Valid values: 0 - 100
138
143
  If 0 then it doesn't add the icon of top of background
139
- Default: ${defaultParams.splashscreenIconRatio}
144
+ Default: ${ defaultParams.splashscreenIconRatio }
140
145
 
141
146
  --profile, -p Use JSON profile file(s):
142
147
  - path to folder (absolute or relative to current folder)
@@ -157,19 +162,19 @@ if (argv.help) {
157
162
  process.exit(0)
158
163
  }
159
164
 
160
- const parseArgv = require('../utils/parse-argv')
161
- const generate = require('../runner/generate')
162
- const getProfileFiles = require('../utils/get-profile-files')
163
- const filterArgvParams = require('../utils/filter-argv-params')
164
- const { log } = require('../utils/logger')
165
+ import { generate } from '../runner/generate.js'
166
+ import { parseArgv } from '../utils/parse-argv.js'
167
+ import { getProfileFiles } from '../utils/get-profile-files.js'
168
+ import { filterArgvParams } from '../utils/filter-argv-params.js'
169
+ import { log } from '../utils/logger.js'
165
170
 
166
171
  async function runProfiles (params, profileFiles) {
167
172
  for (let i = 0; i < profileFiles.length; i++) {
168
- const profile = profileFiles[i]
173
+ const profile = profileFiles[ i ]
169
174
 
170
175
  console.log(`\n`)
171
176
  log(`---------------------`)
172
- log(`Generating by profile: ${profile}`)
177
+ log(`Generating by profile: ${ profile }`)
173
178
  log(`---------------------`)
174
179
  console.log(`\n`)
175
180
 
package/lib/cmd/help.js CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
- console.log(' Running @quasar/icongenie v' + require('../../package.json').version)
2
+ import { packageJson } from '../utils/package-json.js'
3
+
4
+ console.log(' Running @quasar/icongenie v' + packageJson.version)
3
5
 
4
6
  console.log(`
5
7
  Example usage
@@ -1,5 +1,5 @@
1
1
 
2
- const parseArgs = require('minimist')
2
+ import parseArgs from 'minimist'
3
3
 
4
4
  const argv = parseArgs(process.argv.slice(2), {
5
5
  alias: {
@@ -26,9 +26,13 @@ const argv = parseArgs(process.argv.slice(2), {
26
26
  })
27
27
 
28
28
  if (argv.help) {
29
- const modes = Object.keys(require('../modes')).join('|')
30
- const generators = Object.keys(require('../generators')).join('|')
31
- const defaultParams = require('../utils/default-params')
29
+ const { defaultParams } = await import('../utils/default-params.js')
30
+
31
+ const { modes } = await import('../modes/index.js')
32
+ const modesList = Object.keys(modes).join('|')
33
+
34
+ const { generators } = await import('../generators/index.js')
35
+ const generatorsList = Object.keys(generators).join('|')
32
36
 
33
37
  console.log(`
34
38
  Description
@@ -48,7 +52,7 @@ if (argv.help) {
48
52
 
49
53
  --assets, -a Prefill the assets Array with Icon Genie's
50
54
  internal list, based on the modes that you indicate;
51
- [all|${modes}]
55
+ [all|${ modesList }]
52
56
  Multiple can be specified, separated by ",":
53
57
  spa,cordova
54
58
 
@@ -74,15 +78,15 @@ if (argv.help) {
74
78
  Recommended min size: 1024x1024 px
75
79
 
76
80
  --include Prefill the params.include property;
77
- [all|${modes}]
81
+ [all|${ modesList }]
78
82
  Multiple can be specified, separated by ",":
79
83
  spa,cordova
80
84
 
81
85
  --filter, -f Prefill the params.filter property;
82
- [${generators}]
86
+ [${ generatorsList }]
83
87
 
84
88
  --quality Prefill in the params.quality property;
85
- Quality of the files [1 - 12] (default: ${defaultParams.quality})
89
+ Quality of the files [1 - 12] (default: ${ defaultParams.quality })
86
90
  - higher quality --> bigger filesize & slower to create
87
91
  - lower quality --> smaller filesize & faster to create
88
92
 
@@ -103,7 +107,7 @@ if (argv.help) {
103
107
 
104
108
  --svg-color Prefill the params.svgColor property;
105
109
  Color to use for the generated monochrome svgs
106
- Default (if no theme-color is specified): ${defaultParams.svgColor.slice(1)}
110
+ Default (if no theme-color is specified): ${ defaultParams.svgColor.slice(1) }
107
111
  The color must be in hex format (NOT hexa) without the leading
108
112
  '#' character. Transparency not allowed.
109
113
  Examples: 1976D2, eee
@@ -112,14 +116,14 @@ if (argv.help) {
112
116
  Background color to use for the png generator, when
113
117
  "background: true" in the asset definition (like for
114
118
  the Cordova/Capacitor iOS icons);
115
- Default (if no theme-color is specified): ${defaultParams.pngColor.slice(1)}
119
+ Default (if no theme-color is specified): ${ defaultParams.pngColor.slice(1) }
116
120
  The color must be in hex format (NOT hexa) without the leading
117
121
  '#' character. Transparency not allowed.
118
122
  Examples: 1976D2, eee
119
123
 
120
124
  --splashscreen-color Prefill the params.splashscreenColor property;
121
125
  Background color to use for the splashscreen generator;
122
- Default (if no theme-color is specified): ${defaultParams.splashscreenColor.slice(1)}
126
+ Default (if no theme-color is specified): ${ defaultParams.splashscreenColor.slice(1) }
123
127
  The color must be in hex format (NOT hexa) without the leading
124
128
  '#' character. Transparency not allowed.
125
129
  Examples: 1976D2, eee
@@ -129,14 +133,14 @@ if (argv.help) {
129
133
  (whichever is smaller) of the resulting splashscreen;
130
134
  Represents percentages; Valid values: 0 - 100
131
135
  If 0 then it doesn't add the icon of top of background
132
- Default: ${defaultParams.splashscreenIconRatio}
136
+ Default: ${ defaultParams.splashscreenIconRatio }
133
137
  `)
134
138
  process.exit(0)
135
139
  }
136
140
 
137
- const profile = require('../runner/profile')
138
- const filterArgvParams = require('../utils/filter-argv-params')
139
- const parseArgv = require('../utils/parse-argv')
141
+ import { profile } from '../runner/profile.js'
142
+ import { filterArgvParams } from '../utils/filter-argv-params.js'
143
+ import { parseArgv } from '../utils/parse-argv.js'
140
144
 
141
145
  parseArgv(argv, [
142
146
  'output',
package/lib/cmd/verify.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- const parseArgs = require('minimist')
2
+ import parseArgs from 'minimist'
3
3
 
4
4
  const argv = parseArgs(process.argv.slice(2), {
5
5
  alias: {
@@ -8,12 +8,15 @@ const argv = parseArgs(process.argv.slice(2), {
8
8
  f: 'filter',
9
9
  h: 'help'
10
10
  },
11
- boolean: ['h']
11
+ boolean: [ 'h' ]
12
12
  })
13
13
 
14
14
  if (argv.help) {
15
- const modes = Object.keys(require('../modes')).join('|')
16
- const generators = Object.keys(require('../generators')).join('|')
15
+ const { modes } = await import('../modes/index.js')
16
+ const modesList = Object.keys(modes).join('|')
17
+
18
+ const { generators } = await import('../generators/index.js')
19
+ const generatorsList = Object.keys(generators).join('|')
17
20
 
18
21
  console.log(`
19
22
  Description
@@ -41,13 +44,13 @@ if (argv.help) {
41
44
  Options
42
45
  --mode, -m For which Quasar mode(s) to verify the assets;
43
46
  Default: all
44
- [all|${modes}]
47
+ [all|${ modesList }]
45
48
  Multiple can be specified, separated by ",":
46
49
  spa,cordova,capacitor
47
50
 
48
51
  --filter, -f Filter the available generators; when used, it verifies
49
52
  only one type of asset instead of all
50
- [${generators}]
53
+ [${ generatorsList }]
51
54
 
52
55
  --profile Use JSON profile file(s) to extract the asset list to verify:
53
56
  - path to folder (absolute or relative to current folder)
@@ -68,19 +71,19 @@ if (argv.help) {
68
71
  process.exit(0)
69
72
  }
70
73
 
71
- const parseArgv = require('../utils/parse-argv')
72
- const verify = require('../runner/verify')
73
- const getProfileFiles = require('../utils/get-profile-files')
74
- const filterArgvParams = require('../utils/filter-argv-params')
75
- const { log } = require('../utils/logger')
74
+ import { parseArgv } from '../utils/parse-argv.js'
75
+ import { verify } from '../runner/verify.js'
76
+ import { getProfileFiles } from '../utils/get-profile-files.js'
77
+ import { filterArgvParams } from '../utils/filter-argv-params.js'
78
+ import { log } from '../utils/logger.js'
76
79
 
77
80
  async function runProfiles (params, profileFiles) {
78
81
  for (let i = 0; i < profileFiles.length; i++) {
79
- const profile = profileFiles[i]
82
+ const profile = profileFiles[ i ]
80
83
 
81
84
  console.log(`\n`)
82
85
  log(`--------------------`)
83
- log(`Verifying by profile: ${profile}`)
86
+ log(`Verifying by profile: ${ profile }`)
84
87
  log(`--------------------`)
85
88
  console.log(`\n`)
86
89
 
@@ -1,9 +1,10 @@
1
- const { writeFile } = require('fs')
2
- const png2icons = require('png2icons')
3
1
 
4
- const getSquareIcon = require('../utils/get-square-icon')
2
+ import { writeFile } from 'node:fs'
3
+ import png2icons from 'png2icons'
5
4
 
6
- module.exports = async function (file, opts, done) {
5
+ import { getSquareIcon } from '../utils/get-square-icon.js'
6
+
7
+ export default async function (file, opts, done) {
7
8
  const img = getSquareIcon({
8
9
  file,
9
10
  icon: opts.icon,
@@ -1,9 +1,10 @@
1
- const { writeFile } = require('fs')
2
- const png2icons = require('png2icons')
3
1
 
4
- const getSquareIcon = require('../utils/get-square-icon')
2
+ import { writeFile } from 'node:fs'
3
+ import png2icons from 'png2icons'
5
4
 
6
- module.exports = async function (file, opts, done) {
5
+ import { getSquareIcon } from '../utils/get-square-icon.js'
6
+
7
+ export default async function (file, opts, done) {
7
8
  const img = getSquareIcon({
8
9
  file,
9
10
  icon: opts.icon,
@@ -1,7 +1,14 @@
1
- module.exports = {
2
- png: require('./png'),
3
- ico: require('./ico'),
4
- icns: require('./icns'),
5
- splashscreen: require('./splashscreen'),
6
- svg: require('./svg')
1
+
2
+ import png from './png.js'
3
+ import ico from './ico.js'
4
+ import icns from './icns.js'
5
+ import splashscreen from './splashscreen.js'
6
+ import svg from './svg.js'
7
+
8
+ export const generators = {
9
+ png,
10
+ ico,
11
+ icns,
12
+ splashscreen,
13
+ svg
7
14
  }
@@ -1,6 +1,7 @@
1
- const getSquareIcon = require('../utils/get-square-icon')
2
1
 
3
- module.exports = function (file, opts, done) {
2
+ import { getSquareIcon } from '../utils/get-square-icon.js'
3
+
4
+ export default function (file, opts, done) {
4
5
  const img = getSquareIcon({
5
6
  file,
6
7
  icon: opts.icon,
@@ -1,6 +1,7 @@
1
- const getSquareIcon = require('../utils/get-square-icon')
2
1
 
3
- module.exports = async function (file, opts, done) {
2
+ import { getSquareIcon } from '../utils/get-square-icon.js'
3
+
4
+ export default async function (file, opts, done) {
4
5
  const size = Math.min(file.width, file.height)
5
6
 
6
7
  const img = opts.background
@@ -1,10 +1,11 @@
1
- const { optimize } = require('svgo')
2
- const { writeFile } = require('fs')
3
- const { posterize } = require('potrace')
4
1
 
5
- const getSquareIcon = require('../utils/get-square-icon')
2
+ import { optimize } from 'svgo'
3
+ import { writeFile } from 'node:fs'
4
+ import { posterize } from 'potrace'
6
5
 
7
- module.exports = async function (file, opts, done) {
6
+ import { getSquareIcon } from '../utils/get-square-icon.js'
7
+
8
+ export default async function (file, opts, done) {
8
9
  const img = getSquareIcon({
9
10
  file,
10
11
  icon: opts.icon,
@@ -1,6 +1,9 @@
1
- const { existsSync } = require('fs')
2
- const { resolveDir } = require('../utils/app-paths')
3
1
 
4
- module.exports = existsSync(resolveDir('public'))
5
- ? require('./quasar-app-v2')
6
- : require('./quasar-app-v1')
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
+
9
+ export { modes }
@@ -1,4 +1,5 @@
1
- module.exports = [
1
+
2
+ export default [
2
3
  {
3
4
  generator: 'png',
4
5
  name: 'icon-{size}x{size}.png',
@@ -1,3 +1,4 @@
1
+
1
2
  const iosIconRegex = /AppIcon-(\d+\.?\d?)x?(\d+\.?\d?)?@?(\d+)?x?-?\d?\.png/
2
3
 
3
4
  function getAndroidIcons (entries) {
@@ -6,25 +7,25 @@ function getAndroidIcons (entries) {
6
7
  entries.forEach(entry => {
7
8
  const icon = {
8
9
  generator: 'png',
9
- folder: `src-capacitor/android/app/src/main/res/mipmap-${entry[0]}`
10
+ folder: `src-capacitor/android/app/src/main/res/mipmap-${ entry[ 0 ] }`
10
11
  }
11
12
 
12
13
  list.push({
13
14
  ...icon,
14
15
  name: 'ic_launcher_foreground.png',
15
- sizes: [ entry[2] ]
16
+ sizes: [ entry[ 2 ] ]
16
17
  })
17
18
 
18
19
  list.push({
19
20
  ...icon,
20
21
  name: 'ic_launcher_round.png',
21
- sizes: [ entry[1] ]
22
+ sizes: [ entry[ 1 ] ]
22
23
  })
23
24
 
24
25
  list.push({
25
26
  ...icon,
26
27
  name: 'ic_launcher.png',
27
- sizes: [ entry[1] ]
28
+ sizes: [ entry[ 1 ] ]
28
29
  })
29
30
  })
30
31
 
@@ -42,17 +43,17 @@ function getAndroidSplashscreen (entries) {
42
43
 
43
44
  list.push({
44
45
  ...icon,
45
- folder: `src-capacitor/android/app/src/main/res/drawable-land-${entry[0]}`,
46
+ folder: `src-capacitor/android/app/src/main/res/drawable-land-${ entry[ 0 ] }`,
46
47
  sizes: [
47
- [ entry[1], entry[2] ]
48
+ [ entry[ 1 ], entry[ 2 ] ]
48
49
  ]
49
50
  })
50
51
 
51
52
  list.push({
52
53
  ...icon,
53
- folder: `src-capacitor/android/app/src/main/res/drawable-port-${entry[0]}`,
54
+ folder: `src-capacitor/android/app/src/main/res/drawable-port-${ entry[ 0 ] }`,
54
55
  sizes: [
55
- [ entry[2], entry[1] ]
56
+ [ entry[ 2 ], entry[ 1 ] ]
56
57
  ]
57
58
  })
58
59
  })
@@ -61,7 +62,7 @@ function getAndroidSplashscreen (entries) {
61
62
  }
62
63
 
63
64
  function getIosIcon (name) {
64
- const [,size,,multiplier] = name.match(iosIconRegex)
65
+ const [ ,size,,multiplier ] = name.match(iosIconRegex)
65
66
 
66
67
  return {
67
68
  generator: 'png',
@@ -76,7 +77,7 @@ function getIosIcon (name) {
76
77
  }
77
78
  }
78
79
 
79
- module.exports = [
80
+ export default [
80
81
  /***************
81
82
  *** Android ***
82
83
  ***************/