Project layout
What the scaffold gives you and where things live.
Structure
hello-lynx/
├── src/
│ ├── App.tsx # root component
│ ├── main.tsx # background-thread entry: mounts App
│ └── main.thread.tsx # main-thread entry
├── assets/ # icon, splash and adaptive-icon PNGs
├── signalx.config.ts # native app config: name, ids, icons, modules
├── lynx.config.ts # build plugin config (BG/MT bundles)
├── ios/ # generated by `sigx prebuild`
└── android/ # generated by `sigx prebuild`
Scripts
| Script | Runs | What it does |
|---|---|---|
dev | sigx dev | Dev server plus the device dashboard |
build | sigx build | Production JS bundle in dist/ |
doctor | sigx doctor | Toolchain check |
run:android / run:ios / run:web | sigx run:* | Build, install and launch on a device, simulator or the browser |
native:prebuild | sigx prebuild | Regenerate ios/ and android/ |
In projects scaffolded before @sigx/cli 0.13, the prebuild script was named prebuild. npm runs a script with that name as a pre-hook of build, so every npm run build regenerated the native projects. Rename it to native:prebuild in an older app's package.json.
The two bundles
The build plugin compiles your source twice: a background bundle (your components and signals) and a main-thread bundle (worklets, animation drivers). You rarely think about this — @sigx/lynx-plugin handles the split and the worklet transform.
Native projects
ios/ and android/ are generated — treat them as build output. Re-run sigx prebuild (npm run native:prebuild) after adding native modules; the autolinker wires them up.
