Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
425 stars 130 forks source link

CLI is not respecting `extension_directories` in `shopify.app.toml` #4702

Open jagthedrummer opened 6 days ago

jagthedrummer commented 6 days ago

I'm trying to migrate to using the node CLI from having previously used the ruby CLI.

I'd rather not completely reorganize my app to fit the newly-invented directory structure that the new CLI seems to expect. My theme app extension lives in my project directory at theme-app-extension/ and it sits right next to app/, config/, lib/, etc... (this is a rails project).

I've added this line to shopify.app.toml:

extension_directories = [ "theme-app-extension" ]

When I run shopify app info that command shows that it's respecting the config.

...

DIRECTORY COMPONENTS
web
📂 web

theme_app_extension
📂 theme-app-extension   theme-app-extension
     config file         shopify.extension.toml

...

But when I run shopify app deploy it complains that theme-app-extension is not allowed:

Running validation ...
Error: Your theme app extension includes files in an unsupported directory, theme-app-extension
    at validateFile (file:///...snip.../node_modules/@shopify/cli/dist/index.js:163051:11)
    at file:///...snip.../node_modules/@shopify/cli/dist/index.js:163032:5
isaacroldan commented 3 days ago

Hey @jagthedrummer, thanks for reporting this. This error is thrown when the theme extension contains unexpected folders. (only assets, blocks, locales and snippets folders are allowed). Could this be your case?

@jamesmengo ☝