This repository hosts a web-based guide for Cataclysm: Dark Days Ahead (CDDA) that presents searchable, browsable data about game entities such as items and monsters. The goal is to provide players with a quick reference for in-game information, mirroring the semantics from the upstream CDDA codebase and JSON data. When behavior or terminology is unclear, cross-reference the official Cataclysm-DDA source, which may already be checked out in ../Cataclysm-DDA.
- Source is written in TypeScript using Svelte components.
- Use
yarn lint:fixbefore committing to apply Prettier formatting. - A pre‑commit hook runs Prettier,
svelte-checkandtsc --noEmit. - Tests are written with Vitest (
*.test.ts). Runyarn testto execute them. yarn testfetches data into_test/all.jsonif needed viafetch-fixtures.js.
src/– Svelte components and TypeScript logictypes/– UI components grouped by game object typetypes/item/,types/monster/– submodules for item and monster detailsassets/– bundled images*.test.ts– unit testsdata.ts– code for loading and translating game data
public/– static assets used by Vite_test/– downloaded test fixtures (all.meta.jsonis tracked,all.jsonis fetched on demand)vite.config.ts,svelte.config.js,tsconfig*.json– build configuration- Scripts like
fetch-fixtures.jsandgenerate-color-css.jslive in the repo root
- Use Yarn for dependency management (
yarn install). - Run
yarn devfor the development server andyarn buildto create a production build. - CI uses Node.js 22.x; modern Node versions (>=18) are recommended.
- Always run
yarn testbefore committing. If tests cannot run due to network limits, note this in your PR.
cdda-guide is intended to function with data from the master branch of Cataclysm-DDA, as well as with the most recent stable version. Compatibility with older versions is desirable but not required. When making changes, if it is easy to maintain compatibility with older versions, please do so. However, if it would require a significant amount of work, it is acceptable to only support the latest stable version and master.
There are two sources for translation strings:
- For text from the game itself, we rely on the translations provided by the Cataclysm-DDA project.
These are usable via the i18n.gettext helpers (
singular/plural/translate/ etc. in data.ts for data from items, ori18n.__/i18n.gettextfor UI strings). It's preferable to use these when possible as they match the in-game strings and don't require further translation. - For UI strings and any additional text we add, we use Transifex via the
t("English String", { _context?: string, _comment?: string })helper. If a string requires interpolation, and the interpolated values are basic values (e.g. strings or numbers), they can be passed using thet("{n}", {n})syntax. If the interpolated values aren't basic strings (e.g. they are links or Svelte components), the <InterpolatedString> component can be used.