create-quasar 2.0.3 → 2.0.5
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/eslint.config.base.js +19 -0
- package/eslint.config.js +47 -0
- package/index.js +23 -1
- package/package.json +5 -6
- package/scripts/create-test-project.ts +4 -11
- package/templates/app/eslint.config.js +65 -0
- package/templates/app/quasar-v2/js-vite-2/BASE/_package.json +1 -1
- package/templates/app/quasar-v2/ts-vite-2/BASE/_package.json +1 -1
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/postcss.config.cjs +0 -1
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/babel.config.cjs +0 -2
- package/templates/app-extension/eslint.config.js +65 -0
- package/templates/eslint.config.base.js +147 -0
- package/templates/ui-kit/eslint.config.js +70 -0
- package/templates/ui-kit/quasar-v2/BASE/ui/build/script.javascript.js +0 -1
- package/templates/ui-kit/quasar-v2/ae-prompts/app-extension/src/prompts.js +1 -1
- package/templates/ui-kit/quasar-v2/ae-uninstall/app-extension/src/uninstall.js +1 -1
- package/templates/ui-kit/quasar-v2/ui-directive/ui/src/directives/Directive.js +1 -1
- package/utils/index.js +16 -2
- package/.eslintignore +0 -1
- package/.eslintrc.cjs +0 -40
- package/templates/.eslintrc.cjs +0 -103
- package/templates/app-extension/ae-js/.eslintrc.cjs +0 -41
- package/templates/app-extension/ae-ts/.eslintrc.cjs +0 -17
- package/templates/app-extension/ae-ts/BASE/eslint.d.ts +0 -18
- package/templates/ui-kit/.eslintrc.cjs +0 -41
- package/templates/ui-kit/quasar-v2/.eslintrc.cjs +0 -19
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import eslintJs from '@eslint/js'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
3
|
+
|
|
4
|
+
export default tseslint.config(
|
|
5
|
+
{
|
|
6
|
+
name: 'eslint/recommended',
|
|
7
|
+
|
|
8
|
+
...eslintJs.configs.recommended
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
{
|
|
12
|
+
name: 'custom',
|
|
13
|
+
|
|
14
|
+
rules: {
|
|
15
|
+
'no-empty': 'off',
|
|
16
|
+
'no-unused-vars': [ 'error', { ignoreRestSiblings: true, argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' } ]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
)
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import baseConfig from './eslint.config.base.js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import tseslint from 'typescript-eslint'
|
|
4
|
+
// import quasar from 'eslint-config-quasar'
|
|
5
|
+
|
|
6
|
+
export default tseslint.config(
|
|
7
|
+
...baseConfig,
|
|
8
|
+
|
|
9
|
+
// TODO: enable these configs
|
|
10
|
+
// ...quasar.configs.base,
|
|
11
|
+
// ...quasar.configs.node,
|
|
12
|
+
|
|
13
|
+
{
|
|
14
|
+
name: 'custom/ignores',
|
|
15
|
+
|
|
16
|
+
ignores: [ 'test-project' ]
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
name: 'custom',
|
|
21
|
+
|
|
22
|
+
languageOptions: {
|
|
23
|
+
ecmaVersion: 'latest',
|
|
24
|
+
sourceType: 'module',
|
|
25
|
+
|
|
26
|
+
globals: {
|
|
27
|
+
...globals.node
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
name: 'custom/scripts',
|
|
34
|
+
|
|
35
|
+
files: [ './scripts/**/*.ts' ],
|
|
36
|
+
|
|
37
|
+
extends: [
|
|
38
|
+
...tseslint.configs.recommended
|
|
39
|
+
],
|
|
40
|
+
|
|
41
|
+
languageOptions: {
|
|
42
|
+
parserOptions: {
|
|
43
|
+
sourceType: 'module',
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
)
|
package/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import utils from './utils/index.js'
|
|
|
18
18
|
utils.ensureOutsideProject()
|
|
19
19
|
|
|
20
20
|
import parseArgs from 'minimist'
|
|
21
|
+
import prompts from 'prompts'
|
|
21
22
|
|
|
22
23
|
const argv = parseArgs(process.argv.slice(2), {
|
|
23
24
|
alias: {
|
|
@@ -27,8 +28,20 @@ const argv = parseArgs(process.argv.slice(2), {
|
|
|
27
28
|
boolean: [ 'n' ],
|
|
28
29
|
})
|
|
29
30
|
|
|
31
|
+
/** @type {Record<string, any>} */
|
|
32
|
+
const scope = {
|
|
33
|
+
// Usage: `pnpm create quasar <project-folder>`
|
|
34
|
+
// If provided it will skip the projectFolder prompt, but still apply the `format` function after the utils.prompts call
|
|
35
|
+
projectFolder: argv._[0]?.trim()
|
|
36
|
+
}
|
|
37
|
+
prompts.override(scope)
|
|
38
|
+
|
|
39
|
+
if (scope.projectFolder) {
|
|
40
|
+
utils.logger.log(`Using the project folder provided via arguments: ${ scope.projectFolder }`)
|
|
41
|
+
utils.logger.log()
|
|
42
|
+
}
|
|
43
|
+
|
|
30
44
|
const defaultProjectFolder = 'quasar-project'
|
|
31
|
-
const scope = {}
|
|
32
45
|
|
|
33
46
|
await utils.prompts(scope, [
|
|
34
47
|
{
|
|
@@ -146,6 +159,15 @@ if (scope.skipDepsInstall !== true) {
|
|
|
146
159
|
utils.logger.warn('Could not auto lint fix the project folder.')
|
|
147
160
|
}
|
|
148
161
|
}
|
|
162
|
+
|
|
163
|
+
if (scope.prettier) {
|
|
164
|
+
try {
|
|
165
|
+
await utils.formatFolder(scope)
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
utils.logger.warn('Could not auto format the project folder.')
|
|
169
|
+
}
|
|
170
|
+
}
|
|
149
171
|
}
|
|
150
172
|
}
|
|
151
173
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-quasar",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Scaffolds Quasar Apps, AppExtensions or UI kits",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -37,15 +37,14 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/lodash": "^4.17.7",
|
|
39
39
|
"@types/prompts": "^2.4.9",
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
42
|
-
"eslint": "^
|
|
43
|
-
"eslint-plugin-lodash-template": "^1.1.0",
|
|
40
|
+
"@yusufkandemir/eslint-plugin-lodash-template": "^2.0.0",
|
|
41
|
+
"typescript-eslint": "^8.28.0",
|
|
42
|
+
"eslint": "^9.29.0",
|
|
44
43
|
"tsx": "^4.19.1",
|
|
45
44
|
"typescript": "^5.6.2"
|
|
46
45
|
},
|
|
47
46
|
"scripts": {
|
|
48
|
-
"lint": "eslint --
|
|
47
|
+
"lint": "eslint --flag unstable_config_lookup_from_file --fix",
|
|
49
48
|
"create-test-project": "tsx scripts/create-test-project.ts"
|
|
50
49
|
}
|
|
51
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import prompts from 'prompts';
|
|
2
2
|
|
|
3
3
|
type ScriptType = 'js' | 'ts';
|
|
4
|
-
type AppEngine = 'vite-
|
|
4
|
+
type AppEngine = 'vite-2' | 'webpack-4';
|
|
5
5
|
type PackageManager = 'yarn' | 'npm' | 'pnpm';
|
|
6
6
|
|
|
7
7
|
type CreateProjectOptions = {
|
|
@@ -23,7 +23,6 @@ export async function createProject({ scriptType, appEngine, packageManager }: C
|
|
|
23
23
|
projectFolder: 'test-project',
|
|
24
24
|
overwrite: true,
|
|
25
25
|
|
|
26
|
-
quasarVersion: 'v2',
|
|
27
26
|
scriptType: scriptType,
|
|
28
27
|
engine: appEngine,
|
|
29
28
|
|
|
@@ -35,15 +34,9 @@ export async function createProject({ scriptType, appEngine, packageManager }: C
|
|
|
35
34
|
// The defaults
|
|
36
35
|
sfcStyle: 'composition-setup',
|
|
37
36
|
css: 'scss',
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
lintConfig: 'prettier',
|
|
42
|
-
}
|
|
43
|
-
: {
|
|
44
|
-
preset: ['eslint'],
|
|
45
|
-
prettier: true,
|
|
46
|
-
}),
|
|
37
|
+
|
|
38
|
+
preset: ['eslint'],
|
|
39
|
+
prettier: true,
|
|
47
40
|
|
|
48
41
|
packageManager,
|
|
49
42
|
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import tseslint from 'typescript-eslint'
|
|
2
|
+
import baseConfig from '../eslint.config.base.js'
|
|
3
|
+
|
|
4
|
+
export default tseslint.config(
|
|
5
|
+
...baseConfig,
|
|
6
|
+
|
|
7
|
+
{
|
|
8
|
+
files: [
|
|
9
|
+
'quasar-v2/js-vite-2/*/**/*.ts',
|
|
10
|
+
'quasar-v2/js-vite-2/*/**/*.js',
|
|
11
|
+
|
|
12
|
+
'quasar-v2/js-webpack-4/*/**/*.ts',
|
|
13
|
+
'quasar-v2/js-webpack-4/*/**/*.js'
|
|
14
|
+
],
|
|
15
|
+
|
|
16
|
+
settings: {
|
|
17
|
+
'lodash-template/globals': [
|
|
18
|
+
// Base
|
|
19
|
+
'name',
|
|
20
|
+
'description',
|
|
21
|
+
'author',
|
|
22
|
+
|
|
23
|
+
// Quasar v2
|
|
24
|
+
'quasarVersion',
|
|
25
|
+
'scriptType',
|
|
26
|
+
'productName',
|
|
27
|
+
|
|
28
|
+
// Quasar v2 - JS
|
|
29
|
+
'css',
|
|
30
|
+
'preset',
|
|
31
|
+
'prettier'
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
{
|
|
37
|
+
files: [
|
|
38
|
+
'quasar-v2/ts-vite-2/*/**/*.ts',
|
|
39
|
+
'quasar-v2/ts-vite-2/*/**/*.js',
|
|
40
|
+
|
|
41
|
+
'quasar-v2/ts-webpack-4/*/**/*.ts',
|
|
42
|
+
'quasar-v2/ts-webpack-4/*/**/*.js'
|
|
43
|
+
],
|
|
44
|
+
|
|
45
|
+
settings: {
|
|
46
|
+
'lodash-template/globals': [
|
|
47
|
+
// Base
|
|
48
|
+
'name',
|
|
49
|
+
'description',
|
|
50
|
+
'author',
|
|
51
|
+
|
|
52
|
+
// Quasar v2
|
|
53
|
+
'quasarVersion',
|
|
54
|
+
'scriptType',
|
|
55
|
+
'productName',
|
|
56
|
+
|
|
57
|
+
// Quasar v2 - TS
|
|
58
|
+
'sfcStyle',
|
|
59
|
+
'css',
|
|
60
|
+
'preset',
|
|
61
|
+
'prettier'
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import globals from 'globals'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
3
|
+
import baseConfig from '../eslint.config.base.js'
|
|
4
|
+
|
|
5
|
+
export default tseslint.config(
|
|
6
|
+
...baseConfig,
|
|
7
|
+
|
|
8
|
+
{
|
|
9
|
+
// Due to conditional use of mixed ESM/CJS in certain files, they can't be properly parsed and checked
|
|
10
|
+
ignores: [
|
|
11
|
+
'ae-js/BASE/src/index.js',
|
|
12
|
+
'ae-js/install-script/src/install.js',
|
|
13
|
+
'ae-js/prompts-script/src/prompts.js',
|
|
14
|
+
'ae-js/uninstall-script/src/uninstall.js'
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
{
|
|
19
|
+
files: [ 'ae-js/*/**/*.js' ],
|
|
20
|
+
|
|
21
|
+
settings: {
|
|
22
|
+
'lodash-template/globals': [
|
|
23
|
+
// Base
|
|
24
|
+
'name',
|
|
25
|
+
'description',
|
|
26
|
+
'author',
|
|
27
|
+
|
|
28
|
+
'preset',
|
|
29
|
+
'orgName',
|
|
30
|
+
'license',
|
|
31
|
+
|
|
32
|
+
'codeFormat'
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
languageOptions: {
|
|
37
|
+
parserOptions: {
|
|
38
|
+
sourceType: 'script'
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
globals: {
|
|
42
|
+
...globals.node
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
{
|
|
48
|
+
files: [ 'ae-ts/*/**/*.ts', 'ae-ts/*/**/*.js' ],
|
|
49
|
+
|
|
50
|
+
settings: {
|
|
51
|
+
'lodash-template/globals': [
|
|
52
|
+
// Base
|
|
53
|
+
'name',
|
|
54
|
+
'description',
|
|
55
|
+
'author',
|
|
56
|
+
|
|
57
|
+
'preset',
|
|
58
|
+
'orgName',
|
|
59
|
+
'license',
|
|
60
|
+
|
|
61
|
+
'packageManagerField',
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
)
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import globals from 'globals'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
3
|
+
import pluginLodashTemplate from '@yusufkandemir/eslint-plugin-lodash-template'
|
|
4
|
+
import baseConfig from '../eslint.config.base.js'
|
|
5
|
+
|
|
6
|
+
// file paths are relative to templates/*/
|
|
7
|
+
export default tseslint.config(
|
|
8
|
+
...baseConfig,
|
|
9
|
+
|
|
10
|
+
{
|
|
11
|
+
name: 'custom/templates/ts',
|
|
12
|
+
files: [ '*/*/**/*.ts' ],
|
|
13
|
+
|
|
14
|
+
extends: [
|
|
15
|
+
...tseslint.configs.recommended,
|
|
16
|
+
pluginLodashTemplate.configs.recommendedWithScript,
|
|
17
|
+
],
|
|
18
|
+
|
|
19
|
+
languageOptions: {
|
|
20
|
+
parserOptions: {
|
|
21
|
+
parser: tseslint.parser,
|
|
22
|
+
sourceType: 'module',
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
globals: {
|
|
26
|
+
...globals.browser,
|
|
27
|
+
process: 'readonly'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
rules: {
|
|
32
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
33
|
+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
linterOptions: {
|
|
37
|
+
// TS templates use recommendedTypeChecked which have extra rules
|
|
38
|
+
// We can't enable it here due to the complicated nature of the templates
|
|
39
|
+
// So, we simply disable unused disable directives to avoid false positives
|
|
40
|
+
reportUnusedDisableDirectives: 'off'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
{
|
|
45
|
+
name: 'custom/templates/js',
|
|
46
|
+
files: [ '*/*/**/*.js' ],
|
|
47
|
+
|
|
48
|
+
extends: [
|
|
49
|
+
{
|
|
50
|
+
...pluginLodashTemplate.configs.recommendedWithScript,
|
|
51
|
+
settings: {
|
|
52
|
+
'lodash-template/globals': [
|
|
53
|
+
// Base
|
|
54
|
+
'name',
|
|
55
|
+
'description',
|
|
56
|
+
'author',
|
|
57
|
+
|
|
58
|
+
'features',
|
|
59
|
+
'preset',
|
|
60
|
+
|
|
61
|
+
'packageDescription',
|
|
62
|
+
'aeDescription',
|
|
63
|
+
|
|
64
|
+
'umdExportName',
|
|
65
|
+
'componentName',
|
|
66
|
+
'directiveName',
|
|
67
|
+
|
|
68
|
+
'license'
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
|
|
74
|
+
languageOptions: {
|
|
75
|
+
parserOptions: {
|
|
76
|
+
sourceType: 'module',
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
globals: {
|
|
80
|
+
...globals.browser,
|
|
81
|
+
process: 'readonly',
|
|
82
|
+
// For require.context
|
|
83
|
+
require: 'readonly',
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
rules: {
|
|
88
|
+
'no-empty-function': 'off',
|
|
89
|
+
'no-unused-vars': [ 'warn', { args: 'none' } ],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
{
|
|
94
|
+
name: 'custom/templates/config-files',
|
|
95
|
+
files: [
|
|
96
|
+
'*/*/**/_*.js',
|
|
97
|
+
'*/*/**/*.{conf,config}.js',
|
|
98
|
+
],
|
|
99
|
+
|
|
100
|
+
languageOptions: {
|
|
101
|
+
parserOptions: {
|
|
102
|
+
// TODO: re-evaluate this
|
|
103
|
+
sourceType: 'script'
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
globals: {
|
|
107
|
+
...globals.node
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
{
|
|
113
|
+
name: 'custom/templates/config-files/esm',
|
|
114
|
+
files: [
|
|
115
|
+
'*/*/**/quasar.config.js',
|
|
116
|
+
'*/*/**/_eslint.config.js',
|
|
117
|
+
'*/*/**/babel.config.js',
|
|
118
|
+
'*/*/**/postcss.config.js'
|
|
119
|
+
],
|
|
120
|
+
|
|
121
|
+
languageOptions: {
|
|
122
|
+
parserOptions: {
|
|
123
|
+
sourceType: 'module'
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
globals: {
|
|
127
|
+
...globals.node
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
{
|
|
133
|
+
// example: ./app/quasar-v2/index.js
|
|
134
|
+
name: 'custom/templates/helpers',
|
|
135
|
+
files: [ '*/*/*.js' ],
|
|
136
|
+
|
|
137
|
+
languageOptions: {
|
|
138
|
+
parserOptions: {
|
|
139
|
+
sourceType: 'module'
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
globals: {
|
|
143
|
+
...globals.node
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import globals from 'globals'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
3
|
+
import baseConfig from '../eslint.config.base.js'
|
|
4
|
+
|
|
5
|
+
export default tseslint.config(
|
|
6
|
+
...baseConfig,
|
|
7
|
+
|
|
8
|
+
{
|
|
9
|
+
// Due to conditional use of mixed ESM/CJS in certain files, they can't be properly parsed and checked
|
|
10
|
+
ignores: [
|
|
11
|
+
'*/ae-install/app-extension/src/install.js',
|
|
12
|
+
'*/ae-prompts/app-extension/src/prompts.js',
|
|
13
|
+
'*/ae-uninstall/app-extension/src/uninstall.js',
|
|
14
|
+
'*/ae/app-extension/src/index.js'
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
{
|
|
19
|
+
files: [ '*/*/**/*.js' ],
|
|
20
|
+
|
|
21
|
+
settings: {
|
|
22
|
+
'lodash-template/globals': [
|
|
23
|
+
// Base
|
|
24
|
+
'name',
|
|
25
|
+
'description',
|
|
26
|
+
'author',
|
|
27
|
+
|
|
28
|
+
'features',
|
|
29
|
+
'preset',
|
|
30
|
+
|
|
31
|
+
'packageDescription',
|
|
32
|
+
'aeDescription',
|
|
33
|
+
|
|
34
|
+
'umdExportName',
|
|
35
|
+
'componentName',
|
|
36
|
+
'directiveName',
|
|
37
|
+
|
|
38
|
+
'license'
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
{
|
|
44
|
+
files: [ '*/*/**/*.js' ],
|
|
45
|
+
|
|
46
|
+
languageOptions: {
|
|
47
|
+
globals: {
|
|
48
|
+
__UI_VERSION__: 'readonly'
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
{
|
|
54
|
+
files: [
|
|
55
|
+
'*/{ae,ae-*}/app-extension/src/*.js',
|
|
56
|
+
'*/{BASE,ui-ae}/ui/build/*.js',
|
|
57
|
+
'*/{BASE,ui-ae}/ui/build/*/!(entry)/**/*.js',
|
|
58
|
+
],
|
|
59
|
+
|
|
60
|
+
languageOptions: {
|
|
61
|
+
parserOptions: {
|
|
62
|
+
sourceType: 'script'
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
globals: {
|
|
66
|
+
...globals.node
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
)
|
package/utils/index.js
CHANGED
|
@@ -13,6 +13,11 @@ import logger from './logger.js'
|
|
|
13
13
|
|
|
14
14
|
const TEMPLATING_FILE_EXTENSIONS = [ '', '.json', '.js', '.cjs', '.ts', '.vue', '.md', '.html', '.sass' ]
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* @param {Record<string, any>} scope
|
|
18
|
+
* @param {promptUser.PromptObject[]} questions
|
|
19
|
+
* @param {promptUser.Options} opts
|
|
20
|
+
*/
|
|
16
21
|
async function prompts (scope, questions, opts) {
|
|
17
22
|
const options = opts || {
|
|
18
23
|
onCancel: () => {
|
|
@@ -136,7 +141,7 @@ function getGitUser () {
|
|
|
136
141
|
name = exec('git config --get user.name')
|
|
137
142
|
email = exec('git config --get user.email')
|
|
138
143
|
}
|
|
139
|
-
catch (
|
|
144
|
+
catch (_) {}
|
|
140
145
|
|
|
141
146
|
name = name && JSON.stringify(name.toString().trim()).slice(1, -1)
|
|
142
147
|
email = email && (' <' + email.toString().trim() + '>')
|
|
@@ -229,6 +234,14 @@ function lintFolder (scope) {
|
|
|
229
234
|
)
|
|
230
235
|
}
|
|
231
236
|
|
|
237
|
+
function formatFolder (scope) {
|
|
238
|
+
return runCommand(
|
|
239
|
+
scope.packageManager,
|
|
240
|
+
[ 'run', 'format' ],
|
|
241
|
+
{ cwd: scope.projectFolder }
|
|
242
|
+
)
|
|
243
|
+
}
|
|
244
|
+
|
|
232
245
|
function hasGit () {
|
|
233
246
|
try {
|
|
234
247
|
exec('git --version')
|
|
@@ -261,7 +274,7 @@ function initializeGit (projectFolder) {
|
|
|
261
274
|
exec('git add -A', { cwd: projectFolder })
|
|
262
275
|
exec('git commit -m "Initialize the project 🚀" --no-verify', { cwd: projectFolder })
|
|
263
276
|
}
|
|
264
|
-
catch (
|
|
277
|
+
catch (_) {
|
|
265
278
|
logger.warn('Could not initialize Git repository. Please do this manually.')
|
|
266
279
|
return
|
|
267
280
|
}
|
|
@@ -364,6 +377,7 @@ export default {
|
|
|
364
377
|
printFinalMessage,
|
|
365
378
|
installDeps,
|
|
366
379
|
lintFolder,
|
|
380
|
+
formatFolder,
|
|
367
381
|
ensureOutsideProject,
|
|
368
382
|
initializeGit,
|
|
369
383
|
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
test-project/
|
package/.eslintrc.cjs
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
// TODO: improve rules, use the ones from the root config by removing `root: true`
|
|
3
|
-
root: true,
|
|
4
|
-
|
|
5
|
-
parserOptions: {
|
|
6
|
-
ecmaVersion: 'latest',
|
|
7
|
-
sourceType: 'module'
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
env: {
|
|
11
|
-
node: true
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
globals: {
|
|
15
|
-
Promise: 'readonly'
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
extends: [
|
|
19
|
-
'eslint:recommended',
|
|
20
|
-
],
|
|
21
|
-
|
|
22
|
-
rules: {
|
|
23
|
-
'no-empty': 'off',
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
overrides: [
|
|
27
|
-
{
|
|
28
|
-
files: './scripts/**/*.ts',
|
|
29
|
-
|
|
30
|
-
parserOptions: {
|
|
31
|
-
sourceType: 'module',
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
extends: [
|
|
35
|
-
'eslint:recommended',
|
|
36
|
-
'plugin:@typescript-eslint/recommended',
|
|
37
|
-
],
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
package/templates/.eslintrc.cjs
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
overrides: [
|
|
3
|
-
{
|
|
4
|
-
files: './*/*/*/**/*.ts',
|
|
5
|
-
|
|
6
|
-
parserOptions: {
|
|
7
|
-
parser: '@typescript-eslint/parser',
|
|
8
|
-
sourceType: 'module'
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
env: {
|
|
12
|
-
node: false,
|
|
13
|
-
browser: true,
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
globals: {
|
|
17
|
-
process: 'readonly',
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
extends: [
|
|
21
|
-
'eslint:recommended',
|
|
22
|
-
'plugin:@typescript-eslint/recommended',
|
|
23
|
-
'plugin:lodash-template/recommended-with-script'
|
|
24
|
-
],
|
|
25
|
-
|
|
26
|
-
rules: {
|
|
27
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
28
|
-
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
files: './*/*/*/**/*.js',
|
|
34
|
-
|
|
35
|
-
parserOptions: {
|
|
36
|
-
sourceType: 'module'
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
env: {
|
|
40
|
-
node: false,
|
|
41
|
-
browser: true,
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
globals: {
|
|
45
|
-
process: 'readonly',
|
|
46
|
-
// For require.context
|
|
47
|
-
require: 'readonly',
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
extends: [
|
|
51
|
-
'eslint:recommended',
|
|
52
|
-
'plugin:lodash-template/recommended-with-script'
|
|
53
|
-
],
|
|
54
|
-
|
|
55
|
-
rules: {
|
|
56
|
-
'no-empty-function': 'off',
|
|
57
|
-
'no-unused-vars': ['warn', { args: 'none' }],
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
files: [
|
|
63
|
-
'./*/*/*/**/_*.js',
|
|
64
|
-
'./*/*/*/**/*.{conf,config}.js',
|
|
65
|
-
],
|
|
66
|
-
|
|
67
|
-
parserOptions: {
|
|
68
|
-
sourceType: 'script'
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
env: {
|
|
72
|
-
browser: false,
|
|
73
|
-
node: true,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
files: [
|
|
79
|
-
'./*/*/*/**/_eslint.config.js',
|
|
80
|
-
'./*/*/*/**/postcss.config.js'
|
|
81
|
-
],
|
|
82
|
-
|
|
83
|
-
parserOptions: {
|
|
84
|
-
sourceType: 'module'
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
env: {
|
|
88
|
-
browser: false,
|
|
89
|
-
node: true,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
{
|
|
94
|
-
// Template-specific manager/helper scripts (e.g. ./app/quasar-v2/index.js)
|
|
95
|
-
files: './*/*/*/*.js',
|
|
96
|
-
|
|
97
|
-
env: {
|
|
98
|
-
browser: false,
|
|
99
|
-
node: true,
|
|
100
|
-
},
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
settings: {
|
|
3
|
-
'lodash-template/globals': [
|
|
4
|
-
// Base
|
|
5
|
-
'name',
|
|
6
|
-
'description',
|
|
7
|
-
'author',
|
|
8
|
-
|
|
9
|
-
'preset',
|
|
10
|
-
'orgName',
|
|
11
|
-
'license',
|
|
12
|
-
|
|
13
|
-
'codeFormat'
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
overrides: [
|
|
18
|
-
{
|
|
19
|
-
files: [
|
|
20
|
-
'./*/**/*.js',
|
|
21
|
-
],
|
|
22
|
-
|
|
23
|
-
parserOptions: {
|
|
24
|
-
sourceType: 'script'
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
env: {
|
|
28
|
-
browser: false,
|
|
29
|
-
node: true,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
|
|
34
|
-
// Due to conditional use of mixed ESM/CJS in certain files, they can't be properly parsed and checked
|
|
35
|
-
ignorePatterns: [
|
|
36
|
-
'BASE/src/index.js',
|
|
37
|
-
'install-script/src/install.js',
|
|
38
|
-
'prompts-script/src/prompts.js',
|
|
39
|
-
'uninstall-script/src/uninstall.js'
|
|
40
|
-
]
|
|
41
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare module 'eslint-plugin-vue' {
|
|
2
|
-
import type { TSESLint } from '@typescript-eslint/utils';
|
|
3
|
-
|
|
4
|
-
const configs: {
|
|
5
|
-
'flat/recommended': TSESLint.FlatConfig.ConfigArray;
|
|
6
|
-
};
|
|
7
|
-
const plugin: {
|
|
8
|
-
configs: typeof configs;
|
|
9
|
-
};
|
|
10
|
-
export default plugin;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
declare module 'eslint-config-prettier' {
|
|
14
|
-
import type { TSESLint } from '@typescript-eslint/utils';
|
|
15
|
-
|
|
16
|
-
const config: TSESLint.FlatConfig.Config;
|
|
17
|
-
export default config;
|
|
18
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
settings: {
|
|
3
|
-
'lodash-template/globals': [
|
|
4
|
-
// Base
|
|
5
|
-
'name',
|
|
6
|
-
'description',
|
|
7
|
-
'author',
|
|
8
|
-
|
|
9
|
-
'features',
|
|
10
|
-
'preset',
|
|
11
|
-
|
|
12
|
-
'packageDescription',
|
|
13
|
-
'aeDescription',
|
|
14
|
-
|
|
15
|
-
'umdExportName',
|
|
16
|
-
'componentName',
|
|
17
|
-
'directiveName',
|
|
18
|
-
|
|
19
|
-
'license'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
overrides: [
|
|
24
|
-
{
|
|
25
|
-
files: [
|
|
26
|
-
'./*/{ae,ae-*}/app-extension/src/*.js',
|
|
27
|
-
'./*/{BASE,ui-ae}/ui/build/*.js',
|
|
28
|
-
'./*/{BASE,ui-ae}/ui/build/*/!(entry)/**/*.js',
|
|
29
|
-
],
|
|
30
|
-
|
|
31
|
-
parserOptions: {
|
|
32
|
-
sourceType: 'script'
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
env: {
|
|
36
|
-
browser: false,
|
|
37
|
-
node: true,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
]
|
|
41
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
overrides: [
|
|
3
|
-
{
|
|
4
|
-
files: './*/**/*.js',
|
|
5
|
-
|
|
6
|
-
globals: {
|
|
7
|
-
__UI_VERSION__: 'readonly'
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
|
|
12
|
-
// Due to conditional use of mixed ESM/CJS in certain files, they can't be properly parsed and checked
|
|
13
|
-
ignorePatterns: [
|
|
14
|
-
'ae-install/app-extension/src/install.js',
|
|
15
|
-
'ae-prompts/app-extension/src/prompts.js',
|
|
16
|
-
'ae-uninstall/app-extension/src/uninstall.js',
|
|
17
|
-
'ae/app-extension/src/index.js'
|
|
18
|
-
]
|
|
19
|
-
}
|