FujoWebDev / FujoWebDev/fujocoded-plugins

Add generated labels to social link transforms

Offen
#42 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
good first issue zod-transform-socials
Vorherrschende Sprache
TypeScript
Sterne
30
Forks
7
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Add a generated `label` field to `@fujocoded/zod-transform-socials` social link output. This can be used as a user-facing label for the link text, list item label, etc.

## Why

Without a label field, custom platforms or duplicate accounts on a platform have no central place to be specified or overridden. Cases include: distinguishing a personal social account vs an art social account; or giving a name to a custom site.

## Example

Input:

```yaml
contacts:
- https://github.com/FujoWebDev
- url: https://www.fujocoded.com/
label: Official Website
icon: lucide:globe
- url: https://store.fujocoded.com
label: Merch Store
icon: lucide:shopping-bag
- https://fujoweb.dev
```

Output:

```js
[
{ url: "https://github.com/FujoWebDev", platform: "github", username: "fujowebdev", icon: "simple-icons:github", label: "github" },
{ url: "https://www.fujocoded.com/", platform: "custom", username: null, icon: "lucide:globe", label: "Official Website" },
{ url: "https://store.fujocoded.com", platform: "custom", username: null, icon: "lucide:shopping-bag", label: “Merch Store" },
{ url: "https://fujoweb.dev", platform: "custom", username: null, icon: null, label: “fujoweb.dev" },
]
```

## Todo

- [ ] Add optional `label?: string` to object social input.
- [ ] Add `label: string` to transformed social output.
- [ ] Generate labels with this precedence:
- explicit input `label`
- known platform name when `platform !== "custom"`
- fallback from `url`, stripping leading `www.`

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, das Paket @fujocoded/zod-transform-socials sowie seine Schemas für Social-Inputs und -Outputs oder seinen Transform-Einstiegspunkt zu lokalisieren. Verfolge, wie URL, Plattform, Benutzername und Icon derzeit generiert werden, und implementiere anschließend die im Issue beschriebene Priorität für Labels. Als abgeschlossen gilt die Änderung, wenn Objekt-Inputs ein optionales Label akzeptieren und jeder transformierte Social-Link das erwartete generierte Label hat.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.