package-installer-cli 1.3.3 → 1.4.1

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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/dist/commands/email.js +1150 -0
  3. data/dist/email-templates/bugReport.js +108 -0
  4. data/dist/email-templates/collectors/bugReport.js +41 -0
  5. data/dist/email-templates/collectors/common.js +56 -0
  6. data/dist/email-templates/collectors/customMessage.js +48 -0
  7. data/dist/email-templates/collectors/docs.js +41 -0
  8. data/dist/email-templates/collectors/featureRequest.js +47 -0
  9. data/dist/email-templates/collectors/improvement.js +52 -0
  10. data/dist/email-templates/collectors/index.js +9 -0
  11. data/dist/email-templates/collectors/question.js +31 -0
  12. data/dist/email-templates/collectors/templateRequest.js +53 -0
  13. data/dist/email-templates/customMessage.js +135 -0
  14. data/dist/email-templates/docs.js +111 -0
  15. data/dist/email-templates/featureRequest.js +111 -0
  16. data/dist/email-templates/generator.js +67 -0
  17. data/dist/email-templates/improvement.js +121 -0
  18. data/dist/email-templates/index.js +15 -0
  19. data/dist/email-templates/question.js +101 -0
  20. data/dist/email-templates/styles.js +168 -0
  21. data/dist/email-templates/templateRequest.js +120 -0
  22. data/dist/email-templates/testEmail.js +56 -0
  23. data/dist/email-templates/types.js +1 -0
  24. data/dist/index.js +29 -1
  25. data/dist/utils/featureInstaller.js +4 -11
  26. data/features/ai/ai.json +547 -0
  27. data/features/analytics/analytics.json +4 -0
  28. data/features/auth/auth.json +473 -0
  29. data/features/auth/auth0/django/backend/apiexample/urls.py +10 -0
  30. data/features/auth/auth0/django/backend/apiexample/validator.py +21 -0
  31. data/features/auth/auth0/django/backend/apiexample/views.py +30 -0
  32. data/features/auth/auth0/django/backend/requirements.txt +4 -0
  33. data/features/auth/auth0/django/web-app/requirements.txt +4 -0
  34. data/features/auth/auth0/django/web-app/webappexample/settings.py +28 -0
  35. data/features/auth/auth0/django/web-app/webappexample/templates/index.html +16 -0
  36. data/features/auth/auth0/django/web-app/webappexample/urls.py +10 -0
  37. data/features/auth/auth0/django/web-app/webappexample/views.py +52 -0
  38. data/features/auth/auth0/go/backend/go.mod +8 -0
  39. data/features/auth/auth0/go/backend/main.go +60 -0
  40. data/features/auth/auth0/go/backend/middleware/jwt.go +81 -0
  41. data/features/auth/auth0/go/web-app/auth.go +56 -0
  42. data/features/auth/auth0/go/web-app/callback.go +52 -0
  43. data/features/auth/auth0/go/web-app/go.mod +11 -0
  44. data/features/auth/auth0/go/web-app/isAuthenticated.go +20 -0
  45. data/features/auth/auth0/go/web-app/login.go +47 -0
  46. data/features/auth/auth0/go/web-app/logout.go +38 -0
  47. data/features/auth/auth0/go/web-app/main.go +31 -0
  48. data/features/auth/auth0/go/web-app/router.go +44 -0
  49. data/features/auth/auth0/go/web-app/user.go +18 -0
  50. data/features/auth/auth0/ruby-on-rails/backend/Gemfile +1 -0
  51. data/features/auth/auth0/ruby-on-rails/backend/app/controllers/application_controller.rb +5 -0
  52. data/features/auth/auth0/ruby-on-rails/backend/app/controllers/concern/secured.rb +60 -0
  53. data/features/auth/auth0/ruby-on-rails/backend/app/controllers/private_controller.rb +6 -0
  54. data/features/auth/auth0/ruby-on-rails/backend/app/controllers/public-controller.rb +6 -0
  55. data/features/auth/auth0/ruby-on-rails/backend/app/lib/auth0_client.rb +59 -0
  56. data/features/auth/auth0/ruby-on-rails/web-app/Gemfile +2 -0
  57. data/features/auth/auth0/ruby-on-rails/web-app/auth0_controller.rb +41 -0
  58. data/features/auth/auth0/ruby-on-rails/web-app/config/auth0.yml +4 -0
  59. data/features/auth/auth0/ruby-on-rails/web-app/config/initializers/auth0.rb +14 -0
  60. data/features/auth/auth0/ruby-on-rails/web-app/config/routes.rb +6 -0
  61. data/features/auth/auth0/ruby-on-rails/web-app/config/secured.rb +11 -0
  62. data/features/auth/clerk/go/clerk_client.go +28 -0
  63. data/features/auth/clerk/go/go.mod +5 -0
  64. data/features/auth/clerk/go/main.go +82 -0
  65. data/features/auth/clerk/nextjs/typescript/app/layout.tsx +2 -2
  66. data/features/auth/clerk/ruby-on-rails/Gemfile +1 -0
  67. data/features/auth/clerk/ruby-on-rails/app.rb +50 -0
  68. data/features/auth/clerk/ruby-on-rails/config/initializers/clerk.rb +4 -0
  69. data/features/aws/aws.json +5207 -0
  70. data/features/database/database.json +246 -0
  71. data/features/docker/docker.json +108 -0
  72. data/features/features.json +44 -7321
  73. data/features/gitignore/gitignore.json +61 -0
  74. data/features/monitoring/monitoring.json +5 -0
  75. data/features/payment/payment.json +347 -0
  76. data/features/storage/storage.json +371 -0
  77. data/features/testing/jest/angularjs/typescript/tests/angularjs.test.ts +12 -0
  78. data/features/testing/jest/expressjs/javascript/tests/expressjs.test.js +10 -0
  79. data/features/testing/jest/expressjs/typescript/tests/expressjs.test.ts +10 -0
  80. data/features/testing/jest/nestjs/typescript/tests/nestjs.test.ts +10 -0
  81. data/features/testing/jest/nextjs/javascript/tests/nextjs.test.js +10 -0
  82. data/features/testing/jest/nextjs/typescript/tests/nextjs.test.ts +10 -0
  83. data/features/testing/jest/nuxtjs/typescript/tests/nuxtjs.test.ts +9 -0
  84. data/features/testing/jest/reactjs/javascript/tests/reactjs.test.js +10 -0
  85. data/features/testing/jest/reactjs/typescript/tests/reactjs.test.ts +10 -0
  86. data/features/testing/jest/reactjs-expressjs-shadcn/javascript/tests/reactjs.expressjs.shadcn.test.js +16 -0
  87. data/features/testing/jest/reactjs-expressjs-shadcn/typescript/tests/reactjs.expressjs.shadcn.test.ts +16 -0
  88. data/features/testing/jest/reactjs-nestjs-shadcn/typescript/tests/reactjs.nestjs.shadcn.test.ts +14 -0
  89. data/features/testing/jest/remixjs/typescript/tests/remixjs.test.ts +9 -0
  90. data/features/testing/jest/vuejs/javascript/tests/vuejs.test.ts +9 -0
  91. data/features/testing/jest/vuejs/typescript/tests/vuejs.test.ts +9 -0
  92. data/features/testing/testing.json +102 -0
  93. data/features/ui/ui.json +91 -0
  94. metadata +90 -8
  95. data/features/testing/jest/angularjs/tests/angularjs.test.js +0 -12
  96. data/features/testing/jest/expressjs/tests/javascript/expressjs.test.js +0 -12
  97. data/features/testing/jest/expressjs/tests/typescript/expressjs.test.ts +0 -12
  98. data/features/testing/jest/go/tests/go.test.js +0 -12
  99. data/features/testing/jest/nextjs/tests/javascript/nextjs.test.js +0 -12
  100. data/features/testing/jest/nextjs/tests/typescript/nextjs.test.ts +0 -12
