@polka-codes/github 0.7.9 → 0.7.10

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 ADDED
@@ -0,0 +1,78 @@
1
+ # Polka Codes GitHub
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@polka-codes/github.svg)](https://www.npmjs.com/package/@polka-codes/github)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@polka-codes/github.svg)](https://www.npmjs.com/package/@polka-codes/github)
5
+ [![License](https://img.shields.io/npm/l/@polka-codes/github.svg)](https://github.com/polkacodes/polkacodes/blob/main/LICENSE)
6
+
7
+ GitHub API integration module for Polka Codes framework.
8
+
9
+ ## Features
10
+
11
+ - Fetch GitHub issues with their details and comments
12
+ - Fetch GitHub pull requests with their details, diffs, comments, and reviews
13
+ - Process GitHub markdown content by removing HTML comments and Polka Codes specific markers
14
+ - GraphQL integration with GitHub API
15
+ - Markdown processing and transformation
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ bun add @polka-codes/github
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ### Fetching an Issue
26
+
27
+ ```typescript
28
+ import { fetchIssue } from '@polka-codes/github';
29
+ import { Octokit } from '@octokit/core';
30
+
31
+ const octokit = new Octokit({ auth: 'your-github-token' });
32
+
33
+ const issueText = await fetchIssue({
34
+ octokit,
35
+ owner: 'owner-name',
36
+ repo: 'repo-name',
37
+ issueNumber: 123
38
+ });
39
+
40
+ console.log(issueText);
41
+ ```
42
+
43
+ ### Fetching a Pull Request
44
+
45
+ ```typescript
46
+ import { fetchPR } from '@polka-codes/github';
47
+ import { Octokit } from '@octokit/core';
48
+
49
+ const octokit = new Octokit({ auth: 'your-github-token' });
50
+
51
+ const prText = await fetchPR({
52
+ octokit,
53
+ owner: 'owner-name',
54
+ repo: 'repo-name',
55
+ prNumber: 456
56
+ });
57
+
58
+ console.log(prText);
59
+ ```
60
+
61
+ ## Development
62
+
63
+ ### Building
64
+
65
+ ```bash
66
+ cd packages/github
67
+ bun run build
68
+ ```
69
+
70
+ ### Testing
71
+
72
+ ```bash
73
+ bun test
74
+ ```
75
+
76
+ ---
77
+
78
+ *This README was generated by polka.codes*
package/dist/index.js CHANGED
@@ -57,6 +57,9 @@ ${issueBody}
57
57
  continue;
58
58
  }
59
59
  const commentBody = await processBody(comment.body);
60
+ if (commentBody.trim().length === 0) {
61
+ continue;
62
+ }
60
63
  const author = comment.author?.login ?? "unknown";
61
64
  text += `${comment.createdAt} @${author}:
62
65
  ${commentBody}
@@ -102,6 +105,9 @@ ${diff.data}
102
105
  continue;
103
106
  }
104
107
  const commentBody = await processBody(comment.body);
108
+ if (commentBody.trim().length === 0) {
109
+ continue;
110
+ }
105
111
  const author = comment.author?.login ?? "unknown";
106
112
  text += `${comment.createdAt} @${author}:
107
113
  ${commentBody}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/github",
3
- "version": "0.7.9",
3
+ "version": "0.7.10",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "github@polka.codes",
6
6
  "type": "module",