]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
style: format files
authorHaoqun Jiang <haoqunjiang@gmail.com>
Tue, 27 Jul 2021 05:41:23 +0000 (13:41 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Tue, 27 Jul 2021 05:41:57 +0000 (13:41 +0800)
54 files changed:
.prettierignore [new file with mode: 0644]
.prettierrc [new file with mode: 0644]
README.md
index.js
package.json
playground/default-ts-with-tests/package.json
playground/default-ts-with-tests/src/components/HelloWorld.vue
playground/default-ts-with-tests/tsconfig.json
playground/default-ts-with-tests/vite.config.ts
playground/default-ts/package.json
playground/default-ts/src/components/HelloWorld.vue
playground/default-ts/tsconfig.json
playground/default-ts/vite.config.ts
playground/default-with-tests/jsconfig.json
playground/default-with-tests/package.json
playground/default-with-tests/vite.config.js
playground/default/jsconfig.json
playground/default/package.json
playground/default/vite.config.js
playground/spa-ts-with-tests/package.json
playground/spa-ts-with-tests/src/App.vue
playground/spa-ts-with-tests/src/components/HelloWorld.vue
playground/spa-ts-with-tests/src/store/index.ts
playground/spa-ts-with-tests/tsconfig.json
playground/spa-ts-with-tests/vite.config.ts
playground/spa-ts/package.json
playground/spa-ts/src/App.vue
playground/spa-ts/src/components/HelloWorld.vue
playground/spa-ts/src/store/index.ts
playground/spa-ts/tsconfig.json
playground/spa-ts/vite.config.ts
playground/spa-with-tests/jsconfig.json
playground/spa-with-tests/package.json
playground/spa-with-tests/src/App.vue
playground/spa-with-tests/src/store/index.js
playground/spa-with-tests/vite.config.js
playground/spa/jsconfig.json
playground/spa/package.json
playground/spa/src/App.vue
playground/spa/src/store/index.js
playground/spa/vite.config.js
snapshot.js
template/code/spa/src/App.vue
template/code/spa/src/store/index.js
template/code/typescript-default/src/components/HelloWorld.vue
template/code/typescript-spa/src/App.vue
template/code/typescript-spa/src/components/HelloWorld.vue
template/code/typescript-spa/src/store/index.ts
template/config/base/jsconfig.json
template/config/base/vite.config.js
utils/deepMerge.js
utils/directoryTraverse.js
utils/renderTemplate.js
utils/templateList.js

diff --git a/.prettierignore b/.prettierignore
new file mode 100644 (file)
index 0000000..1b9dac1
--- /dev/null
@@ -0,0 +1,6 @@
+pnpm-lock.yaml
+
+# prettier doesn't respect newlines between chained methods
+# https://github.com/prettier/prettier/issues/7884
+**/*.spec.js
+**/*.spec.ts
diff --git a/.prettierrc b/.prettierrc
new file mode 100644 (file)
index 0000000..dbd9637
--- /dev/null
@@ -0,0 +1,7 @@
+{
+  "semi": false,
+  "tabWidth": 2,
+  "singleQuote": true,
+  "printWidth": 80,
+  "trailingComma": "none"
+}
index e6df97ae46c87bb2909785a5b7b7baaebe2d6c55..3b3d1d93795e479ea21dfc1b28886140879db528 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,2 +1,3 @@
 # create-vue
+
 An easy way to start a Vue project
index c762c60bfb4b15aa4ede7b77c04197c26984a1ef..6bca421c20531bfe76fbaaa181645b423f150090 100755 (executable)
--- a/index.js
+++ b/index.js
@@ -34,7 +34,7 @@ function canSafelyOverwrite(dir) {
   return !fs.existsSync(dir) || fs.readdirSync(dir).length === 0
 }
 
-function emptyDir (dir) {
+function emptyDir(dir) {
   postOrderDirectoryTraverse(
     dir,
     (dir) => fs.rmdirSync(dir),
@@ -45,7 +45,7 @@ function emptyDir (dir) {
 async function init() {
   const cwd = process.cwd()
   const argv = minimist(process.argv.slice(2))
-  
+
   let targetDir = argv._[0]
   const defaultProjectName = !targetDir ? 'vue-project' : targetDir
 
@@ -62,71 +62,77 @@ async function init() {
     // - Project language: JavaScript / TypeScript
     // - Install Vue Router & Vuex for SPA development?
     // - Add Cypress for testing?
-    result = await prompts([
-      {
-        name: 'projectName',
-        type: targetDir ? null : 'text',
-        message: 'Project name:',
-        initial: defaultProjectName,
-        onState: (state) =>
-          (targetDir = String(state.value).trim() || defaultProjectName)
-      },
-      {
-        name: 'shouldOverwrite',
-        type: () => canSafelyOverwrite(targetDir) ? null : 'confirm',
-        message: () => {
-          const dirForPrompt = targetDir === '.'
-            ? 'Current directory'
-            : `Target directory "${targetDir}"`
-
-          return `${dirForPrompt} is not empty. Remove existing files and continue?`
-        }
-      },
-      {
-        name: 'overwriteChecker',
-        type: (prev, values = {}) => {
-          if (values.shouldOverwrite === false) {
-            throw new Error(red('✖') + ' Operation cancelled')
+    result = await prompts(
+      [
+        {
+          name: 'projectName',
+          type: targetDir ? null : 'text',
+          message: 'Project name:',
+          initial: defaultProjectName,
+          onState: (state) =>
+            (targetDir = String(state.value).trim() || defaultProjectName)
+        },
+        {
+          name: 'shouldOverwrite',
+          type: () => (canSafelyOverwrite(targetDir) ? null : 'confirm'),
+          message: () => {
+            const dirForPrompt =
+              targetDir === '.'
+                ? 'Current directory'
+                : `Target directory "${targetDir}"`
+
+            return `${dirForPrompt} is not empty. Remove existing files and continue?`
           }
-          return null
+        },
+        {
+          name: 'overwriteChecker',
+          type: (prev, values = {}) => {
+            if (values.shouldOverwrite === false) {
+              throw new Error(red('✖') + ' Operation cancelled')
+            }
+            return null
+          }
+        },
+        {
+          name: 'packageName',
+          type: () => (isValidPackageName(targetDir) ? null : 'text'),
+          message: 'Package name:',
+          initial: () => toValidPackageName(targetDir),
+          validate: (dir) =>
+            isValidPackageName(dir) || 'Invalid package.json name'
+        },
+        {
+          name: 'shouldUseTypeScript',
+          type: () => (isValidTemplate ? null : 'toggle'),
+          message: 'Add TypeScript?',
+          initial: false,
+          active: 'Yes',
+          inactive: 'No'
+        },
+        {
+          name: 'isSPA',
+          type: () => (isValidTemplate ? null : 'toggle'),
+          message:
+            'Add Vue Router & Vuex for Single Page Application development?',
+          initial: false,
+          active: 'Yes',
+          inactive: 'No'
+        },
+        {
+          name: 'shouldAddCypress',
+          type: () => (isValidTemplate ? null : 'toggle'),
+          message: 'Add Cypress for testing?',
+          initial: false,
+          active: 'Yes',
+          inactive: 'No'
         }
-      },
+      ],
       {
-        name: 'packageName',
-        type: () => (isValidPackageName(targetDir) ? null : 'text'),
-        message: 'Package name:',
-        initial: () => toValidPackageName(targetDir),
-        validate: (dir) => isValidPackageName(dir) || 'Invalid package.json name'
-      },
-      {
-        name: 'shouldUseTypeScript',
-        type: () => isValidTemplate ? null : 'toggle',
-        message: 'Add TypeScript?',
-        initial: false,
-        active: 'Yes',
-        inactive: 'No'
-      },
-      {
-        name: 'isSPA',
-        type: () => isValidTemplate ? null : 'toggle',
-        message: 'Add Vue Router & Vuex for Single Page Application development?',
-        initial: false,
-        active: 'Yes',
-        inactive: 'No'
-      },
-      {
-        name: 'shouldAddCypress',
-        type: () => isValidTemplate ? null : 'toggle',
-        message: 'Add Cypress for testing?',
-        initial: false,
-        active: 'Yes',
-        inactive: 'No'
-      }
-    ], {
-      onCancel: () => {
-        throw new Error(red('✖') + ' Operation cancelled')
+        onCancel: () => {
+          throw new Error(red('✖') + ' Operation cancelled')
+        }
       }
-    })
+    )
   } catch (cancelled) {
     console.log(cancelled.message)
     process.exit(1)
@@ -180,13 +186,17 @@ async function init() {
         if (filepath.endsWith('.js')) {
           fs.renameSync(filepath, filepath.replace(/\.js$/, '.ts'))
         } else if (path.basename(filepath) === 'jsconfig.json') {
-          fs.renameSync(filepath, filepath.replace(/jsconfig\.json$/, 'tsconfig.json'))
+          fs.renameSync(
+            filepath,
+            filepath.replace(/jsconfig\.json$/, 'tsconfig.json')
+          )
         }
       }
     )
   }
 
   // Render code template.
+  // prettier-ignore
   const codeTemplate =
     (shouldUseTypeScript ? 'typescript-' : '') +
     (isSPA ? 'spa' : 'default')
@@ -219,9 +229,9 @@ async function init() {
   const packageManager = /pnpm/.test(process.env.npm_execpath)
     ? 'pnpm'
     : /yarn/.test(process.env.npm_execpath)
-      ?'yarn'
-      : 'npm'
-  
+    'yarn'
+    : 'npm'
+
   const commandsMap = {
     install: {
       pnpm: 'pnpm install',
index 17567eb94d286a8ecd484b3461c914f64ec62abd..054f73dafa26bdf4a6419e550f765e356dc03f3c 100644 (file)
@@ -16,6 +16,7 @@
     "node": "^12.13.0 || ^14.0.0 || >= 16.0.0"
   },
   "scripts": {
+    "format": "prettier --write .",
     "test": "echo \"Error: no test specified\" && exit 1",
     "prepublishOnly": "node snapshot.js"
   },
index b1e12f164c712f1b6aef61170e1fafba0d7ca15b..fee85fe23dee3ebb1a258b03392a855977452ccd 100644 (file)
@@ -27,4 +27,4 @@
     "typescript": "~4.3.5",
     "vue-tsc": "^0.2.2"
   }
-}
\ No newline at end of file
+}
index 2dac52348717e5f18c8ce97d9144ad2822083475..97b3d3da6d08da45f0da95302997e2628c4e996c 100644 (file)
@@ -29,7 +29,7 @@
 import { ref } from 'vue'
 
 defineProps<{
-  msg: String,
+  msg: String
 }>()
 
 const count = ref(0)
index d3adf1bf0ba0f302ca95de11ac768ab33a3f11a4..9c2cfe6b94aa9c2da03a83f9915bde7346ae62c2 100644 (file)
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
     "skipLibCheck": true
   },
-  "include": [
-    "vite.config.*",
-
-    "src/**/*",
-    "src/**/*.vue"
-  ],
-  "exclude": [
-    "src/**/__tests__/**"
-  ]
+  "include": ["vite.config.*", "src/**/*", "src/**/*.vue"],
+  "exclude": ["src/**/__tests__/**"]
 }
index 8ae6fd079db1694be32b53adb63db1e54e19bb1d..032e163cf57f312792c106d417534e89491a0727 100644 (file)
@@ -7,7 +7,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname,
-    },
+      '@/': new URL('./src/', import.meta.url).pathname
+    }
   }
 })
