[shopify]Theme Kit使用方法メモ

触りだけ。

インストール

chocolatey(パッケージマネージャー)を使ってPCにインストールする。インストールも仕様も全てコマンドでやっていくことになる(WindowsならPowerShell)。

詳細は前回の記事に。

使用方法

インストールできてたら、コマンドを叩くだけ。PowerShellで常時使える状態になってるんで、「ThemeKitを起動する」みたいな動作は不要。

「theme version」でバージョン確認

コマンドの種類

初っ端に躓くのは「どうやって使うんですか」ってところで、コマンド一覧の取得方法を抑えておく。

theme --help
Theme Kit is a tool kit for manipulating shopify themes

Theme Kit is a fast and cross platform tool that enables you to build shopify themes with ease.

Complete documentation is available at https://shopify.dev/tools/theme-kit.

Usage:
  theme [command]

Available Commands:
  configure   Create a configuration file
  deploy      deploy files to shopify
  download    Download one or all of the theme files
  get         Get a theme and config from shopify
  help        Help about any command
  new         New will generate a new blank slate theme in the same directory where it gets called from and create a new theme on Shopify with those files.
  open        Open the preview for your store.
  publish     publish a theme
  remove      Remove theme file(s) from shopify
  update      Update Theme kit to the newest version.
  version     Print the version number of Theme Kit
  watch       Watch directory for changes and update remote theme

Flags:
      --allow-live                     Will allow themekit to make changes to the live theme on the store.
  -c, --config string                  path to config.yml (default "C:\\WINDOWS\\system32\\config.yml")
  -d, --dir string                     directory that command will take effect. (default current directory)
  -e, --env stringArray                environment to run the command (default [development])
  -h, --help                           help for theme
      --ignored-file stringArray       A single file to ignore, use the flag multiple times to add multiple.
      --ignores stringArray            A path to a file that contains ignore patterns.
      --no-ignore                      Will disable config ignores so that all files can be changed
      --no-theme-kit-access-notifier   Stop theme kit from notifying about Theme Access.
      --no-update-notifier             Stop theme kit from notifying about updates.
  -p, --password string                theme password. This will override what is in your config.yml
      --proxy string                   proxy for all theme requests. This will override what is in your config.yml
  -s, --store string                   your shopify domain. This will override what is in your config.yml
  -t, --themeid string                 theme id. This will override what is in your config.yml
      --timeout duration               the timeout to kill any stalled processes. This will override what is in your config.yml
      --vars string                    path to an file that defines environment variables
  -v, --verbose                        Enable more verbose output from the running command.

Use "theme [command] --help" for more information about a command.

物によって扱い方が変わるので、結局のところこれだけで解決はしないんだけどね。

以下の記事が丁寧で分かりやすい。

【Shopify】Theme Kitのコマンドまとめ | トマトソースのWEB開発
Shopifyのテーマ開発には欠かせないTheme Kitのコマンドをまとめました。使い方からオプションフラグまで掲載しているので、どのコマンドか忘れた際の辞書的役割としてお使いください。

コメント

タイトルとURLをコピーしました