mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2026-02-25 02:20:17 +00:00
🚧 ui: re-scaffolding
- built a new bare vue 3.5 project with vite - partly merged in old configs
This commit is contained in:
parent
8c231b5bf4
commit
022c9138bf
73 changed files with 2517 additions and 8269 deletions
|
|
@ -1,4 +0,0 @@
|
||||||
> 1%
|
|
||||||
last 2 versions
|
|
||||||
not dead
|
|
||||||
not ie 11
|
|
||||||
|
|
@ -1,51 +1,54 @@
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/javascript-node
|
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/javascript-node
|
||||||
{
|
{
|
||||||
"name": "Advent22 UI",
|
"name": "Advent22 UI",
|
||||||
|
|
||||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||||
"image": "mcr.microsoft.com/devcontainers/javascript-node:4-24-trixie",
|
"image": "mcr.microsoft.com/devcontainers/javascript-node:4-24-trixie",
|
||||||
|
|
||||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
"features": {
|
"features": {
|
||||||
"ghcr.io/devcontainers/features/git-lfs:1": {},
|
"ghcr.io/devcontainers/features/git-lfs:1": {},
|
||||||
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
|
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
|
||||||
"plugins": "git-flow npm nvm yarn"
|
"plugins": "git-flow npm nvm yarn"
|
||||||
},
|
|
||||||
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
|
|
||||||
"packages": "git-flow"
|
|
||||||
},
|
|
||||||
"ghcr.io/devcontainers-extra/features/vue-cli:2": {}
|
|
||||||
},
|
},
|
||||||
|
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
|
||||||
// Configure tool-specific properties.
|
"packages": "git-flow"
|
||||||
"customizations": {
|
|
||||||
// Configure properties specific to VS Code.
|
|
||||||
"vscode": {
|
|
||||||
// Set *default* container specific settings.json values on container create.
|
|
||||||
"settings": {
|
|
||||||
"terminal.integrated.defaultProfile.linux": "zsh"
|
|
||||||
},
|
|
||||||
// Add the IDs of extensions you want installed when the container is created.
|
|
||||||
"extensions": [
|
|
||||||
"dbaeumer.vscode-eslint",
|
|
||||||
"esbenp.prettier-vscode",
|
|
||||||
"mhutchie.git-graph",
|
|
||||||
"Syler.sass-indented",
|
|
||||||
"Vue.volar"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
"ghcr.io/devcontainers-extra/features/vue-cli:2": {}
|
||||||
|
},
|
||||||
|
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Configure tool-specific properties.
|
||||||
// "postCreateCommand": "yarn install",
|
"customizations": {
|
||||||
|
// Configure properties specific to VS Code.
|
||||||
|
"vscode": {
|
||||||
|
// Set *default* container specific settings.json values on container create.
|
||||||
|
"settings": {
|
||||||
|
"terminal.integrated.defaultProfile.linux": "zsh"
|
||||||
|
},
|
||||||
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
|
"extensions": [
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"EditorConfig.EditorConfig",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"mhutchie.git-graph",
|
||||||
|
"oxc.oxc-vscode",
|
||||||
|
"Syler.sass-indented",
|
||||||
|
"vitest.explorer",
|
||||||
|
"Vue.volar"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Use 'postStartCommand' to run commands after the container is started.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
"postStartCommand": "yarn dlx update-browserslist-db@latest && yarn install"
|
// "postCreateCommand": "yarn install",
|
||||||
|
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'postStartCommand' to run commands after the container is started.
|
||||||
// "forwardPorts": [],
|
"postStartCommand": "yarn dlx update-browserslist-db@latest && yarn install"
|
||||||
|
|
||||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
// "remoteUser": "root"
|
// "forwardPorts": [],
|
||||||
|
|
||||||
|
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
|
// "remoteUser": "root"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
8
ui/.editorconfig
Normal file
8
ui/.editorconfig
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]
|
||||||
|
charset = utf-8
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
end_of_line = lf
|
||||||
|
max_line_length = 100
|
||||||
1
ui/.gitattributes
vendored
Normal file
1
ui/.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
* text=auto eol=lf
|
||||||
15
ui/.gitignore
vendored
15
ui/.gitignore
vendored
|
|
@ -1,4 +1,19 @@
|
||||||
|
# from newly scaffolded vite project
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
dist-ssr
|
||||||
|
coverage
|
||||||
|
*.local
|
||||||
|
|
||||||
|
# Cypress
|
||||||
|
/cypress/videos/
|
||||||
|
/cypress/screenshots/
|
||||||
|
|
||||||
|
# Vitest
|
||||||
|
__screenshots__/
|
||||||
|
|
||||||
|
# Vite
|
||||||
|
*.timestamp-*-*.mjs
|
||||||
|
|
||||||
# https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Node.gitignore
|
# https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Node.gitignore
|
||||||
|
|
||||||
|
|
|
||||||
10
ui/.oxlintrc.json
Normal file
10
ui/.oxlintrc.json
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["eslint", "typescript", "unicorn", "oxc", "vue", "vitest"],
|
||||||
|
"env": {
|
||||||
|
"browser": true
|
||||||
|
},
|
||||||
|
"categories": {
|
||||||
|
"correctness": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
ui/.prettierrc.json
Normal file
6
ui/.prettierrc.json
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/prettierrc",
|
||||||
|
"semi": false,
|
||||||
|
"singleQuote": true,
|
||||||
|
"printWidth": 100
|
||||||
|
}
|
||||||
11
ui/.vscode/extensions.json
vendored
11
ui/.vscode/extensions.json
vendored
|
|
@ -1,3 +1,12 @@
|
||||||
{
|
{
|
||||||
"recommendations": ["sdras.vue-vscode-snippets"]
|
"recommendations": [
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"EditorConfig.EditorConfig",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"mhutchie.git-graph",
|
||||||
|
"oxc.oxc-vscode",
|
||||||
|
"Syler.sass-indented",
|
||||||
|
"vitest.explorer",
|
||||||
|
"Vue.volar"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
ui/.vscode/settings.json
vendored
10
ui/.vscode/settings.json
vendored
|
|
@ -8,6 +8,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll": "explicit",
|
||||||
"source.organizeImports": "explicit"
|
"source.organizeImports": "explicit"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -15,9 +16,16 @@
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.tabSize": 2,
|
"editor.tabSize": 2,
|
||||||
|
|
||||||
|
"explorer.fileNesting.enabled": true,
|
||||||
|
"explorer.fileNesting.patterns": {
|
||||||
|
"tsconfig.json": "tsconfig.*.json, env.d.ts, typed-router.d.ts",
|
||||||
|
"vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*",
|
||||||
|
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .oxlint*, oxlint*, .oxfmt*, .prettier*, prettier*, .editorconfig"
|
||||||
|
},
|
||||||
|
|
||||||
"sass.disableAutoIndent": true,
|
"sass.disableAutoIndent": true,
|
||||||
"sass.format.convert": false,
|
"sass.format.convert": false,
|
||||||
"sass.format.deleteWhitespace": true,
|
"sass.format.deleteWhitespace": true,
|
||||||
|
|
||||||
"prettier.trailingComma": "all",
|
"prettier.trailingComma": "all"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
51
ui/README.md
51
ui/README.md
|
|
@ -1,29 +1,54 @@
|
||||||
# advent22_ui
|
# advent22_ui
|
||||||
|
|
||||||
## Project setup
|
This template should help get you started developing with Vue 3 in Vite.
|
||||||
|
|
||||||
```
|
## Recommended IDE Setup
|
||||||
yarn install
|
|
||||||
|
[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 [Volar](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/).
|
||||||
|
|
||||||
|
## Project Setup
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yarn
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compiles and hot-reloads for development
|
### Compile and Hot-Reload for Development
|
||||||
|
|
||||||
```
|
```sh
|
||||||
yarn serve
|
yarn dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compiles and minifies for production
|
### Type-Check, Compile and Minify for Production
|
||||||
|
|
||||||
```
|
```sh
|
||||||
yarn build
|
yarn build
|
||||||
```
|
```
|
||||||
|
|
||||||
### Lints and fixes files
|
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yarn test:unit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Lint with [ESLint](https://eslint.org/)
|
||||||
|
|
||||||
|
```sh
|
||||||
yarn lint
|
yarn lint
|
||||||
```
|
```
|
||||||
|
|
||||||
### Customize configuration
|
|
||||||
|
|
||||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
||||||
|
|
|
||||||
47
ui/_legacy/package.json
Normal file
47
ui/_legacy/package.json
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
"name": "advent22_ui",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"packageManager": "yarn@4.12.0",
|
||||||
|
"scripts": {
|
||||||
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build",
|
||||||
|
"test:unit": "vue-cli-service test:unit",
|
||||||
|
"test:unit-watch": "vue-cli-service test:unit --watch",
|
||||||
|
"lint": "vue-cli-service lint",
|
||||||
|
"ui": "vue ui --host 0.0.0.0 --headless"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
||||||
|
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
||||||
|
"@fortawesome/vue-fontawesome": "^3.1.3",
|
||||||
|
"@types/chai": "^5.2.3",
|
||||||
|
"@types/luxon": "^3.7.1",
|
||||||
|
"@types/mocha": "^10.0.10",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
||||||
|
"@typescript-eslint/parser": "^8.55.0",
|
||||||
|
"@vue/cli-plugin-babel": "^5.0.9",
|
||||||
|
"@vue/cli-plugin-eslint": "^5.0.9",
|
||||||
|
"@vue/cli-plugin-typescript": "^5.0.9",
|
||||||
|
"@vue/cli-plugin-unit-mocha": "^5.0.9",
|
||||||
|
"@vue/cli-service": "^5.0.9",
|
||||||
|
"@vue/eslint-config-typescript": "^13.0.0",
|
||||||
|
"@vue/test-utils": "^2.4.6",
|
||||||
|
"@vue/tsconfig": "^0.8.1",
|
||||||
|
"animate.css": "^4.1.1",
|
||||||
|
"axios": "^1.13.5",
|
||||||
|
"bulma": "^1.0.4",
|
||||||
|
"bulma-toast": "2.4.3",
|
||||||
|
"chai": "^6.2.2",
|
||||||
|
"core-js": "^3.48.0",
|
||||||
|
"eslint": "^8.57.1",
|
||||||
|
"eslint-plugin-vue": "^9.33.0",
|
||||||
|
"luxon": "^3.7.2",
|
||||||
|
"pinia": "^3.0.4",
|
||||||
|
"sass": "~1.94.3",
|
||||||
|
"sass-loader": "^16.0.0",
|
||||||
|
"typescript": "^5.9.3",
|
||||||
|
"vue": "^3.5.25",
|
||||||
|
"vue-cli-plugin-webpack-bundle-analyzer": "^4.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
ui/_legacy/public/favicon.ico
Normal file
BIN
ui/_legacy/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
67
ui/_legacy/src/App.vue
Normal file
67
ui/_legacy/src/App.vue
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
<template>
|
||||||
|
<section class="hero is-small is-primary">
|
||||||
|
<div class="hero-body">
|
||||||
|
<h1 class="title is-uppercase">{{ store.site_config.title }}</h1>
|
||||||
|
<h2 class="subtitle">{{ store.site_config.subtitle }}</h2>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section px-3">
|
||||||
|
<progress
|
||||||
|
v-if="store.background_image === 'loading'"
|
||||||
|
class="progress is-primary"
|
||||||
|
max="100"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
v-else-if="store.background_image === 'error'"
|
||||||
|
class="notification is-danger"
|
||||||
|
>
|
||||||
|
Hintergrundbild konnte nicht geladen werden
|
||||||
|
</div>
|
||||||
|
<div v-else class="container">
|
||||||
|
<AdminView v-if="store.is_admin" />
|
||||||
|
<UserView v-else />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="is-flex-grow-1" />
|
||||||
|
|
||||||
|
<footer class="footer">
|
||||||
|
<div class="level">
|
||||||
|
<div class="level-item">
|
||||||
|
<p v-html="store.site_config.footer" />
|
||||||
|
</div>
|
||||||
|
<div class="level-right">
|
||||||
|
<div class="level-item">
|
||||||
|
<TouchButton class="is-small is-warning" />
|
||||||
|
</div>
|
||||||
|
<div class="level-item">
|
||||||
|
<AdminButton class="is-small is-link is-outlined" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { advent22Store } from "./lib/store";
|
||||||
|
|
||||||
|
import AdminView from "./components/admin/AdminView.vue";
|
||||||
|
import AdminButton from "./components/AdminButton.vue";
|
||||||
|
import TouchButton from "./components/TouchButton.vue";
|
||||||
|
import UserView from "./components/UserView.vue";
|
||||||
|
|
||||||
|
const store = advent22Store();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
overflow-y: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
BIN
ui/_legacy/src/assets/logo.png
(Stored with Git LFS)
Normal file
BIN
ui/_legacy/src/assets/logo.png
(Stored with Git LFS)
Normal file
Binary file not shown.
27
ui/_legacy/src/main.ts
Normal file
27
ui/_legacy/src/main.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
import FontAwesomeIcon from "@/lib/fontawesome";
|
||||||
|
import { advent22Store } from "@/lib/store";
|
||||||
|
import { setDefaults as toast_set_defaults } from "bulma-toast";
|
||||||
|
import { createPinia } from "pinia";
|
||||||
|
import { createApp } from "vue";
|
||||||
|
import App from "./App.vue";
|
||||||
|
|
||||||
|
import "@/main.scss";
|
||||||
|
|
||||||
|
const app = createApp(App);
|
||||||
|
|
||||||
|
app.use(createPinia());
|
||||||
|
app.component("FontAwesomeIcon", FontAwesomeIcon);
|
||||||
|
|
||||||
|
advent22Store().init();
|
||||||
|
|
||||||
|
app.mount("#app");
|
||||||
|
|
||||||
|
toast_set_defaults({
|
||||||
|
duration: 10e3,
|
||||||
|
pauseOnHover: true,
|
||||||
|
dismissible: true,
|
||||||
|
closeOnClick: false,
|
||||||
|
type: "is-white",
|
||||||
|
position: "top-center",
|
||||||
|
animate: { in: "backInDown", out: "backOutUp" },
|
||||||
|
});
|
||||||
33
ui/_legacy/tsconfig.json
Normal file
33
ui/_legacy/tsconfig.json
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"lib": [
|
||||||
|
"es2020",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"es2022.object",
|
||||||
|
"es2023.array",
|
||||||
|
],
|
||||||
|
// "moduleResolution": "node",
|
||||||
|
// "sourceMap": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"types": [
|
||||||
|
"webpack-env",
|
||||||
|
"mocha",
|
||||||
|
"chai",
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*.vue",
|
||||||
|
"src/**/*.ts",
|
||||||
|
// "src/**/*.tsx",
|
||||||
|
"tests/**/*.ts",
|
||||||
|
// "tests/**/*.tsx",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"presets": [
|
|
||||||
"@vue/cli-plugin-babel/preset"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
1
ui/env.d.ts
vendored
Normal file
1
ui/env.d.ts
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
/// <reference types="vite/client" />
|
||||||
32
ui/eslint.config.ts
Normal file
32
ui/eslint.config.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
import { globalIgnores } from 'eslint/config'
|
||||||
|
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
||||||
|
import pluginVue from 'eslint-plugin-vue'
|
||||||
|
import pluginVitest from '@vitest/eslint-plugin'
|
||||||
|
import pluginOxlint from 'eslint-plugin-oxlint'
|
||||||
|
import skipFormatting from 'eslint-config-prettier/flat'
|
||||||
|
|
||||||
|
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
||||||
|
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
||||||
|
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
||||||
|
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
|
||||||
|
|
||||||
|
export default defineConfigWithVueTs(
|
||||||
|
{
|
||||||
|
name: 'app/files-to-lint',
|
||||||
|
files: ['**/*.{vue,ts,mts,tsx}'],
|
||||||
|
},
|
||||||
|
|
||||||
|
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
|
||||||
|
|
||||||
|
...pluginVue.configs['flat/essential'],
|
||||||
|
vueTsConfigs.recommended,
|
||||||
|
|
||||||
|
{
|
||||||
|
...pluginVitest.configs.recommended,
|
||||||
|
files: ['src/**/__tests__/*'],
|
||||||
|
},
|
||||||
|
|
||||||
|
...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'),
|
||||||
|
|
||||||
|
skipFormatting,
|
||||||
|
)
|
||||||
13
ui/index.html
Normal file
13
ui/index.html
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<link rel="icon" href="/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Vite App</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script type="module" src="/src/main.ts"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -1,47 +1,50 @@
|
||||||
{
|
{
|
||||||
"name": "advent22_ui",
|
"name": "advent22_ui",
|
||||||
"version": "0.1.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
"packageManager": "yarn@4.12.0",
|
"packageManager": "yarn@4.12.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"dev": "vite",
|
||||||
"build": "vue-cli-service build",
|
"build": "run-p type-check \"build-only {@}\" --",
|
||||||
"test:unit": "vue-cli-service test:unit",
|
"preview": "vite preview",
|
||||||
"test:unit-watch": "vue-cli-service test:unit --watch",
|
"test:unit": "vitest",
|
||||||
"lint": "vue-cli-service lint",
|
"build-only": "vite build",
|
||||||
"ui": "vue ui --host 0.0.0.0 --headless"
|
"type-check": "vue-tsc --build",
|
||||||
|
"lint": "run-s lint:*",
|
||||||
|
"lint:oxlint": "oxlint . --fix",
|
||||||
|
"lint:eslint": "eslint . --fix --cache",
|
||||||
|
"format": "prettier --write --experimental-cli src/"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"pinia": "^3.0.4",
|
||||||
|
"vue": "^3.5.28"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
"@tsconfig/node24": "^24.0.4",
|
||||||
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
"@types/jsdom": "^27.0.0",
|
||||||
"@fortawesome/vue-fontawesome": "^3.1.3",
|
"@types/node": "^25.3.0",
|
||||||
"@types/chai": "^5.2.3",
|
"@vitejs/plugin-vue": "^6.0.4",
|
||||||
"@types/luxon": "^3.7.1",
|
"@vitest/eslint-plugin": "^1.6.9",
|
||||||
"@types/mocha": "^10.0.10",
|
"@vue/eslint-config-typescript": "^14.6.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
||||||
"@typescript-eslint/parser": "^8.55.0",
|
|
||||||
"@vue/cli-plugin-babel": "^5.0.9",
|
|
||||||
"@vue/cli-plugin-eslint": "^5.0.9",
|
|
||||||
"@vue/cli-plugin-typescript": "^5.0.9",
|
|
||||||
"@vue/cli-plugin-unit-mocha": "^5.0.9",
|
|
||||||
"@vue/cli-service": "^5.0.9",
|
|
||||||
"@vue/eslint-config-typescript": "^13.0.0",
|
|
||||||
"@vue/test-utils": "^2.4.6",
|
"@vue/test-utils": "^2.4.6",
|
||||||
"@vue/tsconfig": "^0.8.1",
|
"@vue/tsconfig": "^0.8.1",
|
||||||
"animate.css": "^4.1.1",
|
"eslint": "^9.39.2",
|
||||||
"axios": "^1.13.5",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"bulma": "^1.0.4",
|
"eslint-plugin-oxlint": "~1.46.0",
|
||||||
"bulma-toast": "2.4.3",
|
"eslint-plugin-vue": "~10.8.0",
|
||||||
"chai": "^6.2.2",
|
"jiti": "^2.6.1",
|
||||||
"core-js": "^3.48.0",
|
"jsdom": "^28.1.0",
|
||||||
"eslint": "^8.57.1",
|
"npm-run-all2": "^8.0.4",
|
||||||
"eslint-plugin-vue": "^9.33.0",
|
"oxlint": "~1.47.0",
|
||||||
"luxon": "^3.7.2",
|
"prettier": "3.8.1",
|
||||||
"pinia": "^3.0.4",
|
"typescript": "~5.9.3",
|
||||||
"sass": "~1.94.3",
|
"vite": "^7.3.1",
|
||||||
"sass-loader": "^16.0.0",
|
"vite-plugin-vue-devtools": "^8.0.6",
|
||||||
"typescript": "^5.9.3",
|
"vitest": "^4.0.18",
|
||||||
"vue": "^3.5.25",
|
"vue-tsc": "^3.2.4"
|
||||||
"vue-cli-plugin-webpack-bundle-analyzer": "^4.0.0"
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^20.19.0 || >=22.12.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 4.2 KiB |
|
|
@ -1,67 +1,11 @@
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section class="hero is-small is-primary">
|
<h1>You did it!</h1>
|
||||||
<div class="hero-body">
|
<p>
|
||||||
<h1 class="title is-uppercase">{{ store.site_config.title }}</h1>
|
Visit <a href="https://vuejs.org/" target="_blank" rel="noopener">vuejs.org</a> to read the
|
||||||
<h2 class="subtitle">{{ store.site_config.subtitle }}</h2>
|
documentation
|
||||||
</div>
|
</p>
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section px-3">
|
|
||||||
<progress
|
|
||||||
v-if="store.background_image === 'loading'"
|
|
||||||
class="progress is-primary"
|
|
||||||
max="100"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
v-else-if="store.background_image === 'error'"
|
|
||||||
class="notification is-danger"
|
|
||||||
>
|
|
||||||
Hintergrundbild konnte nicht geladen werden
|
|
||||||
</div>
|
|
||||||
<div v-else class="container">
|
|
||||||
<AdminView v-if="store.is_admin" />
|
|
||||||
<UserView v-else />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<div class="is-flex-grow-1" />
|
|
||||||
|
|
||||||
<footer class="footer">
|
|
||||||
<div class="level">
|
|
||||||
<div class="level-item">
|
|
||||||
<p v-html="store.site_config.footer" />
|
|
||||||
</div>
|
|
||||||
<div class="level-right">
|
|
||||||
<div class="level-item">
|
|
||||||
<TouchButton class="is-small is-warning" />
|
|
||||||
</div>
|
|
||||||
<div class="level-item">
|
|
||||||
<AdminButton class="is-small is-link is-outlined" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<style scoped></style>
|
||||||
import { advent22Store } from "./lib/store";
|
|
||||||
|
|
||||||
import AdminView from "./components/admin/AdminView.vue";
|
|
||||||
import AdminButton from "./components/AdminButton.vue";
|
|
||||||
import TouchButton from "./components/TouchButton.vue";
|
|
||||||
import UserView from "./components/UserView.vue";
|
|
||||||
|
|
||||||
const store = advent22Store();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
html {
|
|
||||||
overflow-y: auto !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#app {
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
||||||
11
ui/src/__tests__/App.spec.ts
Normal file
11
ui/src/__tests__/App.spec.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { describe, it, expect } from 'vitest'
|
||||||
|
|
||||||
|
import { mount } from '@vue/test-utils'
|
||||||
|
import App from '../App.vue'
|
||||||
|
|
||||||
|
describe('App', () => {
|
||||||
|
it('mounts renders properly', () => {
|
||||||
|
const wrapper = mount(App)
|
||||||
|
expect(wrapper.text()).toContain('You did it!')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
@ -1,27 +1,9 @@
|
||||||
import FontAwesomeIcon from "@/lib/fontawesome";
|
import { createApp } from 'vue'
|
||||||
import { advent22Store } from "@/lib/store";
|
import { createPinia } from 'pinia'
|
||||||
import { setDefaults as toast_set_defaults } from "bulma-toast";
|
import App from './App.vue'
|
||||||
import { createPinia } from "pinia";
|
|
||||||
import { createApp } from "vue";
|
|
||||||
import App from "./App.vue";
|
|
||||||
|
|
||||||
import "@/main.scss";
|
const app = createApp(App)
|
||||||
|
|
||||||
const app = createApp(App);
|
app.use(createPinia())
|
||||||
|
|
||||||
app.use(createPinia());
|
app.mount('#app')
|
||||||
app.component("FontAwesomeIcon", FontAwesomeIcon);
|
|
||||||
|
|
||||||
advent22Store().init();
|
|
||||||
|
|
||||||
app.mount("#app");
|
|
||||||
|
|
||||||
toast_set_defaults({
|
|
||||||
duration: 10e3,
|
|
||||||
pauseOnHover: true,
|
|
||||||
dismissible: true,
|
|
||||||
closeOnClick: false,
|
|
||||||
type: "is-white",
|
|
||||||
position: "top-center",
|
|
||||||
animate: { in: "backInDown", out: "backOutUp" },
|
|
||||||
});
|
|
||||||
|
|
|
||||||
12
ui/src/stores/counter.ts
Normal file
12
ui/src/stores/counter.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
|
export const useCounterStore = defineStore('counter', () => {
|
||||||
|
const count = ref(0)
|
||||||
|
const doubleCount = computed(() => count.value * 2)
|
||||||
|
function increment() {
|
||||||
|
count.value++
|
||||||
|
}
|
||||||
|
|
||||||
|
return { count, doubleCount, increment }
|
||||||
|
})
|
||||||
12
ui/tsconfig.app.json
Normal file
12
ui/tsconfig.app.json
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||||
|
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
||||||
|
"exclude": ["src/**/__tests__/*"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
|
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,33 +1,14 @@
|
||||||
{
|
{
|
||||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
"files": [],
|
||||||
"compilerOptions": {
|
"references": [
|
||||||
"experimentalDecorators": true,
|
{
|
||||||
"lib": [
|
"path": "./tsconfig.node.json"
|
||||||
"es2020",
|
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"es2022.object",
|
|
||||||
"es2023.array",
|
|
||||||
],
|
|
||||||
// "moduleResolution": "node",
|
|
||||||
// "sourceMap": true,
|
|
||||||
"baseUrl": ".",
|
|
||||||
"types": [
|
|
||||||
"webpack-env",
|
|
||||||
"mocha",
|
|
||||||
"chai",
|
|
||||||
],
|
|
||||||
"paths": {
|
|
||||||
"@/*": [
|
|
||||||
"src/*",
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
"include": [
|
"path": "./tsconfig.app.json"
|
||||||
"src/**/*.vue",
|
},
|
||||||
"src/**/*.ts",
|
{
|
||||||
// "src/**/*.tsx",
|
"path": "./tsconfig.vitest.json"
|
||||||
"tests/**/*.ts",
|
}
|
||||||
// "tests/**/*.tsx",
|
]
|
||||||
],
|
|
||||||
}
|
}
|
||||||
19
ui/tsconfig.node.json
Normal file
19
ui/tsconfig.node.json
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"extends": "@tsconfig/node24/tsconfig.json",
|
||||||
|
"include": [
|
||||||
|
"vite.config.*",
|
||||||
|
"vitest.config.*",
|
||||||
|
"cypress.config.*",
|
||||||
|
"nightwatch.conf.*",
|
||||||
|
"playwright.config.*",
|
||||||
|
"eslint.config.*"
|
||||||
|
],
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true,
|
||||||
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||||
|
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "Bundler",
|
||||||
|
"types": ["node"]
|
||||||
|
}
|
||||||
|
}
|
||||||
11
ui/tsconfig.vitest.json
Normal file
11
ui/tsconfig.vitest.json
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.app.json",
|
||||||
|
"include": ["src/**/__tests__/*", "env.d.ts"],
|
||||||
|
"exclude": [],
|
||||||
|
"compilerOptions": {
|
||||||
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
|
||||||
|
|
||||||
|
"lib": [],
|
||||||
|
"types": ["node", "jsdom"]
|
||||||
|
}
|
||||||
|
}
|
||||||
18
ui/vite.config.ts
Normal file
18
ui/vite.config.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||||
|
|
||||||
|
// https://vite.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
vue(),
|
||||||
|
vueDevTools(),
|
||||||
|
],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
14
ui/vitest.config.ts
Normal file
14
ui/vitest.config.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
|
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
|
||||||
|
import viteConfig from './vite.config'
|
||||||
|
|
||||||
|
export default mergeConfig(
|
||||||
|
viteConfig,
|
||||||
|
defineConfig({
|
||||||
|
test: {
|
||||||
|
environment: 'jsdom',
|
||||||
|
exclude: [...configDefaults.exclude, 'e2e/**'],
|
||||||
|
root: fileURLToPath(new URL('./', import.meta.url)),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
||||||
const { defineConfig } = require("@vue/cli-service");
|
|
||||||
const webpack = require("webpack");
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
|
||||||
transpileDependencies: true,
|
|
||||||
devServer: {
|
|
||||||
host: "127.0.0.1",
|
|
||||||
},
|
|
||||||
pages: {
|
|
||||||
index: {
|
|
||||||
entry: "src/main.ts",
|
|
||||||
title: "Kalender-Gewinnspiel",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// https://stackoverflow.com/a/77765007
|
|
||||||
configureWebpack: {
|
|
||||||
plugins: [
|
|
||||||
new webpack.DefinePlugin({
|
|
||||||
// Vue CLI is in maintenance mode, and probably won't merge my PR to fix this in their tooling
|
|
||||||
// https://github.com/vuejs/vue-cli/pull/7443
|
|
||||||
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false",
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
});
|
|
||||||
10018
ui/yarn.lock
10018
ui/yarn.lock
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue