create-quasar 2.1.0 → 2.1.1

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 (68) hide show
  1. package/index.js +72 -54
  2. package/package.json +14 -16
  3. package/scripts/create-test-project.ts +28 -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 -2
  6. package/templates/app/create-quasar-script.js +8 -0
  7. package/templates/app/quasar-v2/{index.js → create-quasar-script.js} +22 -8
  8. package/templates/app/quasar-v2/js-vite-2/BASE/_package.json +3 -3
  9. package/templates/app/quasar-v2/{ts-webpack-4/index.js → js-vite-2/create-quasar-script.js} +12 -3
  10. package/templates/app/quasar-v2/js-webpack-4/BASE/_package.json +1 -1
  11. package/templates/app/quasar-v2/{js-vite-2/index.js → js-webpack-4/create-quasar-script.js} +12 -3
  12. package/templates/app/quasar-v2/ts-vite-2/BASE/_package.json +3 -3
  13. package/templates/app/quasar-v2/ts-vite-2/{index.js → create-quasar-script.js} +12 -3
  14. package/templates/app/quasar-v2/ts-webpack-4/BASE/_package.json +1 -1
  15. package/templates/app/quasar-v2/{js-webpack-4/index.js → ts-webpack-4/create-quasar-script.js} +12 -3
  16. package/templates/app-extension/{eslint.config.js → __eslint.config.js} +2 -2
  17. package/templates/app-extension/ae-js/{index.js → create-quasar-script.js} +9 -4
  18. package/templates/app-extension/ae-ts/BASE/_eslint.config.js +3 -2
  19. package/templates/app-extension/ae-ts/BASE/_package.json +2 -2
  20. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/quasar.config.ts +0 -2
  21. package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/quasar.config.ts +0 -2
  22. package/templates/app-extension/ae-ts/{index.js → create-quasar-script.js} +11 -6
  23. package/templates/app-extension/create-quasar-script.js +16 -0
  24. package/templates/ui-kit/{eslint.config.js → __eslint.config.js} +2 -2
  25. package/templates/ui-kit/{index.js → create-quasar-script.js} +8 -5
  26. package/templates/ui-kit/quasar-v2/{index.js → create-quasar-script.js} +5 -2
  27. package/test-project/.editorconfig +7 -0
  28. package/test-project/.prettierrc.json +5 -0
  29. package/test-project/.vscode/extensions.json +15 -0
  30. package/test-project/.vscode/settings.json +9 -0
  31. package/test-project/README.md +43 -0
  32. package/test-project/eslint.config.js +83 -0
  33. package/test-project/index.html +24 -0
  34. package/test-project/package.json +45 -0
  35. package/test-project/pnpm-lock.yaml +5293 -0
  36. package/test-project/pnpm-workspace.yaml +6 -0
  37. package/test-project/postcss.config.js +29 -0
  38. package/test-project/public/favicon.ico +0 -0
  39. package/test-project/public/icons/favicon-128x128.png +0 -0
  40. package/test-project/public/icons/favicon-16x16.png +0 -0
  41. package/test-project/public/icons/favicon-32x32.png +0 -0
  42. package/test-project/public/icons/favicon-96x96.png +0 -0
  43. package/test-project/quasar.config.ts +217 -0
  44. package/test-project/src/App.vue +7 -0
  45. package/test-project/src/assets/quasar-logo-vertical.svg +15 -0
  46. package/test-project/src/boot/.gitkeep +0 -0
  47. package/test-project/src/components/EssentialLink.vue +27 -0
  48. package/test-project/src/components/ExampleComponent.vue +37 -0
  49. package/test-project/src/components/models.ts +8 -0
  50. package/test-project/src/css/app.scss +1 -0
  51. package/test-project/src/css/quasar.variables.scss +25 -0
  52. package/test-project/src/env.d.ts +7 -0
  53. package/test-project/src/layouts/MainLayout.vue +81 -0
  54. package/test-project/src/pages/ErrorNotFound.vue +23 -0
  55. package/test-project/src/pages/IndexPage.vue +43 -0
  56. package/test-project/src/router/index.ts +37 -0
  57. package/test-project/src/router/routes.ts +18 -0
  58. package/test-project/tsconfig.json +3 -0
  59. package/utils/index.js +107 -90
  60. package/utils/logger.js +52 -50
  61. package/eslint.config.base.js +0 -19
  62. package/eslint.config.js +0 -47
  63. package/templates/app/index.js +0 -8
  64. package/templates/app-extension/index.js +0 -15
  65. /package/templates/app/quasar-v2/js-vite-2/{.eslintrc.cjs → __.eslintrc.cjs} +0 -0
  66. /package/templates/app/quasar-v2/js-webpack-4/{.eslintrc.cjs → __.eslintrc.cjs} +0 -0
  67. /package/templates/app/quasar-v2/ts-vite-2/{.eslintrc.cjs → __.eslintrc.cjs} +0 -0
  68. /package/templates/app/quasar-v2/ts-webpack-4/{.eslintrc.cjs → __.eslintrc.cjs} +0 -0
