hale-commenting-system 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +222 -0
- package/cli/dist/index.js +843 -0
- package/cli/dist/index.js.map +1 -0
- package/dist/index.d.mts +87 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +187 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +142 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# @apollo/commenting-system
|
|
2
|
+
|
|
3
|
+
A reusable React commenting system with GitHub/GitLab integration and AI-powered summarization.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 📌 **Visual Comment Pins** - Click anywhere to add comment threads
|
|
8
|
+
- 🔄 **GitHub/GitLab Sync** - Two-way sync with issue trackers
|
|
9
|
+
- 🤖 **AI Summarization** - Powered by DeepSeek R1 via MaaS
|
|
10
|
+
- 📦 **Version Management** - Track comments across prototype versions
|
|
11
|
+
- 🎨 **PatternFly UI** - Built with PatternFly React components
|
|
12
|
+
- 🧙 **CLI Wizard** - Automated setup with `npx apollo-comments init`
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @apollo/commenting-system
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
Run the interactive setup wizard:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx apollo-comments init
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This will:
|
|
29
|
+
- Detect your project type (React, PatternFly, Vite/Webpack)
|
|
30
|
+
- Prompt for GitHub OAuth credentials
|
|
31
|
+
- Generate serverless authentication functions
|
|
32
|
+
- Create environment files (.env.local, .env.example)
|
|
33
|
+
- Generate apollo-comments.config.json
|
|
34
|
+
- Provide integration instructions
|
|
35
|
+
|
|
36
|
+
## Manual Setup
|
|
37
|
+
|
|
38
|
+
### 1. Basic Setup
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import {
|
|
42
|
+
CommentProvider,
|
|
43
|
+
VersionProvider,
|
|
44
|
+
GitHubAuthProvider,
|
|
45
|
+
CommentOverlay,
|
|
46
|
+
CommentDrawer
|
|
47
|
+
} from '@apollo/commenting-system';
|
|
48
|
+
import apolloCommentsConfig from './apollo-comments.config.json';
|
|
49
|
+
import React from 'react';
|
|
50
|
+
|
|
51
|
+
function App() {
|
|
52
|
+
const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<GitHubAuthProvider config={apolloCommentsConfig}>
|
|
56
|
+
<VersionProvider>
|
|
57
|
+
<CommentProvider>
|
|
58
|
+
<CommentDrawer
|
|
59
|
+
selectedThreadId={selectedThreadId}
|
|
60
|
+
onThreadSelect={setSelectedThreadId}
|
|
61
|
+
>
|
|
62
|
+
<CommentOverlay
|
|
63
|
+
selectedThreadId={selectedThreadId}
|
|
64
|
+
onThreadSelect={setSelectedThreadId}
|
|
65
|
+
/>
|
|
66
|
+
{/* Your app content */}
|
|
67
|
+
</CommentDrawer>
|
|
68
|
+
</CommentProvider>
|
|
69
|
+
</VersionProvider>
|
|
70
|
+
</GitHubAuthProvider>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 2. API Configuration
|
|
76
|
+
|
|
77
|
+
The CLI generates serverless functions for GitHub OAuth. For manual setup, create:
|
|
78
|
+
|
|
79
|
+
**Vercel**: `/api/github-oauth-login.ts` and `/api/github-oauth-callback.ts`
|
|
80
|
+
**Netlify**: `/netlify/functions/github-oauth-login.ts` and `/netlify/functions/github-oauth-callback.ts`
|
|
81
|
+
|
|
82
|
+
See the [manual setup guide](https://github.com/apollo/commenting-system/blob/main/docs/manual-setup.md) for templates.
|
|
83
|
+
|
|
84
|
+
### 3. Environment Variables
|
|
85
|
+
|
|
86
|
+
```env
|
|
87
|
+
GITHUB_CLIENT_ID=your_github_client_id
|
|
88
|
+
GITHUB_CLIENT_SECRET=your_github_client_secret
|
|
89
|
+
GITHUB_OWNER=your_github_org
|
|
90
|
+
GITHUB_REPO=your_repo_name
|
|
91
|
+
|
|
92
|
+
# Vite (if using Vite)
|
|
93
|
+
VITE_GITHUB_CLIENT_ID=your_github_client_id
|
|
94
|
+
VITE_GITHUB_OWNER=your_github_org
|
|
95
|
+
VITE_GITHUB_REPO=your_repo_name
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## CLI Commands
|
|
99
|
+
|
|
100
|
+
### Initialize
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
apollo-comments init
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Options:
|
|
107
|
+
- `-y, --yes` - Skip prompts and use defaults
|
|
108
|
+
- `--platform <platform>` - Specify platform (vercel, netlify, manual)
|
|
109
|
+
|
|
110
|
+
### Validate
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
apollo-comments validate
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Checks your setup for:
|
|
117
|
+
- Configuration files
|
|
118
|
+
- Serverless functions
|
|
119
|
+
- GitHub connectivity
|
|
120
|
+
- Repository access
|
|
121
|
+
|
|
122
|
+
## Components
|
|
123
|
+
|
|
124
|
+
### Core Components
|
|
125
|
+
|
|
126
|
+
- **CommentOverlay** - Renders comment pins on the page
|
|
127
|
+
- **CommentDrawer** - Side panel for viewing/editing comments
|
|
128
|
+
- **CommentPin** - Individual comment pin component
|
|
129
|
+
- **AIAssistant** - AI chatbot toggle and panel
|
|
130
|
+
|
|
131
|
+
### Providers
|
|
132
|
+
|
|
133
|
+
- **CommentProvider** - Comment state and CRUD operations
|
|
134
|
+
- **VersionProvider** - Version management
|
|
135
|
+
- **GitHubAuthProvider** - GitHub authentication
|
|
136
|
+
- **GitLabAuthProvider** - GitLab authentication
|
|
137
|
+
- **AIProvider** - AI chat state and API calls
|
|
138
|
+
|
|
139
|
+
## Types
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import type {
|
|
143
|
+
Comment,
|
|
144
|
+
Thread,
|
|
145
|
+
SyncStatus,
|
|
146
|
+
AIMessage,
|
|
147
|
+
GitHubResult
|
|
148
|
+
} from '@apollo/commenting-system';
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Peer Dependencies
|
|
152
|
+
|
|
153
|
+
- @patternfly/react-core: ^6.0.0
|
|
154
|
+
- @patternfly/react-icons: ^6.0.0
|
|
155
|
+
- @patternfly/chatbot: ^6.0.0
|
|
156
|
+
- react: ^18.0.0
|
|
157
|
+
- react-dom: ^18.0.0
|
|
158
|
+
- react-router-dom: ^6.0.0 || ^7.0.0
|
|
159
|
+
|
|
160
|
+
## Configuration File
|
|
161
|
+
|
|
162
|
+
The CLI generates `apollo-comments.config.json`:
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"version": "1.0.0",
|
|
167
|
+
"platform": "vercel",
|
|
168
|
+
"github": {
|
|
169
|
+
"owner": "your-org",
|
|
170
|
+
"repo": "your-repo",
|
|
171
|
+
"clientId": "your-client-id"
|
|
172
|
+
},
|
|
173
|
+
"redirectUri": "https://your-domain.com/api/github-oauth-callback",
|
|
174
|
+
"features": {
|
|
175
|
+
"aiSummarization": true,
|
|
176
|
+
"versionTracking": true,
|
|
177
|
+
"gitlabIntegration": false
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Development
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Install dependencies
|
|
186
|
+
npm install
|
|
187
|
+
|
|
188
|
+
# Build library and CLI
|
|
189
|
+
npm run build
|
|
190
|
+
|
|
191
|
+
# Watch mode (library only)
|
|
192
|
+
npm run dev
|
|
193
|
+
|
|
194
|
+
# Type check
|
|
195
|
+
npm run type-check
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Testing the Package Locally
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
# In this package directory
|
|
202
|
+
npm link
|
|
203
|
+
|
|
204
|
+
# In your test project
|
|
205
|
+
npm link @apollo/commenting-system
|
|
206
|
+
apollo-comments init
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
MIT
|
|
212
|
+
|
|
213
|
+
## Author
|
|
214
|
+
|
|
215
|
+
Justin Hale
|
|
216
|
+
|
|
217
|
+
## Support
|
|
218
|
+
|
|
219
|
+
- [Documentation](https://github.com/apollo/commenting-system)
|
|
220
|
+
- [Issues](https://github.com/apollo/commenting-system/issues)
|
|
221
|
+
- [Discussions](https://github.com/apollo/commenting-system/discussions)
|
|
222
|
+
|