Skip to content

Move the NS8 UI library Storybook to ns8-ui-lib and publish it online #8209

Open

Description

@andre8244

The Storybook of the NS8 UI library (the Ns* components of @nethserver/ns8-ui-lib, e.g. NsButton) currently lives in the ns8-core repository and can only be run locally. Stories show the last published version of the library, so a change to a component can be seen in Storybook only after a new library release.

Proposed changes:

  • Move the Storybook to the ns8-ui-lib repository, next to the components. Stories render the library source code, so changes are visible before a release.
  • Publish the Storybook on GitHub Pages for each library release: https://nethserver.github.io/ns8-ui-lib/
  • Add a playground to ns8-ui-lib: a local app to quickly test components, e.g. to reproduce a bug or to combine several components. Unlike Storybook, v-model and other Vue features fully work there.
  • Make the styles of library components self-contained. Some components relied on CSS rules defined in the core UI stylesheet (colors, spacing, tooltip and modal layout), so they looked different or broken outside NS8, and depended on the installed core version. These rules are now copied inside the components. Core keeps its copies, marked as deprecated, for applications built with older library versions: they will be removed in the future.
  • Remove the Storybook from ns8-core and update the developer manual.

Notes:

  • No visual change is expected in the NS8 UI: all stories were compared pixel by pixel, before and after the change, with the core stylesheet loaded.
  • Applications don't need any change.
  • A repository admin must enable GitHub Pages for ns8-ui-lib (source: GitHub Actions) and allow v* tags to deploy to the github-pages environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions