Compare commits
12 Commits
b080146017
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2279108f31 | |||
| bdd3c8755b | |||
| 335a81bf9d | |||
| 926a4c7a66 | |||
| 789c90ed63 | |||
| 0a5fbc92c7 | |||
| 92f6da672b | |||
| a2cd25bf5f | |||
| 65473a085a | |||
| 10c846486e | |||
| e74f56c4aa | |||
| e955d9b94d |
BIN
.github/Board.png
vendored
Normal file
BIN
.github/Board.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
38
.github/workflows/main.yml
vendored
Normal file
38
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: Deploy to GitHub Pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"] # Replace with your default branch if different
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: oven-sh/setup-bun@v2
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: bun run build --base=/dwa/
|
||||||
|
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
with:
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# The Docker image that will be used to build your app
|
|
||||||
image: node:lts
|
|
||||||
# Functions that should be executed before the build script is run
|
|
||||||
before_script:
|
|
||||||
- npm install
|
|
||||||
pages:
|
|
||||||
script:
|
|
||||||
- npx vite build
|
|
||||||
- rm -rf public
|
|
||||||
- mv dist public
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
# The folder that contains the files to be exposed at the Page URL
|
|
||||||
- public
|
|
||||||
rules:
|
|
||||||
# This ensures that only pushes to the default branch will trigger
|
|
||||||
# a pages deploy
|
|
||||||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
|
||||||
42
README.md
42
README.md
@@ -1,18 +1,38 @@
|
|||||||
# Vue 3 + TypeScript + Vite
|
# DWA
|
||||||
|
|
||||||
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|

|
||||||
|
|
||||||
## Recommended IDE Setup
|
This is a motivational app, where you can track how long you went without accident. You can reset your progress when you have an accident.
|
||||||
|
|
||||||
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
## Installation
|
||||||
|
|
||||||
## Type Support For `.vue` Imports in TS
|
You can just visit [https://quirinecker.github.io/dwa/](https://quirinecker.github.io/dwa/) and install the PWA on your device via chrome(android)/safari(ios).
|
||||||
|
|
||||||
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 [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
## Development
|
||||||
|
|
||||||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
The project is a Vue3/bun/vite project, so the instructions are relatively straight forward.
|
||||||
|
|
||||||
|
### Install dependencies
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Run the development server
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build the application
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun run build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Run the tests
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun run test
|
||||||
|
```
|
||||||
|
|
||||||
1. Disable the built-in TypeScript Extension
|
|
||||||
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
|
||||||
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
|
||||||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
|
||||||
|
|||||||
89
package.json
89
package.json
@@ -1,47 +1,46 @@
|
|||||||
{
|
{
|
||||||
"name": "dwa",
|
"name": "dwa",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build:app": "vue-tsc && vite build",
|
"build": "vite build",
|
||||||
"build": "pnpm build:app && pnpm build:sw",
|
"preview": "vite preview",
|
||||||
"preview": "vite preview",
|
"build:sw": "workbox generateSW workbox-config.js"
|
||||||
"build:sw": "workbox generateSW workbox-config.js"
|
},
|
||||||
},
|
"dependencies": {
|
||||||
"dependencies": {
|
"@faker-js/faker": "^8.4.1",
|
||||||
"@faker-js/faker": "^8.4.1",
|
"@vee-validate/zod": "^4.12.5",
|
||||||
"@vee-validate/zod": "^4.12.5",
|
"@vue/test-utils": "^2.4.4",
|
||||||
"@vue/test-utils": "^2.4.4",
|
"@vueuse/core": "^10.9.0",
|
||||||
"@vueuse/core": "^10.9.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"class-variance-authority": "^0.7.0",
|
"clsx": "^2.1.0",
|
||||||
"clsx": "^2.1.0",
|
"lucide-vue-next": "^0.344.0",
|
||||||
"lucide-vue-next": "^0.344.0",
|
"moment": "^2.30.1",
|
||||||
"moment": "^2.30.1",
|
"radix-vue": "^1.4.9",
|
||||||
"radix-vue": "^1.4.9",
|
"tailwind-merge": "^2.2.1",
|
||||||
"tailwind-merge": "^2.2.1",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"vaul-vue": "^0.1.0",
|
||||||
"vaul-vue": "^0.1.0",
|
"vee-validate": "^4.12.5",
|
||||||
"vee-validate": "^4.12.5",
|
"vue": "^3.4.19",
|
||||||
"vue": "^3.4.19",
|
"vue-router": "^4.3.0",
|
||||||
"vue-router": "^4.3.0",
|
"vue-sonner": "^1.1.2",
|
||||||
"vue-sonner": "^1.1.2",
|
"zod": "^3.22.4"
|
||||||
"zod": "^3.22.4"
|
},
|
||||||
},
|
"devDependencies": {
|
||||||
"devDependencies": {
|
"@types/node": "^20.11.24",
|
||||||
"@types/node": "^20.11.24",
|
"@vitejs/plugin-vue": "^5.0.4",
|
||||||
"@vitejs/plugin-vue": "^5.0.4",
|
"@vitest/coverage-istanbul": "^1.3.1",
|
||||||
"@vitest/coverage-istanbul": "^1.3.1",
|
"@vitest/ui": "^1.3.1",
|
||||||
"@vitest/ui": "^1.3.1",
|
"autoprefixer": "^10.4.18",
|
||||||
"autoprefixer": "^10.4.18",
|
"jsdom": "^24.0.0",
|
||||||
"jsdom": "^24.0.0",
|
"shadcn-vue": "^0.9.0",
|
||||||
"shadcn-vue": "^0.9.0",
|
"tailwindcss": "^3.4.1",
|
||||||
"tailwindcss": "^3.4.1",
|
"typescript": "^5.2.2",
|
||||||
"typescript": "^5.2.2",
|
"vite": "^5.1.4",
|
||||||
"vite": "^5.1.4",
|
"vite-plugin-pwa": "^0.19.0",
|
||||||
"vite-plugin-pwa": "^0.19.0",
|
"vitest": "^1.3.1",
|
||||||
"vitest": "^1.3.1",
|
"vue-tsc": "^1.8.27"
|
||||||
"vue-tsc": "^1.8.27"
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
5598
pnpm-lock.yaml
generated
5598
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
10
src/main.ts
10
src/main.ts
@@ -8,11 +8,11 @@ import Detail from '@/pages/Detail.vue'
|
|||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
routes: [
|
routes: [
|
||||||
{ path: '/', component: Home},
|
{ path: '/', component: Home },
|
||||||
{ path: '/:name', component: Detail, props: true}
|
{ path: '/:name', component: Detail, props: true }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
|
|||||||
Reference in New Issue
Block a user