facebook / facebook/astryx

theme-neutral: clarify palette refs regeneration and drift checks

Open
#6,305 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
13k
Forks
1.1k
Avg merge
1d 15h
Merged PRs (30d)
690

Description

## Summary

- clarify the supported way to regenerate `neutralPaletteRefs.generated.ts`
- confirm how CI checks every selected value against the full palette
- keep existing palette values, token mappings, and the runtime bundle boundary unchanged

## Motivation

[`neutralPaletteRefs.generated.ts`](https://github.com/facebook/astryx/blob/ae9ccef67c09a036c1f2e273e783ae78cd8d2c67/packages/themes/neutral/src/neutralPaletteRefs.generated.ts#L3-L50) stores copied values from the full palette rather than importing it. This split was introduced in #6034 to avoid shipping unused palette stops. A [follow-up comment](https://github.com/facebook/astryx/pull/6034#issuecomment-5550290078) says the selected-stop module was regenerated after a palette update.

I could not find a checked-in command for that step:

- The [palette generator](https://github.com/facebook/astryx/blob/ae9ccef67c09a036c1f2e273e783ae78cd8d2c67/packages/cli/api/theme/palette/generate/generate.mjs#L340-L368) writes the full candidate and receipt, not the selected-stop module.
- [`generate-cli-themes.mjs`](https://github.com/facebook/astryx/blob/ae9ccef67c09a036c1f2e273e783ae78cd8d2c67/scripts/generate-cli-themes.mjs#L94-L123) copies the existing Refs file into the CLI template.
- The [receipt check](https://github.com/facebook/astryx/blob/ae9ccef67c09a036c1f2e273e783ae78cd8d2c67/scripts/check-theme-template.test.mjs#L279-L295) verifies the full palette. The [mapping tests](https://github.com/facebook/astryx/blob/ae9ccef67c09a036c1f2e273e783ae78cd8d2c67/packages/themes/neutral/src/neutralTheme.test.ts) cover expected token assignments, but I could not find a direct comparison of every Refs entry with its source palette entry.

I compared all 104 selected entries with the full palette and found no mismatches. This is about keeping future edits in sync, not a current color regression.

## Questions

1. Is there an existing command or documented workflow for regenerating the selected-stop module?
2. Is there a CI check covering every copied stop, beyond the token-mapping assertions?
3. If either is missing, would documenting the regeneration step and adding a full-entry drift check be an appropriate follow-up?

## Scope

Neutral palette maintenance only. No changes to palette values, semantic mappings, or public APIs. Importing the full palette into the runtime theme would reintroduce the bundle concern from #6034, so I would leave that split in place.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.