index c12f476c7c560b16e14ea3cd346ce66a8a18c5ea..875e356bab9e91af54f043a37235556260971ce4 100644 (file)
@@ -19,4 +19,4 @@
     "typescript": "~4.3.5",
     "vue-tsc": "^0.2.2"
   }
-}
\ No newline at end of file
+}
index 2dac52348717e5f18c8ce97d9144ad2822083475..97b3d3da6d08da45f0da95302997e2628c4e996c 100644 (file)
@@ -29,7 +29,7 @@
 import { ref } from 'vue'
 
 defineProps<{
-  msg: String,
+  msg: String
 }>()
 
 const count = ref(0)
index d3adf1bf0ba0f302ca95de11ac768ab33a3f11a4..9c2cfe6b94aa9c2da03a83f9915bde7346ae62c2 100644 (file)
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
     "skipLibCheck": true
   },
-  "include": [
-    "vite.config.*",
-
-    "src/**/*",
-    "src/**/*.vue"
-  ],
-  "exclude": [
-    "src/**/__tests__/**"
-  ]
+  "include": ["vite.config.*", "src/**/*", "src/**/*.vue"],
+  "exclude": ["src/**/__tests__/**"]
 }
index 8ae6fd079db1694be32b53adb63db1e54e19bb1d..032e163cf57f312792c106d417534e89491a0727 100644 (file)
@@ -7,7 +7,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname,
-    },
+      '@/': new URL('./src/', import.meta.url).pathname
+    }
   }
 })
