Skip to content

This custom elements manifest analyzer plugin adds support for resolving complex types in custom element properties

License

Notifications You must be signed in to change notification settings

jls-digital/cem-plugin-complex-types

Repository files navigation

cem-plugin-complex-types

NPM npm install size

This custom elements manifest analyzer plugin adds support for resolving complex types in custom element properties

Screenshot of Addon

Installation

  1. npm install --save-dev cem-plugin-complex-types
  2. Add cem-plugin-complex-types to your cem config
  3. Link a css file in your storybook's preview-head.html
// custom-elements-manifest.config.mjs
import cemPluginComplexTypes from 'cem-plugin-complex-types'
export default {
  // ...
  plugins: [
    // ...
    cemPluginComplexTypes(['./src/**/*.ts']),
  ],
};
// .storybook/preview-head.html
<link rel="stylesheet" href="node_modules/cem-plugin-complex-types/preview-head-fix.css" />

FAQ

(Click on a question to see the answer.)

Q: Can it handle classes, interfaces, unions as well as primitive types?

A: Yes, the plugin should be able to handle all of these types. It will resolve the type to its source code and display it in the Storybook addon panel. If the type is a class or interface, it will show the properties and methods of that type. If it's a union type, it will show all possible types in the union.

Contributing

We encourage you to contribute to this project! Please check out the Contributing guide for guidelines about how to proceed and how to set up your dev environment. Join us!

License

CEM-Plugin-Complex-Types is released under the MIT License.

About

This custom elements manifest analyzer plugin adds support for resolving complex types in custom element properties

Resources

License

Contributing

Stars

Watchers

Forks