hale-commenting-system 3.8.5 → 3.8.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hale-commenting-system",
3
- "version": "3.8.5",
3
+ "version": "3.8.6",
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
  "homepage": "https://www.npmjs.com/package/hale-commenting-system",
6
6
  "repository": {
@@ -473,10 +473,10 @@ VITE_JIRA_BASE_URL=
473
473
  existing.includes('VITE_PROVIDER_TYPE');
474
474
 
475
475
  if (hasCommentingSystemConfig) {
476
- // Remove old commenting system section and replace with new one
476
+ // Remove ALL commenting system related lines and replace with new config
477
477
  const lines = existing.split('\n');
478
478
  let newLines = [];
479
- let inCommentingSection = false;
479
+ let skipUntilEmptyLine = false;
480
480
  let foundSection = false;
481
481
 
482
482
  for (let i = 0; i < lines.length; i++) {
@@ -484,7 +484,7 @@ VITE_JIRA_BASE_URL=
484
484
 
485
485
  // Detect start of commenting system section
486
486
  if (line.includes('Hale Commenting System')) {
487
- inCommentingSection = true;
487
+ skipUntilEmptyLine = true;
488
488
  foundSection = true;
489
489
  // Add the new content at this position
490
490
  newLines.push(...envContent.split('\n'));
@@ -492,33 +492,47 @@ VITE_JIRA_BASE_URL=
492
492
  }
493
493
 
494
494
  // Skip lines that are part of the commenting system config
495
- if (inCommentingSection) {
495
+ if (skipUntilEmptyLine) {
496
496
  // Check if this is still part of the commenting system section
497
497
  if (line.startsWith('VITE_GITHUB_') ||
498
498
  line.startsWith('VITE_GITLAB_') ||
499
499
  line.startsWith('VITE_PROVIDER_TYPE') ||
500
500
  line.startsWith('VITE_JIRA_BASE_URL') ||
501
- (line.startsWith('#') && (line.includes('GitHub') || line.includes('GitLab') || line.includes('Jira') || line.includes('Provider')))) {
501
+ (line.startsWith('#') && (line.includes('GitHub') || line.includes('GitLab') || line.includes('Jira') || line.includes('Provider') || line.includes('OAuth') || line.includes('Target')))) {
502
502
  // Still in commenting section, skip this line
503
503
  continue;
504
504
  }
505
505
 
506
506
  // Empty line after commenting section - skip it and exit section
507
507
  if (line.trim() === '') {
508
- inCommentingSection = false;
508
+ skipUntilEmptyLine = false;
509
+ // Don't add this empty line, we'll add one after our new content
509
510
  continue;
510
511
  }
511
512
 
512
513
  // Non-empty, non-commenting line - exit section and keep the line
513
- inCommentingSection = false;
514
+ skipUntilEmptyLine = false;
515
+ } else {
516
+ // Also check for standalone commenting system variables (in case header is missing)
517
+ if (line.startsWith('VITE_GITHUB_') ||
518
+ line.startsWith('VITE_GITLAB_') ||
519
+ line.startsWith('VITE_PROVIDER_TYPE') ||
520
+ (line.startsWith('VITE_JIRA_BASE_URL') && existing.includes('Hale Commenting System'))) {
521
+ // Skip standalone commenting system variables
522
+ continue;
523
+ }
514
524
  }
515
525
 
516
526
  // Keep lines that are not part of commenting system section
517
527
  newLines.push(line);
518
528
  }
519
529
 
520
- // If we didn't find the section marker, append to end
530
+ // If we didn't find the section marker but detected config, append to end
521
531
  if (!foundSection) {
532
+ // Remove any trailing empty lines
533
+ while (newLines.length > 0 && newLines[newLines.length - 1].trim() === '') {
534
+ newLines.pop();
535
+ }
522
536
  newLines.push('');
523
537
  newLines.push(...envContent.split('\n'));
524
538
  }