index d3adf1bf0ba0f302ca95de11ac768ab33a3f11a4..9c2cfe6b94aa9c2da03a83f9915bde7346ae62c2 100644 (file)
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
     "skipLibCheck": true
   },
-  "include": [
-    "vite.config.*",
-
-    "src/**/*",
-    "src/**/*.vue"
-  ],
-  "exclude": [
-    "src/**/__tests__/**"
-  ]
+  "include": ["vite.config.*", "src/**/*", "src/**/*.vue"],
+  "exclude": ["src/**/__tests__/**"]
 }
index 44a3acf9a5c396487492fb0c57254a9a2c20e2ca..c95e46c75225103c9296cfaf44a435795346e996 100644 (file)
@@ -24,4 +24,4 @@
     "cypress": "^8.0.0",
     "start-server-and-test": "^1.12.6"
   }
-}
\ No newline at end of file
+}
index 8ae6fd079db1694be32b53adb63db1e54e19bb1d..032e163cf57f312792c106d417534e89491a0727 100644 (file)
@@ -7,7 +7,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname,
-    },
+      '@/': new URL('./src/', import.meta.url).pathname
+    }
   }
 })
index d3adf1bf0ba0f302ca95de11ac768ab33a3f11a4..9c2cfe6b94aa9c2da03a83f9915bde7346ae62c2 100644 (file)
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
     "skipLibCheck": true
   },
