Skip to content
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

docs: add digital ocean page #1237

Merged
merged 3 commits into from
Dec 4, 2024
Merged

docs: add digital ocean page #1237

merged 3 commits into from
Dec 4, 2024

Conversation

danielbarion
Copy link
Member

@danielbarion danielbarion commented Dec 2, 2024

  • Add one digital ocean article to the website to thank them for their support in open source projects.

Summary by CodeRabbit

  • New Features

    • Added a new footer link titled "Deploying to DigitalOcean" for easier access to deployment documentation.
    • Introduced a guide for deploying a static site on DigitalOcean's App Platform, featuring step-by-step instructions and visual aids.
  • Documentation

    • Enhanced documentation structure with new content on deploying React applications.
  • Chores

    • Added TypeScript declarations for various image file formats to improve development experience.

Copy link

coderabbitai bot commented Dec 2, 2024

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between 06952bc and 6428906.

📒 Files selected for processing (2)
  • docs/src/components/HomepageSponsored/index.tsx (4 hunks)
  • docs/src/components/HomepageSponsored/styles.module.css (1 hunks)
 ________________________________________________
< Doubling as a space heater during code review. >
 ------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Walkthrough

The changes include the addition of a new footer link in the Docusaurus configuration file, directing users to documentation on deploying to DigitalOcean. Additionally, a new React component has been introduced in the blog section, providing a comprehensive guide for deploying a static site using DigitalOcean's App Platform. This guide includes structured content with images and step-by-step instructions for users. TypeScript declarations for various image file formats have also been added to enhance type checking and support for image assets in the React application.

Changes

File Path Change Summary
docs/docusaurus.config.js Added a new footer link labeled "Deploying to DigitalOcean" under the "Docs" section.
docs/src/pages/blog/digital-ocean-app-platform.tsx Introduced a new React component that serves as a guide for deploying a static site on DigitalOcean's App Platform, including structured instructions and images.
docs/react-app-env.d.ts Added TypeScript module declarations for PNG, SVG, JPEG, JPG, and WEBP image file formats.

Poem

In the footer now shines a link so bright,
To DigitalOcean, guiding with light.
A new guide appears, with steps laid clear,
Deploy your site, have nothing to fear!
With images and tips, hop along with glee,
A journey to the cloud, come deploy with me! 🐇✨

Tip

You can customize the tone of the review comments and chat replies.

Set the tone_instructions setting in your project's settings in CodeRabbit to customize the tone of the review comments and chat replies. For example, you can set the tone to Act like a strict teacher, Act like a pirate and more.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Dec 2, 2024

Beta version released with the last commit 🚀

or

npm install [email protected]

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (4)
docs/src/pages/blog/digital-ocean-app-platform.tsx (4)

5-20: Consider improving type safety for image imports.

Instead of using @ts-ignore, consider:

  1. Adding proper type declarations for static assets
  2. Using a more type-safe approach for image imports

Create a new file types/images.d.ts:

declare module '*.webp' {
  const content: string;
  export default content;
}

declare module '*.png' {
  const content: string;
  export default content;
}

103-106: Consider removing referral code from the URL.

The DigitalOcean URL contains a referral code which might not be appropriate for official documentation.

-<a href="https://www.digitalocean.com/?refcode=0813b3be1161&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge/">
+<a href="https://www.digitalocean.com/">

37-47: Optimize image loading and improve user experience.

Consider enhancing the image loading experience:

  1. Add loading="lazy" for images below the fold
  2. Add width and height attributes to prevent layout shifts
  3. Consider using responsive images with srcset

Example implementation for one image:

<img
  src={DigitalOceanBanner}
  alt="DigitalOcean banner"
+ loading="lazy"
+ width="800"
+ height="400"
  style={{
    width: '100%',
    maxWidth: '100%',
    height: 'auto',
    marginBottom: '1rem',
  }}
/>

Also applies to: 107-117, 121-131, 139-149, 154-164, 168-178, 182-192


25-36: Consider extracting styles to CSS modules.

Inline styles could be moved to a CSS module for better maintainability and reusability.

Create a new file digital-ocean-page.module.css:

