@nazozokc/git-summary 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/index.ts +29 -0
- package/package.json +17 -0
- package/tsconfig.json +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# git-summary
|
|
2
|
+
|
|
3
|
+
To install dependencies:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
bun install
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
To run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun run index.ts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This project was created using `bun init` in bun v1.3.11. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|
package/index.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { consola } from "consola";
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { execa, execaSync } from "execa";
|
|
4
|
+
|
|
5
|
+
const runCLI = () => {
|
|
6
|
+
const program = new Command();
|
|
7
|
+
|
|
8
|
+
program
|
|
9
|
+
.name("git-summary")
|
|
10
|
+
.version("0.1.0")
|
|
11
|
+
.action(() => {
|
|
12
|
+
const branch = execaSync("git", ["branch", "--show-current"]).stdout;
|
|
13
|
+
const Last = execaSync("git", ["log", "-1", "--format=%s"]).stdout;
|
|
14
|
+
const changes = execaSync("git", ["status", "--short"]).stdout;
|
|
15
|
+
|
|
16
|
+
const line = changes.split("\n").filter((n) => n !== "").length;
|
|
17
|
+
// → [" M README.md", " M src/index.ts", "?? dist/"]
|
|
18
|
+
// 行ごとに分割
|
|
19
|
+
|
|
20
|
+
consola.log(`branch: ${branch}`);
|
|
21
|
+
consola.log(`Last: ${Last}`);
|
|
22
|
+
consola.log(`changes: ${line}`);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
program.parse();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
runCLI();
|
|
29
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nazozokc/git-summary",
|
|
3
|
+
"version": "v1.0.0",
|
|
4
|
+
"module": "index.ts",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@types/bun": "latest"
|
|
8
|
+
},
|
|
9
|
+
"peerDependencies": {
|
|
10
|
+
"typescript": "^5"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"commander": "^14.0.3",
|
|
14
|
+
"consola": "^3.4.2",
|
|
15
|
+
"execa": "^9.6.1"
|
|
16
|
+
}
|
|
17
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Environment setup & latest features
|
|
4
|
+
"lib": ["ESNext"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "Preserve",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
|
|
11
|
+
// Bundler mode
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
// Best practices
|
|
18
|
+
"strict": true,
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedIndexedAccess": true,
|
|
22
|
+
"noImplicitOverride": true,
|
|
23
|
+
|
|
24
|
+
// Some stricter flags (disabled by default)
|
|
25
|
+
"noUnusedLocals": false,
|
|
26
|
+
"noUnusedParameters": false,
|
|
27
|
+
"noPropertyAccessFromIndexSignature": false
|
|
28
|
+
}
|
|
29
|
+
}
|