Recipe: a group in imbatranim-apps
Rendered from corpus/wiki/imbatranim-apps-group-recipe.md · updated 2026-11-09
This page is generated from the project corpus and rewritten on every docs build. Edit the source in corpus/, not here.
Written from the handoff of brief 64, which built the Games group. The layout choice and its measurements are in research-imbatranim-apps-layout.md; the per-app checklist is its section 4.
Where things go
- One root workspace. A group is a folder
<group>/at the repo root, a workspace package named@imbatranim-apps/<group>. There is one root lockfile. - Apps live at
<group>/apps/<id>/src/App.tsx, each with anApp.testthat runs throughfencedSystem. - The package has a
build:osscript that runsvite build. Its dependencies are pinned to the versions the OS resolves; its dev dependencies are the build helper's toolchain, at the root's pins. - Shared code: the Vite config calls
osBuildConfig({root, vendorDir, sharedDir}), so the group finds the kit snapshot and the build helper at the repo root. The group also has atsconfig, and the root wiring knows it: atsconfigreference,tsconfig.nodeand thevitestglobs. - The descriptor template is
os/descriptor.template.jsonin the group.
The descriptor
In the OS catalog (marketplace/<group>.json), schemaVersion is 2 and:
- build:
npm ci --workspace=<group>, thennpm run build:os --workspace=<group>; - output:
<group>/dist/os; each app's entry is<id>/app.mjsand its styles<id>/app.css; - capabilities come from the
systemcalls the app makes, not from the old built-in. Games made no calls, but its fenced tests use hotkeys, so it needsshortcuts; check each app's tests the same way; - the pin is the apps repo commit.
On the OS side
- Add the icons to
ICONS(apps/core/src/shared/registry/marketplace.tsx) and to the icon list inmarketplace/README.md. - Add to
RETIRED_APP_IDSonly if an app's id changes; a same-id move needs no pair. - Delete the built-in's folder, its
manifest.tsline and its lockfile entries, and fix the README and tour lines that name it as built in. - Walk the install from a
file://clone withMARKETPLACE_ALLOW_LOCAL_REPOS=true, and sync the dev container with deletes, since a plain sync leaves deleted add-ons behind.
Apps with hooks and data (Accessories, 2026-11-09)
Learned moving Todo and Bookmarks (brief 75); brief 76 meets the same.
- Sync the kit first, after committing any kit change.
kit:syncreads the OS's git objects, never its working tree, so commit the OS's kit change, thennpm run kit:sync -- <os-checkout> <commit>in the apps repo. Bump the snapshot test's expected commit, and run Office's tests too: the whole kit moves under it. - No react-query. Only React, React DOM and
@imbatranim/uiare lent; a bundled@tanstack/react-querycan't see the desktop's provider. The Accessories apps keep their query hooks' names and shapes overaccessories/shared/src/dataStore.ts: one store per page shared by the window and the hooks, changes in turn, each file written with the version it read, a stale write reloaded and reapplied. Move it topackages/shared/srcwhen a second group needs it. - The hooks are exported by name from
App.tsx(Background,commandSources); the root eslint config lets anApp.tsxexport more than components. A command source reads the app's folders throughctx.data(kit 1.6.0); it has no window and nouseSystem(). - Tests:
fencedSystem'sALWAYShasdata, as the OS's does, and the fake system has an in-memorydataseeded bykind:path(appData: { 'data:todos.json': ... }). - Capabilities follow the calls after the move: Todo lost
httponce its module was gone. - The data moves on the OS side, in
DataMovesService(apps/backend/src/modules/app-data/): at every start, for each app whose tables remain, it writes the files as the app withAppDataService.place(no installed check; never over a file the app wrote), then drops the tables. A failure keeps the rows, logged. Add a move there and delete the module in the same commit. Tables a move sets aside reach the owner throughSetAsideService(download or clean out): a move with new tables adds them to itsSET_ASIDE_TABLEpattern.
A list the OS also trusts (Developer, 2026-11-09)
Learned moving Git GUI and the REST API Client (brief 76).
- The store is shared.
createDataStorelives inpackages/shared/src/dataStore.ts; a group imports it by relative path (a scopednpm ci --workspace=<group>may not link the shared package).inFolder(data, 'state')keeps a store to one of the app's other folders. - A move names its kind.
Move.kindinDataMovesServicepicks the folder (statefor Git GUI'srecents.json);keep()writes rows the OS keeps itself in the transaction that drops the tables. - Before moving a list out, check what else reads it. Git GUI's recent
repositories were also what the grants hand-on checked to give a new
window a folder back, and an app-writable file can't be that check. The
answer (owner, 2026-11-09) was to keep the trusted half in the OS: the
repositories are OS recents of kind
folder, recorded only by an app that holds the folder whole, and the app's file is just its list. - Tests that open a moved app by id break: a catalog app that isn't
installed gets no token, so an e2e that used
open('git-gui')as "some built-in" needs another built-in. - Nothing else opened these apps; a folder recent now opens its app from
Start and the palette, so an app whose recents are folders reads its
open intent (
useOpenIntent).