.mainContainer {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

Then import and use it:

-<main
-  style={{
-    padding: '2rem',
-    display: 'flex',
-    flexDirection: 'column',
-    alignItems: 'center',
-    justifyContent: 'center',
-    minHeight: '100vh',
-    width: '100%',
-    overflowX: 'hidden',
-  }}
->
+<main className={styles.mainContainer}>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 08bfc6f and 7d8626c.

⛔ Files ignored due to path filters (4)
  • docs/static/img/digital-ocean-app-config-1.png is excluded by !**/*.png
  • docs/static/img/digital-ocean-app-config-2.png is excluded by !**/*.png
  • docs/static/img/digital-ocean-create-resource.png is excluded by !**/*.png
  • docs/static/img/digital-ocean-static-site.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • docs/docusaurus.config.js (1 hunks)
  • docs/src/pages/blog/digital-ocean-app-platform.tsx (1 hunks)
🔇 Additional comments (2)
docs/docusaurus.config.js (1)

160-163: LGTM! Footer link addition looks good.

The new footer link is properly configured and points to the correct path for the Digital Ocean deployment guide.

docs/src/pages/blog/digital-ocean-app-platform.tsx (1)

1-215: Overall implementation looks good!

The component is well-structured and provides clear, step-by-step instructions for deploying to DigitalOcean. The content is comprehensive and includes helpful visuals.

Copy link
Member

@gabrieljablonski gabrieljablonski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (with one comment about @ts-ignore), but I'd be fine with making the placement a bit more obvious, other than just on the page footer.

Maybe close to the "powered by" text? Your call if needed.

import DigitalOceanAppConfig2 from '@site/static/img/digital-ocean-app-config-2.png'
// @ts-ignore
import DigitalOceanStaticSite from '@site/static/img/digital-ocean-static-site.png'
// @ts-ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try adding a react-app-env.d.ts to the docs/ directory. With that, we can avoid these @ts-ignore.

declare module '*.png'
declare module '*.svg'
declare module '*.jpeg'
declare module '*.jpg'
declare module '*.webp'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image

Copy link

github-actions bot commented Dec 3, 2024

Beta version released with the last commit 🚀

or

npm install [email protected]

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (5)
docs/src/pages/blog/digital-ocean-app-platform.tsx (5)

1-2: Consider using more specific ESLint disable comments.

Instead of disabling ESLint rules at the file level, consider:

  1. Using inline disables for specific instances
  2. Fixing the underlying issues that require the disables
-/* eslint-disable jsx-a11y/anchor-is-valid */
-/* eslint-disable import/no-unresolved */
+// Add specific disables where needed instead

77-78: Make the example repository URL more obviously placeholder.

The current URL might be confusing for users who might try to copy it directly.

-              git remote add origin https://github.com/your-username/your-repo.git
+              git remote add origin https://github.com/GITHUB_USERNAME/REPOSITORY_NAME.git

95-96: Consider moving the referral code to configuration.

The DigitalOcean referral code should be managed in a configuration file for better maintainability.


144-145: Clarify build directory information.

The documentation assumes build/ as the output directory, but this might vary based on the framework or configuration. Consider adding a note about common variations.

-              Specify the build output directory as <code>build/</code>, which is the default output
-              folder for React projects.
+              Specify the build output directory. For Create React App projects, this is typically <code>build/</code>.
+              For Next.js it's <code>out/</code> (with static export), and for Gatsby it's <code>public/</code>.

194-202: Enhance the support section with more resources.

Consider adding:

  • Common troubleshooting steps
  • Links to DigitalOcean's community forums
  • Version compatibility information
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7d8626c and 06952bc.

📒 Files selected for processing (2)
  • docs/react-app-env.d.ts (1 hunks)
  • docs/src/pages/blog/digital-ocean-app-platform.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/react-app-env.d.ts
🔇 Additional comments (1)
docs/src/pages/blog/digital-ocean-app-platform.tsx (1)

53-56: Fix accessibility and improve tooltip example.

The current example uses a non-descriptive anchor text and lacks proper accessibility attributes.

Copy link

github-actions bot commented Dec 3, 2024

Beta version released with the last commit 🚀

or

npm install [email protected]

Copy link
Member

@gabrieljablonski gabrieljablonski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danielbarion danielbarion merged commit 9cc0685 into master Dec 4, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants