Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
plecrx authored Jan 10, 2024
0 parents commit 2bed338
Show file tree
Hide file tree
Showing 24 changed files with 4,640 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
parserOptions: {
ecmaVersion: 'latest'
}
}
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npx lint-staged
npx lint-staged
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Vite Vue 3 TypeScript Starter

A rapid development starter kit using Vite, Vue3, TypeScript, Vitest, ESLint, Prettier, Husky, and UnoCSS.

### Getting Started

Run

```bash
npx @xqsit94/vite-vue3-ts-starter my-vue-app
```

and follow the prompts.

### Features

- 🚀 Fast development and build times with Vite
- 🖖 Vue 3 for UI components
- 🧭 Vue Router for client-side routing
- 🗄️ Pinia for state management
- 🦋 TypeScript for static type checking
- 📚 Interactive UI development and testing with Storybook
- ✅ Unit Testing with Vitest
- 🧹 Linting and formatting with ESLint and Prettier
- 🐶 Pre-commit checks using Husky
- 🎨 Optimized CSS with UnoCSS

### Commands

Using npm

```bash
npm run dev # Run the app in development mode.
npm run build # Build the app for production using type-check and build-only.
npm run preview # Serve the built app for preview.
npm run test:watch # Run Vitest in watch mode.
npm run test # Run Vitest without watch.
npm run lint # Run ESLint to check for code issues.
npm run format # Run Prettier to format code.
npm run postinstall # Install Husky Git hooks.
npm run prepare # Prepare Husky hooks.
```

#### Using Yarn

```bash
yarn dev # Run the app in development mode.
yarn build # Build the app for production using type-check and build-only.
yarn preview # Serve the built app for preview.
yarn test:watch # Run Vitest in watch mode.
yarn test # Run Vitest without watch.
yarn lint # Run ESLint to check for code issues.
yarn format # Run Prettier to format code.
yarn postinstall # Install Husky Git hooks.
yarn prepare # Prepare Husky hooks.
```

#### Using pnpm

```bash
pnpm dev # Run the app in development mode.
pnpm build # Build the app for production using type-check and build-only.
pnpm preview # Serve the built app for preview.
pnpm test:watch # Run Vitest in watch mode.
pnpm test # Run Vitest without watch.
pnpm lint # Run ESLint to check for code issues.
pnpm format # Run Prettier to format code.
pnpm postinstall # Install Husky Git hooks.
pnpm prepare # Prepare Husky hooks.
```
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body class="m-0 p-0 bg-light dark:bg-[#1b1b1f]">
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
51 changes: 51 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@xqsit94/vite-vue3-ts-starter",
"version": "1.0.0",
"description": "A starter template for Vue3 with Vite and TypeScript includes Vitest, Eslint, Prettier, Husky, and Unocss",
"type": "module",
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"test:watch": "vitest",
"test": "vitest --no-watch",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/",
"postinstall": "npx husky install",
"prepare": "husky install"
},
"dependencies": {
"pinia": "^2.1.6",
"vue": "^3.3.4",
"vue-router": "^4.2.4"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.3.2",
"@tsconfig/node18": "^18.2.0",
"@types/jsdom": "^21.1.1",
"@types/node": "^20.5.7",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@vue/test-utils": "^2.4.1",
"@vue/tsconfig": "^0.4.0",
"eslint": "^8.46.0",
"eslint-plugin-vue": "^9.16.1",
"husky": "^8.0.3",
"jsdom": "^22.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.0",
"typescript": "~5.1.6",
"unocss": "^0.55.4",
"vite": "^4.4.9",
"vitest": "^0.34.3",
"vue-tsc": "^1.8.8"
},
"lint-staged": {
"*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --cache --fix --ignore-path .gitignore",
"*.src/": "prettier --write"
}
}
Loading

0 comments on commit 2bed338

Please sign in to comment.