Document the generate-fixtures asset store (fixtures.assets, $cwa->asset(), prune-fixture-assets)
还没有人认领这个 Issue。
评估
- 难度
- 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-fixtureswrites a readable copy of every uploaded file toassets/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 adapterGenerating 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.jsonmanifest 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|flysystemand--assets-dir <folder>(a local folder). -
Loading:
doctrine:fixtures:loadresolves 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-dimensiondownscale (see #462).
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- 平均合并
- 1 小时 20 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
components-web-app/docs 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 40/100
components-web-app/docs#314 · 1 条评论 ·
-
documentation
难度 4/5 3-5 天 新手友好度 45/100
components-web-app/docs#290 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 35/100
components-web-app/docs#289 · 2 条评论 ·
-
enhancement
难度 5/5 一周以上 新手友好度 15/100
components-web-app/docs#237 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 35/100
components-web-app/docs#1 · 3 条评论 ·
查看 components-web-app/docs 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
needs-area
难度 2/5 1-3 小时 新手友好度 68/100
Azure/typespec-azure#5936 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 72/100
vercel-labs/scriptc#2910 ·
维护者通常 1 天内回复
-
automation missing-model model-sync provider:fireworks-ai
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/models.dev#12458 ·
维护者通常 1 天内回复