-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem description
When running shopify theme component dev --theme-path="." (or any theme path), the generated .dev folder contains empty config files (settings_data.json and settings_schema.json) instead of copying the existing config files from the specified theme directory. This prevents developers from testing components with actual theme settings during development.
Environment
- Collection repository: theme directory
- Branch name: main
- CLI version: 1.0.4
- Operating system: macOS
- Node.js version: 22
Steps to reproduce
- Navigate to a Shopify theme directory with populated
config/settings_data.jsonandconfig/settings_schema.jsonfiles - Run command
shopify theme component dev --theme-path="." - Check the generated
.dev/config/directory - Open
.dev/config/settings_data.jsonand.dev/config/settings_schema.json - See that both files exist but contain empty objects/arrays instead of the theme's actual configuration
Expected behavior
When using the --theme-path flag, the plugin should copy the existing config files from the specified theme directory to the .dev folder, preserving all theme settings and configurations. This would allow developers to test components with real theme settings (colors, fonts, typography, etc.) in the development environment.
Actual behavior
The plugin creates the following empty files:
.dev/config/settings_data.jsoncontains:{}.dev/config/settings_schema.jsoncontains:[]
Theme settings are not available in the component development environment, making it impossible to test components that depend on theme configurations.
Additional context
- This issue is critical for teams maintaining multiple theme variants (e.g., regional versions) where components need to be tested against different configurations
- Current workaround requires manually copying files after each
devcommand:
cp config/settings_data.json .dev/config/
cp config/settings_schema.json .dev/config/Potential fix
When the --theme-path flag is provided, the plugin should:
if (options.themePath) {
// Copy config files from theme to dev environment
copyFile(
path.join(themePath, 'config/settings_data.json'),
path.join(devPath, 'config/settings_data.json')
);
copyFile(
path.join(themePath, 'config/settings_schema.json'),
path.join(devPath, 'config/settings_schema.json')
);
}