create-quasar 1.5.6 → 1.7.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 (69) hide show
  1. package/.eslintrc.cjs +10 -2
  2. package/index.js +88 -92
  3. package/package.json +10 -9
  4. package/templates/app/index.js +2 -3
  5. package/templates/app/quasar-v1/index.js +2 -3
  6. package/templates/app/quasar-v1/js/BASE/src/router/routes.js +0 -1
  7. package/templates/app/quasar-v1/js/index.js +8 -9
  8. package/templates/app/quasar-v1/js/lint/_.eslintrc.js +6 -4
  9. package/templates/app/quasar-v1/ts/index.js +8 -9
  10. package/templates/app/quasar-v1/ts/lint/_.eslintrc.js +1 -0
  11. package/templates/app/quasar-v2/index.js +2 -3
  12. package/templates/app/quasar-v2/js-vite/BASE/_package.json +2 -1
  13. package/templates/app/quasar-v2/js-vite/BASE/quasar.config.js +8 -12
  14. package/templates/app/quasar-v2/js-vite/BASE/src/router/routes.js +0 -1
  15. package/templates/app/quasar-v2/js-vite/index.js +12 -13
  16. package/templates/app/quasar-v2/js-vite/lint/_.eslintrc.cjs +2 -2
  17. package/templates/app/quasar-v2/js-vite-beta/BASE/_package.json +2 -1
  18. package/templates/app/quasar-v2/js-vite-beta/BASE/quasar.config.js +8 -13
  19. package/templates/app/quasar-v2/js-vite-beta/BASE/src/router/routes.js +0 -1
  20. package/templates/app/quasar-v2/js-vite-beta/index.js +12 -13
  21. package/templates/app/quasar-v2/js-vite-beta/lint/_.eslintrc.cjs +1 -1
  22. package/templates/app/quasar-v2/js-webpack/BASE/src/router/routes.js +0 -1
  23. package/templates/app/quasar-v2/js-webpack/index.js +12 -13
  24. package/templates/app/quasar-v2/js-webpack/lint/_.eslintrc.cjs +2 -2
  25. package/templates/app/quasar-v2/js-webpack-beta/BASE/_package.json +1 -1
  26. package/templates/app/quasar-v2/js-webpack-beta/BASE/src/router/routes.js +0 -1
  27. package/templates/app/quasar-v2/js-webpack-beta/index.js +12 -13
  28. package/templates/app/quasar-v2/js-webpack-beta/lint/_.eslintrc.cjs +2 -2
  29. package/templates/app/quasar-v2/ts-vite/BASE/_package.json +3 -1
  30. package/templates/app/quasar-v2/ts-vite/BASE/quasar.config.js +11 -12
  31. package/templates/app/quasar-v2/ts-vite/index.js +14 -15
  32. package/templates/app/quasar-v2/ts-vite/lint/_.eslintignore +0 -1
  33. package/templates/app/quasar-v2/ts-vite/lint/_.eslintrc.cjs +2 -2
  34. package/templates/app/quasar-v2/ts-vite/lint/_tsconfig.vue-tsc.json +6 -0
  35. package/templates/app/quasar-v2/ts-vite-beta/BASE/_package.json +4 -2
  36. package/templates/app/quasar-v2/ts-vite-beta/BASE/quasar.config.ts +11 -13
  37. package/templates/app/quasar-v2/ts-vite-beta/index.js +14 -15
  38. package/templates/app/quasar-v2/ts-vite-beta/lint/_.eslintignore +0 -1
  39. package/templates/app/quasar-v2/ts-vite-beta/lint/_.eslintrc.cjs +2 -2
  40. package/templates/app/quasar-v2/ts-vite-beta/lint/_tsconfig.vue-tsc.json +6 -0
  41. package/templates/app/quasar-v2/ts-webpack/index.js +14 -15
  42. package/templates/app/quasar-v2/ts-webpack/lint/_.eslintrc.cjs +2 -2
  43. package/templates/app/quasar-v2/ts-webpack-beta/BASE/_package.json +1 -1
  44. package/templates/app/quasar-v2/ts-webpack-beta/index.js +14 -15
  45. package/templates/app/quasar-v2/ts-webpack-beta/lint/_.eslintrc.cjs +2 -2
  46. package/templates/app-extension/ae-v1/index.js +7 -8
  47. package/templates/app-extension/index.js +2 -2
  48. package/templates/ui-kit/index.js +8 -9
  49. package/templates/ui-kit/quasar-v1/BASE/ui/build/script.app-ext.js +1 -1
  50. package/templates/ui-kit/quasar-v1/BASE/ui/build/script.clean.js +1 -1
  51. package/templates/ui-kit/quasar-v1/BASE/ui/dev/quasar.conf.js +1 -1
  52. package/templates/ui-kit/quasar-v1/index.js +9 -10
  53. package/templates/ui-kit/quasar-v2/index.js +9 -10
  54. package/utils/index.js +67 -46
  55. package/utils/logger.js +66 -43
  56. /package/templates/{.eslintrc.js → .eslintrc.cjs} +0 -0
  57. /package/templates/app/quasar-v1/js/{.eslintrc.js → .eslintrc.cjs} +0 -0
  58. /package/templates/app/quasar-v1/ts/{.eslintrc.js → .eslintrc.cjs} +0 -0
  59. /package/templates/app/quasar-v2/js-vite/{.eslintrc.js → .eslintrc.cjs} +0 -0
  60. /package/templates/app/quasar-v2/js-vite-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
  61. /package/templates/app/quasar-v2/js-webpack/{.eslintrc.js → .eslintrc.cjs} +0 -0
  62. /package/templates/app/quasar-v2/js-webpack-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
  63. /package/templates/app/quasar-v2/ts-vite/{.eslintrc.js → .eslintrc.cjs} +0 -0
  64. /package/templates/app/quasar-v2/ts-vite-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
  65. /package/templates/app/quasar-v2/ts-webpack/{.eslintrc.js → .eslintrc.cjs} +0 -0
  66. /package/templates/app/quasar-v2/ts-webpack-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
  67. /package/templates/app-extension/ae-v1/{.eslintrc.js → .eslintrc.cjs} +0 -0
  68. /package/templates/ui-kit/{.eslintrc.js → .eslintrc.cjs} +0 -0
  69. /package/templates/ui-kit/quasar-v2/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/utils/logger.js CHANGED
