@lucaapp/service-utils 1.62.6 → 1.63.0
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 +47 -22
- package/dist/lib/kafka/events/reservation.d.ts +5 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
## service-utils
|
|
2
2
|
|
|
3
|
-
`service-utils`
|
|
4
|
-
|
|
3
|
+
`service-utils` is a shared package that provides functionality for backend
|
|
4
|
+
services to reduce code duplication. It includes utilities for:
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
- Logging and monitoring
|
|
7
|
+
- API validation and OpenAPI documentation
|
|
8
|
+
- Error handling
|
|
9
|
+
- Database operations
|
|
10
|
+
- Authentication and authorization
|
|
11
|
+
- Kafka messaging
|
|
12
|
+
- HTTP client operations
|
|
13
|
+
- And more
|
|
7
14
|
|
|
8
|
-
Development
|
|
9
|
-
Therefore, some adoptions and preparations are necessary.
|
|
10
|
-
Follow these steps for initial setup:
|
|
15
|
+
### Development Setup
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
1. Navigate to `packages/service-utils`
|
|
18
|
+
2. Run `yarn link`
|
|
19
|
+
3. Navigate to `services/backend`
|
|
20
|
+
4. Run `yarn link @lucaapp/service-utils`
|
|
16
21
|
|
|
17
|
-
This will connect your local sources for `@lucaapp/service-utils`.
|
|
18
|
-
|
|
22
|
+
This will connect your local sources for `@lucaapp/service-utils`. When making
|
|
23
|
+
changes:
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
1. Run `yarn build` in `packages/service-utils` to compile changes
|
|
26
|
+
2. Run `yarn package-development` in `services/backend` to test changes
|
|
27
|
+
|
|
28
|
+
Required environment variables for local development:
|
|
22
29
|
|
|
23
30
|
```shell
|
|
24
31
|
export DB_HOSTNAME=localhost
|
|
@@ -26,16 +33,34 @@ export KAFKA_BROKER=localhost:9094
|
|
|
26
33
|
export REDIS_HOSTNAME=localhost
|
|
27
34
|
```
|
|
28
35
|
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
Ensure your docker stack has `database`, `kafka`, and `redis` running (but not
|
|
37
|
+
`backend`).
|
|
38
|
+
|
|
39
|
+
### Available Scripts
|
|
40
|
+
|
|
41
|
+
- `yarn build` - Compile TypeScript to JavaScript
|
|
42
|
+
- `yarn ts:check` - Type check without emitting files
|
|
43
|
+
- `yarn lint` - Run ESLint
|
|
44
|
+
- `yarn test` - Run tests with Vitest
|
|
45
|
+
- `yarn test:coverage` - Run tests with coverage report
|
|
46
|
+
- `yarn test:ci` - Run tests in CI environment
|
|
47
|
+
- `yarn audit` - Run security audit (ignoring dev dependencies)
|
|
48
|
+
|
|
49
|
+
### Publishing
|
|
31
50
|
|
|
32
|
-
|
|
51
|
+
The package is automatically published when changes are merged to `dev`. Follow
|
|
52
|
+
[semantic-release](https://www.npmjs.com/package/semantic-release) conventions
|
|
53
|
+
in commit messages to trigger appropriate versioning.
|
|
33
54
|
|
|
34
|
-
|
|
55
|
+
### Dependencies
|
|
35
56
|
|
|
36
|
-
|
|
37
|
-
See `./gitlab-ci/publish[.template].yml` for reference.
|
|
57
|
+
The package uses modern versions of key dependencies:
|
|
38
58
|
|
|
39
|
-
|
|
59
|
+
- TypeScript 5.5.3
|
|
60
|
+
- Node.js 18
|
|
61
|
+
- Express 4.21.2
|
|
62
|
+
- Sequelize 6.32.0
|
|
63
|
+
- Zod 3.22.3
|
|
64
|
+
- Vitest 3.0.5 for testing
|
|
40
65
|
|
|
41
|
-
|
|
66
|
+
See `package.json` for a complete list of dependencies.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucaapp/service-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.63.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@types/node": "18.18.2",
|
|
28
28
|
"@types/response-time": "^2.3.8",
|
|
29
29
|
"@types/swagger-ui-express": "4.1.3",
|
|
30
|
-
"axios": "^1.
|
|
30
|
+
"axios": "^1.8.2",
|
|
31
31
|
"busboy": "^1.6.0",
|
|
32
32
|
"cls-rtracer": "^2.6.2",
|
|
33
33
|
"express": "4.21.2",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"swagger-ui-express": "5.0.1",
|
|
48
48
|
"url-value-parser": "^2.2.0",
|
|
49
49
|
"uuid": "^9.0.0",
|
|
50
|
-
"zod": "3.22.3"
|
|
50
|
+
"zod": "3.22.3",
|
|
51
|
+
"@apidevtools/swagger-parser": "10.0.3"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@types/busboy": "^1.5.3",
|
|
@@ -82,6 +83,7 @@
|
|
|
82
83
|
"cookie": ">= 0.7.0",
|
|
83
84
|
"string-width": "4.2.3",
|
|
84
85
|
"@types/express": "4.17.15",
|
|
85
|
-
"esbuild": "^0.25.0"
|
|
86
|
+
"esbuild": "^0.25.0",
|
|
87
|
+
"axios": "^1.8.2"
|
|
86
88
|
}
|
|
87
89
|
}
|