hale-commenting-system 1.0.4 ā 1.0.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/cli/dist/index.js +72 -20
- package/cli/dist/index.js.map +1 -1
- package/package.json +1 -1
package/cli/dist/index.js
CHANGED
|
@@ -81,29 +81,32 @@ function printSetupInstructions(platform, project) {
|
|
|
81
81
|
CommentOverlay,
|
|
82
82
|
CommentDrawer
|
|
83
83
|
} from 'hale-commenting-system';
|
|
84
|
-
import
|
|
84
|
+
import { BrowserRouter as Router } from 'react-router-dom';
|
|
85
|
+
import haleCommentsConfig from '../../hale-comments.config.json';
|
|
85
86
|
import React from 'react';
|
|
86
87
|
|
|
87
88
|
function App() {
|
|
88
89
|
const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);
|
|
89
90
|
|
|
90
91
|
return (
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
<
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
onThreadSelect={setSelectedThreadId}
|
|
97
|
-
>
|
|
98
|
-
<CommentOverlay
|
|
92
|
+
<Router>
|
|
93
|
+
<GitHubAuthProvider config={haleCommentsConfig}>
|
|
94
|
+
<VersionProvider>
|
|
95
|
+
<CommentProvider>
|
|
96
|
+
<CommentDrawer
|
|
99
97
|
selectedThreadId={selectedThreadId}
|
|
100
98
|
onThreadSelect={setSelectedThreadId}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
>
|
|
100
|
+
<CommentOverlay
|
|
101
|
+
selectedThreadId={selectedThreadId}
|
|
102
|
+
onThreadSelect={setSelectedThreadId}
|
|
103
|
+
/>
|
|
104
|
+
{/* Your app content */}
|
|
105
|
+
</CommentDrawer>
|
|
106
|
+
</CommentProvider>
|
|
107
|
+
</VersionProvider>
|
|
108
|
+
</GitHubAuthProvider>
|
|
109
|
+
</Router>
|
|
107
110
|
);
|
|
108
111
|
}
|
|
109
112
|
`));
|
|
@@ -667,7 +670,7 @@ function injectProviders(content) {
|
|
|
667
670
|
CommentOverlay,
|
|
668
671
|
CommentDrawer
|
|
669
672
|
} from 'hale-commenting-system';
|
|
670
|
-
import
|
|
673
|
+
import haleCommentsConfig from '../../hale-comments.config.json';`;
|
|
671
674
|
const importRegex = /import\s+.*?from\s+['"].*?['"];?/g;
|
|
672
675
|
const matches = content.match(importRegex);
|
|
673
676
|
if (!matches || matches.length === 0) {
|
|
@@ -700,9 +703,37 @@ import apolloCommentsConfig from './apollo-comments.config.json';`;
|
|
|
700
703
|
if (returnStartMatch) {
|
|
701
704
|
const returnStart = returnStartMatch.index + returnStartMatch[0].length;
|
|
702
705
|
const returnEnd = content.indexOf(closingTag, returnStart) + closingTag.length;
|
|
703
|
-
const originalReturn = content.slice(returnStart, returnEnd);
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
+
const originalReturn = content.slice(returnStart, returnEnd).trim();
|
|
707
|
+
const isRouter = originalReturn.match(/^\s*<(Router|BrowserRouter)/);
|
|
708
|
+
let wrappedReturn;
|
|
709
|
+
if (isRouter) {
|
|
710
|
+
const routerMatch = originalReturn.match(/<(Router|BrowserRouter)[^>]*>([\s\S]*)<\/\1>/);
|
|
711
|
+
if (routerMatch) {
|
|
712
|
+
const routerType = routerMatch[1];
|
|
713
|
+
const innerContent = routerMatch[2];
|
|
714
|
+
wrappedReturn = `
|
|
715
|
+
<${routerType}>
|
|
716
|
+
<GitHubAuthProvider config={haleCommentsConfig}>
|
|
717
|
+
<VersionProvider>
|
|
718
|
+
<CommentProvider>
|
|
719
|
+
<CommentDrawer
|
|
720
|
+
selectedThreadId={selectedThreadId}
|
|
721
|
+
onThreadSelect={setSelectedThreadId}
|
|
722
|
+
>
|
|
723
|
+
<CommentOverlay
|
|
724
|
+
selectedThreadId={selectedThreadId}
|
|
725
|
+
onThreadSelect={setSelectedThreadId}
|
|
726
|
+
/>
|
|
727
|
+
${innerContent.trim()}
|
|
728
|
+
</CommentDrawer>
|
|
729
|
+
</CommentProvider>
|
|
730
|
+
</VersionProvider>
|
|
731
|
+
</GitHubAuthProvider>
|
|
732
|
+
</${routerType}>
|
|
733
|
+
`;
|
|
734
|
+
} else {
|
|
735
|
+
wrappedReturn = `
|
|
736
|
+
<GitHubAuthProvider config={haleCommentsConfig}>
|
|
706
737
|
<VersionProvider>
|
|
707
738
|
<CommentProvider>
|
|
708
739
|
<CommentDrawer
|
|
@@ -713,12 +744,33 @@ import apolloCommentsConfig from './apollo-comments.config.json';`;
|
|
|
713
744
|
selectedThreadId={selectedThreadId}
|
|
714
745
|
onThreadSelect={setSelectedThreadId}
|
|
715
746
|
/>
|
|
716
|
-
${originalReturn
|
|
747
|
+
${originalReturn}
|
|
717
748
|
</CommentDrawer>
|
|
718
749
|
</CommentProvider>
|
|
719
750
|
</VersionProvider>
|
|
720
751
|
</GitHubAuthProvider>
|
|
721
752
|
`;
|
|
753
|
+
}
|
|
754
|
+
} else {
|
|
755
|
+
wrappedReturn = `
|
|
756
|
+
<GitHubAuthProvider config={haleCommentsConfig}>
|
|
757
|
+
<VersionProvider>
|
|
758
|
+
<CommentProvider>
|
|
759
|
+
<CommentDrawer
|
|
760
|
+
selectedThreadId={selectedThreadId}
|
|
761
|
+
onThreadSelect={setSelectedThreadId}
|
|
762
|
+
>
|
|
763
|
+
<CommentOverlay
|
|
764
|
+
selectedThreadId={selectedThreadId}
|
|
765
|
+
onThreadSelect={setSelectedThreadId}
|
|
766
|
+
/>
|
|
767
|
+
${originalReturn}
|
|
768
|
+
</CommentDrawer>
|
|
769
|
+
</CommentProvider>
|
|
770
|
+
</VersionProvider>
|
|
771
|
+
</GitHubAuthProvider>
|
|
772
|
+
`;
|
|
773
|
+
}
|
|
722
774
|
content = content.slice(0, returnStart) + wrappedReturn + content.slice(returnEnd);
|
|
723
775
|
}
|
|
724
776
|
return content;
|
package/cli/dist/index.js.map
CHANGED
|
@@ -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/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 hale-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 'hale-commenting-system';\nimport haleCommentsConfig from './hale-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={haleCommentsConfig}>\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: 'Local development (runs locally only)', value: 'local' },\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' || platform === 'local') {\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, 'hale-comments.config.json');\n await writeFile(configPath, JSON.stringify(config, null, 2));\n console.log(chalk.dim(' ā Created hale-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, 'hale-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ā hale-comments.config.json not found'));\n console.log(chalk.dim(' Run: hale-commenting-system 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 hale-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,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,MAAmB;AAC1C,MAAI,KAAK,OAAO,EAAG,QAAO;AAC1B,MAAI,KAAK,KAAK,EAAG,QAAO;AACxB,MAAI,KAAK,eAAe,EAAG,QAAO;AAClC,SAAO;AACT;AAEA,eAAe,gBAAgB,KAAa,MAA4B;AACtE,MAAI,KAAK,MAAM,EAAG,QAAO;AACzB,MAAI,KAAK,SAAS,EAAG,QAAO;AAE5B,MAAI;AACF,UAAM,GAAG,OAAO,KAAK,KAAK,KAAK,gBAAgB,CAAC;AAChD,WAAO;AAAA,EACT,QAAQ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AAQ,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"]}
|
|
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 hale-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 'hale-commenting-system';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport haleCommentsConfig from '../../hale-comments.config.json';\nimport React from 'react';\n\nfunction App() {\n const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);\n\n return (\n <Router>\n <GitHubAuthProvider config={haleCommentsConfig}>\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 </Router>\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: 'Local development (runs locally only)', value: 'local' },\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' || platform === 'local') {\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, 'hale-comments.config.json');\n await writeFile(configPath, JSON.stringify(config, null, 2));\n console.log(chalk.dim(' ā Created hale-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 haleCommentsConfig from '../../hale-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).trim();\n \n // Check if the original return starts with <Router> or <BrowserRouter>\n const isRouter = originalReturn.match(/^\\s*<(Router|BrowserRouter)/);\n \n let wrappedReturn;\n if (isRouter) {\n // Extract Router content - need to find the inner content\n const routerMatch = originalReturn.match(/<(Router|BrowserRouter)[^>]*>([\\s\\S]*)<\\/\\1>/);\n if (routerMatch) {\n const routerType = routerMatch[1];\n const innerContent = routerMatch[2];\n \n // Put Router on outside, providers inside\n wrappedReturn = `\n <${routerType}>\n <GitHubAuthProvider config={haleCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n ${innerContent.trim()}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n </${routerType}>\n `;\n } else {\n // Fallback to wrapping everything\n wrappedReturn = `\n <GitHubAuthProvider config={haleCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n ${originalReturn}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n `;\n }\n } else {\n // No router, wrap everything normally\n wrappedReturn = `\n <GitHubAuthProvider config={haleCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n ${originalReturn}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n `;\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, 'hale-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ā hale-comments.config.json not found'));\n console.log(chalk.dim(' Run: hale-commenting-system 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 hale-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":";;;AA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nD,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