Skip to content

Commit

Permalink
chore(app): cleanup project (#1)
Browse files Browse the repository at this point in the history
* rm unoCSS

* add type-check on pre-commit

* rm eslintcache

* add env to gitignore

* cleanup project

* add CI workflows
  • Loading branch information
plecrx authored Jan 10, 2024
1 parent 2bed338 commit 456952b
Show file tree
Hide file tree
Showing 23 changed files with 4,344 additions and 4,385 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and Deploy on Netlify

on:
push:
branches:
- main
permissions:
id-token: write
contents: read

concurrency:
group: dev_environment
cancel-in-progress: true

jobs:
unit-test:
runs-on: ubuntu-latest
name: Pass unit tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Run unit tests
run: yarn test -- run
25 changes: 25 additions & 0 deletions .github/workflows/validate-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Pull requests validation

on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- 'main'

jobs:
unit-test:
runs-on: ubuntu-latest
name: Pass unit tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Run unit tests
run: yarn test -- run
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ dist
dist-ssr
coverage
*.local
.env

.eslintcache

/cypress/videos/
/cypress/screenshots/
Expand Down
4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npx lint-staged
npx lint-staged
yarn type-check & npx lint-staged
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"tabWidth": 4,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
Expand Down
43 changes: 2 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# 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.
A rapid development starter kit using Vite, Vue3, TypeScript, Vitest, ESLint, Prettier, and Husky.

### Features

Expand All @@ -23,24 +13,9 @@ and follow the prompts.
- ✅ 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
Expand All @@ -53,18 +28,4 @@ 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.
```
```
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"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",
"description": "A starter template for Vue3 with Vite and TypeScript includes Vitest, Eslint, Prettier, and Husky",
"type": "module",
"license": "MIT",
"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",
"type-check": "vue-tsc --noEmit -p tsconfig.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",
Expand Down
Loading

0 comments on commit 456952b

Please sign in to comment.