Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Document the generate-fixtures asset store (fixtures.assets, $cwa->asset(), prune-fixture-assets)

オープン
#242 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php, yaml
領域
api, documentation

調査の方向性

Start in content/4.api/ and find the existing generate-fixtures and scaffold pages, then read the config and command details in the issue body and in components-web-app/api-components-bundle#466. Add a section that covers the fixtures.assets config keys, the one-off --assets-store and --assets-dir options, the .assets.json manifest, the prune-fixture-assets command and the load-time error. Done when each bullet in the issue has a matching passage and the page matches the merged #466 behaviour.

索引モデルが issue の本文から書いたものです。

説明

components-web-app/api-components-bundle#466 (for components-web-app/api-components-bundle#462) adds a fixture asset store to generate-fixtures. The API bundle's fixture docs (content/4.api/, the generate-fixtures / scaffold pages) should cover the following.

What to document

  • Why it exists. Without it, generate-fixtures writes a readable copy of every uploaded file to assets/ beside the scaffold. That is still the default. For a large site you can instead keep the files in a store and commit only a small manifest.

  • Configuration

    silverback_api_components:
      fixtures:
        assets:
          store: local | flysystem      # an env var works, e.g. '%env(FIXTURE_ASSETS_STORE)%'
          path: ...                     # local: the folder; default is assets/ beside the scaffold class
          adapter: gcloud               # flysystem: one of the app's filesystem adapter aliases (required)
          prefix: fixtures/             # flysystem: folder within the adapter
    

    Generating and loading both read this config. Generating needs write access to the store, and loading needs read access.

  • What gets generated

    • Each file is stored once under its SHA-256.
    • The class refers to it as $cwa->asset('<hash>').
    • The class gets a <ClassName>.assets.json manifest beside it, listing name, mime type, size and source fields. Commit the manifest with the class.
    • The same content uploaded under another name is written as $cwa->asset('<hash>', name: '…').
  • One-off options: --assets-store local|flysystem and --assets-dir <folder> (a local folder).

  • Loading: doctrine:fixtures:load resolves each hash through the configured store and stores the file under its manifest name. A missing or changed asset fails the load with a message naming the store.

  • Pruning

    • Generating into a local store deletes the assets the new manifest no longer lists. Give each scaffold its own local folder.
    • silverback:api-components:prune-fixture-assets <manifest>... [--dry-run] deletes from the store the assets that none of the given manifests lists. List every manifest a branch or deployment still loads.
    • Only hash-named files directly under the prefix are ever touched.
  • Hand-written scaffolds can call $cwa->asset() too, with a manifest beside the class.

  • Not built yet: an export-time --max-dimension downscale (see #462).

主要言語
Vue
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

components-web-app/docs のほかの issue

components-web-app/docs の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。