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

chore(docs): update definitions.json generation docs #2947

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mvadari
Copy link
Collaborator

@mvadari mvadari commented Mar 25, 2025

High Level Overview of Change

This PR adds documentation for how to generate the definitions.json output via the new script introduced in #2826, and removes mention of the old script.

Context of Change

#2826 didn't update contributing docs to tell contributors to use the new flow.

Type of Change

  • Documentation Updates

Did you update HISTORY.md?

  • No, this change does not impact library users

Copy link

coderabbitai bot commented Mar 25, 2025

Walkthrough

This pull request updates documentation related to the process for updating the definitions.json file. The instructions in several files have been modified to reference a local generation script instead of an external repository. The changes streamline the update process, remove outdated steps, and ensure consistency in documentation comments without altering any exported functionalities.

Changes

File(s) Change Summary
CONTRIBUTING.md; packages/ripple-binary-codec/CONTRIBUTING.md Updated the section for updating definitions.json to reference a local generation script (e.g., ./tools/generateDefinitions.js), streamlining the update process and eliminating outdated cloning steps.
packages/ripple-binary-codec/src/enums/README.md; packages/ripple-binary-codec/src/enums/xrpl-definitions-base.ts; packages/ripple-binary-codec/src/enums/xrpl-definitions.ts Replaced GitHub URLs with relative paths to the local script in documentation comments, ensuring clarity and consistency across files.

Suggested reviewers

  • khancode
  • ckeshava
  • pdp2121

Poem

I'm a rabbit dancing through the code,
Hopping on docs where new paths are showed.
Local scripts lead our journey so bright,
With clear instructions lighting the night.
Code and hops in perfect rhyme—what a delight!
🐇✨


🪧 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

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.

@mvadari mvadari requested review from khancode and removed request for achowdhry-ripple March 25, 2025 19:58
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: 0

🧹 Nitpick comments (2)
packages/ripple-binary-codec/src/enums/README.md (1)

60-60: Updated Definitions Generation Link: The link now points to this tool, which is a clearer and more localized instruction for generating the definitions file. Ensure that the relative link remains valid when viewed from this README.

CONTRIBUTING.md (1)

153-157: Minor Language Consistency: In the new “Updating definitions.json” section, consider changing “afterwards” to “afterward” to align with American English usage.

- if the output needs manual intervention afterwards, consider updating the script instead.
+ if the output needs manual intervention afterward, consider updating the script instead.
🧰 Tools
🪛 LanguageTool

[locale-violation] ~155-~155: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...if the output needs manual intervention afterwards, consider updating the script instead. ...

(AFTERWARDS_US)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7fe27f3 and c8925e4.

📒 Files selected for processing (5)
  • CONTRIBUTING.md (1 hunks)
  • packages/ripple-binary-codec/CONTRIBUTING.md (1 hunks)
  • packages/ripple-binary-codec/src/enums/README.md (2 hunks)
  • packages/ripple-binary-codec/src/enums/xrpl-definitions-base.ts (1 hunks)
  • packages/ripple-binary-codec/src/enums/xrpl-definitions.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
packages/ripple-binary-codec/src/enums/README.md (1)
Learnt from: mvadari
PR: XRPLF/xrpl.js#2826
File: packages/ripple-binary-codec/src/enums/definitions.json:33-57
Timestamp: 2025-03-24T09:13:29.089Z
Learning: When reviewing diffs in `definitions.json`, ensure to distinguish between entries that are duplicates and entries that are being moved or reordered to avoid false positives.
🪛 LanguageTool
CONTRIBUTING.md

[locale-violation] ~155-~155: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...if the output needs manual intervention afterwards, consider updating the script instead. ...

(AFTERWARDS_US)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: snippets (18.x)
🔇 Additional comments (5)
packages/ripple-binary-codec/src/enums/xrpl-definitions.ts (1)

17-18: Documentation Update – Local Tool Reference: The updated comment now directs users to generate a new definitions.json using the local tool at
packages/ripple-binary-codec/tools/generateDefinitions.js rather than an external URL. This update clearly reflects the new process.

packages/ripple-binary-codec/src/enums/xrpl-definitions-base.ts (1)

41-43: Documentation Update – Relative Path Validation: The comments now instruct users to use the local tool at
packages/ripple-binary-codec/tools/generateDefinitions.js for generating a new definitions file. Please verify that the relative path works for all contributors.

packages/ripple-binary-codec/src/enums/README.md (1)

72-73: Enhanced Contributor Instruction: The added instruction that instructs users to "Generate your own definitions.json file from rippled source code using this tool" improves clarity. This update is consistent with other documentation changes.

packages/ripple-binary-codec/CONTRIBUTING.md (1)

21-27: Updated definitions.json Instructions: The new section for updating definitions.json instructs contributors to use the script here. Ensure that the relative path is correct relative to this CONTRIBUTING file for a smooth contributor experience.

CONTRIBUTING.md (1)

