package.json, a components/ folder, optionally a functions/ folder, and an ollie.json that tells the CLI which store the project belongs to and which folders are components.
ollie.json
ollie.json
The file is read by
start, whoami and function dev. The record and deploy commands do not read it: they take every id as a flag.
The components map
Each entry maps a key to a folder:- The key is either the component’s UUID, which makes the entry linked to a record in your store, or any alias you like, which makes it unlinked. An unlinked entry gets the temporary id
studio-<alias>and shows up in Studio with a Publish button. pathis the folder, relative to the project root. It must contain anindex.tsx. It can live outsidecomponents/.slotis where the component renders. Without it the component is built but not placed, andstartwarns about it.idcan carry the UUID when the key is an alias; usually the key itself is the UUID.
<folder>-copy-<id> entries.
Folders under components/ that are not in the map are still discovered: the CLI falls back to a legacy meta.json inside the folder, and without one treats the folder as unlinked with no slot.
Stages
A project can hold several configurations, one per stage:ollie.json is the prod stage, and ollie.<stage>.json (for example ollie.dev.json) any other. Select one with --stage <name> or -s, or set OLLIE_STAGE.
A stage file is merged over ollie.json key by key: a versionId in ollie.dev.json replaces the one in ollie.json, and so does a components map (the two maps are not combined). ollie.json must exist even when you only use a stage, and a stage file that does not exist is an error:
init
Writes the ids toollie.json (or to ollie.<stage>.json with --stage), merging with what is already there. It does not check that the ids exist and needs no login.
init ignores OLLIE_STAGE; pass --stage explicitly.
setup
Migrates a project from the legacy per-foldermeta.json files to the components map. For every components/<name>/meta.json (or meta.<stage>.json) that carries an id, it writes the entry into ollie.json (or the stage file) and deletes the meta file. Metas without an id are left alone.
Related
- Build Your First Component: declaring and linking a component step by step
- Ollie Studio: how publishing writes the map back
- start: the dev server that reads this file