-
Notifications
You must be signed in to change notification settings - Fork 27
chore: add Apache License 2.0 to multiple files #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added Apache License 2.0 header to various source files, including configuration, components, and stylesheets. - Ensured compliance with licensing requirements for CodeRabbit AI Inc. This update standardizes licensing across the project files.
WalkthroughThis pull request introduces the full text of the Apache License, Version 2.0, into the Changes
Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying coderabbit-docs with
|
Latest commit: |
c207ca9
|
Status: | ✅ Deploy successful! |
Preview URL: | https://4565080f.coderabbit-docs.pages.dev |
Branch Preview URL: | https://alv2-changes.coderabbit-docs.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
src/theme/BlogPostItem/index.js (1)
Line range hint
16-39
: Consider Adding PropTypes for Component PropsAdding
PropTypes
can enhance type checking and improve maintainability by explicitly defining the expected props for theBlogPostItemWrapper
component.You can import
PropTypes
and define the prop types as follows:import { useBlogPost } from "@docusaurus/theme-common/internal" import { AiDisclaimer } from "@site/src/components/AiDisclaimer" +import PropTypes from "prop-types" import BlogPostItem from "@theme-original/BlogPostItem" import { DiscussionEmbed } from "disqus-react" export default function BlogPostItemWrapper(props) { // existing code... } +BlogPostItemWrapper.propTypes = { + props: PropTypes.object, +}src/components/YamlEditor/YamlEditor.tsx (1)
Line range hint
34-59
: Enhance Error Handling invalidateAndSetAnnotations
The current error handling may result in issues if
err.instancePath
is undefined, especially for parsing errors fromjsYaml.load
. To ensure robustness, adjust the error handling to account for all error types.Apply this diff to improve error handling:
function validateAndSetAnnotations(yaml) { try { const doc = jsYaml.load(yaml, { strict: true }) const isValid = validate(doc) if (!isValid && validate.errors) { setAnnotations( validate.errors.map(err => { const instancePathArr = err?.instancePath?.split("/") const key = instancePathArr && instancePathArr[instancePathArr.length - 1] return { row: err.instancePath ? getLineNumber(yaml, err.instancePath) : 0, column: 0, text: `${key}: ${err.message} ${ err?.params?.allowedValues ? `Allowed values: ${err.params.allowedValues.join(", ")}` : "" }`, type: "error", } }), ) } else { setAnnotations([]) } } catch (err) { - const instancePathArr = err?.instancePath?.split("/") - const key = instancePathArr && instancePathArr[instancePathArr.length - 1] + const key = err?.name || 'Error' setAnnotations([ { - row: err.instancePath ? getLineNumber(yaml, err.instancePath) : 0, + row: err.mark ? err.mark.line : 0, column: 0, text: - `${key}: ${err.message} ${ - err?.params?.allowedValues - ? `Allowed values: ${err.params.allowedValues.join(", ")}` - : "" - }` || "YAML parsing error", + `${key}: ${err.message}` || "YAML parsing error", type: "error", }, ]) } }src/theme/Footer/index.js (1)
Line range hint
35-38
: Addalt
Attributes to Images for AccessibilityIncluding
alt
attributes in your<img>
tags enhances accessibility for users relying on screen readers.Apply this diff to include
alt
attributes:// Logo image <img loading="lazy" src={CRLogoBase64} + alt="CodeRabbit Logo" style={{ maxWidth: "200px", height: "auto", }} /> // Social media icons // Twitter <img loading="lazy" src="https://cdn.builder.io/api/v1/image/assets/TEMP/0f1b48f4977dc728d0cea441017f89664834046c1ce8f3916564bb9a1538f58a?" + alt="Twitter" className="aspect-square object-contain object-center w-5 overflow-hidden shrink-0 max-w-full" /> // LinkedIn <img loading="lazy" src="https://cdn.builder.io/api/v1/image/assets/TEMP/9ef98483828bc1c5e3349eb7c8da5c661ce0e7958e4dfe0e9c67db18e2019c65?" + alt="LinkedIn" className="aspect-square object-contain object-center w-5 overflow-hidden shrink-0 max-w-full" /> // Discord <img loading="lazy" src="https://cdn.builder.io/api/v1/image/assets/TEMP/54cf490c6e905acb0ac1e2d5b9946ca1adae440948393edc7a12ec1a68b7b95c?" + alt="Discord" className="aspect-square object-contain object-center w-5 overflow-hidden shrink-0 max-w-full" />Also applies to: 50-53, 95-120
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (17)
LICENSE
(1 hunks)docusaurus.config.ts
(1 hunks)plugins/blog-plugin.js
(1 hunks)sidebars.ts
(1 hunks)src/components/AiDisclaimer/AiDisclaimer.tsx
(1 hunks)src/components/AiDisclaimer/index.ts
(1 hunks)src/components/AiDisclaimer/style.css
(1 hunks)src/components/FeaturedPosts/FeaturedPosts.module.css
(1 hunks)src/components/FeaturedPosts/FeaturedPosts.tsx
(1 hunks)src/components/ReportSchema.tsx
(1 hunks)src/components/SchemaViewer.tsx
(1 hunks)src/components/YamlEditor/YamlEditor.tsx
(1 hunks)src/css/custom.css
(1 hunks)src/pages/index.module.css
(1 hunks)src/theme/BlogPostItem/index.js
(1 hunks)src/theme/Footer/index.js
(1 hunks)tailwind.config.js
(1 hunks)
✅ Files skipped from review due to trivial changes (13)
- src/components/ReportSchema.tsx
- src/pages/index.module.css
- sidebars.ts
- src/components/AiDisclaimer/style.css
- tailwind.config.js
- src/components/FeaturedPosts/FeaturedPosts.module.css
- src/components/AiDisclaimer/index.ts
- src/components/SchemaViewer.tsx
- docusaurus.config.ts
- src/components/AiDisclaimer/AiDisclaimer.tsx
- LICENSE
- src/css/custom.css
- src/components/FeaturedPosts/FeaturedPosts.tsx
🔇 Additional comments (2)
plugins/blog-plugin.js (2)
1-15
: License Header Added Successfully
The Apache License 2.0 header has been correctly added to the file.
Line range hint 16-64
: Extended Blog Plugin Implementation Approved
The code effectively extends the default blog plugin by overriding the contentLoaded
function while preserving existing functionality. The new route /featured-posts
is properly added.
This update standardizes licensing across the project files.