@@ -1,4 +1,4 @@
1
- export async function script ({ scope, utils }) {
1
+ export async function createQuasarScript({ scope, utils }) {
2
2
  await utils.prompts(scope, [
3
3
  {
4
4
  type: 'confirm',
@@ -16,8 +16,9 @@ export async function script ({ scope, utils }) {
16
16
  {
17
17
  type: 'text',
18
18
  name: 'name',
19
- message: 'Quasar App Extension ext-id (without "quasar-app-extension" prefix), eg. "my-ext"',
20
- validate: (val) =>
19
+ message:
20
+ 'Quasar App Extension ext-id (without "quasar-app-extension" prefix), eg. "my-ext"',
21
+ validate: val =>
21
22
  utils.isValidPackageName(val) || 'Invalid App Extension name'
22
23
  },
23
24
 
@@ -27,7 +28,11 @@ export async function script ({ scope, utils }) {
27
28
  message: 'Pick AE code format:',
28
29
  initial: 0,
29
30
  choices: [
30
- { title: 'ESM (q/app-vite >= 1.5, q/app-webpack >= 3.10)', value: 'esm', description: 'recommended' },
31
+ {
32
+ title: 'ESM (q/app-vite >= 1.5, q/app-webpack >= 3.10)',
33
+ value: 'esm',
34
+ description: 'recommended'
35
+ },
31
36
  { title: 'CommonJS', value: 'commonjs' }
32
37
  ]
33
38
  },
@@ -1,11 +1,12 @@
1
1
  import eslint from '@eslint/js';
2
- import tseslint from 'typescript-eslint';
2
+ import { defineConfig } from 'eslint/config';
3
3
  import pluginVue from 'eslint-plugin-vue';
4
4
  import configPrettier from 'eslint-config-prettier';
5
5
  import globals from 'globals';
6
+ import tseslint from 'typescript-eslint';
6
7
  import { version as vueVersion } from 'vue';
7
8
 
8
- export default tseslint.config(
9
+ export default defineConfig(
9
10
  {
10
11
  name: 'eslint/recommended',
11
12
  ...eslint.configs.recommended,
@@ -24,11 +24,11 @@
24
24
  "format:root": "prettier --write \"./*.{json,md,vue,js,ts,yml}\" \"./.vscode/*.json\" --ignore-path .gitignore"
25
25
  },
26
26
  "devDependencies": {
27
- "@eslint/js": "^9.8.0",
27
+ "@eslint/js": "^9.39.4",
28
28
  "@types/eslint": "^9.6.0",
29
29
  "@types/eslint__js": "^8.42.3",
30
30
  "@types/node": "^20.12.8",
31
- "eslint": "^10.0.3",
31
+ "eslint": "^9.39.4",
32
32
  "eslint-config-prettier": "^9.1.0",
33
33
  "eslint-plugin-vue": "^9.27.0",
34
34
  "globals": "^17.4.0",
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  // Configuration for your app
4
2
  // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
5
3
 
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  // Configuration for your app
4
2
  // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js
5
3
 
@@ -1,4 +1,4 @@
1
- export async function script ({ scope, utils }) {
1
+ export async function createQuasarScript({ scope, utils }) {
2
2
  await utils.prompts(scope, [
3
3
  {
4
4
  type: 'confirm',
@@ -16,12 +16,13 @@ export async function script ({ scope, utils }) {
16
16
  {
17
17
  type: 'text',
18
18
  name: 'name',
19
- message: 'Quasar App Extension ext-id (without "quasar-app-extension" prefix), eg. "my-ext"',
20
- validate: (val) =>
19
+ message:
20
+ 'Quasar App Extension ext-id (without "quasar-app-extension" prefix), eg. "my-ext"',
21
+ validate: val =>
21
22
  utils.isValidPackageName(val) || 'Invalid App Extension name'
22
23
  },
23
24
 
24
- utils.commonPrompts.description,
25
+ utils.commonPrompts.description
25
26
  ])
26
27
 
27
28
  await utils.injectAuthor(scope)
@@ -55,10 +56,14 @@ export async function script ({ scope, utils }) {
55
56
  }
56
57
  ])
57
58
 
58
- scope.pkgName = scope.needOrgName ? `@${scope.orgName}/quasar-app-extension-${scope.name}` : `quasar-app-extension-${scope.name}`
59
+ scope.pkgName = scope.needOrgName
60
+ ? `@${scope.orgName}/quasar-app-extension-${scope.name}`
61
+ : `quasar-app-extension-${scope.name}`
59
62
  const packageManager = utils.runningPackageManager
60
63
  scope.packageManager = packageManager
61
- scope.packageManagerField = packageManager ? `${packageManager.name}@${packageManager.version}` : undefined
64
+ scope.packageManagerField = packageManager
65
+ ? `${packageManager.name}@${packageManager.version}`
66
+ : void 0
62
67
 
63
68
  utils.createTargetDir(scope)
64
69
  utils.renderTemplate('BASE', scope)
@@ -0,0 +1,16 @@
1
+ export async function createQuasarScript({ scope, utils }) {
2
+ /**
3
+ * Temporarily disable scriptType prompt (TS not ready yet)
4
+ */
5
+
6
+ // await utils.prompts(scope, [
7
+ // utils.commonPrompts.scriptType
8
+ // ])
9
+
10
+ // const { createQuasarScript: create } = await import(`./ae-${ scope.scriptType }/create-quasar-script.js`)
11
+ // await create({ scope, utils })
12
+
13
+ const { createQuasarScript: create } =
14
+ await import('./ae-js/create-quasar-script.js')
15
+ await create({ scope, utils })
16
+ }
@@ -1,8 +1,8 @@
1
+ import { defineConfig } from 'eslint/config'
1
2
  import globals from 'globals'
2
- import tseslint from 'typescript-eslint'
3
3
  import baseConfig from '../eslint.config.base.js'
4
4
 
5
- export default tseslint.config(
5
+ export default defineConfig(
6
6
  ...baseConfig,
7
7
 
8
8
  {
@@ -1,10 +1,11 @@
1
- export async function script ({ scope, utils }) {
1
+ export async function createQuasarScript({ scope, utils }) {
2
2
  await utils.prompts(scope, [
3
3
  {
4
4
  type: 'text',
5
5
  name: 'name',
6
- message: 'Project name (npm name, kebab-case, without "quasar-ui" prefix)',
7
- validate: (val) =>
6
+ message:
7
+ 'Project name (npm name, kebab-case, without "quasar-ui" prefix)',
8
+ validate: val =>
8
9
  utils.isValidPackageName(val) || 'Invalid package.json name'
9
10
  }
10
11
  ])
@@ -97,8 +98,10 @@ export async function script ({ scope, utils }) {
97
98
  }
98
99
  ])
99
100
 
100
- const { script } = await import(`./quasar-v2/index.js`)
101
- await script({ scope, utils })
101
+ const { createQuasarScript: create } = await import(
102
+ `./quasar-v2/create-quasar-script.js`
103
+ )
104
+ create({ scope, utils })
102
105
 
103
106
  // we don't want to install
104
107
  scope.skipDepsInstall = true
@@ -1,4 +1,4 @@
1
- export async function script ({ scope, utils }) {
1
+ export function createQuasarScript({ scope, utils }) {
2
2
  utils.createTargetDir(scope)
3
3
  utils.renderTemplate('BASE', scope)
4
4
 
@@ -12,7 +12,10 @@ export async function script ({ scope, utils }) {
12
12
  if (scope.features.component) utils.renderTemplate('ui-component', scope)
13
13
  if (scope.features.directive) utils.renderTemplate('ui-directive', scope)
14
14
 
15
- if (scope.features.ae && (scope.features.component || scope.features.directive)) {
15
+ if (
16
+ scope.features.ae &&
17
+ (scope.features.component || scope.features.directive)
18
+ ) {
16
19
  utils.renderTemplate('ui-ae', scope)
17
20
  }
18
21
  }
@@ -0,0 +1,7 @@
1
+ [*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
2
+ charset = utf-8
3
+ indent_size = 2
4
+ indent_style = space
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "singleQuote": true,
4
+ "printWidth": 100
5
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "recommendations": [
3
+ "dbaeumer.vscode-eslint",
4
+ "esbenp.prettier-vscode",
5
+ "editorconfig.editorconfig",
6
+ "vue.volar",
7
+ "wayou.vscode-todo-highlight"
8
+ ],
9
+ "unwantedRecommendations": [
10
+ "octref.vetur",
11
+ "hookyqr.beautify",
12
+ "dbaeumer.jshint",
13
+ "ms-vscode.vscode-typescript-tslint-plugin"
14
+ ]
15
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "editor.bracketPairColorization.enabled": true,
3
+ "editor.guides.bracketPairs": true,
4
+ "editor.formatOnSave": true,
5
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
6
+ "editor.codeActionsOnSave": ["source.fixAll.eslint"],
7
+ "eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
8
+ "typescript.tsdk": "node_modules/typescript/lib"
9
+ }
@@ -0,0 +1,43 @@
1
+ # Quasar App (test-project)
2
+
3
+ A Quasar Project
4
+
5
+ ## Install the dependencies
6
+
7
+ ```bash
8
+ yarn
9
+ # or
10
+ npm install
11
+ ```
12
+
13
+ ### Start the app in development mode (hot-code reloading, error reporting, etc.)
14
+
15
+ ```bash
16
+ quasar dev
17
+ ```
18
+
19
+ ### Lint the files
20
+
21
+ ```bash
22
+ yarn lint
23
+ # or
24
+ npm run lint
25
+ ```
26
+
27
+ ### Format the files
28
+
29
+ ```bash
30
+ yarn format
31
+ # or
32
+ npm run format
33
+ ```
34
+
35
+ ### Build the app for production
36
+
37
+ ```bash
38
+ quasar build
39
+ ```
40
+
41
+ ### Customize the configuration
42
+
43
+ See [Configuring quasar.config.js](https://v2.quasar.dev/quasar-cli-vite/quasar-config-js).
@@ -0,0 +1,83 @@
1
+ import js from '@eslint/js';
2
+ import globals from 'globals';
3
+ import pluginVue from 'eslint-plugin-vue';
4
+ import pluginQuasar from '@quasar/app-vite/eslint';
5
+ import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript';
6
+ import prettierSkipFormatting from '@vue/eslint-config-prettier/skip-formatting';
7
+
8
+ export default defineConfigWithVueTs(
9
+ {
10
+ /**
11
+ * Ignore the following files.
12
+ * Please note that pluginQuasar.configs.recommended() already ignores
13
+ * the "node_modules" folder for you (and all other Quasar project
14
+ * relevant folders and files).
15
+ *
16
+ * ESLint requires "ignores" key to be the only one in this object
17
+ */
18
+ // ignores: []
19
+ },
20
+
21
+ pluginQuasar.configs.recommended(),
22
+ js.configs.recommended,
23
+
24
+ /**
25
+ * https://eslint.vuejs.org
26
+ *
27
+ * pluginVue.configs.base
28
+ * -> Settings and rules to enable correct ESLint parsing.
29
+ * pluginVue.configs[ 'flat/essential']
30
+ * -> base, plus rules to prevent errors or unintended behavior.
31
+ * pluginVue.configs["flat/strongly-recommended"]
32
+ * -> Above, plus rules to considerably improve code readability and/or dev experience.
33
+ * pluginVue.configs["flat/recommended"]
34
+ * -> Above, plus rules to enforce subjective community defaults to ensure consistency.
35
+ */
36
+ pluginVue.configs['flat/essential'],
37
+
38
+ {
39
+ files: ['**/*.ts', '**/*.vue'],
40
+ rules: {
41
+ '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
42
+ },
43
+ },
44
+ // https://github.com/vuejs/eslint-config-typescript
45
+ vueTsConfigs.recommendedTypeChecked,
46
+
47
+ {
48
+ languageOptions: {
49
+ ecmaVersion: 'latest',
50
+ sourceType: 'module',
51
+
52
+ globals: {
53
+ ...globals.browser,
54
+ ...globals.node, // SSR, Electron, config files
55
+ process: 'readonly', // process.env.*
56
+ ga: 'readonly', // Google Analytics
57
+ cordova: 'readonly',
58
+ Capacitor: 'readonly',
59
+ chrome: 'readonly', // BEX related
60
+ browser: 'readonly', // BEX related
61
+ },
62
+ },
63
+
64
+ // add your custom rules here
65
+ rules: {
66
+ 'prefer-promise-reject-errors': 'off',
67
+
68
+ // allow debugger during development only
69
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
70
+ },
71
+ },
72
+
73
+ {
74
+ files: ['src-pwa/custom-service-worker.ts'],
75
+ languageOptions: {
76
+ globals: {
77
+ ...globals.serviceworker,
78
+ },
79
+ },
80
+ },
81
+
82
+ prettierSkipFormatting,
83
+ );
@@ -0,0 +1,24 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title><%= productName %></title>
5
+
6
+ <meta charset="utf-8" />
7
+ <meta name="description" content="<%= productDescription %>" />
8
+ <meta name="format-detection" content="telephone=no" />
9
+ <meta name="msapplication-tap-highlight" content="no" />
10
+ <meta
11
+ name="viewport"
12
+ 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<% } %>"
13
+ />
14
+
15
+ <link rel="icon" type="image/png" sizes="128x128" href="icons/favicon-128x128.png" />
16
+ <link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png" />
17
+ <link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png" />
18
+ <link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png" />
19
+ <link rel="icon" type="image/ico" href="favicon.ico" />
20
+ </head>
21
+ <body>
22
+ <!-- quasar:entry-point -->
23
+ </body>
24
+ </html>
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "test-project",
3
+ "version": "0.0.1",
4
+ "description": "A Quasar Project",
5
+ "productName": "Quasar App",
6
+ "author": "Yusuf Kandemir <yusuf.kandemir@outlook.com.tr>",
7
+ "type": "module",
8
+ "private": true,
9
+ "scripts": {
10
+ "lint": "eslint -c ./eslint.config.js \"./src*/**/*.{ts,js,cjs,mjs,vue}\"",
11
+ "format": "prettier --write \"**/*.{js,ts,vue,scss,html,md,json}\" --ignore-path .gitignore",
12
+ "test": "echo \"No test specified\" && exit 0",
13
+ "dev": "quasar dev",
14
+ "build": "quasar build",
15
+ "postinstall": "quasar prepare"
16
+ },
17
+ "dependencies": {
18
+ "@quasar/extras": "^1.16.4",
19
+ "quasar": "^2.16.0",
20
+ "vue": "^3.5.22",
21
+ "vue-router": "^5.0.3"
22
+ },
23
+ "devDependencies": {
24
+ "@eslint/js": "^10.0.1",
25
+ "eslint": "^10.0.3",
26
+ "eslint-plugin-vue": "^10.8.0",
27
+ "globals": "^17.4.0",
28
+ "vue-tsc": "^3.2.6",
29
+ "@vue/eslint-config-typescript": "^14.7.0",
30
+ "vite-plugin-checker": "^0.12.0",
31
+ "vue-eslint-parser": "^10.4.0",
32
+ "@vue/eslint-config-prettier": "^10.2.0",
33
+ "prettier": "^3.8.1",
34
+ "@types/node": "^22.19.11",
35
+ "@quasar/app-vite": "^2.5.1",
36
+ "autoprefixer": "^10.4.27",
37
+ "typescript": "^5.9.3"
38
+ },
39
+ "engines": {
40
+ "node": "^28 || ^26 || ^24 || ^22.12",
41
+ "npm": ">= 6.13.4",
42
+ "yarn": ">= 1.21.1",
43
+ "pnpm": ">= 10.0.0"
44
+ }
45
+ }