create-quasar 1.5.5 → 1.6.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 (61) hide show
  1. package/.eslintrc.cjs +10 -2
  2. package/index.js +88 -92
  3. package/package.json +10 -9
  4. package/templates/app/index.js +2 -3
  5. package/templates/app/quasar-v1/index.js +2 -3
  6. package/templates/app/quasar-v1/js/BASE/src/router/routes.js +0 -1
  7. package/templates/app/quasar-v1/js/index.js +8 -9
  8. package/templates/app/quasar-v1/js/lint/_.eslintrc.js +6 -4
  9. package/templates/app/quasar-v1/ts/index.js +8 -9
  10. package/templates/app/quasar-v1/ts/lint/_.eslintrc.js +1 -0
  11. package/templates/app/quasar-v2/index.js +2 -3
  12. package/templates/app/quasar-v2/js-vite/BASE/src/router/routes.js +0 -1
  13. package/templates/app/quasar-v2/js-vite/index.js +9 -10
  14. package/templates/app/quasar-v2/js-vite/lint/_.eslintrc.cjs +1 -0
  15. package/templates/app/quasar-v2/js-vite-beta/BASE/quasar.config.js +1 -1
  16. package/templates/app/quasar-v2/js-vite-beta/BASE/src/router/routes.js +0 -1
  17. package/templates/app/quasar-v2/js-vite-beta/index.js +9 -10
  18. package/templates/app/quasar-v2/js-vite-beta/lint/_.eslintrc.cjs +1 -0
  19. package/templates/app/quasar-v2/js-webpack/BASE/src/router/routes.js +0 -1
  20. package/templates/app/quasar-v2/js-webpack/index.js +9 -10
  21. package/templates/app/quasar-v2/js-webpack/lint/_.eslintrc.cjs +1 -0
  22. package/templates/app/quasar-v2/js-webpack-beta/BASE/_package.json +1 -1
  23. package/templates/app/quasar-v2/js-webpack-beta/BASE/quasar.config.js +5 -5
  24. package/templates/app/quasar-v2/js-webpack-beta/BASE/src/router/routes.js +0 -1
  25. package/templates/app/quasar-v2/js-webpack-beta/index.js +9 -10
  26. package/templates/app/quasar-v2/js-webpack-beta/lint/_.eslintrc.cjs +1 -0
  27. package/templates/app/quasar-v2/ts-vite/index.js +10 -11
  28. package/templates/app/quasar-v2/ts-vite/lint/_.eslintrc.cjs +1 -0
  29. package/templates/app/quasar-v2/ts-vite-beta/BASE/quasar.config.ts +1 -1
  30. package/templates/app/quasar-v2/ts-vite-beta/index.js +10 -11
  31. package/templates/app/quasar-v2/ts-vite-beta/lint/_.eslintrc.cjs +1 -0
  32. package/templates/app/quasar-v2/ts-webpack/index.js +10 -11
  33. package/templates/app/quasar-v2/ts-webpack/lint/_.eslintrc.cjs +1 -0
  34. package/templates/app/quasar-v2/ts-webpack-beta/BASE/_package.json +1 -1
  35. package/templates/app/quasar-v2/ts-webpack-beta/BASE/quasar.config.ts +5 -0
  36. package/templates/app/quasar-v2/ts-webpack-beta/index.js +10 -11
  37. package/templates/app/quasar-v2/ts-webpack-beta/lint/_.eslintrc.cjs +1 -0
  38. package/templates/app-extension/ae-v1/index.js +7 -8
  39. package/templates/app-extension/index.js +2 -2
  40. package/templates/ui-kit/index.js +8 -9
  41. package/templates/ui-kit/quasar-v1/BASE/ui/build/script.app-ext.js +1 -1
  42. package/templates/ui-kit/quasar-v1/BASE/ui/build/script.clean.js +1 -1
  43. package/templates/ui-kit/quasar-v1/BASE/ui/dev/quasar.conf.js +1 -1
  44. package/templates/ui-kit/quasar-v1/index.js +9 -10
  45. package/templates/ui-kit/quasar-v2/index.js +9 -10
  46. package/utils/index.js +67 -46
  47. package/utils/logger.js +66 -43
  48. /package/templates/{.eslintrc.js → .eslintrc.cjs} +0 -0
  49. /package/templates/app/quasar-v1/js/{.eslintrc.js → .eslintrc.cjs} +0 -0
  50. /package/templates/app/quasar-v1/ts/{.eslintrc.js → .eslintrc.cjs} +0 -0
  51. /package/templates/app/quasar-v2/js-vite/{.eslintrc.js → .eslintrc.cjs} +0 -0
  52. /package/templates/app/quasar-v2/js-vite-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
  53. /package/templates/app/quasar-v2/js-webpack/{.eslintrc.js → .eslintrc.cjs} +0 -0
  54. /package/templates/app/quasar-v2/js-webpack-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
  55. /package/templates/app/quasar-v2/ts-vite/{.eslintrc.js → .eslintrc.cjs} +0 -0
  56. /package/templates/app/quasar-v2/ts-vite-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
  57. /package/templates/app/quasar-v2/ts-webpack/{.eslintrc.js → .eslintrc.cjs} +0 -0
  58. /package/templates/app/quasar-v2/ts-webpack-beta/{.eslintrc.js → .eslintrc.cjs} +0 -0
  59. /package/templates/app-extension/ae-v1/{.eslintrc.js → .eslintrc.cjs} +0 -0
  60. /package/templates/ui-kit/{.eslintrc.js → .eslintrc.cjs} +0 -0
  61. /package/templates/ui-kit/quasar-v2/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/.eslintrc.cjs CHANGED
