Skip to content

Commit

Permalink
首次提交
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Jun 12, 2024
0 parents commit 26424db
Show file tree
Hide file tree
Showing 124 changed files with 17,867 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
13 changes: 13 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 应用配置面板
VITE_APP_SETTING = true
# 页面标题
VITE_APP_TITLE = Fantastic-mobile 基础版
# 接口请求地址,会设置到 axios 的 baseURL 参数上
VITE_APP_API_BASEURL = /
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =

# 是否开启代理
VITE_OPEN_PROXY = true
# 是否开启开发者工具
VITE_OPEN_DEVTOOLS = true
17 changes: 17 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 应用配置面板
VITE_APP_SETTING = true
# 页面标题
VITE_APP_TITLE = Fantastic-mobile 基础版
# 接口请求地址,会设置到 axios 的 baseURL 参数上
VITE_APP_API_BASEURL = /
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VITE_APP_DEBUG_TOOL =

# 是否在打包时启用 Mock
VITE_BUILD_MOCK = true
# 是否在打包时生成 sourcemap
VITE_BUILD_SOURCEMAP = false
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip,brotli
# 是否在打包后生成存档,支持 zip 和 tar
VITE_BUILD_ARCHIVE =
92 changes: 92 additions & 0 deletions .github/workflows/deploy-example-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: deploy-example-site

on:
push:
branches: [example]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
# 选择要使用的 node 版本
node-version: 20
# registry-url: https://registry.npmmirror.com/

- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install antfu/ni
run: npm i -g @antfu/ni

- name: Install dependencies
run: ni --frozen

# 运行构建脚本
- name: Build
env:
NODE_OPTIONS: --max-old-space-size=8192
run: nr build:example

- name: deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.PUSH_TO_ANOTHER_REPO_SSH_DEPLOY_KEY }}
external_repository: fantastic-mobile/basic-example
publish_branch: main
publish_dir: ./dist-example
enable_jekyll: true
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'

# sync:
# runs-on: ubuntu-latest
# needs: deploy
# steps:
# - name: Sync to Gitee
# uses: wearerequired/git-mirror-action@master
# env:
# # 注意在 Settings->Secrets 配置 GITEE_RSA_PRIVATE_KEY
# SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
# with:
# # 注意替换为你的 GitHub 源仓库地址
# source-repo: [email protected]:fantastic-admin/pro-example.git
# # 注意替换为你的 Gitee 目标仓库地址
# destination-repo: [email protected]:fantastic-admin/pro-example.git

# - name: Build Gitee Pages
# uses: yanglbme/gitee-pages-action@main
# with:
# # 注意替换为你的 Gitee 用户名
# gitee-username: hooray
# # 注意在 Settings->Secrets 配置 GITEE_PASSWORD
# gitee-password: ${{ secrets.GITEE_PASSWORD }}
# # 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错
# gitee-repo: fantastic-admin/pro-example
# # 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在)
# branch: main
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.DS_Store
dist*
dist-ssr
*.local
.eslintcache
.stylelintcache
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{ts,tsx,vue}": "eslint --cache --fix",
"*.{css,scss,vue}": "stylelint --cache --fix"
}
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shamefully-hoist=true
strict-peer-dependencies=false
engine-strict=true
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"EditorConfig.EditorConfig",
"mikestead.dotenv",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"Vue.volar",
"antfu.unocss"
]
}
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.autoImportFileExcludePatterns": ["vue-router$"],
"eslint.experimental.useFlatConfig": true,
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit",
"source.organizeImports": "never"
},
"stylelint.validate": [
"css",
"scss",
"vue"
],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import antfu from '@antfu/eslint-config'

