Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(app): cleanup project #1

Merged
merged 6 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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