Giter Club home page Giter Club logo

create-wc's Introduction

create-wc

A super simple code generator for web components.

Usage

Supply the HTML API for the web component in quotes:

npm init wc "<my-component foo='bar'>"

or

npx create-wc "<my-component hi='mom'>"

Multiple arguments can be passed to generate multiple components:

npm init wc "<comp-one>" "<comp-two>"

Templates

The template can be changed by specifying the --lib flag with one of the following options. The options will persist, so you only need to supply it once.

To be implemented:

  • Vanilla JavaScript
  • Vanilla TypeScript
  • LitElement JavaScript
  • LitElement TypeScript: --lib=lit.ts
  • Stencil JavaScript
  • Stencil TypeScript

Ex: npm init wc "<hello-world foo='bar'>" --lib=lit.ts

import {html, css, LitElement} from 'lit';
import {customElement, property} from 'lit/decorators.js';

@customElement('hello-world')
export class HelloWorld extends LitElement {
  static styles = css`p { color: blue }`;

  @property()
  foo = 'bar';

  render() {
    return html`<p>Hello, world!</p>`;
  }
}

create-wc's People

Contributors

willmartian avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

create-wc's Issues

Maintainence

Hi @willmartian!

Thanks for making a great tool! I notice there's a roadmap of features to be implemented, but it seems like velocity has slowed. I'd really like to tackle the roadmap, and perhaps make the tool more robust with prompts for the user. Would you be interested in new maintainers or new ownership of the repo?

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.