Skip to content

feat(scaffold): add add-component script to scaffold new components#895

Draft
yusasa16 wants to merge 3 commits into
devfrom
feat/scaffold-add-component
Draft

feat(scaffold): add add-component script to scaffold new components#895
yusasa16 wants to merge 3 commits into
devfrom
feat/scaffold-add-component

Conversation

@yusasa16
Copy link
Copy Markdown
Collaborator

Summary

  • @d-zero/scaffoldyarn add-component -n <名前> コマンドを追加
  • scaffdog でコンポーネントの CSS/Pug スケルトン(c-<name>.css / c-<name>.pug)を __assets/_libs/component/ に生成
  • __assets/htdocs/css/style.css の最後の @import '@/component/...' layer(component); 直後に新規 import を自動挿入(重複時はスキップ)
  • 対象 CSS は targetCssFiles 配列で管理。追加対象を増やす場合はスクリプト内を編集
  • README に使い方を追記
  • @d-zero/create-frontend の snapshot を更新(新規 scaffold ファイルを反映)

Closes #877

Test plan

  • yarn test がパスすること(snapshot を確認)
  • cd packages/@d-zero/scaffold && yarn add-component -n sample を実行し、__assets/_libs/component/c-sample.{css,pug} が生成されること
  • 同コマンド実行後、__assets/htdocs/css/style.css の component import 群の末尾に @import '@/component/c-sample.css' layer(component); が追加されていること
  • 同じ名前で再実行した際にスキップメッセージが出ること

🤖 Generated with Claude Code

yusasa16 and others added 2 commits May 13, 2026 13:44
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yusasa16 yusasa16 self-assigned this May 13, 2026
@yusasa16 yusasa16 marked this pull request as draft May 19, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

コンポーネントファイルの生成ツールを作成する

1 participant