← Recipe: persist and restore state

2. Replace luastra.json

luastra/state · luastra/host · app.resolve · about 15 minutes
storage.get + storage.set + ui.render

The manifest admits State, Host, and UI modules plus both storage capabilities.

When to use it

Replace the generated manifest before importing Host or State; storage reads and writes require separate capabilities.

Focused example

{
  "schemaVersion": 2,
  "project": { "id": "dev.luastra.storage-recipe", "entry": "app/main" },
  "sdk": { "contract": 1 },
  "capabilities": ["storage.get", "storage.set", "ui.render"],
  "modules": [
    {
      "id": "app/main",
      "source": "src/main.luau",
      "dependencies": ["luastra/app", "luastra/host", "luastra/state", "luastra/ui"]
    },
    {
      "id": "app/tests/storage",
      "source": "tests/smoke.luau",
      "dependencies": ["app/main", "luastra/state"]
    }
  ],
  "tests": ["app/tests/storage"]
}

Complete inventory

View all pages in Recipe: persist and restore state
← Previous: 1. Create the projectNext: 3. Replace src/main.luau →