This reference explains how identifiers are generated throughout the CoMapeo configuration pipeline. It supports HIGH-024: Standardize Naming Conventions by documenting the rules implemented in src/utils.ts.
- Source:
Detailssheet, column A (field name). - Transformation:
createFieldTagKey(name, index). - Pattern: slugified field name (lowercase,
-separators). If the slug is empty, the fallback isfield-{position}(1-based).
- Source:
Categoriessheet, column A (category name). - Transformation:
createPresetSlug(name, index). - Pattern: slugified category name. Empty slugs fall back to
category-{position}.
- Source:
Detailssheet, column D (comma-separated options). - Transformation:
createOptionValue(label, fieldKey, index). - Pattern: slugified option label. If the slug is empty, the fallback is
{fieldKey}-{position}; when the field key is not yet available, it defaults tooption-{position}.
- Dataset ID defaults follow
comapeo-{slugified spreadsheet name}(seeprocessMetadata.ts). - Drive folder names use the spreadsheet name slug (
driveService.ts,icons.ts).
- Default icon names are slugified from the requested name (
iconProcessor.ts). - PNG/SVG extraction retains the original slug unless normalization removes illegal characters, in which case
normalizeIconSlugapplies the same fallback pattern.
- Helper functions (
createFieldTagKey,createPresetSlug,createOptionValue) provide the canonical behaviour. getFieldOptionsnow delegates tocreateOptionValue, preventing inconsistent option IDs.processFields.ts,processPresets.ts, and import/format detection flows call the helpers so that naming is stable across exports and imports.
When adding new identifiers, prefer the helpers and update this document if additional patterns are required.