Skip to content

Commit e5120db

Browse files
committed
feat: 增加 varlet 和 nut 组件库演示应用
1 parent fba7f90 commit e5120db

141 files changed

Lines changed: 6472 additions & 96 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Example Nut
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'apps/examples-nut/**'
8+
- pnpm-lock.yaml
9+
- pnpm-workspace.yaml
10+
workflow_dispatch:
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: 22
24+
25+
- uses: pnpm/action-setup@v4
26+
name: Install pnpm
27+
with:
28+
run_install: false
29+
30+
- name: Get pnpm store directory
31+
shell: bash
32+
run: |
33+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
34+
35+
- uses: actions/cache@v5
36+
name: Setup pnpm cache
37+
with:
38+
path: ${{ env.STORE_PATH }}
39+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
40+
restore-keys: |
41+
${{ runner.os }}-pnpm-store-
42+
43+
- name: Install dependencies
44+
run: pnpm install --frozen-lockfile
45+
46+
- name: Build site
47+
run: pnpm --filter example-nut build
48+
49+
- name: deploy
50+
uses: peaceiris/actions-gh-pages@v4
51+
with:
52+
deploy_key: ${{ secrets.DEPLOY_EXAMPLE_NUT }}
53+
external_repository: fantastic-mobile/nut-example
54+
publish_branch: main
55+
publish_dir: ./apps/example-nut/dist
56+
enable_jekyll: true
57+
force_orphan: true
58+
user_name: 'github-actions[bot]'
59+
user_email: 'github-actions[bot]@users.noreply.github.com'
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Example Varlet
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'apps/examples-varlet/**'
8+
- pnpm-lock.yaml
9+
- pnpm-workspace.yaml
10+
workflow_dispatch:
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: 22
24+
25+
- uses: pnpm/action-setup@v4
26+
name: Install pnpm
27+
with:
28+
run_install: false
29+
30+
- name: Get pnpm store directory
31+
shell: bash
32+
run: |
33+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
34+
35+
- uses: actions/cache@v5
36+
name: Setup pnpm cache
37+
with:
38+
path: ${{ env.STORE_PATH }}
39+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
40+
restore-keys: |
41+
${{ runner.os }}-pnpm-store-
42+
43+
- name: Install dependencies
44+
run: pnpm install --frozen-lockfile
45+
46+
- name: Build site
47+
run: pnpm --filter example-varlet build
48+
49+
- name: deploy
50+
uses: peaceiris/actions-gh-pages@v4
51+
with:
52+
deploy_key: ${{ secrets.DEPLOY_EXAMPLE_VARLET }}
53+
external_repository: fantastic-mobile/varlet-example
54+
publish_branch: main
55+
publish_dir: ./apps/example-varlet/dist
56+
enable_jekyll: true
57+
force_orphan: true
58+
user_name: 'github-actions[bot]'
59+
user_email: 'github-actions[bot]@users.noreply.github.com'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
with:
4343
type: zip
4444
filename: fantastic-mobile-basic.${{ steps.last_release.outputs.tag_name }}.zip
45-
exclusions: '/.git/* /.github/*'
45+
exclusions: '/.git/* /.github/* /apps/example-nut/* /apps/example-varlet/*'
4646

4747
- name: Upload Archive To Release
4848
uses: xresloader/upload-to-github-release@v1

apps/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "@fantastic-mobile/core",
33
"type": "module",
4-
"version": "1.6.0",
54
"private": true,
65
"scripts": {
76
"dev": "vite",

apps/example-nut/.env.development

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 应用配置面板
2+
VITE_APP_SETTING = true
3+
# 页面标题
4+
VITE_APP_TITLE = Fantastic-mobile 基础版
5+
# 接口请求地址,会设置到 axios 的 baseURL 参数上
6+
VITE_APP_API_BASEURL = /
7+
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
8+
VITE_APP_DEBUG_TOOL =
9+
10+
# 是否开启代理
11+
VITE_ENABLE_PROXY = true
12+
# 是否开启开发者工具
13+
VITE_ENABLE_VUE_DEVTOOLS = true

apps/example-nut/.env.production

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 应用配置面板
2+
VITE_APP_SETTING = true
3+
# 页面标题
4+
VITE_APP_TITLE = Fantastic-mobile 基础版
5+
# 接口请求地址,会设置到 axios 的 baseURL 参数上
6+
VITE_APP_API_BASEURL = /
7+
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
8+
VITE_APP_DEBUG_TOOL =
9+
10+
# 是否在打包时启用假数据
11+
VITE_BUILD_FAKE = true
12+
# 是否在打包时生成 sourcemap
13+
VITE_BUILD_SOURCEMAP = false
14+
# 是否在打包时开启压缩,支持 gzip 和 brotli
15+
VITE_BUILD_COMPRESS = gzip,brotli
16+
# 是否在打包后生成存档,支持 zip 和 tar
17+
VITE_BUILD_ARCHIVE =

apps/example-nut/.env.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 应用配置面板
2+
VITE_APP_SETTING = false
3+
# 页面标题
4+
VITE_APP_TITLE = Fantastic-mobile 基础版
5+
# 接口请求地址,会设置到 axios 的 baseURL 参数上
6+
VITE_APP_API_BASEURL = /
7+
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
8+
VITE_APP_DEBUG_TOOL =
9+
10+
# 是否在打包时启用假数据
11+
VITE_BUILD_FAKE = true
12+
# 是否在打包时生成 sourcemap
13+
VITE_BUILD_SOURCEMAP = true
14+
# 是否在打包时开启压缩,支持 gzip 和 brotli
15+
VITE_BUILD_COMPRESS =
16+
# 是否在打包后生成存档,支持 zip 和 tar
17+
VITE_BUILD_ARCHIVE =

apps/example-nut/components.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://shadcn-vue.com/schema.json",
3+
"style": "new-york-v4",
4+
"typescript": true,
5+
"tailwind": {
6+
"config": "tailwind.config.js",
7+
"css": "src/assets/index.css",
8+
"baseColor": "neutral",
9+
"cssVariables": true
10+
},
11+
"aliases": {
12+
"components": "@/ui/shadcn",
13+
"utils": "@/utils",
14+
"lib": "@/utils"
15+
}
16+
}

