Skip to content

Commit

Permalink
feat: app
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Mar 25, 2022
1 parent 8beb2b0 commit 8d83c96
Show file tree
Hide file tree
Showing 9 changed files with 1,445 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/fetch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Fetch
on:
workflow_dispatch:
schedule:
- cron: '10 18 * * *'
- cron: '10 18 * * *'

jobs:
fetch:
Expand All @@ -28,4 +28,3 @@ jobs:
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit -m "Update"
git push
29 changes: 29 additions & 0 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Github Pages

on:
push:

jobs:
build:
runs-on: ubuntu-latest
needs: fetch
steps:
- name: Set Timezone
run: sudo timedatectl set-timezone "Asia/Shanghai"
- uses: actions/checkout@v2
- name: Setup pnpm
uses: pnpm/[email protected]
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: pnpm
- name: Install
run: pnpm install
- name: Build
run: pnpm build
- name: Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
18 changes: 18 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="zh">

<head>
<meta charset="UTF-8" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#ffffff">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<title>Miki Captain</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
5 changes: 5 additions & 0 deletions app/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script setup lang="ts"></script>

<template>
<h1>Miki's Captain</h1>
</template>
7 changes: 7 additions & 0 deletions app/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createApp } from "vue";

import "uno.css";

import App from "./App.vue";

createApp(App).mount("#app");
27 changes: 27 additions & 0 deletions app/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import path from "path";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

import Unocss from "unocss/vite";
import {
presetUno,
presetAttributify,
transformerDirectives,
transformerVariantGroup,
} from "unocss";
import Icons from "unplugin-icons/vite";

export default defineConfig({
plugins: [
vue(),
Icons(),
Unocss({
presets: [presetUno(), presetAttributify()],
transformers: [transformerDirectives(), transformerVariantGroup()],
}),
],
build: {
outDir: path.join(__dirname, "../dist"),
},
});
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"private": true,
"scripts": {
"build": "vite build app",
"dev": "vite app",
"format": "prettier --write app/**/*.{ts,vue}",
"preview": "vite preview app"
},
"dependencies": {
"date-fns": "^2.28.0",
"vue": "^3.2.31",
"vue-router": "4"
},
"devDependencies": {
"@iconify/json": "^1.1.450",
"@types/node": "^17.0.22",
"@vitejs/plugin-vue": "^2.2.4",
"pinia": "^2.0.11",
"pnpm": "^6.32.3",
"prettier": "^2.6.0",
"typescript": "^4.6.2",
"unocss": "^0.26.3",
"unplugin-icons": "^0.13.0",
"vite": "^2.8.6",
"vitest": "^0.7.9"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 8d83c96

Please sign in to comment.