Workspace mode

Workspace mode is for developing against unreleased SDK changes in a local rsg-sdk checkout. It is not required to build an app with a published SDK. For ordinary app development, including several apps in one repository, use the registry layouts in Directory layout.

A pnpm workspace links an app to SDK source only when its package globs include both the app and the SDK packages it depends on. In the SDK repository, the root pnpm-workspace.yaml includes the SDK packages and example apps. The example apps declare SDK dependencies as workspace:*, so pnpm links those packages from the checkout instead of fetching published versions.

For a source checkout arranged with packages under rsg-sdk/packages/, a containing workspace can use this layout:

project-root/
├── package.json
├── pnpm-workspace.yaml
├── apps/
│   └── my-app/
└── rsg-sdk/
    └── packages/

Its package list must include both sets of packages:

packages:
  - "apps/*"
  - "rsg-sdk/packages/*"

Adjust the paths to your actual checkout. Include any additional local package directories required by those packages, and retain the root's pnpm 11 install-script decisions. The two-glob list above describes membership, not a complete replacement for a checkout's workspace configuration.

In the app's package.json, declare the SDK packages it uses with workspace:* ranges, including @roku-sdk/tooling. Run pnpm install at the workspace root, then run pnpm exec rk build inside the app. Keep roku-config.ts, src/ and pkg/ in the app; they have the same roles as in a registry project.

The rk create template depends on where the tooling package is installed. Tooling running from an SDK checkout with examples/baseline-app available uses that example and preserves its workspace:* dependencies. Tooling installed from the registry uses its bundled template and writes published version ranges, even when you invoke it inside a pnpm workspace. Check the generated package.json before installing; a containing workspace alone does not switch an app to SDK source dependencies.

Device configuration is independent of these dependency ranges. Use the layered device store, and ignore .roku/ wherever you keep local state. Before distributing an app that no longer depends on the checkout, replace its SDK workspace:* ranges with compatible published versions as explained in Installing packages.


Did this page help you?