-  "include": [
-    "vite.config.*",
-
-    "src/**/*",
-    "src/**/*.vue"
-  ],
-  "exclude": [
-    "src/**/__tests__/**"
-  ]
+  "include": ["vite.config.*", "src/**/*", "src/**/*.vue"],
+  "exclude": ["src/**/__tests__/**"]
 }
index 0ff042cd869f500fa35eaeab17c19f57c4d6c425..b9abc77397a10cf88c3fcf006533ccea990f8b8f 100644 (file)
@@ -16,4 +16,4 @@
     "@vue/compiler-sfc": "^3.1.5",
     "vite": "^2.4.3"
   }
-}
\ No newline at end of file
+}
index 8ae6fd079db1694be32b53adb63db1e54e19bb1d..032e163cf57f312792c106d417534e89491a0727 100644 (file)
@@ -7,7 +7,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname,
-    },
+      '@/': new URL('./src/', import.meta.url).pathname
+    }
   }
 })
index 45ac7225a2f2586db50ad6430a924de8a220f1ba..c55fef809e4d433b5462fe6912d9b65f7228d05c 100644 (file)
@@ -29,4 +29,4 @@
     "typescript": "~4.3.5",
     "vue-tsc": "^0.2.2"
   }
-}
\ No newline at end of file
+}
index b964355125dc3c458d3a6bfabc748abd45296d9e..6a65bcc1751df8669f08f543a3831f2065dbd7aa 100644 (file)
@@ -3,7 +3,7 @@
     <router-link to="/">Home</router-link> |
     <router-link to="/about">About</router-link>
   </div>
