Skip to content

Commit 592bd61

Browse files
committed
🎉 feat(app): 更新
1 parent 14ada14 commit 592bd61

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@types/fs-extra": "^11.0.2",
5050
"@typescript-eslint/eslint-plugin": "^6.7.4",
5151
"code-genius": "^0.4.29",
52+
"eslint-plugin-simple-import-sort": "^10.0.0",
5253
"esno": "^0.17.0",
5354
"release-it": "^16.2.1",
5455
"rollup": "^4.0.2",
@@ -57,6 +58,6 @@
5758
"simple-git-hooks": "^2.9.0"
5859
},
5960
"simple-git-hooks": {
60-
"pre-commit": "codeg fix -p src"
61+
"pre-commit": "codeg format && codeg impsort -p src"
6162
}
6263
}

rollup.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default defineConfig({
3131
"ajv",
3232
"enquirer",
3333
"fs-extra",
34+
"eslint-plugin-simple-import-sort",
3435
"code-genius",
3536
],
3637
});

src/common.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import Ajv from "ajv";
2-
import type { CAC } from "cac";
32

43
export interface ClearOptions {
5-
cli: CAC,
64
files: Array<string>;
75
}
86

9-
export const clearGlob = ["./src"];
7+
export const clearGlob = ["./dist"];
108

119
export const schema = {
1210
type: "object",

src/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import path from "node:path";
22
import { performance } from "node:perf_hooks";
33

4+
import type { CAC } from "cac";
5+
import { ACTIVATION, execCommand, loggerInfo, printInfo } from "code-genius";
46
import enquirer from "enquirer";
57
import fs from "fs-extra";
68

7-
import { ACTIVATION, execCommand, loggerInfo, printInfo } from "code-genius";
8-
import { ClearOptions, clearGlob, schema, validateArgs } from "./common";
9+
import { clearGlob, ClearOptions, schema, validateArgs } from "./common";
910

1011
const generateEnquirer = async (
11-
paths: Array<string>
12+
paths: Array<string>,
1213
): Promise<Array<string>> => {
1314
const files = fs
1415
.readdirSync(path.join(process.cwd(), "."))
@@ -53,10 +54,10 @@ const clear = async (paths: string[]) => {
5354
};
5455

5556
const clearInstaller = (config: ClearOptions) => {
56-
const { cli, files } = config;
57+
const { files } = config;
5758
return {
5859
name: "clearInstaller",
59-
setup: () => {
60+
setup: (cli: CAC) => {
6061
cli
6162
.command("clear", "运行 rimraf 删除不再需要的文件或文件夹")
6263
.option("-p, --pattern <pattern>", "设置匹配规则")

0 commit comments

Comments
 (0)