GithubHelp home page GithubHelp logo

emolr / wc-library-starter Goto Github PK

View Code? Open in Web Editor NEW
6.0 0.0 0.0 1.13 MB

A starter template for creating a webcomponent library using typescript, inspired by google material design webcomponents and open-wc

License: MIT License

CSS 0.26% TypeScript 2.85% Shell 6.23% JavaScript 62.13% HTML 28.53%
webcomponents typescript styleguide library design-system designsystem

wc-library-starter's Introduction

WC-library-starter

Web component library starter provides a starting point for creating a web component library with typescript, SCSS, browser testing, style guide (storybook) and a mono repo structure for publishing components individually.

Getting started

Install dependencies and bootstrap

Start by downloading this repository

git clone https://github.com/emolr/wc-library-starter.git

Bootstrap project and make the first build

npm run bootstrap

This command will install dependencies in subfolders located in /packages/*/package.json

Watch for changes and update storybook

  • Add components in /packages/*, see the example button component to learn the component structure.
  • /packages/*/src/*.scss files automatically generates /packages/*/src/*.css.ts exposing export const style = css`css_from_scss...`, to be imported in components.
  • Add new storybook stories in /stories/*.stories.js, see the example story and learn more about storybook.

Transpile typescript, and generate styles on file changes

npm start

This also starts the storybook on http://localhost:9001/

Build all components

npm run build

Build storybook

npm run build && npm run storybook:build

This generates /_site that can be hosted using eg. netlify

Running tests

Tests should be written in .js and be located in /test/**/*.test.js. Read more about the test suite on open-wc

Run all tests

npm run test

Run tests on test file changes

npm run test:watch

Run all test in es5 mode

npm run test:es5

Run tests on test file changes in es5 mode

npm run test:es5:watch

Publish components on NPM

Lerna is integrated with the project, make sure all /packages/*/package.json files look correct and run:

npm run publish

Differences from eg. PWA-starter-kit

This starter kit does not provide the tools and setup for building an application to run itself but is targeted component libraries similar to the Material web components repository, to build a set of components to be used in applications and published via npm with a storybook serving as documentation.

How to Contribute

Everyone is welcome to contribute to this project. The best way to start is by checking our open issues, submit a new issue or feature request, participate in discussions, upvote or downvote the issues you like or dislike, send pull requests.

Under early development

This project is a personal project with the goals of a component driven workflow without hassle while supporting multiple frameworks without writing framework specific code, but instead use state of the art tools to transpile, test, and document components.

Compiling / bundling of the components to be consumed must happen by the consumer and it is not expected for the components to work without a module bundler of some sort until the browsers support implicit node_modules import paths.

Read more about building and consuming web components on LitElement.

wc-library-starter's People

Contributors

emolr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.