@@ -1,9 +1,17 @@
1
1
  module.exports = {
2
2
  root: true,
3
3
 
4
+ parserOptions: {
5
+ ecmaVersion: 'latest',
6
+ sourceType: 'module'
7
+ },
8
+
4
9
  env: {
5
- node: true,
6
- es2020: true,
10
+ node: true
11
+ },
12
+
13
+ globals: {
14
+ Promise: 'readonly'
7
15
  },
8
16
 
9
17
  extends: [
package/index.js CHANGED
@@ -1,131 +1,127 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { readFileSync, readdirSync, existsSync } = require('fs')
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
- require('path').join(__dirname, 'assets/logo.art'),
10
+ new URL('./assets/logo.art', import.meta.url),
10
11
  'utf8'
11
12
  )
12
13
  )
13
14
 
14
- const utils = require('./utils')
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
- async function run () {
22
- const scope = {}
23
-
24
- await utils.prompts(scope, [
25
- {
26
- type: 'select',
27
- name: 'projectType',
28
- initial: 0,
29
- message: 'What would you like to build?',
30
- choices: [
31
- { title: `App with Quasar CLI, let's go!`, value: 'app', description: 'spa/pwa/ssr/bex/electron/capacitor/cordova' },
32
- { title: 'AppExtension (AE) for Quasar CLI', value: 'app-extension', description: 'Quasar CLI AE' },
33
- { title: 'Quasar UI kit', value: 'ui-kit', description: 'Vue component and/or directive' }
34
- ]
35
- },
36
- {
37
- type: 'text',
38
- name: 'projectFolder',
39
- message: 'Project folder:',
40
- initial: defaultProjectFolder,
41
- format: val => {
42
- const name = (val && val.trim()) || defaultProjectFolder
43
- // inject the "short" name
44
- scope.projectFolderName = name
45
- return utils.join(process.cwd(), name)
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
- type: (_, { projectFolder }) =>
50
- !existsSync(projectFolder) || readdirSync(projectFolder).length === 0 ? null : 'confirm',
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
- const projectScript = require(`./templates/${scope.projectType}`)
70
- await projectScript({ scope, utils })
68
+ const { script } = await import(`./templates/${ scope.projectType }/index.js`)
69
+ await script({ scope, utils })
71
70
 
72
- console.log()
73
- utils.logger.success('The project has been scaffolded')
74
- console.log()
71
+ console.log()
72
+ utils.logger.success('The project has been scaffolded')
73
+ console.log()
75
74
 
76
- if (scope.skipDepsInstall !== true) {
77
- await utils.prompts(scope, [
78
- {
79
- type: 'select',
80
- name: 'packageManager',
81
- message:
82
- 'Install project dependencies? (recommended)',
83
- choices: () => (
84
- utils.runningPackageManager
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
- onCancel: () => {
100
- scope.packageManager = false
101
- utils.printFinalMessage(scope)
102
- process.exit(0)
103
- }
104
- })
95
+ )
96
+ }
97
+ ], {
98
+ onCancel: () => {
99
+ scope.packageManager = false
100
+ utils.printFinalMessage(scope)
101
+ process.exit(0)
102
+ }
103
+ })
105
104
 
106
- if (scope.packageManager !== false) {
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.installDeps(scope)
118
+ await utils.lintFolder(scope)
109
119
  }
110
120
  catch {
111
- utils.logger.warn('Could not auto install dependencies. Probably a temporary npm registry issue?')
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
- run()
127
+ utils.printFinalMessage(scope)
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "create-quasar",
3
- "version": "1.5.5",
3
+ "version": "1.6.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": ">=12"
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.11",
34
- "fs-extra": "^10.0.1",
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.6.7",
41
+ "@types/lodash": "^4.14.202",
41
42
  "@types/prompts": "^2.4.7",
42
- "@typescript-eslint/eslint-plugin": "^6.6.0",
43
- "@typescript-eslint/parser": "^6.6.0",
44
- "eslint": "^8.11.0",
45
- "eslint-plugin-lodash-template": "^0.21.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
  }
@@ -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 = require(`./quasar-${scope.quasarVersion}`)
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 = require(`./${scope.scriptType}`)
16
+ const { script } = await import(`./${ scope.scriptType }/index.js`)
18
17
  await script({ scope, utils })
19
18
  }
@@ -1,4 +1,3 @@
1
-
2
1
  const routes = [
3
2
  {
4
3
  path: '/',
@@ -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(__dirname, 'BASE'), scope)
59
- utils.renderTemplate(utils.join(__dirname, scope.css), scope)
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(__dirname, 'axios'), scope)
62
- if (scope.preset.i18n) utils.renderTemplate(utils.join(__dirname, 'i18n'), scope)
63
- if (scope.preset.vuex) utils.renderTemplate(utils.join(__dirname, 'vuex'), scope)
64
- if (scope.preset.lint) utils.renderTemplate(utils.join(__dirname, 'lint'), scope)
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
- <% } else if (lintConfig === 'airbnb') { %>'airbnb-base'
33
- <% } else if (lintConfig === 'prettier') { %>// https://github.com/prettier/eslint-config-prettier#installation
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
- <% } else if (lintConfig === 'airbnb') { %>
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(__dirname, 'BASE'), scope)
70
- utils.renderTemplate(utils.join(__dirname, scope.css), scope)
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(__dirname, 'axios'), scope)
73
- if (scope.preset.i18n) utils.renderTemplate(utils.join(__dirname, 'i18n'), scope)
74
- if (scope.preset.vuex) utils.renderTemplate(utils.join(__dirname, 'vuex'), scope)
75
- if (scope.preset.lint) utils.renderTemplate(utils.join(__dirname, 'lint'), scope)
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
  }