-  <router-view/>
+  <router-view />
 </template>
 
 <style>
index 2dac52348717e5f18c8ce97d9144ad2822083475..97b3d3da6d08da45f0da95302997e2628c4e996c 100644 (file)
@@ -29,7 +29,7 @@
 import { ref } from 'vue'
 
 defineProps<{
-  msg: String,
+  msg: String
 }>()
 
 const count = ref(0)
index 5f05f19391dba84eb4167b3d496bc8b716646fdc..2b9da8fe161a9b06d88ff79ece5b1960111179ae 100644 (file)
@@ -1,12 +1,8 @@
 import { createStore } from 'vuex'
 
 export default createStore({
-  state: {
-  },
-  mutations: {
-  },
-  actions: {
-  },
-  modules: {
-  }
+  state: {},
+  mutations: {},
+  actions: {},
+  modules: {}
 })
index d3adf1bf0ba0f302ca95de11ac768ab33a3f11a4..9c2cfe6b94aa9c2da03a83f9915bde7346ae62c2 100644 (file)
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
     "skipLibCheck": true
   },
-  "include": [
-    "vite.config.*",
-
-    "src/**/*",
-    "src/**/*.vue"
-  ],
-  "exclude": [
-    "src/**/__tests__/**"
-  ]
+  "include": ["vite.config.*", "src/**/*", "src/**/*.vue"],
+  "exclude": ["src/**/__tests__/**"]
 }
index 8ae6fd079db1694be32b53adb63db1e54e19bb1d..032e163cf57f312792c106d417534e89491a0727 100644 (file)
@@ -7,7 +7,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname,
-    },
+      '@/': new URL('./src/', import.meta.url).pathname
+    }
   }
 })
index c9ae486ec1cf6c457bf48113ffb66a213917c94d..afa896da15d36261e9ef6383d4a98ef952cb6b82 100644 (file)
@@ -21,4 +21,4 @@
     "typescript": "~4.3.5",
     "vue-tsc": "^0.2.2"
   }
-}
\ No newline at end of file
+}
index b964355125dc3c458d3a6bfabc748abd45296d9e..6a65bcc1751df8669f08f543a3831f2065dbd7aa 100644 (file)
@@ -3,7 +3,7 @@
     <router-link to="/">Home</router-link> |
     <router-link to="/about">About</router-link>
   </div>
-  <router-view/>
+  <router-view />
 </template>
 
 <style>
index 2dac52348717e5f18c8ce97d9144ad2822083475..97b3d3da6d08da45f0da95302997e2628c4e996c 100644 (file)
@@ -29,7 +29,7 @@
 import { ref } from 'vue'
 
 defineProps<{
-  msg: String,
+  msg: String
 }>()
 
 const count = ref(0)
index 5f05f19391dba84eb4167b3d496bc8b716646fdc..2b9da8fe161a9b06d88ff79ece5b1960111179ae 100644 (file)
@@ -1,12 +1,8 @@
 import { createStore } from 'vuex'
 
 export default createStore({
-  state: {
-  },
-  mutations: {
-  },
-  actions: {
-  },
-  modules: {
-  }
+  state: {},
+  mutations: {},
+  actions: {},
+  modules: {}
 })
index d3adf1bf0ba0f302ca95de11ac768ab33a3f11a4..9c2cfe6b94aa9c2da03a83f9915bde7346ae62c2 100644 (file)
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
     "skipLibCheck": true
   },
