hale-commenting-system 2.2.9 â 2.2.92
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 +7 -7
- package/package.json +1 -1
- package/scripts/integrate.js +44 -10
- package/src/app/commenting-system/index.ts +6 -0
package/README.md
CHANGED
|
@@ -4,13 +4,13 @@ A commenting system for PatternFly React applications that allows designers and
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
7
|
+
- **Pin-based commenting** - Click anywhere on a page to add a comment pin
|
|
8
|
+
- **Thread discussions** - Organize comments into threads with replies
|
|
9
|
+
- **GitHub Integration** - Sync comments with GitHub Issues automatically
|
|
10
|
+
- **Jira Integration** - Link Jira tickets to specific pages or sections
|
|
11
|
+
- **PatternFly Design** - Built with PatternFly React components
|
|
12
|
+
- **Responsive** - Works on desktop and mobile devices
|
|
13
|
+
- **Easy Integration** - Automated setup script for seamless installation
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hale-commenting-system",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.92",
|
|
4
4
|
"description": "A commenting system for PatternFly React applications that allows designers and developers to add comments directly on design pages, sync with GitHub Issues, and link Jira tickets.",
|
|
5
5
|
"repository": "https://github.com/patternfly/patternfly-react-seed.git",
|
|
6
6
|
"homepage": "https://www.npmjs.com/package/hale-commenting-system",
|
package/scripts/integrate.js
CHANGED
|
@@ -1038,10 +1038,16 @@ function modifyIndexTsx(filePath) {
|
|
|
1038
1038
|
function modifyRoutesTsx(filePath) {
|
|
1039
1039
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
1040
1040
|
|
|
1041
|
-
// Check if Comments route already exists
|
|
1041
|
+
// Check if Comments route already exists with actual routes
|
|
1042
|
+
// Use a more sophisticated check that looks for the route path
|
|
1042
1043
|
if (content.includes("label: 'Comments'") || content.includes('label: "Comments"')) {
|
|
1043
|
-
|
|
1044
|
-
|
|
1044
|
+
// Check if it has routes with the /comments path
|
|
1045
|
+
if (content.includes("path: '/comments'") || content.includes('path: "/comments"')) {
|
|
1046
|
+
console.log(' â ī¸ Already integrated (Comments route found)');
|
|
1047
|
+
return false;
|
|
1048
|
+
}
|
|
1049
|
+
// If Comments group exists but has no routes, continue to add them
|
|
1050
|
+
console.log(' âšī¸ Comments group exists but has no routes, adding route...');
|
|
1045
1051
|
}
|
|
1046
1052
|
|
|
1047
1053
|
try {
|
|
@@ -1099,7 +1105,30 @@ function modifyRoutesTsx(filePath) {
|
|
|
1099
1105
|
ast.program.body.splice(importIndex, 0, commentsImport);
|
|
1100
1106
|
}
|
|
1101
1107
|
|
|
1102
|
-
//
|
|
1108
|
+
// Check if Comments route group already exists
|
|
1109
|
+
let existingCommentsGroup = null;
|
|
1110
|
+
let existingCommentsRoutes = null;
|
|
1111
|
+
|
|
1112
|
+
for (const element of routesArray.elements) {
|
|
1113
|
+
if (element.type === 'ObjectExpression') {
|
|
1114
|
+
const labelProp = element.properties.find(
|
|
1115
|
+
prop => prop.key && prop.key.name === 'label' &&
|
|
1116
|
+
prop.value && prop.value.value === 'Comments'
|
|
1117
|
+
);
|
|
1118
|
+
if (labelProp) {
|
|
1119
|
+
existingCommentsGroup = element;
|
|
1120
|
+
const routesProp = element.properties.find(
|
|
1121
|
+
prop => prop.key && prop.key.name === 'routes'
|
|
1122
|
+
);
|
|
1123
|
+
if (routesProp && routesProp.value.type === 'ArrayExpression') {
|
|
1124
|
+
existingCommentsRoutes = routesProp.value;
|
|
1125
|
+
}
|
|
1126
|
+
break;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
// Create the Comments route item
|
|
1103
1132
|
const commentsRouteElement = types.jsxElement(
|
|
1104
1133
|
types.jsxOpeningElement(types.jsxIdentifier(commentsImportName), [], true),
|
|
1105
1134
|
null,
|
|
@@ -1114,12 +1143,17 @@ function modifyRoutesTsx(filePath) {
|
|
|
1114
1143
|
types.objectProperty(types.identifier('title'), types.stringLiteral('Hale Commenting System | Comments'))
|
|
1115
1144
|
]);
|
|
1116
1145
|
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1146
|
+
if (existingCommentsGroup && existingCommentsRoutes) {
|
|
1147
|
+
// Add route to existing Comments group
|
|
1148
|
+
existingCommentsRoutes.elements.push(commentsRouteItem);
|
|
1149
|
+
} else {
|
|
1150
|
+
// Create new Comments route group
|
|
1151
|
+
const commentsRoute = types.objectExpression([
|
|
1152
|
+
types.objectProperty(types.identifier('label'), types.stringLiteral('Comments')),
|
|
1153
|
+
types.objectProperty(types.identifier('routes'), types.arrayExpression([commentsRouteItem]))
|
|
1154
|
+
]);
|
|
1155
|
+
routesArray.elements.push(commentsRoute);
|
|
1156
|
+
}
|
|
1123
1157
|
}
|
|
1124
1158
|
|
|
1125
1159
|
const output = generate(ast, {
|
|
@@ -6,6 +6,12 @@ export { GitHubAuthProvider, useGitHubAuth } from './contexts/GitHubAuthContext'
|
|
|
6
6
|
export { CommentOverlay } from './components/CommentOverlay';
|
|
7
7
|
export { CommentPin } from './components/CommentPin';
|
|
8
8
|
export { CommentPanel } from './components/CommentPanel';
|
|
9
|
+
export { DetailsTab } from './components/DetailsTab';
|
|
10
|
+
export { JiraTab } from './components/JiraTab';
|
|
11
|
+
export { FloatingWidget } from './components/FloatingWidget';
|
|
12
|
+
|
|
13
|
+
// Services
|
|
14
|
+
export { githubAdapter, isGitHubConfigured } from './services/githubAdapter';
|
|
9
15
|
|
|
10
16
|
// Types
|
|
11
17
|
export type { Comment, Thread, SyncStatus, ThreadStatus } from './types';
|