gitdog 0.1.2 → 0.2.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 +6 -4
- package/dist/api-catalog.json +3 -3
- package/dist/commands.js +3 -2
- package/dist/projects.d.ts +1 -1
- package/dist/projects.js +11 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
19
|
<p align="center">
|
|
20
|
-
<img src="https://raw.githubusercontent.com/hyodotdev/gitdog-cli/main/.github/assets/terminal.svg?v=0.
|
|
20
|
+
<img src="https://raw.githubusercontent.com/hyodotdev/gitdog-cli/main/.github/assets/terminal.svg?v=0.2.0" alt="Gitdog terminal: connect a project, configure automation and review pending actions" width="800">
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
-
Connect repositories, configure
|
|
24
|
-
AI actions, and
|
|
23
|
+
Connect repositories, configure issue, discussion and PR automation, review
|
|
24
|
+
AI actions, and manage project tasks from your terminal or CI.
|
|
25
25
|
|
|
26
26
|
## Run with npx
|
|
27
27
|
|
|
@@ -39,6 +39,8 @@ npx gitdog@latest github install
|
|
|
39
39
|
npx gitdog@latest github recover
|
|
40
40
|
npx gitdog@latest init owner/repo
|
|
41
41
|
npx gitdog@latest config set requireApproval true
|
|
42
|
+
npx gitdog@latest config set pullRequestReviewsEnabled true
|
|
43
|
+
npx gitdog@latest config set requireApprovalForPullRequests true
|
|
42
44
|
npx gitdog@latest config push
|
|
43
45
|
```
|
|
44
46
|
|
|
@@ -62,7 +64,7 @@ Use `npx gitdog@latest --help` to explore commands. Add `--json` for scripts.
|
|
|
62
64
|
|
|
63
65
|
```sh
|
|
64
66
|
npx gitdog@latest keys create --name ci
|
|
65
|
-
npx --yes gitdog@0.
|
|
67
|
+
npx --yes gitdog@0.2.0 --key-file /path/to/key.json projects list --json
|
|
66
68
|
npx gitdog@latest keys revoke KEY_ID --yes
|
|
67
69
|
```
|
|
68
70
|
|
package/dist/api-catalog.json
CHANGED
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
{
|
|
268
268
|
"path": "repositories/mutation:updateSettings",
|
|
269
269
|
"kind": "mutation",
|
|
270
|
-
"args": "{\n repositoryId: v.id(\"repositories\"),\n settings: v.object({\n issueAssistantEnabled: v.boolean(),\n autoFormatIssue: v.boolean(),\n autoAnswerQuestions: v.boolean(),\n tagMaintainersForCodeChanges: v.boolean(),\n issueResponseStyle: v.optional(v.string()),\n requireApproval: v.boolean(),\n discussionAssistantEnabled: v.boolean(),\n autoFormatDiscussion: v.boolean(),\n autoAnswerDiscussionQuestions: v.boolean(),\n tagMaintainersForDiscussionCodeChanges: v.boolean(),\n discussionResponseStyle: v.optional(v.string()),\n requireApprovalForDiscussions: v.boolean(),\n }),\n }"
|
|
270
|
+
"args": "{\n repositoryId: v.id(\"repositories\"),\n settings: v.object({\n issueAssistantEnabled: v.boolean(),\n autoFormatIssue: v.boolean(),\n autoAnswerQuestions: v.boolean(),\n tagMaintainersForCodeChanges: v.boolean(),\n issueResponseStyle: v.optional(v.string()),\n requireApproval: v.boolean(),\n discussionAssistantEnabled: v.boolean(),\n autoFormatDiscussion: v.boolean(),\n autoAnswerDiscussionQuestions: v.boolean(),\n tagMaintainersForDiscussionCodeChanges: v.boolean(),\n discussionResponseStyle: v.optional(v.string()),\n requireApprovalForDiscussions: v.boolean(),\n pullRequestReviewsEnabled: v.optional(v.boolean()),\n pullRequestSuggestionsEnabled: v.optional(v.boolean()),\n requireApprovalForPullRequests: v.optional(v.boolean()),\n }),\n }"
|
|
271
271
|
},
|
|
272
272
|
{
|
|
273
273
|
"path": "repositories/query:get",
|
|
@@ -387,12 +387,12 @@
|
|
|
387
387
|
{
|
|
388
388
|
"path": "tickets/query:list",
|
|
389
389
|
"kind": "query",
|
|
390
|
-
"args": "{\n githubRepo: v.optional(v.string()),\n status: v.optional(v.union(v.literal(\"open\"), v.literal(\"closed\"))),\n ticketType: v.optional(\n v.union(v.literal(\"issue\")
|
|
390
|
+
"args": "{\n githubRepo: v.optional(v.string()),\n status: v.optional(v.union(v.literal(\"open\"), v.literal(\"closed\"))),\n ticketType: v.optional(\n v.union(\n v.literal(\"issue\"),\n v.literal(\"discussion\"),\n v.literal(\"pull_request\"),\n ),\n ),\n search: v.optional(v.string()),\n limit: v.optional(v.number()),\n offset: v.optional(v.number()),\n }"
|
|
391
391
|
},
|
|
392
392
|
{
|
|
393
393
|
"path": "tickets/query:listPendingApproval",
|
|
394
394
|
"kind": "query",
|
|
395
|
-
"args": "{\n githubRepo: v.optional(v.string()),\n ticketType: v.optional(\n v.union(v.literal(\"issue\")
|
|
395
|
+
"args": "{\n githubRepo: v.optional(v.string()),\n ticketType: v.optional(\n v.union(\n v.literal(\"issue\"),\n v.literal(\"discussion\"),\n v.literal(\"pull_request\"),\n ),\n ),\n search: v.optional(v.string()),\n limit: v.optional(v.number()),\n offset: v.optional(v.number()),\n }"
|
|
396
396
|
},
|
|
397
397
|
{
|
|
398
398
|
"path": "tokenUsage/query:getCurrentMonthUsage",
|
package/dist/commands.js
CHANGED
|
@@ -380,11 +380,11 @@ export function createProgram(dependencies = {}) {
|
|
|
380
380
|
}));
|
|
381
381
|
const tickets = program
|
|
382
382
|
.command("tickets")
|
|
383
|
-
.description("Browse issues, discussions and pending approvals");
|
|
383
|
+
.description("Browse issues, discussions, PR reviews and pending approvals");
|
|
384
384
|
for (const pending of [false, true]) {
|
|
385
385
|
command(tickets, pending ? "pending" : "list", pending
|
|
386
386
|
? "List tickets awaiting approval"
|
|
387
|
-
: "List issues and
|
|
387
|
+
: "List issues, discussions and PR reviews", async ({ api, project, ui }, _args, opts) => {
|
|
388
388
|
const githubRepo = flag(opts.all)
|
|
389
389
|
? undefined
|
|
390
390
|
: (await project.repository()).githubRepo;
|
|
@@ -405,6 +405,7 @@ export function createProgram(dependencies = {}) {
|
|
|
405
405
|
.addOption(new Option("--type <type>", "Ticket type").choices([
|
|
406
406
|
"issue",
|
|
407
407
|
"discussion",
|
|
408
|
+
"pull_request",
|
|
408
409
|
]))
|
|
409
410
|
.option("--search <text>", "Search title, repository or GitHub number")
|
|
410
411
|
.option("--limit <n>", "Page size (1–500)", limitParser, 20)
|
package/dist/projects.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Ui } from "./ui.js";
|
|
2
2
|
import type { Api } from "./client.js";
|
|
3
|
-
export declare const BOOLEAN_SETTINGS: readonly ["issueAssistantEnabled", "autoFormatIssue", "autoAnswerQuestions", "tagMaintainersForCodeChanges", "requireApproval", "discussionAssistantEnabled", "autoFormatDiscussion", "autoAnswerDiscussionQuestions", "tagMaintainersForDiscussionCodeChanges", "requireApprovalForDiscussions"];
|
|
3
|
+
export declare const BOOLEAN_SETTINGS: readonly ["pullRequestReviewsEnabled", "pullRequestSuggestionsEnabled", "requireApprovalForPullRequests", "issueAssistantEnabled", "autoFormatIssue", "autoAnswerQuestions", "tagMaintainersForCodeChanges", "requireApproval", "discussionAssistantEnabled", "autoFormatDiscussion", "autoAnswerDiscussionQuestions", "tagMaintainersForDiscussionCodeChanges", "requireApprovalForDiscussions"];
|
|
4
4
|
export declare const STYLE_SETTINGS: readonly ["issueResponseStyle", "discussionResponseStyle"];
|
|
5
5
|
export type Settings = Record<(typeof BOOLEAN_SETTINGS)[number], boolean> & Partial<Record<(typeof STYLE_SETTINGS)[number], string>>;
|
|
6
6
|
export type Project = {
|
package/dist/projects.js
CHANGED
|
@@ -5,6 +5,9 @@ import { dirname, join, resolve } from "node:path";
|
|
|
5
5
|
import { exists, readJson, writeJson } from "./storage.js";
|
|
6
6
|
import { asRecord, integer } from "./ui.js";
|
|
7
7
|
export const BOOLEAN_SETTINGS = [
|
|
8
|
+
"pullRequestReviewsEnabled",
|
|
9
|
+
"pullRequestSuggestionsEnabled",
|
|
10
|
+
"requireApprovalForPullRequests",
|
|
8
11
|
"issueAssistantEnabled",
|
|
9
12
|
"autoFormatIssue",
|
|
10
13
|
"autoAnswerQuestions",
|
|
@@ -52,8 +55,15 @@ export function validateSettings(value, complete = false) {
|
|
|
52
55
|
settings[key] = item;
|
|
53
56
|
}
|
|
54
57
|
if (complete &&
|
|
55
|
-
BOOLEAN_SETTINGS.
|
|
58
|
+
BOOLEAN_SETTINGS.filter((key) => key !== "pullRequestReviewsEnabled" &&
|
|
59
|
+
key !== "pullRequestSuggestionsEnabled" &&
|
|
60
|
+
key !== "requireApprovalForPullRequests").some((key) => typeof settings[key] !== "boolean"))
|
|
56
61
|
throw new Error("The server returned incomplete project settings. Update Gitdog before applying settings.");
|
|
62
|
+
if (complete) {
|
|
63
|
+
settings.pullRequestReviewsEnabled ??= false;
|
|
64
|
+
settings.pullRequestSuggestionsEnabled ??= true;
|
|
65
|
+
settings.requireApprovalForPullRequests ??= true;
|
|
66
|
+
}
|
|
57
67
|
return settings;
|
|
58
68
|
}
|
|
59
69
|
export function validateProjectConfig(value) {
|
package/dist/ui.d.ts
CHANGED
package/dist/ui.js
CHANGED