Skip to content

Commit a4975dc

Browse files
committed
🎉 feat(app): 更新
1 parent 81818a1 commit a4975dc

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@rollup/plugin-typescript": "^11.1.5",
4949
"@types/fs-extra": "^11.0.2",
5050
"@typescript-eslint/eslint-plugin": "^6.7.4",
51-
"code-genius": "^0.4.29",
51+
"code-genius": "^0.4.30",
5252
"eslint-plugin-simple-import-sort": "^10.0.0",
5353
"esno": "^0.17.0",
5454
"release-it": "^16.2.1",

src/index.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import type { CAC } from "cac";
2+
import { execCommand, loggerError, printError, printInfo } from "code-genius";
3+
4+
const npmDepCheck = async () => {
5+
try {
6+
await execCommand("npx", ["depcheck"], {
7+
stdio: "inherit",
8+
});
9+
printInfo("项目依赖检查通过");
10+
} catch (error) {
11+
printError(`项目依赖存在一些问题`);
12+
loggerError(error);
13+
process.exit(1);
14+
}
15+
};
16+
17+
const npmDepCheckInstaller = (cli: CAC) => {
18+
return {
19+
name: "npmDepCheckInstaller",
20+
setup: () => {
21+
cli
22+
.command(
23+
"depcheck",
24+
"运行 depcheck 检查过时的、不正确的和未使用的依赖项",
25+
)
26+
.action(async () => await npmDepCheck());
27+
},
28+
};
29+
};
30+
31+
export { npmDepCheck, npmDepCheckInstaller };

0 commit comments

Comments
 (0)