docs: fill in HOW-IT-WORKS.md and CLI.md placeholders - #429
Merged
Conversation
- HOW-IT-WORKS.md: replace the three TODO comments near the top with a real, runnable example of calculator-lib's native C addon (mirrors docs/USAGE.md) plus the JS that requires and calls it, and clone instructions for readers who want to follow along with the source referenced later in the document. - CLI.md: hand-write documentation for all five react-native-node-api CLI commands (vendor-hermes, link, list, info, patch-xcode-project), their options and the shared library-naming strategies, sourced from packages/host/src/node/cli/program.ts, hermes.ts and options.ts, with a note to keep it in sync with those definitions. Fixes #425 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DaK9eAAF5G8wj6UT8VekAm
kraenhansen
added a commit
that referenced
this pull request
Aug 13, 2026
- HOW-IT-WORKS.md: replace the three TODO comments near the top with a real, runnable example of calculator-lib's native C addon (mirrors docs/USAGE.md) plus the JS that requires and calls it, and clone instructions for readers who want to follow along with the source referenced later in the document. - CLI.md: hand-write documentation for all five react-native-node-api CLI commands (vendor-hermes, link, list, info, patch-xcode-project), their options and the shared library-naming strategies, sourced from packages/host/src/node/cli/program.ts, hermes.ts and options.ts, with a note to keep it in sync with those definitions. Fixes #425 Claude-Session: https://claude.ai/code/session_01DaK9eAAF5G8wj6UT8VekAm Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #425 — fills in the four
TODOHTML comments left in the published docs.docs/HOW-IT-WORKS.mdReplaced the three placeholders near the top with a concrete, runnable example of
calculator-lib:packages/host/cpp/HermesNapiHost.cpp).addon.c(Addfunction +NAPI_MODULE_INIT) already walked through indocs/USAGE.md, so the two docs stay consistent.my-appuses to import and calladd.The rest of the document's prose was left untouched — it already referred to this example, it just wasn't shown to the reader beforehand.
docs/CLI.mdReplaced the single
TODOwith hand-written documentation for all five commands exposed by thereact-native-node-apiCLI, referencing the Commander definitions inpackages/host/src/node/cli/:vendor-hermes [from]link [path]list [from-path]info <path>patch-xcode-project [path]Each section documents the command's purpose, arguments and options (pulled from
program.ts,hermes.tsandoptions.ts), plus a shared table explaining thestrip/keep/omitlibrary-naming strategies used by--package-nameand--path-suffix(sourced from the doc comments inpath-utils.ts). I went with hand-written docs (per the issue's "worth deciding") rather than building a generator, and added a note pointing back at the source files so it's clear this needs to be kept in sync by hand.Verification
pnpm exec prettier --check docs/HOW-IT-WORKS.md docs/CLI.mdpasses (ran--writeonce to fixdocs/CLI.md's table formatting).🤖 Generated with Claude Code
https://claude.ai/code/session_01DaK9eAAF5G8wj6UT8VekAm
Generated by Claude Code