diff --git a/create-quasar/templates/app-extension/ae-js/.eslintrc.cjs b/create-quasar/templates/app-extension/ae-js/.eslintrc.cjs index d8c85c36b44..4727b63333b 100644 --- a/create-quasar/templates/app-extension/ae-js/.eslintrc.cjs +++ b/create-quasar/templates/app-extension/ae-js/.eslintrc.cjs @@ -9,10 +9,6 @@ module.exports = { 'preset', 'orgName', 'license', - 'repositoryType', - 'repositoryURL', - 'homepage', - 'bugs', 'codeFormat' ] diff --git a/create-quasar/templates/app-extension/ae-js/BASE/_package.json b/create-quasar/templates/app-extension/ae-js/BASE/_package.json index ffe3ce84664..496ab4b12d5 100644 --- a/create-quasar/templates/app-extension/ae-js/BASE/_package.json +++ b/create-quasar/templates/app-extension/ae-js/BASE/_package.json @@ -9,12 +9,6 @@ "scripts": { "test": "echo \"No test specified\" && exit 0" }, - "repository": { - "type": "<%= repositoryType %>", - "url": "<%= repositoryURL %>" - }, - "bugs": "<%= bugs %>", - "homepage": "<%= homepage %>", "engines": { "node": ">= 12.2.0", "npm": ">= 5.6.0", diff --git a/create-quasar/templates/app-extension/ae-js/index.js b/create-quasar/templates/app-extension/ae-js/index.js index aa0908321d5..5a76bef946c 100644 --- a/create-quasar/templates/app-extension/ae-js/index.js +++ b/create-quasar/templates/app-extension/ae-js/index.js @@ -32,8 +32,12 @@ export async function script ({ scope, utils }) { ] }, - utils.commonPrompts.description, - utils.commonPrompts.author, + utils.commonPrompts.description + ]) + + await utils.injectAuthor(scope) + + await utils.prompts(scope, [ { type: 'text', name: 'license', @@ -59,27 +63,6 @@ export async function script ({ scope, utils }) { } ], format: utils.convertArrayToObject - }, - { - type: 'text', - name: 'repositoryType', - initial: 'git', - message: 'Repository type:' - }, - { - type: 'text', - name: 'repositoryURL', - message: 'Repository URL (eg https://github.com/quasarframework/quasar):' - }, - { - type: 'text', - name: 'homepage', - message: 'Homepage URL:' - }, - { - type: 'text', - name: 'bugs', - message: 'Issue reporting URL (eg https://github.com/quasarframework/quasar/issues):' } ]) diff --git a/create-quasar/templates/app-extension/ae-ts/.eslintrc.cjs b/create-quasar/templates/app-extension/ae-ts/.eslintrc.cjs index 478e8510aa2..47cf43abd6e 100644 --- a/create-quasar/templates/app-extension/ae-ts/.eslintrc.cjs +++ b/create-quasar/templates/app-extension/ae-ts/.eslintrc.cjs @@ -10,10 +10,6 @@ module.exports = { 'orgName', 'pkgName', 'license', - 'repositoryType', - 'repositoryURL', - 'homepage', - 'bugs', 'packageManagerField', ] diff --git a/create-quasar/templates/app-extension/ae-ts/BASE/app-extension/_package.json b/create-quasar/templates/app-extension/ae-ts/BASE/app-extension/_package.json index 3c86b6698b2..4d3ea25215a 100644 --- a/create-quasar/templates/app-extension/ae-ts/BASE/app-extension/_package.json +++ b/create-quasar/templates/app-extension/ae-ts/BASE/app-extension/_package.json @@ -5,12 +5,6 @@ "author": "<%= author %>", "license": "<%= license %>", "type": "module", - "repository": { - "type": "<%= repositoryType %>", - "url": "<%= repositoryURL %>" - }, - "bugs": "<%= bugs %>", - "homepage": "<%= homepage %>", "main": "./dist/runtime/index.js", "module": "./dist/runtime/index.js", "types": "./dist/runtime/index.d.ts", diff --git a/create-quasar/templates/app-extension/ae-ts/index.js b/create-quasar/templates/app-extension/ae-ts/index.js index 1eb3aa221cb..6d7f110e56a 100644 --- a/create-quasar/templates/app-extension/ae-ts/index.js +++ b/create-quasar/templates/app-extension/ae-ts/index.js @@ -22,7 +22,11 @@ export async function script ({ scope, utils }) { }, utils.commonPrompts.description, - utils.commonPrompts.author, + ]) + + await utils.injectAuthor(scope) + + await utils.prompts(scope, [ { type: 'text', name: 'license', @@ -48,27 +52,6 @@ export async function script ({ scope, utils }) { } ], format: utils.convertArrayToObject - }, - { - type: 'text', - name: 'repositoryType', - initial: 'git', - message: 'Repository type:' - }, - { - type: 'text', - name: 'repositoryURL', - message: 'Repository URL (eg https://github.com/quasarframework/quasar):' - }, - { - type: 'text', - name: 'homepage', - message: 'Homepage URL:' - }, - { - type: 'text', - name: 'bugs', - message: 'Issue reporting URL (eg https://github.com/quasarframework/quasar/issues):' } ]) diff --git a/create-quasar/templates/app/quasar-v1/index.js b/create-quasar/templates/app/quasar-v1/index.js index 01a89447781..97aadfb2c3f 100644 --- a/create-quasar/templates/app/quasar-v1/index.js +++ b/create-quasar/templates/app/quasar-v1/index.js @@ -9,10 +9,11 @@ export async function script ({ scope, utils }) { utils.isValidPackageName(val) || 'Invalid package.json name' }, utils.commonPrompts.productName, - utils.commonPrompts.description, - utils.commonPrompts.author + utils.commonPrompts.description ]) + await utils.injectAuthor(scope) + const { script } = await import(`./${ scope.scriptType }/index.js`) await script({ scope, utils }) } diff --git a/create-quasar/templates/app/quasar-v2/index.js b/create-quasar/templates/app/quasar-v2/index.js index adf027a67b4..1490f60cc4d 100644 --- a/create-quasar/templates/app/quasar-v2/index.js +++ b/create-quasar/templates/app/quasar-v2/index.js @@ -23,8 +23,11 @@ export async function script ({ scope, utils }) { utils.commonPrompts.productName, utils.commonPrompts.description, - utils.commonPrompts.author, + ]) + + await utils.injectAuthor(scope) + await utils.prompts(scope, [ { type: 'select', name: 'sfcStyle', diff --git a/create-quasar/templates/ui-kit/.eslintrc.cjs b/create-quasar/templates/ui-kit/.eslintrc.cjs index 5a669a7cf07..16fb1c21c92 100644 --- a/create-quasar/templates/ui-kit/.eslintrc.cjs +++ b/create-quasar/templates/ui-kit/.eslintrc.cjs @@ -17,11 +17,7 @@ module.exports = { 'componentName', 'directiveName', - 'license', - 'repositoryType', - 'repositoryURL', - 'homepage', - 'bugs' + 'license' ] }, diff --git a/create-quasar/templates/ui-kit/index.js b/create-quasar/templates/ui-kit/index.js index ddcc1e54a33..f8e1eedeb25 100644 --- a/create-quasar/templates/ui-kit/index.js +++ b/create-quasar/templates/ui-kit/index.js @@ -8,9 +8,12 @@ export async function script ({ scope, utils }) { message: 'Project name (npm name, kebab-case, without "quasar-ui" prefix)', validate: (val) => utils.isValidPackageName(val) || 'Invalid package.json name' - }, + } + ]) + + await utils.injectAuthor(scope) - utils.commonPrompts.author, + await utils.prompts(scope, [ utils.commonPrompts.license, { @@ -104,12 +107,7 @@ export async function script ({ scope, utils }) { { title: 'ESM (q/app-vite >= 1.5, q/app-webpack >= 3.10)', value: 'esm', description: 'recommended' }, { title: 'CommonJS', value: 'commonjs' } ] - }, - - utils.commonPrompts.repositoryType, - utils.commonPrompts.repositoryURL, - utils.commonPrompts.homepage, - utils.commonPrompts.bugs + } ]) const { script } = await import(`./quasar-${ scope.quasarVersion }/index.js`) diff --git a/create-quasar/templates/ui-kit/quasar-v1/BASE/ui/_package.json b/create-quasar/templates/ui-kit/quasar-v1/BASE/ui/_package.json index 6ad250a3c20..18dfadbcc1e 100644 --- a/create-quasar/templates/ui-kit/quasar-v1/BASE/ui/_package.json +++ b/create-quasar/templates/ui-kit/quasar-v1/BASE/ui/_package.json @@ -17,12 +17,6 @@ "build:js": "node build/script.javascript.js", "build:css": "node build/script.css.js" }, - "repository": { - "type": "<%= repositoryType %>", - "url": "<%= repositoryURL %>" - }, - "bugs": "<%= bugs %>", - "homepage": "<%= homepage %>", "devDependencies": { "autoprefixer": "^10.0.2", "cssnano": "^4.1.10", diff --git a/create-quasar/templates/ui-kit/quasar-v1/ae/app-extension/_package.json b/create-quasar/templates/ui-kit/quasar-v1/ae/app-extension/_package.json index 18468a760ae..b2517f9e145 100644 --- a/create-quasar/templates/ui-kit/quasar-v1/ae/app-extension/_package.json +++ b/create-quasar/templates/ui-kit/quasar-v1/ae/app-extension/_package.json @@ -5,12 +5,6 @@ "author": "<%= author %>", "license": "<%= license %>", "main": "src/index.js", - "repository": { - "type": "<%= repositoryType %>", - "url": "<%= repositoryURL %>" - }, - "bugs": "<%= bugs %>", - "homepage": "<%= homepage %>", "dependencies": { "quasar-ui-<%= name %>": "latest" }, diff --git a/create-quasar/templates/ui-kit/quasar-v2/BASE/ui/_package.json b/create-quasar/templates/ui-kit/quasar-v2/BASE/ui/_package.json index a96a25a609d..df13346e1aa 100644 --- a/create-quasar/templates/ui-kit/quasar-v2/BASE/ui/_package.json +++ b/create-quasar/templates/ui-kit/quasar-v2/BASE/ui/_package.json @@ -17,12 +17,6 @@ "build:js": "node build/script.javascript.js", "build:css": "node build/script.css.js" }, - "repository": { - "type": "<%= repositoryType %>", - "url": "<%= repositoryURL %>" - }, - "bugs": "<%= bugs %>", - "homepage": "<%= homepage %>", "devDependencies": { "autoprefixer": "^10.0.2", "cssnano": "^4.1.10", diff --git a/create-quasar/templates/ui-kit/quasar-v2/ae/app-extension/_package.json b/create-quasar/templates/ui-kit/quasar-v2/ae/app-extension/_package.json index 06d0092ce3f..3a90ec7fbcb 100644 --- a/create-quasar/templates/ui-kit/quasar-v2/ae/app-extension/_package.json +++ b/create-quasar/templates/ui-kit/quasar-v2/ae/app-extension/_package.json @@ -5,12 +5,6 @@ "author": "<%= author %>", "license": "<%= license %>", "type": "<%= aeCodeFormat === 'esm' ? 'module' : 'commonjs' %>", - "repository": { - "type": "<%= repositoryType %>", - "url": "<%= repositoryURL %>" - }, - "bugs": "<%= bugs %>", - "homepage": "<%= homepage %>", "dependencies": { "quasar-ui-<%= name %>": "latest" }, diff --git a/create-quasar/utils/index.js b/create-quasar/utils/index.js index 2f12efab14a..f75c74d3ad4 100644 --- a/create-quasar/utils/index.js +++ b/create-quasar/utils/index.js @@ -337,41 +337,29 @@ const commonPrompts = { val.length > 0 || 'Invalid project description' }, - author: { - type: 'text', - name: 'author', - initial: () => getGitUser(), - message: 'Author:' - }, - license: { type: 'text', name: 'license', message: 'License type', initial: 'MIT' - }, + } +} - repositoryType: { - type: 'text', - name: 'repositoryType', - message: 'Repository type:', - initial: 'git' - }, - repositoryURL: { - type: 'text', - name: 'repositoryURL', - message: 'Repository URL: (eg https://github.com/quasarframework/quasar)' - }, - homepage: { - type: 'text', - name: 'homepage', - message: 'Homepage URL:' - }, - bugs: { - type: 'text', - name: 'bugs', - message: 'Issue reporting URL: (eg https://github.com/quasarframework/quasar/issues)' +export async function injectAuthor (scope) { + const author = getGitUser() + + if (author) { + scope.author = author + return } + + await prompts(scope, [ + { + type: 'text', + name: 'author', + message: 'Author:' + } + ]) } export default { @@ -391,5 +379,6 @@ export default { ensureOutsideProject, initializeGit, - commonPrompts + commonPrompts, + injectAuthor }