export default antfu(
{
unocss: true,
ignores: [
'public',
'dist*',
],
},
{
rules: {
'eslint-comments/no-unlimited-disable': 'off',
'curly': ['error', 'all'],
'antfu/consistent-list-newline': 'off',
},
},
{
files: [
'src/**/*.vue',
],
rules: {
'vue/block-order': ['error', {
order: ['script', 'template', 'style'],
}],
},
},
)
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"/>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
102 changes: 102 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"type": "module",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"scripts": {
"dev": "vite",
"build:example": "vue-tsc && vite build --mode example",
"serve:example": "http-server ./dist-example -o",
"svgo": "svgo -f src/assets/icons",
"new": "plop",
"lint": "npm-run-all -s lint:tsc lint:eslint lint:stylelint",
"lint:tsc": "vue-tsc --noEmit",
"lint:eslint": "eslint . --cache --fix",
"lint:stylelint": "stylelint \"src/**/*.{css,scss,vue}\" --cache --fix",
"postinstall": "simple-git-hooks",
"preinstall": "npx only-allow pnpm"
},
"dependencies": {
"@headlessui/vue": "^1.7.22",
"@vant/touch-emulator": "^1.4.0",
"@visactor/vchart": "^1.11.3",
"@vueuse/core": "^10.10.1",
"@vueuse/integrations": "^10.10.1",
"animate.css": "^4.1.1",
"axios": "^1.7.2",
"dayjs": "^1.11.11",
"echarts": "^5.5.0",
"eruda": "^3.0.1",
"lodash-es": "^4.17.21",
"mitt": "^3.0.1",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"overlayscrollbars-vue": "^0.5.9",
"path-browserify": "^1.0.1",
"pinia": "^2.1.7",
"qrcode": "^1.5.3",
"qs": "^6.12.1",
"swiper": "^11.1.4",
"vant": "^4.9.1",
"vconsole": "^3.15.1",
"vue": "^3.4.27",
"vue-esign": "^1.1.4",
"vue-m-message": "^4.0.2",
"vue-router": "^4.3.3"
},
"devDependencies": {
"@antfu/eslint-config": "^2.21.1",
"@iconify/json": "^2.2.218",
"@iconify/vue": "^4.1.2",
"@stylistic/stylelint-config": "^1.0.1",
"@types/archiver": "^6.0.2",
"@types/lodash-es": "^4.17.12",
"@types/mockjs": "^1.0.10",
"@types/nprogress": "^0.2.3",
"@types/path-browserify": "^1.0.2",
"@types/qrcode": "^1.5.5",
"@types/qs": "^6.9.15",
"@unocss/eslint-plugin": "^0.61.0",
"@unocss/preset-rem-to-px": "^0.61.0",
"@vitejs/plugin-vue": "^5.0.5",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"@yeungkc/unocss-preset-safe-area": "^0.0.6",
"archiver": "^7.0.1",
"autoprefixer": "^10.4.19",
"boxen": "^7.1.1",
"eslint": "^9.4.0",
"http-server": "^14.1.1",
"lint-staged": "^15.2.6",
"npm-run-all2": "^6.2.0",
"picocolors": "^1.0.1",
"plop": "^4.0.1",
"postcss": "^8.4.38",
"postcss-mobile-forever": "^4.1.4",
"sass": "^1.77.5",
"simple-git-hooks": "^2.11.1",
"stylelint": "^16.6.1",
"stylelint-config-recess-order": "^5.0.1",
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-config-standard-vue": "^1.0.0",
"stylelint-scss": "^6.3.1",
"svgo": "^3.3.2",
"typescript": "^5.4.5",
"unocss": "^0.61.0",
"unplugin-auto-import": "^0.17.6",
"unplugin-turbo-console": "^1.8.6",
"unplugin-vue-components": "^0.27.0",
"unplugin-vue-router": "^0.9.1",
"vite": "^5.2.13",
"vite-plugin-banner": "^0.7.1",
"vite-plugin-compression2": "^1.1.1",
"vite-plugin-fake-server": "^2.1.1",
"vite-plugin-pages": "^0.32.2",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-vue-devtools": "^7.2.1",
"vue-tsc": "^2.0.21"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged",
"preserveUnused": true
}
}
17 changes: 17 additions & 0 deletions plop-templates/component/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script setup lang="ts">
{{#if isGlobal}}
defineOptions({
name: '{{ properCase name }}',
})
{{/if}}
</script>

<template>
<div>
<!-- 布局 -->
</div>
</template>

<style lang="scss" scoped>
// 样式
</style>
Loading

0 comments on commit 26424db

Please sign in to comment.