Skip to content

Allow uikit plugins to be used across multiple uikit definitions #1136

@Hydraner

Description

@Hydraner

In patternlab-config.json it is possible to define multiple uikits with different configurations. As far as I understand, the idea is to have a workshop and a storefront uikit showing diffrent patterns based on the exclude configuration.
Since there is no dedicated storefront uikit at the moment, it would be nice if you could just use iukit-workshop to generate the patternlab frontend.

Expected Behavior

When I define multiple uikits with the same name, only one frontend is generated properly

Actual Behavior

Only the last one will work, since the config will override itself.

Steps to Reproduce

Put the following configuration into your patternlab-config.json
"uikits": [ { "name": "uikit-workshop", "outputDir": "workshop", "enabled": true, "excludedPatternStates": [], "excludedTags": [] }, { "name": "uikit-workshop", "outputDir": "storefront", "enabled": true, "excludedPatternStates": [ "inprogress" ], "excludedTags": [] }]

Proposed solution

In order to be backwards-compatible, I suggest adding an optional key "id" to the uikit settings, which will be used to collect the configuration instead of the name. If the id does not exists, use the name as fallback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions