create-admin-mvp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +175 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +159 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +41 -0
- package/templates/admin-portal/ .stylelintrc.cjs +39 -0
- package/templates/admin-portal/.dockerignore +60 -0
- package/templates/admin-portal/.env +29 -0
- package/templates/admin-portal/.env.development +41 -0
- package/templates/admin-portal/.env.example +4 -0
- package/templates/admin-portal/.env.production +41 -0
- package/templates/admin-portal/.eslintrc.cjs +45 -0
- package/templates/admin-portal/.github/workflows/ci.yml +217 -0
- package/templates/admin-portal/.husky/commit-msg +11 -0
- package/templates/admin-portal/.husky/pre-commit +10 -0
- package/templates/admin-portal/.lintstagedrc.json +13 -0
- package/templates/admin-portal/.prettierrc.cjs +19 -0
- package/templates/admin-portal/.stylelintrc.cjs +35 -0
- package/templates/admin-portal/Dockerfile +35 -0
- package/templates/admin-portal/README.md +196 -0
- package/templates/admin-portal/commitlint.config.cjs +41 -0
- package/templates/admin-portal/docker-compose.yml +35 -0
- package/templates/admin-portal/index.html +13 -0
- package/templates/admin-portal/nginx.conf +45 -0
- package/templates/admin-portal/package-lock.json +10730 -0
- package/templates/admin-portal/package.json +62 -0
- package/templates/admin-portal/playwright-report/index.html +85 -0
- package/templates/admin-portal/playwright.config.ts +73 -0
- package/templates/admin-portal/pnpm-lock.yaml +1620 -0
- package/templates/admin-portal/postcss.config.cjs +56 -0
- package/templates/admin-portal/public/vite.svg +1 -0
- package/templates/admin-portal/src/App.vue +15 -0
- package/templates/admin-portal/src/assets/styles/main.css +36 -0
- package/templates/admin-portal/src/assets/vue.svg +1 -0
- package/templates/admin-portal/src/components/HelloWorld.vue +41 -0
- package/templates/admin-portal/src/layout/index.vue +23 -0
- package/templates/admin-portal/src/main.ts +12 -0
- package/templates/admin-portal/src/mock/auth.ts +26 -0
- package/templates/admin-portal/src/permission.ts +15 -0
- package/templates/admin-portal/src/router/index.ts +21 -0
- package/templates/admin-portal/src/style.css +79 -0
- package/templates/admin-portal/src/views/About.vue +15 -0
- package/templates/admin-portal/src/views/Home.vue +15 -0
- package/templates/admin-portal/src/views/login/index.vue +34 -0
- package/templates/admin-portal/test-results/.last-run.json +23 -0
- package/templates/admin-portal/test-results/results.json +882 -0
- package/templates/admin-portal/tests/e2e/example.spec.ts +52 -0
- package/templates/admin-portal/tests/unit/example.test.ts +49 -0
- package/templates/admin-portal/tsconfig.app.json +18 -0
- package/templates/admin-portal/tsconfig.json +7 -0
- package/templates/admin-portal/tsconfig.node.json +22 -0
- package/templates/admin-portal/vite.config.ts +21 -0
- package/templates/admin-portal/vitest.config.ts +49 -0
- package/templates/admin-portal/vitest.setup.ts +60 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Playwright 配置文件
|
|
2
|
+
// 配置端到端(E2E)测试框架
|
|
3
|
+
|
|
4
|
+
import { defineConfig, devices } from '@playwright/test'
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
// 1. 测试目录
|
|
8
|
+
// 测试文件存放的位置
|
|
9
|
+
testDir: './tests/e2e',
|
|
10
|
+
|
|
11
|
+
// 2. 测试超时时间(毫秒)
|
|
12
|
+
// 单个测试的最长执行时间
|
|
13
|
+
timeout: 30 * 1000, // 30 秒
|
|
14
|
+
|
|
15
|
+
// 3. 失败时重试次数
|
|
16
|
+
// CI 环境重试 2 次,本地不重试
|
|
17
|
+
retries: process.env.CI ? 2 : 0,
|
|
18
|
+
|
|
19
|
+
// 4. 并行执行测试
|
|
20
|
+
// CI 环境串行执行,本地并行执行
|
|
21
|
+
workers: process.env.CI ? 1 : undefined,
|
|
22
|
+
|
|
23
|
+
// 5. 测试报告
|
|
24
|
+
reporter: [
|
|
25
|
+
['html'], // HTML 报告(可视化)
|
|
26
|
+
['json', { outputFile: 'test-results/results.json' }], // JSON 报告(机器可读)
|
|
27
|
+
],
|
|
28
|
+
|
|
29
|
+
// 6. 全局设置
|
|
30
|
+
use: {
|
|
31
|
+
// 6.1 基础 URL
|
|
32
|
+
// 所有测试的默认 URL
|
|
33
|
+
baseURL: 'http://localhost:5173',
|
|
34
|
+
|
|
35
|
+
// 6.2 截图(失败时)
|
|
36
|
+
// 测试失败时自动截图
|
|
37
|
+
screenshot: 'only-on-failure',
|
|
38
|
+
|
|
39
|
+
// 6.3 视频录制(失败时)
|
|
40
|
+
// 测试失败时录制视频
|
|
41
|
+
video: 'retain-on-failure',
|
|
42
|
+
|
|
43
|
+
// 6.4 追踪(失败时)
|
|
44
|
+
// 测试失败时记录追踪信息
|
|
45
|
+
trace: 'on-first-retry',
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
// 7. 测试项目(浏览器)
|
|
49
|
+
// 在多个浏览器中运行测试
|
|
50
|
+
projects: [
|
|
51
|
+
{
|
|
52
|
+
name: 'chromium',
|
|
53
|
+
use: { ...devices['Desktop Chrome'] }, // Chrome 浏览器
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'firefox',
|
|
57
|
+
use: { ...devices['Desktop Firefox'] }, // Firefox 浏览器
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'webkit',
|
|
61
|
+
use: { ...devices['Desktop Safari'] }, // Safari 浏览器
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
|
|
65
|
+
// 8. 开发服务器
|
|
66
|
+
// 自动启动开发服务器
|
|
67
|
+
webServer: {
|
|
68
|
+
command: 'npm run dev', // 启动命令
|
|
69
|
+
url: 'http://localhost:5173', // 服务器 URL
|
|
70
|
+
reuseExistingServer: !process.env.CI, // 复用已有服务器
|
|
71
|
+
timeout: 120 * 1000, // 启动超时时间(120 秒)
|
|
72
|
+
},
|
|
73
|
+
})
|