Skip to content

Commit 5676479

Browse files
committed
feat: add doctor command and checkPhantomDeps
1 parent 24b5aaf commit 5676479

22 files changed

+776
-182
lines changed

.changeset/large-clocks-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@umijs/tnf': patch
3+
---
4+
5+
feat: add doctor command and checkPhantomDeps

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Tnf, ~~the north face~~, the next framework. Tnf is focused on simple, performan
2020
- [Framework unified plugin system](./docs/plugin.md) which is compatible with umi and other frameworks.
2121
- Mock.
2222
- Conventional client entry with `src/client.tsx`.
23+
- Doctor to check potential issues.
2324
- [ ] Security built-in. Including doctor rules which is used in Ant Group.
2425
- Support SSR.
2526
- [ ] Support API routes and server functions.
@@ -56,6 +57,7 @@ $ pnpm preview
5657
- `tnf build`: Build the project.
5758
- `tnf config list/get/set/remove [name] [value]`: Manage the config.
5859
- `tnf dev`: Start the development server.
60+
- `tnf doctor`: Check the project for potential issues.
5961
- `tnf generate/g <type> <name>`: Generate a new page (or component and other types in the future).
6062
- `tnf preview`: Preview the product after building the project.
6163
- `tnf sync --mode=<mode>`: Sync the project to the temporary directory.
@@ -110,6 +112,13 @@ Click the component to open in the editor.
110112

111113
The development server configuration.
112114

115+
### doctor
116+
117+
- Type: `{ phantomDeps?: { exclude?: string[] } }`
118+
- Default: `{}`
119+
120+
The doctor configuration.
121+
113122
### externals
114123

115124
- Type: `Record<string, string>`

examples/normal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"preview": "tnf preview"
88
},
99
"dependencies": {
10-
"@types/react": "^18.3.12",
11-
"@types/react-dom": "^18.3.1",
10+
"@types/react": "^19.0.0",
11+
"@types/react-dom": "^19.0.0",
1212
"@umijs/tnf": "workspace:*"
1313
},
1414
"devDependencies": {

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
"connect-history-api-fallback": "^2.0.0",
6767
"cors": "^2.8.5",
6868
"defu": "^6.1.4",
69+
"enhanced-resolve": "^5.17.1",
70+
"es-module-lexer": "^1.5.4",
71+
"esbuild": "^0.24.0",
6972
"express": "^4.21.2",
7073
"express-http-proxy": "^2.1.1",
7174
"fs-extra": "^11.1.0",

0 commit comments

Comments
 (0)