153-160: Clear and Updated Process Instructions: The updated steps provide clear guidance on generating and verifying the definitions.json file using
./packages/ripple-binary-codec/tools/generateDefinitions.js. These instructions remove outdated references and streamline the contributor workflow.

🧰 Tools
🪛 LanguageTool

[locale-violation] ~155-~155: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...if the output needs manual intervention afterwards, consider updating the script instead. ...

(AFTERWARDS_US)

Co-authored-by: Raj Patel <[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: 0

🧹 Nitpick comments (1)
CONTRIBUTING.md (1)

153-160: Documentation Clarity and Numbering Consistency

  • The new "Updating definitions.json" section is much clearer in directing contributors to use the local generation script.
  • Consider updating "afterwards" to "afterward" to conform with American English style conventions.
  • The step numbering appears inconsistent (steps "1.", "2.", then "5."). It might be clearer to renumber these sequentially (e.g., "1.", "2.", "3.") for improved readability.
  • Optionally, you could add a brief clarification on when manual intervention is expected, which will help contributors decide if they need to update the script further.
🧰 Tools
🪛 LanguageTool

[locale-violation] ~155-~155: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...if the output needs manual intervention afterwards, consider updating the script instead. ...

(AFTERWARDS_US)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8925e4 and fb17b89.

📒 Files selected for processing (1)
  • CONTRIBUTING.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
CONTRIBUTING.md

[locale-violation] ~155-~155: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...if the output needs manual intervention afterwards, consider updating the script instead. ...

(AFTERWARDS_US)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: browser (18.x)
  • GitHub Check: snippets (20.x)
  • GitHub Check: snippets (22.x)
  • GitHub Check: integration (22.x)
  • GitHub Check: snippets (18.x)
  • GitHub Check: integration (18.x)
  • GitHub Check: integration (20.x)

fix numbering
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: 0

🧹 Nitpick comments (1)
CONTRIBUTING.md (1)

155-155: Use American English Variant.
Please replace "afterwards" with "afterward" for consistency with American English style.

-... if the output needs manual intervention afterwards, consider updating the script instead.
+... if the output needs manual intervention afterward, consider updating the script instead.
🧰 Tools
🪛 LanguageTool

[locale-violation] ~155-~155: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...if the output needs manual intervention afterwards, consider updating the script instead. ...

(AFTERWARDS_US)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb17b89 and 0ae960d.

📒 Files selected for processing (1)
  • CONTRIBUTING.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
CONTRIBUTING.md

[locale-violation] ~155-~155: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...if the output needs manual intervention afterwards, consider updating the script instead. ...

(AFTERWARDS_US)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: integration (22.x)
  • GitHub Check: snippets (22.x)
  • GitHub Check: snippets (20.x)
  • GitHub Check: snippets (18.x)
  • GitHub Check: integration (18.x)
  • GitHub Check: browser (18.x)
  • GitHub Check: integration (20.x)
🔇 Additional comments (1)
CONTRIBUTING.md (1)

153-159: Clarify and Validate the Updated Steps for Generating definitions.json.
The new section "Updating definitions.json" clearly documents that contributors should use the script located at ./packages/ripple-binary-codec/tools/generateDefinitions.js. The steps (pulling the latest rippled from the develop branch, running the script, and verifying the output) are concise and align well with the recent process updates from PR #2826. Please verify that the relative path and assumptions (i.e. running the command from the repository root) hold true for most contributor environments.

🧰 Tools
🪛 LanguageTool

[locale-violation] ~155-~155: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...if the output needs manual intervention afterwards, consider updating the script instead. ...

(AFTERWARDS_US)


Use [this repo](https://github.com/RichardAH/xrpl-codec-gen) to generate a new `definitions.json` file from the rippled source code. Instructions are available in that README.
1. Clone / pull the latest changes from [rippled](https://github.com/XRPLF/rippled) - Specifically the `develop` branch is usually the right one.
2. Run `node packages/ripple-binary-codec/tools/generateDefinitions.js path/to/rippled` (assuming you're calling this file from the root directory of xrpl.js).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
2. Run `node packages/ripple-binary-codec/tools/generateDefinitions.js path/to/rippled` (assuming you're calling this file from the root directory of xrpl.js).
2. Run `npm run generateDefinitions path/to/rippled` (assuming you're calling this file from the root directory of xrpl.js).

Copy link
Collaborator

Choose a reason for hiding this comment

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

nit ^

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As we discussed previously, that doesn't work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The npm script works for me. You need to be inside the packages/ripple-binary-codec directory.

Copy link
Collaborator Author

@mvadari mvadari Apr 7, 2025

Choose a reason for hiding this comment

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

That makes the command more complex. Most people aren't going to be in that directory when executing this script, they're going to be in the root directory for xrpl.js. So then the command would have to be:

    cd packages/ripple-binary-codec
    npm run generateDefinitions path/to/rippled
    # and now you're in a different directory and need to cd back to the root directory to do other things

Or

(cd packages/ripple-binary-codec && npm run generateDefinitions path/to/rippled)

Both of those aren't the most user-friendly commands, which is why I included what I did.

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.

3 participants