chief-clancy 0.2.0 → 0.3.1
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 +13 -24
- package/dist/bundle/clancy-afk.js +101 -0
- package/dist/bundle/clancy-once.js +13902 -0
- package/dist/installer/file-ops/file-ops.d.ts +32 -0
- package/dist/installer/file-ops/file-ops.d.ts.map +1 -0
- package/dist/installer/file-ops/file-ops.js +58 -0
- package/dist/installer/file-ops/file-ops.js.map +1 -0
- package/dist/installer/hook-installer/hook-installer.d.ts +29 -0
- package/dist/installer/hook-installer/hook-installer.d.ts.map +1 -0
- package/dist/installer/hook-installer/hook-installer.js +96 -0
- package/dist/installer/hook-installer/hook-installer.js.map +1 -0
- package/dist/installer/install.d.ts +3 -0
- package/dist/installer/install.d.ts.map +1 -0
- package/dist/installer/install.js +248 -0
- package/dist/installer/install.js.map +1 -0
- package/dist/installer/manifest/manifest.d.ts +41 -0
- package/dist/installer/manifest/manifest.d.ts.map +1 -0
- package/dist/installer/manifest/manifest.js +97 -0
- package/dist/installer/manifest/manifest.js.map +1 -0
- package/dist/installer/prompts/prompts.d.ts +33 -0
- package/dist/installer/prompts/prompts.d.ts.map +1 -0
- package/dist/installer/prompts/prompts.js +55 -0
- package/dist/installer/prompts/prompts.js.map +1 -0
- package/dist/schemas/env.d.ts +75 -0
- package/dist/schemas/env.d.ts.map +1 -0
- package/dist/schemas/env.js +40 -0
- package/dist/schemas/env.js.map +1 -0
- package/dist/schemas/github.d.ts +27 -0
- package/dist/schemas/github.d.ts.map +1 -0
- package/dist/schemas/github.js +17 -0
- package/dist/schemas/github.js.map +1 -0
- package/dist/schemas/index.d.ts +9 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +5 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/jira.d.ts +37 -0
- package/dist/schemas/jira.d.ts.map +1 -0
- package/dist/schemas/jira.js +37 -0
- package/dist/schemas/jira.js.map +1 -0
- package/dist/schemas/linear.d.ts +67 -0
- package/dist/schemas/linear.d.ts.map +1 -0
- package/dist/schemas/linear.js +50 -0
- package/dist/schemas/linear.js.map +1 -0
- package/dist/scripts/afk/afk.d.ts +21 -0
- package/dist/scripts/afk/afk.d.ts.map +1 -0
- package/dist/scripts/afk/afk.js +124 -0
- package/dist/scripts/afk/afk.js.map +1 -0
- package/dist/scripts/board/github/github.d.ts +40 -0
- package/dist/scripts/board/github/github.d.ts.map +1 -0
- package/dist/scripts/board/github/github.js +121 -0
- package/dist/scripts/board/github/github.js.map +1 -0
- package/dist/scripts/board/jira/jira.d.ts +90 -0
- package/dist/scripts/board/jira/jira.d.ts.map +1 -0
- package/dist/scripts/board/jira/jira.js +251 -0
- package/dist/scripts/board/jira/jira.js.map +1 -0
- package/dist/scripts/board/linear/linear.d.ts +85 -0
- package/dist/scripts/board/linear/linear.d.ts.map +1 -0
- package/dist/scripts/board/linear/linear.js +209 -0
- package/dist/scripts/board/linear/linear.js.map +1 -0
- package/dist/scripts/once/once.d.ts +12 -0
- package/dist/scripts/once/once.d.ts.map +1 -0
- package/dist/scripts/once/once.js +330 -0
- package/dist/scripts/once/once.js.map +1 -0
- package/dist/scripts/shared/branch/branch.d.ts +50 -0
- package/dist/scripts/shared/branch/branch.d.ts.map +1 -0
- package/dist/scripts/shared/branch/branch.js +61 -0
- package/dist/scripts/shared/branch/branch.js.map +1 -0
- package/dist/scripts/shared/claude-cli/claude-cli.d.ts +17 -0
- package/dist/scripts/shared/claude-cli/claude-cli.d.ts.map +1 -0
- package/dist/scripts/shared/claude-cli/claude-cli.js +35 -0
- package/dist/scripts/shared/claude-cli/claude-cli.js.map +1 -0
- package/dist/scripts/shared/env-parser/env-parser.d.ts +30 -0
- package/dist/scripts/shared/env-parser/env-parser.d.ts.map +1 -0
- package/dist/scripts/shared/env-parser/env-parser.js +64 -0
- package/dist/scripts/shared/env-parser/env-parser.js.map +1 -0
- package/dist/scripts/shared/env-schema/env-schema.d.ts +27 -0
- package/dist/scripts/shared/env-schema/env-schema.d.ts.map +1 -0
- package/dist/scripts/shared/env-schema/env-schema.js +46 -0
- package/dist/scripts/shared/env-schema/env-schema.js.map +1 -0
- package/dist/scripts/shared/git-ops/git-ops.d.ts +52 -0
- package/dist/scripts/shared/git-ops/git-ops.d.ts.map +1 -0
- package/dist/scripts/shared/git-ops/git-ops.js +107 -0
- package/dist/scripts/shared/git-ops/git-ops.js.map +1 -0
- package/dist/scripts/shared/http/http.d.ts +52 -0
- package/dist/scripts/shared/http/http.d.ts.map +1 -0
- package/dist/scripts/shared/http/http.js +74 -0
- package/dist/scripts/shared/http/http.js.map +1 -0
- package/dist/scripts/shared/notify/notify.d.ts +46 -0
- package/dist/scripts/shared/notify/notify.d.ts.map +1 -0
- package/dist/scripts/shared/notify/notify.js +88 -0
- package/dist/scripts/shared/notify/notify.js.map +1 -0
- package/dist/scripts/shared/preflight/preflight.d.ts +40 -0
- package/dist/scripts/shared/preflight/preflight.d.ts.map +1 -0
- package/dist/scripts/shared/preflight/preflight.js +84 -0
- package/dist/scripts/shared/preflight/preflight.js.map +1 -0
- package/dist/scripts/shared/progress/progress.d.ts +25 -0
- package/dist/scripts/shared/progress/progress.d.ts.map +1 -0
- package/dist/scripts/shared/progress/progress.js +46 -0
- package/dist/scripts/shared/progress/progress.js.map +1 -0
- package/dist/scripts/shared/prompt/prompt.d.ts +38 -0
- package/dist/scripts/shared/prompt/prompt.d.ts.map +1 -0
- package/dist/scripts/shared/prompt/prompt.js +77 -0
- package/dist/scripts/shared/prompt/prompt.js.map +1 -0
- package/dist/types/board.d.ts +13 -0
- package/dist/types/board.d.ts.map +1 -0
- package/dist/types/board.js +5 -0
- package/dist/types/board.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/ansi/ansi.d.ts +55 -0
- package/dist/utils/ansi/ansi.d.ts.map +1 -0
- package/dist/utils/ansi/ansi.js +55 -0
- package/dist/utils/ansi/ansi.js.map +1 -0
- package/dist/utils/parse-json/parse-json.d.ts +20 -0
- package/dist/utils/parse-json/parse-json.d.ts.map +1 -0
- package/dist/utils/parse-json/parse-json.js +27 -0
- package/dist/utils/parse-json/parse-json.js.map +1 -0
- package/hooks/clancy-check-update.js +2 -2
- package/hooks/clancy-credential-guard.js +8 -1
- package/package.json +48 -8
- package/registry/boards.json +3 -6
- package/src/templates/CLAUDE.md +1 -1
- package/src/workflows/doctor.md +32 -23
- package/src/workflows/init.md +101 -26
- package/src/workflows/logs.md +13 -6
- package/src/workflows/map-codebase.md +17 -16
- package/src/workflows/once.md +22 -12
- package/src/workflows/review.md +40 -27
- package/src/workflows/run.md +20 -12
- package/src/workflows/scaffold.md +5 -1034
- package/src/workflows/settings.md +9 -6
- package/src/workflows/status.md +17 -8
- package/src/workflows/uninstall.md +11 -6
- package/src/workflows/update.md +20 -13
- package/bin/install.js +0 -362
- package/src/templates/scripts/clancy-afk.sh +0 -111
- package/src/templates/scripts/clancy-once-github.sh +0 -249
- package/src/templates/scripts/clancy-once-linear.sh +0 -320
- package/src/templates/scripts/clancy-once.sh +0 -322
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"once.js","sourceRoot":"","sources":["../../../src/scripts/once/once.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,UAAU,EACV,UAAU,IAAI,gBAAgB,EAC9B,WAAW,EACX,UAAU,GACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,eAAe,EACf,WAAW,IAAI,eAAe,EAC9B,cAAc,EACd,QAAQ,EACR,eAAe,IAAI,mBAAmB,GACvC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,UAAU,IAAI,gBAAgB,EAC9B,aAAa,EACb,UA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compute feature and target branch names
|
|
5
|
+
* based on the board provider and ticket metadata.
|
|
6
|
+
*/
|
|
7
|
+
import type { BoardProvider } from '../../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Compute the feature branch name for a ticket.
|
|
10
|
+
*
|
|
11
|
+
* - Jira/Linear: `feature/{key-lowercase}` (e.g., `feature/proj-123`)
|
|
12
|
+
* - GitHub: `feature/issue-{number}` (e.g., `feature/issue-42`)
|
|
13
|
+
*
|
|
14
|
+
* @param provider - The board provider.
|
|
15
|
+
* @param key - The ticket key (e.g., `'PROJ-123'`, `'#42'`, `'ENG-123'`).
|
|
16
|
+
* @returns The feature branch name.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* computeTicketBranch('jira', 'PROJ-123'); // 'feature/proj-123'
|
|
21
|
+
* computeTicketBranch('github', '#42'); // 'feature/issue-42'
|
|
22
|
+
* computeTicketBranch('linear', 'ENG-123'); // 'feature/eng-123'
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function computeTicketBranch(provider: BoardProvider, key: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Compute the target branch for merging.
|
|
28
|
+
*
|
|
29
|
+
* If the ticket has a parent (epic/milestone), branches from that parent's
|
|
30
|
+
* branch. Otherwise falls back to the base branch.
|
|
31
|
+
*
|
|
32
|
+
* - Jira: epic key → `epic/{key-lowercase}`
|
|
33
|
+
* - GitHub: milestone → `milestone/{slug}`
|
|
34
|
+
* - Linear: parent identifier → `epic/{id-lowercase}`
|
|
35
|
+
*
|
|
36
|
+
* @param provider - The board provider.
|
|
37
|
+
* @param baseBranch - The default base branch (e.g., `'main'`).
|
|
38
|
+
* @param parent - Optional parent identifier (epic key, milestone title, parent ID).
|
|
39
|
+
* @returns The target branch name.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* computeTargetBranch('jira', 'main', 'PROJ-100'); // 'epic/proj-100'
|
|
44
|
+
* computeTargetBranch('github', 'main', 'Sprint 3'); // 'milestone/sprint-3'
|
|
45
|
+
* computeTargetBranch('linear', 'main', 'ENG-50'); // 'epic/eng-50'
|
|
46
|
+
* computeTargetBranch('jira', 'main'); // 'main'
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function computeTargetBranch(provider: BoardProvider, baseBranch: string, parent?: string): string;
|
|
50
|
+
//# sourceMappingURL=branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../../src/scripts/shared/branch/branch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,aAAa,EACvB,GAAG,EAAE,MAAM,GACV,MAAM,CAOR;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,aAAa,EACvB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAaR"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the feature branch name for a ticket.
|
|
3
|
+
*
|
|
4
|
+
* - Jira/Linear: `feature/{key-lowercase}` (e.g., `feature/proj-123`)
|
|
5
|
+
* - GitHub: `feature/issue-{number}` (e.g., `feature/issue-42`)
|
|
6
|
+
*
|
|
7
|
+
* @param provider - The board provider.
|
|
8
|
+
* @param key - The ticket key (e.g., `'PROJ-123'`, `'#42'`, `'ENG-123'`).
|
|
9
|
+
* @returns The feature branch name.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* computeTicketBranch('jira', 'PROJ-123'); // 'feature/proj-123'
|
|
14
|
+
* computeTicketBranch('github', '#42'); // 'feature/issue-42'
|
|
15
|
+
* computeTicketBranch('linear', 'ENG-123'); // 'feature/eng-123'
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export function computeTicketBranch(provider, key) {
|
|
19
|
+
if (provider === 'github') {
|
|
20
|
+
const number = key.replace('#', '');
|
|
21
|
+
return `feature/issue-${number}`;
|
|
22
|
+
}
|
|
23
|
+
return `feature/${key.toLowerCase()}`;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Compute the target branch for merging.
|
|
27
|
+
*
|
|
28
|
+
* If the ticket has a parent (epic/milestone), branches from that parent's
|
|
29
|
+
* branch. Otherwise falls back to the base branch.
|
|
30
|
+
*
|
|
31
|
+
* - Jira: epic key → `epic/{key-lowercase}`
|
|
32
|
+
* - GitHub: milestone → `milestone/{slug}`
|
|
33
|
+
* - Linear: parent identifier → `epic/{id-lowercase}`
|
|
34
|
+
*
|
|
35
|
+
* @param provider - The board provider.
|
|
36
|
+
* @param baseBranch - The default base branch (e.g., `'main'`).
|
|
37
|
+
* @param parent - Optional parent identifier (epic key, milestone title, parent ID).
|
|
38
|
+
* @returns The target branch name.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* computeTargetBranch('jira', 'main', 'PROJ-100'); // 'epic/proj-100'
|
|
43
|
+
* computeTargetBranch('github', 'main', 'Sprint 3'); // 'milestone/sprint-3'
|
|
44
|
+
* computeTargetBranch('linear', 'main', 'ENG-50'); // 'epic/eng-50'
|
|
45
|
+
* computeTargetBranch('jira', 'main'); // 'main'
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export function computeTargetBranch(provider, baseBranch, parent) {
|
|
49
|
+
if (!parent)
|
|
50
|
+
return baseBranch;
|
|
51
|
+
if (provider === 'github') {
|
|
52
|
+
const slug = parent
|
|
53
|
+
.toLowerCase()
|
|
54
|
+
.replace(/\s+/g, '-')
|
|
55
|
+
.replace(/[^a-z0-9-]/g, '');
|
|
56
|
+
return `milestone/${slug}`;
|
|
57
|
+
}
|
|
58
|
+
// Jira and Linear both use epic/ prefix
|
|
59
|
+
return `epic/${parent.toLowerCase()}`;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=branch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch.js","sourceRoot":"","sources":["../../../../src/scripts/shared/branch/branch.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAuB,EACvB,GAAW;IAEX,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACpC,OAAO,iBAAiB,MAAM,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,WAAW,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAuB,EACvB,UAAkB,EAClB,MAAe;IAEf,IAAI,CAAC,MAAM;QAAE,OAAO,UAAU,CAAC;IAE/B,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,MAAM,IAAI,GAAG,MAAM;aAChB,WAAW,EAAE;aACb,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;aACpB,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QAC9B,OAAO,aAAa,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,wCAAwC;IACxC,OAAO,QAAQ,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invoke a Claude Code session with the given prompt.
|
|
3
|
+
*
|
|
4
|
+
* Pipes the prompt to stdin and streams stdout/stderr live.
|
|
5
|
+
* Uses `--dangerously-skip-permissions` for autonomous operation.
|
|
6
|
+
*
|
|
7
|
+
* @param prompt - The full implementation prompt.
|
|
8
|
+
* @param model - Optional model override (e.g., `'opus'`, `'sonnet'`).
|
|
9
|
+
* @returns `true` if Claude exited successfully (code 0), `false` otherwise.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* invokeClaudeSession('You are implementing PROJ-123...', 'opus');
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function invokeClaudeSession(prompt: string, model?: string): boolean;
|
|
17
|
+
//# sourceMappingURL=claude-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-cli.d.ts","sourceRoot":"","sources":["../../../../src/scripts/shared/claude-cli/claude-cli.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAc3E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude CLI invocation for ticket implementation.
|
|
3
|
+
*
|
|
4
|
+
* Spawns `claude --dangerously-skip-permissions` with the prompt piped
|
|
5
|
+
* to stdin. Output streams live to the user's terminal.
|
|
6
|
+
*/
|
|
7
|
+
import { spawnSync } from 'node:child_process';
|
|
8
|
+
/**
|
|
9
|
+
* Invoke a Claude Code session with the given prompt.
|
|
10
|
+
*
|
|
11
|
+
* Pipes the prompt to stdin and streams stdout/stderr live.
|
|
12
|
+
* Uses `--dangerously-skip-permissions` for autonomous operation.
|
|
13
|
+
*
|
|
14
|
+
* @param prompt - The full implementation prompt.
|
|
15
|
+
* @param model - Optional model override (e.g., `'opus'`, `'sonnet'`).
|
|
16
|
+
* @returns `true` if Claude exited successfully (code 0), `false` otherwise.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* invokeClaudeSession('You are implementing PROJ-123...', 'opus');
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function invokeClaudeSession(prompt, model) {
|
|
24
|
+
const args = ['--dangerously-skip-permissions'];
|
|
25
|
+
if (model) {
|
|
26
|
+
args.push('--model', model);
|
|
27
|
+
}
|
|
28
|
+
const result = spawnSync('claude', args, {
|
|
29
|
+
input: prompt,
|
|
30
|
+
stdio: ['pipe', 'inherit', 'inherit'],
|
|
31
|
+
encoding: 'utf8',
|
|
32
|
+
});
|
|
33
|
+
return result.status === 0 && !result.error;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=claude-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-cli.js","sourceRoot":"","sources":["../../../../src/scripts/shared/claude-cli/claude-cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,KAAc;IAChE,MAAM,IAAI,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAEhD,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE;QACvC,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC;QACrC,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a .env file content string into a key-value record.
|
|
3
|
+
*
|
|
4
|
+
* Handles single-quoted, double-quoted, and unquoted values.
|
|
5
|
+
* Ignores blank lines and lines starting with `#`.
|
|
6
|
+
*
|
|
7
|
+
* @param content - The raw .env file content.
|
|
8
|
+
* @returns A record of environment variable key-value pairs.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* parseEnvContent('JIRA_BASE_URL=https://example.atlassian.net\nJIRA_USER=user@example.com');
|
|
13
|
+
* // { JIRA_BASE_URL: 'https://example.atlassian.net', JIRA_USER: 'user@example.com' }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseEnvContent(content: string): Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Load environment variables from a `.clancy/.env` file.
|
|
19
|
+
*
|
|
20
|
+
* @param projectRoot - The root directory of the project containing `.clancy/`.
|
|
21
|
+
* @returns The parsed environment variables, or `undefined` if the file doesn't exist.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const env = loadClancyEnv('/path/to/project');
|
|
26
|
+
* // env?.JIRA_BASE_URL === 'https://example.atlassian.net'
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function loadClancyEnv(projectRoot: string): Record<string, string> | undefined;
|
|
30
|
+
//# sourceMappingURL=env-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-parser.d.ts","sourceRoot":"","sources":["../../../../src/scripts/shared/env-parser/env-parser.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4BvE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAQpC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clancy .env file parser.
|
|
3
|
+
*
|
|
4
|
+
* Reads key=value pairs from `.clancy/.env` files. Supports quoted values,
|
|
5
|
+
* comments, and blank lines. Does NOT use dotenv — zero dependencies.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
/**
|
|
10
|
+
* Parse a .env file content string into a key-value record.
|
|
11
|
+
*
|
|
12
|
+
* Handles single-quoted, double-quoted, and unquoted values.
|
|
13
|
+
* Ignores blank lines and lines starting with `#`.
|
|
14
|
+
*
|
|
15
|
+
* @param content - The raw .env file content.
|
|
16
|
+
* @returns A record of environment variable key-value pairs.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* parseEnvContent('JIRA_BASE_URL=https://example.atlassian.net\nJIRA_USER=user@example.com');
|
|
21
|
+
* // { JIRA_BASE_URL: 'https://example.atlassian.net', JIRA_USER: 'user@example.com' }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function parseEnvContent(content) {
|
|
25
|
+
const env = {};
|
|
26
|
+
for (const line of content.split('\n')) {
|
|
27
|
+
const trimmed = line.trim();
|
|
28
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
29
|
+
continue;
|
|
30
|
+
const eqIndex = trimmed.indexOf('=');
|
|
31
|
+
if (eqIndex === -1)
|
|
32
|
+
continue;
|
|
33
|
+
const key = trimmed.slice(0, eqIndex).trim();
|
|
34
|
+
let value = trimmed.slice(eqIndex + 1).trim();
|
|
35
|
+
// Strip surrounding quotes (minimum 2 chars to avoid stripping a lone quote)
|
|
36
|
+
if (value.length >= 2 &&
|
|
37
|
+
((value.startsWith('"') && value.endsWith('"')) ||
|
|
38
|
+
(value.startsWith("'") && value.endsWith("'")))) {
|
|
39
|
+
value = value.slice(1, -1);
|
|
40
|
+
}
|
|
41
|
+
env[key] = value;
|
|
42
|
+
}
|
|
43
|
+
return env;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Load environment variables from a `.clancy/.env` file.
|
|
47
|
+
*
|
|
48
|
+
* @param projectRoot - The root directory of the project containing `.clancy/`.
|
|
49
|
+
* @returns The parsed environment variables, or `undefined` if the file doesn't exist.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const env = loadClancyEnv('/path/to/project');
|
|
54
|
+
* // env?.JIRA_BASE_URL === 'https://example.atlassian.net'
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export function loadClancyEnv(projectRoot) {
|
|
58
|
+
const envPath = join(projectRoot, '.clancy', '.env');
|
|
59
|
+
if (!existsSync(envPath))
|
|
60
|
+
return undefined;
|
|
61
|
+
const content = readFileSync(envPath, 'utf8');
|
|
62
|
+
return parseEnvContent(content);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=env-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-parser.js","sourceRoot":"","sources":["../../../../src/scripts/shared/env-parser/env-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,MAAM,GAAG,GAA2B,EAAE,CAAC;IAEvC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAE5B,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAElD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAErC,IAAI,OAAO,KAAK,CAAC,CAAC;YAAE,SAAS;QAE7B,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7C,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAE9C,6EAA6E;QAC7E,IACE,KAAK,CAAC,MAAM,IAAI,CAAC;YACjB,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAC7C,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EACjD,CAAC;YACD,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;QAED,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,WAAmB;IAEnB,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAErD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAE3C,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAE9C,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Board detection from raw `.clancy/.env` variables.
|
|
3
|
+
*
|
|
4
|
+
* Validates env vars against Zod schemas and returns a typed
|
|
5
|
+
* discriminated union for the detected board provider.
|
|
6
|
+
*/
|
|
7
|
+
import type { BoardConfig } from '../../../schemas/env.js';
|
|
8
|
+
export type { BoardConfig, GitHubEnv, JiraEnv, LinearEnv, SharedEnv, } from '../../../schemas/env.js';
|
|
9
|
+
/**
|
|
10
|
+
* Detect which board is configured from raw env vars and return a typed config.
|
|
11
|
+
*
|
|
12
|
+
* Detection priority: Jira → GitHub → Linear (checked by presence of
|
|
13
|
+
* board-specific required keys). Returns the first match.
|
|
14
|
+
*
|
|
15
|
+
* @param raw - The raw key-value record from `.clancy/.env`.
|
|
16
|
+
* @returns A typed `BoardConfig` or an error string if no board is detected
|
|
17
|
+
* or validation fails.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const result = detectBoard({ GITHUB_TOKEN: 'ghp_xxx', GITHUB_REPO: 'acme/app' });
|
|
22
|
+
* if (typeof result === 'string') console.error(result);
|
|
23
|
+
* else console.log(result.provider); // 'github'
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function detectBoard(raw: Record<string, string>): BoardConfig | string;
|
|
27
|
+
//# sourceMappingURL=env-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-schema.d.ts","sourceRoot":"","sources":["../../../../src/scripts/shared/env-schema/env-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQpD,YAAY,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,WAAW,GAAG,MAAM,CAmC7E"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { githubEnvSchema, jiraEnvSchema, linearEnvSchema, } from '../../../schemas/env.js';
|
|
2
|
+
/**
|
|
3
|
+
* Detect which board is configured from raw env vars and return a typed config.
|
|
4
|
+
*
|
|
5
|
+
* Detection priority: Jira → GitHub → Linear (checked by presence of
|
|
6
|
+
* board-specific required keys). Returns the first match.
|
|
7
|
+
*
|
|
8
|
+
* @param raw - The raw key-value record from `.clancy/.env`.
|
|
9
|
+
* @returns A typed `BoardConfig` or an error string if no board is detected
|
|
10
|
+
* or validation fails.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const result = detectBoard({ GITHUB_TOKEN: 'ghp_xxx', GITHUB_REPO: 'acme/app' });
|
|
15
|
+
* if (typeof result === 'string') console.error(result);
|
|
16
|
+
* else console.log(result.provider); // 'github'
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export function detectBoard(raw) {
|
|
20
|
+
// Jira — check for JIRA_BASE_URL as the distinguishing key
|
|
21
|
+
if (raw.JIRA_BASE_URL) {
|
|
22
|
+
const parsed = jiraEnvSchema.safeParse(raw);
|
|
23
|
+
if (!parsed.success) {
|
|
24
|
+
return `✗ Jira env validation failed: ${parsed.error.message}`;
|
|
25
|
+
}
|
|
26
|
+
return { provider: 'jira', env: parsed.data };
|
|
27
|
+
}
|
|
28
|
+
// GitHub — check for GITHUB_TOKEN as the distinguishing key
|
|
29
|
+
if (raw.GITHUB_TOKEN) {
|
|
30
|
+
const parsed = githubEnvSchema.safeParse(raw);
|
|
31
|
+
if (!parsed.success) {
|
|
32
|
+
return `✗ GitHub env validation failed: ${parsed.error.message}`;
|
|
33
|
+
}
|
|
34
|
+
return { provider: 'github', env: parsed.data };
|
|
35
|
+
}
|
|
36
|
+
// Linear — check for LINEAR_API_KEY as the distinguishing key
|
|
37
|
+
if (raw.LINEAR_API_KEY) {
|
|
38
|
+
const parsed = linearEnvSchema.safeParse(raw);
|
|
39
|
+
if (!parsed.success) {
|
|
40
|
+
return `✗ Linear env validation failed: ${parsed.error.message}`;
|
|
41
|
+
}
|
|
42
|
+
return { provider: 'linear', env: parsed.data };
|
|
43
|
+
}
|
|
44
|
+
return '✗ No board detected — set Jira, GitHub, or Linear credentials in .clancy/.env';
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=env-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-schema.js","sourceRoot":"","sources":["../../../../src/scripts/shared/env-schema/env-schema.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAW1B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAAC,GAA2B;IACrD,2DAA2D;IAC3D,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAE5C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,iCAAiC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACjE,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAChD,CAAC;IAED,4DAA4D;IAC5D,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,mCAAmC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnE,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAClD,CAAC;IAED,8DAA8D;IAC9D,IAAI,GAAG,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,mCAAmC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnE,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAClD,CAAC;IAED,OAAO,+EAA+E,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the name of the currently checked-out branch.
|
|
3
|
+
*
|
|
4
|
+
* @returns The current branch name.
|
|
5
|
+
*/
|
|
6
|
+
export declare function currentBranch(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Check whether the working directory has uncommitted changes.
|
|
9
|
+
*
|
|
10
|
+
* @returns `true` if there are staged or unstaged changes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function hasUncommittedChanges(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Check whether a local branch exists.
|
|
15
|
+
*
|
|
16
|
+
* @param branch - The branch name to check.
|
|
17
|
+
* @returns `true` if the branch exists locally.
|
|
18
|
+
*/
|
|
19
|
+
export declare function branchExists(branch: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Create a branch from a base branch if it doesn't already exist.
|
|
22
|
+
*
|
|
23
|
+
* @param branch - The branch name to create.
|
|
24
|
+
* @param baseBranch - The base branch to create from.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ensureBranch(branch: string, baseBranch: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Check out a branch. Uses `-B` flag to force-create if needed.
|
|
29
|
+
*
|
|
30
|
+
* @param branch - The branch name to check out.
|
|
31
|
+
* @param force - If `true`, uses `-B` to force-create/reset the branch.
|
|
32
|
+
*/
|
|
33
|
+
export declare function checkout(branch: string, force?: boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* Squash merge a source branch into the currently checked-out branch
|
|
36
|
+
* and commit with the given message.
|
|
37
|
+
*
|
|
38
|
+
* @param sourceBranch - The branch to squash merge from.
|
|
39
|
+
* @param commitMessage - The commit message for the squash merge.
|
|
40
|
+
* @returns `true` if changes were committed, `false` if there was nothing to commit.
|
|
41
|
+
*/
|
|
42
|
+
export declare function squashMerge(sourceBranch: string, commitMessage: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Delete a local branch (force).
|
|
45
|
+
*
|
|
46
|
+
* Uses `-D` because squash merges leave the branch in an "unmerged" state
|
|
47
|
+
* from git's perspective, causing `-d` to fail.
|
|
48
|
+
*
|
|
49
|
+
* @param branch - The branch name to delete.
|
|
50
|
+
*/
|
|
51
|
+
export declare function deleteBranch(branch: string): void;
|
|
52
|
+
//# sourceMappingURL=git-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-ops.d.ts","sourceRoot":"","sources":["../../../../src/scripts/shared/git-ops/git-ops.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAQ/C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAapD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAIrE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,IAAI,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,GACpB,OAAO,CAUT;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEjD"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git operations shared across board scripts.
|
|
3
|
+
*
|
|
4
|
+
* Wraps common git commands used during the ticket lifecycle:
|
|
5
|
+
* branch creation, checkout, squash merge, and cleanup.
|
|
6
|
+
*/
|
|
7
|
+
import { execFileSync } from 'node:child_process';
|
|
8
|
+
/**
|
|
9
|
+
* Run a git command and return trimmed stdout.
|
|
10
|
+
*
|
|
11
|
+
* @param args - The git sub-command and its arguments.
|
|
12
|
+
* @returns The trimmed stdout output.
|
|
13
|
+
*/
|
|
14
|
+
function git(...args) {
|
|
15
|
+
return execFileSync('git', args, { encoding: 'utf8' }).trim();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get the name of the currently checked-out branch.
|
|
19
|
+
*
|
|
20
|
+
* @returns The current branch name.
|
|
21
|
+
*/
|
|
22
|
+
export function currentBranch() {
|
|
23
|
+
return git('rev-parse', '--abbrev-ref', 'HEAD');
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check whether the working directory has uncommitted changes.
|
|
27
|
+
*
|
|
28
|
+
* @returns `true` if there are staged or unstaged changes.
|
|
29
|
+
*/
|
|
30
|
+
export function hasUncommittedChanges() {
|
|
31
|
+
try {
|
|
32
|
+
execFileSync('git', ['diff', '--quiet'], { stdio: 'ignore' });
|
|
33
|
+
execFileSync('git', ['diff', '--cached', '--quiet'], { stdio: 'ignore' });
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check whether a local branch exists.
|
|
42
|
+
*
|
|
43
|
+
* @param branch - The branch name to check.
|
|
44
|
+
* @returns `true` if the branch exists locally.
|
|
45
|
+
*/
|
|
46
|
+
export function branchExists(branch) {
|
|
47
|
+
try {
|
|
48
|
+
execFileSync('git', ['show-ref', '--verify', '--quiet', `refs/heads/${branch}`], {
|
|
49
|
+
stdio: 'ignore',
|
|
50
|
+
});
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a branch from a base branch if it doesn't already exist.
|
|
59
|
+
*
|
|
60
|
+
* @param branch - The branch name to create.
|
|
61
|
+
* @param baseBranch - The base branch to create from.
|
|
62
|
+
*/
|
|
63
|
+
export function ensureBranch(branch, baseBranch) {
|
|
64
|
+
if (!branchExists(branch)) {
|
|
65
|
+
git('checkout', '-b', branch, baseBranch);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Check out a branch. Uses `-B` flag to force-create if needed.
|
|
70
|
+
*
|
|
71
|
+
* @param branch - The branch name to check out.
|
|
72
|
+
* @param force - If `true`, uses `-B` to force-create/reset the branch.
|
|
73
|
+
*/
|
|
74
|
+
export function checkout(branch, force = false) {
|
|
75
|
+
git('checkout', ...(force ? ['-B'] : []), branch);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Squash merge a source branch into the currently checked-out branch
|
|
79
|
+
* and commit with the given message.
|
|
80
|
+
*
|
|
81
|
+
* @param sourceBranch - The branch to squash merge from.
|
|
82
|
+
* @param commitMessage - The commit message for the squash merge.
|
|
83
|
+
* @returns `true` if changes were committed, `false` if there was nothing to commit.
|
|
84
|
+
*/
|
|
85
|
+
export function squashMerge(sourceBranch, commitMessage) {
|
|
86
|
+
git('merge', '--squash', sourceBranch);
|
|
87
|
+
try {
|
|
88
|
+
execFileSync('git', ['diff', '--cached', '--quiet'], { stdio: 'ignore' });
|
|
89
|
+
return false; // nothing staged
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
execFileSync('git', ['commit', '-m', commitMessage], { encoding: 'utf8' });
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Delete a local branch (force).
|
|
98
|
+
*
|
|
99
|
+
* Uses `-D` because squash merges leave the branch in an "unmerged" state
|
|
100
|
+
* from git's perspective, causing `-d` to fail.
|
|
101
|
+
*
|
|
102
|
+
* @param branch - The branch name to delete.
|
|
103
|
+
*/
|
|
104
|
+
export function deleteBranch(branch) {
|
|
105
|
+
git('branch', '-D', branch);
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=git-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-ops.js","sourceRoot":"","sources":["../../../../src/scripts/shared/git-ops/git-ops.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;GAKG;AACH,SAAS,GAAG,CAAC,GAAG,IAAc;IAC5B,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAChE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,GAAG,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,IAAI,CAAC;QACH,YAAY,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC9D,YAAY,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC1E,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,IAAI,CAAC;QACH,YAAY,CACV,KAAK,EACL,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,MAAM,EAAE,CAAC,EAC3D;YACE,KAAK,EAAE,QAAQ;SAChB,CACF,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CA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ilerplate across Jira, GitHub, and Linear integrations.
|
|
6
|
+
*/
|
|
7
|
+
/** Standard error messages mapped to HTTP status codes. */
|
|
8
|
+
type StatusErrorMap = Record<number, string>;
|
|
9
|
+
/** Result from a ping or connectivity check. */
|
|
10
|
+
export type PingResult = {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Ping an API endpoint and map common HTTP error codes to messages.
|
|
16
|
+
*
|
|
17
|
+
* Returns `{ ok: true }` on success, or `{ ok: false, error }` with
|
|
18
|
+
* a human-readable message on failure.
|
|
19
|
+
*
|
|
20
|
+
* @param url - The URL to ping.
|
|
21
|
+
* @param headers - HTTP headers to send.
|
|
22
|
+
* @param statusErrors - Map of HTTP status codes to error messages.
|
|
23
|
+
* @param networkError - Error message for network failures.
|
|
24
|
+
* @returns A ping result with `ok` and optional `error`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const result = await pingEndpoint(
|
|
29
|
+
* 'https://api.github.com/repos/owner/repo',
|
|
30
|
+
* { Authorization: 'Bearer tok_xxx' },
|
|
31
|
+
* { 401: '✗ Auth failed', 404: '✗ Not found' },
|
|
32
|
+
* '✗ Could not reach GitHub',
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function pingEndpoint(url: string, headers: Record<string, string>, statusErrors: StatusErrorMap, networkError: string): Promise<PingResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Build standard GitHub API request headers.
|
|
39
|
+
*
|
|
40
|
+
* @param token - The GitHub personal access token.
|
|
41
|
+
* @returns Headers object for GitHub REST API requests.
|
|
42
|
+
*/
|
|
43
|
+
export declare function githubHeaders(token: string): Record<string, string>;
|
|
44
|
+
/**
|
|
45
|
+
* Build standard Jira API request headers.
|
|
46
|
+
*
|
|
47
|
+
* @param auth - The Base64-encoded Basic auth string.
|
|
48
|
+
* @returns Headers object for Jira REST API requests.
|
|
49
|
+
*/
|
|
50
|
+
export declare function jiraHeaders(auth: string): Record<string, string>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/scripts/shared/http/http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,2DAA2D;AAC3D,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE7C,gDAAgD;AAChD,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,YAAY,EAAE,cAAc,EAC5B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,UAAU,CAAC,CAqBrB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMnE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKhE"}
|