@samet-it/be-base-common 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
# Samet
|
|
1
|
+
# Samet IT : Base Common
|
|
2
|
+
`Component` `Backend`
|
|
2
3
|
```
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
__
|
|
5
|
+
/ /_ ____ _________ _________ ____ ___ ____ ___ ____ ____
|
|
6
|
+
/ __ \/ __ `/ ___/ _ \ / ___/ __ \/ __ `__ \/ __ `__ \/ __ \/ __ \
|
|
7
|
+
/ /_/ / /_/ (__ / __/ / /__/ /_/ / / / / / / / / / / / /_/ / / / /
|
|
8
|
+
/_.___/\__,_/____/\___/ \___/\____/_/ /_/ /_/_/ /_/ /_/\____/_/ /_/
|
|
7
9
|
```
|
|
10
|
+
<!-- https://patorjk.com/software/taag/#p=display&f=Slant&t=base+common&x=none&v=4&h=3&w=80&we=false -->
|
|
8
11
|
- `EN`: It's base component
|
|
9
12
|
- `TR`: Nodejs projeleri için temel bileşen
|
|
10
13
|
|
|
14
|
+
## Prerequisite
|
|
15
|
+
- [Help](https://github.com/samet-digital/help)
|
|
16
|
+
- [1 - Install Git](https://github.com/samet-digital/help/blob/main//install-git.MD)
|
|
17
|
+
- [2 - Build Up a Git Connection](https://github.com/samet-digital/help/blob/main//build-git-connection.MD)
|
|
18
|
+
- [3 - Install Node/NPM](https://github.com/samet-digital/help/blob/main//install-npm.MD)
|
|
19
|
+
- [4 - Create Project Folder](https://github.com/samet-digital/help/blob/main//create-project-folder.MD)
|
|
20
|
+
- [5 - Bind Projects Folder to Git](https://github.com/samet-digital/help/blob/main//bind-project-folder.MD)
|
|
21
|
+
|
|
22
|
+
|
|
11
23
|
## Usage
|
|
12
24
|
- `EN`: How to add into your project?
|
|
13
25
|
- `TR`: Projene nasıl eklersin?
|
|
@@ -17,30 +29,23 @@ npm i @samet-it/be-base-common
|
|
|
17
29
|
```
|
|
18
30
|
|
|
19
31
|
## Environments
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
| `
|
|
32
|
+
- [baseCommonConfig](./src/config/base-common.config.ts) : config
|
|
33
|
+
|
|
34
|
+
| Name | Type | Default | Required | Secret |
|
|
35
|
+
|-------------|------|---------|----------|--------|
|
|
36
|
+
| `NODE_ENV` | enum | _local_ | | |
|
|
37
|
+
| `LOG_LEVEL` | enum | _debug_ | | |
|
|
25
38
|
|
|
26
39
|
## Contents
|
|
27
|
-
- [errorHandler](./src/error/error.handler.ts)
|
|
28
|
-
- [
|
|
40
|
+
- [errorHandler](./src/error/error.handler.ts)
|
|
41
|
+
- [exitHandler](./src/exit/exit-handler.impl.ts)
|
|
42
|
+
- [generator](./src/generator/generator.ts)
|
|
29
43
|
|
|
30
44
|
## Development
|
|
31
45
|
> You can start to develop on it
|
|
32
46
|
>
|
|
33
47
|
### Step 1
|
|
34
|
-
-
|
|
35
|
-
- `TR`: Bilgisayarında proje klasörüne git
|
|
36
|
-
```shell
|
|
37
|
-
# Windows
|
|
38
|
-
cd C:\\projects\samet-digital
|
|
39
|
-
```
|
|
40
|
-
```shell
|
|
41
|
-
# Mac
|
|
42
|
-
cd /Users/{user}/projects/samet-digital
|
|
43
|
-
```
|
|
48
|
+
- [Go to project folder](https://github.com/samet-digital/help/blob/main/go-to-project-folder.MD)
|
|
44
49
|
|
|
45
50
|
### Step 2
|
|
46
51
|
- `EN`: Clone the project
|
|
@@ -53,37 +58,7 @@ git clone https://github.com/samet-digital/be-base-common.git -b development
|
|
|
53
58
|
- ~~Nothing~~
|
|
54
59
|
|
|
55
60
|
## Commands
|
|
56
|
-
|
|
57
|
-
# Collects all dependencies
|
|
58
|
-
npm i
|
|
59
|
-
|
|
60
|
-
# Builds project dist (TS -> JS, src -> dist)
|
|
61
|
-
npm run build
|
|
62
|
-
|
|
63
|
-
# Publishes component on http://npmjs.com/
|
|
64
|
-
npm run publish:public
|
|
65
|
-
|
|
66
|
-
# Clears `dist` and `coverage` folders
|
|
67
|
-
npm run clear
|
|
68
|
-
|
|
69
|
-
# Clear `node_modules` folder
|
|
70
|
-
npm run clear:nm
|
|
71
|
-
|
|
72
|
-
# Validates lint for only errors @see (./eslint.config.mjs) for rules
|
|
73
|
-
npm run lint
|
|
74
|
-
|
|
75
|
-
# Validates lint with warnings
|
|
76
|
-
npm run lint:verbose
|
|
77
|
-
|
|
78
|
-
# Runs test cases
|
|
79
|
-
npm run test
|
|
80
|
-
|
|
81
|
-
# Exports coverage report, @see (./coverage/lcov-report/index.html)
|
|
82
|
-
npm run coverage
|
|
83
|
-
|
|
84
|
-
# Finds outdated/legacy dependencies
|
|
85
|
-
npm outdated
|
|
86
|
-
```
|
|
61
|
+
- [Component Commands](https://github.com/samet-digital/help/blob/main/commands-component.MD)
|
|
87
62
|
|
|
88
63
|
## Standards
|
|
89
64
|
```diff
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.InitializationException = void 0;
|
|
4
4
|
// noinspection JSUnusedGlobalSymbols
|
|
5
5
|
const base_exception_1 = require("./base.exception");
|
|
6
|
+
// noinspection JSUnusedGlobalSymbols
|
|
6
7
|
class InitializationException extends base_exception_1.BaseException {
|
|
7
8
|
constructor(message) {
|
|
8
9
|
super(message, {}, 500);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PageNotFoundException = void 0;
|
|
4
4
|
const base_exception_1 = require("./base.exception");
|
|
5
|
+
// noinspection JSUnusedGlobalSymbols
|
|
5
6
|
class PageNotFoundException extends base_exception_1.BaseException {
|
|
6
7
|
constructor(path) {
|
|
7
8
|
super(`Path: ${path} is not found`, { path }, 404);
|