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.
Files changed (139) hide show
  1. package/index.js +72 -54
  2. package/package.json +14 -18
  3. package/scripts/create-test-project.ts +26 -25
  4. package/templates/{eslint.config.base.js → __eslint.config.base.js} +3 -2
  5. package/templates/app/{eslint.config.js → __eslint.config.js} +2 -3
  6. package/templates/app/create-quasar-script.js +8 -0
  7. package/templates/app/quasar-v2/create-quasar-script.js +39 -0
  8. package/templates/app/quasar-v2/js-vite-2/BASE/README.md +4 -4
  9. package/templates/app/quasar-v2/js-vite-2/BASE/_.vscode/extensions.json +2 -2
  10. package/templates/app/quasar-v2/js-vite-2/BASE/_.vscode/settings.json +2 -2
  11. package/templates/app/quasar-v2/js-vite-2/BASE/_package.json +13 -14
  12. package/templates/app/quasar-v2/js-vite-2/BASE/index.html +3 -3
  13. package/templates/app/quasar-v2/js-vite-2/BASE/quasar.config.js +9 -10
  14. package/templates/app/quasar-v2/js-vite-2/BASE/src/App.vue +0 -11
  15. package/templates/app/quasar-v2/js-vite-2/BASE/src/components/EssentialLink.vue +7 -35
  16. package/templates/app/quasar-v2/js-vite-2/BASE/src/layouts/MainLayout.vue +2 -141
  17. package/templates/app/quasar-v2/js-vite-2/BASE/src/pages/ErrorNotFound.vue +0 -11
  18. package/templates/app/quasar-v2/js-vite-2/BASE/src/pages/IndexPage.vue +0 -11
  19. package/templates/app/quasar-v2/{ts-webpack-4/index.js → js-vite-2/create-quasar-script.js} +24 -7
  20. package/templates/app/quasar-v2/js-vite-2/eslint/_eslint.config.js +3 -3
  21. package/templates/app/quasar-v2/js-webpack-4/BASE/README.md +4 -4
  22. package/templates/app/quasar-v2/js-webpack-4/BASE/_.vscode/extensions.json +2 -2
  23. package/templates/app/quasar-v2/js-webpack-4/BASE/_.vscode/settings.json +2 -2
  24. package/templates/app/quasar-v2/js-webpack-4/BASE/_package.json +10 -11
  25. package/templates/app/quasar-v2/js-webpack-4/BASE/index.html +3 -3
  26. package/templates/app/quasar-v2/js-webpack-4/BASE/quasar.config.js +5 -6
  27. package/templates/app/quasar-v2/js-webpack-4/BASE/src/App.vue +0 -11
  28. package/templates/app/quasar-v2/js-webpack-4/BASE/src/components/EssentialLink.vue +7 -35
  29. package/templates/app/quasar-v2/js-webpack-4/BASE/src/layouts/MainLayout.vue +2 -141
  30. package/templates/app/quasar-v2/js-webpack-4/BASE/src/pages/ErrorNotFound.vue +0 -11
  31. package/templates/app/quasar-v2/js-webpack-4/BASE/src/pages/IndexPage.vue +0 -11
  32. package/templates/app/quasar-v2/{js-vite-2/index.js → js-webpack-4/create-quasar-script.js} +24 -7
  33. package/templates/app/quasar-v2/js-webpack-4/eslint/_eslint.config.js +3 -3
  34. package/templates/app/quasar-v2/ts-vite-2/BASE/README.md +4 -4
  35. package/templates/app/quasar-v2/ts-vite-2/BASE/_.vscode/extensions.json +2 -2
  36. package/templates/app/quasar-v2/ts-vite-2/BASE/_.vscode/settings.json +2 -2
  37. package/templates/app/quasar-v2/ts-vite-2/BASE/_package.json +13 -14
  38. package/templates/app/quasar-v2/ts-vite-2/BASE/index.html +3 -3
  39. package/templates/app/quasar-v2/ts-vite-2/BASE/quasar.config.ts +9 -10
  40. package/templates/app/quasar-v2/ts-vite-2/BASE/src/App.vue +0 -11
  41. package/templates/app/quasar-v2/ts-vite-2/BASE/src/components/EssentialLink.vue +2 -37
  42. package/templates/app/quasar-v2/ts-vite-2/BASE/src/components/ExampleComponent.vue +2 -98
  43. package/templates/app/quasar-v2/ts-vite-2/BASE/src/layouts/MainLayout.vue +2 -141
  44. package/templates/app/quasar-v2/ts-vite-2/BASE/src/pages/ErrorNotFound.vue +0 -11
  45. package/templates/app/quasar-v2/ts-vite-2/BASE/src/pages/IndexPage.vue +2 -90
  46. package/templates/app/quasar-v2/{ts-webpack-4/.eslintrc.cjs → ts-vite-2/__.eslintrc.cjs} +0 -1
  47. package/templates/app/quasar-v2/ts-vite-2/{index.js → create-quasar-script.js} +24 -7
  48. package/templates/app/quasar-v2/ts-vite-2/eslint/_eslint.config.js +3 -3
  49. package/templates/app/quasar-v2/ts-vite-2/i18n/src/boot/i18n.ts +2 -2
  50. package/templates/app/quasar-v2/ts-webpack-4/BASE/README.md +4 -4
  51. package/templates/app/quasar-v2/ts-webpack-4/BASE/_.vscode/extensions.json +2 -2
  52. package/templates/app/quasar-v2/ts-webpack-4/BASE/_.vscode/settings.json +2 -2
  53. package/templates/app/quasar-v2/ts-webpack-4/BASE/_package.json +10 -11
  54. package/templates/app/quasar-v2/ts-webpack-4/BASE/index.html +3 -3
  55. package/templates/app/quasar-v2/ts-webpack-4/BASE/quasar.config.ts +5 -6
  56. package/templates/app/quasar-v2/ts-webpack-4/BASE/src/App.vue +0 -11
  57. package/templates/app/quasar-v2/ts-webpack-4/BASE/src/components/EssentialLink.vue +2 -37
  58. package/templates/app/quasar-v2/ts-webpack-4/BASE/src/components/ExampleComponent.vue +2 -98
  59. package/templates/app/quasar-v2/ts-webpack-4/BASE/src/layouts/MainLayout.vue +2 -141
  60. package/templates/app/quasar-v2/ts-webpack-4/BASE/src/pages/ErrorNotFound.vue +0 -11
  61. package/templates/app/quasar-v2/ts-webpack-4/BASE/src/pages/IndexPage.vue +2 -90
  62. package/templates/app/quasar-v2/{ts-vite-2/.eslintrc.cjs → ts-webpack-4/__.eslintrc.cjs} +0 -1
  63. package/templates/app/quasar-v2/{js-webpack-4/index.js → ts-webpack-4/create-quasar-script.js} +24 -7
  64. package/templates/app/quasar-v2/ts-webpack-4/eslint/_eslint.config.js +3 -3
  65. package/templates/app/quasar-v2/ts-webpack-4/i18n/src/boot/i18n.ts +2 -2
  66. package/templates/app-extension/{eslint.config.js → __eslint.config.js} +3 -5
  67. package/templates/app-extension/ae-js/BASE/README.md +5 -5
  68. package/templates/app-extension/ae-js/BASE/_package.json +6 -6
  69. package/templates/app-extension/ae-js/BASE/src/index.js +1 -1
  70. package/templates/app-extension/ae-js/{index.js → create-quasar-script.js} +4 -14
  71. package/templates/app-extension/ae-js/install-script/src/install.js +1 -1
  72. package/templates/app-extension/ae-js/prompts-script/src/prompts.js +1 -1
  73. package/templates/app-extension/ae-js/uninstall-script/src/uninstall.js +1 -1
  74. package/templates/app-extension/ae-ts/BASE/README.md +6 -6
  75. package/templates/app-extension/ae-ts/BASE/_eslint.config.js +3 -2
  76. package/templates/app-extension/ae-ts/BASE/_package.json +11 -11
  77. package/templates/app-extension/ae-ts/BASE/app-extension/README.md +7 -7
  78. package/templates/app-extension/ae-ts/BASE/app-extension/_package.json +9 -9
  79. package/templates/app-extension/ae-ts/BASE/app-extension/src/index.ts +2 -2
  80. package/templates/app-extension/ae-ts/BASE/app-extension/src/runtime/README.md +3 -3
  81. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/README.md +11 -11
  82. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/_package.json +4 -4
  83. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/index.html +3 -3
  84. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/quasar.config.ts +0 -2
  85. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/quasar.extensions.json +1 -1
  86. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/quasar.d.ts +1 -1
  87. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/README.md +10 -10
  88. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/_package.json +4 -4
  89. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/index.html +3 -3
  90. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/quasar.config.ts +0 -2
  91. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/quasar.extensions.json +1 -1
  92. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/quasar.d.ts +1 -1
  93. package/templates/app-extension/ae-ts/{index.js → create-quasar-script.js} +11 -6
  94. package/templates/app-extension/create-quasar-script.js +17 -0
  95. package/templates/ui-kit/{eslint.config.js → __eslint.config.js} +2 -2
  96. package/templates/ui-kit/{index.js → create-quasar-script.js} +8 -5
  97. package/templates/ui-kit/quasar-v2/BASE/LICENSE +1 -1
  98. package/templates/ui-kit/quasar-v2/BASE/README.md +4 -4
  99. package/templates/ui-kit/quasar-v2/BASE/ui/README.md +29 -29
  100. package/templates/ui-kit/quasar-v2/BASE/ui/_package.json +4 -4
  101. package/templates/ui-kit/quasar-v2/BASE/ui/build/index.js +1 -1
  102. package/templates/ui-kit/quasar-v2/BASE/ui/build/script.javascript.js +2 -2
  103. package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/index.template.html +10 -5
  104. package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/layouts/MyLayout.vue +1 -1
  105. package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/pages/Test1.vue +4 -4
  106. package/templates/ui-kit/quasar-v2/BASE/ui/src/index.sass +2 -2
  107. package/templates/ui-kit/quasar-v2/BASE/ui/src/vue-plugin.js +6 -6
  108. package/templates/ui-kit/quasar-v2/BASE/ui/umd-test.html +2 -2
  109. package/templates/ui-kit/quasar-v2/ae/app-extension/README.md +6 -6
  110. package/templates/ui-kit/quasar-v2/ae/app-extension/_package.json +5 -5
  111. package/templates/ui-kit/quasar-v2/ae/app-extension/src/boot/register.js +1 -1
  112. package/templates/ui-kit/quasar-v2/ae/app-extension/src/index.js +7 -7
  113. package/templates/ui-kit/quasar-v2/{index.js → create-quasar-script.js} +5 -2
  114. package/templates/ui-kit/quasar-v2/ui-component/ui/src/components/Component.js +3 -3
  115. package/templates/ui-kit/quasar-v2/ui-component/ui/src/components/Component.sass +1 -1
  116. package/templates/ui-kit/quasar-v2/ui-directive/ui/src/directives/Directive.js +1 -1
  117. package/templates/ui-kit/quasar-v2/ui-directive/ui/src/directives/Directive.sass +1 -1
  118. package/utils/index.js +106 -93
  119. package/utils/logger.js +52 -50
  120. package/utils/template.js +280 -0
  121. package/eslint.config.base.js +0 -19
  122. package/eslint.config.js +0 -47
  123. package/templates/app/index.js +0 -8
  124. package/templates/app/quasar-v2/index.js +0 -56
  125. package/templates/app/quasar-v2/js-vite-2/axios/src/boot/axios.js +0 -24
  126. package/templates/app/quasar-v2/js-vite-2/scss/src/css/app.scss +0 -1
  127. package/templates/app/quasar-v2/js-vite-2/scss/src/css/quasar.variables.scss +0 -25
  128. package/templates/app/quasar-v2/js-webpack-4/axios/src/boot/axios.js +0 -24
  129. package/templates/app/quasar-v2/js-webpack-4/scss/src/css/app.scss +0 -1
  130. package/templates/app/quasar-v2/js-webpack-4/scss/src/css/quasar.variables.scss +0 -25
  131. package/templates/app/quasar-v2/ts-vite-2/axios/src/boot/axios.ts +0 -31
  132. package/templates/app/quasar-v2/ts-vite-2/scss/src/css/app.scss +0 -1
  133. package/templates/app/quasar-v2/ts-vite-2/scss/src/css/quasar.variables.scss +0 -25
  134. package/templates/app/quasar-v2/ts-webpack-4/axios/src/boot/axios.ts +0 -31
  135. package/templates/app/quasar-v2/ts-webpack-4/scss/src/css/app.scss +0 -1
  136. package/templates/app/quasar-v2/ts-webpack-4/scss/src/css/quasar.variables.scss +0 -25
  137. package/templates/app-extension/index.js +0 -15
  138. /package/templates/app/quasar-v2/js-vite-2/{.eslintrc.cjs → __.eslintrc.cjs} +0 -0
  139. /package/templates/app/quasar-v2/js-webpack-4/{.eslintrc.cjs → __.eslintrc.cjs} +0 -0
