2017-12-16 13:25:59 +01:00
|
|
|
---
|
|
|
|
id: build
|
|
|
|
title: "Build the source code"
|
|
|
|
---
|
2017-10-28 22:36:18 +02:00
|
|
|
|
|
|
|
Verdaccio relies on `yarn` instead `npm` to download depenedencies.
|
|
|
|
|
2018-01-06 23:04:02 +01:00
|
|
|
*Note: the current build only will build with `➜ yarn` latest.*
|
2017-10-28 22:36:18 +02:00
|
|
|
|
|
|
|
```bash
|
|
|
|
yarn install
|
|
|
|
```
|
|
|
|
|
|
|
|
## Scripts
|
|
|
|
|
2018-01-20 23:00:45 +01:00
|
|
|
We have a list of scripts that you will use for diferent kind of tasks, in the following section
|
|
|
|
we describe all posible task based on branches.
|
2017-10-28 22:36:18 +02:00
|
|
|
|
2018-01-20 23:00:45 +01:00
|
|
|
### Branch (2.x)
|
2017-10-28 22:36:18 +02:00
|
|
|
|
2018-01-20 23:00:45 +01:00
|
|
|
On branch `2.x` the unique part we have to build is the UI which is based on React.js, webpack and CSS Modules.
|
2017-10-28 22:36:18 +02:00
|
|
|
|
2018-01-20 23:00:45 +01:00
|
|
|
#### Scripts
|
2017-10-28 22:36:18 +02:00
|
|
|
|
2017-12-16 13:25:59 +01:00
|
|
|
script | Description
|
|
|
|
--- | --- |
|
2017-10-28 22:36:18 +02:00
|
|
|
release | this script is used to generate changelog and raise up the version according the commits messages
|
|
|
|
prepublish | it ensures before publish the new ui is being generated
|
2017-12-16 13:25:59 +01:00
|
|
|
test | run all the test
|
2017-10-28 22:36:18 +02:00
|
|
|
pre:ci | specific task for CI, build the UI required for test
|
|
|
|
test:ci | run test generating coverage
|
|
|
|
test:only | run only test
|
|
|
|
test:coverage | run `nyc` as a wrapper to generate coverage with mocha test
|
|
|
|
coverage:html | run `nyc` to generate coverage reports
|
|
|
|
coverage:publish | publish on `codecov` the coverage (don't use it)
|
|
|
|
lint | run the linting for javascript code.
|
|
|
|
lint:css | run the linter for `css`
|
|
|
|
dev:webui | run a `webpack` server with hot reloading enabled `http://localhost:4872/#/` it requires a `verdaccio` server running in port `4873`.
|
|
|
|
pre:webpack | prepare the field for webpack (it a substask of `build:webui`)
|
|
|
|
build:webui | create the static assets for the UI with `webpack`
|
|
|
|
build:docker | create a local docker image with `verdaccio`
|
|
|
|
build:rpi | create a local docker for raspberry pi image with `verdaccio` **(experimental with no support)**
|
|
|
|
|
|
|
|
|
2018-01-20 23:00:45 +01:00
|
|
|
#### Master branch (3.x)
|
2017-10-28 22:36:18 +02:00
|
|
|
|
2018-01-20 23:00:45 +01:00
|
|
|
The current major version is based on `babel` and `flow`. If you switch from master ensure to run `yarn install` again.
|
2017-10-28 22:36:18 +02:00
|
|
|
|
|
|
|
*Note: Only new scripts in bold*
|
|
|
|
|
|
|
|
### Scripts
|
|
|
|
|
2017-12-16 13:25:59 +01:00
|
|
|
script | Description
|
|
|
|
--- | --- |
|
2017-10-28 22:36:18 +02:00
|
|
|
**flow** | run flow check
|
2017-12-04 08:12:30 +01:00
|
|
|
**dev:start** | run `babel-node` and transpile code on memory
|
2017-10-28 22:36:18 +02:00
|
|
|
**code:build** | transpile `verdaccio` with `babel` and copy transpiled code to `build/`
|
|
|
|
release | this script is used to generate changelog and raise up the version according the commits messages
|
|
|
|
prepublish | it ensures before publish the new ui is being generated
|
2017-12-04 08:11:38 +01:00
|
|
|
test | run all the test `jest`
|
2018-01-20 23:00:45 +01:00
|
|
|
test:unit | run the unit test
|
|
|
|
test:func | run the funtional test
|
2017-10-28 22:36:18 +02:00
|
|
|
pre:ci | specific task for CI, build the UI required for test
|
2018-01-20 23:00:45 +01:00
|
|
|
pretest | A shorcut for transpile the code
|
2017-10-28 22:36:18 +02:00
|
|
|
test:ci | run test generating coverage
|
2018-01-20 23:00:45 +01:00
|
|
|
coverage:publish | publish on `codecov` the coverage (CI task specific, do not use it)
|
2017-10-28 22:36:18 +02:00
|
|
|
lint | run the linting for javascript code.
|
|
|
|
lint:css | run the linter for `css`
|
|
|
|
dev:webui | run a `webpack` server with hot reloading enabled `http://localhost:4872/#/` it requires a `verdaccio` server running in port `4873`.
|
|
|
|
pre:webpack | prepare the field for webpack (it a substask of `build:webui`)
|
|
|
|
build:webui | create the static assets for the UI with `webpack`
|
|
|
|
build:docker | create a local docker image with `verdaccio`
|
2017-12-04 08:11:38 +01:00
|
|
|
build:rpi | create a local docker for raspberry pi image with `verdaccio` **(experimental with no support)**
|