mirror of
https://github.com/Kugelschieber/migo.git
synced 2026-01-18 06:40:29 +00:00
Basic Vue setup.
This commit is contained in:
48
cmd/admin/.eslintrc.cjs
Normal file
48
cmd/admin/.eslintrc.cjs
Normal file
@@ -0,0 +1,48 @@
|
||||
/* eslint-env node */
|
||||
require('@rushstack/eslint-patch/modern-module-resolution')
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
node: true
|
||||
},
|
||||
'extends': [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/eslint-config-typescript'
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 2021
|
||||
},
|
||||
rules: {
|
||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||
"vue/multi-word-component-names": "off",
|
||||
"indent": "off",
|
||||
"vue/html-indent": ["warn", 4, {
|
||||
"alignAttributesVertically": false
|
||||
}],
|
||||
"vue/script-indent": ["warn", 4, {
|
||||
"baseIndent": 1,
|
||||
"switchCase": 1
|
||||
}],
|
||||
"vue/mustache-interpolation-spacing": ["error", "never"],
|
||||
"vue/v-on-style": ["error", "longform"],
|
||||
"vue/max-attributes-per-line": ["warn", {
|
||||
singleline: {
|
||||
max: 99
|
||||
}
|
||||
}],
|
||||
"vue/singleline-html-element-content-newline": "off",
|
||||
"vue/attributes-order": "off",
|
||||
"vue/first-attribute-linebreak": "off",
|
||||
"vue/attribute-hyphenation": "off",
|
||||
"vue/html-closing-bracket-newline": "off",
|
||||
"vue/v-slot-style": "off",
|
||||
"vue/no-v-html": "off",
|
||||
"vue/html-self-closing": "off",
|
||||
"vue/require-default-prop": "off"
|
||||
}
|
||||
}
|
||||
28
cmd/admin/.gitignore
vendored
Normal file
28
cmd/admin/.gitignore
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
1
cmd/admin/env.d.ts
vendored
Normal file
1
cmd/admin/env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
@@ -1 +1,13 @@
|
||||
<h1>Admin</h1>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Migo Admin</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
4012
cmd/admin/package-lock.json
generated
Normal file
4012
cmd/admin/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
33
cmd/admin/package.json
Normal file
33
cmd/admin/package.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "migo",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite build --watch",
|
||||
"build": "run-p type-check build-only",
|
||||
"preview": "vite preview",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
||||
},
|
||||
"dependencies": {
|
||||
"pinia": "^2.1.3",
|
||||
"sass": "^1.63.6",
|
||||
"vue": "^3.3.4",
|
||||
"vue-router": "^4.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.2.0",
|
||||
"@tsconfig/node18": "^2.0.1",
|
||||
"@types/node": "^18.16.17",
|
||||
"@vitejs/plugin-vue": "^4.2.3",
|
||||
"@vue/eslint-config-typescript": "^11.0.3",
|
||||
"@vue/tsconfig": "^0.4.0",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-plugin-vue": "^9.11.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"typescript": "~5.0.4",
|
||||
"vite": "^4.3.9",
|
||||
"vue-tsc": "^1.6.5"
|
||||
}
|
||||
}
|
||||
BIN
cmd/admin/public/favicon.ico
Normal file
BIN
cmd/admin/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
13
cmd/admin/src/App.vue
Normal file
13
cmd/admin/src/App.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<router-view />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {defineComponent} from "vue";
|
||||
|
||||
export default defineComponent({});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/assets/main.scss";
|
||||
</style>
|
||||
4
cmd/admin/src/assets/main.scss
Normal file
4
cmd/admin/src/assets/main.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
9
cmd/admin/src/main.ts
Normal file
9
cmd/admin/src/main.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { createApp } from "vue";
|
||||
import { createPinia } from "pinia";
|
||||
import App from "./App.vue";
|
||||
import router from "./router";
|
||||
|
||||
createApp(App)
|
||||
.use(createPinia())
|
||||
.use(router)
|
||||
.mount("#app");
|
||||
15
cmd/admin/src/router/index.ts
Normal file
15
cmd/admin/src/router/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import {createRouter, createWebHistory} from "vue-router";
|
||||
import SignIn from "../views/SignIn.vue";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: "/login",
|
||||
name: "login",
|
||||
component: SignIn
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
export default router;
|
||||
5
cmd/admin/src/stores/counter.ts
Normal file
5
cmd/admin/src/stores/counter.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import {defineStore} from "pinia";
|
||||
|
||||
export const useCounterStore = defineStore("counter", () => {
|
||||
return {}
|
||||
})
|
||||
9
cmd/admin/src/views/SignIn.vue
Normal file
9
cmd/admin/src/views/SignIn.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<h1>Sign In</h1>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {defineComponent} from "vue";
|
||||
|
||||
export default defineComponent({});
|
||||
</script>
|
||||
12
cmd/admin/tsconfig.app.json
Normal file
12
cmd/admin/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": {
|
||||
"composite": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
11
cmd/admin/tsconfig.json
Normal file
11
cmd/admin/tsconfig.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.node.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
15
cmd/admin/tsconfig.node.json
Normal file
15
cmd/admin/tsconfig.node.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "@tsconfig/node18/tsconfig.json",
|
||||
"include": [
|
||||
"vite.config.*",
|
||||
"vitest.config.*",
|
||||
"cypress.config.*",
|
||||
"nightwatch.conf.*",
|
||||
"playwright.config.*"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "ESNext",
|
||||
"types": ["node"]
|
||||
}
|
||||
}
|
||||
20
cmd/admin/vite.config.ts
Normal file
20
cmd/admin/vite.config.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
},
|
||||
base: "/admin",
|
||||
define: {
|
||||
__VITE_PROD_DEVTOOLS__: false
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user