Skip to main content

generated-metadata

Diagnose missing or stale dist/*-metadata.js, the Vite metadata plugin cache, and the ../name-metadata.js import alias. Use when dist/ is missing, a catalog resolves nothing, a spec fails only locally, or editing the Vite metadata plugin. Do not hand-edit dist/ or add another metadata module.

来源信息

仓库
LiberatedPixelCup/Universal-LPC-Spritesheet-Character-Generator
最近来源活动
2026年8月26日 13:07
检测到的 SKILL.md 语言
英语
星标
1,862
分支
596

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
generated-metadata
description
Diagnose missing or stale dist/*-metadata.js, the Vite metadata plugin cache, and the ../name-metadata.js import alias. Use when dist/ is missing, a catalog resolves nothing, a spec fails only locally, or editing the Vite metadata plugin. Do not hand-edit dist/ or add another metadata module.
# Generated metadata Vite writes five modules to `dist/`: `index-`, `palette-`, `item-`, `credits-`, and `layers-metadata.js`. Source code imports them as `../<name>-metadata.js`, never as a `dist/` path. See [Generated metadata and the dist alias](../../../ARCHITECTURE.md#generated-metadata-and-the-dist-alias). A resolve failure means `dist/` was never built. After a fresh clone, run `npm run dev` or `npm run build` once before specs, ZIP profiles, or `seedCatalogWithGeneratedContext`. `profile:app` starts Vite itself. The plugin fingerprints `sheet_definitions/`, `palette_definitions/`, and `scripts/generateSources/` under `.cache/` (gitignored). If the fingerprint matches and `dist/index-metadata.js` exists, generation is skipped. A generator emit change without a definition change used to reuse stale `dist/`. Symptoms: a seeded catalog resolves nothing, `not-found` for an item you just added, or a spec that passes for someone else. Force the full pipeline: ```bash VITE_REGENERATE_SOURCES=1 npm run dev ``` Deleting `.cache/` has the same effect. Details: [File Generation](../../../CONTRIBUTING.md#file-generation). After changing emit (`scripts/generateSources/`), run `npm run metadata:size` and `npm run metadata:size:check`. The check is the CI budget (item raw 500 KiB, item + index pair 600 KiB). Raising a budget is deliberate. Do not hand-edit `dist/` or add a sixth metadata module. ## Intern tables Emitted `index-metadata.js` stores shared tables; `item-metadata.js` stores indices. `registerIndexMetadata` / `registerItemMetadata` expand them. | Table | Indexed by | Restores | | --- | --- | --- | | `variantArrays` | per-item `v` | `ItemLite.variants` | | `recolorVariantArrays` | per-item `r` | `recolors[0].variants` | | `paletteArrays` | per-recolor `p` | `recolors[].palettes` | Emitted lite has `v` / `r` / `p` and omits the expanded arrays/maps. Not emitted on lite: `licenses`, `tags`, `required_tags`, `excluded_tags`, `priority` (credits chunk / sheet JSON / generator tree sort).
在 GitHub 查看