Skip to content

feat(create-frontend): add basercms5 project type#894

Open
yusasa16 wants to merge 4 commits into
devfrom
feat/create-frontend-add-basercms5-type
Open

feat(create-frontend): add basercms5 project type#894
yusasa16 wants to merge 4 commits into
devfrom
feat/create-frontend-add-basercms5-type

Conversation

@yusasa16
Copy link
Copy Markdown
Collaborator

関連イシュー

closes #802

概要

  • @d-zero/create-frontend--type オプションに basercms5 を追加
  • basercms5 選択時、ファイルを htdocs/webroot/ 以下に配置(CakePHP 5 の webroot 構造に対応)
  • kamado.config.tsoutputhtdocs/webroot に変更
  • htdocs/.htaccesshtdocs/webroot/.htaccess を生成(CakePHP のリクエスト転送・フロントコントローラー用)

設計

型別の静的ファイルを @d-zero/scaffold__type/<type>/ ディレクトリで管理する仕組みを新設。

置き場 対象
__type/<type>/ そのタイプ固有の静的ファイル(変換不要・追加のみ)
plopfile.js 共通ファイルの変換・除外・パス変更などロジックが必要なもの

今後タイプ固有のファイルを追加する際は scaffold/__type/<type>/ にファイルを置くだけで対応可能。

変更ファイル

  • packages/@d-zero/scaffold/__type/basercms5/htdocs/.htaccess — 新規
  • packages/@d-zero/scaffold/__type/basercms5/htdocs/webroot/.htaccess — 新規
  • packages/@d-zero/create-frontend/plopfile.js — basercms5 対応・__type/ 読み込み処理追加
  • packages/@d-zero/create-frontend/libraries.js — basercms5 用ライブラリパス追加
  • packages/@d-zero/create-frontend/index.spec.js — basercms5 テスト追加
  • packages/@d-zero/create-frontend/__snapshots__/index.spec.js.snap — スナップショット更新

Place scaffold files under htdocs/webroot/, update kamado output to htdocs/webroot,

and generate empty .htaccess files at htdocs/ and htdocs/webroot/ for CakePHP 5 setup.
Store static files unique to each project type under __type/<type>/.

Scaffolded files that need no transformation are placed here instead of

being generated inline in create-frontend plopfile logic.
…ype directory

Pre-load files under __type/<type>/ at setup time and copy them to the

destination as static add actions, removing inline file generation from plopfile logic.
htdocs/.htaccess redirects all requests to webroot/ for CakePHP 5.

htdocs/webroot/.htaccess routes non-existent paths to index.php as front controller.
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.

@d-zero/create-frontendのプロジェクトタイプにbaserCMS v5を追加する

3 participants