> ## Documentation Index
> Fetch the complete documentation index at: https://docs.waniwani.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Eject

> waniwani eject writes the server, the bundler config and the deploy files into your repo, rewrites the imports, and removes @waniwani/kit from the dependencies. One way only.

`waniwani eject` writes the plumbing into the repo itself and leaves. What comes out is the same tree a build was producing all along, with your source moved under `src/app/`:

```text theme={null}
oney/
├── src/app/{tools,widgets,flows,lib}/        your code, moved
├── src/_runtime/                             the runtime, vendored as source
├── src/{server,waniwani}.ts                  entry and registration
├── src/views/<widget>.tsx                    view entries
├── vite.config.ts  alpic.json  vercel.json   bundling and deploy
├── Dockerfile  .dockerignore                 container deploy
└── tsconfig.json  package.json
```

Every `@waniwani/kit` import gets rewritten to `./_runtime/…`, and the dependency drops out of `package.json`. From then on the repo runs on Skybridge's own CLI (`dev`, `build`, `start`) with no Waniwani in the loop.

```bash theme={null}
waniwani eject               # in place
waniwani eject --out ../oney-ejected
```

Ejecting in place moves the files instead of copying them, so the originals go once the copy is on disk and the repo is never left holding two versions of a file that can drift. `--out <dir>` leaves the source repo untouched. Either way the CLI prints what moved. Eject refuses to overwrite existing plumbing unless you pass `--force`, and it runs one way, with nothing to turn an ejected repo back.

## Why the source moves under src/

Your source has to move under `src/` for the compiled server to land where Skybridge's entry wrapper looks for it. `tsc` derives `rootDir` from the widest common ancestor of the files it compiles, so source sitting beside `src/` rather than inside it pushes every emitted path down a level and the wrapper's import misses.

## The trade eject makes

What an ejected repo gives up is the generator, and with it:

* **the build check**, so `showWidget("typo")` becomes a runtime failure again
* **name-from-filesystem**, so adding a widget means editing `src/waniwani.ts` and adding an entry under `src/views/`
* **runtime fixes**, since `src/_runtime/` is a fork from the moment it lands
