Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Each catalog has a different color #6

Open
3 tasks done
trydofor opened this issue Sep 14, 2024 · 2 comments
Open
3 tasks done

Each catalog has a different color #6

trydofor opened this issue Sep 14, 2024 · 2 comments
Labels
enhancement New feature or request pr welcome

Comments

@trydofor
Copy link

Clear and concise description of the problem

catalogs:
  common:     ## color:orange
    "@vueuse/core": "^11.0.3"
    "@vueuse/nuxt": "^11.0.3"
  deploy:     ## color:blue
    "@changesets/cli": "^2.27.8"
  testing:    ## color:green
    "vitest": "^2.0.5"

it would be great if catalog with different color to distinguish them.

Suggested solution

color can auto calculate or manually set

Alternative

No response

Additional context

No response

Validations

@trydofor trydofor added the enhancement New feature or request label Sep 14, 2024
@antfu
Copy link
Owner

antfu commented Sep 14, 2024

Un, interesting. I don't actually use named catalogs, but yeah I think this would be a nice feature. PR welcome if anyone wants to work on it

@trydofor
Copy link
Author

I cloned this repo, and tried to the following,

predefine 10 colors in the config, and get colors by the catalog index,

  • 0 - for the default catalogs
  • 1... - for named catalogs by index
  • #000000 - for the IndexOutOfBounds
"contributes": {
  "configuration": {
+     "pnpmCatalogLens.colors": {
+     "type": "array",
+     "default": ["#f69220", "#845EC2", "#D65DB1", "#2C73D2", "#0089BA", "#008F7A", "#00C7AD", "#F3C5FF", "#00C0FF", "#E6E885"],
+     "description": "text colors to diff catalogs. the first for default, #000000 for IndexOutOfBounds",
+     "items": {
+        "type": "string"
+     }
   }
const configColors = workspace.getConfiguration('pnpmCatalogLens').get('colors',['#f69220'])
const decorationsOverrideMap = new Map<string, ShallowRef<DecorationOptions[]>>();

and finally, i give up,
it's hard for me to impl this feature now,
i'v wrote bad smelling code :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pr welcome
Projects
None yet
Development

No branches or pull requests

3 participants
@trydofor @antfu and others