Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng
#242 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php, yaml
Lĩnh vực
api, documentation

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
TypeScript
Star
0
Fork
0
Merge trung bình
1 giờ 20 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của components-web-app/docs

Tất cả issue của components-web-app/docs

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.