@mereb/shared-packages 0.0.40 → 0.0.41
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 +39 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,44 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mereb/shared-packages
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared backend package consumed by `svc-*` services. It centralizes common auth, config, logging, telemetry, Kafka, Redis, event envelope, and media helper utilities.
|
|
4
|
+
|
|
5
|
+
## What this package exports
|
|
6
|
+
|
|
7
|
+
Primary root exports from `src/index.ts`:
|
|
8
|
+
|
|
9
|
+
- `auth/jwks`: JWT verification helpers (`verifyJwt`, header parsing helpers)
|
|
10
|
+
- `config/env`: env loading and typed env access (`loadEnv`, `getEnv`, `loadThenGetEnvs`, ...)
|
|
11
|
+
- `logger`: pino logger setup + Fastify logger options
|
|
12
|
+
- `observability/otel`: OpenTelemetry bootstrap helpers
|
|
13
|
+
- `messaging/kafka`: Kafka client/config helpers
|
|
14
|
+
- `cache/redis`: Redis client helpers
|
|
15
|
+
- `events/envelope` and `events/publisher`: integration event envelopes + publish helpers
|
|
16
|
+
- `media/s3`: media URL and upload-key helpers
|
|
17
|
+
|
|
18
|
+
Extra testing exports:
|
|
19
|
+
|
|
20
|
+
- `@mereb/shared-packages/testing/db`
|
|
21
|
+
- `@mereb/shared-packages/testing/kafka`
|
|
22
|
+
- `@mereb/shared-packages/testing/oidc`
|
|
4
23
|
|
|
5
24
|
## Local development
|
|
6
25
|
|
|
7
26
|
```bash
|
|
8
|
-
pnpm install
|
|
9
27
|
pnpm --filter @mereb/shared-packages lint
|
|
10
28
|
pnpm --filter @mereb/shared-packages typecheck
|
|
29
|
+
pnpm --filter @mereb/shared-packages test
|
|
11
30
|
pnpm --filter @mereb/shared-packages build
|
|
12
31
|
```
|
|
13
32
|
|
|
14
|
-
|
|
33
|
+
Build output is written to `dist/`.
|
|
15
34
|
|
|
16
|
-
##
|
|
35
|
+
## Versioning and publishing
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
Version is controlled in `package.json` and published as `@mereb/shared-packages`.
|
|
19
38
|
|
|
20
|
-
|
|
21
|
-
2. **Push to `main`** – Jenkins runs the branch build. After it lints/builds, the `release.autoTag` stage (configured with `allowDirty: true` because the build leaves `node_modules/` around) creates and pushes the next `v<semver>` tag.
|
|
22
|
-
3. **Release stages** – in the same build, the new `releaseStages` block uses that tag (`RELEASE_TAG`) to run `pnpm publish` and then the `release.github` stage publishes release notes.
|
|
23
|
-
4. **Jenkins job** – create a Multibranch Pipeline pointing at this repository. Tags are optional now, but still enable tag discovery if you want Jenkins to react to manual tags.
|
|
24
|
-
5. **Credentials** – add an `npm-registry-token` secret text credential in Jenkins for npm publish, plus `github-credentials` for tagging/GitHub releases. The pipeline writes the npm token to `.npmrc` during the publish stage.
|
|
25
|
-
6. **Registry override (optional)** – set the job environment variable `NPM_REGISTRY` if you publish somewhere other than `https://registry.npmjs.org`.
|
|
39
|
+
Bump version:
|
|
26
40
|
|
|
27
|
-
|
|
41
|
+
```bash
|
|
42
|
+
pnpm --filter @mereb/shared-packages version:bump
|
|
43
|
+
```
|
|
28
44
|
|
|
29
|
-
|
|
45
|
+
Optional bump type:
|
|
30
46
|
|
|
31
|
-
|
|
47
|
+
```bash
|
|
48
|
+
pnpm --filter @mereb/shared-packages version:bump minor
|
|
49
|
+
pnpm --filter @mereb/shared-packages version:bump major
|
|
50
|
+
```
|
|
32
51
|
|
|
33
|
-
|
|
52
|
+
The repository includes Jenkins + `.ci/ci.yml` automation for tag/release/publish flow.
|
|
34
53
|
|
|
35
|
-
|
|
54
|
+
## Manual publish fallback
|
|
36
55
|
|
|
37
56
|
```bash
|
|
38
57
|
cd services/shared
|
|
39
58
|
pnpm install
|
|
40
|
-
pnpm lint
|
|
59
|
+
pnpm lint
|
|
60
|
+
pnpm typecheck
|
|
61
|
+
pnpm build
|
|
41
62
|
NPM_TOKEN=... pnpm publish --registry https://registry.npmjs.org --no-git-checks
|
|
42
63
|
```
|
|
43
|
-
|
|
44
|
-
Ensure the git tag matches the package version before publishing so the CI job can take over again on the next release.
|