Replies: 1 comment
-
|
Additionally, perhaps an extension worth flagging: In monorepos with nested scopes or hierarchical package structures ( A parametric color driver could handle this: {
"packageMeta": {
"@myorg/api": {
"color": "#3B82F6",
"colorMode": "gradient"
},
"@myorg/web": {
"color": "#22C55E"
}
}
}Where This is/may be out of scope for an initial PR, but it suggests that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
User-configurable package colors in turbo.json
Problem
Monorepos with 15+ packages get no visual signal from task prefix colors. The current 5-color palette (
cyan,magenta,green,yellow,blue) cycles ~3 times across 18 packages, making colors noise rather than signal.Teams that maintain domain-specific color conventions (design systems, microservice topologies, pillar architectures) can't leverage their existing visual vocabulary in turbo output.
Prior work
This builds on the chain of improvements to color handling:
PR #9023 solved which package gets which color. The natural next step is letting users choose which color.
Proposal
A top-level
packageColorsmap inturbo.jsonthat feeds into the existingColorSelector:{ "packageColors": { "@myorg/api": "#3B82F6", "@myorg/web": "#22C55E", "@myorg/shared": "#FFD700" } }Why
packageColorsand not per-task configI'm aware that per-task UI configuration was discussed in #9167 and #9091, and that the concern is "there can only be one UI but many tasks." This proposal is deliberately scoped differently:
ColorSelector's lookup table, not the UI modeScope
The implementation touches three files:
crates/turborepo-ui/src/color_selector.rs— accept custom colors from config alongside the existing palettecrates/turborepo-lib/src/turbo_json/— parse the optionalpackageColorsfieldcrates/turborepo-lib/src/task_graph/visitor.rs— pre-populate custom colors before the graph walkQuestions for the team
packageColorsconfiguration surface inturbo.json?turbo.jsonor somewhere else in the schema?#RRGGBB, named ANSI colors, or both?)Happy to submit a PR if there's interest. Would keep it tightly scoped to this one feature.
Beta Was this translation helpful? Give feedback.
All reactions