create-quasar 2.1.0 → 2.2.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/index.js +72 -54
- package/package.json +14 -18
- package/scripts/create-test-project.ts +26 -25
- package/templates/{eslint.config.base.js → __eslint.config.base.js} +3 -2
- package/templates/app/{eslint.config.js → __eslint.config.js} +2 -3
- package/templates/app/create-quasar-script.js +8 -0
- package/templates/app/quasar-v2/create-quasar-script.js +39 -0
- package/templates/app/quasar-v2/js-vite-2/BASE/README.md +4 -4
- package/templates/app/quasar-v2/js-vite-2/BASE/_.vscode/extensions.json +2 -2
- package/templates/app/quasar-v2/js-vite-2/BASE/_.vscode/settings.json +2 -2
- package/templates/app/quasar-v2/js-vite-2/BASE/_package.json +13 -14
- package/templates/app/quasar-v2/js-vite-2/BASE/index.html +3 -3
- package/templates/app/quasar-v2/js-vite-2/BASE/quasar.config.js +9 -10
- package/templates/app/quasar-v2/js-vite-2/BASE/src/App.vue +0 -11
- package/templates/app/quasar-v2/js-vite-2/BASE/src/components/EssentialLink.vue +7 -35
- package/templates/app/quasar-v2/js-vite-2/BASE/src/layouts/MainLayout.vue +2 -141
- package/templates/app/quasar-v2/js-vite-2/BASE/src/pages/ErrorNotFound.vue +0 -11
- package/templates/app/quasar-v2/js-vite-2/BASE/src/pages/IndexPage.vue +0 -11
- package/templates/app/quasar-v2/{ts-webpack-4/index.js → js-vite-2/create-quasar-script.js} +24 -7
- package/templates/app/quasar-v2/js-vite-2/eslint/_eslint.config.js +3 -3
- package/templates/app/quasar-v2/js-webpack-4/BASE/README.md +4 -4
- package/templates/app/quasar-v2/js-webpack-4/BASE/_.vscode/extensions.json +2 -2
- package/templates/app/quasar-v2/js-webpack-4/BASE/_.vscode/settings.json +2 -2
- package/templates/app/quasar-v2/js-webpack-4/BASE/_package.json +10 -11
- package/templates/app/quasar-v2/js-webpack-4/BASE/index.html +3 -3
- package/templates/app/quasar-v2/js-webpack-4/BASE/quasar.config.js +5 -6
- package/templates/app/quasar-v2/js-webpack-4/BASE/src/App.vue +0 -11
- package/templates/app/quasar-v2/js-webpack-4/BASE/src/components/EssentialLink.vue +7 -35
- package/templates/app/quasar-v2/js-webpack-4/BASE/src/layouts/MainLayout.vue +2 -141
- package/templates/app/quasar-v2/js-webpack-4/BASE/src/pages/ErrorNotFound.vue +0 -11
- package/templates/app/quasar-v2/js-webpack-4/BASE/src/pages/IndexPage.vue +0 -11
- package/templates/app/quasar-v2/{js-vite-2/index.js → js-webpack-4/create-quasar-script.js} +24 -7
- package/templates/app/quasar-v2/js-webpack-4/eslint/_eslint.config.js +3 -3
- package/templates/app/quasar-v2/ts-vite-2/BASE/README.md +4 -4
- package/templates/app/quasar-v2/ts-vite-2/BASE/_.vscode/extensions.json +2 -2
- package/templates/app/quasar-v2/ts-vite-2/BASE/_.vscode/settings.json +2 -2
- package/templates/app/quasar-v2/ts-vite-2/BASE/_package.json +13 -14
- package/templates/app/quasar-v2/ts-vite-2/BASE/index.html +3 -3
- package/templates/app/quasar-v2/ts-vite-2/BASE/quasar.config.ts +9 -10
- package/templates/app/quasar-v2/ts-vite-2/BASE/src/App.vue +0 -11
- package/templates/app/quasar-v2/ts-vite-2/BASE/src/components/EssentialLink.vue +2 -37
- package/templates/app/quasar-v2/ts-vite-2/BASE/src/components/ExampleComponent.vue +2 -98
- package/templates/app/quasar-v2/ts-vite-2/BASE/src/layouts/MainLayout.vue +2 -141
- package/templates/app/quasar-v2/ts-vite-2/BASE/src/pages/ErrorNotFound.vue +0 -11
- package/templates/app/quasar-v2/ts-vite-2/BASE/src/pages/IndexPage.vue +2 -90
- package/templates/app/quasar-v2/{ts-webpack-4/.eslintrc.cjs → ts-vite-2/__.eslintrc.cjs} +0 -1
- package/templates/app/quasar-v2/ts-vite-2/{index.js → create-quasar-script.js} +24 -7
- package/templates/app/quasar-v2/ts-vite-2/eslint/_eslint.config.js +3 -3
- package/templates/app/quasar-v2/ts-vite-2/i18n/src/boot/i18n.ts +2 -2
- package/templates/app/quasar-v2/ts-webpack-4/BASE/README.md +4 -4
- package/templates/app/quasar-v2/ts-webpack-4/BASE/_.vscode/extensions.json +2 -2
- package/templates/app/quasar-v2/ts-webpack-4/BASE/_.vscode/settings.json +2 -2
- package/templates/app/quasar-v2/ts-webpack-4/BASE/_package.json +10 -11
- package/templates/app/quasar-v2/ts-webpack-4/BASE/index.html +3 -3
- package/templates/app/quasar-v2/ts-webpack-4/BASE/quasar.config.ts +5 -6
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/App.vue +0 -11
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/components/EssentialLink.vue +2 -37
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/components/ExampleComponent.vue +2 -98
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/layouts/MainLayout.vue +2 -141
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/pages/ErrorNotFound.vue +0 -11
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/pages/IndexPage.vue +2 -90
- package/templates/app/quasar-v2/{ts-vite-2/.eslintrc.cjs → ts-webpack-4/__.eslintrc.cjs} +0 -1
- package/templates/app/quasar-v2/{js-webpack-4/index.js → ts-webpack-4/create-quasar-script.js} +24 -7
- package/templates/app/quasar-v2/ts-webpack-4/eslint/_eslint.config.js +3 -3
- package/templates/app/quasar-v2/ts-webpack-4/i18n/src/boot/i18n.ts +2 -2
- package/templates/app-extension/{eslint.config.js → __eslint.config.js} +3 -5
- package/templates/app-extension/ae-js/BASE/README.md +5 -5
- package/templates/app-extension/ae-js/BASE/_package.json +6 -6
- package/templates/app-extension/ae-js/BASE/src/index.js +1 -1
- package/templates/app-extension/ae-js/{index.js → create-quasar-script.js} +4 -14
- package/templates/app-extension/ae-js/install-script/src/install.js +1 -1
- package/templates/app-extension/ae-js/prompts-script/src/prompts.js +1 -1
- package/templates/app-extension/ae-js/uninstall-script/src/uninstall.js +1 -1
- package/templates/app-extension/ae-ts/BASE/README.md +6 -6
- package/templates/app-extension/ae-ts/BASE/_eslint.config.js +3 -2
- package/templates/app-extension/ae-ts/BASE/_package.json +11 -11
- package/templates/app-extension/ae-ts/BASE/app-extension/README.md +7 -7
- package/templates/app-extension/ae-ts/BASE/app-extension/_package.json +9 -9
- package/templates/app-extension/ae-ts/BASE/app-extension/src/index.ts +2 -2
- package/templates/app-extension/ae-ts/BASE/app-extension/src/runtime/README.md +3 -3
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/README.md +11 -11
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/_package.json +4 -4
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/index.html +3 -3
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/quasar.config.ts +0 -2
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/quasar.extensions.json +1 -1
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/quasar.d.ts +1 -1
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/README.md +10 -10
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/_package.json +4 -4
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/index.html +3 -3
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/quasar.config.ts +0 -2
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/quasar.extensions.json +1 -1
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/quasar.d.ts +1 -1
- package/templates/app-extension/ae-ts/{index.js → create-quasar-script.js} +11 -6
- package/templates/app-extension/create-quasar-script.js +17 -0
- package/templates/ui-kit/{eslint.config.js → __eslint.config.js} +2 -2
- package/templates/ui-kit/{index.js → create-quasar-script.js} +8 -5
- package/templates/ui-kit/quasar-v2/BASE/LICENSE +1 -1
- package/templates/ui-kit/quasar-v2/BASE/README.md +4 -4
- package/templates/ui-kit/quasar-v2/BASE/ui/README.md +29 -29
- package/templates/ui-kit/quasar-v2/BASE/ui/_package.json +4 -4
- package/templates/ui-kit/quasar-v2/BASE/ui/build/index.js +1 -1
- package/templates/ui-kit/quasar-v2/BASE/ui/build/script.javascript.js +2 -2
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/index.template.html +10 -5
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/layouts/MyLayout.vue +1 -1
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/pages/Test1.vue +4 -4
- package/templates/ui-kit/quasar-v2/BASE/ui/src/index.sass +2 -2
- package/templates/ui-kit/quasar-v2/BASE/ui/src/vue-plugin.js +6 -6
- package/templates/ui-kit/quasar-v2/BASE/ui/umd-test.html +2 -2
- package/templates/ui-kit/quasar-v2/ae/app-extension/README.md +6 -6
- package/templates/ui-kit/quasar-v2/ae/app-extension/_package.json +5 -5
- package/templates/ui-kit/quasar-v2/ae/app-extension/src/boot/register.js +1 -1
- package/templates/ui-kit/quasar-v2/ae/app-extension/src/index.js +7 -7
- package/templates/ui-kit/quasar-v2/{index.js → create-quasar-script.js} +5 -2
- package/templates/ui-kit/quasar-v2/ui-component/ui/src/components/Component.js +3 -3
- package/templates/ui-kit/quasar-v2/ui-component/ui/src/components/Component.sass +1 -1
- package/templates/ui-kit/quasar-v2/ui-directive/ui/src/directives/Directive.js +1 -1
- package/templates/ui-kit/quasar-v2/ui-directive/ui/src/directives/Directive.sass +1 -1
- package/utils/index.js +106 -93
- package/utils/logger.js +52 -50
- package/utils/template.js +280 -0
- package/eslint.config.base.js +0 -19
- package/eslint.config.js +0 -47
- package/templates/app/index.js +0 -8
- package/templates/app/quasar-v2/index.js +0 -56
- package/templates/app/quasar-v2/js-vite-2/axios/src/boot/axios.js +0 -24
- package/templates/app/quasar-v2/js-vite-2/scss/src/css/app.scss +0 -1
- package/templates/app/quasar-v2/js-vite-2/scss/src/css/quasar.variables.scss +0 -25
- package/templates/app/quasar-v2/js-webpack-4/axios/src/boot/axios.js +0 -24
- package/templates/app/quasar-v2/js-webpack-4/scss/src/css/app.scss +0 -1
- package/templates/app/quasar-v2/js-webpack-4/scss/src/css/quasar.variables.scss +0 -25
- package/templates/app/quasar-v2/ts-vite-2/axios/src/boot/axios.ts +0 -31
- package/templates/app/quasar-v2/ts-vite-2/scss/src/css/app.scss +0 -1
- package/templates/app/quasar-v2/ts-vite-2/scss/src/css/quasar.variables.scss +0 -25
- package/templates/app/quasar-v2/ts-webpack-4/axios/src/boot/axios.ts +0 -31
- package/templates/app/quasar-v2/ts-webpack-4/scss/src/css/app.scss +0 -1
- package/templates/app/quasar-v2/ts-webpack-4/scss/src/css/quasar.variables.scss +0 -25
- package/templates/app-extension/index.js +0 -15
- /package/templates/app/quasar-v2/js-vite-2/{.eslintrc.cjs → __.eslintrc.cjs} +0 -0
- /package/templates/app/quasar-v2/js-webpack-4/{.eslintrc.cjs → __.eslintrc.cjs} +0 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heavily inspired by Eta v4.5.1
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const fnAccumulator = '__qstr__'
|
|
6
|
+
const defaultParseOptions = {
|
|
7
|
+
varName: 'scope',
|
|
8
|
+
exec: '', // never '-' | '_'
|
|
9
|
+
interpolate: '=', // never '-' | '_'
|
|
10
|
+
raw: '~', // never '-' | '_'
|
|
11
|
+
header: '',
|
|
12
|
+
tagStart: '<%',
|
|
13
|
+
tagEnd: '%>'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const newlineRE = /\n/
|
|
17
|
+
const newlineTrimRE = /^(?:\r\n|\n|\r)/
|
|
18
|
+
const escapeRegexpRE = /[.*+\-?^${}()|[\]\\]/g
|
|
19
|
+
const templateLitReg =
|
|
20
|
+
/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g
|
|
21
|
+
const singleQuoteReg = /'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g
|
|
22
|
+
const doubleQuoteReg = /"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g
|
|
23
|
+
|
|
24
|
+
function throwParseError(message, str, index) {
|
|
25
|
+
const whitespace = str.slice(0, index).split(newlineRE)
|
|
26
|
+
|
|
27
|
+
const lineNo = whitespace.length
|
|
28
|
+
const colNo = whitespace[lineNo - 1].length + 1
|
|
29
|
+
|
|
30
|
+
message +=
|
|
31
|
+
' at line ' +
|
|
32
|
+
lineNo +
|
|
33
|
+
' col ' +
|
|
34
|
+
colNo +
|
|
35
|
+
':\n\n' +
|
|
36
|
+
' ' +
|
|
37
|
+
str.split(newlineRE)[lineNo - 1] +
|
|
38
|
+
'\n' +
|
|
39
|
+
' ' +
|
|
40
|
+
Array(colNo).join(' ') +
|
|
41
|
+
'^'
|
|
42
|
+
|
|
43
|
+
throw new Error(message)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function escapeRegExp(str) {
|
|
47
|
+
// From MDN
|
|
48
|
+
return str.replace(escapeRegexpRE, '\\$&') // $& means the whole matched string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function trimWS(str, wsLeft, wsRight) {
|
|
52
|
+
// Slightly confusing,
|
|
53
|
+
// but _}} will trim the left side of the following string
|
|
54
|
+
let leftTrim = wsLeft || wsLeft === false ? wsLeft : 'nl'
|
|
55
|
+
let rightTrim = wsRight || wsRight === false ? wsRight : false
|
|
56
|
+
|
|
57
|
+
if (!rightTrim && !leftTrim) return str
|
|
58
|
+
|
|
59
|
+
if (leftTrim === 'slurp' && rightTrim === 'slurp') {
|
|
60
|
+
return str.trim()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (leftTrim === '_' || leftTrim === 'slurp') {
|
|
64
|
+
// full slurp
|
|
65
|
+
str = str.trimStart()
|
|
66
|
+
} else if (leftTrim === '-' || leftTrim === 'nl') {
|
|
67
|
+
// nl trim
|
|
68
|
+
str = str.replace(newlineTrimRE, '')
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (rightTrim === '_' || rightTrim === 'slurp') {
|
|
72
|
+
// full slurp
|
|
73
|
+
str = str.trimEnd()
|
|
74
|
+
} else if (rightTrim === '-' || rightTrim === 'nl') {
|
|
75
|
+
// nl trim
|
|
76
|
+
str = str.replace(newlineTrimRE, '')
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return str
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// opts: { exec, interpolate, raw, tagStart, tagEnd }
|
|
83
|
+
function getAST(str, opts) {
|
|
84
|
+
let ast = []
|
|
85
|
+
let trimLeftOfNextStr = false
|
|
86
|
+
let lastIndex = 0
|
|
87
|
+
|
|
88
|
+
templateLitReg.lastIndex = 0
|
|
89
|
+
singleQuoteReg.lastIndex = 0
|
|
90
|
+
doubleQuoteReg.lastIndex = 0
|
|
91
|
+
|
|
92
|
+
function pushString(strng, shouldTrimRightOfString) {
|
|
93
|
+
if (strng) {
|
|
94
|
+
// if string is truthy it must be of type 'string'
|
|
95
|
+
|
|
96
|
+
strng = trimWS(
|
|
97
|
+
strng,
|
|
98
|
+
trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined
|
|
99
|
+
shouldTrimRightOfString
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
if (strng) {
|
|
103
|
+
// replace \ with \\, ' with \'
|
|
104
|
+
// we're going to convert all CRLF to LF so it doesn't take more than one replace
|
|
105
|
+
|
|
106
|
+
strng = strng.replace(/\\|'/g, '\\$&').replace(/\r\n|\n|\r/g, '\\n')
|
|
107
|
+
|
|
108
|
+
ast.push(strng)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const prefixes = [opts.exec, opts.interpolate, opts.raw].reduce(
|
|
114
|
+
(accumulator, prefix) => {
|
|
115
|
+
if (accumulator && prefix) {
|
|
116
|
+
return accumulator + '|' + escapeRegExp(prefix)
|
|
117
|
+
} else if (prefix) {
|
|
118
|
+
// accumulator is falsy
|
|
119
|
+
return escapeRegExp(prefix)
|
|
120
|
+
} else {
|
|
121
|
+
// prefix and accumulator are both falsy
|
|
122
|
+
return accumulator
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
''
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
const parseOpenReg = new RegExp(
|
|
129
|
+
escapeRegExp(opts.tagStart) + '(-|_)?\\s*(' + prefixes + ')?\\s*',
|
|
130
|
+
'g'
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
const parseCloseReg = new RegExp(
|
|
134
|
+
'\'|"|`|\\/\\*|(\\s*(-|_)?' + escapeRegExp(opts.tagEnd) + ')',
|
|
135
|
+
'g'
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
let m
|
|
139
|
+
|
|
140
|
+
while ((m = parseOpenReg.exec(str))) {
|
|
141
|
+
const precedingString = str.slice(lastIndex, m.index)
|
|
142
|
+
|
|
143
|
+
lastIndex = m[0].length + m.index
|
|
144
|
+
|
|
145
|
+
const wsLeft = m[1]
|
|
146
|
+
const prefix = m[2] || '' // by default either ~, =, or empty
|
|
147
|
+
|
|
148
|
+
pushString(precedingString, wsLeft)
|
|
149
|
+
|
|
150
|
+
parseCloseReg.lastIndex = lastIndex
|
|
151
|
+
let closeTag
|
|
152
|
+
let currentObj = false
|
|
153
|
+
|
|
154
|
+
while ((closeTag = parseCloseReg.exec(str))) {
|
|
155
|
+
if (closeTag[1]) {
|
|
156
|
+
const content = str.slice(lastIndex, closeTag.index)
|
|
157
|
+
|
|
158
|
+
parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex
|
|
159
|
+
|
|
160
|
+
trimLeftOfNextStr = closeTag[2]
|
|
161
|
+
|
|
162
|
+
const currentType =
|
|
163
|
+
prefix === opts.exec
|
|
164
|
+
? 'e'
|
|
165
|
+
: prefix === opts.raw
|
|
166
|
+
? 'r'
|
|
167
|
+
: prefix === opts.interpolate
|
|
168
|
+
? 'i'
|
|
169
|
+
: ''
|
|
170
|
+
|
|
171
|
+
currentObj = { t: currentType, val: content }
|
|
172
|
+
break
|
|
173
|
+
} else {
|
|
174
|
+
const char = closeTag[0]
|
|
175
|
+
if (char === '/*') {
|
|
176
|
+
const commentCloseInd = str.indexOf('*/', parseCloseReg.lastIndex)
|
|
177
|
+
|
|
178
|
+
if (commentCloseInd === -1) {
|
|
179
|
+
throwParseError('unclosed comment', str, closeTag.index)
|
|
180
|
+
}
|
|
181
|
+
parseCloseReg.lastIndex = commentCloseInd
|
|
182
|
+
} else if (char === "'") {
|
|
183
|
+
singleQuoteReg.lastIndex = closeTag.index
|
|
184
|
+
|
|
185
|
+
const singleQuoteMatch = singleQuoteReg.exec(str)
|
|
186
|
+
if (singleQuoteMatch) {
|
|
187
|
+
parseCloseReg.lastIndex = singleQuoteReg.lastIndex
|
|
188
|
+
} else {
|
|
189
|
+
throwParseError('unclosed string', str, closeTag.index)
|
|
190
|
+
}
|
|
191
|
+
} else if (char === '"') {
|
|
192
|
+
doubleQuoteReg.lastIndex = closeTag.index
|
|
193
|
+
const doubleQuoteMatch = doubleQuoteReg.exec(str)
|
|
194
|
+
|
|
195
|
+
if (doubleQuoteMatch) {
|
|
196
|
+
parseCloseReg.lastIndex = doubleQuoteReg.lastIndex
|
|
197
|
+
} else {
|
|
198
|
+
throwParseError('unclosed string', str, closeTag.index)
|
|
199
|
+
}
|
|
200
|
+
} else if (char === '`') {
|
|
201
|
+
templateLitReg.lastIndex = closeTag.index
|
|
202
|
+
const templateLitMatch = templateLitReg.exec(str)
|
|
203
|
+
if (templateLitMatch) {
|
|
204
|
+
parseCloseReg.lastIndex = templateLitReg.lastIndex
|
|
205
|
+
} else {
|
|
206
|
+
throwParseError('unclosed string', str, closeTag.index)
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (currentObj) {
|
|
212
|
+
ast.push(currentObj)
|
|
213
|
+
} else {
|
|
214
|
+
throwParseError('unclosed tag', str, m.index)
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
pushString(str.slice(lastIndex, str.length), false)
|
|
219
|
+
return ast
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// opts: { varName, header }
|
|
223
|
+
function compileBody(ast, opts) {
|
|
224
|
+
let i = 0
|
|
225
|
+
const astLength = ast.length
|
|
226
|
+
let returnStr = `${opts.header}\nlet ${fnAccumulator} = '';\n`
|
|
227
|
+
|
|
228
|
+
for (; i < astLength; i++) {
|
|
229
|
+
const currentBlock = ast[i]
|
|
230
|
+
|
|
231
|
+
if (typeof currentBlock === 'string') {
|
|
232
|
+
returnStr += `${fnAccumulator}+='${currentBlock}';\n`
|
|
233
|
+
continue
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const type = currentBlock.t // "r", "e", or "i"
|
|
237
|
+
let content = currentBlock.val || ''
|
|
238
|
+
|
|
239
|
+
if (type === 'r') {
|
|
240
|
+
// raw
|
|
241
|
+
returnStr += `${fnAccumulator}+=${content};\n`
|
|
242
|
+
} else if (type === 'i') {
|
|
243
|
+
// interpolate
|
|
244
|
+
returnStr += `${fnAccumulator}+=${content};\n`
|
|
245
|
+
} else if (type === 'e') {
|
|
246
|
+
// execute
|
|
247
|
+
returnStr += content + '\n'
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return returnStr + `\nreturn ${fnAccumulator};`
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export function compileTemplateToFile(str, rawOpts = {}) {
|
|
255
|
+
const opts = { ...defaultParseOptions, ...rawOpts }
|
|
256
|
+
const ast = getAST(str, opts)
|
|
257
|
+
const body = compileBody(ast, opts)
|
|
258
|
+
return `export default ${opts.varName} => {\n${body}\n}`
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function compileTemplateToFn(str, rawOpts = {}) {
|
|
262
|
+
const opts = { ...defaultParseOptions, ...rawOpts }
|
|
263
|
+
const ast = getAST(str, opts)
|
|
264
|
+
const body = compileBody(ast, opts)
|
|
265
|
+
return new Function(opts.varName, body)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export function renderTemplate(str, scope, rawOpts) {
|
|
269
|
+
let opts = rawOpts
|
|
270
|
+
if (opts?.varName === false) {
|
|
271
|
+
opts.varName = defaultParseOptions.varName
|
|
272
|
+
const keys = Object.keys(scope)
|
|
273
|
+
if (keys.length !== 0) {
|
|
274
|
+
opts.header = `const { ${keys.join(', ')} } = ${defaultParseOptions.varName}`
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const templateFn = compileTemplateToFn(str, opts)
|
|
279
|
+
return templateFn(scope)
|
|
280
|
+
}
|
package/eslint.config.base.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import eslintJs from '@eslint/js'
|
|
2
|
-
import tseslint from 'typescript-eslint'
|
|
3
|
-
|
|
4
|
-
export default tseslint.config(
|
|
5
|
-
{
|
|
6
|
-
name: 'eslint/recommended',
|
|
7
|
-
|
|
8
|
-
...eslintJs.configs.recommended
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
name: 'custom',
|
|
13
|
-
|
|
14
|
-
rules: {
|
|
15
|
-
'no-empty': 'off',
|
|
16
|
-
'no-unused-vars': [ 'error', { ignoreRestSiblings: true, argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' } ]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
)
|
package/eslint.config.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import baseConfig from './eslint.config.base.js'
|
|
2
|
-
import globals from 'globals'
|
|
3
|
-
import tseslint from 'typescript-eslint'
|
|
4
|
-
// import quasar from 'eslint-config-quasar'
|
|
5
|
-
|
|
6
|
-
export default tseslint.config(
|
|
7
|
-
...baseConfig,
|
|
8
|
-
|
|
9
|
-
// TODO: enable these configs
|
|
10
|
-
// ...quasar.configs.base,
|
|
11
|
-
// ...quasar.configs.node,
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
name: 'custom/ignores',
|
|
15
|
-
|
|
16
|
-
ignores: [ 'test-project' ]
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
name: 'custom',
|
|
21
|
-
|
|
22
|
-
languageOptions: {
|
|
23
|
-
ecmaVersion: 'latest',
|
|
24
|
-
sourceType: 'module',
|
|
25
|
-
|
|
26
|
-
globals: {
|
|
27
|
-
...globals.node
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
name: 'custom/scripts',
|
|
34
|
-
|
|
35
|
-
files: [ './scripts/**/*.ts' ],
|
|
36
|
-
|
|
37
|
-
extends: [
|
|
38
|
-
...tseslint.configs.recommended
|
|
39
|
-
],
|
|
40
|
-
|
|
41
|
-
languageOptions: {
|
|
42
|
-
parserOptions: {
|
|
43
|
-
sourceType: 'module',
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
)
|
package/templates/app/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export async function script ({ scope, utils }) {
|
|
2
|
-
await utils.prompts(scope, [
|
|
3
|
-
{
|
|
4
|
-
type: 'select',
|
|
5
|
-
name: 'engine',
|
|
6
|
-
message: 'Pick Quasar App CLI variant:',
|
|
7
|
-
initial: 0,
|
|
8
|
-
choices: [
|
|
9
|
-
{ title: 'Quasar App CLI with Vite', value: 'vite-2', description: 'recommended' },
|
|
10
|
-
{ title: 'Quasar App CLI with Webpack', value: 'webpack-4' }
|
|
11
|
-
]
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
type: 'text',
|
|
15
|
-
name: 'name',
|
|
16
|
-
message: 'Package name:',
|
|
17
|
-
initial: () => utils.inferPackageName(scope.projectFolderName),
|
|
18
|
-
validate: (val) =>
|
|
19
|
-
utils.isValidPackageName(val) || 'Invalid package.json name'
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
utils.commonPrompts.productName,
|
|
23
|
-
utils.commonPrompts.description,
|
|
24
|
-
])
|
|
25
|
-
|
|
26
|
-
await utils.injectAuthor(scope)
|
|
27
|
-
|
|
28
|
-
await utils.prompts(scope, [
|
|
29
|
-
{
|
|
30
|
-
type: 'select',
|
|
31
|
-
name: 'sfcStyle',
|
|
32
|
-
message: 'Pick a Vue component style:',
|
|
33
|
-
initial: 0,
|
|
34
|
-
choices: [
|
|
35
|
-
{ title: 'Composition API with <script setup>', value: 'composition-setup', description: 'recommended' },
|
|
36
|
-
{ title: 'Composition API', value: 'composition', description: 'recommended' },
|
|
37
|
-
{ title: 'Options API', value: 'options' }
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
type: 'select',
|
|
43
|
-
name: 'css',
|
|
44
|
-
message: 'Pick your CSS preprocessor:',
|
|
45
|
-
initial: 0,
|
|
46
|
-
choices: [
|
|
47
|
-
{ title: 'Sass with SCSS syntax', value: 'scss' },
|
|
48
|
-
{ title: 'Sass with indented syntax', value: 'sass' },
|
|
49
|
-
{ title: 'None (the others will still be available)', value: 'css' }
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
])
|
|
53
|
-
|
|
54
|
-
const { script } = await import(`./${ scope.scriptType }-${ scope.engine }/index.js`)
|
|
55
|
-
await script({ scope, utils })
|
|
56
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineBoot } from '#q-app/wrappers'
|
|
2
|
-
import axios from 'axios'
|
|
3
|
-
|
|
4
|
-
// Be careful when using SSR for cross-request state pollution
|
|
5
|
-
// due to creating a Singleton instance here;
|
|
6
|
-
// If any client changes this (global) instance, it might be a
|
|
7
|
-
// good idea to move this instance creation inside of the
|
|
8
|
-
// "export default () => {}" function below (which runs individually
|
|
9
|
-
// for each client)
|
|
10
|
-
const api = axios.create({ baseURL: 'https://api.example.com' })
|
|
11
|
-
|
|
12
|
-
export default defineBoot(({ app }) => {
|
|
13
|
-
// for use inside Vue files (Options API) through this.$axios and this.$api
|
|
14
|
-
|
|
15
|
-
app.config.globalProperties.$axios = axios
|
|
16
|
-
// ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form)
|
|
17
|
-
// so you won't necessarily have to import axios in each vue file
|
|
18
|
-
|
|
19
|
-
app.config.globalProperties.$api = api
|
|
20
|
-
// ^ ^ ^ this will allow you to use this.$api (for Vue Options API form)
|
|
21
|
-
// so you can easily perform requests against your app's API
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
export { api }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// app global css in SCSS form
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Quasar SCSS (& Sass) Variables
|
|
2
|
-
// --------------------------------------------------
|
|
3
|
-
// To customize the look and feel of this app, you can override
|
|
4
|
-
// the Sass/SCSS variables found in Quasar's source Sass/SCSS files.
|
|
5
|
-
|
|
6
|
-
// Check documentation for full list of Quasar variables
|
|
7
|
-
|
|
8
|
-
// Your own variables (that are declared here) and Quasar's own
|
|
9
|
-
// ones will be available out of the box in your .vue/.scss/.sass files
|
|
10
|
-
|
|
11
|
-
// It's highly recommended to change the default colors
|
|
12
|
-
// to match your app's branding.
|
|
13
|
-
// Tip: Use the "Theme Builder" on Quasar's documentation website.
|
|
14
|
-
|
|
15
|
-
$primary : #1976D2;
|
|
16
|
-
$secondary : #26A69A;
|
|
17
|
-
$accent : #9C27B0;
|
|
18
|
-
|
|
19
|
-
$dark : #1D1D1D;
|
|
20
|
-
$dark-page : #121212;
|
|
21
|
-
|
|
22
|
-
$positive : #21BA45;
|
|
23
|
-
$negative : #C10015;
|
|
24
|
-
$info : #31CCEC;
|
|
25
|
-
$warning : #F2C037;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineBoot } from '#q-app/wrappers'
|
|
2
|
-
import axios from 'axios'
|
|
3
|
-
|
|
4
|
-
// Be careful when using SSR for cross-request state pollution
|
|
5
|
-
// due to creating a Singleton instance here;
|
|
6
|
-
// If any client changes this (global) instance, it might be a
|
|
7
|
-
// good idea to move this instance creation inside of the
|
|
8
|
-
// "export default () => {}" function below (which runs individually
|
|
9
|
-
// for each client)
|
|
10
|
-
const api = axios.create({ baseURL: 'https://api.example.com' })
|
|
11
|
-
|
|
12
|
-
export default defineBoot(({ app }) => {
|
|
13
|
-
// for use inside Vue files (Options API) through this.$axios and this.$api
|
|
14
|
-
|
|
15
|
-
app.config.globalProperties.$axios = axios
|
|
16
|
-
// ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form)
|
|
17
|
-
// so you won't necessarily have to import axios in each vue file
|
|
18
|
-
|
|
19
|
-
app.config.globalProperties.$api = api
|
|
20
|
-
// ^ ^ ^ this will allow you to use this.$api (for Vue Options API form)
|
|
21
|
-
// so you can easily perform requests against your app's API
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
export { api }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// app global css in SCSS form
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Quasar SCSS (& Sass) Variables
|
|
2
|
-
// --------------------------------------------------
|
|
3
|
-
// To customize the look and feel of this app, you can override
|
|
4
|
-
// the Sass/SCSS variables found in Quasar's source Sass/SCSS files.
|
|
5
|
-
|
|
6
|
-
// Check documentation for full list of Quasar variables
|
|
7
|
-
|
|
8
|
-
// Your own variables (that are declared here) and Quasar's own
|
|
9
|
-
// ones will be available out of the box in your .vue/.scss/.sass files
|
|
10
|
-
|
|
11
|
-
// It's highly recommended to change the default colors
|
|
12
|
-
// to match your app's branding.
|
|
13
|
-
// Tip: Use the "Theme Builder" on Quasar's documentation website.
|
|
14
|
-
|
|
15
|
-
$primary : #1976D2;
|
|
16
|
-
$secondary : #26A69A;
|
|
17
|
-
$accent : #9C27B0;
|
|
18
|
-
|
|
19
|
-
$dark : #1D1D1D;
|
|
20
|
-
$dark-page : #121212;
|
|
21
|
-
|
|
22
|
-
$positive : #21BA45;
|
|
23
|
-
$negative : #C10015;
|
|
24
|
-
$info : #31CCEC;
|
|
25
|
-
$warning : #F2C037;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { defineBoot } from '#q-app/wrappers';
|
|
2
|
-
import axios, { type AxiosInstance } from 'axios';
|
|
3
|
-
|
|
4
|
-
declare module 'vue' {
|
|
5
|
-
interface ComponentCustomProperties {
|
|
6
|
-
$axios: AxiosInstance;
|
|
7
|
-
$api: AxiosInstance;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Be careful when using SSR for cross-request state pollution
|
|
12
|
-
// due to creating a Singleton instance here;
|
|
13
|
-
// If any client changes this (global) instance, it might be a
|
|
14
|
-
// good idea to move this instance creation inside of the
|
|
15
|
-
// "export default () => {}" function below (which runs individually
|
|
16
|
-
// for each client)
|
|
17
|
-
const api = axios.create({ baseURL: 'https://api.example.com' });
|
|
18
|
-
|
|
19
|
-
export default defineBoot(({ app }) => {
|
|
20
|
-
// for use inside Vue files (Options API) through this.$axios and this.$api
|
|
21
|
-
|
|
22
|
-
app.config.globalProperties.$axios = axios;
|
|
23
|
-
// ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form)
|
|
24
|
-
// so you won't necessarily have to import axios in each vue file
|
|
25
|
-
|
|
26
|
-
app.config.globalProperties.$api = api;
|
|
27
|
-
// ^ ^ ^ this will allow you to use this.$api (for Vue Options API form)
|
|
28
|
-
// so you can easily perform requests against your app's API
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export { api };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// app global css in SCSS form
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Quasar SCSS (& Sass) Variables
|
|
2
|
-
// --------------------------------------------------
|
|
3
|
-
// To customize the look and feel of this app, you can override
|
|
4
|
-
// the Sass/SCSS variables found in Quasar's source Sass/SCSS files.
|
|
5
|
-
|
|
6
|
-
// Check documentation for full list of Quasar variables
|
|
7
|
-
|
|
8
|
-
// Your own variables (that are declared here) and Quasar's own
|
|
9
|
-
// ones will be available out of the box in your .vue/.scss/.sass files
|
|
10
|
-
|
|
11
|
-
// It's highly recommended to change the default colors
|
|
12
|
-
// to match your app's branding.
|
|
13
|
-
// Tip: Use the "Theme Builder" on Quasar's documentation website.
|
|
14
|
-
|
|
15
|
-
$primary : #1976D2;
|
|
16
|
-
$secondary : #26A69A;
|
|
17
|
-
$accent : #9C27B0;
|
|
18
|
-
|
|
19
|
-
$dark : #1D1D1D;
|
|
20
|
-
$dark-page : #121212;
|
|
21
|
-
|
|
22
|
-
$positive : #21BA45;
|
|
23
|
-
$negative : #C10015;
|
|
24
|
-
$info : #31CCEC;
|
|
25
|
-
$warning : #F2C037;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { defineBoot } from '#q-app/wrappers';
|
|
2
|
-
import axios, { type AxiosInstance } from 'axios';
|
|
3
|
-
|
|
4
|
-
declare module 'vue' {
|
|
5
|
-
interface ComponentCustomProperties {
|
|
6
|
-
$axios: AxiosInstance;
|
|
7
|
-
$api: AxiosInstance;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Be careful when using SSR for cross-request state pollution
|
|
12
|
-
// due to creating a Singleton instance here;
|
|
13
|
-
// If any client changes this (global) instance, it might be a
|
|
14
|
-
// good idea to move this instance creation inside of the
|
|
15
|
-
// "export default () => {}" function below (which runs individually
|
|
16
|
-
// for each client)
|
|
17
|
-
const api = axios.create({ baseURL: 'https://api.example.com' });
|
|
18
|
-
|
|
19
|
-
export default defineBoot(({ app }) => {
|
|
20
|
-
// for use inside Vue files (Options API) through this.$axios and this.$api
|
|
21
|
-
|
|
22
|
-
app.config.globalProperties.$axios = axios;
|
|
23
|
-
// ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form)
|
|
24
|
-
// so you won't necessarily have to import axios in each vue file
|
|
25
|
-
|
|
26
|
-
app.config.globalProperties.$api = api;
|
|
27
|
-
// ^ ^ ^ this will allow you to use this.$api (for Vue Options API form)
|
|
28
|
-
// so you can easily perform requests against your app's API
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export { api };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// app global css in SCSS form
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Quasar SCSS (& Sass) Variables
|
|
2
|
-
// --------------------------------------------------
|
|
3
|
-
// To customize the look and feel of this app, you can override
|
|
4
|
-
// the Sass/SCSS variables found in Quasar's source Sass/SCSS files.
|
|
5
|
-
|
|
6
|
-
// Check documentation for full list of Quasar variables
|
|
7
|
-
|
|
8
|
-
// Your own variables (that are declared here) and Quasar's own
|
|
9
|
-
// ones will be available out of the box in your .vue/.scss/.sass files
|
|
10
|
-
|
|
11
|
-
// It's highly recommended to change the default colors
|
|
12
|
-
// to match your app's branding.
|
|
13
|
-
// Tip: Use the "Theme Builder" on Quasar's documentation website.
|
|
14
|
-
|
|
15
|
-
$primary : #1976D2;
|
|
16
|
-
$secondary : #26A69A;
|
|
17
|
-
$accent : #9C27B0;
|
|
18
|
-
|
|
19
|
-
$dark : #1D1D1D;
|
|
20
|
-
$dark-page : #121212;
|
|
21
|
-
|
|
22
|
-
$positive : #21BA45;
|
|
23
|
-
$negative : #C10015;
|
|
24
|
-
$info : #31CCEC;
|
|
25
|
-
$warning : #F2C037;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export async function script ({ scope, utils }) {
|
|
2
|
-
/**
|
|
3
|
-
* Temporarily disable scriptType prompt (TS not ready yet)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// await utils.prompts(scope, [
|
|
7
|
-
// utils.commonPrompts.scriptType
|
|
8
|
-
// ])
|
|
9
|
-
|
|
10
|
-
// const { script } = await import(`./ae-${ scope.scriptType }/index.js`)
|
|
11
|
-
// await script({ scope, utils })
|
|
12
|
-
|
|
13
|
-
const { script } = await import('./ae-js/index.js')
|
|
14
|
-
await script({ scope, utils })
|
|
15
|
-
}
|
|
File without changes
|
|
File without changes
|