-  "include": [
-    "vite.config.*",
-
-    "src/**/*",
-    "src/**/*.vue"
-  ],
-  "exclude": [
-    "src/**/__tests__/**"
-  ]
+  "include": ["vite.config.*", "src/**/*", "src/**/*.vue"],
+  "exclude": ["src/**/__tests__/**"]
 }
index 8ae6fd079db1694be32b53adb63db1e54e19bb1d..032e163cf57f312792c106d417534e89491a0727 100644 (file)
@@ -7,7 +7,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname,
-    },
+      '@/': new URL('./src/', import.meta.url).pathname
+    }
   }
 })
index d3adf1bf0ba0f302ca95de11ac768ab33a3f11a4..9c2cfe6b94aa9c2da03a83f9915bde7346ae62c2 100644 (file)
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
     "skipLibCheck": true
   },
-  "include": [
-    "vite.config.*",
-
-    "src/**/*",
-    "src/**/*.vue"
-  ],
-  "exclude": [
-    "src/**/__tests__/**"
-  ]
+  "include": ["vite.config.*", "src/**/*", "src/**/*.vue"],
+  "exclude": ["src/**/__tests__/**"]
 }
index 443e5f8bce3d6273407d7600b2664853d544d1c9..49c07602c29be87944e1ffd9bb5df13923d82a9f 100644 (file)
@@ -26,4 +26,4 @@
     "cypress": "^8.0.0",
     "start-server-and-test": "^1.12.6"
   }
-}
\ No newline at end of file
+}
index b964355125dc3c458d3a6bfabc748abd45296d9e..6a65bcc1751df8669f08f543a3831f2065dbd7aa 100644 (file)
@@ -3,7 +3,7 @@
     <router-link to="/">Home</router-link> |
     <router-link to="/about">About</router-link>
   </div>
-  <router-view/>
+  <router-view />
 </template>
 
 <style>
index 5f05f19391dba84eb4167b3d496bc8b716646fdc..2b9da8fe161a9b06d88ff79ece5b1960111179ae 100644 (file)
@@ -1,12 +1,8 @@
 import { createStore } from 'vuex'
 
 export default createStore({
-  state: {
-  },
-  mutations: {
-  },
-  actions: {
-  },
-  modules: {
-  }
+  state: {},
+  mutations: {},
+  actions: {},
+  modules: {}
 })
index 8ae6fd079db1694be32b53adb63db1e54e19bb1d..032e163cf57f312792c106d417534e89491a0727 100644 (file)
@@ -7,7 +7,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname,
-    },
+      '@/': new URL('./src/', import.meta.url).pathname
+    }
   }
 })
index d3adf1bf0ba0f302ca95de11ac768ab33a3f11a4..9c2cfe6b94aa9c2da03a83f9915bde7346ae62c2 100644 (file)
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
     "skipLibCheck": true
   },
-  "include": [
-    "vite.config.*",
-
-    "src/**/*",
-    "src/**/*.vue"
-  ],
-  "exclude": [
-    "src/**/__tests__/**"
-  ]
+  "include": ["vite.config.*", "src/**/*", "src/**/*.vue"],
+  "exclude": ["src/**/__tests__/**"]
 }
index a98131e1f1412b45f56cd8541fda0a1e09bd41bf..bc2cd488944652075ecd960a35f586d9808775f7 100644 (file)
@@ -18,4 +18,4 @@
     "@vue/compiler-sfc": "^3.1.5",
     "vite": "^2.4.3"
   }
-}
\ No newline at end of file
+}
index b964355125dc3c458d3a6bfabc748abd45296d9e..6a65bcc1751df8669f08f543a3831f2065dbd7aa 100644 (file)
@@ -3,7 +3,7 @@
     <router-link to="/">Home</router-link> |
     <router-link to="/about">About</router-link>
   </div>
-  <router-view/>
+  <router-view />
 </template>
 
 <style>
