[Feature] CLI Generate types command

Currently to generate the types for app extensions you need to run the dev command on the CLI. However if you are upgrading from an older extension to a new one, this doesn’t always work and actually generate the shopify.d.ts file.

What I’d love is to be able to just generate the types by command without also having to start and spin up all the dev command. e.g. shopify app extension types generate, similar to how function extensions work therefore taking the guess work out of if the dev command will run or not.

Would it be possible to add a command like this? Please :folded_hands:

Hi @JordanFinners

Can you confirm which types you are referring to? Are they in an extension or the RR7 app?

Hey Nick,

Sorry should have added context for UI Extensions. “The shopify app dev command runs your app and also generates a shopify.d.ts file in your extension directory, adding support for the new global shopify object.”

Which generates a file like this when it works correctly, which doesn’t always happen when upgrading extensions.

import ‘@shopify/ui-extensions’;

declare module ‘./src/index.tsx’ {

const shopify: import(‘@shopify/ui-ex@shopifyensions/admin.order-details.action.render’).Api;

const globalThis: { shopify@shopify typeof shopify };

}

Thanks @JordanFinners. Can you tell us more about the use case? In what cases does the typegen during dev not work, and how would a separate command help?

Also, FYI the app build command is another mechanism to trigger the typegen. Does that help your use case?

Hey Nick,
Yeah I tried both of these and neither generated the types. I’m taking an older ui extensions (admin, pos) from version 2025-07 to 2026-04.

Followed the steps in here, the only difference is my tsconfig is at the root of my repo rather than extensions as its the same throughout.

Also tried the build command, which generated a manifest.json but no types.

I think I’ve confused my ask by combining two things:

  • The dev command doesn’t seem to generate types consistently when upgrading extensions, not sure if this a bug
  • I think an explicit command to just generate extension types would be helpful, like there is for functions, for DX to speed this step up, than having to run a whole dev command, be specific about the extension you want to generate rather than a side effect, allow AI agents to also generate these as well

Hi Jordan, you need to have a local tsconfig.json in order for type generation to work. This is by design so type checking can be optional. To resolve the issue you need to copy the tsconfig from your root to your extension folder (next to the shopify.app.toml). You can also use this minimal one that should work for extensions using preact:

{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "preact",
    "target": "ES2020",
    "checkJs": true,
    "allowJs": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "noEmit": true,
    "skipLibCheck": true
  }
}

Hey Trish,

Oh I see, is there any plans to make that more flexible? e.g. with a separate command to specifically generate them?
Copying the same tsconfig file for every extension (I’ve got 11) seems like a lot of duplication and extra files

Symlink them perhaps? One in root and symlink into each extension?

I think you can have a simple file that extends the base one so you don’t have to copy everything over.

{"extends": "../tsconfig"}

Thanks Trish. I’ve added that now and it works. I’d still love a separate command to trigger the typegen, just so I don’t have to spin everything up when I’m migrating each extension if possible please :folded_hands: