ya-git-jira 1.3.0 → 1.5.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/bin/git-bump.ts +7 -4
- package/bin/{git-jira-issues.ts → git-jira-issue-list.ts} +10 -7
- package/bin/git-jira-issue-show.ts +40 -0
- package/bin/git-jira-issue.ts +14 -25
- package/bin/git-jira-start.ts +8 -5
- package/bin/git-jira.ts +9 -6
- package/bin/git-lab-group-list.ts +35 -0
- package/bin/git-lab-group.ts +25 -0
- package/bin/git-lab-merge-active.ts +41 -0
- package/bin/git-lab-merge-todo.ts +36 -0
- package/bin/git-lab-merge-train-list.ts +26 -0
- package/bin/git-lab-merge-train.ts +25 -0
- package/bin/git-lab-merge.ts +29 -0
- package/bin/git-lab-namespace-list.ts +27 -0
- package/bin/git-lab-namespace.ts +24 -0
- package/bin/{git-lab-projects.ts → git-lab-project-list.ts} +13 -10
- package/bin/git-lab-project-pipeline-list.ts +46 -0
- package/bin/git-lab-project-pipeline.ts +24 -0
- package/bin/git-lab-project-whereami.ts +43 -0
- package/bin/git-lab-project.ts +28 -0
- package/bin/git-lab-whoami.ts +8 -5
- package/bin/git-lab.ts +18 -8
- package/bin/gitj.ts +7 -5
- package/build.ts +1 -1
- package/bun.lockb +0 -0
- package/dist/bin/git-bump.js +55 -17
- package/dist/bin/{git-jira-issues.js → git-jira-issue-list.js} +71 -28
- package/dist/bin/{git-lab-mergetrain.js → git-jira-issue-show.js} +100 -43
- package/dist/bin/git-jira-issue.js +106 -33
- package/dist/bin/git-jira-start.js +70 -27
- package/dist/bin/git-jira.js +117 -59
- package/dist/bin/git-lab-group-list.js +2793 -0
- package/dist/bin/git-lab-group.js +2805 -0
- package/dist/bin/git-lab-groups.js +1992 -0
- package/dist/bin/git-lab-merge-active.js +2798 -0
- package/dist/bin/git-lab-merge-todo.js +2793 -0
- package/dist/bin/git-lab-merge-train-list.js +2754 -0
- package/dist/bin/git-lab-merge-train.js +2766 -0
- package/dist/bin/git-lab-merge.js +2865 -0
- package/dist/bin/git-lab-namespace-list.js +1967 -0
- package/dist/bin/git-lab-namespace.js +1979 -0
- package/dist/bin/git-lab-namespaces.js +1984 -0
- package/dist/bin/git-lab-project-list.js +2761 -0
- package/dist/bin/git-lab-project-pipeline-list.js +2800 -0
- package/dist/bin/git-lab-project-pipeline.js +2812 -0
- package/dist/bin/git-lab-project-whereami.js +2764 -0
- package/dist/bin/git-lab-project.js +2805 -0
- package/dist/bin/git-lab-projects-list.js +1996 -0
- package/dist/bin/git-lab-projects-whereami.js +1999 -0
- package/dist/bin/git-lab-projects.js +138 -35
- package/dist/bin/git-lab-whoami.js +100 -56
- package/dist/bin/git-lab.js +1123 -58
- package/dist/bin/gitj.js +1260 -172
- package/dist/index.js +881 -35
- package/index.ts +1 -1
- package/lib/gitlab/api.ts +46 -0
- package/lib/gitlab/config.ts +21 -0
- package/lib/gitlab/dlog.ts +2 -0
- package/lib/gitlab/group.ts +12 -0
- package/lib/gitlab/index.ts +8 -0
- package/lib/gitlab/merge-request.ts +31 -0
- package/lib/gitlab/merge-trains.ts +19 -0
- package/lib/gitlab/namespace.ts +12 -0
- package/lib/gitlab/pipeline.ts +32 -0
- package/lib/gitlab/project.ts +78 -0
- package/lib/gitlab/user.ts +13 -0
- package/lib/is_main.ts +21 -2
- package/lib/jira.ts +12 -7
- package/lib/package.ts +35 -0
- package/package.json +21 -4
- package/tests/all-help.test.ts +46 -0
- package/tests/git.test.ts +8 -7
- package/tests/gitj.test.ts +1 -1
- package/lib/gitlab.ts +0 -86
package/bin/git-bump.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import { createBranch, getCurrentBranch } from "../lib/git"
|
|
4
4
|
import { Command } from 'commander'
|
|
5
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
6
|
import { isMain } from '../lib/is_main'
|
|
7
|
+
const version = await getPackageVersion()
|
|
6
8
|
|
|
7
9
|
export function create(): Command {
|
|
8
|
-
const program = new Command()
|
|
10
|
+
const program: Command = new Command()
|
|
9
11
|
program
|
|
12
|
+
.version(version)
|
|
10
13
|
.name('bump')
|
|
11
14
|
.description('Bump the version number in the current branch')
|
|
12
15
|
.action(async () => {
|
|
@@ -27,8 +30,8 @@ export function create(): Command {
|
|
|
27
30
|
return program
|
|
28
31
|
}
|
|
29
32
|
|
|
33
|
+
export default create
|
|
34
|
+
|
|
30
35
|
if (isMain('git-bump')) {
|
|
31
36
|
await create().parseAsync(Bun.argv)
|
|
32
37
|
}
|
|
33
|
-
|
|
34
|
-
export default create
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
4
5
|
import { myUnresolvedIssues } from "../lib/jira"
|
|
5
6
|
import { isMain } from '../lib/is_main'
|
|
7
|
+
const version = await getPackageVersion()
|
|
6
8
|
|
|
7
9
|
export function create(): Command {
|
|
8
|
-
const program = new Command()
|
|
10
|
+
const program: Command = new Command()
|
|
9
11
|
program
|
|
10
|
-
.
|
|
12
|
+
.version(version)
|
|
13
|
+
.name('list')
|
|
11
14
|
.description('List your unresolved issues')
|
|
12
|
-
.action(async (
|
|
15
|
+
.action(async () => {
|
|
13
16
|
const issues = await myUnresolvedIssues()
|
|
14
17
|
console.log(`You have ${issues.length} unresolved issues`)
|
|
15
18
|
issues.forEach(issue => {
|
|
@@ -19,8 +22,8 @@ export function create(): Command {
|
|
|
19
22
|
return program
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
export default create
|
|
26
|
+
|
|
27
|
+
if (isMain('git-jira-issue-list')) {
|
|
23
28
|
await create().parseAsync(Bun.argv)
|
|
24
29
|
}
|
|
25
|
-
|
|
26
|
-
export default create
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { getIssue } from "../lib/jira"
|
|
6
|
+
import { isMain } from '../lib/is_main'
|
|
7
|
+
import { getJiraConfig } from '../lib/jira'
|
|
8
|
+
const version = await getPackageVersion()
|
|
9
|
+
|
|
10
|
+
export function create(): Command {
|
|
11
|
+
const program: Command = new Command()
|
|
12
|
+
program
|
|
13
|
+
.version(version)
|
|
14
|
+
.name('show')
|
|
15
|
+
.description('Show information about one issue')
|
|
16
|
+
.argument('issue', 'Issue ID')
|
|
17
|
+
.option('-v, --verbose', 'Verbose output')
|
|
18
|
+
.action(async (issueId: string, options) => {
|
|
19
|
+
const issue = await getIssue(issueId)
|
|
20
|
+
if (!issue) {
|
|
21
|
+
console.error(`Issue ${issueId} not found`)
|
|
22
|
+
process.exit(1)
|
|
23
|
+
}
|
|
24
|
+
if (options.verbose) {
|
|
25
|
+
console.log(issue)
|
|
26
|
+
} else {
|
|
27
|
+
const { host } = await getJiraConfig()
|
|
28
|
+
const summary = issue.fields.summary
|
|
29
|
+
const url = `https://${host}/browse/${issueId}`
|
|
30
|
+
console.log({ issueId, summary, url })
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
return program
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default create
|
|
37
|
+
|
|
38
|
+
if (isMain('git-jira-issue-show')) {
|
|
39
|
+
await create().parseAsync(Bun.argv)
|
|
40
|
+
}
|
package/bin/git-jira-issue.ts
CHANGED
|
@@ -1,38 +1,27 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander'
|
|
4
|
-
import {
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
5
|
import { isMain } from '../lib/is_main'
|
|
6
|
-
import
|
|
6
|
+
import list from './git-jira-issue-list'
|
|
7
|
+
import show from './git-jira-issue-show'
|
|
8
|
+
const version = await getPackageVersion()
|
|
7
9
|
|
|
8
10
|
export function create(): Command {
|
|
9
|
-
const program = new Command()
|
|
11
|
+
const program: Command = new Command()
|
|
10
12
|
program
|
|
13
|
+
.version(version)
|
|
11
14
|
.name('issue')
|
|
12
|
-
.description('
|
|
13
|
-
.
|
|
14
|
-
.
|
|
15
|
-
.
|
|
16
|
-
|
|
17
|
-
const { host } = await getJiraConfig()
|
|
18
|
-
const issue = await getIssue(issueId)
|
|
19
|
-
if (!issue) {
|
|
20
|
-
console.error(`Issue ${issueId} not found`)
|
|
21
|
-
process.exit(1)
|
|
22
|
-
}
|
|
23
|
-
if (options.verbose) {
|
|
24
|
-
console.log(issue)
|
|
25
|
-
process.exit(0)
|
|
26
|
-
}
|
|
27
|
-
if (options.url) {
|
|
28
|
-
console.log(`https://${host}/browse/${issueId}`)
|
|
29
|
-
}
|
|
30
|
-
})
|
|
15
|
+
.description('Commands for working with issues')
|
|
16
|
+
.addCommand(list())
|
|
17
|
+
.addCommand(show())
|
|
18
|
+
.action(() => program.help()
|
|
19
|
+
)
|
|
31
20
|
return program
|
|
32
21
|
}
|
|
33
22
|
|
|
23
|
+
export default create
|
|
24
|
+
|
|
34
25
|
if (isMain('git-jira-issue')) {
|
|
35
26
|
await create().parseAsync(Bun.argv)
|
|
36
27
|
}
|
|
37
|
-
|
|
38
|
-
export default create
|
package/bin/git-jira-start.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
4
5
|
import { createBranch } from "../lib/git"
|
|
5
6
|
import { getIssue } from "../lib/jira"
|
|
6
7
|
import { isMain } from '../lib/is_main'
|
|
8
|
+
const version = await getPackageVersion()
|
|
7
9
|
|
|
8
10
|
function toKebab(s: string): string {
|
|
9
11
|
return s.replace(/([a-z]+)([A-Z]+)/g, "$1_2").toLowerCase()
|
|
@@ -12,8 +14,9 @@ function toKebab(s: string): string {
|
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export function create(): Command {
|
|
15
|
-
const program = new Command()
|
|
17
|
+
const program: Command = new Command()
|
|
16
18
|
program
|
|
19
|
+
.version(version)
|
|
17
20
|
.name('start')
|
|
18
21
|
.description('Start working on an issue by creating a branch')
|
|
19
22
|
.argument('issue', 'Issue ID')
|
|
@@ -32,8 +35,8 @@ export function create(): Command {
|
|
|
32
35
|
return program
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
export default create
|
|
39
|
+
|
|
40
|
+
if (isMain('git-jira-start')) {
|
|
36
41
|
await create().parseAsync(Bun.argv)
|
|
37
42
|
}
|
|
38
|
-
|
|
39
|
-
export default create
|
package/bin/git-jira.ts
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
4
5
|
import { isMain } from '../lib/is_main'
|
|
5
6
|
import start from './git-jira-start'
|
|
6
7
|
import issue from './git-jira-issue'
|
|
7
|
-
import issues from './git-jira-
|
|
8
|
+
import issues from './git-jira-issue-list'
|
|
9
|
+
const version = await getPackageVersion()
|
|
8
10
|
|
|
9
11
|
export function create(): Command {
|
|
10
|
-
const program = new Command()
|
|
12
|
+
const program: Command = new Command()
|
|
11
13
|
program
|
|
14
|
+
.version(version)
|
|
12
15
|
.name('jira')
|
|
13
|
-
.description('
|
|
16
|
+
.description('Commands for working with Jira')
|
|
14
17
|
.addCommand(start())
|
|
15
18
|
.addCommand(issue())
|
|
16
19
|
.addCommand(issues())
|
|
17
20
|
return program
|
|
18
21
|
}
|
|
19
22
|
|
|
23
|
+
export default create
|
|
24
|
+
|
|
20
25
|
if (isMain('git-jira')) {
|
|
21
26
|
await create().parseAsync(Bun.argv)
|
|
22
27
|
}
|
|
23
|
-
|
|
24
|
-
export default create
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { isMain } from '../lib/is_main'
|
|
6
|
+
import { getGroups } from '../lib/gitlab'
|
|
7
|
+
const version = await getPackageVersion()
|
|
8
|
+
|
|
9
|
+
export function create(): Command {
|
|
10
|
+
const program: Command = new Command()
|
|
11
|
+
program
|
|
12
|
+
.version(version)
|
|
13
|
+
.name('list')
|
|
14
|
+
.description('List groups for the current user')
|
|
15
|
+
.option("-v, --verbose", "Verbose output")
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
const groups = await getGroups()
|
|
18
|
+
if (options.verbose)
|
|
19
|
+
console.log(groups)
|
|
20
|
+
else {
|
|
21
|
+
const filtered = groups.map(g => {
|
|
22
|
+
const { id, name, full_path } = g
|
|
23
|
+
return { id, name, full_path }
|
|
24
|
+
})
|
|
25
|
+
console.log(filtered)
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
return program
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default create
|
|
32
|
+
|
|
33
|
+
if (isMain('git-lab-group-list')) {
|
|
34
|
+
await create().parseAsync(Bun.argv)
|
|
35
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { isMain } from '../lib/is_main'
|
|
6
|
+
const version = await getPackageVersion()
|
|
7
|
+
|
|
8
|
+
import list from './git-lab-group-list'
|
|
9
|
+
|
|
10
|
+
export function create(): Command {
|
|
11
|
+
const program: Command = new Command()
|
|
12
|
+
program
|
|
13
|
+
.version(version)
|
|
14
|
+
.name('group')
|
|
15
|
+
.description('Commands for working with GitLab groups')
|
|
16
|
+
.addCommand(list())
|
|
17
|
+
.action(() => program.help())
|
|
18
|
+
return program
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default create
|
|
22
|
+
|
|
23
|
+
if (isMain('git-lab-group')) {
|
|
24
|
+
await create().parseAsync(Bun.argv)
|
|
25
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { getMyMergeRequestsInProgress } from "../lib/gitlab"
|
|
6
|
+
import { isMain } from '../lib/is_main'
|
|
7
|
+
const version = await getPackageVersion()
|
|
8
|
+
|
|
9
|
+
export function create(): Command {
|
|
10
|
+
const program: Command = new Command()
|
|
11
|
+
program
|
|
12
|
+
.version(version)
|
|
13
|
+
.name('active')
|
|
14
|
+
.description('List my MRs in progress')
|
|
15
|
+
.option('-v, --verbose', 'Verbose output')
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
const merges = await getMyMergeRequestsInProgress();
|
|
18
|
+
if (!merges) {
|
|
19
|
+
console.error(`No MRs!`)
|
|
20
|
+
process.exit(1)
|
|
21
|
+
}
|
|
22
|
+
if (options.verbose) {
|
|
23
|
+
console.log(merges)
|
|
24
|
+
process.exit(0)
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const filtered = merges.map(m => {
|
|
28
|
+
const { title, web_url, source_branch, target_branch } = m
|
|
29
|
+
return { title, web_url, source_branch, target_branch }
|
|
30
|
+
})
|
|
31
|
+
console.log(filtered)
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
return program
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default create
|
|
38
|
+
|
|
39
|
+
if (isMain('git-lab-merge-active')) {
|
|
40
|
+
await create().parseAsync(Bun.argv)
|
|
41
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { getMyMergeRequestsToReview, type MergeRequest } from "../lib/gitlab"
|
|
6
|
+
import { isMain } from '../lib/is_main'
|
|
7
|
+
const version = await getPackageVersion()
|
|
8
|
+
|
|
9
|
+
export function create(): Command {
|
|
10
|
+
const program: Command = new Command()
|
|
11
|
+
program
|
|
12
|
+
.version(version)
|
|
13
|
+
.name('todo')
|
|
14
|
+
.description('MRs needing my review')
|
|
15
|
+
.option('-v, --verbose', 'Verbose output')
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
const mrs: MergeRequest[] = await getMyMergeRequestsToReview()
|
|
18
|
+
if (options.verbose) {
|
|
19
|
+
console.log(mrs)
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const filtered = mrs.map(mr => {
|
|
23
|
+
const { title, web_url, source_branch, target_branch } = mr
|
|
24
|
+
return { title, web_url, source_branch, target_branch }
|
|
25
|
+
})
|
|
26
|
+
console.log(filtered)
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
return program
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default create
|
|
33
|
+
|
|
34
|
+
if (isMain('git-lab-merge-todo')) {
|
|
35
|
+
await create().parseAsync(Bun.argv)
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { isMain } from '../lib/is_main'
|
|
6
|
+
import { getMergeTrains } from '../lib/gitlab/merge-trains'
|
|
7
|
+
const version = await getPackageVersion()
|
|
8
|
+
|
|
9
|
+
export function create(): Command {
|
|
10
|
+
const program: Command = new Command()
|
|
11
|
+
program
|
|
12
|
+
.version(version)
|
|
13
|
+
.name('list')
|
|
14
|
+
.description('List merge trains for the current project')
|
|
15
|
+
.action(async () => {
|
|
16
|
+
const trains = await getMergeTrains()
|
|
17
|
+
console.log(trains)
|
|
18
|
+
})
|
|
19
|
+
return program
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default create
|
|
23
|
+
|
|
24
|
+
if (isMain('git-lab-merge-train-list')) {
|
|
25
|
+
await create().parseAsync(Bun.argv)
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { isMain } from '../lib/is_main'
|
|
6
|
+
const version = await getPackageVersion()
|
|
7
|
+
|
|
8
|
+
import list from './git-lab-merge-train-list'
|
|
9
|
+
|
|
10
|
+
export function create(): Command {
|
|
11
|
+
const program: Command = new Command()
|
|
12
|
+
program
|
|
13
|
+
.version(version)
|
|
14
|
+
.name('train')
|
|
15
|
+
.description('Commands for working with GitLab merge trains.')
|
|
16
|
+
.addCommand(list())
|
|
17
|
+
.action(() => program.help())
|
|
18
|
+
return program
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default create
|
|
22
|
+
|
|
23
|
+
if (isMain('git-lab-merge-train')) {
|
|
24
|
+
await create().parseAsync(Bun.argv)
|
|
25
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { isMain } from '../lib/is_main'
|
|
6
|
+
import todo from './git-lab-merge-todo'
|
|
7
|
+
import active from './git-lab-merge-active'
|
|
8
|
+
import train from './git-lab-merge-train'
|
|
9
|
+
|
|
10
|
+
const version = await getPackageVersion()
|
|
11
|
+
|
|
12
|
+
export function create(): Command {
|
|
13
|
+
const program: Command = new Command()
|
|
14
|
+
program
|
|
15
|
+
.version(version)
|
|
16
|
+
.name('merge')
|
|
17
|
+
.description('Commands for working with GitLab merge requests')
|
|
18
|
+
.addCommand(active())
|
|
19
|
+
.addCommand(todo())
|
|
20
|
+
.addCommand(train())
|
|
21
|
+
.action(() => program.help())
|
|
22
|
+
return program
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default create
|
|
26
|
+
|
|
27
|
+
if (isMain('git-lab-merge')) {
|
|
28
|
+
await create().parseAsync(Bun.argv)
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { isMain } from '../lib/is_main'
|
|
6
|
+
import { getNamespaces } from '../lib/gitlab/namespace'
|
|
7
|
+
|
|
8
|
+
const version = await getPackageVersion()
|
|
9
|
+
|
|
10
|
+
export function create(): Command {
|
|
11
|
+
const program: Command = new Command()
|
|
12
|
+
program
|
|
13
|
+
.version(version)
|
|
14
|
+
.name('list')
|
|
15
|
+
.description('List namespaces for the current user')
|
|
16
|
+
.action(async () => {
|
|
17
|
+
const namespaces = await getNamespaces()
|
|
18
|
+
console.log(namespaces)
|
|
19
|
+
})
|
|
20
|
+
return program
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default create
|
|
24
|
+
|
|
25
|
+
if (isMain('git-lab-namespace-list')) {
|
|
26
|
+
await create().parseAsync(Bun.argv)
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { isMain } from '../lib/is_main'
|
|
6
|
+
import list from './git-lab-namespace-list'
|
|
7
|
+
const version = await getPackageVersion()
|
|
8
|
+
|
|
9
|
+
export function create(): Command {
|
|
10
|
+
const program: Command = new Command()
|
|
11
|
+
program
|
|
12
|
+
.version(version)
|
|
13
|
+
.name('namespace')
|
|
14
|
+
.description('Commands for working with GitLab namespaces')
|
|
15
|
+
.addCommand(list())
|
|
16
|
+
.action(() => program.help())
|
|
17
|
+
return program
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default create
|
|
21
|
+
|
|
22
|
+
if (isMain('git-lab-namespace')) {
|
|
23
|
+
await create().parseAsync(Bun.argv)
|
|
24
|
+
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander'
|
|
4
|
-
import {
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { getProjects, type Project } from "../lib/gitlab/project"
|
|
5
6
|
import { isMain } from '../lib/is_main'
|
|
7
|
+
const version = await getPackageVersion()
|
|
6
8
|
|
|
7
9
|
export function create(): Command {
|
|
8
|
-
const program = new Command()
|
|
10
|
+
const program: Command = new Command()
|
|
9
11
|
program
|
|
10
|
-
.
|
|
12
|
+
.version(version)
|
|
13
|
+
.name('list')
|
|
11
14
|
.description('List projects for current user')
|
|
12
15
|
.option('-v, --verbose', 'Verbose output')
|
|
13
|
-
.
|
|
14
|
-
.action(async (
|
|
15
|
-
const projects: Array<Project> = await getProjects(
|
|
16
|
+
.option('-m, --match <match>', 'Match projects with paths containing <match>')
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
const projects: Array<Project> = await getProjects(options.match)
|
|
16
19
|
if (!projects) {
|
|
17
20
|
console.error(`No projects!`)
|
|
18
21
|
process.exit(1)
|
|
@@ -31,8 +34,8 @@ export function create(): Command {
|
|
|
31
34
|
return program
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
export default create
|
|
38
|
+
|
|
39
|
+
if (isMain('git-lab-project-list')) {
|
|
35
40
|
await create().parseAsync(Bun.argv)
|
|
36
41
|
}
|
|
37
|
-
|
|
38
|
-
export default create
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { getProjectPipelines, type Pipeline } from "../lib/gitlab"
|
|
6
|
+
import { isMain } from '../lib/is_main'
|
|
7
|
+
import debug from 'debug'
|
|
8
|
+
|
|
9
|
+
const version = await getPackageVersion()
|
|
10
|
+
const dlog = debug('git-lab-project-pipeline-list')
|
|
11
|
+
|
|
12
|
+
export function create(): Command {
|
|
13
|
+
const program: Command = new Command()
|
|
14
|
+
program
|
|
15
|
+
.version(version)
|
|
16
|
+
.name('list')
|
|
17
|
+
.description('List recent successful pipelines')
|
|
18
|
+
.option('-v, --verbose', 'Verbose output')
|
|
19
|
+
.option('-d, --days <days>', 'Number of days to look back', '7')
|
|
20
|
+
.option('-s, --status <status>', 'Status of pipelines to list: success | runnning | ', 'success')
|
|
21
|
+
.action(async (options) => {
|
|
22
|
+
const pipelines: Array<Pipeline> = await getProjectPipelines(options)
|
|
23
|
+
dlog(`pipelines:`, pipelines)
|
|
24
|
+
if (!pipelines) {
|
|
25
|
+
console.error(`No pipelines!`)
|
|
26
|
+
process.exit(1)
|
|
27
|
+
}
|
|
28
|
+
if (options.verbose) {
|
|
29
|
+
console.log(pipelines)
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
let filtered = pipelines.map((p: Pipeline) => {
|
|
33
|
+
const { id, web_url, updated_at, ref, sha } = p
|
|
34
|
+
return { id, web_url, updated_at, ref, sha }
|
|
35
|
+
})
|
|
36
|
+
console.log(filtered)
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
return program
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default create
|
|
43
|
+
|
|
44
|
+
if (isMain('git-lab-project-pipeline-list')) {
|
|
45
|
+
await create().parseAsync(Bun.argv)
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { isMain } from '../lib/is_main'
|
|
6
|
+
import list from './git-lab-project-pipeline-list'
|
|
7
|
+
const version = await getPackageVersion()
|
|
8
|
+
|
|
9
|
+
export function create(): Command {
|
|
10
|
+
const program: Command = new Command()
|
|
11
|
+
program
|
|
12
|
+
.version(version)
|
|
13
|
+
.name('pipeline')
|
|
14
|
+
.description('Commands for working with GitLab pipelines')
|
|
15
|
+
.addCommand(list())
|
|
16
|
+
.action(() => program.help())
|
|
17
|
+
return program
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default create
|
|
21
|
+
|
|
22
|
+
if (isMain('git-lab-project-pipeline')) {
|
|
23
|
+
await create().parseAsync(Bun.argv)
|
|
24
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import { getPackageVersion } from '../lib/package'
|
|
5
|
+
import { findProject } from "../lib/gitlab/project"
|
|
6
|
+
import { getRemote } from '../lib/git'
|
|
7
|
+
import { isMain } from '../lib/is_main'
|
|
8
|
+
const version = await getPackageVersion()
|
|
9
|
+
|
|
10
|
+
export function create(): Command {
|
|
11
|
+
const program: Command = new Command()
|
|
12
|
+
program
|
|
13
|
+
.version(version)
|
|
14
|
+
.name('whereami')
|
|
15
|
+
.description('Show current project based on current directory')
|
|
16
|
+
.option('-v, --verbose', 'Verbose output')
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
const ssh_url = await getRemote();
|
|
19
|
+
if (!ssh_url) {
|
|
20
|
+
console.error(`No remote!`)
|
|
21
|
+
process.exit(1)
|
|
22
|
+
}
|
|
23
|
+
console.log(`Remote: ${ssh_url}`)
|
|
24
|
+
const project = await findProject(ssh_url);
|
|
25
|
+
if (!project) {
|
|
26
|
+
console.error(`No project!`)
|
|
27
|
+
process.exit(1)
|
|
28
|
+
}
|
|
29
|
+
if (options.verbose) {
|
|
30
|
+
console.log(project)
|
|
31
|
+
} else {
|
|
32
|
+
const { id, name, path_with_namespace, ssh_url_to_repo } = project
|
|
33
|
+
console.log({id, name, path_with_namespace, ssh_url_to_repo })
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
return program
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default create
|
|
40
|
+
|
|
41
|
+
if (isMain('git-lab-project-whereami')) {
|
|
42
|
+
await create().parseAsync(Bun.argv)
|
|
43
|
+
}
|