You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bae3d68
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,9 @@ Either is welcome. A clean, deterministic repro is often more valuable than a gu
23
23
The React Native repository is a Bun monorepo with a pinned `packages/react-native-nitro-modules/nitro/` submodule from [margelo/nitro](https://github.com/margelo/nitro):
24
24
25
25
-[apps/example/](apps/example) — React Native example app that hosts the runtime test harness.
26
-
-[packages/react-native-nitro-modules/nitro/packages/nitro-core/](https://github.com/margelo/nitro/tree/core-split/packages/nitro-core) - shared JS/TS definitions and runtime helpers, published from `nitro`.
27
-
-[packages/react-native-nitro-modules/nitro/packages/nitrogen/](https://github.com/margelo/nitro/tree/core-split/packages/nitrogen) - the `nitrogen` code generator, maintained in `nitro`.
28
-
-[packages/react-native-nitro-modules/](packages/react-native-nitro-modules) - the published React Native package and its CocoaPods, Gradle, and CMake configuration. Its native sources are staged from `packages/react-native-nitro-modules/nitro/packages/react-native-nitro-modules/`; its RN-specific JS is maintained here. Shared JS/TS comes from `nitro-core`.
26
+
-[packages/react-native-nitro-modules/nitro/nitro-core/](https://github.com/margelo/nitro/tree/core-split/nitro-core) - shared native runtime and JS/TS API. The `nitro-core` npm package publishes only JS/TS.
27
+
-[packages/react-native-nitro-modules/nitro/nitrogen/](https://github.com/margelo/nitro/tree/core-split/nitrogen) - the `nitrogen` code generator, maintained in `nitro`.
28
+
-[packages/react-native-nitro-modules/](packages/react-native-nitro-modules) - the published React Native package and its CocoaPods, Gradle, and CMake configuration. Its native sources are staged from `packages/react-native-nitro-modules/nitro/nitro-core/`; its RN-specific JS is maintained here. Shared JS/TS comes from `nitro-core`.
29
29
-[packages/react-native-nitro-test/](packages/react-native-nitro-test) — a Nitro module full of specs used as compile-time and runtime tests.
30
30
-[packages/react-native-nitro-test-external/](packages/react-native-nitro-test-external) — a second Nitro module used to cover cross-module behavior.
31
31
-[packages/template/](packages/template) - the `npx nitrogen init` React Native library template. It stays here with the CocoaPods/Gradle/CMake integration and React Native dependencies it configures.
@@ -50,17 +50,17 @@ bun lint-all # run all linters (JS/TS, C++, Swift, Kotlin)
50
50
51
51
The `packages/react-native-nitro-modules/nitro/` gitlink records the exact Nitro commit used by this repository. This repository develops on `main`; the submodule's development branch in `nitro` is `core-split`. Ordinary builds and `git submodule update --init --recursive` use the recorded commit. Do not use `git submodule update --remote` in builds.
52
52
53
-
Edit native sources in `packages/react-native-nitro-modules/nitro/packages/react-native-nitro-modules/` and shared JS/TS in `packages/react-native-nitro-modules/nitro/packages/nitro-core/`. The wrapper's `cpp/`, `ios/`, and `android/src/` directories are generated by `bun sync-core` and ignored by Git. The wrappermaintains `src/` for RN bootstrap, views, worklets, and shared API re-exports. The staging command owns only those directories and the additional shared files listed in `scripts/sync-core.mjs`. Keep handwritten package and build configuration outside them. Nitrogen is used directly from `packages/react-native-nitro-modules/nitro/packages/nitrogen/` and is not copied into the wrapper.
53
+
Edit shared sources in `packages/react-native-nitro-modules/nitro/nitro-core/`: `cpp/`, `apple/`, and `android/src/` contain native code; `js/` contains the shared JS/TS API. The wrapper's `cpp/`, `ios/`, and `android/src/` directories are generated by `bun sync-core` and ignored by Git. The command maps core's `apple/` sources to the wrapper's existing `ios/` path. The wrapper maintains `src/` for RN bootstrap, views, worklets, and shared API re-exports. The staging command owns only those directories and the additional shared files listed in `scripts/sync-core.mjs`. Keep handwritten package and build configuration outside them. Nitrogen is used directly from `packages/react-native-nitro-modules/nitro/nitrogen/` and is not copied into the wrapper.
54
54
55
55
To update the pinned core:
56
56
57
-
1. Edit shared sources in `packages/react-native-nitro-modules/nitro/`. Stage new or deleted implementation files there so `bun sync-core` sees them. Existing tracked edits can be tested before committing with `bun run build`, `bun specs`, and the relevant native builds and tests from the wrapper root. The wrapper builds Nitrogen directly from `packages/react-native-nitro-modules/nitro/packages/nitrogen/`.
57
+
1. Edit shared sources in `packages/react-native-nitro-modules/nitro/`. Stage new or deleted implementation files there so `bun sync-core` sees them. Existing tracked edits can be tested before committing with `bun run build`, `bun specs`, and the relevant native builds and tests from the wrapper root. The wrapper builds Nitrogen directly from `packages/react-native-nitro-modules/nitro/nitrogen/`.
58
58
2. Run the standalone core build and typecheck from a separate `nitro` checkout with its own dependencies: `bun install`, `bun run build`, and `bun typecheck`.
59
59
3. Commit and push the core changes first. Check out that commit in `packages/react-native-nitro-modules/nitro/`, then run `git add packages/react-native-nitro-modules/nitro` from the wrapper root before any further staging or builds. `bun sync-core` requires the core checkout's HEAD to match the gitlink in the wrapper's index.
60
60
4. If the core version changed, run `bun update-core-version`. Run `bun install`, `bun specs`, and the relevant native checks, then commit the core pin, version/lockfile changes, and any intended generated test bindings here. Push the wrapper commit after the core commit is available remotely.
61
61
5. On another checkout, run `git submodule update --init --recursive` followed by `bun install` after pulling the wrapper commit.
62
62
63
-
Prepare version changes in the standalone `nitro` repository with `bun version:set VERSION`. This updates `nitro-core`, Nitrogen, its core dependency, the native source manifest, and embedded JS/native versions. Build Nitrogen and refresh the core lockfile before committing. Publish `nitro-core` followed by `nitrogen` from the `nitro` repository, then use the final pushed core commit when updating the wrapper as described above. Nitrogen depends on `nitro-core` with a compatible semver range. The RN package depends on the exact core version to match its native runtime. All three packages use the coordinated release version.
63
+
Prepare version changes in the standalone `nitro` repository with `bun version:set VERSION`. This updates `nitro-core`, Nitrogen, its core dependency, and embedded JS/native versions in `nitro-core/js/version.ts` and `nitro-core/cpp/utils/NitroDefines.hpp`. Build Nitrogen and refresh the core lockfile before committing. Publish `nitro-core` followed by `nitrogen` from the `nitro` repository, then use the final pushed core commit when updating the wrapper as described above. Nitrogen depends on `nitro-core` with a compatible semver range. The RN package depends on the exact core version to match its native runtime. All three packages use the coordinated release version.
64
64
65
65
`bun update-core-version` copies the authoritative version into the wrapper and test packages. Inspect real `npm pack` tarballs for `nitro-core`, `nitrogen`, and the RN package and run the native consumer checks before publishing. In this repository, `bun release` checks the existing version and publishes only `react-native-nitro-modules` through `npm publish`; it does not bump versions with release-it.
66
66
@@ -118,7 +118,7 @@ If a PR adds dozens of new structs, enums, or spec files to reproduce a bug, it
118
118
bun specs
119
119
```
120
120
This runs `nitrogen` for `react-native-nitro-test` (and transitively for `react-native-nitro-test-external`). Commit the generated files.
121
-
4.**Implement the fix** in `packages/react-native-nitro-modules/nitro/packages/react-native-nitro-modules/` or `packages/react-native-nitro-modules/nitro/packages/nitrogen/`. Run `bun sync-core` after changing shared sources. Keep regression tests and their generated bindings in this repository.
121
+
4.**Implement the fix** in `packages/react-native-nitro-modules/nitro/nitro-core/` or `packages/react-native-nitro-modules/nitro/nitrogen/` for shared changes, or in this repository for RN integration changes. Run `bun sync-core` after changing shared sources. Keep regression tests and their generated bindings in this repository.
-[**react-native-nitro-test** example module](./packages/react-native-nitro-test/README.md)
62
62
-[`TestObject.nitro.ts` example playground](./packages/react-native-nitro-test/src/specs/TestObject.nitro.ts)
@@ -89,7 +89,7 @@ We build fast and beautiful apps. Contact us at [margelo.com](https://margelo.co
89
89
90
90
This repository owns the React Native package, apps, test modules, docs, and templates. Shared runtime sources and Nitrogen live in [margelo/nitro](https://github.com/margelo/nitro), pinned here by the `packages/react-native-nitro-modules/nitro/` submodule.
91
91
92
-
For a fresh checkout, run `bun bootstrap` to initialize `packages/react-native-nitro-modules/nitro/`, install dependencies, and build the workspace. Run `bun bootstrap:ios` to also install the example app's iOS dependencies. Implementation changes belong in `packages/react-native-nitro-modules/nitro/`; `bun sync-core` copies them into the React Native package before builds and packing.
92
+
For a fresh checkout, run `bun bootstrap` to initialize `packages/react-native-nitro-modules/nitro/`, install dependencies, and build the workspace. Run `bun bootstrap:ios` to also install the example app's iOS dependencies. Shared implementation changes belong in `packages/react-native-nitro-modules/nitro/nitro-core/`; `bun sync-core` copies its native sources into the React Native package before builds and packing. Shared JS/TS comes from the `nitro-core` dependency. RN bootstrap, views, and worklets integration remain in this repository.
93
93
94
94
Read [CONTRIBUTING.md](./CONTRIBUTING.md) for the contribution flow (PR expectations, the required test-per-fix rule, and the nitrogen workflow). For environment setup and reproduction walkthroughs, see the [contributing guide](https://nitro.margelo.com/docs/resources/contributing) on the docs site.
0 commit comments