How setup works
What `bun run setup` copies, generates, patches, strips and finalizes - and the tree you end up with.
bun run setup runs once on a Starter or Pro tree. Here's what it does, step by step, and the
tree it leaves behind. To run it, see Quickstart; for the flags, see
Scripts.
The steps
For the selected option of every category, setup:
- Copies the module's
files/**to the repo root byte-for-byte and deletes files owned only by non-selected modules (a file listed by several modules survives while one owner is selected). - Generates
src/ui/index.ts(re-exports the active UI adapter),src/providers.tsx(providers nested byorder),src/lib/env.ts(zod-validatedEXPO_PUBLIC_*keys),.env.exampleand.readynative.json(the applied selection plus the merged app patch, post-setup steps and doctor checks). - Patches
package.json(adds module dependencies, removes those that belong only to non-selected modules, mergesscripts/overrides) andtsconfig.json(includeentries), then runs your package manager's install andexpo installfor the packages that need SDK-matched versions. - Strips the demo content so you start from a clean app: the weather demo
(the Cities tab in
src/app/(tabs)/cities/,src/screens/weather/,src/lib/weather/,src/stores/weather.tsand theuseForecasthook), the example screens (src/app/examples/,src/screens/examples/and the hook/store behind them), the UI catalog route and its Settings row, and the placeholder assets. The home screen becomes a plain welcome and the Weather tab turns back into Home. Pass--with-examplesto keep all of it. What stays is everything the demo was built on -@/lib/location,@/lib/widgets, the offline cache in@/lib/cache, every locale and the native tab bar.bun run cleanremoves it later, but only whilemodules/exists (--keep-modules); in a finalized tree, delete those files by hand. - Removes the
no-restricted-importsblock fromeslint.config.js(unless--keep-modules). It exists only so the shipped screens work on every UI stack; once your stack is fixed, you can importView/StyleSheetstraight fromreact-native. - Reconciles the tree with your package manager: the other package managers' lockfiles go (see Package managers).
- Finalizes the tree (unless
--keep-modules):src/ui/<stack>/*moves tosrc/components/ui/*, every@/uiimport becomes@/components/ui(and@/ui/contract→@/components/ui/types), theUiKitcontract is dropped, and the product tooling leaves:modules/is deleted,scripts/keepsdoctor,gen(the screen scaffolder),gen:theme,gen:links,gen:privacy,gen:assets,gen:graphande2e, plus any script a module added;README.md/AGENTS.mdare rewritten for your app.docs/(the architecture graph) stays, and so doesexamples/in the Pro repo - the example apps are standalone projects you keep or delete. - Prints the post-setup steps of every selected module (dashboards to create, keys to paste)
and a
https://readynative.app/docs/?stack=…link that pre-filters these docs to your tree.
The tree you end up with
After a finalizing run:
src/
app/ routes (expo-router)
screens/ screen bodies
components/
ui/ the kit: box.tsx, button.tsx, list.tsx, …, index.ts, types.ts
lib/ env, storage, i18n, auth/analytics/payments shims
stores/ theme/ locales/
scripts/ doctor.ts, gen.ts, gen-*.ts, e2e.ts (+ lib/)
docs/ ARCHITECTURE.md, graph.json
examples/ Pro only: two standalone example apps
readynative.config.ts app.config.ts eas.json .env.example .readynative.jsonNo modules/, no src/ui, no contract to satisfy - a normal Expo Router app you edit like any
other.
Finalizing is one-way
After a finalizing run, bun run setup is a one-line stub that prints "Already applied" and
changes nothing. Switching an option then means a fresh clone of your tier repo - Can I change a
module after setup? has the steps. To keep the tree
switchable, run bun run setup --keep-modules instead.
With --keep-modules
Steps 1-4 and 8 run as above, step 6 only removes the other lockfiles, and steps 5 and 7 are
skipped. modules/ stays, the kit stays in src/ui/<stack> behind @/ui and the
UI contract, and scripts/ keeps setup, clean and gen module.
Running setup again with a different selection re-resolves the plan, copies the new modules,
removes the old ones' files and regenerates providers and env. The same selection twice
produces no diff.