Creative Commons Web Component Generator
This project is created with wc-base-typescript. A project to create isolated web components with typescript
Download this project for local development of web the components.
Once the project is on your computer, enter the folder and install all npm dependencies:
The components are stored in "src/components".
To run a server in development mode run:
The components will be compiled every time you save a file.
Inside the component folder, there is a file ending with "spec.ts" that include the tests.
To run the test use:
There are two files inside the component folder that are used by storybook.
@component.stories.ts: Is the file to create the story for the component.
README.md: It's used to add documentation for the component using the Notes storybook addon.
Run storybook with:
npm run storybook
Build the component
npm run build
You can find the builds in the "dist" folder.
The component will be compiled in a js file (as ES module), to use it as module in any application, and in a dist.js (as iife), to use it directly in browsers, with the same name you give to the folder in "src/components".
All modules include their respective Typescript declaration files.