Giter VIP home page Giter VIP logo

lwc-create-app's Introduction

lwc-create-app

A tool for setting up your Lightning Web Components projects.

CircleCI oclif lerna

Version Downloads/week lwc-create-app

Version Downloads/week lwc-services

Quick Start

To get up and running execute the following command in a shell/terminal:

npx lwc-create-app your-app-name

To run this, you must have Node.js installed, with at least npm 5.2+. You should be familiar with either npm or yarn. The npx tool is a package runner that installs with npm 5.2+.

This will run a npx installation of lwc-create-app, guide you with a couple of steps through the setup, and then create a new Lightning Web Components project for you.

Then run yarn watch (or npm run watch, depending on your personal preference and what you've chosen during the npx installation). Done!

Live App

If you want to see Lightning Web Components in action - check out https://recipes.lwc.dev.

So what's this tool about?

Technically it's a toolchain that gives you a quickstart experience for developing with Lightning web components. This project consists out of two packages:

It is focused on providing a quick, but also if needed customizable, onboarding experience when you want to develop with Lightning Web Components. If you want to develop Lightning Web Components on the Salesforce Platform you may want to look into using Salesforce CLI instead.

If you haven't heard about Lightning Web Components - it's a new framework, introduced by Salesforce, based on the Web Components specifications. Read more about it in the official documentation.

lwc-services

Using lwc-create-app is meant to be a one-stop-shop solution. The created project contains everything you need to get started. It adds one dependecy, which is lwc-services. Find below a list of all the things that are bundled with it. When you create a project with lwc-create-app also a number of predefined scripts gets added to your package.json.

Configuration

If you want to override certain behavior of lwc-services you can place a lwc-services.config.js file into the root of your app directory. Checkout the example file for possible configuration parameters and values.

Commands

lwc-services build

Creates a new webpack build

USAGE
  $ lwc-services build

OPTIONS
  -d, --destination=destination  [default: ./dist] defines the directory where the build is stored
  -m, --mode=mode                [default: development] defines the mode for the build (production|development)
  -n, --noclear                  setting this will not re-create the build dir
  -w, --webpack=webpack          location of custom webpack configuration file

EXAMPLES
  lwc-services build
  lwc-services build -d ./public --noclear

lwc-services serve

Runs a Lightning Web Components project with a local Express server

USAGE
  $ lwc-services serve

OPTIONS
  -d, --directory=directory  [default: ./dist] defines the directory where the build is stored
  -i, --host=host            [default: 0.0.0.0] sets the hostname/IP address
  -o, --open                 opens the site in the default browser
  -p, --port=port            [default: 3002] configures the port of the application

EXAMPLES
  lwc-services serve
  lwc-services serve -p 3998 -i 192.168.178.12

lwc-services sniff

Exports configuration information. It's not a full "eject" out of this tool. Yet.

USAGE
  $ lwc-services sniff

OPTIONS
  -d, --directory=directory  (required) exports configuration files to the given directory
  -w, --webpack=webpack      location of custom webpack configuration file

EXAMPLE
  lwc-services sniff -d somedirectory

lwc-services test

Runs Jest tests for Lightning Web Components

USAGE
  $ lwc-services test

OPTIONS
  -c, --coverage  collects a coverage report
  -d, --debug     runs tests in debug mode (https://jestjs.io/docs/en/troubleshooting)
  -w, --watch     runs in watch mode and re-runs tests on file changes
  -r, --runInBand runs tests serially (slower, but often needed when running on CI systems)

EXAMPLES
  lwc-services test
  lwc-services test --coverage
  lwc-services test -w

lwc-services watch

Runs a Lightning Web Components project in watch mode

USAGE
  $ lwc-services watch

OPTIONS
  -i, --host=host        [default: 0.0.0.0] sets the hostname/IP address
  -m, --mode=mode        [default: development] defines the mode for the build (production|development)
  -o, --open             opens the site in the default browser
  -p, --port=port        [default: 3001] configures the port of the application
  -w, --webpack=webpack  location of custom webpack configuration file

EXAMPLES
  lwc-services watch
  lwc-services watch -p 3998 -i 192.168.178.12 -m production

Contribution

If you have great ideas on how to extend this tool - feel free to open new issues, and then PR something in. ;-)

Please read the contribution guideline for that. Thanks!

lwc-create-app's People

Contributors

muenzpraeger avatar pmdartus avatar adamsellers avatar kevinv11n avatar rcurry-sf avatar mshanemc avatar shawnjk avatar

Watchers

James Cloos 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.