Skip to content

tx2z/creativecommons-webcomponent

Repository files navigation

Creative Commons Web Component Generator

This is the repository that generate the code that is published in npm. To use the package check his storybook or the package in the npm repository.

This project is created with wc-base-typescript. A project to create isolated web components with typescript

Uses:

Contribute

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:

npm i

The components are stored in "src/components".

To run a server in development mode run:

npm start

The components will be compiled every time you save a file.

Tests

Karma & jasmine are used as testing environment and framework.

Inside the component folder, there is a file ending with "spec.ts" that include the tests.

To run the test use:

npm test

Storybook

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.