create-quasar 1.8.2 → 1.8.4
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 +1 -0
- package/README.md +7 -1
- package/index.js +2 -2
- package/package.json +11 -12
- package/scripts/create-test-project.ts +6 -2
- package/templates/app/quasar-v1/js/BASE/_package.json +1 -1
- package/templates/app/quasar-v1/ts/BASE/_package.json +1 -1
- package/templates/app/quasar-v2/js-vite-1/BASE/_package.json +3 -3
- package/templates/app/quasar-v2/js-vite-2/BASE/_package.json +3 -4
- package/templates/app/quasar-v2/js-vite-2/BASE/{postcss.config.cjs → postcss.config.js} +9 -6
- package/templates/app/quasar-v2/js-vite-2/index.js +1 -16
- package/templates/app/quasar-v2/js-webpack-3/BASE/_package.json +3 -3
- package/templates/app/quasar-v2/js-webpack-4/BASE/_package.json +3 -4
- package/templates/app/quasar-v2/js-webpack-4/index.js +1 -16
- package/templates/app/quasar-v2/ts-vite-1/BASE/_package.json +3 -3
- package/templates/app/quasar-v2/ts-vite-2/BASE/_package.json +3 -4
- package/templates/app/quasar-v2/ts-vite-2/BASE/{postcss.config.cjs → postcss.config.js} +9 -6
- package/templates/app/quasar-v2/ts-vite-2/BASE/src/router/index.ts +1 -3
- package/templates/app/quasar-v2/ts-vite-2/index.js +1 -15
- package/templates/app/quasar-v2/ts-webpack-3/BASE/_package.json +3 -3
- package/templates/app/quasar-v2/ts-webpack-4/BASE/_package.json +3 -4
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/router/index.ts +2 -3
- package/templates/app/quasar-v2/ts-webpack-4/index.js +1 -15
- package/templates/ui-kit/quasar-v2/BASE/ui/_package.json +2 -2
- package/utils/index.js +8 -1
- package/templates/app/quasar-v2/js-vite-2/vuex/src/store/index.js +0 -27
- package/templates/app/quasar-v2/js-vite-2/vuex/src/store/module-example/actions.js +0 -2
- package/templates/app/quasar-v2/js-vite-2/vuex/src/store/module-example/getters.js +0 -2
- package/templates/app/quasar-v2/js-vite-2/vuex/src/store/module-example/index.js +0 -12
- package/templates/app/quasar-v2/js-vite-2/vuex/src/store/module-example/mutations.js +0 -2
- package/templates/app/quasar-v2/js-vite-2/vuex/src/store/module-example/state.js +0 -5
- package/templates/app/quasar-v2/js-vite-2/vuex/src/store/store-flag.d.ts +0 -10
- package/templates/app/quasar-v2/js-webpack-4/vuex/src/store/index.js +0 -27
- package/templates/app/quasar-v2/js-webpack-4/vuex/src/store/module-example/actions.js +0 -2
- package/templates/app/quasar-v2/js-webpack-4/vuex/src/store/module-example/getters.js +0 -2
- package/templates/app/quasar-v2/js-webpack-4/vuex/src/store/module-example/index.js +0 -12
- package/templates/app/quasar-v2/js-webpack-4/vuex/src/store/module-example/mutations.js +0 -2
- package/templates/app/quasar-v2/js-webpack-4/vuex/src/store/module-example/state.js +0 -5
- package/templates/app/quasar-v2/js-webpack-4/vuex/src/store/store-flag.d.ts +0 -10
- package/templates/app/quasar-v2/ts-vite-2/vuex/src/store/index.ts +0 -63
- package/templates/app/quasar-v2/ts-vite-2/vuex/src/store/module-example/actions.ts +0 -11
- package/templates/app/quasar-v2/ts-vite-2/vuex/src/store/module-example/getters.ts +0 -11
- package/templates/app/quasar-v2/ts-vite-2/vuex/src/store/module-example/index.ts +0 -16
- package/templates/app/quasar-v2/ts-vite-2/vuex/src/store/module-example/mutations.ts +0 -10
- package/templates/app/quasar-v2/ts-vite-2/vuex/src/store/module-example/state.ts +0 -11
- package/templates/app/quasar-v2/ts-vite-2/vuex/src/store/store-flag.d.ts +0 -10
- package/templates/app/quasar-v2/ts-webpack-4/vuex/src/store/index.ts +0 -63
- package/templates/app/quasar-v2/ts-webpack-4/vuex/src/store/module-example/actions.ts +0 -11
- package/templates/app/quasar-v2/ts-webpack-4/vuex/src/store/module-example/getters.ts +0 -11
- package/templates/app/quasar-v2/ts-webpack-4/vuex/src/store/module-example/index.ts +0 -16
- package/templates/app/quasar-v2/ts-webpack-4/vuex/src/store/module-example/mutations.ts +0 -10
- package/templates/app/quasar-v2/ts-webpack-4/vuex/src/store/module-example/state.ts +0 -11
- package/templates/app/quasar-v2/ts-webpack-4/vuex/src/store/store-flag.d.ts +0 -10
package/.eslintrc.cjs
CHANGED
package/README.md
CHANGED
|
@@ -13,12 +13,17 @@
|
|
|
13
13
|
This app is used to scaffold Quasar CLI project folders.
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
+
npm init quasar
|
|
17
|
+
# or:
|
|
16
18
|
yarn create quasar
|
|
17
19
|
# or:
|
|
18
|
-
|
|
20
|
+
pnpm create quasar
|
|
21
|
+
# or:
|
|
22
|
+
bun create quasar
|
|
19
23
|
```
|
|
20
24
|
|
|
21
25
|
## Supporting Quasar
|
|
26
|
+
|
|
22
27
|
Quasar Framework is an MIT-licensed open source project. Its ongoing development is made possible thanks to the support by these awesome [backers](https://github.com/rstoenescu/quasar-framework/blob/dev/backers.md).
|
|
23
28
|
|
|
24
29
|
**Please read our manifest on [Why donations are important](https://quasar.dev/why-donate)**. If you'd like to become a donator, check out [Quasar Framework's Donator campaign](https://donate.quasar.dev).
|
|
@@ -44,6 +49,7 @@ Ask questions at the official community forum: [https://forum.quasar.dev](https:
|
|
|
44
49
|
I'm excited if you want to contribute to Quasar under any form (report bugs, write a plugin, fix an issue, write a new feature). Please read the [Contributing Guide](../CONTRIBUTING.md).
|
|
45
50
|
|
|
46
51
|
## Semver
|
|
52
|
+
|
|
47
53
|
Quasar is following [Semantic Versioning 2.0](https://semver.org/).
|
|
48
54
|
|
|
49
55
|
## License
|
package/index.js
CHANGED
|
@@ -87,9 +87,9 @@ if (scope.skipDepsInstall !== true) {
|
|
|
87
87
|
]
|
|
88
88
|
: [
|
|
89
89
|
{ title: 'Yes, use Yarn (recommended)', value: 'yarn' },
|
|
90
|
+
{ title: 'Yes, use PNPM (recommended)', value: 'pnpm' },
|
|
90
91
|
{ title: 'Yes, use NPM', value: 'npm' },
|
|
91
|
-
{ title: 'Yes, use
|
|
92
|
-
{ title: 'Yes, use Bun (experimental support)', value: 'bun' },
|
|
92
|
+
{ title: 'Yes, use Bun', value: 'bun' },
|
|
93
93
|
{ title: 'No, I will handle that myself', value: false }
|
|
94
94
|
]
|
|
95
95
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-quasar",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.4",
|
|
4
4
|
"description": "Scaffolds Quasar Apps, AppExtensions or UI kits",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -26,10 +26,6 @@
|
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=16"
|
|
28
28
|
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"lint": "eslint --ext .js,.ts ./ --fix",
|
|
31
|
-
"create-test-project": "tsx scripts/create-test-project.ts"
|
|
32
|
-
},
|
|
33
29
|
"dependencies": {
|
|
34
30
|
"fast-glob": "^3.3.2",
|
|
35
31
|
"fs-extra": "^11.2.0",
|
|
@@ -38,13 +34,16 @@
|
|
|
38
34
|
"prompts": "^2.4.2"
|
|
39
35
|
},
|
|
40
36
|
"devDependencies": {
|
|
41
|
-
"@types/lodash": "^4.
|
|
37
|
+
"@types/lodash": "^4.17.0",
|
|
42
38
|
"@types/prompts": "^2.4.7",
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "^7.1
|
|
44
|
-
"@typescript-eslint/parser": "^7.1
|
|
45
|
-
"eslint": "^8.57.0",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
|
40
|
+
"@typescript-eslint/parser": "^7.7.1",
|
|
46
41
|
"eslint-plugin-lodash-template": "^1.0.0",
|
|
47
|
-
"tsx": "^4.7.
|
|
48
|
-
"typescript": "^5.
|
|
42
|
+
"tsx": "^4.7.2",
|
|
43
|
+
"typescript": "^5.4.5"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"lint": "eslint --ext .js,.ts ./ --fix",
|
|
47
|
+
"create-test-project": "tsx scripts/create-test-project.ts"
|
|
49
48
|
}
|
|
50
|
-
}
|
|
49
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import prompts from 'prompts';
|
|
2
2
|
|
|
3
3
|
type ScriptType = 'js' | 'ts';
|
|
4
4
|
type AppEngine = 'vite' | 'webpack';
|
|
@@ -13,8 +13,12 @@ type CreateProjectOptions = {
|
|
|
13
13
|
export async function createProject({ scriptType, appEngine, packageManager }: CreateProjectOptions) {
|
|
14
14
|
// To bypass Corepack enforcing what's specified in the closest package.json file that has the 'packageManager' field
|
|
15
15
|
process.env.COREPACK_ENABLE_STRICT = '0';
|
|
16
|
+
// See https://github.com/yarnpkg/yarn/issues/9015
|
|
17
|
+
process.env.SKIP_YARN_COREPACK_CHECK = '1';
|
|
18
|
+
// To alter the behavior to run correctly within this script
|
|
19
|
+
process.env.CREATE_TEST_PROJECT_OVERRIDE = 'true';
|
|
16
20
|
|
|
17
|
-
override({
|
|
21
|
+
prompts.override({
|
|
18
22
|
projectType: 'app',
|
|
19
23
|
projectFolder: 'test-project',
|
|
20
24
|
overwrite: true,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<% if (preset.lint) { %>
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
|
28
28
|
"@typescript-eslint/parser": "^5.10.0",
|
|
29
|
-
"eslint": "^8.
|
|
29
|
+
"eslint": "^8.57.0",
|
|
30
30
|
"eslint-plugin-vue": "^9.0.0",
|
|
31
31
|
<% if (lintConfig === 'standard') { %>
|
|
32
32
|
"eslint-config-standard": "^17.0.0",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
<% if (preset.pinia) { %>"pinia": "^2.0.11",<% } %>
|
|
20
20
|
<% if (preset.vuex) { %>"vuex": "^4.0.1",<% } %>
|
|
21
21
|
"@quasar/extras": "^1.16.4",
|
|
22
|
-
"quasar": "^2.
|
|
22
|
+
"quasar": "^2.16.0",
|
|
23
23
|
"vue": "^3.4.18",
|
|
24
24
|
"vue-router": "^4.0.12"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
<% if (preset.lint) { %>
|
|
28
|
-
"eslint": "^8.
|
|
28
|
+
"eslint": "^8.57.0",
|
|
29
29
|
"eslint-plugin-vue": "^9.0.0",
|
|
30
30
|
"vite-plugin-checker": "^0.6.4",
|
|
31
31
|
<% if (lintConfig === 'standard') { %>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"prettier": "^2.5.1",
|
|
42
42
|
<% } } %>
|
|
43
43
|
<% if (preset.i18n) { %>"@intlify/vite-plugin-vue-i18n": "^3.3.1",<% } %>
|
|
44
|
-
"@quasar/app-vite": "^1.
|
|
44
|
+
"@quasar/app-vite": "^1.9.0",
|
|
45
45
|
"autoprefixer": "^10.4.2",
|
|
46
46
|
"postcss": "^8.4.14"
|
|
47
47
|
},
|
|
@@ -18,16 +18,15 @@
|
|
|
18
18
|
<% if (preset.axios) { %>"axios": "^1.2.1",<% } %>
|
|
19
19
|
<% if (preset.i18n) { %>"vue-i18n": "^9.0.0",<% } %>
|
|
20
20
|
<% if (preset.pinia) { %>"pinia": "^2.0.11",<% } %>
|
|
21
|
-
<% if (preset.vuex) { %>"vuex": "^4.0.1",<% } %>
|
|
22
21
|
"@quasar/extras": "^1.16.4",
|
|
23
|
-
"quasar": "^2.
|
|
22
|
+
"quasar": "^2.16.0",
|
|
24
23
|
"vue": "^3.4.18",
|
|
25
24
|
"vue-router": "^4.0.0"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
<% if (preset.lint) { %>
|
|
29
28
|
"vite-plugin-checker": "^0.6.4",
|
|
30
|
-
"eslint": "^8.
|
|
29
|
+
"eslint": "^8.57.0",
|
|
31
30
|
"eslint-plugin-vue": "^9.0.0",
|
|
32
31
|
<% if (lintConfig === 'standard') { %>
|
|
33
32
|
"eslint-config-standard": "^17.0.0",
|
|
@@ -42,7 +41,7 @@
|
|
|
42
41
|
"prettier": "^3.0.3",
|
|
43
42
|
<% } } %>
|
|
44
43
|
<% if (preset.i18n) { %>"@intlify/unplugin-vue-i18n": "^2.0.0",<% } %>
|
|
45
|
-
"@quasar/app-vite": "^2.0.0-beta.
|
|
44
|
+
"@quasar/app-vite": "^2.0.0-beta.12",
|
|
46
45
|
"autoprefixer": "^10.4.2",
|
|
47
46
|
"postcss": "^8.4.14"
|
|
48
47
|
},
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
// https://github.com/michael-ciniawsky/postcss-load-config
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import autoprefixer from 'autoprefixer'
|
|
5
|
+
// import rtlcss from 'postcss-rtlcss'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
5
8
|
plugins: [
|
|
6
9
|
// https://github.com/postcss/autoprefixer
|
|
7
|
-
|
|
10
|
+
autoprefixer({
|
|
8
11
|
overrideBrowserslist: [
|
|
9
12
|
'last 4 Chrome versions',
|
|
10
13
|
'last 4 Firefox versions',
|
|
@@ -15,13 +18,13 @@ module.exports = {
|
|
|
15
18
|
'last 4 FirefoxAndroid versions',
|
|
16
19
|
'last 4 iOS versions'
|
|
17
20
|
]
|
|
18
|
-
})
|
|
21
|
+
}),
|
|
19
22
|
|
|
20
23
|
// https://github.com/elchininet/postcss-rtlcss
|
|
21
24
|
// If you want to support RTL css, then
|
|
22
|
-
// 1. yarn/npm install postcss-rtlcss
|
|
25
|
+
// 1. yarn/pnpm/bun/npm install postcss-rtlcss
|
|
23
26
|
// 2. optionally set quasar.config.js > framework > lang to an RTL language
|
|
24
|
-
// 3. uncomment the following line:
|
|
25
|
-
//
|
|
27
|
+
// 3. uncomment the following line (and its import statement above):
|
|
28
|
+
// rtlcss()
|
|
26
29
|
]
|
|
27
30
|
}
|
|
@@ -7,23 +7,10 @@ export async function script ({ scope, utils }) {
|
|
|
7
7
|
choices: [
|
|
8
8
|
{ title: 'Linting (vite-plugin-checker + ESLint)', value: 'lint', description: 'recommended', selected: true },
|
|
9
9
|
{ title: 'State Management (Pinia)', value: 'pinia', description: 'https://pinia.vuejs.org' },
|
|
10
|
-
{ title: 'State Management (Vuex) [DEPRECATED by Vue Team]', value: 'vuex', description: 'See https://vuejs.org/guide/scaling-up/state-management.html#pinia' },
|
|
11
10
|
{ title: 'axios', value: 'axios' },
|
|
12
11
|
{ title: 'vue-i18n', value: 'i18n' }
|
|
13
12
|
],
|
|
14
|
-
format:
|
|
15
|
-
let result = values
|
|
16
|
-
|
|
17
|
-
if (values.includes('vuex') && values.includes('pinia')) {
|
|
18
|
-
console.log()
|
|
19
|
-
utils.logger.warn('Only one state management package can be used. Picking the recommended Pinia and dropping Vuex.')
|
|
20
|
-
console.log()
|
|
21
|
-
|
|
22
|
-
result = values.filter(entry => entry !== 'vuex')
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return utils.convertArrayToObject(result)
|
|
26
|
-
}
|
|
13
|
+
format: utils.convertArrayToObject
|
|
27
14
|
},
|
|
28
15
|
{
|
|
29
16
|
type: (_, { preset }) => (preset.lint ? 'select' : null),
|
|
@@ -44,7 +31,5 @@ export async function script ({ scope, utils }) {
|
|
|
44
31
|
if (scope.preset.axios) utils.renderTemplate('axios', scope)
|
|
45
32
|
if (scope.preset.i18n) utils.renderTemplate('i18n', scope)
|
|
46
33
|
if (scope.preset.lint) utils.renderTemplate('lint', scope)
|
|
47
|
-
|
|
48
34
|
if (scope.preset.pinia) utils.renderTemplate('pinia', scope)
|
|
49
|
-
else if (scope.preset.vuex) utils.renderTemplate('vuex', scope)
|
|
50
35
|
}
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
<% if (preset.vuex) { %>"vuex": "^4.0.1",<% } %>
|
|
21
21
|
"@quasar/extras": "^1.16.4",
|
|
22
22
|
"core-js": "^3.31.1",
|
|
23
|
-
"quasar": "^2.
|
|
23
|
+
"quasar": "^2.16.0",
|
|
24
24
|
"vue": "^3.4.18",
|
|
25
25
|
"vue-router": "^4.0.12"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
<% if (preset.lint) { %>
|
|
29
29
|
"@babel/eslint-parser": "^7.13.14",
|
|
30
|
-
"eslint": "^8.
|
|
30
|
+
"eslint": "^8.57.0",
|
|
31
31
|
"eslint-plugin-vue": "^9.0.0",
|
|
32
32
|
"eslint-webpack-plugin": "^3.1.1",
|
|
33
33
|
<% if (lintConfig === 'standard') { %>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"eslint-config-prettier": "^8.1.0",
|
|
43
43
|
"prettier": "^2.5.1",
|
|
44
44
|
<% } } %>
|
|
45
|
-
"@quasar/app-webpack": "^3.
|
|
45
|
+
"@quasar/app-webpack": "^3.13.0"
|
|
46
46
|
},
|
|
47
47
|
"browserslist": [
|
|
48
48
|
"last 10 Chrome versions",
|
|
@@ -17,17 +17,16 @@
|
|
|
17
17
|
<% if (preset.axios) { %>"axios": "^1.2.1",<% } %>
|
|
18
18
|
<% if (preset.i18n) { %>"vue-i18n": "^9.0.0",<% } %>
|
|
19
19
|
<% if (preset.pinia) { %>"pinia": "^2.0.11",<% } %>
|
|
20
|
-
<% if (preset.vuex) { %>"vuex": "^4.0.1",<% } %>
|
|
21
20
|
"@quasar/extras": "^1.16.4",
|
|
22
21
|
"core-js": "^3.31.1",
|
|
23
|
-
"quasar": "^2.
|
|
22
|
+
"quasar": "^2.16.0",
|
|
24
23
|
"vue": "^3.4.18",
|
|
25
24
|
"vue-router": "^4.0.12"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
<% if (preset.lint) { %>
|
|
29
28
|
"@babel/eslint-parser": "^7.13.14",
|
|
30
|
-
"eslint": "^8.
|
|
29
|
+
"eslint": "^8.57.0",
|
|
31
30
|
"eslint-plugin-vue": "^9.0.0",
|
|
32
31
|
"eslint-webpack-plugin": "^3.1.1",
|
|
33
32
|
<% if (lintConfig === 'standard') { %>
|
|
@@ -42,7 +41,7 @@
|
|
|
42
41
|
"eslint-config-prettier": "^9.0.0",
|
|
43
42
|
"prettier": "^3.0.3",
|
|
44
43
|
<% } } %>
|
|
45
|
-
"@quasar/app-webpack": "^4.0.0-beta.
|
|
44
|
+
"@quasar/app-webpack": "^4.0.0-beta.13"
|
|
46
45
|
},
|
|
47
46
|
"browserslist": [
|
|
48
47
|
"last 10 Chrome versions",
|
|
@@ -7,23 +7,10 @@ export async function script ({ scope, utils }) {
|
|
|
7
7
|
choices: [
|
|
8
8
|
{ title: 'Linting (ESLint)', value: 'lint', description: 'recommended', selected: true },
|
|
9
9
|
{ title: 'State Management (Pinia)', value: 'pinia', description: 'https://pinia.vuejs.org' },
|
|
10
|
-
{ title: 'State Management (Vuex) [DEPRECATED by Vue Team]', value: 'vuex', description: 'See https://vuejs.org/guide/scaling-up/state-management.html#pinia' },
|
|
11
10
|
{ title: 'axios', value: 'axios' },
|
|
12
11
|
{ title: 'vue-i18n', value: 'i18n' }
|
|
13
12
|
],
|
|
14
|
-
format:
|
|
15
|
-
let result = values
|
|
16
|
-
|
|
17
|
-
if (values.includes('vuex') && values.includes('pinia')) {
|
|
18
|
-
console.log()
|
|
19
|
-
utils.logger.warn('Only one state management package can be used. Picking the recommended Pinia and dropping Vuex.')
|
|
20
|
-
console.log()
|
|
21
|
-
|
|
22
|
-
result = values.filter(entry => entry !== 'vuex')
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return utils.convertArrayToObject(result)
|
|
26
|
-
}
|
|
13
|
+
format: utils.convertArrayToObject
|
|
27
14
|
},
|
|
28
15
|
{
|
|
29
16
|
type: (_, { preset }) => (preset.lint ? 'select' : null),
|
|
@@ -44,7 +31,5 @@ export async function script ({ scope, utils }) {
|
|
|
44
31
|
if (scope.preset.axios) utils.renderTemplate('axios', scope)
|
|
45
32
|
if (scope.preset.i18n) utils.renderTemplate('i18n', scope)
|
|
46
33
|
if (scope.preset.lint) utils.renderTemplate('lint', scope)
|
|
47
|
-
|
|
48
34
|
if (scope.preset.pinia) utils.renderTemplate('pinia', scope)
|
|
49
|
-
else if (scope.preset.vuex) utils.renderTemplate('vuex', scope)
|
|
50
35
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<% if (preset.pinia) { %>"pinia": "^2.0.11",<% } %>
|
|
20
20
|
<% if (preset.vuex) { %>"vuex": "^4.0.1",<% } %>
|
|
21
21
|
"@quasar/extras": "^1.16.4",
|
|
22
|
-
"quasar": "^2.
|
|
22
|
+
"quasar": "^2.16.0",
|
|
23
23
|
"vue": "^3.4.18",
|
|
24
24
|
"vue-router": "^4.0.12"
|
|
25
25
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@typescript-eslint/parser": "^5.10.0",
|
|
30
30
|
"vite-plugin-checker": "^0.6.4",
|
|
31
31
|
"vue-tsc": "^1.8.22",
|
|
32
|
-
"eslint": "^8.
|
|
32
|
+
"eslint": "^8.57.0",
|
|
33
33
|
"eslint-plugin-vue": "^9.0.0",
|
|
34
34
|
<% if (lintConfig === 'standard') { %>
|
|
35
35
|
"eslint-config-standard": "^17.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
<% } } %>
|
|
46
46
|
"@types/node": "^12.20.21",
|
|
47
47
|
<% if (preset.i18n) { %>"@intlify/vite-plugin-vue-i18n": "^3.3.1",<% } %>
|
|
48
|
-
"@quasar/app-vite": "^1.
|
|
48
|
+
"@quasar/app-vite": "^1.9.0",
|
|
49
49
|
"autoprefixer": "^10.4.2",
|
|
50
50
|
"typescript": "^4.5.4"
|
|
51
51
|
},
|
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
<% if (preset.axios) { %>"axios": "^1.2.1",<% } %>
|
|
19
19
|
<% if (preset.i18n) { %>"vue-i18n": "^9.2.2",<% } %>
|
|
20
20
|
<% if (preset.pinia) { %>"pinia": "^2.0.11",<% } %>
|
|
21
|
-
<% if (preset.vuex) { %>"vuex": "^4.0.1",<% } %>
|
|
22
21
|
"@quasar/extras": "^1.16.4",
|
|
23
|
-
"quasar": "^2.
|
|
22
|
+
"quasar": "^2.16.0",
|
|
24
23
|
"vue": "^3.4.18",
|
|
25
24
|
"vue-router": "^4.0.12"
|
|
26
25
|
},
|
|
@@ -30,7 +29,7 @@
|
|
|
30
29
|
"@typescript-eslint/parser": "^6.6.0",
|
|
31
30
|
"vite-plugin-checker": "^0.6.4",
|
|
32
31
|
"vue-tsc": "^1.8.22",
|
|
33
|
-
"eslint": "^8.
|
|
32
|
+
"eslint": "^8.57.0",
|
|
34
33
|
"eslint-plugin-vue": "^9.0.0",
|
|
35
34
|
<% if (lintConfig === 'standard') { %>
|
|
36
35
|
"eslint-config-standard": "^17.0.0",
|
|
@@ -46,7 +45,7 @@
|
|
|
46
45
|
<% } } %>
|
|
47
46
|
"@types/node": "^20.5.9",
|
|
48
47
|
<% if (preset.i18n) { %>"@intlify/unplugin-vue-i18n": "^2.0.0",<% } %>
|
|
49
|
-
"@quasar/app-vite": "^2.0.0-beta.
|
|
48
|
+
"@quasar/app-vite": "^2.0.0-beta.12",
|
|
50
49
|
"autoprefixer": "^10.4.2",
|
|
51
50
|
"typescript": "~5.3.0"
|
|
52
51
|
},
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
// https://github.com/michael-ciniawsky/postcss-load-config
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import autoprefixer from 'autoprefixer'
|
|
5
|
+
// import rtlcss from 'postcss-rtlcss'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
5
8
|
plugins: [
|
|
6
9
|
// https://github.com/postcss/autoprefixer
|
|
7
|
-
|
|
10
|
+
autoprefixer({
|
|
8
11
|
overrideBrowserslist: [
|
|
9
12
|
'last 4 Chrome versions',
|
|
10
13
|
'last 4 Firefox versions',
|
|
@@ -15,13 +18,13 @@ module.exports = {
|
|
|
15
18
|
'last 4 FirefoxAndroid versions',
|
|
16
19
|
'last 4 iOS versions'
|
|
17
20
|
]
|
|
18
|
-
})
|
|
21
|
+
}),
|
|
19
22
|
|
|
20
23
|
// https://github.com/elchininet/postcss-rtlcss
|
|
21
24
|
// If you want to support RTL css, then
|
|
22
|
-
// 1. yarn/npm install postcss-rtlcss
|
|
25
|
+
// 1. yarn/pnpm/bun/npm install postcss-rtlcss
|
|
23
26
|
// 2. optionally set quasar.config.js > framework > lang to an RTL language
|
|
24
|
-
// 3. uncomment the following line:
|
|
25
|
-
//
|
|
27
|
+
// 3. uncomment the following line (and its import statement above):
|
|
28
|
+
// rtlcss()
|
|
26
29
|
]
|
|
27
30
|
}
|
|
@@ -5,8 +5,6 @@ import {
|
|
|
5
5
|
createWebHashHistory,
|
|
6
6
|
createWebHistory,
|
|
7
7
|
} from 'vue-router';
|
|
8
|
-
<% if (preset.vuex) { %>import { StateInterface } from '../store';
|
|
9
|
-
<% } %>
|
|
10
8
|
import routes from './routes';
|
|
11
9
|
|
|
12
10
|
/*
|
|
@@ -18,7 +16,7 @@ import routes from './routes';
|
|
|
18
16
|
* with the Router instance.
|
|
19
17
|
*/
|
|
20
18
|
|
|
21
|
-
export default route
|
|
19
|
+
export default route(function (/* { store, ssrContext } */) {
|
|
22
20
|
const createHistory = process.env.SERVER
|
|
23
21
|
? createMemoryHistory
|
|
24
22
|
: (process.env.VUE_ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory);
|
|
@@ -7,23 +7,10 @@ export async function script ({ scope, utils }) {
|
|
|
7
7
|
choices: [
|
|
8
8
|
{ title: 'Linting (vite-plugin-checker + ESLint + vue-tsc)', value: 'lint', description: 'recommended', selected: true },
|
|
9
9
|
{ title: 'State Management (Pinia)', value: 'pinia', description: 'https://pinia.vuejs.org' },
|
|
10
|
-
{ title: 'State Management (Vuex) [DEPRECATED by Vue Team]', value: 'vuex', description: 'See https://vuejs.org/guide/scaling-up/state-management.html#pinia' },
|
|
11
10
|
{ title: 'axios', value: 'axios' },
|
|
12
11
|
{ title: 'vue-i18n', value: 'i18n' }
|
|
13
12
|
],
|
|
14
|
-
format:
|
|
15
|
-
let result = values
|
|
16
|
-
|
|
17
|
-
if (values.includes('vuex') && values.includes('pinia')) {
|
|
18
|
-
console.log()
|
|
19
|
-
utils.logger.warn('Only one state management package can be used. Picking the recommended Pinia and dropping Vuex.')
|
|
20
|
-
console.log()
|
|
21
|
-
|
|
22
|
-
result = values.filter(entry => entry !== 'vuex')
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return utils.convertArrayToObject(result)
|
|
26
|
-
}
|
|
13
|
+
format: utils.convertArrayToObject
|
|
27
14
|
},
|
|
28
15
|
{
|
|
29
16
|
type: (_, { preset }) => (preset.lint ? 'select' : null),
|
|
@@ -51,5 +38,4 @@ export async function script ({ scope, utils }) {
|
|
|
51
38
|
}
|
|
52
39
|
|
|
53
40
|
if (scope.preset.pinia) utils.renderTemplate('pinia', scope)
|
|
54
|
-
else if (scope.preset.vuex) utils.renderTemplate('vuex', scope)
|
|
55
41
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<% if (preset.vuex) { %>"vuex": "^4.0.1",<% } %>
|
|
21
21
|
"@quasar/extras": "^1.16.4",
|
|
22
22
|
"core-js": "^3.31.1",
|
|
23
|
-
"quasar": "^2.
|
|
23
|
+
"quasar": "^2.16.0",
|
|
24
24
|
"vue": "^3.4.18",
|
|
25
25
|
"vue-router": "^4.0.12"
|
|
26
26
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<% if (preset.lint) { %>
|
|
29
29
|
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
|
30
30
|
"@typescript-eslint/parser": "^5.10.0",
|
|
31
|
-
"eslint": "^8.
|
|
31
|
+
"eslint": "^8.57.0",
|
|
32
32
|
"eslint-plugin-vue": "^9.0.0",
|
|
33
33
|
<% if (lintConfig === 'standard') { %>
|
|
34
34
|
"eslint-config-standard": "^17.0.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"prettier": "^2.5.1",
|
|
44
44
|
<% } } %>
|
|
45
45
|
"@types/node": "^12.20.21",
|
|
46
|
-
"@quasar/app-webpack": "^3.
|
|
46
|
+
"@quasar/app-webpack": "^3.13.0"
|
|
47
47
|
},
|
|
48
48
|
"browserslist": [
|
|
49
49
|
"last 10 Chrome versions",
|
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
<% if (preset.axios) { %>"axios": "^1.2.1",<% } %>
|
|
18
18
|
<% if (preset.i18n) { %>"vue-i18n": "^9.2.2",<% } %>
|
|
19
19
|
<% if (preset.pinia) { %>"pinia": "^2.0.11",<% } %>
|
|
20
|
-
<% if (preset.vuex) { %>"vuex": "^4.0.1",<% } %>
|
|
21
20
|
"@quasar/extras": "^1.16.4",
|
|
22
21
|
"core-js": "^3.6.5",
|
|
23
|
-
"quasar": "^2.
|
|
22
|
+
"quasar": "^2.16.0",
|
|
24
23
|
"vue": "^3.4.18",
|
|
25
24
|
"vue-router": "^4.0.0"
|
|
26
25
|
},
|
|
@@ -28,7 +27,7 @@
|
|
|
28
27
|
<% if (preset.lint) { %>
|
|
29
28
|
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
|
30
29
|
"@typescript-eslint/parser": "^6.6.0",
|
|
31
|
-
"eslint": "^8.
|
|
30
|
+
"eslint": "^8.57.0",
|
|
32
31
|
"eslint-plugin-vue": "^9.0.0",
|
|
33
32
|
"eslint-webpack-plugin": "^4.0.1",
|
|
34
33
|
<% if (lintConfig === 'standard') { %>
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"prettier": "^3.0.3",
|
|
45
44
|
<% } } %>
|
|
46
45
|
"@types/node": "^20.5.9",
|
|
47
|
-
"@quasar/app-webpack": "^4.0.0-beta.
|
|
46
|
+
"@quasar/app-webpack": "^4.0.0-beta.13",
|
|
48
47
|
"ts-loader": "^9.4.2",
|
|
49
48
|
"typescript": "^5.2.2"
|
|
50
49
|
},
|
|
@@ -5,8 +5,7 @@ import {
|
|
|
5
5
|
createWebHashHistory,
|
|
6
6
|
createWebHistory,
|
|
7
7
|
} from 'vue-router';
|
|
8
|
-
|
|
9
|
-
<% } %>import routes from './routes';
|
|
8
|
+
import routes from './routes';
|
|
10
9
|
|
|
11
10
|
/*
|
|
12
11
|
* If not building with SSR mode, you can
|
|
@@ -17,7 +16,7 @@ import {
|
|
|
17
16
|
* with the Router instance.
|
|
18
17
|
*/
|
|
19
18
|
|
|
20
|
-
export default route
|
|
19
|
+
export default route(function (/* { store, ssrContext } */) {
|
|
21
20
|
const createHistory = process.env.SERVER
|
|
22
21
|
? createMemoryHistory
|
|
23
22
|
: (process.env.VUE_ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory);
|
|
@@ -7,23 +7,10 @@ export async function script ({ scope, utils }) {
|
|
|
7
7
|
choices: [
|
|
8
8
|
{ title: 'Linting (ESLint)', value: 'lint', description: 'recommended', selected: true },
|
|
9
9
|
{ title: 'State Management (Pinia)', value: 'pinia', description: 'https://pinia.vuejs.org' },
|
|
10
|
-
{ title: 'State Management (Vuex) [DEPRECATED by Vue Team]', value: 'vuex', description: 'See https://vuejs.org/guide/scaling-up/state-management.html#pinia' },
|
|
11
10
|
{ title: 'axios', value: 'axios' },
|
|
12
11
|
{ title: 'vue-i18n', value: 'i18n' }
|
|
13
12
|
],
|
|
14
|
-
format:
|
|
15
|
-
let result = values
|
|
16
|
-
|
|
17
|
-
if (values.includes('vuex') && values.includes('pinia')) {
|
|
18
|
-
console.log()
|
|
19
|
-
utils.logger.warn('Only one state management package can be used. Picking the recommended Pinia and dropping Vuex.')
|
|
20
|
-
console.log()
|
|
21
|
-
|
|
22
|
-
result = values.filter(entry => entry !== 'vuex')
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return utils.convertArrayToObject(result)
|
|
26
|
-
}
|
|
13
|
+
format: utils.convertArrayToObject
|
|
27
14
|
},
|
|
28
15
|
{
|
|
29
16
|
type: (_, { preset }) => (preset.lint ? 'select' : null),
|
|
@@ -51,5 +38,4 @@ export async function script ({ scope, utils }) {
|
|
|
51
38
|
}
|
|
52
39
|
|
|
53
40
|
if (scope.preset.pinia) utils.renderTemplate('pinia', scope)
|
|
54
|
-
else if (scope.preset.vuex) utils.renderTemplate('vuex', scope)
|
|
55
41
|
}
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"postcss": "^8.1.9",
|
|
30
30
|
"rtlcss": "^2.6.1",
|
|
31
31
|
"sass": "^1.33.0",
|
|
32
|
-
"quasar": "^2.
|
|
32
|
+
"quasar": "^2.16.0",
|
|
33
33
|
"@quasar/extras": "^1.16.4",
|
|
34
34
|
"core-js": "^3.0.0",
|
|
35
|
-
"@quasar/app-webpack": "^3.
|
|
35
|
+
"@quasar/app-webpack": "^3.13.0",
|
|
36
36
|
"open": "^7.3.0",
|
|
37
37
|
"fs-extra": "^8.1.0",
|
|
38
38
|
"chalk": "^4.1.0",
|
package/utils/index.js
CHANGED
|
@@ -197,9 +197,16 @@ function runCommand (cmd, args, options) {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
function installDeps (scope) {
|
|
200
|
+
const args = [ 'install' ]
|
|
201
|
+
// Related to scripts/create-test-project.ts
|
|
202
|
+
if (process.env.CREATE_TEST_PROJECT_OVERRIDE === 'true') {
|
|
203
|
+
// If we don't use this flag, then the test project will become part of the monorepo and fail to install properly
|
|
204
|
+
args.push('--ignore-workspace')
|
|
205
|
+
}
|
|
206
|
+
|
|
200
207
|
return runCommand(
|
|
201
208
|
scope.packageManager,
|
|
202
|
-
|
|
209
|
+
args,
|
|
203
210
|
{ cwd: scope.projectFolder }
|
|
204
211
|
)
|
|
205
212
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { store } from 'quasar/wrappers'
|
|
2
|
-
import { createStore } from 'vuex'
|
|
3
|
-
|
|
4
|
-
// import example from './module-example'
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* If not building with SSR mode, you can
|
|
8
|
-
* directly export the Store instantiation;
|
|
9
|
-
*
|
|
10
|
-
* The function below can be async too; either use
|
|
11
|
-
* async/await or return a Promise which resolves
|
|
12
|
-
* with the Store instance.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export default store(function (/* { ssrContext } */) {
|
|
16
|
-
const Store = createStore({
|
|
17
|
-
modules: {
|
|
18
|
-
// example
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
// enable strict mode (adds overhead!)
|
|
22
|
-
// for dev mode and --debug builds only
|
|
23
|
-
strict: process.env.DEBUGGING
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
return Store
|
|
27
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
|
|
3
|
-
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
|
|
4
|
-
import "quasar/dist/types/feature-flag";
|
|
5
|
-
|
|
6
|
-
declare module "quasar/dist/types/feature-flag" {
|
|
7
|
-
interface QuasarFeatureFlags {
|
|
8
|
-
store: true;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { store } from 'quasar/wrappers'
|
|
2
|
-
import { createStore } from 'vuex'
|
|
3
|
-
|
|
4
|
-
// import example from './module-example'
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* If not building with SSR mode, you can
|
|
8
|
-
* directly export the Store instantiation;
|
|
9
|
-
*
|
|
10
|
-
* The function below can be async too; either use
|
|
11
|
-
* async/await or return a Promise which resolves
|
|
12
|
-
* with the Store instance.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export default store(function (/* { ssrContext } */) {
|
|
16
|
-
const Store = createStore({
|
|
17
|
-
modules: {
|
|
18
|
-
// example
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
// enable strict mode (adds overhead!)
|
|
22
|
-
// for dev mode and --debug builds only
|
|
23
|
-
strict: process.env.DEBUGGING
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
return Store
|
|
27
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
|
|
3
|
-
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
|
|
4
|
-
import "quasar/dist/types/feature-flag";
|
|
5
|
-
|
|
6
|
-
declare module "quasar/dist/types/feature-flag" {
|
|
7
|
-
interface QuasarFeatureFlags {
|
|
8
|
-
store: true;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { store } from 'quasar/wrappers'
|
|
2
|
-
import { InjectionKey } from 'vue'
|
|
3
|
-
import { Router } from 'vue-router'
|
|
4
|
-
import {
|
|
5
|
-
createStore,
|
|
6
|
-
Store as VuexStore,
|
|
7
|
-
useStore as vuexUseStore,
|
|
8
|
-
} from 'vuex'
|
|
9
|
-
|
|
10
|
-
// import example from './module-example'
|
|
11
|
-
// import { ExampleStateInterface } from './module-example/state';
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* If not building with SSR mode, you can
|
|
15
|
-
* directly export the Store instantiation;
|
|
16
|
-
*
|
|
17
|
-
* The function below can be async too; either use
|
|
18
|
-
* async/await or return a Promise which resolves
|
|
19
|
-
* with the Store instance.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
export interface StateInterface {
|
|
23
|
-
// Define your own store structure, using submodules if needed
|
|
24
|
-
// example: ExampleStateInterface;
|
|
25
|
-
// Declared as unknown to avoid linting issue. Best to strongly type as per the line above.
|
|
26
|
-
example: unknown
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// provide typings for `this.$store`
|
|
30
|
-
declare module '@vue/runtime-core' {
|
|
31
|
-
interface ComponentCustomProperties {
|
|
32
|
-
$store: VuexStore<StateInterface>
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// provide typings for `useStore` helper
|
|
37
|
-
export const storeKey: InjectionKey<VuexStore<StateInterface>> = Symbol('vuex-key')
|
|
38
|
-
|
|
39
|
-
// Provide typings for `this.$router` inside Vuex stores
|
|
40
|
-
declare module "vuex" {
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
|
-
export interface Store<S> {
|
|
43
|
-
readonly $router: Router;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default store(function (/* { ssrContext } */) {
|
|
48
|
-
const Store = createStore<StateInterface>({
|
|
49
|
-
modules: {
|
|
50
|
-
// example
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
// enable strict mode (adds overhead!)
|
|
54
|
-
// for dev mode and --debug builds only
|
|
55
|
-
strict: !!process.env.DEBUGGING
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
return Store;
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
export function useStore() {
|
|
62
|
-
return vuexUseStore(storeKey)
|
|
63
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ActionTree } from 'vuex';
|
|
2
|
-
import { StateInterface } from '../index';
|
|
3
|
-
import { ExampleStateInterface } from './state';
|
|
4
|
-
|
|
5
|
-
const actions: ActionTree<ExampleStateInterface, StateInterface> = {
|
|
6
|
-
someAction (/* context */) {
|
|
7
|
-
// your code
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default actions;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { GetterTree } from 'vuex';
|
|
2
|
-
import { StateInterface } from '../index';
|
|
3
|
-
import { ExampleStateInterface } from './state';
|
|
4
|
-
|
|
5
|
-
const getters: GetterTree<ExampleStateInterface, StateInterface> = {
|
|
6
|
-
someAction (/* context */) {
|
|
7
|
-
// your code
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default getters;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Module } from 'vuex';
|
|
2
|
-
import { StateInterface } from '../index';
|
|
3
|
-
import state, { ExampleStateInterface } from './state';
|
|
4
|
-
import actions from './actions';
|
|
5
|
-
import getters from './getters';
|
|
6
|
-
import mutations from './mutations';
|
|
7
|
-
|
|
8
|
-
const exampleModule: Module<ExampleStateInterface, StateInterface> = {
|
|
9
|
-
namespaced: true,
|
|
10
|
-
actions,
|
|
11
|
-
getters,
|
|
12
|
-
mutations,
|
|
13
|
-
state
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default exampleModule;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
|
|
3
|
-
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
|
|
4
|
-
import "quasar/dist/types/feature-flag";
|
|
5
|
-
|
|
6
|
-
declare module "quasar/dist/types/feature-flag" {
|
|
7
|
-
interface QuasarFeatureFlags {
|
|
8
|
-
store: true;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { store } from 'quasar/wrappers'
|
|
2
|
-
import { InjectionKey } from 'vue'
|
|
3
|
-
import { Router } from 'vue-router'
|
|
4
|
-
import {
|
|
5
|
-
createStore,
|
|
6
|
-
Store as VuexStore,
|
|
7
|
-
useStore as vuexUseStore,
|
|
8
|
-
} from 'vuex'
|
|
9
|
-
|
|
10
|
-
// import example from './module-example'
|
|
11
|
-
// import { ExampleStateInterface } from './module-example/state';
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* If not building with SSR mode, you can
|
|
15
|
-
* directly export the Store instantiation;
|
|
16
|
-
*
|
|
17
|
-
* The function below can be async too; either use
|
|
18
|
-
* async/await or return a Promise which resolves
|
|
19
|
-
* with the Store instance.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
export interface StateInterface {
|
|
23
|
-
// Define your own store structure, using submodules if needed
|
|
24
|
-
// example: ExampleStateInterface;
|
|
25
|
-
// Declared as unknown to avoid linting issue. Best to strongly type as per the line above.
|
|
26
|
-
example: unknown
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// provide typings for `this.$store`
|
|
30
|
-
declare module '@vue/runtime-core' {
|
|
31
|
-
interface ComponentCustomProperties {
|
|
32
|
-
$store: VuexStore<StateInterface>
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// provide typings for `useStore` helper
|
|
37
|
-
export const storeKey: InjectionKey<VuexStore<StateInterface>> = Symbol('vuex-key')
|
|
38
|
-
|
|
39
|
-
// Provide typings for `this.$router` inside Vuex stores
|
|
40
|
-
declare module "vuex" {
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
|
-
export interface Store<S> {
|
|
43
|
-
readonly $router: Router;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default store(function (/* { ssrContext } */) {
|
|
48
|
-
const Store = createStore<StateInterface>({
|
|
49
|
-
modules: {
|
|
50
|
-
// example
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
// enable strict mode (adds overhead!)
|
|
54
|
-
// for dev mode and --debug builds only
|
|
55
|
-
strict: !!process.env.DEBUGGING
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
return Store;
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
export function useStore() {
|
|
62
|
-
return vuexUseStore(storeKey)
|
|
63
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ActionTree } from 'vuex';
|
|
2
|
-
import { StateInterface } from '../index';
|
|
3
|
-
import { ExampleStateInterface } from './state';
|
|
4
|
-
|
|
5
|
-
const actions: ActionTree<ExampleStateInterface, StateInterface> = {
|
|
6
|
-
someAction (/* context */) {
|
|
7
|
-
// your code
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default actions;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { GetterTree } from 'vuex';
|
|
2
|
-
import { StateInterface } from '../index';
|
|
3
|
-
import { ExampleStateInterface } from './state';
|
|
4
|
-
|
|
5
|
-
const getters: GetterTree<ExampleStateInterface, StateInterface> = {
|
|
6
|
-
someAction (/* context */) {
|
|
7
|
-
// your code
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default getters;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Module } from 'vuex';
|
|
2
|
-
import { StateInterface } from '../index';
|
|
3
|
-
import state, { ExampleStateInterface } from './state';
|
|
4
|
-
import actions from './actions';
|
|
5
|
-
import getters from './getters';
|
|
6
|
-
import mutations from './mutations';
|
|
7
|
-
|
|
8
|
-
const exampleModule: Module<ExampleStateInterface, StateInterface> = {
|
|
9
|
-
namespaced: true,
|
|
10
|
-
actions,
|
|
11
|
-
getters,
|
|
12
|
-
mutations,
|
|
13
|
-
state
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default exampleModule;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
|
|
3
|
-
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
|
|
4
|
-
import "quasar/dist/types/feature-flag";
|
|
5
|
-
|
|
6
|
-
declare module "quasar/dist/types/feature-flag" {
|
|
7
|
-
interface QuasarFeatureFlags {
|
|
8
|
-
store: true;
|
|
9
|
-
}
|
|
10
|
-
}
|