Skip to content

Commit 254c388

Browse files
committed
claude初始配置
1 parent fa85db1 commit 254c388

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

jeecgboot-vue3/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33
.github
44
dist
55
.cache
6+
.playwright-mcp
67

78
tests/server/static
89
tests/server/static/upload
@@ -33,4 +34,4 @@ os_del.cmd
3334
/.vscode/
3435
/.history/
3536
/svn clear.bat
36-
.claude
37+
.claude

jeecgboot-vue3/CLAUDE.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
JeecgBoot Vue3 frontend — an enterprise low-code platform built with Vue 3 + Vite 6 + Ant Design Vue 4 + TypeScript. Uses pnpm as package manager. Node 20+ required.
7+
JeecgBoot Vue3 frontend — an enterprise low-code platform built with Vue 3 + Vite 6 + Ant Design Vue 4 + TypeScript. Uses pnpm as package manager. Node 18 or 20+ required (`engines: "^18 || >=20"`).
88

99
## Common Commands
1010

1111
```bash
1212
pnpm dev # Start dev server (port 3100, mock enabled)
1313
pnpm build # Production build (output: dist/)
14+
pnpm build:docker # Docker production build
15+
pnpm build:dockercloud # Docker cloud production build
1416
pnpm build:report # Build with bundle visualizer
1517
pnpm preview # Build + preview
1618

@@ -19,13 +21,13 @@ npx eslint src/path/to/file.vue # Lint specific file
1921
npx stylelint "src/**/*.{vue,less,css}" # Stylelint
2022
pnpm batch:prettier # Format all src files
2123

22-
# Testing
23-
npx jest # Run all tests
24-
npx jest tests/test.spec.ts # Run specific test
25-
# Framework: Jest 29 + ts-jest, config in jest.config.mjs
24+
# Testing (Jest configured but not integrated into npm scripts)
25+
# Tests exist in tests/ directory but no test script in package.json
26+
# Run manually if needed: npx jest
2627

2728
pnpm clean:cache # Clear Vite cache
28-
pnpm gen:icon # Regenerate icon data
29+
pnpm gen:icon # Regenerate icon data
30+
pnpm reinstall # Clean reinstall all dependencies
2931
```
3032

3133
## Path Aliases
@@ -40,7 +42,7 @@ The `/@/` prefix (with leading slash) is the project's conventional alias — pr
4042

4143
### Bootstrap Sequence (src/main.ts)
4244

43-
`createApp` → pinia → i18napp config → registerPackages (@jeecg/online) → registerGlobComp (core Ant Design components) → SSO login → registerSuper (dynamic module discovery) → router setup → guards → directives → error handler → registerThirdComp (vxe-table, emoji, dayjs) → mount
45+
`createApp`createRouter → setupStore (pinia)setupPropsi18n → initAppConfigStore → registerPackages (@jeecg/online) → registerGlobComp (core Ant Design components) → SSO login → registerSuper (dynamic module discovery) → setupRouter → guards → directives → error handler → registerThirdComp (vxe-table, emoji, dayjs) → setupElectron → router.isReady() → mount
4446

4547
### Routing & Permissions
4648

@@ -94,6 +96,20 @@ Three icon approaches:
9496
- `@jeecg/online` and `@jeecg/aiflow` are external monorepo packages excluded from Vite optimizeDeps (CJS compatibility issues)
9597
- Registered via `registerPackages(app)` in main.ts
9698

99+
### Performance Optimization Patterns
100+
101+
**Critical: Use dynamic imports for non-critical modules**
102+
- Static `import` at top of file causes the entire dependency chain to load on initial page
103+
- Use `await import('module')` or `import('path/to/module').then()` for lazy loading
104+
- Key files using dynamic imports:
105+
- `src/settings/registerThirdComp.ts` — vxe-table, emoji picker (loaded after mount)
106+
- `src/views/super/registerSuper.ts` — dynamic module discovery
107+
- Non-critical Ant Design Vue components loaded asynchronously
108+
109+
**Vite optimizeDeps**
110+
- Pre-bundled dependencies in `vite.config.ts` include: dayjs, axios, pinia, nprogress, qs, crypto-js, md5, sortablejs, xe-utils, vue-i18n, lodash-es, xss, mockjs
111+
- External packages (`@jeecg/*`) excluded due to CJS issues
112+
97113
### Micro-Frontend (Qiankun)
98114

99115
- Can run as master (hosting sub-apps) or child (embedded in parent)
@@ -112,6 +128,9 @@ Three icon approaches:
112128
- `.env` — base config (port 3100, app title, SSO/qiankun flags)
113129
- `.env.development` — mock enabled, proxy to `localhost:8080/jeecg-boot`
114130
- `.env.production` — mock disabled, gzip compression
131+
- `.env.docker` — Docker production build config
132+
- `.env.dockercloud` — Docker cloud production build config
133+
- `.env.prod_electron` — Electron production build config
115134
- `VITE_GLOB_*` vars are injected at runtime via `dist/_app.config.js` (changeable post-build)
116135

117136
### Build
@@ -122,8 +141,8 @@ Three icon approaches:
122141

123142
## Code Style
124143

125-
- **Prettier**: 150 char width, single quotes, trailing commas (es5), 2-space indent, `endOfLine: 'auto'`
126-
- **ESLint**: Vue3 recommended + TypeScript recommended + Prettier. `any` is allowed. Unused vars prefixed with `_` are ignored
144+
- **Prettier**: 150 char width, single quotes, trailing commas (es5), 2-space indent, `endOfLine: 'auto'`, `vueIndentScriptAndStyle: true` (indent inside `<script>`/`<style>`), `htmlWhitespaceSensitivity: 'strict'`
145+
- **ESLint**: Vue3 recommended + TypeScript recommended + Prettier. `any` is allowed. Unused vars prefixed with `_` are ignored. Note: `prettier/prettier` rule is `'off'` — Prettier is not enforced via ESLint, run it separately
127146
- **Commits**: Conventional commits enforced via commitlint. Types: feat, fix, perf, style, docs, test, refactor, build, ci, chore, revert, wip, workflow, types, release. Max header: 108 chars
128147
- **i18n**: Chinese (zh-CN) and English supported. Locale files in `src/locales/lang/`
129148

0 commit comments

Comments
 (0)