Skip to content

Commit fd78ffb

Browse files
style: format code with Prettier
This commit fixes the style issues introduced in 278f712 according to the output from Prettier. Details: None
1 parent 278f712 commit fd78ffb

5 files changed

Lines changed: 21 additions & 15 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ src/projects/
165165

166166
### 🆕 如何新增一个新项目(推荐流程)
167167

168-
1) 新建目录:`src/projects/<yourProject>/`
169-
2) 添加入口:`src/projects/<yourProject>/index.tsx`
170-
3) (可选)添加路由覆盖:`src/projects/<yourProject>/routers/index.jsx`
171-
4) 新增 pages/components 业务代码
172-
5) 复制一份脚本(参考 `projectA/projectB`)或直接使用 `cross-env PROJECT=<yourProject> ...` 启动/构建
168+
1. 新建目录:`src/projects/<yourProject>/`
169+
2. 添加入口:`src/projects/<yourProject>/index.tsx`
170+
3. (可选)添加路由覆盖:`src/projects/<yourProject>/routers/index.jsx`
171+
4. 新增 pages/components 业务代码
172+
5. 复制一份脚本(参考 `projectA/projectB`)或直接使用 `cross-env PROJECT=<yourProject> ...` 启动/构建
173173

174174
更多用法详见 [详细文档](./docs/README_PERMISSION.md)[用户角色权限说明](./docs/USER_ROLE_PERMISSION.md)
175175

docs/MULTI_PROJECT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ Webpack 构建产物目录:
7676

7777
## 新增一个项目(例如 projectC)
7878

79-
1) 创建入口文件:`src/projects/projectC/index.tsx`
79+
1. 创建入口文件:`src/projects/projectC/index.tsx`
8080

81-
2) (可选)创建路由目录:`src/projects/projectC/routers/`
81+
2. (可选)创建路由目录:`src/projects/projectC/routers/`
8282

8383
- 如果你想先复用默认路由:
8484
- `routers/index.jsx` 里写:
@@ -87,9 +87,9 @@ Webpack 构建产物目录:
8787
- `routers/authRouter.jsx` 里写:
8888
- `export { default } from '@src/routers/authRouter'`
8989

90-
3) (可选)创建静态资源目录:`src/projects/projectC/public/`
90+
3. (可选)创建静态资源目录:`src/projects/projectC/public/`
9191

92-
4) 增加脚本(两种方式选一种)
92+
4. 增加脚本(两种方式选一种)
9393

9494
- 推荐:直接照着 `projectA`/`projectB` 在根 `package.json` 里添加:
9595
- `cross-env PROJECT=projectC vite --host --config vite.config.ts`

scripts/dist-tools.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ async function main() {
107107
}
108108

109109
if (cmd === 'http') {
110-
const bins = process.platform === 'win32' ? ['http-server.cmd', 'http-server', 'npx.cmd', 'npx'] : ['http-server', 'npx']
110+
const bins =
111+
process.platform === 'win32' ? ['http-server.cmd', 'http-server', 'npx.cmd', 'npx'] : ['http-server', 'npx']
111112

112113
const r = tryRun(bins, (bin) => {
113114
if (bin.startsWith('npx')) {

vite.config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ export default defineConfig(({ mode }) => {
5353
const outDirAbs = path.resolve(__dirname, outDir)
5454
const zipDir = path.resolve(__dirname, 'dist-vite-zip')
5555
await fs.promises.mkdir(zipDir, { recursive: true })
56-
const archivePath = path.join(zipDir, project === 'default' ? 'pro-react-admin.zip' : `pro-react-admin-${project}.zip`)
56+
const archivePath = path.join(
57+
zipDir,
58+
project === 'default' ? 'pro-react-admin.zip' : `pro-react-admin-${project}.zip`
59+
)
5760

5861
const output = fs.createWriteStream(archivePath)
5962
const archive = archiver('zip', { zlib: { level: 9 } })
@@ -157,7 +160,9 @@ export default defineConfig(({ mode }) => {
157160
'@container': path.resolve(__dirname, 'src/components/container'),
158161
'@assets': path.resolve(__dirname, 'src/assets'),
159162
'@pages': path.resolve(__dirname, 'src/pages'),
160-
'@routers': fs.existsSync(resolveProjectDir('routers')) ? resolveProjectDir('routers') : path.resolve(__dirname, 'src/routers'),
163+
'@routers': fs.existsSync(resolveProjectDir('routers'))
164+
? resolveProjectDir('routers')
165+
: path.resolve(__dirname, 'src/routers'),
161166
'@utils': path.resolve(__dirname, 'src/utils'),
162167
'@theme': path.resolve(__dirname, 'src/theme'),
163168
},

webpack/webpack.common.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ const config = {
114114
'@utils': path.resolve('./src/utils'),
115115
'@theme': path.resolve('./src/theme'),
116116
// 确保关键依赖只有一个实例,避免 zustand middleware 错误
117-
'zustand': path.resolve('./node_modules/zustand'),
118-
'immer': path.resolve('./node_modules/immer'),
119-
'react': path.resolve('./node_modules/react'),
117+
zustand: path.resolve('./node_modules/zustand'),
118+
immer: path.resolve('./node_modules/immer'),
119+
react: path.resolve('./node_modules/react'),
120120
'react-dom': path.resolve('./node_modules/react-dom'),
121121
},
122122
symlinks: false,

0 commit comments

Comments
 (0)