hale-commenting-system 1.0.1 → 1.0.2

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/cli/dist/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  // src/index.ts
4
4
  import { Command } from "commander";
5
- import chalk11 from "chalk";
5
+ import chalk12 from "chalk";
6
6
 
7
7
  // src/commands/init.ts
8
- import chalk9 from "chalk";
8
+ import chalk10 from "chalk";
9
9
  import ora from "ora";
10
10
  import inquirer3 from "inquirer";
11
11
 
@@ -602,6 +602,136 @@ async function generateConfig(githubConfig, platform, projectRoot) {
602
602
  console.log(chalk6.dim(" \u2192 Created apollo-comments.config.json"));
603
603
  }
604
604
 
605
+ // src/generators/code.ts
606
+ import path5 from "path";
607
+ import chalk7 from "chalk";
608
+ async function integrateProviders(projectRoot) {
609
+ const possiblePaths = [
610
+ "src/app/index.tsx",
611
+ "src/app/App.tsx",
612
+ "src/App.tsx",
613
+ "src/index.tsx"
614
+ ];
615
+ let appFilePath = null;
616
+ for (const p of possiblePaths) {
617
+ const fullPath = path5.join(projectRoot, p);
618
+ if (await fileExists(fullPath)) {
619
+ appFilePath = fullPath;
620
+ break;
621
+ }
622
+ }
623
+ if (!appFilePath) {
624
+ return {
625
+ success: false,
626
+ filePath: "",
627
+ message: "Could not find App entry point. Please integrate manually."
628
+ };
629
+ }
630
+ try {
631
+ const content = await readFile(appFilePath);
632
+ if (content.includes("hale-commenting-system") || content.includes("GitHubAuthProvider")) {
633
+ return {
634
+ success: false,
635
+ filePath: appFilePath,
636
+ message: "Providers already integrated or commenting system imports found."
637
+ };
638
+ }
639
+ const modifiedContent = injectProviders(content);
640
+ if (modifiedContent === content) {
641
+ return {
642
+ success: false,
643
+ filePath: appFilePath,
644
+ message: "Could not automatically integrate. File structure not recognized."
645
+ };
646
+ }
647
+ await writeFile(appFilePath, modifiedContent);
648
+ return {
649
+ success: true,
650
+ filePath: appFilePath,
651
+ message: `Successfully integrated providers into ${path5.relative(projectRoot, appFilePath)}`
652
+ };
653
+ } catch (error) {
654
+ return {
655
+ success: false,
656
+ filePath: appFilePath,
657
+ message: `Error: ${error.message}`
658
+ };
659
+ }
660
+ }
661
+ function injectProviders(content) {
662
+ const imports = `import {
663
+ CommentProvider,
664
+ VersionProvider,
665
+ GitHubAuthProvider,
666
+ CommentOverlay,
667
+ CommentDrawer
668
+ } from 'hale-commenting-system';
669
+ import apolloCommentsConfig from './apollo-comments.config.json';`;
670
+ const importRegex = /import\s+.*?from\s+['"].*?['"];?/g;
671
+ const matches = content.match(importRegex);
672
+ if (!matches || matches.length === 0) {
673
+ content = imports + "\n\n" + content;
674
+ } else {
675
+ const lastImport = matches[matches.length - 1];
676
+ const lastImportIndex = content.lastIndexOf(lastImport);
677
+ const insertPosition = lastImportIndex + lastImport.length;
678
+ content = content.slice(0, insertPosition) + "\n\n" + imports + content.slice(insertPosition);
679
+ }
680
+ const returnMatch = content.match(/return\s*\(?[\s\n]*<(\w+)/);
681
+ if (!returnMatch) {
682
+ return content;
683
+ }
684
+ const componentName = returnMatch[1];
685
+ const closingTag = `</${componentName}>`;
686
+ const closingIndex = content.indexOf(closingTag);
687
+ if (closingIndex === -1) {
688
+ return content;
689
+ }
690
+ const stateHook = ` const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);
691
+
692
+ `;
693
+ const functionMatch = content.match(/const\s+\w+.*?=.*?\(\).*?=>\s*\{/);
694
+ if (functionMatch) {
695
+ const insertPos = functionMatch.index + functionMatch[0].length;
696
+ content = content.slice(0, insertPos) + "\n" + stateHook + content.slice(insertPos);
697
+ }
698
+ const returnStartMatch = content.match(/return\s*\(/);
699
+ if (returnStartMatch) {
700
+ const returnStart = returnStartMatch.index + returnStartMatch[0].length;
701
+ const returnEnd = content.indexOf(closingTag, returnStart) + closingTag.length;
702
+ const originalReturn = content.slice(returnStart, returnEnd);
703
+ const wrappedReturn = `
704
+ <GitHubAuthProvider config={apolloCommentsConfig}>
705
+ <VersionProvider>
706
+ <CommentProvider>
707
+ <CommentDrawer
708
+ selectedThreadId={selectedThreadId}
709
+ onThreadSelect={setSelectedThreadId}
710
+ >
711
+ <CommentOverlay
712
+ selectedThreadId={selectedThreadId}
713
+ onThreadSelect={setSelectedThreadId}
714
+ />
715
+ ${originalReturn.trim()}
716
+ </CommentDrawer>
717
+ </CommentProvider>
718
+ </VersionProvider>
719
+ </GitHubAuthProvider>
720
+ `;
721
+ content = content.slice(0, returnStart) + wrappedReturn + content.slice(returnEnd);
722
+ }
723
+ return content;
724
+ }
725
+ function showIntegrationDiff(filePath) {
726
+ console.log(chalk7.cyan("\nChanges made to your App file:"));
727
+ console.log(chalk7.white("\u2022 Added commenting system imports"));
728
+ console.log(chalk7.white("\u2022 Added state hook for comment thread selection"));
729
+ console.log(chalk7.white("\u2022 Wrapped app with GitHubAuthProvider, VersionProvider, and CommentProvider"));
730
+ console.log(chalk7.white("\u2022 Added CommentDrawer and CommentOverlay components\n"));
731
+ console.log(chalk7.dim(`Modified: ${filePath}
732
+ `));
733
+ }
734
+
605
735
  // src/validators/github.ts
606
736
  import axios from "axios";
607
737
  async function validateGitHubConnection(config) {
@@ -621,7 +751,7 @@ async function validateGitHubConnection(config) {
621
751
 
622
752
  // src/validators/repo.ts
623
753
  import axios2 from "axios";
624
- import chalk7 from "chalk";
754
+ import chalk8 from "chalk";
625
755
  async function validateRepoAccess(config) {
626
756
  try {
627
757
  const response = await axios2.get(
@@ -636,8 +766,8 @@ async function validateRepoAccess(config) {
636
766
  return response.status === 200;
637
767
  } catch (error) {
638
768
  if (error.response?.status === 404) {
639
- console.log(chalk7.yellow(` Repository ${config.owner}/${config.repo} not found or is private`));
640
- console.log(chalk7.yellow(" Note: Private repos require authentication at runtime"));
769
+ console.log(chalk8.yellow(` Repository ${config.owner}/${config.repo} not found or is private`));
770
+ console.log(chalk8.yellow(" Note: Private repos require authentication at runtime"));
641
771
  return true;
642
772
  }
643
773
  console.error(" Repo access error:", error.message);
@@ -646,18 +776,18 @@ async function validateRepoAccess(config) {
646
776
  }
647
777
 
648
778
  // src/validators/labels.ts
649
- import chalk8 from "chalk";
779
+ import chalk9 from "chalk";
650
780
  var REQUIRED_LABELS = [
651
781
  { name: "comment", color: "0075ca", description: "User feedback comment" },
652
782
  { name: "prototype-feedback", color: "d93f0b", description: "Prototype feedback" },
653
783
  { name: "needs-review", color: "fbca04", description: "Needs team review" }
654
784
  ];
655
785
  async function ensureLabels(config) {
656
- console.log(chalk8.dim("\n Required labels for GitHub issues:"));
786
+ console.log(chalk9.dim("\n Required labels for GitHub issues:"));
657
787
  REQUIRED_LABELS.forEach((label) => {
658
- console.log(chalk8.dim(` - ${label.name} (#${label.color}): ${label.description}`));
788
+ console.log(chalk9.dim(` - ${label.name} (#${label.color}): ${label.description}`));
659
789
  });
660
- console.log(chalk8.dim(" These will be created automatically at runtime with proper authentication.\n"));
790
+ console.log(chalk9.dim(" These will be created automatically at runtime with proper authentication.\n"));
661
791
  }
662
792
 
663
793
  // src/commands/init.ts
@@ -674,7 +804,7 @@ async function initCommand(options) {
674
804
  }
675
805
  if (!project.isReact) {
676
806
  spinner.fail("This package requires a React project");
677
- console.log(chalk9.red("\n\u2717 Apollo Commenting System requires React.\n"));
807
+ console.log(chalk10.red("\n\u2717 Apollo Commenting System requires React.\n"));
678
808
  process.exit(1);
679
809
  }
680
810
  if (!project.hasPatternFly) {
@@ -689,7 +819,7 @@ async function initCommand(options) {
689
819
  }
690
820
  ]);
691
821
  if (!continueAnyway) {
692
- console.log(chalk9.dim("\nSetup cancelled.\n"));
822
+ console.log(chalk10.dim("\nSetup cancelled.\n"));
693
823
  process.exit(0);
694
824
  }
695
825
  }
@@ -738,24 +868,56 @@ async function initCommand(options) {
738
868
  process.exit(1);
739
869
  }
740
870
  printSuccess();
741
- printSetupInstructions(platform, project);
742
- printNextSteps();
871
+ if (!options.yes) {
872
+ const { autoIntegrate } = await inquirer3.prompt([
873
+ {
874
+ type: "confirm",
875
+ name: "autoIntegrate",
876
+ message: "Automatically integrate providers into your App file?",
877
+ default: true
878
+ }
879
+ ]);
880
+ if (autoIntegrate) {
881
+ spinner.start("Integrating providers...");
882
+ const result = await integrateProviders(project.root);
883
+ if (result.success) {
884
+ spinner.succeed("Providers integrated!");
885
+ showIntegrationDiff(result.filePath);
886
+ console.log(chalk10.green("\u2713 Your app is ready to use the commenting system!\n"));
887
+ console.log(chalk10.cyan("Next steps:"));
888
+ console.log(chalk10.white("1. Review the changes in your App file"));
889
+ console.log(chalk10.white("2. Start your dev server: npm run start:dev"));
890
+ console.log(chalk10.white("3. Open http://localhost:9000\n"));
891
+ } else {
892
+ spinner.warn(result.message);
893
+ console.log(chalk10.yellow("\nFalling back to manual integration:\n"));
894
+ printSetupInstructions(platform, project);
895
+ printNextSteps();
896
+ }
897
+ } else {
898
+ printSetupInstructions(platform, project);
899
+ printNextSteps();
900
+ }
901
+ } else {
902
+ printSetupInstructions(platform, project);
903
+ printNextSteps();
904
+ }
743
905
  }
744
906
 
745
907
  // src/commands/validate.ts
746
- import chalk10 from "chalk";
908
+ import chalk11 from "chalk";
747
909
  import ora2 from "ora";
748
- import path5 from "path";
910
+ import path6 from "path";
749
911
  async function validateCommand() {
750
- console.log(chalk10.bold.cyan("\n\u{1F50D} Validating Apollo Commenting System Setup\n"));
912
+ console.log(chalk11.bold.cyan("\n\u{1F50D} Validating Apollo Commenting System Setup\n"));
751
913
  const spinner = ora2("Checking configuration files...").start();
752
914
  const cwd = process.cwd();
753
- const configPath = path5.join(cwd, "apollo-comments.config.json");
915
+ const configPath = path6.join(cwd, "apollo-comments.config.json");
754
916
  const hasConfig = await fileExists(configPath);
755
917
  if (!hasConfig) {
756
918
  spinner.fail("Configuration file not found");
757
- console.log(chalk10.red("\n\u2717 apollo-comments.config.json not found"));
758
- console.log(chalk10.dim(" Run: apollo-comments init\n"));
919
+ console.log(chalk11.red("\n\u2717 apollo-comments.config.json not found"));
920
+ console.log(chalk11.dim(" Run: apollo-comments init\n"));
759
921
  process.exit(1);
760
922
  }
761
923
  let config;
@@ -765,11 +927,11 @@ async function validateCommand() {
765
927
  spinner.succeed("Configuration file found");
766
928
  } catch (error) {
767
929
  spinner.fail("Invalid configuration file");
768
- console.log(chalk10.red("\n\u2717 Could not parse apollo-comments.config.json\n"));
930
+ console.log(chalk11.red("\n\u2717 Could not parse apollo-comments.config.json\n"));
769
931
  process.exit(1);
770
932
  }
771
933
  spinner.start("Checking environment files...");
772
- const envPath = path5.join(cwd, ".env.local");
934
+ const envPath = path6.join(cwd, ".env.local");
773
935
  const hasEnv = await fileExists(envPath);
774
936
  if (!hasEnv) {
775
937
  spinner.warn("Environment file not found (.env.local)");
@@ -779,14 +941,14 @@ async function validateCommand() {
779
941
  spinner.start("Checking serverless functions...");
780
942
  let hasServerless = false;
781
943
  if (config.platform === "vercel") {
782
- const apiDir = path5.join(cwd, "api");
783
- const loginPath = path5.join(apiDir, "github-oauth-login.ts");
784
- const callbackPath = path5.join(apiDir, "github-oauth-callback.ts");
944
+ const apiDir = path6.join(cwd, "api");
945
+ const loginPath = path6.join(apiDir, "github-oauth-login.ts");
946
+ const callbackPath = path6.join(apiDir, "github-oauth-callback.ts");
785
947
  hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);
786
948
  } else if (config.platform === "netlify") {
787
- const functionsDir = path5.join(cwd, "netlify", "functions");
788
- const loginPath = path5.join(functionsDir, "github-oauth-login.ts");
789
- const callbackPath = path5.join(functionsDir, "github-oauth-callback.ts");
949
+ const functionsDir = path6.join(cwd, "netlify", "functions");
950
+ const loginPath = path6.join(functionsDir, "github-oauth-login.ts");
951
+ const callbackPath = path6.join(functionsDir, "github-oauth-callback.ts");
790
952
  hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);
791
953
  }
792
954
  if (!hasServerless && config.platform !== "manual") {
@@ -798,7 +960,7 @@ async function validateCommand() {
798
960
  const isValid = await validateGitHubConnection(config.github);
799
961
  if (!isValid) {
800
962
  spinner.fail("GitHub connection failed");
801
- console.log(chalk10.red("\n\u2717 Could not connect to GitHub API\n"));
963
+ console.log(chalk11.red("\n\u2717 Could not connect to GitHub API\n"));
802
964
  process.exit(1);
803
965
  }
804
966
  spinner.succeed("GitHub connection validated");
@@ -809,8 +971,8 @@ async function validateCommand() {
809
971
  } else {
810
972
  spinner.succeed("Repository access confirmed");
811
973
  }
812
- console.log(chalk10.green.bold("\n\u2713 Validation complete!\n"));
813
- console.log(chalk10.white("Your Apollo Commenting System setup looks good.\n"));
974
+ console.log(chalk11.green.bold("\n\u2713 Validation complete!\n"));
975
+ console.log(chalk11.white("Your Apollo Commenting System setup looks good.\n"));
814
976
  }
815
977
 
816
978
  // src/index.ts
@@ -820,7 +982,7 @@ program.command("init").description("Initialize Apollo Commenting System in your
820
982
  try {
821
983
  await initCommand(options);
822
984
  } catch (error) {
823
- console.error(chalk11.red("\n\u2717 Error:"), error.message);
985
+ console.error(chalk12.red("\n\u2717 Error:"), error.message);
824
986
  process.exit(1);
825
987
  }
826
988
  });
@@ -828,13 +990,13 @@ program.command("validate").description("Validate your commenting system setup")
828
990
  try {
829
991
  await validateCommand();
830
992
  } catch (error) {
831
- console.error(chalk11.red("\n\u2717 Error:"), error.message);
993
+ console.error(chalk12.red("\n\u2717 Error:"), error.message);
832
994
  process.exit(1);
833
995
  }
834
996
  });
835
997
  program.command("update").description("Update existing configuration").action(() => {
836
- console.log(chalk11.yellow("\n\u26A0\uFE0F Coming soon: Update configuration\n"));
837
- console.log(chalk11.dim("For now, you can manually edit apollo-comments.config.json\n"));
998
+ console.log(chalk12.yellow("\n\u26A0\uFE0F Coming soon: Update configuration\n"));
999
+ console.log(chalk12.dim("For now, you can manually edit apollo-comments.config.json\n"));
838
1000
  });
839
1001
  if (!process.argv.slice(2).length) {
840
1002
  program.help();
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/utils/detect.ts","../src/utils/logger.ts","../src/prompts/platform.ts","../src/prompts/github.ts","../src/generators/serverless.ts","../src/utils/fs.ts","../src/templates/vercel-auth.ts","../src/templates/netlify-auth.ts","../src/generators/env.ts","../src/generators/config.ts","../src/validators/github.ts","../src/validators/repo.ts","../src/validators/labels.ts","../src/commands/validate.ts"],"sourcesContent":["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { initCommand } from './commands/init.js';\nimport { validateCommand } from './commands/validate.js';\n\nconst program = new Command();\n\nprogram\n .name('hale-commenting-system')\n .description('Hale Commenting System CLI - Setup wizard and tooling')\n .version('1.0.0');\n\nprogram\n .command('init')\n .description('Initialize Apollo Commenting System in your project')\n .option('-y, --yes', 'Skip prompts and use defaults')\n .option('--platform <platform>', 'Target platform (vercel, netlify, manual)')\n .action(async (options) => {\n try {\n await initCommand(options);\n } catch (error: any) {\n console.error(chalk.red('\\n✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate your commenting system setup')\n .action(async () => {\n try {\n await validateCommand();\n } catch (error: any) {\n console.error(chalk.red('\\n✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\nprogram\n .command('update')\n .description('Update existing configuration')\n .action(() => {\n console.log(chalk.yellow('\\n⚠️ Coming soon: Update configuration\\n'));\n console.log(chalk.dim('For now, you can manually edit apollo-comments.config.json\\n'));\n });\n\n// Show help if no command provided\nif (!process.argv.slice(2).length) {\n program.help();\n}\n\nprogram.parse();\n\n","import chalk from 'chalk';\nimport ora from 'ora';\nimport inquirer from 'inquirer';\nimport { detectProject } from '../utils/detect.js';\nimport { printWelcome, printSetupInstructions, printSuccess, printNextSteps, printWarning } from '../utils/logger.js';\nimport { promptPlatform } from '../prompts/platform.js';\nimport { promptGitHubConfig } from '../prompts/github.js';\nimport { generateServerless } from '../generators/serverless.js';\nimport { generateEnvFiles } from '../generators/env.js';\nimport { generateConfig } from '../generators/config.js';\nimport { validateGitHubConnection } from '../validators/github.js';\nimport { validateRepoAccess } from '../validators/repo.js';\nimport { ensureLabels } from '../validators/labels.js';\n\ninterface InitOptions {\n yes?: boolean;\n platform?: string;\n}\n\nexport async function initCommand(options: InitOptions) {\n printWelcome();\n\n const spinner = ora('Detecting project...').start();\n\n // Step 1: Detect project type\n let project;\n try {\n project = await detectProject(process.cwd());\n spinner.succeed(`Detected: ${project.framework} with ${project.buildTool}`);\n } catch (error: any) {\n spinner.fail(error.message);\n process.exit(1);\n }\n\n if (!project.isReact) {\n spinner.fail('This package requires a React project');\n console.log(chalk.red('\\n✗ Apollo Commenting System requires React.\\n'));\n process.exit(1);\n }\n\n if (!project.hasPatternFly) {\n printWarning('PatternFly not detected. This package is optimized for PatternFly projects.');\n if (!options.yes) {\n const { continueAnyway } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'continueAnyway',\n message: 'Continue anyway?',\n default: false\n }\n ]);\n if (!continueAnyway) {\n console.log(chalk.dim('\\nSetup cancelled.\\n'));\n process.exit(0);\n }\n }\n }\n\n // Step 2: Select platform\n const platform = options.platform || await promptPlatform(project.root);\n\n // Step 3: Prompt for GitHub OAuth settings\n const githubConfig = await promptGitHubConfig(options.yes || false);\n\n // Step 4: Validate GitHub connection\n spinner.start('Validating GitHub connection...');\n const isValid = await validateGitHubConnection(githubConfig);\n if (!isValid) {\n spinner.fail('GitHub connection failed. Please check your internet connection.');\n process.exit(1);\n }\n spinner.succeed('GitHub connection validated');\n\n // Step 5: Validate repo access\n spinner.start('Checking repository access...');\n const hasAccess = await validateRepoAccess(githubConfig);\n if (!hasAccess) {\n spinner.fail('Cannot access repository. Check the owner/repo name.');\n process.exit(1);\n }\n spinner.succeed('Repository access confirmed');\n\n // Step 6: Ensure labels exist\n spinner.start('Checking issue labels...');\n await ensureLabels(githubConfig);\n spinner.succeed('Issue labels documented');\n\n // Step 7: Generate serverless functions\n spinner.start('Generating serverless functions...');\n try {\n await generateServerless(platform, project.root);\n spinner.succeed('Serverless functions created');\n } catch (error: any) {\n spinner.fail(`Failed to generate serverless functions: ${error.message}`);\n process.exit(1);\n }\n\n // Step 8: Generate environment files\n spinner.start('Creating environment files...');\n try {\n await generateEnvFiles(githubConfig, platform, project.root);\n spinner.succeed('Environment files created');\n } catch (error: any) {\n spinner.fail(`Failed to create environment files: ${error.message}`);\n process.exit(1);\n }\n\n // Step 9: Generate config file\n spinner.start('Creating apollo-comments.config.json...');\n try {\n await generateConfig(githubConfig, platform, project.root);\n spinner.succeed('Configuration file created');\n } catch (error: any) {\n spinner.fail(`Failed to create config file: ${error.message}`);\n process.exit(1);\n }\n\n // Step 10: Print setup instructions\n printSuccess();\n printSetupInstructions(platform, project);\n printNextSteps();\n}\n\n","import fs from 'fs/promises';\nimport path from 'path';\n\nexport interface ProjectInfo {\n root: string;\n framework: string;\n buildTool: string;\n isReact: boolean;\n hasPatternFly: boolean;\n hasTypeScript: boolean;\n packageJson: any;\n}\n\nexport async function detectProject(cwd: string): Promise<ProjectInfo> {\n const packageJsonPath = path.join(cwd, 'package.json');\n \n let packageJson: any = {};\n try {\n const content = await fs.readFile(packageJsonPath, 'utf-8');\n packageJson = JSON.parse(content);\n } catch (error) {\n throw new Error('No package.json found. Are you in a Node.js project?');\n }\n\n const deps = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies\n };\n\n const buildTool = await detectBuildTool(cwd, deps);\n\n return {\n root: cwd,\n framework: detectFramework(deps),\n buildTool,\n isReact: !!deps['react'],\n hasPatternFly: !!deps['@patternfly/react-core'],\n hasTypeScript: !!deps['typescript'],\n packageJson\n };\n}\n\nfunction detectFramework(deps: any): string {\n if (deps['react']) return 'React';\n if (deps['vue']) return 'Vue';\n if (deps['@angular/core']) return 'Angular';\n return 'Unknown';\n}\n\nasync function detectBuildTool(cwd: string, deps: any): Promise<string> {\n if (deps['vite']) return 'Vite';\n if (deps['webpack']) return 'Webpack';\n \n try {\n await fs.access(path.join(cwd, 'next.config.js'));\n return 'Next.js';\n } catch {\n // Next.js config not found\n }\n\n return 'Unknown';\n}\n\nexport async function detectPlatform(cwd: string): Promise<string | null> {\n try {\n await fs.access(path.join(cwd, 'vercel.json'));\n return 'vercel';\n } catch {\n // Not Vercel\n }\n\n try {\n await fs.access(path.join(cwd, 'netlify.toml'));\n return 'netlify';\n } catch {\n // Not Netlify\n }\n\n return null;\n}\n\n","import chalk from 'chalk';\n\nexport function printWelcome() {\n console.log(chalk.bold.cyan('\\n🚀 Hale Commenting System Setup Wizard\\n'));\n}\n\nexport function printSetupInstructions(platform: string, project: any) {\n console.log(chalk.bold('\\n📝 Manual Setup Required:\\n'));\n\n console.log(chalk.cyan('1. Add the CommentProvider to your App.tsx:\\n'));\n \n console.log(chalk.white(`import {\n CommentProvider,\n VersionProvider,\n GitHubAuthProvider,\n CommentOverlay,\n CommentDrawer\n} from '@apollo/commenting-system';\nimport apolloCommentsConfig from './apollo-comments.config.json';\nimport React from 'react';\n\nfunction App() {\n const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);\n\n return (\n <GitHubAuthProvider config={apolloCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n {/* Your app content */}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n );\n}\n`));\n\n console.log(chalk.cyan('\\n2. Deploy your serverless functions:\\n'));\n\n if (platform === 'vercel') {\n console.log(chalk.white(' vercel --prod'));\n } else if (platform === 'netlify') {\n console.log(chalk.white(' netlify deploy --prod'));\n } else {\n console.log(chalk.white(' Follow your platform\\'s deployment guide'));\n }\n\n console.log(chalk.cyan('\\n3. Update your GitHub OAuth App callback URL:\\n'));\n console.log(chalk.white(' https://your-domain.com/api/github-oauth-callback\\n'));\n}\n\nexport function printSuccess() {\n console.log(chalk.green.bold('\\n✓ Setup complete!\\n'));\n}\n\nexport function printNextSteps() {\n console.log(chalk.cyan('\\nNext steps:'));\n console.log(chalk.white('1. Review generated files in your project'));\n console.log(chalk.white('2. Add the CommentProvider to your App.tsx (see instructions above)'));\n console.log(chalk.white('3. Deploy your serverless functions'));\n console.log(chalk.white('4. Run: npm run dev\\n'));\n\n console.log(chalk.dim('Run \"hale-commenting-system validate\" to verify your setup.\\n'));\n}\n\nexport function printError(message: string) {\n console.log(chalk.red.bold(`\\n✗ Error: ${message}\\n`));\n}\n\nexport function printWarning(message: string) {\n console.log(chalk.yellow(`⚠️ ${message}`));\n}\n\n","import inquirer from 'inquirer';\nimport chalk from 'chalk';\nimport { detectPlatform } from '../utils/detect.js';\n\nexport async function promptPlatform(projectRoot: string): Promise<string> {\n // Auto-detect platform\n const detectedPlatform = await detectPlatform(projectRoot);\n\n if (detectedPlatform) {\n console.log(chalk.green(`✓ Detected ${detectedPlatform} configuration`));\n \n const { usePlatform } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'usePlatform',\n message: `Use ${detectedPlatform} for serverless functions?`,\n default: true\n }\n ]);\n\n if (usePlatform) {\n return detectedPlatform;\n }\n }\n\n const { platform } = await inquirer.prompt([\n {\n type: 'list',\n name: 'platform',\n message: 'Select your deployment platform:',\n choices: [\n { name: 'Vercel', value: 'vercel' },\n { name: 'Netlify', value: 'netlify' },\n { name: 'Manual (I will configure myself)', value: 'manual' }\n ]\n }\n ]);\n\n return platform;\n}\n\n","import inquirer from 'inquirer';\nimport chalk from 'chalk';\n\nexport interface GitHubConfig {\n clientId: string;\n clientSecret: string;\n owner: string;\n repo: string;\n}\n\nexport async function promptGitHubConfig(skipPrompts: boolean = false): Promise<GitHubConfig> {\n if (skipPrompts) {\n console.log(chalk.yellow('Using default/environment values...'));\n return {\n clientId: process.env.GITHUB_CLIENT_ID || '',\n clientSecret: process.env.GITHUB_CLIENT_SECRET || '',\n owner: process.env.GITHUB_OWNER || '',\n repo: process.env.GITHUB_REPO || ''\n };\n }\n\n console.log(chalk.bold('\\n📋 GitHub OAuth Configuration\\n'));\n console.log(chalk.dim('You need to create a GitHub OAuth App:'));\n console.log(chalk.dim('https://github.com/settings/developers\\n'));\n\n const answers = await inquirer.prompt<GitHubConfig>([\n {\n type: 'input',\n name: 'clientId',\n message: 'GitHub OAuth Client ID:',\n validate: (input: string) => input.length > 0 || 'Client ID is required'\n },\n {\n type: 'password',\n name: 'clientSecret',\n message: 'GitHub OAuth Client Secret:',\n mask: '*',\n validate: (input: string) => input.length > 0 || 'Client Secret is required'\n },\n {\n type: 'input',\n name: 'owner',\n message: 'GitHub Repository Owner (user or org):',\n validate: (input: string) => input.length > 0 || 'Owner is required'\n },\n {\n type: 'input',\n name: 'repo',\n message: 'GitHub Repository Name:',\n validate: (input: string) => input.length > 0 || 'Repository name is required'\n }\n ]);\n\n return answers;\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { ensureDir, writeFile } from '../utils/fs.js';\nimport { vercelAuthLoginTemplate, vercelAuthCallbackTemplate } from '../templates/vercel-auth.js';\nimport { netlifyAuthLoginTemplate, netlifyAuthCallbackTemplate } from '../templates/netlify-auth.js';\n\nexport async function generateServerless(platform: string, projectRoot: string): Promise<void> {\n if (platform === 'vercel') {\n const apiDir = path.join(projectRoot, 'api');\n await ensureDir(apiDir);\n\n await writeFile(\n path.join(apiDir, 'github-oauth-login.ts'),\n vercelAuthLoginTemplate\n );\n\n await writeFile(\n path.join(apiDir, 'github-oauth-callback.ts'),\n vercelAuthCallbackTemplate\n );\n\n console.log(chalk.dim(' → Created api/github-oauth-login.ts'));\n console.log(chalk.dim(' → Created api/github-oauth-callback.ts'));\n } else if (platform === 'netlify') {\n const functionsDir = path.join(projectRoot, 'netlify', 'functions');\n await ensureDir(functionsDir);\n\n await writeFile(\n path.join(functionsDir, 'github-oauth-login.ts'),\n netlifyAuthLoginTemplate\n );\n\n await writeFile(\n path.join(functionsDir, 'github-oauth-callback.ts'),\n netlifyAuthCallbackTemplate\n );\n\n console.log(chalk.dim(' → Created netlify/functions/github-oauth-login.ts'));\n console.log(chalk.dim(' → Created netlify/functions/github-oauth-callback.ts'));\n } else {\n console.log(chalk.yellow(' Manual platform selected. You must create serverless functions yourself.'));\n console.log(chalk.dim(' See: https://github.com/apollo/commenting-system/blob/main/docs/manual-setup.md'));\n }\n}\n\n","import fs from 'fs/promises';\nimport path from 'path';\n\nexport async function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function ensureDir(dirPath: string): Promise<void> {\n await fs.mkdir(dirPath, { recursive: true });\n}\n\nexport async function writeFileIfNotExists(filePath: string, content: string): Promise<boolean> {\n const exists = await fileExists(filePath);\n if (exists) {\n return false;\n }\n \n await fs.writeFile(filePath, content, 'utf-8');\n return true;\n}\n\nexport async function appendToFile(filePath: string, content: string): Promise<void> {\n await fs.appendFile(filePath, content, 'utf-8');\n}\n\nexport async function readFile(filePath: string): Promise<string> {\n return fs.readFile(filePath, 'utf-8');\n}\n\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n await fs.writeFile(filePath, content, 'utf-8');\n}\n\nexport function getRelativePath(from: string, to: string): string {\n return path.relative(from, to);\n}\n\n","export const vercelAuthLoginTemplate = `import { VercelRequest, VercelResponse } from '@vercel/node';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {\n try {\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n \n if (!clientId) {\n res.status(500).json({ error: 'GitHub OAuth not configured - missing client ID' });\n return;\n }\n\n // Get the base URL from the request\n const protocol = (req.headers['x-forwarded-proto'] as string) || 'https';\n const host = (req.headers.host || req.headers['x-forwarded-host']) as string;\n \n if (!host) {\n res.status(500).json({ error: 'Could not determine host' });\n return;\n }\n \n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUri = \\`\\${baseUrl}/api/github-oauth-callback\\`;\n\n // Redirect to GitHub OAuth\n // Scope: public_repo allows read/write access to public repositories only\n const githubAuthUrl = \\`https://github.com/login/oauth/authorize?client_id=\\${clientId}&redirect_uri=\\${encodeURIComponent(redirectUri)}&scope=public_repo\\`;\n\n res.redirect(302, githubAuthUrl);\n } catch (error: any) {\n res.status(500).json({ \n error: 'Internal server error', \n details: error.message\n });\n }\n}\n`;\n\nexport const vercelAuthCallbackTemplate = `import { VercelRequest, VercelResponse } from '@vercel/node';\nimport axios from 'axios';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {\n try {\n const code = req.query.code as string;\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n const clientSecret = process.env.GITHUB_CLIENT_SECRET;\n\n if (!code) {\n res.status(400).json({ error: 'No code provided' });\n return;\n }\n\n if (!clientId || !clientSecret) {\n res.status(500).json({ error: 'GitHub OAuth not configured properly' });\n return;\n }\n\n // Exchange code for access token\n const tokenResponse = await axios.post(\n 'https://github.com/login/oauth/access_token',\n {\n client_id: clientId,\n client_secret: clientSecret,\n code,\n },\n {\n headers: {\n Accept: 'application/json',\n },\n }\n );\n\n const accessToken = tokenResponse.data.access_token;\n\n if (!accessToken) {\n throw new Error('No access token received');\n }\n\n // Get user info\n const userResponse = await axios.get('https://api.github.com/user', {\n headers: {\n Authorization: \\`token \\${accessToken}\\`,\n },\n });\n\n const user = userResponse.data;\n\n // Redirect back to the app with token in URL fragment (client-side only)\n const protocol = req.headers['x-forwarded-proto'] || 'https';\n const host = req.headers.host || req.headers['x-forwarded-host'];\n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUrl = \\`\\${baseUrl}/#/auth-callback?token=\\${accessToken}&login=\\${user.login}&avatar=\\${encodeURIComponent(user.avatar_url)}\\`;\n\n res.redirect(302, redirectUrl);\n } catch (error: any) {\n res.status(500).json({\n error: 'Failed to exchange code for token',\n details: error.message,\n });\n }\n}\n`;\n\n","export const netlifyAuthLoginTemplate = `import { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';\nimport axios from 'axios';\n\nconst handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {\n try {\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n \n if (!clientId) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'GitHub OAuth not configured - missing client ID' })\n };\n }\n\n // Get the base URL from the request\n const protocol = event.headers['x-forwarded-proto'] || 'https';\n const host = event.headers.host;\n \n if (!host) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'Could not determine host' })\n };\n }\n \n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUri = \\`\\${baseUrl}/.netlify/functions/github-oauth-callback\\`;\n\n // Redirect to GitHub OAuth\n const githubAuthUrl = \\`https://github.com/login/oauth/authorize?client_id=\\${clientId}&redirect_uri=\\${encodeURIComponent(redirectUri)}&scope=public_repo\\`;\n\n return {\n statusCode: 302,\n headers: {\n Location: githubAuthUrl\n },\n body: ''\n };\n } catch (error: any) {\n return {\n statusCode: 500,\n body: JSON.stringify({ \n error: 'Internal server error', \n details: error.message\n })\n };\n }\n};\n\nexport { handler };\n`;\n\nexport const netlifyAuthCallbackTemplate = `import { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';\nimport axios from 'axios';\n\nconst handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {\n try {\n const code = event.queryStringParameters?.code;\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n const clientSecret = process.env.GITHUB_CLIENT_SECRET;\n\n if (!code) {\n return {\n statusCode: 400,\n body: JSON.stringify({ error: 'No code provided' })\n };\n }\n\n if (!clientId || !clientSecret) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'GitHub OAuth not configured properly' })\n };\n }\n\n // Exchange code for access token\n const tokenResponse = await axios.post(\n 'https://github.com/login/oauth/access_token',\n {\n client_id: clientId,\n client_secret: clientSecret,\n code,\n },\n {\n headers: {\n Accept: 'application/json',\n },\n }\n );\n\n const accessToken = tokenResponse.data.access_token;\n\n if (!accessToken) {\n throw new Error('No access token received');\n }\n\n // Get user info\n const userResponse = await axios.get('https://api.github.com/user', {\n headers: {\n Authorization: \\`token \\${accessToken}\\`,\n },\n });\n\n const user = userResponse.data;\n\n // Redirect back to the app with token in URL fragment\n const protocol = event.headers['x-forwarded-proto'] || 'https';\n const host = event.headers.host;\n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUrl = \\`\\${baseUrl}/#/auth-callback?token=\\${accessToken}&login=\\${user.login}&avatar=\\${encodeURIComponent(user.avatar_url)}\\`;\n\n return {\n statusCode: 302,\n headers: {\n Location: redirectUrl\n },\n body: ''\n };\n } catch (error: any) {\n return {\n statusCode: 500,\n body: JSON.stringify({\n error: 'Failed to exchange code for token',\n details: error.message,\n })\n };\n }\n};\n\nexport { handler };\n`;\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { fileExists, appendToFile, writeFile, readFile } from '../utils/fs.js';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function generateEnvFiles(\n githubConfig: GitHubConfig, \n platform: string, \n projectRoot: string\n): Promise<void> {\n const envContent = `\n# Apollo Commenting System Configuration\n# Generated by apollo-comments CLI\n\n# GitHub OAuth\nGITHUB_CLIENT_ID=${githubConfig.clientId}\nGITHUB_CLIENT_SECRET=${githubConfig.clientSecret}\nGITHUB_OWNER=${githubConfig.owner}\nGITHUB_REPO=${githubConfig.repo}\n\n# Vite (if using Vite)\nVITE_GITHUB_CLIENT_ID=${githubConfig.clientId}\nVITE_GITHUB_OWNER=${githubConfig.owner}\nVITE_GITHUB_REPO=${githubConfig.repo}\n`;\n\n const envLocalPath = path.join(projectRoot, '.env.local');\n const envPath = path.join(projectRoot, '.env');\n\n // Check if .env.local exists and already contains GitHub config\n const envLocalExists = await fileExists(envLocalPath);\n \n if (envLocalExists) {\n const existingEnv = await readFile(envLocalPath);\n if (existingEnv.includes('GITHUB_CLIENT_ID')) {\n console.log(chalk.yellow(' .env.local already contains GitHub config. Skipping...'));\n } else {\n await appendToFile(envLocalPath, envContent);\n console.log(chalk.dim(' → Updated .env.local'));\n }\n } else {\n await writeFile(envLocalPath, envContent.trim());\n console.log(chalk.dim(' → Created .env.local'));\n }\n\n // Create .env.example without secrets\n const envExampleContent = `# Apollo Commenting System Configuration\n\n# GitHub OAuth (get from https://github.com/settings/developers)\nGITHUB_CLIENT_ID=your_client_id_here\nGITHUB_CLIENT_SECRET=your_client_secret_here\nGITHUB_OWNER=your_github_org\nGITHUB_REPO=your_repo_name\n\n# Vite (if using Vite)\nVITE_GITHUB_CLIENT_ID=your_client_id_here\nVITE_GITHUB_OWNER=your_github_org\nVITE_GITHUB_REPO=your_repo_name\n`;\n\n await writeFile(path.join(projectRoot, '.env.example'), envExampleContent);\n console.log(chalk.dim(' → Created .env.example'));\n\n // Add .env.local to .gitignore if not already present\n const gitignorePath = path.join(projectRoot, '.gitignore');\n if (await fileExists(gitignorePath)) {\n const gitignoreContent = await readFile(gitignorePath);\n if (!gitignoreContent.includes('.env.local')) {\n await appendToFile(gitignorePath, '\\n# Apollo Commenting System\\n.env.local\\n');\n console.log(chalk.dim(' → Updated .gitignore'));\n }\n }\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { writeFile } from '../utils/fs.js';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function generateConfig(\n githubConfig: GitHubConfig,\n platform: string,\n projectRoot: string\n): Promise<void> {\n // Build redirect URI based on platform\n let redirectUri = 'http://localhost:9000/api/github-oauth-callback';\n \n if (platform === 'netlify') {\n redirectUri = 'https://your-domain.com/.netlify/functions/github-oauth-callback';\n } else if (platform === 'vercel') {\n redirectUri = 'https://your-domain.com/api/github-oauth-callback';\n }\n\n const config = {\n version: '1.0.0',\n platform,\n github: {\n owner: githubConfig.owner,\n repo: githubConfig.repo,\n clientId: githubConfig.clientId\n },\n redirectUri,\n features: {\n aiSummarization: true,\n versionTracking: true,\n gitlabIntegration: false\n },\n labels: [\n { name: 'comment', color: '0075ca', description: 'User feedback comment' },\n { name: 'prototype-feedback', color: 'd93f0b', description: 'Prototype feedback' },\n { name: 'needs-review', color: 'fbca04', description: 'Needs team review' }\n ]\n };\n\n const configPath = path.join(projectRoot, 'apollo-comments.config.json');\n await writeFile(configPath, JSON.stringify(config, null, 2));\n console.log(chalk.dim(' → Created apollo-comments.config.json'));\n}\n\n","import axios from 'axios';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function validateGitHubConnection(config: GitHubConfig): Promise<boolean> {\n try {\n // Test basic GitHub API connectivity\n const response = await axios.get('https://api.github.com/rate_limit', {\n headers: {\n 'Accept': 'application/vnd.github.v3+json'\n },\n timeout: 5000\n });\n return response.status === 200;\n } catch (error) {\n console.error('GitHub connection error:', error);\n return false;\n }\n}\n\n","import axios from 'axios';\nimport chalk from 'chalk';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function validateRepoAccess(config: GitHubConfig): Promise<boolean> {\n try {\n // Note: This checks if the repo exists publicly\n // Private repos would need authentication\n const response = await axios.get(\n `https://api.github.com/repos/${config.owner}/${config.repo}`,\n {\n headers: {\n 'Accept': 'application/vnd.github.v3+json'\n },\n timeout: 5000\n }\n );\n return response.status === 200;\n } catch (error: any) {\n if (error.response?.status === 404) {\n console.log(chalk.yellow(` Repository ${config.owner}/${config.repo} not found or is private`));\n console.log(chalk.yellow(' Note: Private repos require authentication at runtime'));\n // We'll allow this to proceed since private repos are valid\n return true;\n }\n console.error(' Repo access error:', error.message);\n return false;\n }\n}\n\n","import chalk from 'chalk';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nconst REQUIRED_LABELS = [\n { name: 'comment', color: '0075ca', description: 'User feedback comment' },\n { name: 'prototype-feedback', color: 'd93f0b', description: 'Prototype feedback' },\n { name: 'needs-review', color: 'fbca04', description: 'Needs team review' }\n];\n\nexport async function ensureLabels(config: GitHubConfig): Promise<void> {\n // Note: Creating labels requires authentication\n // For now, just inform the user about required labels\n console.log(chalk.dim('\\n Required labels for GitHub issues:'));\n REQUIRED_LABELS.forEach(label => {\n console.log(chalk.dim(` - ${label.name} (#${label.color}): ${label.description}`));\n });\n console.log(chalk.dim(' These will be created automatically at runtime with proper authentication.\\n'));\n}\n\nexport function getRequiredLabels() {\n return REQUIRED_LABELS;\n}\n\n","import chalk from 'chalk';\nimport ora from 'ora';\nimport path from 'path';\nimport { fileExists, readFile } from '../utils/fs.js';\nimport { validateGitHubConnection } from '../validators/github.js';\nimport { validateRepoAccess } from '../validators/repo.js';\n\nexport async function validateCommand() {\n console.log(chalk.bold.cyan('\\n🔍 Validating Apollo Commenting System Setup\\n'));\n\n const spinner = ora('Checking configuration files...').start();\n const cwd = process.cwd();\n\n // Check for config file\n const configPath = path.join(cwd, 'apollo-comments.config.json');\n const hasConfig = await fileExists(configPath);\n \n if (!hasConfig) {\n spinner.fail('Configuration file not found');\n console.log(chalk.red('\\n✗ apollo-comments.config.json not found'));\n console.log(chalk.dim(' Run: apollo-comments init\\n'));\n process.exit(1);\n }\n\n let config: any;\n try {\n const configContent = await readFile(configPath);\n config = JSON.parse(configContent);\n spinner.succeed('Configuration file found');\n } catch (error) {\n spinner.fail('Invalid configuration file');\n console.log(chalk.red('\\n✗ Could not parse apollo-comments.config.json\\n'));\n process.exit(1);\n }\n\n // Check for .env.local\n spinner.start('Checking environment files...');\n const envPath = path.join(cwd, '.env.local');\n const hasEnv = await fileExists(envPath);\n \n if (!hasEnv) {\n spinner.warn('Environment file not found (.env.local)');\n } else {\n spinner.succeed('Environment file found');\n }\n\n // Check for serverless functions\n spinner.start('Checking serverless functions...');\n let hasServerless = false;\n \n if (config.platform === 'vercel') {\n const apiDir = path.join(cwd, 'api');\n const loginPath = path.join(apiDir, 'github-oauth-login.ts');\n const callbackPath = path.join(apiDir, 'github-oauth-callback.ts');\n hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);\n } else if (config.platform === 'netlify') {\n const functionsDir = path.join(cwd, 'netlify', 'functions');\n const loginPath = path.join(functionsDir, 'github-oauth-login.ts');\n const callbackPath = path.join(functionsDir, 'github-oauth-callback.ts');\n hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);\n }\n\n if (!hasServerless && config.platform !== 'manual') {\n spinner.warn('Serverless functions not found');\n } else {\n spinner.succeed('Serverless functions found');\n }\n\n // Validate GitHub connection\n spinner.start('Validating GitHub connection...');\n const isValid = await validateGitHubConnection(config.github);\n if (!isValid) {\n spinner.fail('GitHub connection failed');\n console.log(chalk.red('\\n✗ Could not connect to GitHub API\\n'));\n process.exit(1);\n }\n spinner.succeed('GitHub connection validated');\n\n // Validate repo access\n spinner.start('Validating repository access...');\n const hasAccess = await validateRepoAccess(config.github);\n if (!hasAccess) {\n spinner.warn('Repository access could not be confirmed');\n } else {\n spinner.succeed('Repository access confirmed');\n }\n\n console.log(chalk.green.bold('\\n✓ Validation complete!\\n'));\n console.log(chalk.white('Your Apollo Commenting System setup looks good.\\n'));\n}\n\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,OAAOA,aAAW;;;ACDlB,OAAOC,YAAW;AAClB,OAAO,SAAS;AAChB,OAAOC,eAAc;;;ACFrB,OAAO,QAAQ;AACf,OAAO,UAAU;AAYjB,eAAsB,cAAc,KAAmC;AACrE,QAAM,kBAAkB,KAAK,KAAK,KAAK,cAAc;AAErD,MAAI,cAAmB,CAAC;AACxB,MAAI;AACF,UAAM,UAAU,MAAM,GAAG,SAAS,iBAAiB,OAAO;AAC1D,kBAAc,KAAK,MAAM,OAAO;AAAA,EAClC,SAAS,OAAO;AACd,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACxE;AAEA,QAAM,OAAO;AAAA,IACX,GAAG,YAAY;AAAA,IACf,GAAG,YAAY;AAAA,EACjB;AAEA,QAAM,YAAY,MAAM,gBAAgB,KAAK,IAAI;AAEjD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,WAAW,gBAAgB,IAAI;AAAA,IAC/B;AAAA,IACA,SAAS,CAAC,CAAC,KAAK,OAAO;AAAA,IACvB,eAAe,CAAC,CAAC,KAAK,wBAAwB;AAAA,IAC9C,eAAe,CAAC,CAAC,KAAK,YAAY;AAAA,IAClC;AAAA,EACF;AACF;AAEA,SAAS,gBAAgB,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AACnB,YAAQ,MAAMA,QAAM,IAAI,iBAAY,GAAG,MAAM,OAAO;AACpD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,QAAQ,EAChB,YAAY,+BAA+B,EAC3C,OAAO,MAAM;AACZ,UAAQ,IAAIA,QAAM,OAAO,qDAA2C,CAAC;AACrE,UAAQ,IAAIA,QAAM,IAAI,8DAA8D,CAAC;AACvF,CAAC;AAGH,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,EAAE,QAAQ;AACjC,UAAQ,KAAK;AACf;AAEA,QAAQ,MAAM;","names":["chalk","chalk","inquirer","chalk","chalk","inquirer","chalk","path","chalk","fs","fs","fs","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","axios","chalk","chalk","chalk","inquirer","chalk","ora","path","chalk","ora","path","chalk"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/utils/detect.ts","../src/utils/logger.ts","../src/prompts/platform.ts","../src/prompts/github.ts","../src/generators/serverless.ts","../src/utils/fs.ts","../src/templates/vercel-auth.ts","../src/templates/netlify-auth.ts","../src/generators/env.ts","../src/generators/config.ts","../src/generators/code.ts","../src/validators/github.ts","../src/validators/repo.ts","../src/validators/labels.ts","../src/commands/validate.ts"],"sourcesContent":["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { initCommand } from './commands/init.js';\nimport { validateCommand } from './commands/validate.js';\n\nconst program = new Command();\n\nprogram\n .name('hale-commenting-system')\n .description('Hale Commenting System CLI - Setup wizard and tooling')\n .version('1.0.0');\n\nprogram\n .command('init')\n .description('Initialize Apollo Commenting System in your project')\n .option('-y, --yes', 'Skip prompts and use defaults')\n .option('--platform <platform>', 'Target platform (vercel, netlify, manual)')\n .action(async (options) => {\n try {\n await initCommand(options);\n } catch (error: any) {\n console.error(chalk.red('\\n✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate your commenting system setup')\n .action(async () => {\n try {\n await validateCommand();\n } catch (error: any) {\n console.error(chalk.red('\\n✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\nprogram\n .command('update')\n .description('Update existing configuration')\n .action(() => {\n console.log(chalk.yellow('\\n⚠️ Coming soon: Update configuration\\n'));\n console.log(chalk.dim('For now, you can manually edit apollo-comments.config.json\\n'));\n });\n\n// Show help if no command provided\nif (!process.argv.slice(2).length) {\n program.help();\n}\n\nprogram.parse();\n\n","import chalk from 'chalk';\nimport ora from 'ora';\nimport inquirer from 'inquirer';\nimport { detectProject } from '../utils/detect.js';\nimport { printWelcome, printSetupInstructions, printSuccess, printNextSteps, printWarning } from '../utils/logger.js';\nimport { promptPlatform } from '../prompts/platform.js';\nimport { promptGitHubConfig } from '../prompts/github.js';\nimport { generateServerless } from '../generators/serverless.js';\nimport { generateEnvFiles } from '../generators/env.js';\nimport { generateConfig } from '../generators/config.js';\nimport { integrateProviders, showIntegrationDiff } from '../generators/code.js';\nimport { validateGitHubConnection } from '../validators/github.js';\nimport { validateRepoAccess } from '../validators/repo.js';\nimport { ensureLabels } from '../validators/labels.js';\n\ninterface InitOptions {\n yes?: boolean;\n platform?: string;\n}\n\nexport async function initCommand(options: InitOptions) {\n printWelcome();\n\n const spinner = ora('Detecting project...').start();\n\n // Step 1: Detect project type\n let project;\n try {\n project = await detectProject(process.cwd());\n spinner.succeed(`Detected: ${project.framework} with ${project.buildTool}`);\n } catch (error: any) {\n spinner.fail(error.message);\n process.exit(1);\n }\n\n if (!project.isReact) {\n spinner.fail('This package requires a React project');\n console.log(chalk.red('\\n✗ Apollo Commenting System requires React.\\n'));\n process.exit(1);\n }\n\n if (!project.hasPatternFly) {\n printWarning('PatternFly not detected. This package is optimized for PatternFly projects.');\n if (!options.yes) {\n const { continueAnyway } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'continueAnyway',\n message: 'Continue anyway?',\n default: false\n }\n ]);\n if (!continueAnyway) {\n console.log(chalk.dim('\\nSetup cancelled.\\n'));\n process.exit(0);\n }\n }\n }\n\n // Step 2: Select platform\n const platform = options.platform || await promptPlatform(project.root);\n\n // Step 3: Prompt for GitHub OAuth settings\n const githubConfig = await promptGitHubConfig(options.yes || false);\n\n // Step 4: Validate GitHub connection\n spinner.start('Validating GitHub connection...');\n const isValid = await validateGitHubConnection(githubConfig);\n if (!isValid) {\n spinner.fail('GitHub connection failed. Please check your internet connection.');\n process.exit(1);\n }\n spinner.succeed('GitHub connection validated');\n\n // Step 5: Validate repo access\n spinner.start('Checking repository access...');\n const hasAccess = await validateRepoAccess(githubConfig);\n if (!hasAccess) {\n spinner.fail('Cannot access repository. Check the owner/repo name.');\n process.exit(1);\n }\n spinner.succeed('Repository access confirmed');\n\n // Step 6: Ensure labels exist\n spinner.start('Checking issue labels...');\n await ensureLabels(githubConfig);\n spinner.succeed('Issue labels documented');\n\n // Step 7: Generate serverless functions\n spinner.start('Generating serverless functions...');\n try {\n await generateServerless(platform, project.root);\n spinner.succeed('Serverless functions created');\n } catch (error: any) {\n spinner.fail(`Failed to generate serverless functions: ${error.message}`);\n process.exit(1);\n }\n\n // Step 8: Generate environment files\n spinner.start('Creating environment files...');\n try {\n await generateEnvFiles(githubConfig, platform, project.root);\n spinner.succeed('Environment files created');\n } catch (error: any) {\n spinner.fail(`Failed to create environment files: ${error.message}`);\n process.exit(1);\n }\n\n // Step 9: Generate config file\n spinner.start('Creating apollo-comments.config.json...');\n try {\n await generateConfig(githubConfig, platform, project.root);\n spinner.succeed('Configuration file created');\n } catch (error: any) {\n spinner.fail(`Failed to create config file: ${error.message}`);\n process.exit(1);\n }\n\n // Step 10: Offer auto-integration\n printSuccess();\n \n if (!options.yes) {\n const { autoIntegrate } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'autoIntegrate',\n message: 'Automatically integrate providers into your App file?',\n default: true\n }\n ]);\n\n if (autoIntegrate) {\n spinner.start('Integrating providers...');\n const result = await integrateProviders(project.root);\n \n if (result.success) {\n spinner.succeed('Providers integrated!');\n showIntegrationDiff(result.filePath);\n console.log(chalk.green('✓ Your app is ready to use the commenting system!\\n'));\n console.log(chalk.cyan('Next steps:'));\n console.log(chalk.white('1. Review the changes in your App file'));\n console.log(chalk.white('2. Start your dev server: npm run start:dev'));\n console.log(chalk.white('3. Open http://localhost:9000\\n'));\n } else {\n spinner.warn(result.message);\n console.log(chalk.yellow('\\nFalling back to manual integration:\\n'));\n printSetupInstructions(platform, project);\n printNextSteps();\n }\n } else {\n printSetupInstructions(platform, project);\n printNextSteps();\n }\n } else {\n // If --yes flag, skip integration and show manual instructions\n printSetupInstructions(platform, project);\n printNextSteps();\n }\n}\n\n","import fs from 'fs/promises';\nimport path from 'path';\n\nexport interface ProjectInfo {\n root: string;\n framework: string;\n buildTool: string;\n isReact: boolean;\n hasPatternFly: boolean;\n hasTypeScript: boolean;\n packageJson: any;\n}\n\nexport async function detectProject(cwd: string): Promise<ProjectInfo> {\n const packageJsonPath = path.join(cwd, 'package.json');\n \n let packageJson: any = {};\n try {\n const content = await fs.readFile(packageJsonPath, 'utf-8');\n packageJson = JSON.parse(content);\n } catch (error) {\n throw new Error('No package.json found. Are you in a Node.js project?');\n }\n\n const deps = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies\n };\n\n const buildTool = await detectBuildTool(cwd, deps);\n\n return {\n root: cwd,\n framework: detectFramework(deps),\n buildTool,\n isReact: !!deps['react'],\n hasPatternFly: !!deps['@patternfly/react-core'],\n hasTypeScript: !!deps['typescript'],\n packageJson\n };\n}\n\nfunction detectFramework(deps: any): string {\n if (deps['react']) return 'React';\n if (deps['vue']) return 'Vue';\n if (deps['@angular/core']) return 'Angular';\n return 'Unknown';\n}\n\nasync function detectBuildTool(cwd: string, deps: any): Promise<string> {\n if (deps['vite']) return 'Vite';\n if (deps['webpack']) return 'Webpack';\n \n try {\n await fs.access(path.join(cwd, 'next.config.js'));\n return 'Next.js';\n } catch {\n // Next.js config not found\n }\n\n return 'Unknown';\n}\n\nexport async function detectPlatform(cwd: string): Promise<string | null> {\n try {\n await fs.access(path.join(cwd, 'vercel.json'));\n return 'vercel';\n } catch {\n // Not Vercel\n }\n\n try {\n await fs.access(path.join(cwd, 'netlify.toml'));\n return 'netlify';\n } catch {\n // Not Netlify\n }\n\n return null;\n}\n\n","import chalk from 'chalk';\n\nexport function printWelcome() {\n console.log(chalk.bold.cyan('\\n🚀 Hale Commenting System Setup Wizard\\n'));\n}\n\nexport function printSetupInstructions(platform: string, project: any) {\n console.log(chalk.bold('\\n📝 Manual Setup Required:\\n'));\n\n console.log(chalk.cyan('1. Add the CommentProvider to your App.tsx:\\n'));\n \n console.log(chalk.white(`import {\n CommentProvider,\n VersionProvider,\n GitHubAuthProvider,\n CommentOverlay,\n CommentDrawer\n} from '@apollo/commenting-system';\nimport apolloCommentsConfig from './apollo-comments.config.json';\nimport React from 'react';\n\nfunction App() {\n const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);\n\n return (\n <GitHubAuthProvider config={apolloCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n {/* Your app content */}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n );\n}\n`));\n\n console.log(chalk.cyan('\\n2. Deploy your serverless functions:\\n'));\n\n if (platform === 'vercel') {\n console.log(chalk.white(' vercel --prod'));\n } else if (platform === 'netlify') {\n console.log(chalk.white(' netlify deploy --prod'));\n } else {\n console.log(chalk.white(' Follow your platform\\'s deployment guide'));\n }\n\n console.log(chalk.cyan('\\n3. Update your GitHub OAuth App callback URL:\\n'));\n console.log(chalk.white(' https://your-domain.com/api/github-oauth-callback\\n'));\n}\n\nexport function printSuccess() {\n console.log(chalk.green.bold('\\n✓ Setup complete!\\n'));\n}\n\nexport function printNextSteps() {\n console.log(chalk.cyan('\\nNext steps:'));\n console.log(chalk.white('1. Review generated files in your project'));\n console.log(chalk.white('2. Add the CommentProvider to your App.tsx (see instructions above)'));\n console.log(chalk.white('3. Deploy your serverless functions'));\n console.log(chalk.white('4. Run: npm run dev\\n'));\n\n console.log(chalk.dim('Run \"hale-commenting-system validate\" to verify your setup.\\n'));\n}\n\nexport function printError(message: string) {\n console.log(chalk.red.bold(`\\n✗ Error: ${message}\\n`));\n}\n\nexport function printWarning(message: string) {\n console.log(chalk.yellow(`⚠️ ${message}`));\n}\n\n","import inquirer from 'inquirer';\nimport chalk from 'chalk';\nimport { detectPlatform } from '../utils/detect.js';\n\nexport async function promptPlatform(projectRoot: string): Promise<string> {\n // Auto-detect platform\n const detectedPlatform = await detectPlatform(projectRoot);\n\n if (detectedPlatform) {\n console.log(chalk.green(`✓ Detected ${detectedPlatform} configuration`));\n \n const { usePlatform } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'usePlatform',\n message: `Use ${detectedPlatform} for serverless functions?`,\n default: true\n }\n ]);\n\n if (usePlatform) {\n return detectedPlatform;\n }\n }\n\n const { platform } = await inquirer.prompt([\n {\n type: 'list',\n name: 'platform',\n message: 'Select your deployment platform:',\n choices: [\n { name: 'Vercel', value: 'vercel' },\n { name: 'Netlify', value: 'netlify' },\n { name: 'Manual (I will configure myself)', value: 'manual' }\n ]\n }\n ]);\n\n return platform;\n}\n\n","import inquirer from 'inquirer';\nimport chalk from 'chalk';\n\nexport interface GitHubConfig {\n clientId: string;\n clientSecret: string;\n owner: string;\n repo: string;\n}\n\nexport async function promptGitHubConfig(skipPrompts: boolean = false): Promise<GitHubConfig> {\n if (skipPrompts) {\n console.log(chalk.yellow('Using default/environment values...'));\n return {\n clientId: process.env.GITHUB_CLIENT_ID || '',\n clientSecret: process.env.GITHUB_CLIENT_SECRET || '',\n owner: process.env.GITHUB_OWNER || '',\n repo: process.env.GITHUB_REPO || ''\n };\n }\n\n console.log(chalk.bold('\\n📋 GitHub OAuth Configuration\\n'));\n console.log(chalk.dim('You need to create a GitHub OAuth App:'));\n console.log(chalk.dim('https://github.com/settings/developers\\n'));\n\n const answers = await inquirer.prompt<GitHubConfig>([\n {\n type: 'input',\n name: 'clientId',\n message: 'GitHub OAuth Client ID:',\n validate: (input: string) => input.length > 0 || 'Client ID is required'\n },\n {\n type: 'password',\n name: 'clientSecret',\n message: 'GitHub OAuth Client Secret:',\n mask: '*',\n validate: (input: string) => input.length > 0 || 'Client Secret is required'\n },\n {\n type: 'input',\n name: 'owner',\n message: 'GitHub Repository Owner (user or org):',\n validate: (input: string) => input.length > 0 || 'Owner is required'\n },\n {\n type: 'input',\n name: 'repo',\n message: 'GitHub Repository Name:',\n validate: (input: string) => input.length > 0 || 'Repository name is required'\n }\n ]);\n\n return answers;\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { ensureDir, writeFile } from '../utils/fs.js';\nimport { vercelAuthLoginTemplate, vercelAuthCallbackTemplate } from '../templates/vercel-auth.js';\nimport { netlifyAuthLoginTemplate, netlifyAuthCallbackTemplate } from '../templates/netlify-auth.js';\n\nexport async function generateServerless(platform: string, projectRoot: string): Promise<void> {\n if (platform === 'vercel') {\n const apiDir = path.join(projectRoot, 'api');\n await ensureDir(apiDir);\n\n await writeFile(\n path.join(apiDir, 'github-oauth-login.ts'),\n vercelAuthLoginTemplate\n );\n\n await writeFile(\n path.join(apiDir, 'github-oauth-callback.ts'),\n vercelAuthCallbackTemplate\n );\n\n console.log(chalk.dim(' → Created api/github-oauth-login.ts'));\n console.log(chalk.dim(' → Created api/github-oauth-callback.ts'));\n } else if (platform === 'netlify') {\n const functionsDir = path.join(projectRoot, 'netlify', 'functions');\n await ensureDir(functionsDir);\n\n await writeFile(\n path.join(functionsDir, 'github-oauth-login.ts'),\n netlifyAuthLoginTemplate\n );\n\n await writeFile(\n path.join(functionsDir, 'github-oauth-callback.ts'),\n netlifyAuthCallbackTemplate\n );\n\n console.log(chalk.dim(' → Created netlify/functions/github-oauth-login.ts'));\n console.log(chalk.dim(' → Created netlify/functions/github-oauth-callback.ts'));\n } else {\n console.log(chalk.yellow(' Manual platform selected. You must create serverless functions yourself.'));\n console.log(chalk.dim(' See: https://github.com/apollo/commenting-system/blob/main/docs/manual-setup.md'));\n }\n}\n\n","import fs from 'fs/promises';\nimport path from 'path';\n\nexport async function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function ensureDir(dirPath: string): Promise<void> {\n await fs.mkdir(dirPath, { recursive: true });\n}\n\nexport async function writeFileIfNotExists(filePath: string, content: string): Promise<boolean> {\n const exists = await fileExists(filePath);\n if (exists) {\n return false;\n }\n \n await fs.writeFile(filePath, content, 'utf-8');\n return true;\n}\n\nexport async function appendToFile(filePath: string, content: string): Promise<void> {\n await fs.appendFile(filePath, content, 'utf-8');\n}\n\nexport async function readFile(filePath: string): Promise<string> {\n return fs.readFile(filePath, 'utf-8');\n}\n\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n await fs.writeFile(filePath, content, 'utf-8');\n}\n\nexport function getRelativePath(from: string, to: string): string {\n return path.relative(from, to);\n}\n\n","export const vercelAuthLoginTemplate = `import { VercelRequest, VercelResponse } from '@vercel/node';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {\n try {\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n \n if (!clientId) {\n res.status(500).json({ error: 'GitHub OAuth not configured - missing client ID' });\n return;\n }\n\n // Get the base URL from the request\n const protocol = (req.headers['x-forwarded-proto'] as string) || 'https';\n const host = (req.headers.host || req.headers['x-forwarded-host']) as string;\n \n if (!host) {\n res.status(500).json({ error: 'Could not determine host' });\n return;\n }\n \n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUri = \\`\\${baseUrl}/api/github-oauth-callback\\`;\n\n // Redirect to GitHub OAuth\n // Scope: public_repo allows read/write access to public repositories only\n const githubAuthUrl = \\`https://github.com/login/oauth/authorize?client_id=\\${clientId}&redirect_uri=\\${encodeURIComponent(redirectUri)}&scope=public_repo\\`;\n\n res.redirect(302, githubAuthUrl);\n } catch (error: any) {\n res.status(500).json({ \n error: 'Internal server error', \n details: error.message\n });\n }\n}\n`;\n\nexport const vercelAuthCallbackTemplate = `import { VercelRequest, VercelResponse } from '@vercel/node';\nimport axios from 'axios';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {\n try {\n const code = req.query.code as string;\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n const clientSecret = process.env.GITHUB_CLIENT_SECRET;\n\n if (!code) {\n res.status(400).json({ error: 'No code provided' });\n return;\n }\n\n if (!clientId || !clientSecret) {\n res.status(500).json({ error: 'GitHub OAuth not configured properly' });\n return;\n }\n\n // Exchange code for access token\n const tokenResponse = await axios.post(\n 'https://github.com/login/oauth/access_token',\n {\n client_id: clientId,\n client_secret: clientSecret,\n code,\n },\n {\n headers: {\n Accept: 'application/json',\n },\n }\n );\n\n const accessToken = tokenResponse.data.access_token;\n\n if (!accessToken) {\n throw new Error('No access token received');\n }\n\n // Get user info\n const userResponse = await axios.get('https://api.github.com/user', {\n headers: {\n Authorization: \\`token \\${accessToken}\\`,\n },\n });\n\n const user = userResponse.data;\n\n // Redirect back to the app with token in URL fragment (client-side only)\n const protocol = req.headers['x-forwarded-proto'] || 'https';\n const host = req.headers.host || req.headers['x-forwarded-host'];\n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUrl = \\`\\${baseUrl}/#/auth-callback?token=\\${accessToken}&login=\\${user.login}&avatar=\\${encodeURIComponent(user.avatar_url)}\\`;\n\n res.redirect(302, redirectUrl);\n } catch (error: any) {\n res.status(500).json({\n error: 'Failed to exchange code for token',\n details: error.message,\n });\n }\n}\n`;\n\n","export const netlifyAuthLoginTemplate = `import { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';\nimport axios from 'axios';\n\nconst handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {\n try {\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n \n if (!clientId) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'GitHub OAuth not configured - missing client ID' })\n };\n }\n\n // Get the base URL from the request\n const protocol = event.headers['x-forwarded-proto'] || 'https';\n const host = event.headers.host;\n \n if (!host) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'Could not determine host' })\n };\n }\n \n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUri = \\`\\${baseUrl}/.netlify/functions/github-oauth-callback\\`;\n\n // Redirect to GitHub OAuth\n const githubAuthUrl = \\`https://github.com/login/oauth/authorize?client_id=\\${clientId}&redirect_uri=\\${encodeURIComponent(redirectUri)}&scope=public_repo\\`;\n\n return {\n statusCode: 302,\n headers: {\n Location: githubAuthUrl\n },\n body: ''\n };\n } catch (error: any) {\n return {\n statusCode: 500,\n body: JSON.stringify({ \n error: 'Internal server error', \n details: error.message\n })\n };\n }\n};\n\nexport { handler };\n`;\n\nexport const netlifyAuthCallbackTemplate = `import { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';\nimport axios from 'axios';\n\nconst handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {\n try {\n const code = event.queryStringParameters?.code;\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n const clientSecret = process.env.GITHUB_CLIENT_SECRET;\n\n if (!code) {\n return {\n statusCode: 400,\n body: JSON.stringify({ error: 'No code provided' })\n };\n }\n\n if (!clientId || !clientSecret) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'GitHub OAuth not configured properly' })\n };\n }\n\n // Exchange code for access token\n const tokenResponse = await axios.post(\n 'https://github.com/login/oauth/access_token',\n {\n client_id: clientId,\n client_secret: clientSecret,\n code,\n },\n {\n headers: {\n Accept: 'application/json',\n },\n }\n );\n\n const accessToken = tokenResponse.data.access_token;\n\n if (!accessToken) {\n throw new Error('No access token received');\n }\n\n // Get user info\n const userResponse = await axios.get('https://api.github.com/user', {\n headers: {\n Authorization: \\`token \\${accessToken}\\`,\n },\n });\n\n const user = userResponse.data;\n\n // Redirect back to the app with token in URL fragment\n const protocol = event.headers['x-forwarded-proto'] || 'https';\n const host = event.headers.host;\n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUrl = \\`\\${baseUrl}/#/auth-callback?token=\\${accessToken}&login=\\${user.login}&avatar=\\${encodeURIComponent(user.avatar_url)}\\`;\n\n return {\n statusCode: 302,\n headers: {\n Location: redirectUrl\n },\n body: ''\n };\n } catch (error: any) {\n return {\n statusCode: 500,\n body: JSON.stringify({\n error: 'Failed to exchange code for token',\n details: error.message,\n })\n };\n }\n};\n\nexport { handler };\n`;\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { fileExists, appendToFile, writeFile, readFile } from '../utils/fs.js';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function generateEnvFiles(\n githubConfig: GitHubConfig, \n platform: string, \n projectRoot: string\n): Promise<void> {\n const envContent = `\n# Apollo Commenting System Configuration\n# Generated by apollo-comments CLI\n\n# GitHub OAuth\nGITHUB_CLIENT_ID=${githubConfig.clientId}\nGITHUB_CLIENT_SECRET=${githubConfig.clientSecret}\nGITHUB_OWNER=${githubConfig.owner}\nGITHUB_REPO=${githubConfig.repo}\n\n# Vite (if using Vite)\nVITE_GITHUB_CLIENT_ID=${githubConfig.clientId}\nVITE_GITHUB_OWNER=${githubConfig.owner}\nVITE_GITHUB_REPO=${githubConfig.repo}\n`;\n\n const envLocalPath = path.join(projectRoot, '.env.local');\n const envPath = path.join(projectRoot, '.env');\n\n // Check if .env.local exists and already contains GitHub config\n const envLocalExists = await fileExists(envLocalPath);\n \n if (envLocalExists) {\n const existingEnv = await readFile(envLocalPath);\n if (existingEnv.includes('GITHUB_CLIENT_ID')) {\n console.log(chalk.yellow(' .env.local already contains GitHub config. Skipping...'));\n } else {\n await appendToFile(envLocalPath, envContent);\n console.log(chalk.dim(' → Updated .env.local'));\n }\n } else {\n await writeFile(envLocalPath, envContent.trim());\n console.log(chalk.dim(' → Created .env.local'));\n }\n\n // Create .env.example without secrets\n const envExampleContent = `# Apollo Commenting System Configuration\n\n# GitHub OAuth (get from https://github.com/settings/developers)\nGITHUB_CLIENT_ID=your_client_id_here\nGITHUB_CLIENT_SECRET=your_client_secret_here\nGITHUB_OWNER=your_github_org\nGITHUB_REPO=your_repo_name\n\n# Vite (if using Vite)\nVITE_GITHUB_CLIENT_ID=your_client_id_here\nVITE_GITHUB_OWNER=your_github_org\nVITE_GITHUB_REPO=your_repo_name\n`;\n\n await writeFile(path.join(projectRoot, '.env.example'), envExampleContent);\n console.log(chalk.dim(' → Created .env.example'));\n\n // Add .env.local to .gitignore if not already present\n const gitignorePath = path.join(projectRoot, '.gitignore');\n if (await fileExists(gitignorePath)) {\n const gitignoreContent = await readFile(gitignorePath);\n if (!gitignoreContent.includes('.env.local')) {\n await appendToFile(gitignorePath, '\\n# Apollo Commenting System\\n.env.local\\n');\n console.log(chalk.dim(' → Updated .gitignore'));\n }\n }\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { writeFile } from '../utils/fs.js';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function generateConfig(\n githubConfig: GitHubConfig,\n platform: string,\n projectRoot: string\n): Promise<void> {\n // Build redirect URI based on platform\n let redirectUri = 'http://localhost:9000/api/github-oauth-callback';\n \n if (platform === 'netlify') {\n redirectUri = 'https://your-domain.com/.netlify/functions/github-oauth-callback';\n } else if (platform === 'vercel') {\n redirectUri = 'https://your-domain.com/api/github-oauth-callback';\n }\n\n const config = {\n version: '1.0.0',\n platform,\n github: {\n owner: githubConfig.owner,\n repo: githubConfig.repo,\n clientId: githubConfig.clientId\n },\n redirectUri,\n features: {\n aiSummarization: true,\n versionTracking: true,\n gitlabIntegration: false\n },\n labels: [\n { name: 'comment', color: '0075ca', description: 'User feedback comment' },\n { name: 'prototype-feedback', color: 'd93f0b', description: 'Prototype feedback' },\n { name: 'needs-review', color: 'fbca04', description: 'Needs team review' }\n ]\n };\n\n const configPath = path.join(projectRoot, 'apollo-comments.config.json');\n await writeFile(configPath, JSON.stringify(config, null, 2));\n console.log(chalk.dim(' → Created apollo-comments.config.json'));\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { readFile, writeFile, fileExists } from '../utils/fs.js';\n\ninterface IntegrationResult {\n success: boolean;\n filePath: string;\n message: string;\n}\n\nexport async function integrateProviders(projectRoot: string): Promise<IntegrationResult> {\n // Find the App entry point - try common locations\n const possiblePaths = [\n 'src/app/index.tsx',\n 'src/app/App.tsx',\n 'src/App.tsx',\n 'src/index.tsx'\n ];\n\n let appFilePath: string | null = null;\n \n for (const p of possiblePaths) {\n const fullPath = path.join(projectRoot, p);\n if (await fileExists(fullPath)) {\n appFilePath = fullPath;\n break;\n }\n }\n\n if (!appFilePath) {\n return {\n success: false,\n filePath: '',\n message: 'Could not find App entry point. Please integrate manually.'\n };\n }\n\n try {\n const content = await readFile(appFilePath);\n \n // Check if already integrated\n if (content.includes('hale-commenting-system') || content.includes('GitHubAuthProvider')) {\n return {\n success: false,\n filePath: appFilePath,\n message: 'Providers already integrated or commenting system imports found.'\n };\n }\n\n const modifiedContent = injectProviders(content);\n \n if (modifiedContent === content) {\n return {\n success: false,\n filePath: appFilePath,\n message: 'Could not automatically integrate. File structure not recognized.'\n };\n }\n\n await writeFile(appFilePath, modifiedContent);\n\n return {\n success: true,\n filePath: appFilePath,\n message: `Successfully integrated providers into ${path.relative(projectRoot, appFilePath)}`\n };\n } catch (error: any) {\n return {\n success: false,\n filePath: appFilePath,\n message: `Error: ${error.message}`\n };\n }\n}\n\nfunction injectProviders(content: string): string {\n // Add imports at the top (after existing imports)\n const imports = `import {\n CommentProvider,\n VersionProvider,\n GitHubAuthProvider,\n CommentOverlay,\n CommentDrawer\n} from 'hale-commenting-system';\nimport apolloCommentsConfig from './apollo-comments.config.json';`;\n\n // Find the last import statement\n const importRegex = /import\\s+.*?from\\s+['\"].*?['\"];?/g;\n const matches = content.match(importRegex);\n \n if (!matches || matches.length === 0) {\n // No imports found, add at the beginning\n content = imports + '\\n\\n' + content;\n } else {\n const lastImport = matches[matches.length - 1];\n const lastImportIndex = content.lastIndexOf(lastImport);\n const insertPosition = lastImportIndex + lastImport.length;\n content = content.slice(0, insertPosition) + '\\n\\n' + imports + content.slice(insertPosition);\n }\n\n // Find the return statement with Router/App structure\n // Look for patterns like: return ( <Router> or return <Router>\n const returnMatch = content.match(/return\\s*\\(?[\\s\\n]*<(\\w+)/);\n \n if (!returnMatch) {\n return content; // Can't find return statement\n }\n\n const componentName = returnMatch[1]; // Router, Fragment, etc.\n \n // Find the closing tag\n const closingTag = `</${componentName}>`;\n const closingIndex = content.indexOf(closingTag);\n \n if (closingIndex === -1) {\n return content; // Can't find closing tag\n }\n\n // Add state hook before return\n const stateHook = ` const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);\\n\\n`;\n \n // Find the function body (after function declaration)\n const functionMatch = content.match(/const\\s+\\w+.*?=.*?\\(\\).*?=>\\s*\\{/);\n if (functionMatch) {\n const insertPos = functionMatch.index! + functionMatch[0].length;\n content = content.slice(0, insertPos) + '\\n' + stateHook + content.slice(insertPos);\n }\n\n // Wrap the return content with providers\n const returnStartMatch = content.match(/return\\s*\\(/);\n if (returnStartMatch) {\n const returnStart = returnStartMatch.index! + returnStartMatch[0].length;\n const returnEnd = content.indexOf(closingTag, returnStart) + closingTag.length;\n \n const originalReturn = content.slice(returnStart, returnEnd);\n \n const wrappedReturn = `\n <GitHubAuthProvider config={apolloCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n ${originalReturn.trim()}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n `;\n \n content = content.slice(0, returnStart) + wrappedReturn + content.slice(returnEnd);\n }\n\n return content;\n}\n\nexport function showIntegrationDiff(filePath: string) {\n console.log(chalk.cyan('\\nChanges made to your App file:'));\n console.log(chalk.white('• Added commenting system imports'));\n console.log(chalk.white('• Added state hook for comment thread selection'));\n console.log(chalk.white('• Wrapped app with GitHubAuthProvider, VersionProvider, and CommentProvider'));\n console.log(chalk.white('• Added CommentDrawer and CommentOverlay components\\n'));\n console.log(chalk.dim(`Modified: ${filePath}\\n`));\n}\n\n","import axios from 'axios';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function validateGitHubConnection(config: GitHubConfig): Promise<boolean> {\n try {\n // Test basic GitHub API connectivity\n const response = await axios.get('https://api.github.com/rate_limit', {\n headers: {\n 'Accept': 'application/vnd.github.v3+json'\n },\n timeout: 5000\n });\n return response.status === 200;\n } catch (error) {\n console.error('GitHub connection error:', error);\n return false;\n }\n}\n\n","import axios from 'axios';\nimport chalk from 'chalk';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function validateRepoAccess(config: GitHubConfig): Promise<boolean> {\n try {\n // Note: This checks if the repo exists publicly\n // Private repos would need authentication\n const response = await axios.get(\n `https://api.github.com/repos/${config.owner}/${config.repo}`,\n {\n headers: {\n 'Accept': 'application/vnd.github.v3+json'\n },\n timeout: 5000\n }\n );\n return response.status === 200;\n } catch (error: any) {\n if (error.response?.status === 404) {\n console.log(chalk.yellow(` Repository ${config.owner}/${config.repo} not found or is private`));\n console.log(chalk.yellow(' Note: Private repos require authentication at runtime'));\n // We'll allow this to proceed since private repos are valid\n return true;\n }\n console.error(' Repo access error:', error.message);\n return false;\n }\n}\n\n","import chalk from 'chalk';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nconst REQUIRED_LABELS = [\n { name: 'comment', color: '0075ca', description: 'User feedback comment' },\n { name: 'prototype-feedback', color: 'd93f0b', description: 'Prototype feedback' },\n { name: 'needs-review', color: 'fbca04', description: 'Needs team review' }\n];\n\nexport async function ensureLabels(config: GitHubConfig): Promise<void> {\n // Note: Creating labels requires authentication\n // For now, just inform the user about required labels\n console.log(chalk.dim('\\n Required labels for GitHub issues:'));\n REQUIRED_LABELS.forEach(label => {\n console.log(chalk.dim(` - ${label.name} (#${label.color}): ${label.description}`));\n });\n console.log(chalk.dim(' These will be created automatically at runtime with proper authentication.\\n'));\n}\n\nexport function getRequiredLabels() {\n return REQUIRED_LABELS;\n}\n\n","import chalk from 'chalk';\nimport ora from 'ora';\nimport path from 'path';\nimport { fileExists, readFile } from '../utils/fs.js';\nimport { validateGitHubConnection } from '../validators/github.js';\nimport { validateRepoAccess } from '../validators/repo.js';\n\nexport async function validateCommand() {\n console.log(chalk.bold.cyan('\\n🔍 Validating Apollo Commenting System Setup\\n'));\n\n const spinner = ora('Checking configuration files...').start();\n const cwd = process.cwd();\n\n // Check for config file\n const configPath = path.join(cwd, 'apollo-comments.config.json');\n const hasConfig = await fileExists(configPath);\n \n if (!hasConfig) {\n spinner.fail('Configuration file not found');\n console.log(chalk.red('\\n✗ apollo-comments.config.json not found'));\n console.log(chalk.dim(' Run: apollo-comments init\\n'));\n process.exit(1);\n }\n\n let config: any;\n try {\n const configContent = await readFile(configPath);\n config = JSON.parse(configContent);\n spinner.succeed('Configuration file found');\n } catch (error) {\n spinner.fail('Invalid configuration file');\n console.log(chalk.red('\\n✗ Could not parse apollo-comments.config.json\\n'));\n process.exit(1);\n }\n\n // Check for .env.local\n spinner.start('Checking environment files...');\n const envPath = path.join(cwd, '.env.local');\n const hasEnv = await fileExists(envPath);\n \n if (!hasEnv) {\n spinner.warn('Environment file not found (.env.local)');\n } else {\n spinner.succeed('Environment file found');\n }\n\n // Check for serverless functions\n spinner.start('Checking serverless functions...');\n let hasServerless = false;\n \n if (config.platform === 'vercel') {\n const apiDir = path.join(cwd, 'api');\n const loginPath = path.join(apiDir, 'github-oauth-login.ts');\n const callbackPath = path.join(apiDir, 'github-oauth-callback.ts');\n hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);\n } else if (config.platform === 'netlify') {\n const functionsDir = path.join(cwd, 'netlify', 'functions');\n const loginPath = path.join(functionsDir, 'github-oauth-login.ts');\n const callbackPath = path.join(functionsDir, 'github-oauth-callback.ts');\n hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);\n }\n\n if (!hasServerless && config.platform !== 'manual') {\n spinner.warn('Serverless functions not found');\n } else {\n spinner.succeed('Serverless functions found');\n }\n\n // Validate GitHub connection\n spinner.start('Validating GitHub connection...');\n const isValid = await validateGitHubConnection(config.github);\n if (!isValid) {\n spinner.fail('GitHub connection failed');\n console.log(chalk.red('\\n✗ Could not connect to GitHub API\\n'));\n process.exit(1);\n }\n spinner.succeed('GitHub connection validated');\n\n // Validate repo access\n spinner.start('Validating repository access...');\n const hasAccess = await validateRepoAccess(config.github);\n if (!hasAccess) {\n spinner.warn('Repository access could not be confirmed');\n } else {\n spinner.succeed('Repository access confirmed');\n }\n\n console.log(chalk.green.bold('\\n✓ Validation complete!\\n'));\n console.log(chalk.white('Your Apollo Commenting System setup looks good.\\n'));\n}\n\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,OAAOA,aAAW;;;ACDlB,OAAOC,aAAW;AAClB,OAAO,SAAS;AAChB,OAAOC,eAAc;;;ACFrB,OAAO,QAAQ;AACf,OAAO,UAAU;AAYjB,eAAsB,cAAc,KAAmC;AACrE,QAAM,kBAAkB,KAAK,KAAK,KAAK,cAAc;AAErD,MAAI,cAAmB,CAAC;AACxB,MAAI;AACF,UAAM,UAAU,MAAM,GAAG,SAAS,iBAAiB,OAAO;AAC1D,kBAAc,KAAK,MAAM,OAAO;AAAA,EAClC,SAAS,OAAO;AACd,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACxE;AAEA,QAAM,OAAO;AAAA,IACX,GAAG,YAAY;AAAA,IACf,GAAG,YAAY;AAAA,EACjB;AAEA,QAAM,YAAY,MAAM,gBAAgB,KAAK,IAAI;AAEjD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,WAAW,gBAAgB,IAAI;AAAA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UAAU,EAClB,YAAY,uCAAuC,EACnD,OAAO,YAAY;AAClB,MAAI;AACF,UAAM,gBAAgB;AAAA,EACxB,SAAS,OAAY;AACnB,YAAQ,MAAMA,QAAM,IAAI,iBAAY,GAAG,MAAM,OAAO;AACpD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,QAAQ,EAChB,YAAY,+BAA+B,EAC3C,OAAO,MAAM;AACZ,UAAQ,IAAIA,QAAM,OAAO,qDAA2C,CAAC;AACrE,UAAQ,IAAIA,QAAM,IAAI,8DAA8D,CAAC;AACvF,CAAC;AAGH,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,EAAE,QAAQ;AACjC,UAAQ,KAAK;AACf;AAEA,QAAQ,MAAM;","names":["chalk","chalk","inquirer","chalk","chalk","inquirer","chalk","path","chalk","fs","fs","fs","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","axios","chalk","chalk","chalk","inquirer","chalk","ora","path","chalk","ora","path","chalk"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hale-commenting-system",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Reusable commenting system with GitHub/GitLab integration and AI summarization",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",