apps/example-nut/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover"/>
7+
<meta http-equiv="Expires" content="0">
8+
<meta http-equiv="Pragma" content="no-cache">
9+
<meta http-equiv="Cache-control" content="no-cache">
10+
<meta http-equiv="Cache" content="no-cache">
11+
</head>
12+
<body>
13+
<div id="app"></div>
14+
<script type="module" src="/src/main.ts"></script>
15+
</body>
16+
</html>

apps/example-nut/package.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"name": "@fantastic-mobile/example-nut",
3+
"type": "module",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "vue-tsc -b && vite build",
8+
"build:test": "vue-tsc -b && vite build --mode test",
9+
"serve": "http-server ./dist -o",
10+
"serve:test": "http-server ./dist-test -o",
11+
"svgo": "svgo -f src/assets/icons",
12+
"lint": "vue-tsc -b"
13+
},
14+
"dependencies": {
15+
"@fantastic-mobile/components": "workspace:*",
16+
"@fantastic-mobile/settings": "workspace:*",
17+
"@fantastic-mobile/themes": "workspace:*",
18+
"@nutui/nutui": "^4.3.14",
19+
"@nutui/touch-emulator": "^1.0.0",
20+
"@vee-validate/zod": "catalog:",
21+
"@vueuse/components": "catalog:",
22+
"@vueuse/core": "catalog:",
23+
"@vueuse/integrations": "catalog:",
24+
"axios": "catalog:",
25+
"class-variance-authority": "catalog:",
26+
"clsx": "catalog:",
27+
"dayjs": "catalog:",
28+
"defu": "catalog:",
29+
"echarts": "catalog:",
30+
"eruda": "catalog:",
31+
"es-toolkit": "catalog:",
32+
"lucide-vue-next": "catalog:",
33+
"mitt": "catalog:",
34+
"nprogress": "catalog:",
35+
"overlayscrollbars-vue": "catalog:",
36+
"path-browserify": "catalog:",
37+
"pinia": "catalog:",
38+
"pinia-plugin-persistedstate": "catalog:",
39+
"qs": "catalog:",
40+
"reka-ui": "catalog:",
41+
"spinkit": "catalog:",
42+
"tailwind-merge": "catalog:",
43+
"type-fest": "catalog:",
44+
"vconsole": "catalog:",
45+
"vee-validate": "catalog:",
46+
"vue": "catalog:",
47+
"vue-router": "catalog:",
48+
"vue-sonner": "catalog:",
49+
"zod": "catalog:"
50+
},
51+
"devDependencies": {
52+
"@faker-js/faker": "catalog:",
53+
"@iconify/json": "catalog:",
54+
"@iconify/vue": "catalog:",
55+
"@spiriit/vite-plugin-svg-spritemap": "catalog:",
56+
"@types/nprogress": "catalog:",
57+
"@types/qs": "catalog:",
58+
"@vitejs/plugin-legacy": "catalog:",
59+
"@vitejs/plugin-vue": "catalog:",
60+
"@vitejs/plugin-vue-jsx": "catalog:",
61+
"@vue/tsconfig": "catalog:",
62+
"autoprefixer": "catalog:",
63+
"boxen": "catalog:",
64+
"http-server": "catalog:",
65+
"picocolors": "catalog:",
66+
"postcss": "catalog:",
67+
"postcss-mobile-forever": "catalog:",
68+
"postcss-nested": "catalog:",
69+
"sass-embedded": "catalog:",
70+
"svgo": "catalog:",
71+
"unplugin-auto-import": "catalog:",
72+
"unplugin-turbo-console": "catalog:",
73+
"unplugin-vue-components": "catalog:",
74+
"vite": "catalog:",
75+
"vite-plugin-archiver": "catalog:",
76+
"vite-plugin-banner": "catalog:",
77+
"vite-plugin-compression2": "catalog:",
78+
"vite-plugin-env-parse": "catalog:",
79+
"vite-plugin-fake-server": "catalog:",
80+
"vite-plugin-pages": "catalog:",
81+
"vite-plugin-qrcode": "catalog:",
82+
"vite-plugin-vue-devtools": "catalog:",
83+
"vue-tsc": "catalog:"
84+
}
85+
}

0 commit comments

Comments
 (0)