@zerotal/monitor 1.0.4 → 1.1.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/CHANGELOG.md +7 -1
- package/package.json +7 -7
- package/src/sources/live.ts +2 -1
- package/src/sources/system.ts +2 -1
- package/src/version.ts +25 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Changelog
|
|
1
|
+
# Changelog — @zerotal/monitor
|
|
2
2
|
|
|
3
3
|
All notable changes to this package are documented here. The format is
|
|
4
4
|
based on [Keep a Changelog](https://keepachangelog.com/); this package
|
|
@@ -8,6 +8,12 @@ follows the Zerotal monorepo's unified versioning.
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.1.0] — 2026-08-08
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **The reported framework version follows the release.** Two hardcoded version strings in `sources/live.ts` and `sources/system.ts` meant a monitored app reported whatever version was current when those lines were last edited. They now read the package's own manifest, which the lockstep release keeps correct.
|
|
16
|
+
|
|
11
17
|
## [1.0.3] — 2026-08-07
|
|
12
18
|
|
|
13
19
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerotal/monitor",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "experimental",
|
|
6
6
|
"private": false,
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"typecheck": "tsc --noEmit"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zerotal/core": "1.0
|
|
33
|
-
"@zerotal/flow-ui": "1.0
|
|
34
|
-
"@zerotal/flow": "1.0
|
|
32
|
+
"@zerotal/core": "1.1.0",
|
|
33
|
+
"@zerotal/flow-ui": "1.1.0",
|
|
34
|
+
"@zerotal/flow": "1.1.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@zerotal/queue": "1.0
|
|
38
|
-
"@zerotal/scheduler": "1.0
|
|
39
|
-
"@zerotal/telemetry": "1.0
|
|
37
|
+
"@zerotal/queue": "1.1.0",
|
|
38
|
+
"@zerotal/scheduler": "1.1.0",
|
|
39
|
+
"@zerotal/telemetry": "1.1.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@zerotal/queue": "^1.0.0",
|
package/src/sources/live.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* sample data so the panel stays populated and useful.
|
|
7
7
|
*/
|
|
8
8
|
import { Health } from "@zerotal/core/health";
|
|
9
|
+
import { ZEROTAL_VERSION } from "../version.ts";
|
|
9
10
|
import type {
|
|
10
11
|
CheckIn,
|
|
11
12
|
DeadJob,
|
|
@@ -232,7 +233,7 @@ export async function liveHealth(_app?: AppShape): Promise<HealthEntry[] | null>
|
|
|
232
233
|
try {
|
|
233
234
|
const report = await Health.run({
|
|
234
235
|
name: "app",
|
|
235
|
-
version:
|
|
236
|
+
version: ZEROTAL_VERSION,
|
|
236
237
|
environment: process.env.NODE_ENV ?? "production",
|
|
237
238
|
uptime: Math.floor(process.uptime()),
|
|
238
239
|
});
|
package/src/sources/system.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { cpus, loadavg, totalmem, freemem } from "node:os";
|
|
|
8
8
|
import { readFileSync } from "node:fs";
|
|
9
9
|
import { currentApp } from "@zerotal/core";
|
|
10
10
|
import { httpMetrics } from "@zerotal/core/metrics";
|
|
11
|
+
import { ZEROTAL_VERSION_TAG } from "../version.ts";
|
|
11
12
|
import type { Gauge, SystemMeta } from "../store/types.ts";
|
|
12
13
|
|
|
13
14
|
/** Bun's native in-flight HTTP count, or 0 when no server is bound (console/test). */
|
|
@@ -138,7 +139,7 @@ export function systemMeta(opts: {
|
|
|
138
139
|
typeof Bun !== "undefined" && Bun.version
|
|
139
140
|
? Bun.version
|
|
140
141
|
: (process.versions.bun ?? process.version.replace(/^v/, "")),
|
|
141
|
-
zerotal: opts.zerotal ??
|
|
142
|
+
zerotal: opts.zerotal ?? ZEROTAL_VERSION_TAG,
|
|
142
143
|
region: opts.region ?? process.env.FLY_REGION ?? process.env.AWS_REGION ?? "local",
|
|
143
144
|
deploy: opts.deploy ?? process.env.DEPLOY_SHA?.slice(0, 7) ?? "dev",
|
|
144
145
|
environment: process.env.APP_ENV ?? process.env.NODE_ENV ?? "development",
|
package/src/version.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The framework version this package reports.
|
|
3
|
+
*
|
|
4
|
+
* Read rather than written down. Two hardcoded `"1.0.4"` strings lived in
|
|
5
|
+
* `sources/live.ts` and `sources/system.ts`, and a hardcoded version is only ever
|
|
6
|
+
* correct until the next release: after 1.0.0 shipped, three separate literals across
|
|
7
|
+
* the monorepo still said `1.1.0`, each failing silently — a monitored app cheerfully
|
|
8
|
+
* reported a version that had never been published.
|
|
9
|
+
*
|
|
10
|
+
* The monorepo publishes in lockstep, so this package's own manifest carries the
|
|
11
|
+
* framework version, and it ships inside the tarball — which the repository root does
|
|
12
|
+
* not. The release script verifies the root version against the tag, so this follows
|
|
13
|
+
* the thing that is actually checked at publish time.
|
|
14
|
+
*/
|
|
15
|
+
import { readFileSync } from "node:fs";
|
|
16
|
+
|
|
17
|
+
const pkg: { version: string } = JSON.parse(
|
|
18
|
+
readFileSync(new URL("../package.json", import.meta.url), "utf8"),
|
|
19
|
+
) as { version: string };
|
|
20
|
+
|
|
21
|
+
/** Full version, e.g. `1.1.0`. */
|
|
22
|
+
export const ZEROTAL_VERSION: string = pkg.version;
|
|
23
|
+
|
|
24
|
+
/** Display form used by the system panel, e.g. `v1.1.0`. */
|
|
25
|
+
export const ZEROTAL_VERSION_TAG = `v${pkg.version}`;
|