Updated project to a simple Vue 3 + Vite project, with Vue i18n, Pinia, Vitest and Playwright
This commit is contained in:
65
README.md
65
README.md
@@ -1,19 +1,46 @@
|
||||
# NATO Glossary, Public Client
|
||||
|
||||
This is the reop for the public client of the NATO Glossary project.
|
||||
This is the reop for the public client of the NATO Glossary project. This README will explain all basic commands for running, developing, testing, and building the app.
|
||||
|
||||
## Stack
|
||||
|
||||
- [Nuxt](https://nuxt.com/docs/getting-started/introduction)
|
||||
- [Vue 3](https://vuejs.org/) + [Vite](https://vite.dev/)
|
||||
- [TypeScript](https://www.typescriptlang.org/)
|
||||
- [Vue I18N](https://vue-i18n.intlify.dev/) for multi-language options
|
||||
- [Pinia](https://pinia.vuejs.org/) for state management
|
||||
- [Vitest](https://vitest.dev/) for unit testing
|
||||
- [Playwright](https://playwright.dev/) for end-to-end (e2e) testing
|
||||
|
||||
## File Structure
|
||||
|
||||
Given the small scope of this project, we're beginning with a [Flat Structure](https://alexop.dev/posts/how-to-structure-vue-projects/#1-flat-structure-perfect-for-small-projects) to organize the files.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
||||
|
||||
## Recommended Browser Setup
|
||||
|
||||
- Chromium-based browsers (Chrome, Edge, Brave, etc.):
|
||||
- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
|
||||
- [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters)
|
||||
- Firefox:
|
||||
- [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
|
||||
- [Turn on Custom Object Formatter in Firefox DevTools](https://fxdx.dev/firefox-devtools-custom-object-formatters/)
|
||||
|
||||
## Type Support for `.vue` Imports in TS
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vite.dev/config/).
|
||||
|
||||
## First-Time Setup
|
||||
|
||||
Install dependencies:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm install
|
||||
```
|
||||
|
||||
@@ -30,10 +57,40 @@ To properly run on and test this application, you'll need the following pieces t
|
||||
Start the development server on `http://localhost:3000`:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
||||
|
||||
```sh
|
||||
npm run test:unit
|
||||
```
|
||||
|
||||
### Run End-to-End Tests with [Playwright](https://playwright.dev)
|
||||
|
||||
```sh
|
||||
# Install browsers for the first run
|
||||
npx playwright install
|
||||
|
||||
# When testing on CI, must build the project first
|
||||
npm run build
|
||||
|
||||
# Runs the end-to-end tests
|
||||
npm run test:e2e
|
||||
# Runs the tests only on Chromium
|
||||
npm run test:e2e -- --project=chromium
|
||||
# Runs the tests of a specific file
|
||||
npm run test:e2e -- tests/example.spec.ts
|
||||
# Runs the tests in debug mode
|
||||
npm run test:e2e -- --debug
|
||||
```
|
||||
|
||||
### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
npm run lint
|
||||
```
|
||||
|
||||
## Production
|
||||
|
||||
Build the application for production:
|
||||
|
||||
Reference in New Issue
Block a user