Polaris CLI
Commands for building Shopify Apps with Polaris.
Installation
You can install the Polaris plugin for the Shopify CLI by running the following command:
Exampleshopify插件安装@shopify / polaris-cli
See theShopify CLI command syntaxsection for how to execute commands using other package managers (ex: npm, Yarn, or pnpm).
Commands
migrate
Executes thePolaris Migrator. This makes version upgrades faster and safer by performing codemod transformations to your codebase. You can apply any of theavailable Polaris migrationsusing theShopify CLImigrate
command.
Exampleshopify polaris migrate<migration><path>
migration
- name of migrationpath
- files or directory to perform migration
The following is a complete CLI command example usingnpm
:
Examplenpm run shopify polaris migrate v10-react-replace-text-components'src/components/**/*.tsx'
See theShopify CLI command syntaxsection for how to execute commands using other package managers.
Flags
Flag | Description |
---|---|
--dry |
Do a dry-run, no code will be edited |
--print |
Prints the changed output for comparison |
--force |
Bypass Git safety checks and forcibly run migrations |