Skip to content

Add CLAUDE.md - #815

Open
ZayanKhan-12 wants to merge 3 commits into
teslamotors:masterfrom
ZayanKhan-12:docs/add-claude-md
Open

ZayanKhan-12 wants to merge 3 commits into
teslamotors:masterfrom
ZayanKhan-12:docs/add-claude-md

Conversation

@ZayanKhan-12

Copy link
Copy Markdown

Summary

Adds a root CLAUDE.md with working notes for AI coding assistants (Claude Code, Cursor, and anything else that reads a repo-level instructions file).

The main section is adding an event, because that's where the shape of this repo bites. Supporting both React Native architectures on both platforms means one event touches the codegen spec, the public props, three iOS files and four Android ones — including the two CKCameraManager.kt files, which must stay symmetrical: a registration added to one and not the other produces an event that silently never arrives on that architecture.

The rest is toolchain reality that's easy to be misled by:

  • yarn lint lints nothing. It's eslint -c .eslintrc.js with no file arguments, so it exits 0 regardless of what's in src/. A green lint says nothing about your TypeScript. yarn build is the check that actually bites.
  • yarn test is declared but jest isn't installed, and CI doesn't run it.
  • The real gate is the two example app builds CI performs — a Kotlin or Swift mistake shows up nowhere else.
  • Running the Android one locally needs Node ≥ 20.19 (the example is on RN 0.81 while the root package installs fine on older Node), JDK 17 and an Android SDK. cd android && ./gradlew assembleDebug on the library alone fails with "Plugin with id 'com.android.library' not found" — it's only buildable through the example app.
  • SwiftLint needs SourceKit and aborts at startup with only the Command Line Tools installed; pointing DYLD_FRAMEWORK_PATH at the CLT copy avoids installing all of Xcode. CameraView.swift already exceeds the file_length limit, so diff the violations rather than reading the raw count.

Plus two traps before writing a prop: CameraProps extends ViewProps, so names React Native already defines (onFocus, onBlur) are taken; and Fabric has no optional numeric props yet, so numbers need WithDefault<..., -1> in the spec and a default in Camera.ios.tsx / Camera.android.tsx.

Every claim was checked against the repo rather than assumed. No behaviour change: one new file, nothing else touched.

Motivation

I picked these up the slow way while working on #590 (see #814). Writing them down means the next person or agent doesn't repeat it.

Entirely optional, and easy to drop if you'd rather not carry an assistant-facing file. Sent separately from #814 so the feature there can be reviewed on its own.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MjiwHkBNkrUKxsQUVeeaSH

Working notes for AI coding assistants: the layer cake a feature has to pass
through here, and the parts of the toolchain that mislead.

The load-bearing section is adding an event. Because the library supports both
React Native architectures on both platforms, one event touches the codegen
spec, the public props, three iOS files, and four Android ones - including two
CKCameraManager.kt files that must be kept symmetrical, since a registration
added to one and not the other produces an event that silently never arrives on
that architecture.

On the toolchain: `yarn lint` passes no file arguments to eslint, so it lints
nothing and always exits 0 - a green lint says nothing about the TypeScript.
`yarn test` is declared but jest is not installed, and CI does not run it.
`yarn build` is the check that actually bites, alongside the two example app
builds CI performs.

Also records what it takes to run those builds locally: Node >= 20.19 for the
example even though the root package installs on older Node, that the library
module cannot be built on its own, and that SwiftLint needs to be pointed at the
Command Line Tools copy of SourceKit when Xcode is not installed. Plus the two
traps worth knowing before writing a prop: ViewProps already owns some names,
and Fabric has no optional numeric props yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MjiwHkBNkrUKxsQUVeeaSH
ZayanKhan-12 pushed a commit to ZayanKhan-12/react-native-camera-kit that referenced this pull request Sep 15, 2026
Adds two things to CLAUDE.md that cost real time to rediscover:

- There is no Swift test target, but UIKit-only files build for Mac
  Catalyst and so can be laid out, rendered and asserted on from a
  command-line binary. Notes the swiftc invocation, the main.swift
  requirement for top-level code, and the awk extraction trick that keeps
  a geometry test exercising the shipped source instead of a copy.

- yarn bootstrap's bundler is broken on modern Ruby, and because the
  script is &&-chained that failure silently skips yarn in example/. The
  library then never reaches example/node_modules, autolinking drops it,
  and the iOS build looks green while not compiling this library at all.
  Includes the one-line Podfile.lock check that catches it, the
  brew-cocoapods path around bundler, and the Xcode 26 fmt workaround.
React 19 freezes element.props in development and the RN babel preset
emits no "use strict", so a props mutation no-ops in debug and applies
in release. That divergence is hard to spot from the simulator, so
CLAUDE.md now warns against it and gives a one-liner that counts the
mutations in the compiled output.

Also notes that a JS-side default is only needed when the codegen spec
does not already supply one.
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