@@ -0,0 +1,108 @@
1
+ import { EMAIL_CSS } from './styles.js';
2
+ export function generateBugReportTemplate(data, systemInfo) {
3
+ const stepsHtml = data.steps ?
4
+ `<div class="steps-list"><ol>${data.steps.split('|').map((step) => `<li>${step.trim()}</li>`).join('')}</ol></div>` :
5
+ '<p style="color: #6c757d; font-style: italic;">Not provided</p>';
6
+ return {
7
+ subject: `[Package Installer CLI] 🐛 Bug Report: ${data.title}`,
8
+ htmlBody: `
9
+ ${EMAIL_CSS}
10
+ <body>
11
+ <div class="email-container">
12
+ <div class="header">
13
+ <span class="emoji">🐛</span>
14
+ <h1>Bug Report</h1>
15
+ <p style="margin: 5px 0 0 0; opacity: 0.9;">Package Installer CLI</p>
16
+ </div>
17
+
18
+ <div class="content">
19
+ <div class="section">
20
+ <h3>Bug Title</h3>
21
+ <p><strong>${data.title}</strong></p>
22
+ </div>
23
+
24
+ <div class="section">
25
+ <h3>Description</h3>
26
+ <p>${data.description}</p>
27
+ </div>
28
+
29
+ <div class="section">
30
+ <h3>Steps to Reproduce</h3>
31
+ ${stepsHtml}
32
+ </div>
33
+
34
+ <div class="section">
35
+ <h3>Expected Behavior</h3>
36
+ <p>${data.expected || '<span style="color: #6c757d; font-style: italic;">Not provided</span>'}</p>
37
+ </div>
38
+
39
+ <div class="section">
40
+ <h3>Actual Behavior</h3>
41
+ <p>${data.actual || '<span style="color: #6c757d; font-style: italic;">Not provided</span>'}</p>
42
+ </div>
43
+
44
+ ${data.additional ? `
45
+ <div class="section">
46
+ <h3>Additional Information</h3>
47
+ <p>${data.additional}</p>
48
+ </div>
49
+ ` : ''}
50
+
51
+ <div class="system-info">
52
+ <strong>System Information:</strong><br>
53
+ - OS: ${systemInfo.platform} (${systemInfo.arch})<br>
54
+ - Node.js: ${systemInfo.nodeVersion}<br>
55
+ - CLI Version: ${systemInfo.cliVersion}<br>
56
+ - Working Directory: ${systemInfo.workingDirectory}
57
+ </div>
58
+
59
+ ${data.name || data.email ? `
60
+ <div class="contact-info">
61
+ <strong>Contact Information:</strong><br>
62
+ ${data.name ? `Name: ${data.name}<br>` : ''}
63
+ ${data.email ? `Email: ${data.email}` : ''}
64
+ </div>
65
+ ` : ''}
66
+ </div>
67
+
68
+ <div class="footer">
69
+ <div class="timestamp">Reported at: ${systemInfo.timestamp}</div>
70
+ <p style="margin: 10px 0 0 0;">Thank you for helping improve Package Installer CLI! 🚀</p>
71
+ </div>
72
+ </div>
73
+ </body>
74
+ `,
75
+ plainBody: `Hi Shariq,
76
+
77
+ I encountered a bug while using Package Installer CLI.
78
+
79
+ Bug Title: ${data.title}
80
+
81
+ Description:
82
+ ${data.description}
83
+
84
+ Steps to Reproduce:
85
+ ${data.steps ? data.steps.split('|').map((step, index) => `${index + 1}. ${step.trim()}`).join('\n') : 'Not provided'}
86
+
87
+ Expected Behavior:
88
+ ${data.expected || 'Not provided'}
89
+
90
+ Actual Behavior:
91
+ ${data.actual || 'Not provided'}
92
+
93
+ Additional Information:
94
+ ${data.additional || 'None'}
95
+
96
+ System Information:
97
+ - OS: ${systemInfo.platform} (${systemInfo.arch})
98
+ - Node.js: ${systemInfo.nodeVersion}
99
+ - CLI Version: ${systemInfo.cliVersion}
100
+ - Working Directory: ${systemInfo.workingDirectory}
101
+
102
+ Reported at: ${systemInfo.timestamp}
103
+
104
+ Best regards,
105
+ ${data.name || 'Anonymous User'}
106
+ ${data.email ? `Contact: ${data.email}` : ''}`
107
+ };
108
+ }
@@ -0,0 +1,41 @@
1
+ import inquirer from 'inquirer';
2
+ /**
3
+ * Collect bug report information from user
4
+ */
5
+ export async function collectBugReportData() {
6
+ const answers = await inquirer.prompt([
7
+ {
8
+ type: 'input',
9
+ name: 'title',
10
+ message: 'Bug title (brief description):',
11
+ validate: (input) => input.length > 0 || 'Title is required'
12
+ },
13
+ {
14
+ type: 'input',
15
+ name: 'description',
16
+ message: 'Detailed description of the bug:',
17
+ validate: (input) => input.length > 10 || 'Please provide a detailed description (min 10 characters)'
18
+ },
19
+ {
20
+ type: 'input',
21
+ name: 'steps',
22
+ message: 'Steps to reproduce (optional, use | to separate steps):'
23
+ },
24
+ {
25
+ type: 'input',
26
+ name: 'expected',
27
+ message: 'What did you expect to happen? (optional):'
28
+ },
29
+ {
30
+ type: 'input',
31
+ name: 'actual',
32
+ message: 'What actually happened? (optional):'
33
+ },
34
+ {
35
+ type: 'input',
36
+ name: 'additional',
37
+ message: 'Any additional information? (optional):'
38
+ }
39
+ ]);
40
+ return answers;
41
+ }
@@ -0,0 +1,56 @@
1
+ import inquirer from 'inquirer';
2
+ /**
3
+ * Collect user contact information (optional)
4
+ */
5
+ export async function collectContactInfo() {
6
+ const answers = await inquirer.prompt([
7
+ {
8
+ type: 'input',
9
+ name: 'name',
10
+ message: 'Your name (optional):',
11
+ },
12
+ {
13
+ type: 'input',
14
+ name: 'email',
15
+ message: 'Your email (optional, for follow-up):',
16
+ validate: (input) => {
17
+ if (!input)
18
+ return true; // Optional field
19
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
20
+ return emailRegex.test(input) || 'Please enter a valid email address';
21
+ }
22
+ }
23
+ ]);
24
+ return answers;
25
+ }
26
+ /**
27
+ * Collect quick feedback (minimal prompts for fast feedback)
28
+ */
29
+ export async function collectQuickFeedback(category) {
30
+ const answers = await inquirer.prompt([
31
+ {
32
+ type: 'input',
33
+ name: 'title',
34
+ message: `Brief ${category} summary:`,
35
+ validate: (input) => input.length > 0 || 'Summary is required'
36
+ },
37
+ {
38
+ type: 'input',
39
+ name: 'description',
40
+ message: 'Detailed description:',
41
+ validate: (input) => input.length > 10 || 'Please provide more details (min 10 characters)'
42
+ },
43
+ {
44
+ type: 'input',
45
+ name: 'email',
46
+ message: 'Your email (optional, for follow-up):',
47
+ validate: (input) => {
48
+ if (!input)
49
+ return true;
50
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
51
+ return emailRegex.test(input) || 'Please enter a valid email address';
52
+ }
53
+ }
54
+ ]);
55
+ return answers;
56
+ }
@@ -0,0 +1,48 @@
1
+ import inquirer from 'inquirer';
2
+ import chalk from 'chalk';
3
+ /**
4
+ * Collect custom message information from user with formatting instructions
5
+ */
6
+ export async function collectCustomMessageData() {
7
+ console.log(chalk.hex('#00d2d3')('\n📝 Custom Message Guidelines:'));
8
+ console.log(chalk.hex('#95afc0')('• Use clear, concise subject line'));
9
+ console.log(chalk.hex('#95afc0')('• Write body in plain text or HTML format'));
10
+ console.log(chalk.hex('#95afc0')('• Use \\n for line breaks in plain text'));
11
+ console.log(chalk.hex('#95afc0')('• HTML tags will be automatically formatted'));
12
+ console.log(chalk.hex('#95afc0')('• Example HTML: <p>Hello</p><br><strong>Important:</strong> Details'));
13
+ console.log(chalk.hex('#ffa502')('• Your message will be professionally formatted with CSS styling\n'));
14
+ const answers = await inquirer.prompt([
15
+ {
16
+ type: 'input',
17
+ name: 'title',
18
+ message: 'Email subject:',
19
+ validate: (input) => input.length > 0 || 'Subject is required'
20
+ },
21
+ {
22
+ type: 'editor',
23
+ name: 'description',
24
+ message: 'Email body (opens in your default editor):',
25
+ validate: (input) => input.length > 10 || 'Please provide a detailed message (min 10 characters)'
26
+ },
27
+ {
28
+ type: 'list',
29
+ name: 'format',
30
+ message: 'Body format:',
31
+ choices: [
32
+ { name: 'Plain Text (will be formatted automatically)', value: 'plain' },
33
+ { name: 'HTML (advanced formatting)', value: 'html' }
34
+ ]
35
+ },
36
+ {
37
+ type: 'list',
38
+ name: 'priority',
39
+ message: 'Message priority:',
40
+ choices: [
41
+ { name: 'Normal', value: 'normal' },
42
+ { name: 'High', value: 'high' },
43
+ { name: 'Urgent', value: 'urgent' }
44
+ ]
45
+ }
46
+ ]);
47
+ return answers;
48
+ }
@@ -0,0 +1,41 @@
1
+ import inquirer from 'inquirer';
2
+ /**
3
+ * Collect documentation issue information from user
4
+ */
5
+ export async function collectDocsData() {
6
+ const answers = await inquirer.prompt([
7
+ {
8
+ type: 'input',
9
+ name: 'title',
10
+ message: 'Documentation issue title:',
11
+ validate: (input) => input.length > 0 || 'Title is required'
12
+ },
13
+ {
14
+ type: 'input',
15
+ name: 'section',
16
+ message: 'Documentation section (e.g., README, commands.md):',
17
+ },
18
+ {
19
+ type: 'input',
20
+ name: 'description',
21
+ message: 'Issue description:',
22
+ validate: (input) => input.length > 10 || 'Please provide a detailed description (min 10 characters)'
23
+ },
24
+ {
25
+ type: 'input',
26
+ name: 'problems',
27
+ message: 'Current content problems (optional):'
28
+ },
29
+ {
30
+ type: 'input',
31
+ name: 'suggestions',
32
+ message: 'Suggested improvements (optional):'
33
+ },
34
+ {
35
+ type: 'input',
36
+ name: 'additional',
37
+ message: 'Additional context (optional):'
38
+ }
39
+ ]);
40
+ return answers;
41
+ }
@@ -0,0 +1,47 @@
1
+ import inquirer from 'inquirer';
2
+ /**
3
+ * Collect feature request information from user
4
+ */
5
+ export async function collectFeatureRequestData() {
6
+ const answers = await inquirer.prompt([
7
+ {
8
+ type: 'input',
9
+ name: 'title',
10
+ message: 'Feature title:',
11
+ validate: (input) => input.length > 0 || 'Title is required'
12
+ },
13
+ {
14
+ type: 'input',
15
+ name: 'description',
16
+ message: 'Detailed description of the feature:',
17
+ validate: (input) => input.length > 10 || 'Please provide a detailed description (min 10 characters)'
18
+ },
19
+ {
20
+ type: 'input',
21
+ name: 'useCase',
22
+ message: 'Use case - why do you need this feature? (optional):'
23
+ },
24
+ {
25
+ type: 'input',
26
+ name: 'solution',
27
+ message: 'Proposed solution or implementation ideas (optional):'
28
+ },
29
+ {
30
+ type: 'list',
31
+ name: 'priority',
32
+ message: 'Priority level:',
33
+ choices: [
34
+ { name: 'Low - Nice to have', value: 'Low' },
35
+ { name: 'Medium - Would be helpful', value: 'Medium' },
36
+ { name: 'High - Really needed', value: 'High' },
37
+ { name: 'Critical - Blocking my work', value: 'Critical' }
38
+ ]
39
+ },
40
+ {
41
+ type: 'input',
42
+ name: 'additional',
43
+ message: 'Additional context or information (optional):'
44
+ }
45
+ ]);
46
+ return answers;
47
+ }
@@ -0,0 +1,52 @@
1
+ import inquirer from 'inquirer';
2
+ /**
3
+ * Collect improvement suggestion information from user
4
+ */
5
+ export async function collectImprovementData() {
6
+ const answers = await inquirer.prompt([
7
+ {
8
+ type: 'input',
9
+ name: 'title',
10
+ message: 'Improvement title:',
11
+ validate: (input) => input.length > 0 || 'Title is required'
12
+ },
13
+ {
14
+ type: 'input',
15
+ name: 'current',
16
+ message: 'Current behavior (what happens now):',
17
+ validate: (input) => input.length > 0 || 'Current behavior description is required'
18
+ },
19
+ {
20
+ type: 'input',
21
+ name: 'description',
22
+ message: 'Suggested improvement:',
23
+ validate: (input) => input.length > 10 || 'Please provide a detailed suggestion (min 10 characters)'
24
+ },
25
+ {
26
+ type: 'input',
27
+ name: 'benefits',
28
+ message: 'Benefits of this improvement (optional):'
29
+ },
30
+ {
31
+ type: 'input',
32
+ name: 'implementation',
33
+ message: 'Implementation ideas (optional):'
34
+ },
35
+ {
36
+ type: 'list',
37
+ name: 'priority',
38
+ message: 'Priority level:',
39
+ choices: [
40
+ { name: 'Low - Nice to have', value: 'Low' },
41
+ { name: 'Medium - Would be helpful', value: 'Medium' },
42
+ { name: 'High - Really needed', value: 'High' }
43
+ ]
44
+ },
45
+ {
46
+ type: 'input',
47
+ name: 'additional',
48
+ message: 'Additional context (optional):'
49
+ }
50
+ ]);
51
+ return answers;
52
+ }
@@ -0,0 +1,9 @@
1
+ // Data collection exports
2
+ export { collectBugReportData } from './bugReport.js';
3
+ export { collectFeatureRequestData } from './featureRequest.js';
4
+ export { collectTemplateRequestData } from './templateRequest.js';
5
+ export { collectQuestionData } from './question.js';
6
+ export { collectImprovementData } from './improvement.js';
7
+ export { collectDocsData } from './docs.js';
8
+ export { collectCustomMessageData } from './customMessage.js';
9
+ export { collectContactInfo, collectQuickFeedback } from './common.js';
@@ -0,0 +1,31 @@
1
+ import inquirer from 'inquirer';
2
+ /**
3
+ * Collect general question information from user
4
+ */
5
+ export async function collectQuestionData() {
6
+ const answers = await inquirer.prompt([
7
+ {
8
+ type: 'input',
9
+ name: 'title',
10
+ message: 'Question summary:',
11
+ validate: (input) => input.length > 0 || 'Question summary is required'
12
+ },
13
+ {
14
+ type: 'input',
15
+ name: 'description',
16
+ message: 'Detailed question:',
17
+ validate: (input) => input.length > 10 || 'Please provide a detailed question (min 10 characters)'
18
+ },
19
+ {
20
+ type: 'input',
21
+ name: 'tried',
22
+ message: 'What have you tried so far? (optional):'
23
+ },
24
+ {
25
+ type: 'input',
26
+ name: 'expected',
27
+ message: 'What outcome are you looking for? (optional):'
28
+ }
29
+ ]);
30
+ return answers;
31
+ }
@@ -0,0 +1,53 @@
1
+ import inquirer from 'inquirer';
2
+ /**
3
+ * Collect template request information from user
4
+ */
5
+ export async function collectTemplateRequestData() {
6
+ const answers = await inquirer.prompt([
7
+ {
8
+ type: 'input',
9
+ name: 'title',
10
+ message: 'Template name:',
11
+ validate: (input) => input.length > 0 || 'Template name is required'
12
+ },
13
+ {
14
+ type: 'input',
15
+ name: 'framework',
16
+ message: 'Framework/Technology (e.g., Next.js, React, Vue, etc.):',
17
+ validate: (input) => input.length > 0 || 'Framework is required'
18
+ },
19
+ {
20
+ type: 'input',
21
+ name: 'description',
22
+ message: 'Template description:',
23
+ validate: (input) => input.length > 10 || 'Please provide a detailed description (min 10 characters)'
24
+ },
25
+ {
26
+ type: 'input',
27
+ name: 'features',
28
+ message: 'Key features/libraries needed (separate with |):',
29
+ default: 'Authentication | Database | Styling'
30
+ },
31
+ {
32
+ type: 'input',
33
+ name: 'similar',
34
+ message: 'Similar existing templates (optional):'
35
+ },
36
+ {
37
+ type: 'list',
38
+ name: 'priority',
39
+ message: 'Priority level:',
40
+ choices: [
41
+ { name: 'Low - Nice to have', value: 'Low' },
42
+ { name: 'Medium - Would be helpful', value: 'Medium' },
43
+ { name: 'High - Really needed', value: 'High' }
44
+ ]
45
+ },
46
+ {
47
+ type: 'input',
48
+ name: 'additional',
49
+ message: 'Additional requirements or context (optional):'
50
+ }
51
+ ]);
52
+ return answers;
53
+ }
@@ -0,0 +1,135 @@
1
+ import { EMAIL_CSS } from './styles.js';
2
+ /**
3
+ * Format text content based on format type
4
+ */
5
+ function formatContent(content, format) {
6
+ if (format === 'html') {
7
+ // If user provided HTML, wrap it in a content div for consistent styling
8
+ return `<div class="custom-content">${content}</div>`;
9
+ }
10
+ else {
11
+ // Convert plain text to HTML with line breaks and basic formatting
12
+ return `<div class="custom-content">${content
13
+ .replace(/\n\n/g, '</p><p>')
14
+ .replace(/\n/g, '<br>')
15
+ .replace(/^/, '<p>')
16
+ .replace(/$/, '</p>')
17
+ .replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
18
+ .replace(/\*(.*?)\*/g, '<em>$1</em>')
19
+ .replace(/`(.*?)`/g, '<code>$1</code>')}</div>`;
20
+ }
21
+ }
22
+ export function generateCustomMessageTemplate(data, systemInfo) {
23
+ const priorityClass = data.priority === 'high' ? 'priority-high' :
24
+ data.priority === 'urgent' ? 'priority-critical' : '';
25
+ const priorityBadge = data.priority === 'high' ? 'priority-high-badge' :
26
+ data.priority === 'urgent' ? 'priority-critical-badge' :
27
+ 'priority-low';
28
+ const priorityText = data.priority === 'urgent' ? 'Urgent' :
29
+ data.priority === 'high' ? 'High Priority' :
30
+ 'Normal Priority';
31
+ const formattedContent = formatContent(data.description, data.format || 'plain');
32
+ return {
33
+ subject: `[Package Installer CLI] ✉️ ${data.title}`,
34
+ htmlBody: `
35
+ ${EMAIL_CSS}
36
+ <style>
37
+ .custom-content {
38
+ background: white;
39
+ padding: 20px;
40
+ border-radius: 6px;
41
+ border: 1px solid #dee2e6;
42
+ margin: 15px 0;
43
+ line-height: 1.6;
44
+ }
45
+ .custom-content p {
46
+ margin: 10px 0;
47
+ }
48
+ .custom-content code {
49
+ background: #f8f9fa;
50
+ padding: 2px 6px;
51
+ border-radius: 4px;
52
+ font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
53
+ font-size: 0.9em;
54
+ }
55
+ .header.custom {
56
+ background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
57
+ }
58
+ </style>
59
+ <body>
60
+ <div class="email-container">
61
+ <div class="header custom">
62
+ <span class="emoji">✉️</span>
63
+ <h1>Custom Message</h1>
64
+ <p style="margin: 5px 0 0 0; opacity: 0.9;">Package Installer CLI</p>
65
+ </div>
66
+
67
+ <div class="content">
68
+ <div class="section ${priorityClass}">
69
+ <h3>Subject
70
+ <span class="priority-badge ${priorityBadge}">${priorityText}</span>
71
+ </h3>
72
+ <p><strong>${data.title}</strong></p>
73
+ </div>
74
+
75
+ <div class="section">
76
+ <h3>Message</h3>
77
+ ${formattedContent}
78
+ </div>
79
+
80
+ ${data.additional ? `
81
+ <div class="section">
82
+ <h3>Additional Information</h3>
83
+ <p>${data.additional}</p>
84
+ </div>
85
+ ` : ''}
86
+
87
+ <div class="system-info">
88
+ <strong>System Information:</strong><br>
89
+ - OS: ${systemInfo.platform} (${systemInfo.arch})<br>
90
+ - Node.js: ${systemInfo.nodeVersion}<br>
91
+ - CLI Version: ${systemInfo.cliVersion}<br>
92
+ - Working Directory: ${systemInfo.workingDirectory}
93
+ </div>
94
+
95
+ ${data.name || data.email ? `
96
+ <div class="contact-info">
97
+ <strong>Contact Information:</strong><br>
98
+ ${data.name ? `Name: ${data.name}<br>` : ''}
99
+ ${data.email ? `Email: ${data.email}` : ''}
100
+ </div>
101
+ ` : ''}
102
+ </div>
103
+
104
+ <div class="footer">
105
+ <div class="timestamp">Sent at: ${systemInfo.timestamp}</div>
106
+ <p style="margin: 10px 0 0 0;">Package Installer CLI - Custom Message 💬</p>
107
+ </div>
108
+ </div>
109
+ </body>
110
+ `,
111
+ plainBody: `Hi Shariq,
112
+
113
+ Custom message from Package Installer CLI user.
114
+
115
+ Subject: ${data.title}
116
+
117
+ Priority: ${priorityText}
118
+
119
+ Message:
120
+ ${data.description}
121
+
122
+ ${data.additional ? `Additional Information:\n${data.additional}\n` : ''}
123
+ System Information:
124
+ - OS: ${systemInfo.platform} (${systemInfo.arch})
125
+ - Node.js: ${systemInfo.nodeVersion}
126
+ - CLI Version: ${systemInfo.cliVersion}
127
+ - Working Directory: ${systemInfo.workingDirectory}
128
+
129
+ Sent at: ${systemInfo.timestamp}
130
+
131
+ Best regards,
132
+ ${data.name || 'Anonymous User'}
133
+ ${data.email ? `Contact: ${data.email}` : ''}`
134
+ };
135
+ }