index 5f05f19391dba84eb4167b3d496bc8b716646fdc..2b9da8fe161a9b06d88ff79ece5b1960111179ae 100644 (file)
@@ -1,12 +1,8 @@
 import { createStore } from 'vuex'
 
 export default createStore({
-  state: {
-  },
-  mutations: {
-  },
-  actions: {
-  },
-  modules: {
-  }
+  state: {},
+  mutations: {},
+  actions: {},
+  modules: {}
 })
index 8ae6fd079db1694be32b53adb63db1e54e19bb1d..032e163cf57f312792c106d417534e89491a0727 100644 (file)
@@ -7,7 +7,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname,
-    },
+      '@/': new URL('./src/', import.meta.url).pathname
+    }
   }
 })
index 53b0c5fc378364e715c1c4b6c367a7fdd88f1d0d..06952187dd8faef5fd92d51315c4c1684811a894 100644 (file)
@@ -2,12 +2,16 @@ import templateList from './utils/templateList.js'
 import { spawnSync } from 'child_process'
 
 for (const template of templateList) {
-  spawnSync('node', [
-    new URL('./index.js', import.meta.url).pathname,
-    template,
-    '--template',
-    template
-  ], {
-    cwd: new URL('./playground/', import.meta.url).pathname
-  })
+  spawnSync(
+    'node',
+    [
+      new URL('./index.js', import.meta.url).pathname,
+      template,
+      '--template',
+      template
+    ],
+    {
+      cwd: new URL('./playground/', import.meta.url).pathname
+    }
+  )
 }
index b964355125dc3c458d3a6bfabc748abd45296d9e..6a65bcc1751df8669f08f543a3831f2065dbd7aa 100644 (file)
@@ -3,7 +3,7 @@
     <router-link to="/">Home</router-link> |
     <router-link to="/about">About</router-link>
   </div>
-  <router-view/>
+  <router-view />
 </template>
 
 <style>
index 5f05f19391dba84eb4167b3d496bc8b716646fdc..2b9da8fe161a9b06d88ff79ece5b1960111179ae 100644 (file)
@@ -1,12 +1,8 @@
 import { createStore } from 'vuex'
 
 export default createStore({
-  state: {
-  },
-  mutations: {
-  },
-  actions: {
-  },
-  modules: {
-  }
+  state: {},
+  mutations: {},
+  actions: {},
+  modules: {}
 })
index 2dac52348717e5f18c8ce97d9144ad2822083475..97b3d3da6d08da45f0da95302997e2628c4e996c 100644 (file)
@@ -29,7 +29,7 @@
 import { ref } from 'vue'
 
 defineProps<{
-  msg: String,
+  msg: String
 }>()
 
 const count = ref(0)
index b964355125dc3c458d3a6bfabc748abd45296d9e..6a65bcc1751df8669f08f543a3831f2065dbd7aa 100644 (file)
@@ -3,7 +3,7 @@
     <router-link to="/">Home</router-link> |
     <router-link to="/about">About</router-link>
   </div>
-  <router-view/>
+  <router-view />
 </template>
 
 <style>
index 2dac52348717e5f18c8ce97d9144ad2822083475..97b3d3da6d08da45f0da95302997e2628c4e996c 100644 (file)
@@ -29,7 +29,7 @@
 import { ref } from 'vue'
 
 defineProps<{
-  msg: String,
+  msg: String
 }>()
 
 const count = ref(0)
index 5f05f19391dba84eb4167b3d496bc8b716646fdc..2b9da8fe161a9b06d88ff79ece5b1960111179ae 100644 (file)
@@ -1,12 +1,8 @@
 import { createStore } from 'vuex'
 
 export default createStore({
-  state: {
-  },
-  mutations: {
-  },
-  actions: {
-  },
-  modules: {
-  }
+  state: {},
+  mutations: {},
+  actions: {},
+  modules: {}
 })
