@intentsolutions/blueprint 2.2.0 → 2.4.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/dist/cli.js +360 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/github/action.d.ts +27 -0
- package/dist/integrations/github/action.d.ts.map +1 -0
- package/dist/integrations/github/action.js +151 -0
- package/dist/integrations/github/action.js.map +1 -0
- package/dist/integrations/github/client.d.ts +78 -0
- package/dist/integrations/github/client.d.ts.map +1 -0
- package/dist/integrations/github/client.js +279 -0
- package/dist/integrations/github/client.js.map +1 -0
- package/dist/integrations/github/exporter.d.ts +53 -0
- package/dist/integrations/github/exporter.d.ts.map +1 -0
- package/dist/integrations/github/exporter.js +387 -0
- package/dist/integrations/github/exporter.js.map +1 -0
- package/dist/integrations/github/index.d.ts +10 -0
- package/dist/integrations/github/index.d.ts.map +1 -0
- package/dist/integrations/github/index.js +9 -0
- package/dist/integrations/github/index.js.map +1 -0
- package/dist/integrations/github/types.d.ts +70 -0
- package/dist/integrations/github/types.d.ts.map +1 -0
- package/dist/integrations/github/types.js +63 -0
- package/dist/integrations/github/types.js.map +1 -0
- package/dist/integrations/linear/client.d.ts +94 -0
- package/dist/integrations/linear/client.d.ts.map +1 -0
- package/dist/integrations/linear/client.js +398 -0
- package/dist/integrations/linear/client.js.map +1 -0
- package/dist/integrations/linear/exporter.d.ts +80 -0
- package/dist/integrations/linear/exporter.d.ts.map +1 -0
- package/dist/integrations/linear/exporter.js +438 -0
- package/dist/integrations/linear/exporter.js.map +1 -0
- package/dist/integrations/linear/index.d.ts +9 -0
- package/dist/integrations/linear/index.d.ts.map +1 -0
- package/dist/integrations/linear/index.js +8 -0
- package/dist/integrations/linear/index.js.map +1 -0
- package/dist/integrations/linear/types.d.ts +137 -0
- package/dist/integrations/linear/types.d.ts.map +1 -0
- package/dist/integrations/linear/types.js +40 -0
- package/dist/integrations/linear/types.js.map +1 -0
- package/dist/mcp/index.js +0 -0
- package/package.json +2 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Action Generator
|
|
3
|
+
* Generates GitHub Action workflows for Blueprint integration
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Generate GitHub Action workflow for doc generation
|
|
7
|
+
*/
|
|
8
|
+
export function generateDocGenAction(config) {
|
|
9
|
+
const triggers = [];
|
|
10
|
+
if (config.onPush) {
|
|
11
|
+
triggers.push(` push:
|
|
12
|
+
branches: [main]
|
|
13
|
+
paths:
|
|
14
|
+
- 'docs/**'
|
|
15
|
+
- '.github/workflows/blueprint-*.yml'`);
|
|
16
|
+
}
|
|
17
|
+
if (config.onPR) {
|
|
18
|
+
triggers.push(` pull_request:
|
|
19
|
+
branches: [main]`);
|
|
20
|
+
}
|
|
21
|
+
if (config.onSchedule) {
|
|
22
|
+
triggers.push(` schedule:
|
|
23
|
+
- cron: '${config.onSchedule}'`);
|
|
24
|
+
}
|
|
25
|
+
triggers.push(` workflow_dispatch:
|
|
26
|
+
inputs:
|
|
27
|
+
scope:
|
|
28
|
+
description: 'Documentation scope'
|
|
29
|
+
required: false
|
|
30
|
+
default: '${config.scope}'
|
|
31
|
+
type: choice
|
|
32
|
+
options:
|
|
33
|
+
- mvp
|
|
34
|
+
- standard
|
|
35
|
+
- comprehensive`);
|
|
36
|
+
return `# Intent Blueprint Documentation Generator
|
|
37
|
+
# Automatically generates and updates project documentation
|
|
38
|
+
|
|
39
|
+
name: Blueprint Docs
|
|
40
|
+
|
|
41
|
+
on:
|
|
42
|
+
${triggers.join('\n')}
|
|
43
|
+
|
|
44
|
+
jobs:
|
|
45
|
+
generate-docs:
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
permissions:
|
|
48
|
+
contents: write
|
|
49
|
+
issues: write
|
|
50
|
+
|
|
51
|
+
steps:
|
|
52
|
+
- name: Checkout
|
|
53
|
+
uses: actions/checkout@v4
|
|
54
|
+
|
|
55
|
+
- name: Setup Node.js
|
|
56
|
+
uses: actions/setup-node@v4
|
|
57
|
+
with:
|
|
58
|
+
node-version: '20'
|
|
59
|
+
|
|
60
|
+
- name: Generate Documentation
|
|
61
|
+
run: |
|
|
62
|
+
npx @intentsolutions/blueprint generate \\
|
|
63
|
+
--name "${config.projectName}" \\
|
|
64
|
+
--description "Auto-generated documentation" \\
|
|
65
|
+
--scope \${{ inputs.scope || '${config.scope}' }} \\
|
|
66
|
+
--audience "${config.audience}" \\
|
|
67
|
+
--output "${config.outputDir || 'docs'}"
|
|
68
|
+
|
|
69
|
+
- name: Commit Changes
|
|
70
|
+
uses: stefanzweifel/git-auto-commit-action@v5
|
|
71
|
+
with:
|
|
72
|
+
commit_message: "docs: update Blueprint documentation"
|
|
73
|
+
file_pattern: "${config.outputDir || 'docs'}/**"
|
|
74
|
+
${config.createIssues ? `
|
|
75
|
+
- name: Export to Issues
|
|
76
|
+
if: github.event_name == 'workflow_dispatch'
|
|
77
|
+
env:
|
|
78
|
+
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
79
|
+
run: |
|
|
80
|
+
npx @intentsolutions/blueprint export github \\
|
|
81
|
+
--project "${config.projectName}" \\
|
|
82
|
+
--token "\$GITHUB_TOKEN" \\
|
|
83
|
+
--owner "\${{ github.repository_owner }}" \\
|
|
84
|
+
--repo "\${{ github.event.repository.name }}"
|
|
85
|
+
` : ''}`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Generate GitHub Action for doc sync on PR
|
|
89
|
+
*/
|
|
90
|
+
export function generatePRSyncAction(config) {
|
|
91
|
+
return `# Intent Blueprint PR Documentation Check
|
|
92
|
+
# Validates documentation is up-to-date on PRs
|
|
93
|
+
|
|
94
|
+
name: Blueprint PR Check
|
|
95
|
+
|
|
96
|
+
on:
|
|
97
|
+
pull_request:
|
|
98
|
+
branches: [main]
|
|
99
|
+
|
|
100
|
+
jobs:
|
|
101
|
+
check-docs:
|
|
102
|
+
runs-on: ubuntu-latest
|
|
103
|
+
|
|
104
|
+
steps:
|
|
105
|
+
- name: Checkout
|
|
106
|
+
uses: actions/checkout@v4
|
|
107
|
+
|
|
108
|
+
- name: Setup Node.js
|
|
109
|
+
uses: actions/setup-node@v4
|
|
110
|
+
with:
|
|
111
|
+
node-version: '20'
|
|
112
|
+
|
|
113
|
+
- name: Check Documentation
|
|
114
|
+
run: |
|
|
115
|
+
# Generate docs to temp directory
|
|
116
|
+
npx @intentsolutions/blueprint generate \\
|
|
117
|
+
--name "${config.projectName}" \\
|
|
118
|
+
--description "Documentation check" \\
|
|
119
|
+
--scope "${config.scope}" \\
|
|
120
|
+
--output ".blueprint-check"
|
|
121
|
+
|
|
122
|
+
# Compare with existing docs
|
|
123
|
+
if [ -d "${config.outputDir || 'docs'}" ]; then
|
|
124
|
+
diff -r "${config.outputDir || 'docs'}" ".blueprint-check" || echo "Documentation may need updating"
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
rm -rf .blueprint-check
|
|
128
|
+
|
|
129
|
+
- name: Comment on PR
|
|
130
|
+
uses: actions/github-script@v7
|
|
131
|
+
if: failure()
|
|
132
|
+
with:
|
|
133
|
+
script: |
|
|
134
|
+
github.rest.issues.createComment({
|
|
135
|
+
issue_number: context.issue.number,
|
|
136
|
+
owner: context.repo.owner,
|
|
137
|
+
repo: context.repo.repo,
|
|
138
|
+
body: '📄 **Intent Blueprint**: Documentation may be out of date. Consider regenerating with \`npx @intentsolutions/blueprint generate\`'
|
|
139
|
+
})
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Generate all Blueprint GitHub Actions
|
|
144
|
+
*/
|
|
145
|
+
export function generateAllActions(config) {
|
|
146
|
+
return {
|
|
147
|
+
'blueprint-generate.yml': generateDocGenAction(config),
|
|
148
|
+
'blueprint-pr-check.yml': generatePRSyncAction(config),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/integrations/github/action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAoB;IACvD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,QAAQ,CAAC,IAAI,CAAC;;;;4CAI0B,CAAC,CAAC;IAC5C,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,QAAQ,CAAC,IAAI,CAAC;qBACG,CAAC,CAAC;IACrB,CAAC;IAED,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC;eACH,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC;;;;;oBAKI,MAAM,CAAC,KAAK;;;;;0BAKN,CAAC,CAAC;IAE1B,OAAO;;;;;;EAMP,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;sBAqBC,MAAM,CAAC,WAAW;;4CAEI,MAAM,CAAC,KAAK;0BAC9B,MAAM,CAAC,QAAQ;wBACjB,MAAM,CAAC,SAAS,IAAI,MAAM;;;;;;2BAMvB,MAAM,CAAC,SAAS,IAAI,MAAM;EACnD,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;;;;;;;yBAOC,MAAM,CAAC,WAAW;;;;CAI1C,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACT,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAoB;IACvD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;sBA0Ba,MAAM,CAAC,WAAW;;uBAEjB,MAAM,CAAC,KAAK;;;;qBAId,MAAM,CAAC,SAAS,IAAI,MAAM;uBACxB,MAAM,CAAC,SAAS,IAAI,MAAM;;;;;;;;;;;;;;;;CAgBhD,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAoB;IACrD,OAAO;QACL,wBAAwB,EAAE,oBAAoB,CAAC,MAAM,CAAC;QACtD,wBAAwB,EAAE,oBAAoB,CAAC,MAAM,CAAC;KACvD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub API Client
|
|
3
|
+
* Handles all GitHub API interactions using Octokit
|
|
4
|
+
*/
|
|
5
|
+
import type { GitHubConfig, GitHubLabel, GitHubMilestone, GitHubIssue, TaskBreakdown, ReleasePhase } from './types.js';
|
|
6
|
+
export declare class GitHubClient {
|
|
7
|
+
private octokit;
|
|
8
|
+
private owner;
|
|
9
|
+
private repo;
|
|
10
|
+
constructor(config: GitHubConfig);
|
|
11
|
+
/**
|
|
12
|
+
* Verify connection and permissions
|
|
13
|
+
*/
|
|
14
|
+
verify(): Promise<{
|
|
15
|
+
valid: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Create or update labels
|
|
20
|
+
*/
|
|
21
|
+
ensureLabels(labels: GitHubLabel[]): Promise<{
|
|
22
|
+
created: number;
|
|
23
|
+
updated: number;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Create a milestone
|
|
27
|
+
*/
|
|
28
|
+
createMilestone(milestone: GitHubMilestone): Promise<number | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Find milestone by title
|
|
31
|
+
*/
|
|
32
|
+
findMilestone(title: string): Promise<number | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Create an issue
|
|
35
|
+
*/
|
|
36
|
+
createIssue(issue: GitHubIssue): Promise<{
|
|
37
|
+
number: number;
|
|
38
|
+
url: string;
|
|
39
|
+
} | null>;
|
|
40
|
+
/**
|
|
41
|
+
* Create multiple issues from task breakdown
|
|
42
|
+
*/
|
|
43
|
+
createIssuesFromTasks(tasks: TaskBreakdown[], options?: {
|
|
44
|
+
milestoneId?: number;
|
|
45
|
+
labelPrefix?: string;
|
|
46
|
+
}): Promise<Array<{
|
|
47
|
+
number: number;
|
|
48
|
+
url: string;
|
|
49
|
+
title: string;
|
|
50
|
+
}>>;
|
|
51
|
+
/**
|
|
52
|
+
* Format task body for GitHub issue
|
|
53
|
+
*/
|
|
54
|
+
private formatTaskBody;
|
|
55
|
+
/**
|
|
56
|
+
* Create milestones from release phases
|
|
57
|
+
*/
|
|
58
|
+
createMilestonesFromPhases(phases: ReleasePhase[]): Promise<Array<{
|
|
59
|
+
number: number;
|
|
60
|
+
title: string;
|
|
61
|
+
}>>;
|
|
62
|
+
/**
|
|
63
|
+
* Create PR templates
|
|
64
|
+
*/
|
|
65
|
+
createPRTemplates(templates: Array<{
|
|
66
|
+
name: string;
|
|
67
|
+
content: string;
|
|
68
|
+
}>): Promise<number>;
|
|
69
|
+
/**
|
|
70
|
+
* Get repository info
|
|
71
|
+
*/
|
|
72
|
+
getRepoInfo(): Promise<{
|
|
73
|
+
name: string;
|
|
74
|
+
url: string;
|
|
75
|
+
defaultBranch: string;
|
|
76
|
+
} | null>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/integrations/github/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,WAAW,EAGX,aAAa,EACb,YAAY,EACb,MAAM,YAAY,CAAC;AAOpB,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,IAAI,CAAS;gBAET,MAAM,EAAE,YAAY;IAShC;;OAEG;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AO,CAAC,MAAM,CAAC;IA0C7F;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAgB1F"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub API Client
|
|
3
|
+
* Handles all GitHub API interactions using Octokit
|
|
4
|
+
*/
|
|
5
|
+
import { Octokit } from '@octokit/rest';
|
|
6
|
+
import { CATEGORY_LABELS, PRIORITY_LABELS, } from './types.js';
|
|
7
|
+
export class GitHubClient {
|
|
8
|
+
octokit;
|
|
9
|
+
owner;
|
|
10
|
+
repo;
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.octokit = new Octokit({
|
|
13
|
+
auth: config.token,
|
|
14
|
+
baseUrl: config.baseUrl,
|
|
15
|
+
});
|
|
16
|
+
this.owner = config.owner;
|
|
17
|
+
this.repo = config.repo;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Verify connection and permissions
|
|
21
|
+
*/
|
|
22
|
+
async verify() {
|
|
23
|
+
try {
|
|
24
|
+
const { data } = await this.octokit.repos.get({
|
|
25
|
+
owner: this.owner,
|
|
26
|
+
repo: this.repo,
|
|
27
|
+
});
|
|
28
|
+
if (!data.permissions?.push) {
|
|
29
|
+
return { valid: false, error: 'No push access to repository' };
|
|
30
|
+
}
|
|
31
|
+
return { valid: true };
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return {
|
|
35
|
+
valid: false,
|
|
36
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create or update labels
|
|
42
|
+
*/
|
|
43
|
+
async ensureLabels(labels) {
|
|
44
|
+
let created = 0;
|
|
45
|
+
let updated = 0;
|
|
46
|
+
for (const label of labels) {
|
|
47
|
+
try {
|
|
48
|
+
await this.octokit.issues.createLabel({
|
|
49
|
+
owner: this.owner,
|
|
50
|
+
repo: this.repo,
|
|
51
|
+
name: label.name,
|
|
52
|
+
color: label.color,
|
|
53
|
+
description: label.description,
|
|
54
|
+
});
|
|
55
|
+
created++;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
// Label might already exist, try to update
|
|
59
|
+
if (error.status === 422) {
|
|
60
|
+
try {
|
|
61
|
+
await this.octokit.issues.updateLabel({
|
|
62
|
+
owner: this.owner,
|
|
63
|
+
repo: this.repo,
|
|
64
|
+
name: label.name,
|
|
65
|
+
color: label.color,
|
|
66
|
+
description: label.description,
|
|
67
|
+
});
|
|
68
|
+
updated++;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// Ignore update errors
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { created, updated };
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Create a milestone
|
|
80
|
+
*/
|
|
81
|
+
async createMilestone(milestone) {
|
|
82
|
+
try {
|
|
83
|
+
const { data } = await this.octokit.issues.createMilestone({
|
|
84
|
+
owner: this.owner,
|
|
85
|
+
repo: this.repo,
|
|
86
|
+
title: milestone.title,
|
|
87
|
+
description: milestone.description,
|
|
88
|
+
due_on: milestone.dueOn,
|
|
89
|
+
state: milestone.state || 'open',
|
|
90
|
+
});
|
|
91
|
+
return data.number;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
// Milestone might already exist
|
|
95
|
+
if (error.status === 422) {
|
|
96
|
+
const existing = await this.findMilestone(milestone.title);
|
|
97
|
+
return existing;
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Find milestone by title
|
|
104
|
+
*/
|
|
105
|
+
async findMilestone(title) {
|
|
106
|
+
try {
|
|
107
|
+
const { data } = await this.octokit.issues.listMilestones({
|
|
108
|
+
owner: this.owner,
|
|
109
|
+
repo: this.repo,
|
|
110
|
+
state: 'all',
|
|
111
|
+
});
|
|
112
|
+
const milestone = data.find((m) => m.title === title);
|
|
113
|
+
return milestone?.number || null;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Create an issue
|
|
121
|
+
*/
|
|
122
|
+
async createIssue(issue) {
|
|
123
|
+
try {
|
|
124
|
+
const { data } = await this.octokit.issues.create({
|
|
125
|
+
owner: this.owner,
|
|
126
|
+
repo: this.repo,
|
|
127
|
+
title: issue.title,
|
|
128
|
+
body: issue.body,
|
|
129
|
+
labels: issue.labels,
|
|
130
|
+
milestone: issue.milestone,
|
|
131
|
+
assignees: issue.assignees,
|
|
132
|
+
});
|
|
133
|
+
return { number: data.number, url: data.html_url };
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Create multiple issues from task breakdown
|
|
141
|
+
*/
|
|
142
|
+
async createIssuesFromTasks(tasks, options = {}) {
|
|
143
|
+
const results = [];
|
|
144
|
+
for (const task of tasks) {
|
|
145
|
+
const labels = ['blueprint', 'task'];
|
|
146
|
+
// Add priority label
|
|
147
|
+
if (task.priority && PRIORITY_LABELS[task.priority]) {
|
|
148
|
+
labels.push(PRIORITY_LABELS[task.priority].name);
|
|
149
|
+
}
|
|
150
|
+
// Add category label
|
|
151
|
+
if (task.category && CATEGORY_LABELS[task.category]) {
|
|
152
|
+
labels.push(CATEGORY_LABELS[task.category].name);
|
|
153
|
+
}
|
|
154
|
+
// Add prefix if specified
|
|
155
|
+
if (options.labelPrefix) {
|
|
156
|
+
labels.push(`${options.labelPrefix}:task`);
|
|
157
|
+
}
|
|
158
|
+
const body = this.formatTaskBody(task);
|
|
159
|
+
const result = await this.createIssue({
|
|
160
|
+
title: task.title,
|
|
161
|
+
body,
|
|
162
|
+
labels,
|
|
163
|
+
milestone: options.milestoneId,
|
|
164
|
+
});
|
|
165
|
+
if (result) {
|
|
166
|
+
results.push({ ...result, title: task.title });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return results;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Format task body for GitHub issue
|
|
173
|
+
*/
|
|
174
|
+
formatTaskBody(task) {
|
|
175
|
+
const lines = [];
|
|
176
|
+
lines.push('## Description');
|
|
177
|
+
lines.push(task.description);
|
|
178
|
+
lines.push('');
|
|
179
|
+
if (task.estimatedHours) {
|
|
180
|
+
lines.push(`**Estimated Time:** ${task.estimatedHours} hours`);
|
|
181
|
+
lines.push('');
|
|
182
|
+
}
|
|
183
|
+
if (task.dependencies && task.dependencies.length > 0) {
|
|
184
|
+
lines.push('## Dependencies');
|
|
185
|
+
for (const dep of task.dependencies) {
|
|
186
|
+
lines.push(`- [ ] ${dep}`);
|
|
187
|
+
}
|
|
188
|
+
lines.push('');
|
|
189
|
+
}
|
|
190
|
+
if (task.acceptanceCriteria && task.acceptanceCriteria.length > 0) {
|
|
191
|
+
lines.push('## Acceptance Criteria');
|
|
192
|
+
for (const ac of task.acceptanceCriteria) {
|
|
193
|
+
lines.push(`- [ ] ${ac}`);
|
|
194
|
+
}
|
|
195
|
+
lines.push('');
|
|
196
|
+
}
|
|
197
|
+
lines.push('---');
|
|
198
|
+
lines.push('*Generated by [Intent Blueprint](https://github.com/intent-solutions-io/intent-blueprint-docs)*');
|
|
199
|
+
return lines.join('\n');
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Create milestones from release phases
|
|
203
|
+
*/
|
|
204
|
+
async createMilestonesFromPhases(phases) {
|
|
205
|
+
const results = [];
|
|
206
|
+
for (const phase of phases) {
|
|
207
|
+
const milestoneId = await this.createMilestone({
|
|
208
|
+
title: phase.name,
|
|
209
|
+
description: phase.description,
|
|
210
|
+
dueOn: phase.endDate,
|
|
211
|
+
});
|
|
212
|
+
if (milestoneId) {
|
|
213
|
+
results.push({ number: milestoneId, title: phase.name });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return results;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Create PR templates
|
|
220
|
+
*/
|
|
221
|
+
async createPRTemplates(templates) {
|
|
222
|
+
let created = 0;
|
|
223
|
+
for (const template of templates) {
|
|
224
|
+
try {
|
|
225
|
+
const path = template.name === 'default'
|
|
226
|
+
? '.github/PULL_REQUEST_TEMPLATE.md'
|
|
227
|
+
: `.github/PULL_REQUEST_TEMPLATE/${template.name}.md`;
|
|
228
|
+
// Check if file exists
|
|
229
|
+
let sha;
|
|
230
|
+
try {
|
|
231
|
+
const { data } = await this.octokit.repos.getContent({
|
|
232
|
+
owner: this.owner,
|
|
233
|
+
repo: this.repo,
|
|
234
|
+
path,
|
|
235
|
+
});
|
|
236
|
+
if ('sha' in data) {
|
|
237
|
+
sha = data.sha;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
// File doesn't exist, that's fine
|
|
242
|
+
}
|
|
243
|
+
await this.octokit.repos.createOrUpdateFileContents({
|
|
244
|
+
owner: this.owner,
|
|
245
|
+
repo: this.repo,
|
|
246
|
+
path,
|
|
247
|
+
message: `docs: add ${template.name} PR template (Intent Blueprint)`,
|
|
248
|
+
content: Buffer.from(template.content).toString('base64'),
|
|
249
|
+
sha,
|
|
250
|
+
});
|
|
251
|
+
created++;
|
|
252
|
+
}
|
|
253
|
+
catch {
|
|
254
|
+
// Ignore errors for individual templates
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return created;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Get repository info
|
|
261
|
+
*/
|
|
262
|
+
async getRepoInfo() {
|
|
263
|
+
try {
|
|
264
|
+
const { data } = await this.octokit.repos.get({
|
|
265
|
+
owner: this.owner,
|
|
266
|
+
repo: this.repo,
|
|
267
|
+
});
|
|
268
|
+
return {
|
|
269
|
+
name: data.full_name,
|
|
270
|
+
url: data.html_url,
|
|
271
|
+
defaultBranch: data.default_branch,
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/integrations/github/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAWxC,OAAO,EACL,eAAe,EACf,eAAe,GAEhB,MAAM,YAAY,CAAC;AAEpB,MAAM,OAAO,YAAY;IACf,OAAO,CAAU;IACjB,KAAK,CAAS;IACd,IAAI,CAAS;IAErB,YAAY,MAAoB;QAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC;YACzB,IAAI,EAAE,MAAM,CAAC,KAAK;YAClB,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,IAAI,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;gBAC5C,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;gBAC5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,8BAA8B,EAAE,CAAC;YACjE,CAAC;Y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EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;gBAC5C,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;YAEH,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,SAAS;gBACpB,GAAG,EAAE,IAAI,CAAC,QAAQ;gBAClB,aAAa,EAAE,IAAI,CAAC,cAAc;aACnC,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Exporter
|
|
3
|
+
* Converts Blueprint documents to GitHub artifacts (issues, milestones, templates)
|
|
4
|
+
*/
|
|
5
|
+
import type { GitHubConfig, ExportResult, ExportOptions, TaskBreakdown, ReleasePhase, GitHubLabel } from './types.js';
|
|
6
|
+
import type { GeneratedDocument, TemplateContext } from '../../core/index.js';
|
|
7
|
+
export declare class GitHubExporter {
|
|
8
|
+
private client;
|
|
9
|
+
private options;
|
|
10
|
+
constructor(config: GitHubConfig, options?: ExportOptions);
|
|
11
|
+
/**
|
|
12
|
+
* Export generated documents to GitHub
|
|
13
|
+
*/
|
|
14
|
+
export(documents: GeneratedDocument[], context: TemplateContext): Promise<ExportResult>;
|
|
15
|
+
/**
|
|
16
|
+
* Get all labels to create
|
|
17
|
+
*/
|
|
18
|
+
private getAllLabels;
|
|
19
|
+
/**
|
|
20
|
+
* Extract tasks from generated documents
|
|
21
|
+
*/
|
|
22
|
+
private extractTasks;
|
|
23
|
+
/**
|
|
24
|
+
* Parse tasks from markdown content
|
|
25
|
+
*/
|
|
26
|
+
private parseTasksFromMarkdown;
|
|
27
|
+
/**
|
|
28
|
+
* Extract release phases from documents
|
|
29
|
+
*/
|
|
30
|
+
private extractPhases;
|
|
31
|
+
/**
|
|
32
|
+
* Parse release phases from markdown
|
|
33
|
+
*/
|
|
34
|
+
private parsePhasesFromMarkdown;
|
|
35
|
+
/**
|
|
36
|
+
* Generate PR templates based on project context
|
|
37
|
+
*/
|
|
38
|
+
private generatePRTemplates;
|
|
39
|
+
/**
|
|
40
|
+
* Preview what would be exported (dry run)
|
|
41
|
+
*/
|
|
42
|
+
preview(documents: GeneratedDocument[], context: TemplateContext): Promise<{
|
|
43
|
+
labels: GitHubLabel[];
|
|
44
|
+
tasks: TaskBreakdown[];
|
|
45
|
+
phases: ReleasePhase[];
|
|
46
|
+
prTemplates: string[];
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Quick export function
|
|
51
|
+
*/
|
|
52
|
+
export declare function exportToGitHub(config: GitHubConfig, documents: GeneratedDocument[], context: TemplateContext, options?: ExportOptions): Promise<ExportResult>;
|
|
53
|
+
//# sourceMappingURL=exporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/integrations/github/exporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AAMpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE9E,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,OAAO,CAAgB;gBAEnB,MAAM,EAAE,YAAY,EAAE,OAAO,GAAE,aAAkB;IAY7D;;OAEG;IACG,MAAM,CACV,SAAS,EAAE,iBAAiB,EAAE,EAC9B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,YAAY,CAAC;IAyExB;;OAEG;IACH,OAAO,CAAC,YAAY;IAyBpB;;OAEG;IACH,OAAO,CAAC,YAAY;IAiBpB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAuF9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