Skip to content

feat: support community skins generation#1663

Open
brtbrt wants to merge 8 commits into
masterfrom
mbertamini/1588-import-community-skins
Open

feat: support community skins generation#1663
brtbrt wants to merge 8 commits into
masterfrom
mbertamini/1588-import-community-skins

Conversation

@brtbrt

@brtbrt brtbrt commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

How the script is organized

The generator is built around one concept: a skin family. Each family is a descriptor object declaring where its tokens live, where its output goes, its list of skins, its file naming, and how its module is shaped (skinModule).

There are two:
OFFICIAL_SKINS_FAMILY
and
COMMUNITY_SKINS_FAMILY.

A single generic pipeline, generateSkinFamily(family), does all the work: list the family's skins, generate each .tsx and .css, then run any family-specific shared files. main() just runs it for each family.

The two families differ only in data, so official and community skins no longer have separate code paths.

Related Issues

Fixes #1588

brtbrt added 2 commits July 18, 2026 16:16
Enable generate-design-tokens to discover and generate community skins from JSON tokens in the mistica-design repo. Community skin tokens are expected in tokens/community/ folder, with generated files output to src/community/skins/ and css/community/ directories.

- Add community skins folder paths (src/community/skins, css/community)
- Modify generateSkinSrc to handle community skins with correct import paths and type usage
- Add generateCommunitySkins function to discover and process community token files
- Community skins use generic Skin type instead of KnownSkin
- Constants are defined inline in community skin files
@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

Size stats

master this branch diff
Total JS 15.7 MB 15.7 MB +1.32 kB
JS without icons 1.93 MB 1.93 MB +1.32 kB
Lib overhead 96.9 kB 96.9 kB 0 B
Lib overhead (gzip) 21.3 kB 21.3 kB 0 B

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploy preview for mistica-web ready!

Project:mistica-web
Status: ✅  Deploy successful!
Preview URL:https://mistica-95ew4gnn7-flows-projects-65bb050e.vercel.app
Latest Commit:4b46137

Deployed with vercel-action

@github-actions

Copy link
Copy Markdown

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

@brtbrt
brtbrt marked this pull request as ready for review July 21, 2026 14:57
@brtbrt
brtbrt requested a review from a team as a code owner July 21, 2026 14:57
Copilot AI review requested due to automatic review settings July 21, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the generate-design-tokens package to support generating both official and community skins from mistica-design tokens using a single, data-driven pipeline (skin families), aligning with the new tokens/community/ structure.

Changes:

  • Refactors generation logic into a generic generateSkinFamily(family) pipeline driven by OFFICIAL_SKINS_FAMILY and COMMUNITY_SKINS_FAMILY descriptors.
  • Adds @generated banners to formatted TypeScript/CSS outputs and introduces community output folders (src/community/skins, css/community).
  • Updates the package README to document where official vs community generated files are written and where community tokens are discovered.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/generate-design-tokens/README.md Documents official vs community generated output locations and token discovery path.
packages/generate-design-tokens/index.js Implements skin-family-based generation for official and community skins and adds generated banners.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

};

generateSkinFiles();
main();
@brtbrt brtbrt changed the title feat(generate-design-tokens): support community skins generation feat: support community skins generation Jul 21, 2026

@Marcosld Marcosld left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ!

Comment on lines +30 to +31
const OFFICIAL_SKINS = ['blau', 'movistar', 'o2', 'telefonica', 'vivo', 'vivo-evolution', 'esimflag'];
const COMMUNITY_SKINS = ['cyber'];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can inline these into the skin families constants ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they're here for convenience, like a frontmatter style, but actually they don't convince me: is there a good reason I don't know to have the supported skins hardcoded here?

  1. do we have special cases/contexts where we want to exclude upcoming-and-already-published skins?
  2. if yes, shouldn't we use an env variable for that? or like a param etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, feel free to investigate it. You can move them into the family constants and move the constants up if you want to have them on top.

Comment thread packages/generate-design-tokens/index.js Outdated
Comment thread packages/generate-design-tokens/index.ts
@brtbrt
brtbrt requested a review from a team July 22, 2026 10:56
@brtbrt
brtbrt requested a review from Marcosld July 22, 2026 18:57
Comment thread css/blau.css

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing the generation by using mistica-design master locally

@Marcosld Marcosld left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awsom

Comment thread tsconfig.json

// this also excludes paths from VSCode auto import feature
"exclude": ["dist", "dist-ts", "dist-es", "node_modules", "examples"]
"exclude": ["dist", "dist-ts", "dist-es", "node_modules", "examples", "packages"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm.. shouldn't it be the other way around? Include in dev / exclude in pro tsconfig?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update generate-design-tokens package to import from community skins

3 participants