@@ -1,22 +1,22 @@
1
- const {
1
+ import {
2
2
  bgGreen, green,
3
3
  inverse,
4
4
  bgRed, red,
5
5
  bgYellow, yellow,
6
6
  black, white,
7
7
  underline
8
- } = require('kolorist')
8
+ } from 'kolorist'
9
9
 
10
- const readline = require('readline')
10
+ import readline from 'node:readline'
11
11
 
12
12
  /**
13
13
  * Pills
14
14
  */
15
15
 
16
- const successPill = msg => bgGreen(black(` ${msg} `))
17
- const infoPill = msg => inverse(` ${msg} `)
18
- const errorPill = msg => bgRed(white(` ${msg} `))
19
- const warningPill = msg => bgYellow(black(` ${msg} `))
16
+ const successPill = msg => bgGreen(black(` ${ msg } `))
17
+ const infoPill = msg => inverse(` ${ msg } `)
18
+ const errorPill = msg => bgRed(white(` ${ msg } `))
19
+ const warningPill = msg => bgYellow(black(` ${ msg } `))
20
20
 
21
21
  /**
22
22
  * Main approach
@@ -27,11 +27,9 @@ const banner = 'Quasar ' + dot
27
27
  const greenBanner = green(banner)
28
28
  const redBanner = red(banner)
29
29
  const yellowBanner = yellow(banner)
30
- const tipBanner = `${green('App')} ${dot} ${successPill('TIP')} ${dot} 🚀 `
30
+ const tipBanner = `${ green('App') } ${ dot } ${ successPill('TIP') } ${ dot } 🚀 `
31
31
 
32
- module.exports.dot = dot
33
-
34
- module.exports.clearConsole = process.stdout.isTTY
32
+ const clearConsole = process.stdout.isTTY
35
33
  ? () => {
36
34
  // Fill screen with blank lines. Then move to 0 (beginning of visible part) and clear it
37
35
  const blank = '\n'.repeat(process.stdout.rows)
@@ -41,34 +39,34 @@ module.exports.clearConsole = process.stdout.isTTY
41
39
  }
42
40
  : () => {}
43
41
 
44
- module.exports.tip = function (msg) {
45
- console.log(msg ? ` ${tipBanner} ${msg}` : '')
42
+ function tip (msg) {
43
+ console.log(msg ? ` ${ tipBanner } ${ msg }` : '')
46
44
  }
47
45
 
48
- module.exports.log = function (msg) {
49
- console.log(msg ? ` ${greenBanner} ${msg}` : '')
46
+ function log (msg) {
47
+ console.log(msg ? ` ${ greenBanner } ${ msg }` : '')
50
48
  }
51
49
 
52
- module.exports.warn = function (msg, pill) {
50
+ function warn (msg, pill) {
53
51
  if (msg !== void 0) {
54
52
  const pillBanner = pill !== void 0
55
53
  ? bgYellow(black('', pill, '')) + ' '
56
54
  : ''
57
55
 
58
- console.warn(` ${yellowBanner} ⚠️ ${pillBanner}${msg}`)
56
+ console.warn(` ${ yellowBanner } ⚠️ ${ pillBanner }${ msg }`)
59
57
  }
60
58
  else {
61
59
  console.warn()
62
60
  }
63
61
  }
64
62
 
65
- module.exports.fatal = function (msg, pill) {
63
+ function fatal (msg, pill) {
66
64
  if (msg !== void 0) {
67
65
  const pillBanner = pill !== void 0
68
66
  ? errorPill(pill) + ' '
69
67
  : ''
70
68
 
71
- console.error(`\n ${redBanner} ⚠️ ${pillBanner}${msg}\n`)
69
+ console.error(`\n ${ redBanner } ⚠️ ${ pillBanner }${ msg }\n`)
72
70
  }
73
71
  else {
74
72
  console.error()
@@ -81,54 +79,79 @@ module.exports.fatal = function (msg, pill) {
81
79
  * Extended approach - Status & pills
82
80
  */
