Skip to content

Commit a26970d

Browse files
Modernize Vue app tooling
1 parent d56921b commit a26970d

24 files changed

Lines changed: 2841 additions & 12795 deletions

.github/workflows/node.js.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,14 @@ jobs:
3333
- name: Install dependencies
3434
run: yarn install --immutable
3535

36-
- name: Cache Cypress binary
37-
uses: actions/cache@v4
38-
with:
39-
path: ~/.cache/Cypress
40-
key: cypress-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
41-
restore-keys: |
42-
cypress-${{ runner.os }}-
36+
- name: Lint
37+
run: yarn lint
4338

44-
- name: Run tests (yarn test:headless)
45-
uses: cypress-io/github-action@v6
46-
with:
47-
install: false
48-
command: yarn test:headless
39+
- name: Type check
40+
run: yarn typecheck
41+
42+
- name: Test
43+
run: yarn test
44+
45+
- name: Build
46+
run: yarn build

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
node_modules
33
/dist
44
ts/
5-
videos/
5+
coverage/
66

77
# local env files
88
.env.local

.yarn/install-state.gz

-994 KB
Binary file not shown.

README.md

Lines changed: 73 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,102 @@
11
# Base Vue Project
22

3-
A Vue 3 + TypeScript starter using Vue CLI (serve/build), Vite (Cypress Component Testing), Yarn 4, ESLint (Airbnb + Vue), and Sass.
3+
A Vue 3 + TypeScript starter using Vite, Vitest, Yarn 4, ESLint, and Sass.
44

55
## Requirements
6+
67
- Node 22+
7-
- Yarn 4 (via Corepack)
8+
- Yarn 4 via Corepack
89

910
```bash
1011
corepack enable
11-
node -v # should be 22.x
12-
yarn -v # Yarn 4.x
12+
node -v
13+
yarn -v
1314
```
1415

1516
## Quickstart
17+
1618
```bash
1719
yarn install --immutable
18-
yarn serve
20+
yarn dev
1921
```
20-
- Dev server: http://localhost:8080
22+
23+
The dev server runs at the URL printed by Vite, usually http://localhost:5173.
2124

2225
## Scripts
23-
- `yarn serve`: start the Vue CLI dev server
24-
- `yarn build`: production build to `dist/`
26+
27+
- `yarn dev`: start the Vite dev server
28+
- `yarn serve`: alias for `yarn dev`
29+
- `yarn build`: type-check and create a production build in `dist/`
30+
- `yarn preview`: preview the production build locally
2531
- `yarn lint`: run ESLint checks
26-
- `yarn test`: lint then open Cypress Component Test Runner (defaults to Firefox)
27-
- `yarn test:chrome`: lint then open Cypress in Chrome
28-
- `yarn test:headless`: lint then run headless component tests (used in CI)
29-
30-
## Testing (Cypress Component)
31-
- Bundler: Vite; Framework: Vue (`cypress.config.ts`)
32-
- Spec pattern: `src/**/*.spec.{ts,tsx,js,jsx}`
33-
- Example: `src/tests/Foo.spec.ts`
34-
- Open runner:
35-
```bash
36-
yarn test # Firefox
37-
yarn test:chrome # Chrome
38-
```
39-
- Headless (CI-equivalent):
40-
```bash
41-
yarn test:headless
42-
```
43-
44-
## Linting
45-
- Config: Flat ESLint with `plugin:vue/recommended` + `airbnb-base` and TypeScript rules.
46-
- Run:
47-
```bash
48-
yarn lint
49-
# optional:
50-
yarn eslint . --fix
51-
```
52-
- Tip: Install the “ESLint” editor extension for inline feedback.
32+
- `yarn typecheck`: run Vue-aware TypeScript checks
33+
- `yarn test`: run Vitest once
34+
- `yarn test:watch`: run Vitest in watch mode
35+
36+
## Testing
37+
38+
Vitest runs component tests in a jsdom environment. Component tests use Vue Test Utils.
39+
40+
```bash
41+
yarn test
42+
```
43+
44+
The example component test lives at `src/tests/Foo.spec.ts`.
45+
46+
## Linting And Type Checking
47+
48+
The project uses ESLint flat config with Vue and TypeScript parsing.
49+
50+
```bash
51+
yarn lint
52+
yarn typecheck
53+
```
5354

5455
## CI
55-
- GitHub Actions run on pushes/PRs to `main`, using Node 22 + Yarn 4 via Corepack and `yarn test:headless`.
56-
- Workflow file: `.github/workflows/node.js.yml`
5756

58-
## Tech stack
57+
GitHub Actions run on pushes and pull requests to `main` using Node 22 and Yarn 4:
58+
59+
```bash
60+
yarn install --immutable
61+
yarn lint
62+
yarn typecheck
63+
yarn test
64+
yarn build
65+
```
66+
67+
Workflow file: `.github/workflows/node.js.yml`.
68+
69+
## Tech Stack
70+
5971
- Vue 3, TypeScript
60-
- Vue Router, Vuex
61-
- Build/serve: Vue CLI
62-
- Component tests: Cypress (+ Vite bundler)
63-
- Styling: Sass
72+
- Vite
73+
- Vitest, Vue Test Utils, jsdom
74+
- Vue Router and Vuex are installed as starter dependencies
75+
- Sass
6476

65-
## Project structure
77+
## Project Structure
6678

67-
```
79+
```text
6880
base-vue/
69-
├── babel.config.js # Babel configuration
70-
├── vue.config.js # Vue CLI configuration
71-
├── vite.config.ts # Vite configuration for Cypress
72-
├── cypress.config.ts # Cypress configuration
73-
├── eslint.config.cjs # ESLint configuration
81+
├── index.html
82+
├── vite.config.ts
83+
├── eslint.config.cjs
84+
├── tsconfig.json
7485
├── public/
75-
│ ├── index.html # HTML template
76-
│ └── favicon.ico # Site favicon
86+
│ └── favicon.ico
7787
├── src/
78-
│ ├── main.ts # Vue app entry point
79-
│ ├── App.vue # Root Vue component
80-
│ ├── App.scss # Global styles
88+
│ ├── main.ts
89+
│ ├── App.vue
90+
│ ├── App.scss
91+
│ ├── vite-env.d.ts
8192
│ ├── assets/
82-
│ │ └── logo.png # Static assets
93+
│ │ └── logo.png
8394
│ ├── components/
84-
│ │ ├── Foo.vue # Example component
85-
│ │ └── Foo.scss # Component styles
95+
│ │ ├── Foo.vue
96+
│ │ └── Foo.scss
8697
│ └── tests/
87-
│ └── Foo.spec.ts # Component tests
88-
├── cypress/
89-
│ ├── fixtures/ # Test data
90-
│ ├── plugins/ # Cypress plugins
91-
│ ├── support/ # Support files
92-
│ ├── downloads/ # Downloaded files during tests
93-
│ └── screenshots/ # Test screenshots
94-
├── .github/
95-
│ └── workflows/
96-
│ └── node.js.yml # CI/CD workflow
97-
```
98+
│ └── Foo.spec.ts
99+
└── .github/
100+
└── workflows/
101+
└── node.js.yml
102+
```

babel.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

cypress.config.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

cypress/fixtures/example.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

cypress/plugins/index.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

cypress/support/commands.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

cypress/support/commands.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)