@@ -97,6 +97,7 @@ module.exports = {
97
97
  // does not work with type definitions
98
98
  'import/named': 'off',
99
99
  <% } else if (lintConfig === 'airbnb') { %>
100
+ 'no-plusplus': 'off',
100
101
  'no-param-reassign': 'off',
101
102
  'no-void': 'off',
102
103
  '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',
@@ -27,6 +26,6 @@ module.exports = async function ({ scope, utils }) {
27
26
  utils.commonPrompts.author
28
27
  ])
29
28
 
30
- const script = require(`./${scope.scriptType}-${scope.engine}`)
29
+ const { script } = await import(`./${ scope.scriptType }-${ scope.engine }/index.js`)
31
30
  await script({ scope, utils })
32
31
  }
@@ -1,4 +1,3 @@
1
-
2
1
  const routes = [
3
2
  {
4
3
  path: '/',
@@ -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',
@@ -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(__dirname, 'BASE'), scope)
54
- utils.renderTemplate(utils.join(__dirname, scope.css), scope)
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(__dirname, 'axios'), scope)
57
- if (scope.preset.i18n) utils.renderTemplate(utils.join(__dirname, 'i18n'), scope)
58
- if (scope.preset.lint) utils.renderTemplate(utils.join(__dirname, 'lint'), scope)
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(__dirname, 'pinia'), scope)
61
- else if (scope.preset.vuex) utils.renderTemplate(utils.join(__dirname, 'vuex'), scope)
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
  }
