CLI

CLIコマンドを使用してテーマを生成する方法を学ぶ。

使い方

テーマを生成する

themeコマンドを実行すると、指定されたパスにテーマを生成します。

pnpm yamada-cli theme
Usage: pnpm yamada-cli theme [options] [path]

generate theme to your project.

Arguments:
  path                       path to the theme directory.

Options:
  --cwd <path>               current working directory.
  -c, --config <path>        path to the config file. (default: "ui.json")
  -o, --overwrite            overwrite existing directory. (default: false)
  -j, --js                   use js instead of ts.
  -y, --yes                  skip all confirmation prompts. (default: false)
  -p, --package-name <name>  package name (for monorepo).
  -s, --src                  use src/ directory.
  --no-src                   do not use src/ directory.
  -i, --install              install dependencies when choice is monorepo.
  --no-install               do not install dependencies when choice is monorepo.
  -f, --format               format the output files.
  --no-format                do not format the output files.
  -l, --lint                 lint the output files.
  --no-lint                  do not lint the output files.
  -t, --tag <name>           tag for the registries (e.g. dev, next).
  -h, --help                 display help for command

差分を確認する

diffコマンドを実行すると、テーマのローカルとリモートの差分を確認できます。

pnpm yamada-cli diff theme
Usage: pnpm yamada-cli diff [options] [component]

check for updates against the registry.

Arguments:
  component            component to check.

Options:
  --cwd <path>         current working directory.
  -c, --config <path>  path to the config file. (default: "ui.json")
  -s, --sequential     run tasks sequentially. (default: false)
  -d, --detail         show detailed changes. (default: false)
  -y, --yes            skip all confirmation prompts. (default: false)
  -u, --update         update files when there are file diff.
  --no-update          do not update files when there are file diff.
  -i, --install        install dependencies when updating files.
  --no-install         do not install dependencies when updating files.
  -t, --tag <name>     tag for the registries (e.g. dev, next).
  -h, --help           display help for command

テーマを更新する

updateコマンドを実行すると、テーマを更新します。

pnpm yamada-cli update theme
Usage: pnpm yamada-cli update [options] [components...]

update components in your project.

Arguments:
  components           components to update.

Options:
  --cwd <path>         current working directory.
  -c, --config <path>  path to the config file. (default: "ui.json")
  -s, --sequential     run tasks sequentially. (default: false)
  -F, --force          force update, overwriting local changes. (default: false)
  -y, --yes            skip all confirmation prompts. (default: false)
  -i, --install        install dependencies.
  --no-install         do not install dependencies.
  -f, --format         format the output files.
  --no-format          do not format the output files.
  -l, --lint           lint the output files.
  --no-lint            do not lint the output files.
  -t, --tag <name>     tag for the registries (e.g. dev, next).
  -h, --help           display help for command

型定義を更新する

tokensコマンドを実行すると、カスタマイズしたテーマの型定義を更新できます。 この型定義は、Style Propsなどで使用されます。

pnpm yamada-cli tokens
Usage: pnpm yamada-cli tokens [options] [path]

generate theme typings.

Arguments:
  path                 path to the theme file.

Options:
  --cwd <path>         current working directory.
  -c, --config <path>  path to the config file. (default: "ui.json")
  -o, --out <path>     output path.
  -f, --format         format the output file.
  --no-format          do not format the output file.
  -l, --lint           lint the output file.
  --no-lint            do not lint the output file.
  --internal           generate internal tokens. (default: false)
  -h, --help           display help for command