saasframe eject
yarn saasframe eject copies a module's source code from its installed package (node_modules) into your app's src/modules/ directory and switches its origin in modules.ts to from: '@app'. After ejecting, the module behaves as a local module that you can freely modify.
The command is bootstrap-free — it reads files and copies them without requiring DI or ORM initialization. It is especially useful in standalone apps where you want to customize core behavior beyond simple overrides.
Usage
# List all ejectable modules
yarn saasframe eject --list
# Eject a specific module
yarn saasframe eject <moduleId>
Aliases: -l for --list.
yarn saasframe module eject <moduleId> is an alias for this command, provided for consistency with the module command namespace. Both are identical in behavior.
Options
| Option | Description |
|---|---|
--list, -l | List all modules that can be ejected. Modules already marked from: '@app' are excluded. |
<moduleId> | The module identifier to eject (e.g., currencies, catalog, customers). |
Ejectable Modules
Only modules with ejectable: true in their metadata can be ejected. The following core modules currently support ejection:
| Module | Description |
|---|---|
catalog | Products, categories, variants, pricing |
currencies | Multi-currency support, exchange rates |
customers | People, companies, deals, activities |
perspectives | Sidebar perspectives and view management |
planner | Planning and scheduling tools |
resources | Resources and resource types |
sales | Orders, quotes, invoices, shipments, payments |
staff | Staff management |
workflows | Workflow automation engine |
What the Command Does
- Validates that the module exists in
src/modules.tsand is not already local (from: '@app'). - Confirms the module is marked
ejectable: truein its package metadata. - Copies the entire module directory from the package into
src/modules/<moduleId>/, skipping__tests__,__mocks__, andnode_modulesdirectories. - Updates
modules.tsto change the module'sfromvalue to'@app', so the framework loads it from your local source instead of the package.
Post-Eject Steps
After ejecting, run the generators and start development:
# 1. Regenerate module registry, entities, DI
yarn saasframe generate all
# 2. Customize the module source
# Edit files in src/modules/<moduleId>/
# 3. Start the dev server
yarn dev
Examples
List modules available for ejection:
yarn saasframe eject --list
Output:
Ejectable modules:
currencies (from: @saasframe/core) — Multi-currency management
catalog (from: @saasframe/core)
customers (from: @saasframe/core)
...
Usage: yarn saasframe eject <moduleId>
Eject the currencies module:
yarn saasframe eject currencies
Output:
Ejecting module "currencies"...
✅ Module "currencies" ejected successfully!
Next steps:
1. Run generators: yarn saasframe generate all
2. Customize: edit src/modules/currencies/
3. Start dev: yarn dev
Troubleshooting
- Module not found — the module must be listed in your
src/modules.ts. Runyarn saasframe eject --listto see what is available. - Already ejected — if the module already has
from: '@app'inmodules.ts, it is already local. Edit it directly insrc/modules/<moduleId>/. - Not marked as ejectable — only modules whose
index.tsexportsejectable: truein their metadata support ejection. Core-only modules (e.g.,auth) cannot be ejected. - Destination directory already exists — remove or rename the existing
src/modules/<moduleId>/directory before ejecting again. - Build errors after ejection — run
yarn saasframe generate allto regenerate the module registry and DI bindings, then verify withyarn build.