]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
style: format code
authorHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 11 Aug 2021 13:29:18 +0000 (21:29 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 11 Aug 2021 13:29:18 +0000 (21:29 +0800)
index.js
utils/generateReadme.js
utils/getCommand.js

index c7d57b1f21a8b8c9eea69a30195c767357f26910..cab65f72919a3e76b623a89fa607ebbf1cfe0ce3 100755 (executable)
--- a/index.js
+++ b/index.js
@@ -311,12 +311,15 @@ async function init() {
     : 'npm'
 
   // README generation
-  fs.writeFileSync(path.resolve(root, 'README.md'), generateReadme({
-    projectName: result.projectName || defaultProjectName,
-    packageManager,
-    needsTypeScript,
-    needsTests
-  }))
+  fs.writeFileSync(
+    path.resolve(root, 'README.md'),
+    generateReadme({
+      projectName: result.projectName || defaultProjectName,
+      packageManager,
+      needsTypeScript,
+      needsTests
+    })
+  )
 
   console.log(`\nDone. Now run:\n`)
   if (root !== cwd) {
index 3eb338e17cc27747df5e8f3ffb4c3f8e274e01af..97985e7ae768d37d73eec7e467da4ed3bd42b65a 100644 (file)
@@ -21,13 +21,15 @@ export default function generateReadme({
   template = template.replace('{{projectName}}', projectName)
 
   if (needsTypeScript) {
-    template = template.replace('<!-- SFC-TYPE-SUPPORT -->\n', sfcTypeSupportDoc)
+    template = template.replace(
+      '<!-- SFC-TYPE-SUPPORT -->\n',
+      sfcTypeSupportDoc
+    )
   } else {
     template = template.replace('<!-- SFC-TYPE-SUPPORT -->\n\n', '')
   }
 
-  let npmScriptsDescriptions = 
-`\`\`\`sh
+  let npmScriptsDescriptions = `\`\`\`sh
 ${getCommand(packageManager, 'install')}
 \`\`\`
 
@@ -45,25 +47,28 @@ ${getCommand(packageManager, 'build')}
 `
 
   if (needsTests) {
-    npmScriptsDescriptions +=`
+    npmScriptsDescriptions += `
 ### Run Unit Tests with [Cypress Component Testing](https://docs.cypress.io/guides/component-testing/introduction)
 
 \`\`\`sh
-${getCommand(packageManager, 'test:unit')} # or \`${getCommand(packageManager, 'test:unit:ci')}\` for headless testing
+${getCommand(packageManager, 'test:unit')} # or \`${getCommand(
+      packageManager,
+      'test:unit:ci'
+    )}\` for headless testing
 \`\`\`
 
 ### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
 
 \`\`\`sh
-${getCommand(packageManager, 'test:e2e')} # or \`${getCommand(packageManager, 'test:e2e:ci')}\` for headless testing
+${getCommand(packageManager, 'test:e2e')} # or \`${getCommand(
+      packageManager,
+      'test:e2e:ci'
+    )}\` for headless testing
 \`\`\`
 `
   }
 
-  template = template.replace(
-    '<!-- NPM-SCRIPTS -->\n',
-    npmScriptsDescriptions
-  )
+  template = template.replace('<!-- NPM-SCRIPTS -->\n', npmScriptsDescriptions)
 
   return template
 }
index 1b6cba2ee9e3ba2985f0d59c49fc254fd47de0b5..4723888d6c569736db452914932d2116dca8d10c 100644 (file)
@@ -1,7 +1,9 @@
 export default function getCommand(packageManager, scriptName) {
   if (scriptName === 'install') {
-    return packageManager === 'yarn' ? 'yarn': `${packageManager} install`
+    return packageManager === 'yarn' ? 'yarn' : `${packageManager} install`
   }
 
-  return packageManager === 'npm' ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`
+  return packageManager === 'npm'
+    ? `npm run ${scriptName}`
+    : `${packageManager} ${scriptName}`
 }