Giter VIP home page Giter VIP logo

awesome-lwc-collection's Introduction

⚡️ Awesome LWC Collection

GitHub GitHub CI Quality Gate Status

About the project

The repository should provide a collection of ready-to-use Lightning Web Components that might help your SFDX project and is intended to grow over time. Additionally, it also includes an initial configuration of Prettier, linting rules, git hooks and unit tests as well as useful VS Code settings. The setup really focuses on LWC development.

Prerequisites

To use this library and try out the components locally, Node and the Salesforce CLI should already be installed.

Getting started

Install all dependencies

To get the components up and runnning, you need to open the repository with VS Code, install all the recommended extensions and run npm install to install all required dependencies.

Authorize an org

You need to authorize an org before you use the local development server. This is necessary because all data requests using Lightning Data Service or Apex will get proxied to the Salesforce org and returned in the local components. In VS Code the authorization can be done by pressing Command + Shift + P, enter "sfdx", and select SFDX: Authorize an Org.

Alternatively you can also run the following command from the command line:

sfdx force:auth:web:login

Install the local development server

Lightning Web Components can be viewed and developed locally without the need to push them to an org first. To set up local development you only nedd to install the development server after you authorized an org.

The local development server and its configuration are provided by a Salesforce CLI plugin that can be installed as follows:

sfdx plugins:install @salesforce/lwc-dev-server

Run npm run server:lwc to start the server on http://localhost:3333 and access all components of this project.

Components available

The following list of components is part of this repo. All components contain corresponding unit tests and docs.

You can also find many more useful and reusable Lightning Web Components in the official lwc-recipes.

Quality measures

Git hooks

The project includes client-side pre-commit git hooks using husky and lint-staged. After installing all project dependencies, Prettier, Linter and unit tests are automatically executed before each commit.

Prettier for code formatting

Run npm run prettier to check all files for Prettier issues.

Code linting with ESLint

Run npm run lint to check for ESLint issues.

Unit tests with Jest

Run

  • npm run test:unit to execute all unit tests only once
  • npm run test:unit:watch to execute all unit tests in watch mode for development
  • npm run test:unit:coverage to execute all unit tests with generated code coverage

Documentation with JSDoc

Run npm run docs to generate code documentation with JSDoc in HTML format.

awesome-lwc-collection's People

Contributors

svierk avatar dependabot[bot] 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.