Repository navigation
Add CLAUDE.md - #815
Open
ZayanKhan-12 wants to merge 3 commits into
Open
Add CLAUDE.md#815ZayanKhan-12 wants to merge 3 commits into
ZayanKhan-12 wants to merge 3 commits into
Conversation
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
Add CLAUDE.md. Open upstream as teslamotors#815.
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.
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
Adds a root
CLAUDE.mdwith 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.ktfiles, 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 lintlints nothing. It'seslint -c .eslintrc.jswith no file arguments, so it exits 0 regardless of what's insrc/. A green lint says nothing about your TypeScript.yarn buildis the check that actually bites.yarn testis declared butjestisn't installed, and CI doesn't run it.cd android && ./gradlew assembleDebugon the library alone fails with "Plugin with id 'com.android.library' not found" — it's only buildable through the example app.DYLD_FRAMEWORK_PATHat the CLT copy avoids installing all of Xcode.CameraView.swiftalready exceeds thefile_lengthlimit, 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 needWithDefault<..., -1>in the spec and a default inCamera.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