@@ -77,6 +77,7 @@ module.exports = {
77
77
  'import/no-unresolved': 'off',
78
78
  'import/no-extraneous-dependencies': 'off',
79
79
  <% } else if (lintConfig === 'airbnb') { %>
80
+ 'no-plusplus': 'off',
80
81
  'no-param-reassign': 'off',
81
82
  'no-void': 'off',
82
83
  'no-nested-ternary': 'off',
@@ -53,7 +53,7 @@ export default configure((<% if (preset.i18n) { %>ctx<% } else { %>/* ctx */<% }
53
53
  // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
54
54
  build: {
55
55
  target: {
56
- browser: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
56
+ browser: [ 'es2022', 'firefox115', 'chrome115', 'safari14' ],
57
57
  node: 'node20'
58
58
  },
59
59
 
@@ -1,4 +1,3 @@
1
-
2
1
  const routes = [
3
2
  {
4
3
  path: '/',
@@ -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',
@@ -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(__dirname, 'BASE'), scope)
54
- utils.renderTemplate(utils.join(__dirname, scope.css), scope)
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(__dirname, 'axios'), scope)
57
- if (scope.preset.i18n) utils.renderTemplate(utils.join(__dirname, 'i18n'), scope)
58
- if (scope.preset.lint) utils.renderTemplate(utils.join(__dirname, 'lint'), scope)
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(__dirname, 'pinia'), scope)
61
- else if (scope.preset.vuex) utils.renderTemplate(utils.join(__dirname, 'vuex'), scope)
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
  }
@@ -77,6 +77,7 @@ module.exports = {
77
77
  'import/no-unresolved': 'off',
78
78
  'import/no-extraneous-dependencies': 'off',
79
79
  <% } else if (lintConfig === 'airbnb') { %>
80
+ 'no-plusplus': 'off',
80
81
  'no-param-reassign': 'off',
81
82
  'no-void': 'off',
82
83
  'no-nested-ternary': 'off',
@@ -1,4 +1,3 @@
1
-
2
1
  const routes = [
3
2
  {
4
3
  path: '/',
@@ -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',
@@ -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(__dirname, 'BASE'), scope)
54
- utils.renderTemplate(utils.join(__dirname, scope.css), scope)
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(__dirname, 'axios'), scope)
57
- if (scope.preset.i18n) utils.renderTemplate(utils.join(__dirname, 'i18n'), scope)
58
- if (scope.preset.lint) utils.renderTemplate(utils.join(__dirname, 'lint'), scope)
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(__dirname, 'pinia'), scope)
61
- else if (scope.preset.vuex) utils.renderTemplate(utils.join(__dirname, 'vuex'), scope)
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
  }
@@ -78,6 +78,7 @@ module.exports = {
78
78
  'import/no-unresolved': 'off',
79
79
  'import/no-extraneous-dependencies': 'off',
80
80
  <% } else if (lintConfig === 'airbnb') { %>
81
+ 'no-plusplus': 'off',
81
82
  'no-param-reassign': 'off',
82
83
  'no-void': 'off',
83
84
  'no-nested-ternary': 'off',
@@ -56,7 +56,7 @@
56
56
  "last 5 Opera versions"
57
57
  ],
58
58
  "engines": {
59
- "node": "^24 || ^22 || ^20 || ^18 || ^16",
59
+ "node": "^24 || ^22 || ^20 || ^18",
60
60
  "npm": ">= 6.13.4",
61
61
  "yarn": ">= 1.21.1"
62
62
  }
@@ -57,11 +57,6 @@ export default configure((ctx) => {
57
57
  // publicPath: '/',
58
58
  vueRouterMode: 'hash', // available values: 'hash', 'history'
59
59
 
60
- esbuildTarget: {
61
- browser: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
62
- node: 'node20'
63
- },
64
-
65
60
  // webpackTranspile: false,
66
61
 
67
62
  // Add dependencies for transpiling with Babel (Array of string/regex)
@@ -69,6 +64,11 @@ export default configure((ctx) => {
69
64
  // Applies only if "webpackTranspile" is set to true.
70
65
  // webpackTranspileDependencies: [],
71
66
 
67
+ esbuildTarget: {
68
+ browser: [ 'es2022', 'firefox115', 'chrome115', 'safari14' ],
69
+ node: 'node20'
70
+ },
71
+
72
72
  // rtl: true, // https://quasar.dev/options/rtl-support
73
73
  // preloadChunks: true,
74
74
  // showProgress: false,
@@ -1,4 +1,3 @@
1
-
2
1
  const routes = [
3
2
  {
4
3
  path: '/',