package/index.js CHANGED
@@ -5,12 +5,7 @@ import { join } from 'node:path'
5
5
 
6
6
  // display banner
7
7
  console.log()
8
- console.log(
9
- readFileSync(
10
- new URL('./assets/logo.art', import.meta.url),
11
- 'utf8'
12
- )
13
- )
8
+ console.log(readFileSync(new URL('./assets/logo.art', import.meta.url), 'utf8'))
14
9
 
15
10
  import utils from './utils/index.js'
16
11
 
@@ -22,10 +17,10 @@ import prompts from 'prompts'
22
17
 
23
18
  const argv = parseArgs(process.argv.slice(2), {
24
19
  alias: {
25
- n: 'nogit',
20
+ n: 'nogit'
26
21
  },
27
22
 
28
- boolean: [ 'n' ],
23
+ boolean: ['n']
29
24
  })
30
25
 
31
26
  /** @type {Record<string, any>} */
@@ -37,7 +32,9 @@ const scope = {
37
32
  prompts.override(scope)
38
33
 
39
34
  if (scope.projectFolder) {
40
- utils.logger.log(`Using the project folder provided via arguments: ${ scope.projectFolder }`)
35
+ utils.logger.log(
36
+ `Using the project folder provided via arguments: ${scope.projectFolder}`
37
+ )
41
38
  utils.logger.log()
42
39
  }
43
40
 
@@ -50,9 +47,21 @@ await utils.prompts(scope, [
50
47
  initial: 0,
51
48
  message: 'What would you like to build?',
52
49
  choices: [
53
- { title: 'App with Quasar CLI, let\'s go!', value: 'app', description: 'spa/pwa/ssr/bex/electron/capacitor/cordova' },
54
- { title: 'AppExtension (AE) for Quasar CLI', value: 'app-extension', description: 'Quasar CLI AE' },
55
- { title: 'Quasar UI kit', value: 'ui-kit', description: 'Vue component and/or directive' }
50
+ {
51
+ title: "App with Quasar CLI, let's go!",
52
+ value: 'app',
53
+ description: 'spa/pwa/ssr/bex/electron/capacitor/cordova'
54
+ },
55
+ {
56
+ title: 'AppExtension (AE) for Quasar CLI',
57
+ value: 'app-extension',
58
+ description: 'Quasar CLI AE'
59
+ },
60
+ {
61
+ title: 'Quasar UI kit',
62
+ value: 'ui-kit',
63
+ description: 'Vue component and/or directive'
64
+ }
56
65
  ]
57
66
  },
58
67
  {
@@ -69,13 +78,15 @@ await utils.prompts(scope, [
69
78
  },
70
79
  {
71
80
  type: (_, { projectFolder }) =>
72
- (!existsSync(projectFolder) || readdirSync(projectFolder).length === 0 ? null : 'confirm'),
81
+ !existsSync(projectFolder) || readdirSync(projectFolder).length === 0
82
+ ? null
83
+ : 'confirm',
73
84
  name: 'overwrite',
74
85
  message: () =>
75
86
  (scope.projectFolderName === '.'
76
87
  ? 'Current directory'
77
- : `Target directory "${ scope.projectFolderName }"`)
78
- + ' is not empty. Remove existing files and continue?'
88
+ : `Target directory "${scope.projectFolderName}"`) +
89
+ ' is not empty. Remove existing files and continue?'
79
90
  },
80
91
  {
81
92
  type: (_, { overwrite } = {}) => {
@@ -88,21 +99,24 @@ await utils.prompts(scope, [
88
99
  }
89
100
  ])
90
101
 
91
- const { script } = await import(`./templates/${ scope.projectType }/index.js`)
92
- await script({ scope, utils })
102
+ const { createQuasarScript } = await import(
103
+ `./templates/${scope.projectType}/create-quasar-script.js`
104
+ )
105
+ await createQuasarScript({ scope, utils })
93
106
 
94
107
  console.log()
95
108
  utils.logger.success('The project has been scaffolded')
96
109
  console.log()
97
110
 
98
- function finalize () {
111
+ function finalize() {
99
112
  if (scope.projectFolder) {
100
113
  console.log()
101
114
 
102
115
  if (argv.nogit) {
103
- utils.logger.log('Skipping git initialization as --nogit flag was provided')
104
- }
105
- else {
116
+ utils.logger.log(
117
+ 'Skipping git initialization as --nogit flag was provided'
118
+ )
119
+ } else {
106
120
  utils.initializeGit(scope.projectFolder)
107
121
  }
108
122
  }
@@ -111,41 +125,47 @@ function finalize () {
111
125
  }
112
126
 
113
127
  if (scope.skipDepsInstall !== true) {
114
- await utils.prompts(scope, [
128
+ await utils.prompts(
129
+ scope,
130
+ [
131
+ {
132
+ type: 'select',
133
+ name: 'packageManager',
134
+ message: 'Install project dependencies? (recommended)',
135
+ choices: () =>
136
+ utils.runningPackageManager
137
+ ? [
138
+ {
139
+ title: `Yes, use ${utils.runningPackageManager.name}`,
140
+ value: utils.runningPackageManager.name
141
+ },
142
+ { title: 'No, I will handle that myself', value: false }
143
+ ]
144
+ : [
145
+ { title: 'Yes, use Yarn (recommended)', value: 'yarn' },
146
+ { title: 'Yes, use PNPM (recommended)', value: 'pnpm' },
147
+ { title: 'Yes, use NPM', value: 'npm' },
148
+ { title: 'Yes, use Bun', value: 'bun' },
149
+ { title: 'No, I will handle that myself', value: false }
150
+ ]
151
+ }
152
+ ],
115
153
  {
116
- type: 'select',
117
- name: 'packageManager',
118
- message:
119
- 'Install project dependencies? (recommended)',
120
- choices: () => (
121
- utils.runningPackageManager
122
- ? [
123
- { title: `Yes, use ${ utils.runningPackageManager.name }`, value: utils.runningPackageManager.name },
124
- { title: 'No, I will handle that myself', value: false }
125
- ]
126
- : [
127
- { title: 'Yes, use Yarn (recommended)', value: 'yarn' },
128
- { title: 'Yes, use PNPM (recommended)', value: 'pnpm' },
129
- { title: 'Yes, use NPM', value: 'npm' },
130
- { title: 'Yes, use Bun', value: 'bun' },
131
- { title: 'No, I will handle that myself', value: false }
132
- ]
133
- )
134
- }
135
- ], {
136
- onCancel: () => {
137
- scope.packageManager = false
138
- finalize()
139
- process.exit(0)
154
+ onCancel: () => {
155
+ scope.packageManager = false
156
+ finalize()
157
+ process.exit(0)
158
+ }
140
159
  }
141
- })
160
+ )
142
161
 
143
162
  if (scope.packageManager !== false) {
144
163
  try {
145
164
  await utils.installDeps(scope)
146
- }
147
- catch {
148
- utils.logger.warn('Could not auto install dependencies. Probably a temporary npm registry issue?')
165
+ } catch {
166
+ utils.logger.warn(
167
+ 'Could not auto install dependencies. Probably a temporary npm registry issue?'
168
+ )
149
169
  scope.packageManager = false
150
170
  finalize()
151
171
  process.exit(0)
@@ -154,8 +174,7 @@ if (scope.skipDepsInstall !== true) {
154
174
  if (scope.preset.lint) {
155
175
  try {
156
176
  await utils.lintFolder(scope)
157
- }
158
- catch {
177
+ } catch {
159
178
  utils.logger.warn('Could not auto lint fix the project folder.')
160
179
  }
161
180
  }
@@ -163,8 +182,7 @@ if (scope.skipDepsInstall !== true) {
163
182
  if (scope.prettier) {
164
183
  try {
165
184
  await utils.formatFolder(scope)
166
- }
167
- catch {
185
+ } catch {
168
186
  utils.logger.warn('Could not auto format the project folder.')
169
187
  }
170
188
  }
package/package.json CHANGED
@@ -1,51 +1,47 @@
1
1
  {
2
2
  "name": "create-quasar",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Scaffolds Quasar Apps, AppExtensions or UI kits",
5
- "type": "module",
5
+ "homepage": "https://quasar.dev",
6
+ "bugs": "https://github.com/quasarframework/quasar/issues",
7
+ "license": "MIT",
6
8
  "author": {
7
9
  "name": "Razvan Stoenescu",
8
10
  "email": "razvan.stoenescu@gmail.com",
9
11
  "url": "https://github.com/quasarframework"
10
12
  },
11
- "license": "MIT",
12
- "main": "index.js",
13
- "bin": {
14
- "create-quasar": "index.js"
15
- },
16
13
  "repository": {
17
14
  "type": "git",
18
15
  "url": "https://github.com/quasarframework/quasar"
19
16
  },
20
- "bugs": "https://github.com/quasarframework/quasar/issues",
21
- "homepage": "https://quasar.dev",
22
17
  "funding": {
23
18
  "type": "github",
24
19
  "url": "https://donate.quasar.dev"
25
20
  },
26
- "engines": {
27
- "node": ">=16"
21
+ "bin": {
22
+ "create-quasar": "index.js"
28
23
  },
24
+ "type": "module",
25
+ "main": "index.js",
29
26
  "dependencies": {
30
27
  "cross-spawn": "^7.0.6",
31
- "fs-extra": "^11.2.0",
28
+ "fs-extra": "^11.3.4",
32
29
  "kolorist": "^1.8.0",
33
- "lodash": "^4.17.21",
34
30
  "minimist": "^1.2.8",
35
31
  "prompts": "^2.4.2",
36
32
  "tinyglobby": "^0.2.10"
37
33
  },
38
34
  "devDependencies": {
39
- "@types/lodash": "^4.17.7",
40
35
  "@types/prompts": "^2.4.9",
41
- "@yusufkandemir/eslint-plugin-lodash-template": "^2.0.0",
42
- "typescript-eslint": "^8.28.0",
43
- "eslint": "^9.37.0",
44
36
  "tsx": "^4.19.1",
45
37
  "typescript": "^5.6.2"
46
38
  },
39
+ "engines": {
40
+ "node": ">=16"
41
+ },
47
42
  "scripts": {
48
- "lint": "eslint --flag v10_config_lookup_from_file --fix",
43
+ "lint": "oxfmt && oxlint --fix",
44
+ "lint:check": "oxfmt --check && oxlint",
49
45
  "create-test-project": "tsx scripts/create-test-project.ts"
50
46
  }
51
47
  }
@@ -1,8 +1,8 @@
1
- import prompts from 'prompts';
1
+ import prompts from "prompts";
2
2
 
3
- type ScriptType = 'js' | 'ts';
4
- type AppEngine = 'vite-2' | 'webpack-4';
5
- type PackageManager = 'yarn' | 'npm' | 'pnpm';
3
+ type ScriptType = "js" | "ts";
4
+ type AppEngine = "vite-2" | "webpack-4";
5
+ type PackageManager = "yarn" | "npm" | "pnpm";
6
6
 
7
7
  type CreateProjectOptions = {
8
8
  scriptType: ScriptType;
@@ -10,35 +10,37 @@ type CreateProjectOptions = {
10
10
  packageManager: PackageManager;
11
11
  };
12
12
 
13
- export async function createProject({ scriptType, appEngine, packageManager }: CreateProjectOptions) {
13
+ export async function createProject({
14
+ scriptType,
15
+ appEngine,
16
+ packageManager
17
+ }: CreateProjectOptions) {
14
18
  // To bypass Corepack enforcing what's specified in the closest package.json file that has the 'packageManager' field
15
- process.env.COREPACK_ENABLE_STRICT = '0';
19
+ process.env.COREPACK_ENABLE_STRICT = "0";
16
20
  // See https://github.com/yarnpkg/yarn/issues/9015
17
- process.env.SKIP_YARN_COREPACK_CHECK = '1';
21
+ process.env.SKIP_YARN_COREPACK_CHECK = "1";
18
22
  // To alter the behavior to run correctly within this script
19
- process.env.CREATE_TEST_PROJECT_OVERRIDE = 'true';
23
+ process.env.CREATE_TEST_PROJECT_OVERRIDE = "true";
20
24
 
21
25
  prompts.override({
22
- projectType: 'app',
23
- projectFolder: 'test-project',
26
+ projectType: "app",
27
+ projectFolder: "test-project",
24
28
  overwrite: true,
25
29
 
26
30
  scriptType: scriptType,
27
31
  engine: appEngine,
28
32
 
29
- name: 'test-project',
30
- productName: 'Test Project',
31
- description: 'A test project',
32
- author: 'Quasar Team (info@quasar.dev)',
33
+ name: "test-project",
34
+ productName: "Test Project",
35
+ description: "A test project",
36
+ author: "Quasar Team (info@quasar.dev)",
33
37
 
34
38
  // The defaults
35
- sfcStyle: 'composition-setup',
36
- css: 'scss',
37
39
 
38
- preset: ['eslint'],
40
+ preset: ["sass", "eslint"],
39
41
  prettier: true,
40
42
 
41
- packageManager,
43
+ packageManager
42
44
  });
43
45
 
44
46
  // We are overriding .override() as every call overrides the previous overrides (too many overrides :D)
@@ -47,7 +49,7 @@ export async function createProject({ scriptType, appEngine, packageManager }: C
47
49
  // Remove all extra arguments to avoid interfering with the index.js script
48
50
  process.argv = process.argv.slice(0, 2);
49
51
 
50
- await import('../index.js');
52
+ await import("../index.js");
51
53
  }
52
54
 
53
55
  const args = process.argv.slice(2) as [ScriptType, AppEngine, PackageManager];
@@ -55,9 +57,8 @@ const args = process.argv.slice(2) as [ScriptType, AppEngine, PackageManager];
55
57
  void createProject({
56
58
  scriptType: args[0],
57
59
  appEngine: args[1],
58
- packageManager: args[2],
59
- })
60
- .catch(error => {
61
- console.error(error);
62
- process.exit(1);
63
- });
60
+ packageManager: args[2]
61
+ }).catch(error => {
62
+ console.error(error);
63
+ process.exit(1);
64
+ });
@@ -1,10 +1,11 @@
1
+ import pluginLodashTemplate from '@yusufkandemir/eslint-plugin-lodash-template'
2
+ import { defineConfig } from 'eslint/config'
1
3
  import globals from 'globals'
2
4
  import tseslint from 'typescript-eslint'
3
- import pluginLodashTemplate from '@yusufkandemir/eslint-plugin-lodash-template'
4
5
  import baseConfig from '../eslint.config.base.js'
5
6
 
6
7
  // file paths are relative to templates/*/
7
- export default tseslint.config(
8
+ export default defineConfig(
8
9
  ...baseConfig,
9
10
 
10
11
  {
@@ -1,7 +1,7 @@
1
- import tseslint from 'typescript-eslint'
1
+ import { defineConfig } from 'eslint/config'
2
2
  import baseConfig from '../eslint.config.base.js'
3
3
 
4
- export default tseslint.config(
4
+ export default defineConfig(
5
5
  ...baseConfig,
6
6
 
7
7
  {
@@ -55,7 +55,6 @@ export default tseslint.config(
55
55
  'productName',
56
56
 
57
57
  // Quasar v2 - TS
58
- 'sfcStyle',
59
58
  'css',
60
59
  'preset',
61
60
  'prettier'
@@ -0,0 +1,8 @@
1
+ export async function createQuasarScript({ scope, utils }) {
2
+ await utils.prompts(scope, [utils.commonPrompts.scriptType])
3
+
4
+ const { createQuasarScript: create } = await import(
5
+ `./quasar-v2/create-quasar-script.js`
6
+ )
7
+ await create({ scope, utils })
8
+ }
@@ -0,0 +1,39 @@
1
+ export async function createQuasarScript({ 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
+ {
10
+ title: 'Quasar App CLI with Vite',
11
+ value: 'vite-2',
12
+ description: 'recommended'
13
+ },
14
+ {
15
+ title: 'Quasar App CLI with Webpack',
16
+ value: 'webpack-4'
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ type: 'text',
22
+ name: 'name',
23
+ message: 'Package name:',
24
+ initial: () => utils.inferPackageName(scope.projectFolderName),
25
+ validate: val =>
26
+ utils.isValidPackageName(val) || 'Invalid package.json name'
27
+ },
28
+
29
+ utils.commonPrompts.productName,
30
+ utils.commonPrompts.description
31
+ ])
32
+
33
+ await utils.injectAuthor(scope)
34
+
35
+ const { createQuasarScript: create } = await import(
36
+ `./${scope.scriptType}-${scope.engine}/create-quasar-script.js`
37
+ )
38
+ await create({ scope, utils })
39
+ }
@@ -1,6 +1,6 @@
1
- # <%= productName %> (<%= name %>)
1
+ # <%= scope.productName %> (<%= scope.name %>)
2
2
 
3
- <%= description %>
3
+ <%= scope.description %>
4
4
 
5
5
  ## Install the dependencies
6
6
  ```bash
@@ -13,7 +13,7 @@ npm install
13
13
  ```bash
14
14
  quasar dev
15
15
  ```
16
- <% if (preset.eslint) { %>
16
+ <% if (scope.preset.eslint) { %>
17
17
 
18
18
  ### Lint the files
19
19
  ```bash
@@ -21,7 +21,7 @@ yarn lint
21
21
  # or
22
22
  npm run lint
23
23
  ```
24
- <% if (prettier) { %>
24
+ <% if (scope.prettier) { %>
25
25
 
26
26
  ### Format the files
27
27
  ```bash
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "recommendations": [
3
- <% if (preset.eslint) { %>"dbaeumer.vscode-eslint",<% } %>
4
- <% if (prettier) { %>"esbenp.prettier-vscode",<% } %>
3
+ <% if (scope.preset.eslint) { %>"dbaeumer.vscode-eslint",<% } %>
4
+ <% if (scope.prettier) { %>"esbenp.prettier-vscode",<% } %>
5
5
  "editorconfig.editorconfig",
6
6
  "vue.volar",
7
7
  "wayou.vscode-todo-highlight"
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "editor.bracketPairColorization.enabled": true,
3
- "editor.guides.bracketPairs": true<% if (preset.eslint) { %>,
3
+ "editor.guides.bracketPairs": true<% if (scope.preset.eslint) { %>,
4
4
  "editor.formatOnSave": true,
5
- "editor.defaultFormatter": <% if (prettier) { %>"esbenp.prettier-vscode"<% } else { %>"dbaeumer.vscode-eslint"<% } %>,
5
+ "editor.defaultFormatter": <% if (scope.prettier) { %>"esbenp.prettier-vscode"<% } else { %>"dbaeumer.vscode-eslint"<% } %>,
6
6
  "editor.codeActionsOnSave": [
7
7
  "source.fixAll.eslint"
8
8
  ],
@@ -1,39 +1,38 @@
1
1
  {
2
- "name": "<%= name %>",
2
+ "name": "<%= scope.name %>",
3
3
  "version": "0.0.1",
4
- "description": "<%= description %>",
5
- "productName": "<%= productName %>",
6
- "author": "<%= author %>",
4
+ "description": "<%= scope.description %>",
5
+ "productName": "<%= scope.productName %>",
6
+ "author": "<%= scope.author %>",
7
7
  "type": "module",
8
8
  "private": true,
9
9
  "scripts": {
10
- <% if (preset.eslint) { %>"lint": "eslint -c ./eslint.config.js \"./src*/**/*.{js,cjs,mjs,vue}\"",<% } %>
11
- <% if (prettier) { %>"format": "prettier --write \"**/*.{js,vue<% if (css !== 'sass') { %>,<%= css %><% } %>,html,md,json}\" --ignore-path .gitignore",<% } %>
10
+ <% if (scope.preset.eslint) { %>"lint": "eslint -c ./eslint.config.js \"./src*/**/*.{js,cjs,mjs,vue}\"",<% } %>
11
+ <% if (scope.prettier) { %>"format": "prettier --write \"**/*.{js,vue,css<% if (scope.preset.sass) { %>,scss<% } %>,html,md,json}\" --ignore-path .gitignore",<% } %>
12
12
  "test": "echo \"No test specified\" && exit 0",
13
13
  "dev": "quasar dev",
14
14
  "build": "quasar build",
15
15
  "postinstall": "quasar prepare"
16
16
  },
17
17
  "dependencies": {
18
- <% if (preset.axios) { %>"axios": "^1.2.1",<% } %>
19
- <% if (preset.i18n) { %>"vue-i18n": "^11.3.0",<% } %>
20
- <% if (preset.pinia) { %>"pinia": "^3.0.1",<% } %>
18
+ <% if (scope.preset.i18n) { %>"vue-i18n": "^11.3.0",<% } %>
19
+ <% if (scope.preset.pinia) { %>"pinia": "^3.0.1",<% } %>
21
20
  "@quasar/extras": "^1.16.4",
22
21
  "quasar": "^2.16.0",
23
22
  "vue": "^3.5.22",
24
23
  "vue-router": "^5.0.3"
25
24
  },
26
25
  "devDependencies": {
27
- <% if (preset.i18n) { %>"@intlify/unplugin-vue-i18n": "^11.0.0",<% } %>
28
- <% if (preset.eslint) { %>
29
- "@eslint/js": "^10.0.1",
30
- "eslint": "^10.0.3",
26
+ <% if (scope.preset.i18n) { %>"@intlify/unplugin-vue-i18n": "^11.0.0",<% } %>
27
+ <% if (scope.preset.eslint) { %>
28
+ "@eslint/js": "^9.39.4",
29
+ "eslint": "^9.39.4",
31
30
  "eslint-plugin-vue": "^10.8.0",
32
31
  "globals": "^17.4.0",
33
32
  "vite-plugin-checker": "^0.12.0",
34
33
  "vue-eslint-parser": "^10.4.0",
35
34
  <% } %>
36
- <% if (prettier) { %>
35
+ <% if (scope.prettier) { %>
37
36
  "@vue/eslint-config-prettier": "^10.2.0",
38
37
  "prettier": "^3.8.1",
39
38
  <% } %>
@@ -1,13 +1,13 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title><%= '\<%= productName %\>' %></title>
4
+ <title><%= '<' + '%= productName %' + '>' %></title>
5
5
 
6
6
  <meta charset="utf-8">
7
- <meta name="description" content="<%= '\<%= productDescription %\>' %>">
7
+ <meta name="description" content="<%= '<' + '%= productDescription %' + '>' %>">
8
8
  <meta name="format-detection" content="telephone=no">
9
9
  <meta name="msapplication-tap-highlight" content="no">
10
- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<%= '\<% if (ctx.mode.cordova || ctx.mode.capacitor) { %\>, viewport-fit=cover\<% } %\>' %>">
10
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<%= '<' + '% if (ctx.mode.cordova || ctx.mode.capacitor) { %' + '>, viewport-fit=cover<' + '% } %' + '>' %>">
11
11
 
12
12
  <link rel="icon" type="image/png" sizes="128x128" href="icons/favicon-128x128.png">
13
13
  <link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
@@ -1,10 +1,10 @@
1
1
  // Configuration for your app
2
2
  // https://v2.quasar.dev/quasar-cli-vite/quasar-config-file
3
3
 
4
- import { defineConfig } from '#q-app/wrappers'<% if (preset.i18n) { %>
4
+ import { defineConfig } from '#q-app/wrappers'<% if (scope.preset.i18n) { %>
5
5
  import { fileURLToPath } from 'node:url'<% } %>
6
6
 
7
- export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% } %>) => {
7
+ export default defineConfig((<% if (scope.preset.i18n) { %>ctx<% } else { %>/* ctx */<% } %>) => {
8
8
  return {
9
9
  // https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
10
10
  // preFetch: true,
@@ -12,14 +12,13 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
12
12
  // app boot file (/src/boot)
13
13
  // --> boot files are part of "main.js"
14
14
  // https://v2.quasar.dev/quasar-cli-vite/boot-files
15
- boot: [<% if (preset.i18n) { %>
16
- 'i18n'<% } %><% if (preset.axios) { %><% if (preset.i18n) { %>,<% } %>
17
- 'axios'<% } %>
15
+ boot: [
16
+ <% if (scope.preset.i18n) { %>'i18n'<% } %>
18
17
  ],
19
18
 
20
19
  // https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#css
21
20
  css: [
22
- 'app.<%= css %>'
21
+ 'app.<%= scope.preset.sass ? 'sass' : 'css' %>'
23
22
  ],
24
23
 
25
24
  // https://github.com/quasarframework/quasar/tree/dev/extras
@@ -61,8 +60,8 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
61
60
 
62
61
  // extendViteConf (viteConf) {},
63
62
  // viteVuePluginOptions: {},
64
- <% if (preset.i18n || preset.eslint) { %>
65
- vitePlugins: [<% if (preset.i18n) { %>
63
+ <% if (scope.preset.i18n || scope.preset.eslint) { %>
64
+ vitePlugins: [<% if (scope.preset.i18n) { %>
66
65
  ['@intlify/unplugin-vue-i18n/vite', {
67
66
  // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
68
67
  // compositionOnly: false,
@@ -75,7 +74,7 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
75
74
 
76
75
  // you need to set i18n resource including paths !
77
76
  include: [ fileURLToPath(new URL('./src/i18n', import.meta.url)) ]
78
- }]<% } %><% if (preset.eslint) { %><% if (preset.i18n) { %>,
77
+ }]<% } %><% if (scope.preset.eslint) { %><% if (scope.preset.i18n) { %>,
79
78
  <% } %>
80
79
  ['vite-plugin-checker', {
81
80
  eslint: {
@@ -208,7 +207,7 @@ export default defineConfig((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<
208
207
  builder: {
209
208
  // https://www.electron.build/configuration
210
209
 
211
- appId: '<%= name %>'
210
+ appId: '<%= scope.name %>'
212
211
  }
213
212
  },
214
213
 
@@ -1,14 +1,3 @@
1
1
  <template>
2
2
  <router-view />
3
3
  </template>
4
- <% if (sfcStyle === 'composition-setup') { %>
5
- <script setup>
6
- //
7
- </script><% } else if (sfcStyle === 'composition' || sfcStyle === 'options') { %>
8
- <script>
9
- import { defineComponent } from 'vue';
10
-
11
- export default defineComponent({
12
- name: 'App'
13
- });
14
- </script><% } %>