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.
- package/.eslintrc.cjs +10 -2
- package/index.js +88 -92
- package/package.json +10 -9
- package/templates/app/index.js +2 -3
- package/templates/app/quasar-v1/index.js +2 -3
- package/templates/app/quasar-v1/js/BASE/src/router/routes.js +0 -1
- package/templates/app/quasar-v1/js/index.js +8 -9
- package/templates/app/quasar-v1/js/lint/_.eslintrc.js +6 -4
- package/templates/app/quasar-v1/ts/index.js +8 -9
- package/templates/app/quasar-v1/ts/lint/_.eslintrc.js +1 -0
- package/templates/app/quasar-v2/index.js +2 -3
- package/templates/app/quasar-v2/js-vite/BASE/_package.json +2 -1
- package/templates/app/quasar-v2/js-vite/BASE/quasar.config.js +8 -12
- package/templates/app/quasar-v2/js-vite/BASE/src/router/routes.js +0 -1
- package/templates/app/quasar-v2/js-vite/index.js +12 -13
- package/templates/app/quasar-v2/js-vite/lint/_.eslintrc.cjs +2 -2
- package/templates/app/quasar-v2/js-vite-beta/BASE/_package.json +2 -1
- package/templates/app/quasar-v2/js-vite-beta/BASE/quasar.config.js +8 -13
- package/templates/app/quasar-v2/js-vite-beta/BASE/src/router/routes.js +0 -1
- package/templates/app/quasar-v2/js-vite-beta/index.js +12 -13
- package/templates/app/quasar-v2/js-vite-beta/lint/_.eslintrc.cjs +1 -1
- package/templates/app/quasar-v2/js-webpack/BASE/src/router/routes.js +0 -1
- package/templates/app/quasar-v2/js-webpack/index.js +12 -13
- package/templates/app/quasar-v2/js-webpack/lint/_.eslintrc.cjs +2 -2
- package/templates/app/quasar-v2/js-webpack-beta/BASE/_package.json +1 -1
- package/templates/app/quasar-v2/js-webpack-beta/BASE/src/router/routes.js +0 -1
- package/templates/app/quasar-v2/js-webpack-beta/index.js +12 -13
- package/templates/app/quasar-v2/js-webpack-beta/lint/_.eslintrc.cjs +2 -2
- package/templates/app/quasar-v2/ts-vite/BASE/_package.json +3 -1
- package/templates/app/quasar-v2/ts-vite/BASE/quasar.config.js +11 -12
- package/templates/app/quasar-v2/ts-vite/index.js +14 -15
- package/templates/app/quasar-v2/ts-vite/lint/_.eslintignore +0 -1
- package/templates/app/quasar-v2/ts-vite/lint/_.eslintrc.cjs +2 -2
- package/templates/app/quasar-v2/ts-vite/lint/_tsconfig.vue-tsc.json +6 -0
- package/templates/app/quasar-v2/ts-vite-beta/BASE/_package.json +4 -2
- package/templates/app/quasar-v2/ts-vite-beta/BASE/quasar.config.ts +11 -13
- package/templates/app/quasar-v2/ts-vite-beta/index.js +14 -15
- package/templates/app/quasar-v2/ts-vite-beta/lint/_.eslintignore +0 -1
- package/templates/app/quasar-v2/ts-vite-beta/lint/_.eslintrc.cjs +2 -2
- package/templates/app/quasar-v2/ts-vite-beta/lint/_tsconfig.vue-tsc.json +6 -0
- package/templates/app/quasar-v2/ts-webpack/index.js +14 -15
- package/templates/app/quasar-v2/ts-webpack/lint/_.eslintrc.cjs +2 -2
- package/templates/app/quasar-v2/ts-webpack-beta/BASE/_package.json +1 -1
- package/templates/app/quasar-v2/ts-webpack-beta/index.js +14 -15
- package/templates/app/quasar-v2/ts-webpack-beta/lint/_.eslintrc.cjs +2 -2
- package/templates/app-extension/ae-v1/index.js +7 -8
- package/templates/app-extension/index.js +2 -2
- package/templates/ui-kit/index.js +8 -9
- package/templates/ui-kit/quasar-v1/BASE/ui/build/script.app-ext.js +1 -1
- package/templates/ui-kit/quasar-v1/BASE/ui/build/script.clean.js +1 -1
- package/templates/ui-kit/quasar-v1/BASE/ui/dev/quasar.conf.js +1 -1
- package/templates/ui-kit/quasar-v1/index.js +9 -10
- package/templates/ui-kit/quasar-v2/index.js +9 -10
- package/utils/index.js +67 -46
- package/utils/logger.js +66 -43
- /package/templates/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v1/js/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v1/ts/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v2/js-vite/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v2/js-vite-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v2/js-webpack/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v2/js-webpack-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v2/ts-vite/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v2/ts-vite-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v2/ts-webpack/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v2/ts-webpack-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/app-extension/ae-v1/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/ui-kit/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/templates/ui-kit/quasar-v2/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/utils/logger.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
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
|
-
}
|
|
8
|
+
} from 'kolorist'
|
|
9
9
|
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
45
|
-
console.log(msg ? ` ${tipBanner} ${msg}` : '')
|
|
42
|
+
function tip (msg) {
|
|
43
|
+
console.log(msg ? ` ${ tipBanner } ${ msg }` : '')
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
console.log(msg ? ` ${greenBanner} ${msg}` : '')
|
|
46
|
+
function log (msg) {
|
|
47
|
+
console.log(msg ? ` ${ greenBanner } ${ msg }` : '')
|
|
50
48
|
}
|
|
51
49
|
|
|
52
|
-
|
|
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
|
-
|
|
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
|
-
|
|
85
|
-
|
|
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
|
-
|
|
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
|
-
|
|
93
|
-
|
|
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
|
-
|
|
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
|
-
|
|
101
|
-
|
|
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
|
-
|
|
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
|
-
|
|
109
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
132
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|