index d3adf1bf0ba0f302ca95de11ac768ab33a3f11a4..9c2cfe6b94aa9c2da03a83f9915bde7346ae62c2 100644 (file)
     "resolveJsonModule": true,
     "esModuleInterop": true,
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
     "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
     "skipLibCheck": true
   },
-  "include": [
-    "vite.config.*",
-
-    "src/**/*",
-    "src/**/*.vue"
-  ],
-  "exclude": [
-    "src/**/__tests__/**"
-  ]
+  "include": ["vite.config.*", "src/**/*", "src/**/*.vue"],
+  "exclude": ["src/**/__tests__/**"]
 }
index 8ae6fd079db1694be32b53adb63db1e54e19bb1d..032e163cf57f312792c106d417534e89491a0727 100644 (file)
@@ -7,7 +7,7 @@ export default defineConfig({
   plugins: [vue(), vueJsx()],
   resolve: {
     alias: {
-      '@/': new URL('./src/', import.meta.url).pathname,
-    },
+      '@/': new URL('./src/', import.meta.url).pathname
+    }
   }
 })
index 1fb16e831a2c70a6783ec5e8ec531d64c551ff3e..bfdaf8b071ae442c3c645bce1036e3f4c13b13af 100644 (file)
@@ -1,4 +1,4 @@
-const isObject = val => val && typeof val === 'object'
+const isObject = (val) => val && typeof val === 'object'
 const mergeArrayWithDedupe = (a, b) => Array.from(new Set([...a, ...b]))
 
 /**
index 645d43c8d6720025f030c10e8929cd384710c7f0..73b7fa3b81bcb0a4dc65aab149524dedeeb43240 100644 (file)
@@ -1,9 +1,9 @@
-import fs from 'fs';
-import path from 'path';
+import fs from 'fs'
+import path from 'path'
 
 export function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
   for (const filename of fs.readdirSync(dir)) {
-    const fullpath = path.resolve(dir, filename);
+    const fullpath = path.resolve(dir, filename)
     if (fs.lstatSync(fullpath).isDirectory()) {
       dirCallback(fullpath)
       // in case the dirCallback removes the directory entirely
@@ -12,7 +12,7 @@ export function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
       }
       continue
     }
-    fileCallback(fullpath);
+    fileCallback(fullpath)
   }
 }
 
@@ -22,7 +22,7 @@ export function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
     if (fs.lstatSync(fullpath).isDirectory()) {
       postOrderDirectoryTraverse(fullpath, dirCallback, fileCallback)
       dirCallback(fullpath)
-      continue;
+      continue
     }
     fileCallback(fullpath)
   }
index c35df96778f07dba12fe964113096cb324cd43d5..8a64df77d93f41f67787c3538d0a4217b8565006 100644 (file)
@@ -14,7 +14,7 @@ import deepMerge from './deepMerge.js'
  */
 function renderTemplate(src, dest) {
   const stats = fs.statSync(src)
-  
+
   if (stats.isDirectory()) {
     // if it's a directory, render its subdirectories and files recusively
     fs.mkdirSync(dest, { recursive: true })
@@ -38,10 +38,7 @@ function renderTemplate(src, dest) {
 
   if (filename.startsWith('_')) {
     // rename `_file` to `.file`
-    dest = path.resolve(
-      path.dirname(dest),
-      filename.replace(/^_/, '.')
-    )
+    dest = path.resolve(path.dirname(dest), filename.replace(/^_/, '.'))
   }
 
   fs.copyFileSync(src, dest)
index cdcb4221f771005851e0ecbd1a83c282b762786e..60fe1cd043b2a4dd569f4c2f69487d4c690b08d6 100644 (file)
@@ -1,5 +1,5 @@
 const templateList = ['default', 'spa']
-  .flatMap(x => [x, x + '-ts'])
-  .flatMap(x => [x, x + '-with-tests'])
+  .flatMap((x) => [x, x + '-ts'])
+  .flatMap((x) => [x, x + '-with-tests'])
 
 export default templateList