npm package: @sumor-cloud/builder
Description: Sumor Builder Tool is a tool used to quickly build Node.JS libraries, providing functions such as fast testing, packaging, and publishing private npm package.
Latest version: 1.1.13
Deprecated: outdated

# @sumor-cloud/builder
Sumor Builder Tool is a tool used to quickly build Node.JS libraries, providing functions such as fast testing, packaging, and publishing private npm package.

[![NPM version](https://img.shields.io/npm/v/%40sumor-cloud%2Fbuilder.svg)](https://www.npmjs.com/package/@sumor-cloud/builder)
[![NPM downloads](https://img.shields.io/npm/dm/%40sumor-cloud%2Fbuilder.svg)](https://www.npmjs.com/package/@sumor-cloud/builder)

A [Sumor Cloud](https://www.sumor.com) Tool.  
[More Documentation](https://www.sumor.com/help)

## Installation

```shell
npm install -D @sumor-cloud/builder
```

Now, you can use the `scb` command to use the builder tool.

## Usage

### Initialization

Quickly initialize the project, generate sample programs and test cases, as well as build configuration files.

```shell
scb init
```

### Code Checking

It will check the code style and code format. and it will generate a report into `output/lint` folder.

```shell
scb lint
```

##### Automatically fix code style and code format issues

```shell
scb lint --fix
```

### Unit Testing

It will run the unit test cases which are under `test` folder and suffix with `.test.js`.  
Then generate an unit test report into `output/unit` folder. A coverage report into `output/coverage` folder.

```shell
scb test
```

##### --scenario
You can add `--scenario=< case >` to specify the test case which locate in this folder.

### Packaging

Aim to package the library into a single file, and prepare files for publishing to NPM.  
It will copy `static` folder into output folder.  
It will package the library into output folder. By default, package entry is `src/index.js`.  
output folder is `output/production`.

```shell
scb build
```

##### packaging for debugging

output folder is `output/development`.

```shell
scb build --mode=development
```

##### README Generation
As NPM library should have name and description in package.json. And README file should have the same content as package.json.
It will automatically generate full README.md file into output folder.

You need to specify the name and description in package.json.
Then specify the document into `README.md`.
And License info into `LICENSE.md`, if no license file, it will load from package.json.


### License Report

It will generate a license report into `output/license.md`.

```shell
scb license
```

### Publish

Publish the library to the public repository

```shell
scb publish <version>
```

Publish the beta version

```shell
scb publish <version> -b
```

Publish the library to the private repository

```shell
scb publish <version> -r <registry> -u <username> -p <password>
```

### Clean

Clean the dependencies, in case of some dependencies expired.

```shell
scb clean
```

##### --scope

Specify scope which will be cleaned, example: @sumor-cloud

```shell
scb clean --scope @sumor-cloud
```

## Contributing & Issues

You can use this tool for free.  
But we are a commercial company, to ensure stability, we currently don't offer a joint contribution mechanism.  
You can report issues through [Report Library Issue Ticket](https://www.sumor.com/ticket/library), and we will fix them as soon as possible.

## License

In consideration of the chaotic situation in the open source community, we provide obfuscated code for use and security analysis.  
However, we do not provide the source code in its original form in order to protect the ongoing maintenance and creative interests and motivations.  
The released code in [NPMJS](https://www.npmjs.com) is based on MIT. The source code is closed-source.

Our tools are free to use in order to help build cloud applications more efficiently. Our commercial purpose is to improve the ecosystem of business websites.  
If there are any innovations that greatly benefit the open source community, it will be separated and contributed to the open source community.