-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
brick を作成するための brick を作成 #120
Conversation
… other attributes accordingly
import 'package:mason/mason.dart'; | ||
|
||
void run(HookContext context) { | ||
final brickName = context.vars['brick_name']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vars
の取得方法は以下を参考にしました。
https://docs.brickhub.dev/hooks#-hooks-usage
environment: | ||
mason: ">=0.1.0-dev.52 <0.1.0" | ||
|
||
vars: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hooks で mason new
を実行するため、mason new
のオプションを受け取れるようにしました。FYI
## What is "brick" | ||
A brick to create a brick. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for review 🚀 |
@blendthink @Yamasaki-pan961 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@morikann
ご対応ありがとうございます!
一点だけコメントしましたので、ご確認お願いします 🙏
brickName, | ||
'--path', | ||
bricksDir + brickName, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ご指摘ありがとうございます!
以下で修正いたしました🙏
51dc495
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
レビューありがとうございます! |
概要
背景
これまで brick を作成し、それを mason.yaml に追加するには以下のコードを実行する必要がありました。
上記から分かるように、毎回 path を記載するのが面倒くさいという問題点がありました。
そのため、本 PR では brick を作成する brick を作成し、brick の作成をより簡単にしました。
brick の作成、mason.yaml への追加を行う際は以下のコードを実行します。
レビュー観点
mason make
コマンドを利用します。今回作成したのは brick を作る brick ということで、mason make brick
となるように、brick 名を "brick" にしました。レビューレベル
レビュー優先度
画像 / 動画
動作変更なし
動作確認手順
備考
mason make brick
を実行すると以下3点が聞かれ、それぞれに答えることで回答に合った brick が作成されます。また、
mason make
実行時に以下のようにオプションを指定することで、プロンプトで質問されることなく brick の作成が行えます。mason make brick --name [brick name] --hooks [true or false] --description [brick description]
全てのオプションに対し、デフォルト値が設定されています。そのため、brick の説明など、作成時にまだ考えていないものは答えなくても問題ありません。