create-quasar 1.8.6 → 1.9.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
CHANGED
|
@@ -17,6 +17,16 @@ import utils from './utils/index.js'
|
|
|
17
17
|
// should error out if already inside of a Quasar project
|
|
18
18
|
utils.ensureOutsideProject()
|
|
19
19
|
|
|
20
|
+
import parseArgs from 'minimist'
|
|
21
|
+
|
|
22
|
+
const argv = parseArgs(process.argv.slice(2), {
|
|
23
|
+
alias: {
|
|
24
|
+
n: 'nogit',
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
boolean: [ 'n' ],
|
|
28
|
+
})
|
|
29
|
+
|
|
20
30
|
const defaultProjectFolder = 'quasar-project'
|
|
21
31
|
const scope = {}
|
|
22
32
|
|
|
@@ -72,6 +82,21 @@ console.log()
|
|
|
72
82
|
utils.logger.success('The project has been scaffolded')
|
|
73
83
|
console.log()
|
|
74
84
|
|
|
85
|
+
function finalize () {
|
|
86
|
+
if (scope.projectFolder) {
|
|
87
|
+
console.log()
|
|
88
|
+
|
|
89
|
+
if (argv.nogit) {
|
|
90
|
+
utils.logger.log('Skipping git initialization as --nogit flag was provided')
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
utils.initializeGit(scope.projectFolder)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
utils.printFinalMessage(scope)
|
|
98
|
+
}
|
|
99
|
+
|
|
75
100
|
if (scope.skipDepsInstall !== true) {
|
|
76
101
|
await utils.prompts(scope, [
|
|
77
102
|
{
|
|
@@ -97,7 +122,7 @@ if (scope.skipDepsInstall !== true) {
|
|
|
97
122
|
], {
|
|
98
123
|
onCancel: () => {
|
|
99
124
|
scope.packageManager = false
|
|
100
|
-
|
|
125
|
+
finalize()
|
|
101
126
|
process.exit(0)
|
|
102
127
|
}
|
|
103
128
|
})
|
|
@@ -109,7 +134,7 @@ if (scope.skipDepsInstall !== true) {
|
|
|
109
134
|
catch {
|
|
110
135
|
utils.logger.warn('Could not auto install dependencies. Probably a temporary npm registry issue?')
|
|
111
136
|
scope.packageManager = false
|
|
112
|
-
|
|
137
|
+
finalize()
|
|
113
138
|
process.exit(0)
|
|
114
139
|
}
|
|
115
140
|
|
|
@@ -124,4 +149,4 @@ if (scope.skipDepsInstall !== true) {
|
|
|
124
149
|
}
|
|
125
150
|
}
|
|
126
151
|
|
|
127
|
-
|
|
152
|
+
finalize()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-quasar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Scaffolds Quasar Apps, AppExtensions or UI kits",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"fs-extra": "^11.2.0",
|
|
36
36
|
"kolorist": "^1.5.1",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
38
|
+
"minimist": "^1.2.8",
|
|
38
39
|
"prompts": "^2.4.2"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
<% if (preset.lint) { %>
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
30
|
-
"@typescript-eslint/parser": "^
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
30
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
31
31
|
"eslint": "^8.57.0",
|
|
32
32
|
"eslint-plugin-vue": "^9.0.0",
|
|
33
33
|
<% if (lintConfig === 'standard') { %>
|
|
@@ -45,6 +45,20 @@
|
|
|
45
45
|
"@types/node": "^12.20.21",
|
|
46
46
|
"@quasar/app-webpack": "^3.13.0"
|
|
47
47
|
},
|
|
48
|
+
"overridesComments": {
|
|
49
|
+
"typescript-1": "npm and pnpm hoist newer version of TypeScript, which is incompatible with app-webpack v3 due to fork-ts-checker-webpack-plugin",
|
|
50
|
+
"typescript-2": "this hoisting of newer version of TypeScript breaks linting performed by @typescript-eslint packages",
|
|
51
|
+
"typescript-3": "yarn hoists the correct version of TypeScript, so we don't need to add a resolutions field",
|
|
52
|
+
"typescript-4": "app-webpack v4 doesn't use fork-ts-checker-webpack-plugin and thus supports newer versions of TypeScript"
|
|
53
|
+
},
|
|
54
|
+
"overrides": {
|
|
55
|
+
"typescript": "^4.9.5"
|
|
56
|
+
},
|
|
57
|
+
"pnpm": {
|
|
58
|
+
"overrides": {
|
|
59
|
+
"typescript": "^4.9.5"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
48
62
|
"browserslist": [
|
|
49
63
|
"last 10 Chrome versions",
|
|
50
64
|
"last 10 Firefox versions",
|
package/utils/index.js
CHANGED
|
@@ -90,6 +90,7 @@ function renderTemplate (relativePath, scope) {
|
|
|
90
90
|
const template = compileTemplate(rawContent, { interpolate: /<%=([\s\S]+?)%>/g })
|
|
91
91
|
|
|
92
92
|
const newContent = extension === '.json'
|
|
93
|
+
// This prevents us to add comments into JSONC files, like tsconfig ones
|
|
93
94
|
? JSON.stringify(JSON.parse(template(scope)), null, 2)
|
|
94
95
|
: template(scope)
|
|
95
96
|
|
|
@@ -144,25 +145,25 @@ function getGitUser () {
|
|
|
144
145
|
function printFinalMessage (scope) {
|
|
145
146
|
const verPrefix = scope.quasarVersion ? scope.quasarVersion + '.' : ''
|
|
146
147
|
const message = `
|
|
147
|
-
To get started:
|
|
148
|
-
${ yellow(`
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
`) }
|
|
154
|
-
Documentation can be found at: https://${ verPrefix }quasar.dev
|
|
155
|
-
|
|
156
|
-
Quasar is relying on donations to evolve. We'd be very grateful if you can
|
|
157
|
-
read our manifest on "Why donations are important": https://${ verPrefix }quasar.dev/why-donate
|
|
158
|
-
Donation campaign: https://donate.quasar.dev
|
|
159
|
-
Any amount is very welcome.
|
|
160
|
-
If invoices are required, please first contact Razvan Stoenescu.
|
|
161
|
-
|
|
162
|
-
Please give us a star on Github if you appreciate our work:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
Enjoy! - Quasar Team
|
|
148
|
+
To get started:
|
|
149
|
+
${ yellow(`
|
|
150
|
+
cd ${ scope.projectFolderName }${ scope.skipDepsInstall !== true && scope.packageManager === false ? `
|
|
151
|
+
yarn #or: npm install
|
|
152
|
+
yarn lint --fix # or: npm run lint -- --fix` : '' }${ scope.skipDepsInstall !== true ? `
|
|
153
|
+
quasar dev # or: yarn quasar dev # or: npx quasar dev` : '' }
|
|
154
|
+
`) }
|
|
155
|
+
Documentation can be found at: https://${ verPrefix }quasar.dev
|
|
156
|
+
|
|
157
|
+
Quasar is relying on donations to evolve. We'd be very grateful if you can
|
|
158
|
+
read our manifest on "Why donations are important": https://${ verPrefix }quasar.dev/why-donate
|
|
159
|
+
Donation campaign: https://donate.quasar.dev
|
|
160
|
+
Any amount is very welcome.
|
|
161
|
+
If invoices are required, please first contact Razvan Stoenescu.
|
|
162
|
+
|
|
163
|
+
Please give us a star on Github if you appreciate our work:
|
|
164
|
+
https://github.com/quasarframework/quasar
|
|
165
|
+
|
|
166
|
+
Enjoy! - Quasar Team
|
|
166
167
|
`
|
|
167
168
|
|
|
168
169
|
console.log(message)
|
|
@@ -221,6 +222,46 @@ function lintFolder (scope) {
|
|
|
221
222
|
)
|
|
222
223
|
}
|
|
223
224
|
|
|
225
|
+
function hasGit () {
|
|
226
|
+
try {
|
|
227
|
+
exec('git --version')
|
|
228
|
+
return true
|
|
229
|
+
}
|
|
230
|
+
catch (_) {}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function folderHasGit (cwd) {
|
|
234
|
+
try {
|
|
235
|
+
exec('git status', { stdio: 'ignore', cwd })
|
|
236
|
+
return true
|
|
237
|
+
}
|
|
238
|
+
catch (_) {}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function initializeGit (projectFolder) {
|
|
242
|
+
if (hasGit() !== true) {
|
|
243
|
+
logger.log('Git is not installed on the system, so skipping Git repo initialization.')
|
|
244
|
+
return
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (folderHasGit(projectFolder) === true) {
|
|
248
|
+
logger.log('A parent of the project folder is already a Git repository, so skipping Git initialization.')
|
|
249
|
+
return
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
try {
|
|
253
|
+
exec('git init', { cwd: projectFolder })
|
|
254
|
+
exec('git add -A', { cwd: projectFolder })
|
|
255
|
+
exec('git commit -m "Initialize the project 🚀" --no-verify', { cwd: projectFolder })
|
|
256
|
+
}
|
|
257
|
+
catch (e) {
|
|
258
|
+
logger.warn('Could not initialize Git repository. Please do this manually.')
|
|
259
|
+
return
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
logger.log('Initialized Git repository 🚀')
|
|
263
|
+
}
|
|
264
|
+
|
|
224
265
|
const quasarConfigFilenameList = [
|
|
225
266
|
'quasar.config.js',
|
|
226
267
|
'quasar.config.mjs',
|
|
@@ -341,6 +382,7 @@ export default {
|
|
|
341
382
|
installDeps,
|
|
342
383
|
lintFolder,
|
|
343
384
|
ensureOutsideProject,
|
|
385
|
+
initializeGit,
|
|
344
386
|
|
|
345
387
|
commonPrompts
|
|
346
388
|
}
|
|
File without changes
|