83
81
 
84
- module.exports.successPill = successPill
85
- module.exports.success = function (msg, title = 'SUCCESS') {
86
- console.log(` ${greenBanner} ${successPill(title)} ${green(dot + ' ' + msg)}`)
82
+ function success (msg, title = 'SUCCESS') {
83
+ console.log(` ${ greenBanner } ${ successPill(title) } ${ green(dot + ' ' + msg) }`)
87
84
  }
88
- module.exports.getSuccess = function (msg, title) {
89
- return ` ${greenBanner} ${successPill(title)} ${green(dot + ' ' + msg)}`
85
+ function getSuccess (msg, title) {
86
+ return ` ${ greenBanner } ${ successPill(title) } ${ green(dot + ' ' + msg) }`
90
87
  }
91
88
 
92
- module.exports.infoPill = infoPill
93
- module.exports.info = function (msg, title = 'INFO') {
94
- console.log(` ${greenBanner} ${infoPill(title)} ${green(dot)} ${msg}`)
89
+ function info (msg, title = 'INFO') {
90
+ console.log(` ${ greenBanner } ${ infoPill(title) } ${ green(dot) } ${ msg }`)
95
91
  }
96
- module.exports.getInfo = function (msg, title) {
97
- return ` ${greenBanner} ${infoPill(title)} ${green(dot)} ${msg}`
92
+ function getInfo (msg, title) {
93
+ return ` ${ greenBanner } ${ infoPill(title) } ${ green(dot) } ${ msg }`
98
94
  }
99
95
 
100
- module.exports.errorPill = errorPill
101
- module.exports.error = function (msg, title = 'ERROR') {
102
- console.log(` ${redBanner} ${errorPill(title)} ${red(dot + ' ' + msg)}`)
96
+ function error (msg, title = 'ERROR') {
97
+ console.log(` ${ redBanner } ${ errorPill(title) } ${ red(dot + ' ' + msg) }`)
103
98
  }
104
- module.exports.getError = function (msg, title = 'ERROR') {
105
- return ` ${redBanner} ${errorPill(title)} ${red(dot + ' ' + msg)}`
99
+ function getError (msg, title = 'ERROR') {
100
+ return ` ${ redBanner } ${ errorPill(title) } ${ red(dot + ' ' + msg) }`
106
101
  }
107
102
 
108
- module.exports.warningPill = warningPill
109
- module.exports.warning = function (msg, title = 'WARNING') {
110
- console.log(` ${yellowBanner} ${warningPill(title)} ${yellow(dot + ' ' + msg)}`)
103
+ function warning (msg, title = 'WARNING') {
104
+ console.log(` ${ yellowBanner } ${ warningPill(title) } ${ yellow(dot + ' ' + msg) }`)
111
105
  }
112
- module.exports.getWarning = function (msg, title = 'WARNING') {
113
- return ` ${yellowBanner} ${warningPill(title)} ${yellow(dot + ' ' + msg)}`
106
+ function getWarning (msg, title = 'WARNING') {
107
+ return ` ${ yellowBanner } ${ warningPill(title) } ${ yellow(dot + ' ' + msg) }`
114
108
  }
115
109
 
116
110
  /**
117
111
  * Progress related
118
112
  */
119
113
 
120
- module.exports.progress = function start (msg, token) {
114
+ function progress (msg, token) {
121
115
  const parseMsg = token !== void 0
122
116
  ? text => text.replace('___', underline(green(token)))
123
117
  : text => text
124
118
 
125
- module.exports.info(parseMsg(msg), 'WAIT')
119
+ info(parseMsg(msg), 'WAIT')
126
120
 
127
121
  const startTime = Date.now()
128
122
 
129
123
  return msg => {
130
124
  const diffTime = +new Date() - startTime
131
- module.exports.success(`${parseMsg(msg)} ${dot} ${diffTime}ms`, 'DONE')
132
- module.exports.log()
125
+ success(`${ parseMsg(msg) } ${ dot } ${ diffTime }ms`, 'DONE')
126
+ log()
133
127
  }
134
128
  }
129
+
130
+ export default {
131
+ successPill,
132
+ infoPill,
133
+ errorPill,
134
+ warningPill,
135
+
136
+ dot,
137
+
138
+ clearConsole,
139
+ tip,
140
+ log,
141
+ warn,
142
+ fatal,
143
+
144
+ success,
145
+ getSuccess,
146
+
147
+ info,
148
+ getInfo,
149
+
150
+ error,
151
+ getError,
152
+
153
+ warning,
154
+ getWarning,
155
+
156
+ progress
157
+ }
File without changes