-
Notifications
You must be signed in to change notification settings - Fork 0
feat: init storybook #24
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
base: main
Are you sure you want to change the base?
Conversation
Walkthrough新しい環境設定ファイル、Storybookの設定と依存関係、ヘッダーコンポーネントの再構成と新しいリンクコンポーネントの追加が行われました。全体の変更は、再利用性とモジュール性を高め、ストーリーブックに基づいたコンポーネント開発環境を整備することを目的としています。 Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Deploying simochee-net-storybook with
|
| Latest commit: |
b646ac0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9217495e.simochee-net-storybook.pages.dev |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
Files selected for processing (9)
- .env (1 hunks)
- .gitignore (1 hunks)
- .storybook/main.ts (1 hunks)
- .storybook/preview.tsx (1 hunks)
- package.json (1 hunks)
- src/components/Header/index.tsx (2 hunks)
- src/components/HeaderMenuLink/index.stories.tsx (1 hunks)
- src/components/HeaderMenuLink/index.tsx (1 hunks)
- tsconfig.json (1 hunks)
Files not reviewed due to errors (1)
- src/components/Header/index.tsx (no review received)
Files skipped from review due to trivial changes (3)
- .env
- .gitignore
- .storybook/main.ts
Additional context used
Biome
src/components/Header/index.tsx
[error] 25-25: Missing key property for this element in iterable. (lint/correctness/useJsxKeyInIterable)
The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.
Additional comments not posted (10)
.storybook/preview.tsx (3)
1-2:storybook-framework-qwikのインポートと設定を確認してください。
qwikCityDecoratorが正しくインポートされており、ストーリーブックのデコレータとして設定されています。これにより、Qwik Cityのコンテキストがストーリーブックのプレビューで利用可能になります。
5-16: プレビュー設定の確認。
Previewオブジェクトの設定が適切です。特に、controls.matchersで色と日付のフィールドを正しく設定している点、Zeplinリンクの追加、そしてqwikCityDecoratorの使用が確認できます。これにより、UIコンポーネントの開発時にユーザーインターフェースの一貫性と再現性が向上します。
18-18: デフォルトエクスポートの確認。
previewオブジェクトをデフォルトでエクスポートしています。これにより、他の設定ファイルやコンポーネントからこの設定を簡単に利用できるようになります。src/components/HeaderMenuLink/index.tsx (2)
1-2: インポートとフックの確認。
AnchorHTMLAttributesとSlotの型が正しくインポートされています。また、useLocationフックを使用して現在のURLのパス名を取得しています。これにより、コンポーネントの動的なスタイリングが可能になります。
4-19: コンポーネントの定義とエクスポート。
Props型を正しく定義し、クラス属性を除外しています。コンポーネントは、与えられたプロパティに基づいて条件付きでスタイルを適用し、Slotを使用して子要素をレンダリングします。この設計により、再利用可能で保守が容易なコンポーネントが提供されます。tsconfig.json (1)
24-24: TypeScriptの設定を確認してください。
.storybookディレクトリがinclude配列に追加されました。これにより、ストーリーブックの設定ファイルもTypeScriptのチェックの対象になり、プロジェクト全体の型安全性が向上します。src/components/HeaderMenuLink/index.stories.tsx (2)
1-3: ストーリーブックの設定のインポートとコンポーネントの確認。
MetaとStoryObjの型が正しくインポートされています。また、HeaderMenuLinkコンポーネントも適切にインポートされています。これにより、ストーリーの定義に必要な型安全性が保証されます。
4-33: ストーリーのメタデータとプライマリーストーリーの定義。ストーリーのメタデータを定義しており、
component,argTypes,args,renderフィールドが設定されています。これにより、コンポーネントの振る舞いをカスタマイズしてプレビューすることが可能です。プライマリーストーリーも適切に設定されており、特定の引数が与えられた場合のコンポーネントの振る舞いを示しています。package.json (2)
6-13: ストーリーブックのスクリプトの追加。
build-storybookとstorybookスクリプトが追加されました。これにより、ストーリーブックのビルドと開発サーバの起動が簡単に行えるようになります。スクリプトの設定が正確であり、プロジェクトの構築とテストの効率が向上します。
19-39: ストーリーブック関連の依存関係の追加。多数のストーリーブック関連の依存関係が追加されています。これにより、UIコンポーネントの開発とテストが容易になります。依存関係のバージョンが適切であり、プロジェクトの要件に合致していることを確認してください。
Summary by CodeRabbit
新機能
HeaderコンポーネントにHeaderMenuLinkの使用を導入しました。その他
.envファイルを追加し、環境変数を導入しました。.gitignoreファイルを更新し、*.logファイルと/storybook-staticディレクトリを除外しました。.storybookディレクトリを含めるようにしました。