|
| 1 | +import { HeadingWithAnchor } from '@/components/heading-with-anchor'; |
| 2 | +import { EditPageLink } from '@/components/edit-page-link'; |
| 3 | +import { parseGemspec, GemDependency } from '@/lib/gemspec-parser'; |
| 4 | +import { Card } from '@/components/ui/card'; |
| 5 | +import { Callout } from '@/components/ui/callout'; |
| 6 | + |
| 7 | +// Make this a server component |
| 8 | +export default async function SupportedVersionsPage() { |
| 9 | + const dependencies = parseGemspec(); |
| 10 | + const requiredDeps = dependencies.filter((dep) => dep.type === 'required'); |
| 11 | + const optionalDeps = dependencies.filter((dep) => dep.type === 'optional'); |
| 12 | + |
| 13 | + return ( |
| 14 | + <div className="space-y-6"> |
| 15 | + <HeadingWithAnchor id="supported-gem-versions" level={1}> |
| 16 | + Supported Gem Versions |
| 17 | + </HeadingWithAnchor> |
| 18 | + <p className="text-lg text-neutral-600 dark:text-neutral-400"> |
| 19 | + LogStruct works with the following versions of Rails and various |
| 20 | + integration gems. |
| 21 | + </p> |
| 22 | + |
| 23 | + <HeadingWithAnchor id="required-dependencies" level={2}> |
| 24 | + Required Dependencies |
| 25 | + </HeadingWithAnchor> |
| 26 | + <p className="text-neutral-600 dark:text-neutral-400 mb-4"> |
| 27 | + These gems are required for LogStruct to function properly. |
| 28 | + </p> |
| 29 | + |
| 30 | + <Card className="p-6"> |
| 31 | + <div className="relative overflow-x-auto"> |
| 32 | + <table className="w-full text-sm text-left"> |
| 33 | + <thead className="text-neutral-700 dark:text-neutral-300 border-b border-neutral-200 dark:border-neutral-700"> |
| 34 | + <tr> |
| 35 | + <th scope="col" className="px-4 py-3 font-medium"> |
| 36 | + Gem |
| 37 | + </th> |
| 38 | + <th scope="col" className="px-4 py-3 font-medium"> |
| 39 | + Version |
| 40 | + </th> |
| 41 | + <th scope="col" className="px-4 py-3 font-medium"> |
| 42 | + Description |
| 43 | + </th> |
| 44 | + </tr> |
| 45 | + </thead> |
| 46 | + <tbody> |
| 47 | + {requiredDeps.map((dep) => ( |
| 48 | + <tr |
| 49 | + key={dep.name} |
| 50 | + className="border-b border-neutral-200 dark:border-neutral-700" |
| 51 | + > |
| 52 | + <td className="px-4 py-4 font-medium"> |
| 53 | + <a |
| 54 | + href={`https://rubygems.org/gems/${dep.name}`} |
| 55 | + target="_blank" |
| 56 | + rel="noopener noreferrer" |
| 57 | + > |
| 58 | + {dep.name} |
| 59 | + </a> |
| 60 | + </td> |
| 61 | + <td className="px-4 py-4 font-mono text-xs">{dep.version}</td> |
| 62 | + <td className="px-4 py-4">{getGemDescription(dep.name)}</td> |
| 63 | + </tr> |
| 64 | + ))} |
| 65 | + </tbody> |
| 66 | + </table> |
| 67 | + </div> |
| 68 | + </Card> |
| 69 | + |
| 70 | + <HeadingWithAnchor id="optional-integrations" level={2}> |
| 71 | + Optional Integrations |
| 72 | + </HeadingWithAnchor> |
| 73 | + <p className="text-neutral-600 dark:text-neutral-400 mb-4"> |
| 74 | + LogStruct provides seamless integration with these gems, but they are |
| 75 | + not required for its core functionality. |
| 76 | + </p> |
| 77 | + |
| 78 | + <Callout type="info"> |
| 79 | + <p> |
| 80 | + Feel free to open a PR if you want to add support for an older version |
| 81 | + or a different gem. |
| 82 | + </p> |
| 83 | + </Callout> |
| 84 | + |
| 85 | + <Card className="p-6"> |
| 86 | + <div className="relative overflow-x-auto"> |
| 87 | + <table className="w-full text-sm text-left"> |
| 88 | + <thead className="text-neutral-700 dark:text-neutral-300 border-b border-neutral-200 dark:border-neutral-700"> |
| 89 | + <tr> |
| 90 | + <th scope="col" className="px-4 py-3 font-medium"> |
| 91 | + Gem |
| 92 | + </th> |
| 93 | + <th scope="col" className="px-4 py-3 font-medium"> |
| 94 | + Version |
| 95 | + </th> |
| 96 | + <th scope="col" className="px-4 py-3 font-medium"> |
| 97 | + Description |
| 98 | + </th> |
| 99 | + </tr> |
| 100 | + </thead> |
| 101 | + <tbody> |
| 102 | + {optionalDeps.map((dep) => ( |
| 103 | + <tr |
| 104 | + key={dep.name} |
| 105 | + className="border-b border-neutral-200 dark:border-neutral-700" |
| 106 | + > |
| 107 | + <td className="px-4 py-4 font-medium"> |
| 108 | + <a |
| 109 | + href={`https://rubygems.org/gems/${dep.name}`} |
| 110 | + target="_blank" |
| 111 | + rel="noopener noreferrer" |
| 112 | + > |
| 113 | + {dep.name} |
| 114 | + </a> |
| 115 | + </td> |
| 116 | + <td className="px-4 py-4 font-mono text-xs">{dep.version}</td> |
| 117 | + <td className="px-4 py-4">{getGemDescription(dep.name)}</td> |
| 118 | + </tr> |
| 119 | + ))} |
| 120 | + </tbody> |
| 121 | + </table> |
| 122 | + </div> |
| 123 | + </Card> |
| 124 | + |
| 125 | + <HeadingWithAnchor id="ruby-versions" level={2}> |
| 126 | + Ruby Versions |
| 127 | + </HeadingWithAnchor> |
| 128 | + <p className="text-neutral-600 dark:text-neutral-400"> |
| 129 | + LogStruct requires Ruby <span className="text-gray-200">3.2.0</span> or |
| 130 | + higher. |
| 131 | + </p> |
| 132 | + |
| 133 | + <HeadingWithAnchor id="how-to-use" level={2}> |
| 134 | + How to Use Integrations |
| 135 | + </HeadingWithAnchor> |
| 136 | + <p className="text-neutral-600 dark:text-neutral-400"> |
| 137 | + To use LogStruct with any of the optional integrations, simply add the |
| 138 | + desired gem to your Gemfile and LogStruct will automatically detect and |
| 139 | + configure it. See the <a href="/docs/integrations">Integrations</a> page |
| 140 | + for more details and log examples. |
| 141 | + </p> |
| 142 | + |
| 143 | + <EditPageLink /> |
| 144 | + </div> |
| 145 | + ); |
| 146 | +} |
| 147 | + |
| 148 | +// Helper function to provide descriptions for each gem |
| 149 | +function getGemDescription(gemName: string): string { |
| 150 | + const descriptions: { [key: string]: string } = { |
| 151 | + rails: 'Web application framework', |
| 152 | + lograge: "Taming Rails' default request logging", |
| 153 | + 'sorbet-runtime': "Sorbet's runtime type checking component", |
| 154 | + bugsnag: 'Error monitoring and reporting service', |
| 155 | + carrierwave: 'File upload solution for Rails', |
| 156 | + honeybadger: 'Exception, uptime, and performance monitoring', |
| 157 | + rollbar: 'Error tracking and debugging tool', |
| 158 | + 'sentry-ruby': |
| 159 | + 'Error tracking that helps developers monitor and fix crashes', |
| 160 | + shrine: 'File attachment toolkit for Ruby applications', |
| 161 | + sidekiq: 'Simple, efficient background processing for Ruby', |
| 162 | + sorbet: 'A type checker for Ruby', |
| 163 | + }; |
| 164 | + |
| 165 | + return descriptions[gemName] || 'Integration supported by LogStruct'; |
| 166 | +} |
0 commit comments