This guide helps you setting up, building and running the library as well as the demo app on your own machine.
- Install Git and NodeJS 10+
- Install Yarn
- Install Angular CLI
Let's install the library on your machine.
First we need to clone the ngx-drag-to-select repository:
$ git clone https://github.com/d3lm/ngx-drag-to-select
Once cloned, we need to install all dependencies. For that we can simply run
yarn install
Now that everything's set up, we can build and run it locally.
yarn start
This will build the demo app as well as the libary for development.
Verify that all tests pass on your machine, before you start working. For that, simply run
yarn test
yarn e2e
That's it! When all tests pass, you can open your favourite browser at localhost:4200
and see the demo app in action.
start
: Build and serve demo app in watch modeserve:ssr
: Serve application using dynamic Universalbuild
: Build client and server bundlesbuild:ssr
: Build client and server bundles as well as server and prerendering scriptsbuild:ghpages
: Build app for GitHub Pagesbuild:prerender
: Build all bundles and statically prerender applicationbuild:prerender-ghpages
: Build all bundles and statically prerender application for GitHub Pagesbuild:app
: Build demo demo app for productionbuild:server
: Build server bundle for productionbuild:lib
: Build entire library only. This command will build the code, styles and ultimately copy the build artifacts todist/ngx-drag-to-select
build:lib:code
: Build library code onlybuild:lib:sass
: Compile sass files and copy them todist/ngx-drag-to-select
deploy
: Deploy demo app to GitHub Pagescopy:styles
: Copy source sass files todist/ngx-drag-to-select/sass
generate:prerender
: Statically prerender applicationwebpack:server
: Build express server and prerendering scriptformat:base
: Run prettier without optionsformat:check
: Run prettier and list files that don't comply with prettier's formattingformat:fix
: Fix formatting issuesstyle
: Check linting and formattingstyle:fix
: Fix linting and formatting errorslint:check
: Check for linting errorslint:fix
: Fix linting errorsclean
: Remove dist foldertest
: Run unit tests (Jest)test:watch
: Run unit tests in watch modee2e
: Run end-to-end test suite (Cypress)cypress:open
: Open Cypresscypress:run
: Run Cypress in headless mode
The most important folders are cypress
, app
and projects
. Inside cypress
you'll find all of the e2e tests. The app
folder contains all the code for the demo app and projects
contains the code for the library.
Build artifacts related to the lib can be found in dist/lib
.
dist
cypress
projects
├── ngx-drag-to-select
| ├── src
| | ├── lib
| | | └── *.ts
| | ├── scss
| | | └── *.scss
| | └── public_api.ts
| ├── package.json
| └── ...
src
├── app
├── assets
├── environments
└── ...