Skip to content

Commit 2bed338

Browse files
authored
Initial commit
0 parents  commit 2bed338

24 files changed

+4640
-0
lines changed

.eslintrc.cjs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* eslint-env node */
2+
require('@rushstack/eslint-patch/modern-module-resolution')
3+
4+
module.exports = {
5+
root: true,
6+
'extends': [
7+
'plugin:vue/vue3-essential',
8+
'eslint:recommended',
9+
'@vue/eslint-config-typescript',
10+
'@vue/eslint-config-prettier/skip-formatting'
11+
],
12+
parserOptions: {
13+
ecmaVersion: 'latest'
14+
}
15+
}

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged
5+
npx lint-staged
6+
npx lint-staged

.prettierrc.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"semi": false,
4+
"tabWidth": 2,
5+
"singleQuote": true,
6+
"printWidth": 100,
7+
"trailingComma": "none"
8+
}

.vscode/extensions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"Vue.volar",
4+
"Vue.vscode-typescript-vue-plugin",
5+
"dbaeumer.vscode-eslint",
6+
"esbenp.prettier-vscode"
7+
]
8+
}

README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Vite Vue 3 TypeScript Starter
2+
3+
A rapid development starter kit using Vite, Vue3, TypeScript, Vitest, ESLint, Prettier, Husky, and UnoCSS.
4+
5+
### Getting Started
6+
7+
Run
8+
9+
```bash
10+
npx @xqsit94/vite-vue3-ts-starter my-vue-app
11+
```
12+
13+
and follow the prompts.
14+
15+
### Features
16+
17+
- 🚀 Fast development and build times with Vite
18+
- 🖖 Vue 3 for UI components
19+
- 🧭 Vue Router for client-side routing
20+
- 🗄️ Pinia for state management
21+
- 🦋 TypeScript for static type checking
22+
- 📚 Interactive UI development and testing with Storybook
23+
- ✅ Unit Testing with Vitest
24+
- 🧹 Linting and formatting with ESLint and Prettier
25+
- 🐶 Pre-commit checks using Husky
26+
- 🎨 Optimized CSS with UnoCSS
27+
28+
### Commands
29+
30+
Using npm
31+
32+
```bash
33+
npm run dev # Run the app in development mode.
34+
npm run build # Build the app for production using type-check and build-only.
35+
npm run preview # Serve the built app for preview.
36+
npm run test:watch # Run Vitest in watch mode.
37+
npm run test # Run Vitest without watch.
38+
npm run lint # Run ESLint to check for code issues.
39+
npm run format # Run Prettier to format code.
40+
npm run postinstall # Install Husky Git hooks.
41+
npm run prepare # Prepare Husky hooks.
42+
```
43+
44+
#### Using Yarn
45+
46+
```bash
47+
yarn dev # Run the app in development mode.
48+
yarn build # Build the app for production using type-check and build-only.
49+
yarn preview # Serve the built app for preview.
50+
yarn test:watch # Run Vitest in watch mode.
51+
yarn test # Run Vitest without watch.
52+
yarn lint # Run ESLint to check for code issues.
53+
yarn format # Run Prettier to format code.
54+
yarn postinstall # Install Husky Git hooks.
55+
yarn prepare # Prepare Husky hooks.
56+
```
57+
58+
#### Using pnpm
59+
60+
```bash
61+
pnpm dev # Run the app in development mode.
62+
pnpm build # Build the app for production using type-check and build-only.
63+
pnpm preview # Serve the built app for preview.
64+
pnpm test:watch # Run Vitest in watch mode.
65+
pnpm test # Run Vitest without watch.
66+
pnpm lint # Run ESLint to check for code issues.
67+
pnpm format # Run Prettier to format code.
68+
pnpm postinstall # Install Husky Git hooks.
69+
pnpm prepare # Prepare Husky hooks.
70+
```

index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + Vue + TS</title>
8+
</head>
9+
<body class="m-0 p-0 bg-light dark:bg-[#1b1b1f]">
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

package.json

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "@xqsit94/vite-vue3-ts-starter",
3+
"version": "1.0.0",
4+
"description": "A starter template for Vue3 with Vite and TypeScript includes Vitest, Eslint, Prettier, Husky, and Unocss",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "run-p type-check build-only",
9+
"preview": "vite preview",
10+
"test:watch": "vitest",
11+
"test": "vitest --no-watch",
12+
"build-only": "vite build",
13+
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
14+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
15+
"format": "prettier --write src/",
16+
"postinstall": "npx husky install",
17+
"prepare": "husky install"
18+
},
19+
"dependencies": {
20+
"pinia": "^2.1.6",
21+
"vue": "^3.3.4",
22+
"vue-router": "^4.2.4"
23+
},
24+
"devDependencies": {
25+
"@rushstack/eslint-patch": "^1.3.2",
26+
"@tsconfig/node18": "^18.2.0",
27+
"@types/jsdom": "^21.1.1",
28+
"@types/node": "^20.5.7",
29+
"@vitejs/plugin-vue": "^4.2.3",
30+
"@vitejs/plugin-vue-jsx": "^3.0.2",
31+
"@vue/eslint-config-prettier": "^8.0.0",
32+
"@vue/eslint-config-typescript": "^11.0.3",
33+
"@vue/test-utils": "^2.4.1",
34+
"@vue/tsconfig": "^0.4.0",
35+
"eslint": "^8.46.0",
36+
"eslint-plugin-vue": "^9.16.1",
37+
"husky": "^8.0.3",
38+
"jsdom": "^22.1.0",
39+
"npm-run-all": "^4.1.5",
40+
"prettier": "^3.0.0",
41+
"typescript": "~5.1.6",
42+
"unocss": "^0.55.4",
43+
"vite": "^4.4.9",
44+
"vitest": "^0.34.3",
45+
"vue-tsc": "^1.8.8"
46+
},
47+
"lint-staged": {
48+
"*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --cache --fix --ignore-path .gitignore",
49+
"*.src/": "prettier --write"
50+
}
51+
}

0 commit comments

Comments
 (0)