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

Update example version to v0.4.28 #877

Merged
merged 2 commits into from
Jul 25, 2024
Merged

Update example version to v0.4.28 #877

merged 2 commits into from
Jul 25, 2024

Conversation

chacha912
Copy link
Contributor

@chacha912 chacha912 commented Jul 25, 2024

What this PR does / why we need it?

Update example version to v0.4.28

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

  • New Features

    • Introduced a script to automate the building and updating of example projects using the Yorkie JS SDK, enhancing usability and efficiency for users.
  • Updates

    • Updated the yorkie-js-sdk dependency in various example projects to version 0.4.28, which may include bug fixes and performance improvements.

Copy link

coderabbitai bot commented Jul 25, 2024

Walkthrough

The primary change is the introduction of the build_examples.sh script, which automates the building of multiple example projects using the yorkie-js-sdk. Users can now specify the SDK version, streamlining the management and execution of builds. Additionally, several example projects have updated their yorkie-js-sdk dependency from ^0.4.27 to ^0.4.28, improving performance and stability while maintaining existing functionality.

Changes

Files Change Summary
build_examples.sh Introduced a script to automate building example projects, allowing user-defined SDK version input.
scripts/update-examples.sh Added a script to update and build example projects with a specified SDK version.
examples/.../package.json (multiple files) Updated yorkie-js-sdk dependency from ^0.4.27 to ^0.4.28 across various example projects, reflecting a minor version upgrade.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BuildScript
    participant ExampleProject

    User->>BuildScript: Specify SDK version
    BuildScript->>BuildScript: Navigate to examples directory
    BuildScript->>ExampleProject: Install specified SDK version
    ExampleProject->>BuildScript: Build project
    BuildScript->>User: Report build success/failure
Loading

Poem

🐰 In a garden bright and fair,
A script hops 'round without a care.
From twenty-seven to twenty-eight,
The SDKs dance, oh, isn’t it great?
With builds so smooth, let joy abound,
A rabbit's cheer is all around! 🌼


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.85%. Comparing base (25bb409) to head (2004f35).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #877   +/-   ##
=======================================
  Coverage   80.85%   80.85%           
=======================================
  Files          60       60           
  Lines        4639     4639           
  Branches      942      942           
=======================================
  Hits         3751     3751           
  Misses        621      621           
  Partials      267      267           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 25bb409 and 3de5b54.

Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing (9)
  • build_examples.sh (1 hunks)
  • examples/nextjs-scheduler/package.json (1 hunks)
  • examples/profile-stack/package.json (1 hunks)
  • examples/react-tldraw/package.json (1 hunks)
  • examples/react-todomvc/package.json (1 hunks)
  • examples/simultaneous-cursors/package.json (1 hunks)
  • examples/vanilla-codemirror6/package.json (1 hunks)
  • examples/vanilla-quill/package.json (1 hunks)
  • examples/vuejs-kanban/package.json (1 hunks)
Files skipped from review due to trivial changes (8)
  • examples/nextjs-scheduler/package.json
  • examples/profile-stack/package.json
  • examples/react-tldraw/package.json
  • examples/react-todomvc/package.json
  • examples/simultaneous-cursors/package.json
  • examples/vanilla-codemirror6/package.json
  • examples/vanilla-quill/package.json
  • examples/vuejs-kanban/package.json
Additional context used
Shellcheck
build_examples.sh

[warning] 7-7: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)


[warning] 14-14: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

Additional comments not posted (1)
build_examples.sh (1)

1-5: LGTM!

The shebang line and user input prompt are correct.

build_examples.sh Outdated Show resolved Hide resolved
build_examples.sh Outdated Show resolved Hide resolved
build_examples.sh Outdated Show resolved Hide resolved
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: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3de5b54 and 2004f35.

Files selected for processing (2)
  • package.json (1 hunks)
  • scripts/update-examples.sh (1 hunks)
Files skipped from review due to trivial changes (1)
  • package.json
Additional context used
Shellcheck
scripts/update-examples.sh

[warning] 7-7: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)


[warning] 15-15: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

Additional comments not posted (7)
scripts/update-examples.sh (7)

1-1: Shebang is correct.

The shebang #!/bin/bash is appropriate for this script.


4-4: Ensure secure input handling.

The read command is used to get user input, which is fine for this context. However, consider validating the input to ensure it matches the expected version format.


10-10: Loop through directories is correct.

The loop correctly iterates through all directories in the examples folder.


12-12: Print directory names for debugging.

Printing directory names helps in debugging and tracking progress.


13-13: Exclude dist folder correctly.

The check correctly excludes the dist folder from the loop.


18-18: Ensure npm commands are executed securely.

The npm commands are executed securely and sequentially. Ensure that the npm i command installs the correct version of yorkie-js-sdk.


21-25: Error handling for npm commands.

The script correctly handles errors from the npm commands and provides appropriate feedback.

fi

# Move back to the examples folder
cd ..
Copy link

Choose a reason for hiding this comment

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

Handle directory change errors.

Add error handling to the cd command to ensure the script exits if the directory change fails.

- cd ..
+ cd .. || exit
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd ..
cd .. || exit

echo $dir
if [ -d "$dir" ] && [ "$dir" != "dist/" ]; then
# Move to the example folder
cd "$dir"
Copy link

Choose a reason for hiding this comment

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

Handle directory change errors.

Add error handling to the cd command to ensure the script exits if the directory change fails.

- cd "$dir"
+ cd "$dir" || exit
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd "$dir"
cd "$dir" || exit
Tools
Shellcheck

[warning] 15-15: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

read -p "Enter the yorkie-js-sdk version: " version

# Change the directory to the examples folder
cd examples
Copy link

Choose a reason for hiding this comment

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

Handle directory change errors.

Add error handling to the cd command to ensure the script exits if the directory change fails.

- cd examples
+ cd examples || exit
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd examples
cd examples || exit
Tools
Shellcheck

[warning] 7-7: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

@hackerwins hackerwins merged commit 83a6369 into main Jul 25, 2024
2 checks passed
@hackerwins hackerwins deleted the ex-v0.4.28 branch July 25, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants