docs(@nylas/react): restructure README onto the SDK house style - #97
Conversation
`useNylasConnect` and `NylasConnectButton` are exported only from the `@nylas/react/connect` subpath. `src/index.ts` re-exports `./elements` and `./utils`, neither of which reaches them, so the four README snippets importing from `@nylas/react` could not resolve. Also corrects the Exports overview, which claimed the Connect symbols were importable from `@nylas/react` as well as `@nylas/react/connect`. The Elements entries are unaffected: `NylasSchedulerEditor` and `NylasScheduling` genuinely resolve from the package root. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Brings the README onto the section skeleton shared by @nylas/connect, nylas-nodejs, nylas-python, nylas-ruby and nylas-java: centered header block with banner, tagline, badge row and nav links, then Get started, Install, Usage, Examples, AI agents, Reference, Upgrading, Contributing, Security, Other Nylas SDKs, License. All existing prose and every code sample are preserved. The Scheduler Editor example, the local dev server instructions, the hook usage, the environment setup, the identity provider example and the custom code exchange example are unchanged apart from being moved under `## Usage`. Documentation gaps closed while restructuring: - The Exports overview listed 3 of the ~59 exported components without saying what the rest were. Now names the 3 entry points and explains that the others are their building blocks. - The hook config table omitted `initialLoadingState`, and did not mention that UseNylasConnectConfig extends ConnectConfig. - The hook return values omitted `setLogLevel` and `connectClient`. - NylasConnectButton had no prop documentation at all; 26 props are now grouped by purpose, including the `unstyled` and `cssVars` theming hooks. - CHANGELOG.md and LICENSE.md exist in the package but were never linked. Both now are. - Added an Error handling section, absent entirely. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
9fd0ca6 to
5ab61c8
Compare
AaronDDM
left a comment
There was a problem hiding this comment.
Good afternoon!
Spot-checked the new tables against the source and they hold up:
UseNylasConnectConfig extends ConnectConfigandinitialLoadingStatedefaults totrue(useNylasConnect.ts:18-27).setLogLevelandconnectClientare both on the return type (useNylasConnect.ts:36-48).- The 26 button props and the four
cssVarsnames matchNylasConnectButton.tsx:12. Worth noting the CSS file defines more variables than that (--nylas-btn-border-radius, the focus/active states, etc.), but thecssVarsprop type only accepts those four, so listing four is right.
Two non-blocking notes:
- The subpath table omits
@nylas/react/utils, which is a real entry inpackage.jsonexports. The root row says "everything below except the Connect symbols", so a reader can inferutilscontent is in the root, but they can't tell what it is. One more row would close it. - Merge order still matters — this is based on
fix/react-readme-connect-imports, so #94 goes in first.
Agreed on leaving the Node 20 vs 22 inconsistency for a separate decision rather than changing it here.
Approving.
The subpath table omitted @nylas/react/utils, which is a real entry in the package.json exports map. Noted in review on #97. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thanks — both notes taken. 1. Missing | That's the whole of 2. Merge order. Agreed — this is still based on Good catch on the |
…se-style # Conflicts: # packages/react/README.md
|
Rebased onto There was a merge conflict. #94 was squash-merged as b23827f, so this branch's base commit isn't in Resolved by taking this branch's version, which is safe because the rewrite already supersedes what landed in #94 — it carries all four Verified after resolving:
The earlier approval was auto-dismissed by the new commits, so this needs a fresh look when you have a moment — no content has changed since your review beyond the |
Brings
packages/react/README.mdonto the section skeleton shared by@nylas/connect(#95),nylas-nodejs,nylas-python,nylas-rubyandnylas-java.Structure
# Nylas React ComponentsAll existing prose and every code sample are preserved. The Scheduler Editor example, local dev server instructions, hook usage, environment setup, identity provider example and custom code exchange example are unchanged apart from moving under
## ⚡️ Usage.Gaps closed while restructuring
These go beyond pure restructuring — happy to strip any of them if you'd rather keep the diff to layout only:
NylasScheduling,NylasSchedulerEditor,NylasSchedulingMethod) and explains the remainder are their building blocks.initialLoadingState, and never said thatUseNylasConnectConfig extends ConnectConfig— so readers had no way to knowapiUrl,defaultScopes,persistTokens,logLevel,codeExchangeandidentityProviderTokenare all accepted (src/connect/useNylasConnect.ts:18).setLogLevelandconnectClient(useNylasConnect.ts:36-47).NylasConnectButtonhad no prop documentation at all. Its 26 props (NylasConnectButton.tsx:12) are now grouped as Connection / Appearance / Callbacks / Advanced, including theunstyledandcssVarstheming hooks and theonStart/onCancelcallbacks that were never mentioned.CHANGELOG.mdandLICENSE.mdexist in the package but were never linked. Both now are.@nylas/react/connect— the thing fix(@nylas/react): correct Connect import paths in README #94 fixes.Deliberately unchanged
Two pre-existing claims I left alone rather than quietly altering:
package.json'sengines: >=22.0.0, and Node 20 went EOL in April 2026. Not wrong for this package (Node 20 has the globals@nylas/connectneeds), just stale. Worth a separate decision.enginesfield, so nothing enforces either number.I did align "React.js v18 or higher" to "React 18 or 19", which is what
peerDependenciesactually declares (^18 || ^19) and what the root README already says.Patch changeset included so the corrected README reaches npmjs.com.
🤖 Generated with Claude Code