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/.eslintrc.cjs
CHANGED
package/index.js
CHANGED
|
@@ -1,131 +1,127 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { readFileSync, readdirSync, existsSync } from 'node:fs'
|
|
4
|
+
import { join } from 'node:path'
|
|
4
5
|
|
|
5
6
|
// display banner
|
|
6
7
|
console.log()
|
|
7
8
|
console.log(
|
|
8
9
|
readFileSync(
|
|
9
|
-
|
|
10
|
+
new URL('./assets/logo.art', import.meta.url),
|
|
10
11
|
'utf8'
|
|
11
12
|
)
|
|
12
13
|
)
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
import utils from './utils/index.js'
|
|
15
16
|
|
|
16
17
|
// should error out if already inside of a Quasar project
|
|
17
18
|
utils.ensureOutsideProject()
|
|
18
19
|
|
|
19
20
|
const defaultProjectFolder = 'quasar-project'
|
|
21
|
+
const scope = {}
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
23
|
+
await utils.prompts(scope, [
|
|
24
|
+
{
|
|
25
|
+
type: 'select',
|
|
26
|
+
name: 'projectType',
|
|
27
|
+
initial: 0,
|
|
28
|
+
message: 'What would you like to build?',
|
|
29
|
+
choices: [
|
|
30
|
+
{ title: 'App with Quasar CLI, let\'s go!', value: 'app', description: 'spa/pwa/ssr/bex/electron/capacitor/cordova' },
|
|
31
|
+
{ title: 'AppExtension (AE) for Quasar CLI', value: 'app-extension', description: 'Quasar CLI AE' },
|
|
32
|
+
{ title: 'Quasar UI kit', value: 'ui-kit', description: 'Vue component and/or directive' }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: 'text',
|
|
37
|
+
name: 'projectFolder',
|
|
38
|
+
message: 'Project folder:',
|
|
39
|
+
initial: defaultProjectFolder,
|
|
40
|
+
format: val => {
|
|
41
|
+
const name = (val && val.trim()) || defaultProjectFolder
|
|
42
|
+
// inject the "short" name
|
|
43
|
+
scope.projectFolderName = name
|
|
44
|
+
return join(process.cwd(), name)
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: (_, { projectFolder }) =>
|
|
49
|
+
(!existsSync(projectFolder) || readdirSync(projectFolder).length === 0 ? null : 'confirm'),
|
|
50
|
+
name: 'overwrite',
|
|
51
|
+
message: () =>
|
|
52
|
+
(scope.projectFolderName === '.'
|
|
53
|
+
? 'Current directory'
|
|
54
|
+
: `Target directory "${ scope.projectFolderName }"`)
|
|
55
|
+
+ ' is not empty. Remove existing files and continue?'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: (_, { overwrite } = {}) => {
|
|
59
|
+
if (overwrite === false) {
|
|
60
|
+
utils.logger.fatal('Scaffolding cancelled')
|
|
46
61
|
}
|
|
62
|
+
return null
|
|
47
63
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
name: 'overwrite',
|
|
52
|
-
message: () =>
|
|
53
|
-
(scope.projectFolderName === '.'
|
|
54
|
-
? 'Current directory'
|
|
55
|
-
: `Target directory "${scope.projectFolderName}"`) +
|
|
56
|
-
` is not empty. Remove existing files and continue?`
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
type: (_, { overwrite } = {}) => {
|
|
60
|
-
if (overwrite === false) {
|
|
61
|
-
utils.logger.fatal('Scaffolding cancelled')
|
|
62
|
-
}
|
|
63
|
-
return null
|
|
64
|
-
},
|
|
65
|
-
name: 'overwriteConfirmation'
|
|
66
|
-
}
|
|
67
|
-
])
|
|
64
|
+
name: 'overwriteConfirmation'
|
|
65
|
+
}
|
|
66
|
+
])
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
const { script } = await import(`./templates/${ scope.projectType }/index.js`)
|
|
69
|
+
await script({ scope, utils })
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
console.log()
|
|
72
|
+
utils.logger.success('The project has been scaffolded')
|
|
73
|
+
console.log()
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
{ title: `Yes, use ${utils.runningPackageManager}`, value: utils.runningPackageManager },
|
|
75
|
+
if (scope.skipDepsInstall !== true) {
|
|
76
|
+
await utils.prompts(scope, [
|
|
77
|
+
{
|
|
78
|
+
type: 'select',
|
|
79
|
+
name: 'packageManager',
|
|
80
|
+
message:
|
|
81
|
+
'Install project dependencies? (recommended)',
|
|
82
|
+
choices: () => (
|
|
83
|
+
utils.runningPackageManager
|
|
84
|
+
? [
|
|
85
|
+
{ title: `Yes, use ${ utils.runningPackageManager }`, value: utils.runningPackageManager },
|
|
87
86
|
{ title: 'No, I will handle that myself', value: false }
|
|
88
87
|
]
|
|
89
|
-
|
|
88
|
+
: [
|
|
90
89
|
{ title: 'Yes, use Yarn (recommended)', value: 'yarn' },
|
|
91
90
|
{ title: 'Yes, use NPM', value: 'npm' },
|
|
92
91
|
{ title: 'Yes, use PNPM (experimental support)', value: 'pnpm' },
|
|
93
92
|
{ title: 'Yes, use Bun (experimental support)', value: 'bun' },
|
|
94
93
|
{ title: 'No, I will handle that myself', value: false }
|
|
95
94
|
]
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
], {
|
|
98
|
+
onCancel: () => {
|
|
99
|
+
scope.packageManager = false
|
|
100
|
+
utils.printFinalMessage(scope)
|
|
101
|
+
process.exit(0)
|
|
102
|
+
}
|
|
103
|
+
})
|
|
105
104
|
|
|
106
|
-
|
|
105
|
+
if (scope.packageManager !== false) {
|
|
106
|
+
try {
|
|
107
|
+
await utils.installDeps(scope)
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
utils.logger.warn('Could not auto install dependencies. Probably a temporary npm registry issue?')
|
|
111
|
+
scope.packageManager = false
|
|
112
|
+
utils.printFinalMessage(scope)
|
|
113
|
+
process.exit(0)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (scope.preset.lint) {
|
|
107
117
|
try {
|
|
108
|
-
await utils.
|
|
118
|
+
await utils.lintFolder(scope)
|
|
109
119
|
}
|
|
110
120
|
catch {
|
|
111
|
-
utils.logger.warn('Could not auto
|
|
112
|
-
scope.packageManager = false
|
|
113
|
-
utils.printFinalMessage(scope)
|
|
114
|
-
process.exit(0)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (scope.preset.lint) {
|
|
118
|
-
try {
|
|
119
|
-
await utils.lintFolder(scope)
|
|
120
|
-
}
|
|
121
|
-
catch {
|
|
122
|
-
utils.logger.warn('Could not auto lint fix the project folder.')
|
|
123
|
-
}
|
|
121
|
+
utils.logger.warn('Could not auto lint fix the project folder.')
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
124
|
}
|
|
127
|
-
|
|
128
|
-
utils.printFinalMessage(scope)
|
|
129
125
|
}
|
|
130
126
|
|
|
131
|
-
|
|
127
|
+
utils.printFinalMessage(scope)
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-quasar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Scaffolds Quasar Apps, AppExtensions or UI kits",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "Razvan Stoenescu",
|
|
7
8
|
"email": "razvan.stoenescu@gmail.com",
|
|
@@ -23,26 +24,26 @@
|
|
|
23
24
|
"url": "https://donate.quasar.dev"
|
|
24
25
|
},
|
|
25
26
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
27
|
+
"node": ">=16"
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
29
30
|
"lint": "eslint --ext .js,.ts ./ --fix",
|
|
30
31
|
"create-test-project": "tsx scripts/create-test-project.ts"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"fast-glob": "^3.2
|
|
34
|
-
"fs-extra": "^
|
|
34
|
+
"fast-glob": "^3.3.2",
|
|
35
|
+
"fs-extra": "^11.2.0",
|
|
35
36
|
"kolorist": "^1.5.1",
|
|
36
37
|
"lodash": "^4.17.21",
|
|
37
38
|
"prompts": "^2.4.2"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@types/lodash": "^4.
|
|
41
|
+
"@types/lodash": "^4.14.202",
|
|
41
42
|
"@types/prompts": "^2.4.7",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
43
|
-
"@typescript-eslint/parser": "^
|
|
44
|
-
"eslint": "^8.
|
|
45
|
-
"eslint-plugin-lodash-template": "^0.
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
44
|
+
"@typescript-eslint/parser": "^7.1.0",
|
|
45
|
+
"eslint": "^8.57.0",
|
|
46
|
+
"eslint-plugin-lodash-template": "^1.0.0",
|
|
46
47
|
"tsx": "^4.7.0",
|
|
47
48
|
"typescript": "^5.2.2"
|
|
48
49
|
}
|
package/templates/app/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
module.exports = async function ({ scope, utils }) {
|
|
1
|
+
export async function script ({ scope, utils }) {
|
|
3
2
|
await utils.prompts(scope, [
|
|
4
3
|
utils.commonPrompts.quasarVersion,
|
|
5
4
|
utils.commonPrompts.scriptType
|
|
6
5
|
])
|
|
7
6
|
|
|
8
|
-
const script =
|
|
7
|
+
const { script } = await import(`./quasar-${ scope.quasarVersion }/index.js`)
|
|
9
8
|
await script({ scope, utils })
|
|
10
9
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
module.exports = async function ({ scope, utils }) {
|
|
1
|
+
export async function script ({ scope, utils }) {
|
|
3
2
|
await utils.prompts(scope, [
|
|
4
3
|
{
|
|
5
4
|
type: 'text',
|
|
@@ -14,6 +13,6 @@ module.exports = async function ({ scope, utils }) {
|
|
|
14
13
|
utils.commonPrompts.author
|
|
15
14
|
])
|
|
16
15
|
|
|
17
|
-
const script =
|
|
16
|
+
const { script } = await import(`./${ scope.scriptType }/index.js`)
|
|
18
17
|
await script({ scope, utils })
|
|
19
18
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
module.exports = async function ({ scope, utils }) {
|
|
1
|
+
export async function script ({ scope, utils }) {
|
|
3
2
|
await utils.prompts(scope, [
|
|
4
3
|
{
|
|
5
4
|
type: 'select',
|
|
@@ -43,7 +42,7 @@ module.exports = async function ({ scope, utils }) {
|
|
|
43
42
|
format: utils.convertArrayToObject
|
|
44
43
|
},
|
|
45
44
|
{
|
|
46
|
-
type: (_, { preset }) => preset.lint ? 'select' : null,
|
|
45
|
+
type: (_, { preset }) => (preset.lint ? 'select' : null),
|
|
47
46
|
name: 'lintConfig',
|
|
48
47
|
message: 'Pick an ESLint preset:',
|
|
49
48
|
choices: [
|
|
@@ -55,11 +54,11 @@ module.exports = async function ({ scope, utils }) {
|
|
|
55
54
|
])
|
|
56
55
|
|
|
57
56
|
utils.createTargetDir(scope)
|
|
58
|
-
utils.renderTemplate(utils.join(
|
|
59
|
-
utils.renderTemplate(utils.join(
|
|
57
|
+
utils.renderTemplate(utils.join(import.meta.url, 'BASE'), scope)
|
|
58
|
+
utils.renderTemplate(utils.join(import.meta.url, scope.css), scope)
|
|
60
59
|
|
|
61
|
-
if (scope.preset.axios) utils.renderTemplate(utils.join(
|
|
62
|
-
if (scope.preset.i18n) utils.renderTemplate(utils.join(
|
|
63
|
-
if (scope.preset.vuex) utils.renderTemplate(utils.join(
|
|
64
|
-
if (scope.preset.lint) utils.renderTemplate(utils.join(
|
|
60
|
+
if (scope.preset.axios) utils.renderTemplate(utils.join(import.meta.url, 'axios'), scope)
|
|
61
|
+
if (scope.preset.i18n) utils.renderTemplate(utils.join(import.meta.url, 'i18n'), scope)
|
|
62
|
+
if (scope.preset.vuex) utils.renderTemplate(utils.join(import.meta.url, 'vuex'), scope)
|
|
63
|
+
if (scope.preset.lint) utils.renderTemplate(utils.join(import.meta.url, 'lint'), scope)
|
|
65
64
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
module.exports = {
|
|
3
2
|
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
|
|
4
3
|
// This option interrupts the configuration hierarchy at this file
|
|
@@ -29,8 +28,10 @@ module.exports = {
|
|
|
29
28
|
// 'plugin:vue/recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
|
|
30
29
|
|
|
31
30
|
<% if (lintConfig === 'standard') { %>'standard'
|
|
32
|
-
<% }
|
|
33
|
-
|
|
31
|
+
<% }
|
|
32
|
+
else if (lintConfig === 'airbnb') { %>'airbnb-base'
|
|
33
|
+
<% }
|
|
34
|
+
else if (lintConfig === 'prettier') { %>// https://github.com/prettier/eslint-config-prettier#installation
|
|
34
35
|
// usage with Prettier, provided by 'eslint-config-prettier'.
|
|
35
36
|
'prettier'<% } %>
|
|
36
37
|
],
|
|
@@ -74,7 +75,8 @@ module.exports = {
|
|
|
74
75
|
'import/extensions': 'off',
|
|
75
76
|
'import/no-unresolved': 'off',
|
|
76
77
|
'import/no-extraneous-dependencies': 'off',
|
|
77
|
-
<% }
|
|
78
|
+
<% }
|
|
79
|
+
else if (lintConfig === 'airbnb') { %>
|
|
78
80
|
'no-param-reassign': 'off',
|
|
79
81
|
'no-void': 'off',
|
|
80
82
|
'no-nested-ternary': 'off',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
module.exports = async function ({ scope, utils }) {
|
|
1
|
+
export async function script ({ scope, utils }) {
|
|
3
2
|
await utils.prompts(scope, [
|
|
4
3
|
{
|
|
5
4
|
type: 'select',
|
|
@@ -54,7 +53,7 @@ module.exports = async function ({ scope, utils }) {
|
|
|
54
53
|
format: utils.convertArrayToObject
|
|
55
54
|
},
|
|
56
55
|
{
|
|
57
|
-
type: (_, { preset }) => preset.lint ? 'select' : null,
|
|
56
|
+
type: (_, { preset }) => (preset.lint ? 'select' : null),
|
|
58
57
|
name: 'lintConfig',
|
|
59
58
|
message: 'Pick an ESLint preset:',
|
|
60
59
|
choices: [
|
|
@@ -66,11 +65,11 @@ module.exports = async function ({ scope, utils }) {
|
|
|
66
65
|
])
|
|
67
66
|
|
|
68
67
|
utils.createTargetDir(scope)
|
|
69
|
-
utils.renderTemplate(utils.join(
|
|
70
|
-
utils.renderTemplate(utils.join(
|
|
68
|
+
utils.renderTemplate(utils.join(import.meta.url, 'BASE'), scope)
|
|
69
|
+
utils.renderTemplate(utils.join(import.meta.url, scope.css), scope)
|
|
71
70
|
|
|
72
|
-
if (scope.preset.axios) utils.renderTemplate(utils.join(
|
|
73
|
-
if (scope.preset.i18n) utils.renderTemplate(utils.join(
|
|
74
|
-
if (scope.preset.vuex) utils.renderTemplate(utils.join(
|
|
75
|
-
if (scope.preset.lint) utils.renderTemplate(utils.join(
|
|
71
|
+
if (scope.preset.axios) utils.renderTemplate(utils.join(import.meta.url, 'axios'), scope)
|
|
72
|
+
if (scope.preset.i18n) utils.renderTemplate(utils.join(import.meta.url, 'i18n'), scope)
|
|
73
|
+
if (scope.preset.vuex) utils.renderTemplate(utils.join(import.meta.url, 'vuex'), scope)
|
|
74
|
+
if (scope.preset.lint) utils.renderTemplate(utils.join(import.meta.url, 'lint'), scope)
|
|
76
75
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
module.exports = async function ({ scope, utils }) {
|
|
1
|
+
export async function script ({ scope, utils }) {
|
|
3
2
|
await utils.prompts(scope, [
|
|
4
3
|
{
|
|
5
4
|
type: 'select',
|
|
@@ -27,6 +26,6 @@ module.exports = async function ({ scope, utils }) {
|
|
|
27
26
|
utils.commonPrompts.author
|
|
28
27
|
])
|
|
29
28
|
|
|
30
|
-
const script =
|
|
29
|
+
const { script } = await import(`./${ scope.scriptType }-${ scope.engine }/index.js`)
|
|
31
30
|
await script({ scope, utils })
|
|
32
31
|
}
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
<% if (preset.lint) { %>
|
|
28
28
|
"eslint": "^8.11.0",
|
|
29
29
|
"eslint-plugin-vue": "^9.0.0",
|
|
30
|
+
"vite-plugin-checker": "^0.6.4",
|
|
30
31
|
<% if (lintConfig === 'standard') { %>
|
|
31
32
|
"eslint-config-standard": "^17.0.0",
|
|
32
33
|
"eslint-plugin-import": "^2.19.1",
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
"prettier": "^2.5.1",
|
|
41
42
|
<% } } %>
|
|
42
43
|
<% if (preset.i18n) { %>"@intlify/vite-plugin-vue-i18n": "^3.3.1",<% } %>
|
|
43
|
-
"@quasar/app-vite": "^1.
|
|
44
|
+
"@quasar/app-vite": "^1.8.0",
|
|
44
45
|
"autoprefixer": "^10.4.2",
|
|
45
46
|
"postcss": "^8.4.14"
|
|
46
47
|
},
|
|
@@ -15,15 +15,6 @@ const { configure } = require('quasar/wrappers');
|
|
|
15
15
|
|
|
16
16
|
module.exports = configure(function (/* ctx */) {
|
|
17
17
|
return {
|
|
18
|
-
<% if (preset.lint) { %>eslint: {
|
|
19
|
-
// fix: true,
|
|
20
|
-
// include: [],
|
|
21
|
-
// exclude: [],
|
|
22
|
-
// rawOptions: {},
|
|
23
|
-
warnings: true,
|
|
24
|
-
errors: true
|
|
25
|
-
},<% } %>
|
|
26
|
-
|
|
27
18
|
// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
|
|
28
19
|
// preFetch: true,
|
|
29
20
|
|
|
@@ -80,7 +71,7 @@ module.exports = configure(function (/* ctx */) {
|
|
|
80
71
|
// extendViteConf (viteConf) {},
|
|
81
72
|
// viteVuePluginOptions: {},
|
|
82
73
|
|
|
83
|
-
<% if (preset.i18n) { %>vitePlugins: [
|
|
74
|
+
<% if (preset.i18n || preset.lint) { %>vitePlugins: [<% if (preset.i18n) { %>
|
|
84
75
|
['@intlify/vite-plugin-vue-i18n', {
|
|
85
76
|
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
|
|
86
77
|
// compositionOnly: false,
|
|
@@ -91,10 +82,15 @@ module.exports = configure(function (/* ctx */) {
|
|
|
91
82
|
|
|
92
83
|
// you need to set i18n resource including paths !
|
|
93
84
|
include: path.resolve(__dirname, './src/i18n/**')
|
|
94
|
-
}]
|
|
85
|
+
}]<% } %><% if (preset.lint) { %><% if (preset.i18n) { %>,<% } %>
|
|
86
|
+
['vite-plugin-checker', {
|
|
87
|
+
eslint: {
|
|
88
|
+
lintCommand: 'eslint "./**/*.{js,mjs,cjs,vue}"'
|
|
89
|
+
}
|
|
90
|
+
}, { server: false }]<% } %>
|
|
95
91
|
]<% } else { %>
|
|
96
92
|
// vitePlugins: [
|
|
97
|
-
// [ 'package-name', { ..
|
|
93
|
+
// [ 'package-name', { ..pluginOptions.. }, { server: true, client: true } ]
|
|
98
94
|
// ]<% } %>
|
|
99
95
|
},
|
|
100
96
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
module.exports = async function ({ scope, utils }) {
|
|
1
|
+
export async function script ({ scope, utils }) {
|
|
3
2
|
await utils.prompts(scope, [
|
|
4
3
|
{
|
|
5
4
|
type: 'select',
|
|
@@ -17,11 +16,11 @@ module.exports = async function ({ scope, utils }) {
|
|
|
17
16
|
name: 'preset',
|
|
18
17
|
message: 'Check the features needed for your project:',
|
|
19
18
|
choices: [
|
|
20
|
-
{ title: 'ESLint', value: 'lint', description: 'recommended', selected: true },
|
|
19
|
+
{ title: 'Linting (vite-plugin-checker + ESLint)', value: 'lint', description: 'recommended', selected: true },
|
|
21
20
|
{ title: 'State Management (Pinia)', value: 'pinia', description: 'https://pinia.vuejs.org' },
|
|
22
21
|
{ title: 'State Management (Vuex) [DEPRECATED by Vue Team]', value: 'vuex', description: 'See https://vuejs.org/guide/scaling-up/state-management.html#pinia' },
|
|
23
|
-
{ title: '
|
|
24
|
-
{ title: '
|
|
22
|
+
{ title: 'axios', value: 'axios' },
|
|
23
|
+
{ title: 'vue-i18n', value: 'i18n' }
|
|
25
24
|
],
|
|
26
25
|
format: values => {
|
|
27
26
|
let result = values
|
|
@@ -38,7 +37,7 @@ module.exports = async function ({ scope, utils }) {
|
|
|
38
37
|
}
|
|
39
38
|
},
|
|
40
39
|
{
|
|
41
|
-
type: (_, { preset }) => preset.lint ? 'select' : null,
|
|
40
|
+
type: (_, { preset }) => (preset.lint ? 'select' : null),
|
|
42
41
|
name: 'lintConfig',
|
|
43
42
|
message: 'Pick an ESLint preset:',
|
|
44
43
|
choices: [
|
|
@@ -50,13 +49,13 @@ module.exports = async function ({ scope, utils }) {
|
|
|
50
49
|
])
|
|
51
50
|
|
|
52
51
|
utils.createTargetDir(scope)
|
|
53
|
-
utils.renderTemplate(utils.join(
|
|
54
|
-
utils.renderTemplate(utils.join(
|
|
52
|
+
utils.renderTemplate(utils.join(import.meta.url, 'BASE'), scope)
|
|
53
|
+
utils.renderTemplate(utils.join(import.meta.url, scope.css), scope)
|
|
55
54
|
|
|
56
|
-
if (scope.preset.axios) utils.renderTemplate(utils.join(
|
|
57
|
-
if (scope.preset.i18n) utils.renderTemplate(utils.join(
|
|
58
|
-
if (scope.preset.lint) utils.renderTemplate(utils.join(
|
|
55
|
+
if (scope.preset.axios) utils.renderTemplate(utils.join(import.meta.url, 'axios'), scope)
|
|
56
|
+
if (scope.preset.i18n) utils.renderTemplate(utils.join(import.meta.url, 'i18n'), scope)
|
|
57
|
+
if (scope.preset.lint) utils.renderTemplate(utils.join(import.meta.url, 'lint'), scope)
|
|
59
58
|
|
|
60
|
-
if (scope.preset.pinia) utils.renderTemplate(utils.join(
|
|
61
|
-
else if (scope.preset.vuex) utils.renderTemplate(utils.join(
|
|
59
|
+
if (scope.preset.pinia) utils.renderTemplate(utils.join(import.meta.url, 'pinia'), scope)
|
|
60
|
+
else if (scope.preset.vuex) utils.renderTemplate(utils.join(import.meta.url, 'vuex'), scope)
|
|
62
61
|
}
|
|
@@ -10,8 +10,7 @@ module.exports = {
|
|
|
10
10
|
|
|
11
11
|
env: {
|
|
12
12
|
node: true,
|
|
13
|
-
browser: true
|
|
14
|
-
'vue/setup-compiler-macros': true
|
|
13
|
+
browser: true
|
|
15
14
|
},
|
|
16
15
|
|
|
17
16
|
// Rules order is important, please avoid shuffling them
|
|
@@ -77,6 +76,7 @@ module.exports = {
|
|
|
77
76
|
'import/no-unresolved': 'off',
|
|
78
77
|
'import/no-extraneous-dependencies': 'off',
|
|
79
78
|
<% } else if (lintConfig === 'airbnb') { %>
|
|
79
|
+
'no-plusplus': 'off',
|
|
80
80
|
'no-param-reassign': 'off',
|
|
81
81
|
'no-void': 'off',
|
|
82
82
|
'no-nested-ternary': 'off',
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
<% if (preset.lint) { %>
|
|
29
|
+
"vite-plugin-checker": "^0.6.4",
|
|
29
30
|
"eslint": "^8.11.0",
|
|
30
31
|
"eslint-plugin-vue": "^9.0.0",
|
|
31
32
|
<% if (lintConfig === 'standard') { %>
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"prettier": "^3.0.3",
|
|
42
43
|
<% } } %>
|
|
43
44
|
<% if (preset.i18n) { %>"@intlify/unplugin-vue-i18n": "^2.0.0",<% } %>
|
|
44
|
-
"@quasar/app-vite": "^2.0.0-beta.
|
|
45
|
+
"@quasar/app-vite": "^2.0.0-beta.5",
|
|
45
46
|
"autoprefixer": "^10.4.2",
|
|
46
47
|
"postcss": "^8.4.14"
|
|
47
48
|
},
|
|
@@ -10,16 +10,6 @@ import { configure } from 'quasar/wrappers'
|
|
|
10
10
|
|
|
11
11
|
export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% } %>) => {
|
|
12
12
|
return {
|
|
13
|
-
<% if (preset.lint) { %>eslint: {
|
|
14
|
-
// fix: true,
|
|
15
|
-
// include: [],
|
|
16
|
-
// exclude: [],
|
|
17
|
-
// cache: false,
|
|
18
|
-
// rawOptions: {},
|
|
19
|
-
warnings: true,
|
|
20
|
-
errors: true
|
|
21
|
-
},<% } %>
|
|
22
|
-
|
|
23
13
|
// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
|
|
24
14
|
// preFetch: true,
|
|
25
15
|
|
|
@@ -76,7 +66,7 @@ export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% }
|
|
|
76
66
|
// extendViteConf (viteConf) {},
|
|
77
67
|
// viteVuePluginOptions: {},
|
|
78
68
|
|
|
79
|
-
<% if (preset.i18n) { %>vitePlugins: [
|
|
69
|
+
<% if (preset.i18n || preset.lint) { %>vitePlugins: [<% if (preset.i18n) { %>
|
|
80
70
|
['@intlify/unplugin-vue-i18n/vite', {
|
|
81
71
|
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
|
|
82
72
|
// compositionOnly: false,
|
|
@@ -89,10 +79,15 @@ export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% }
|
|
|
89
79
|
|
|
90
80
|
// you need to set i18n resource including paths !
|
|
91
81
|
include: [ fileURLToPath(new URL('./src/i18n', import.meta.url)) ],
|
|
92
|
-
}]
|
|
82
|
+
}]<% } %><% if (preset.lint) { %><% if (preset.i18n) { %>,<% } %>
|
|
83
|
+
['vite-plugin-checker', {
|
|
84
|
+
eslint: {
|
|
85
|
+
lintCommand: 'eslint "./**/*.{js,mjs,cjs,vue}"'
|
|
86
|
+
}
|
|
87
|
+
}, { server: false }]<% } %>
|
|
93
88
|
]<% } else { %>
|
|
94
89
|
// vitePlugins: [
|
|
95
|
-
// [ 'package-name', { ..
|
|
90
|
+
// [ 'package-name', { ..pluginOptions.. }, { server: true, client: true } ]
|
|
96
91
|
// ]<% } %>
|
|
97
92
|
},
|
|
98
93
|
|